Package org.eclipse.jgit.api

Examples of org.eclipse.jgit.api.StashDropCommand


        /* git stash pop */
        applyCommand.setApplyUntracked(applyUntracked);
        applyCommand.setApplyIndex(applyIndex);
        applyCommand.call();

        StashDropCommand dropCommand = git.stashDrop();
        dropCommand.setAll(false);
        dropCommand.call();

      }

      return true;

View Full Code Here


      if (isStashEmpty(git)) {
        String msg = "Failed to drop stashed changes due to an empty stash.";
        return statusHandler.handleRequest(request, response, new ServerStatus(IStatus.WARNING, HttpServletResponse.SC_BAD_REQUEST, msg, null));
      }

      StashDropCommand dropCommand = git.stashDrop();

      if (stashRev != null) {

        StashRef stashRef = getStashRef(git, stashRev);
        if (stashRef == null) {
          String msg = NLS.bind("Invalid stash reference {0}.", stashRev);
          return statusHandler.handleRequest(request, response, new ServerStatus(IStatus.ERROR, HttpServletResponse.SC_BAD_REQUEST, msg, null));
        }

        dropCommand.setStashRef(stashRef.getRef());

      } else
        dropCommand.setAll(true);

      dropCommand.call();
      return true;

    } catch (Exception ex) {
      String msg = "An error occured for stash command.";
      return statusHandler.handleRequest(request, response, new ServerStatus(IStatus.ERROR, HttpServletResponse.SC_INTERNAL_SERVER_ERROR, msg, ex));
View Full Code Here

  public void execute(IProgressMonitor monitor) throws CoreException {
    IWorkspaceRunnable action = new IWorkspaceRunnable() {

      public void run(IProgressMonitor pm) throws CoreException {
        pm.beginTask("", 1); //$NON-NLS-1$
        StashDropCommand command = Git.wrap(repo).stashDrop();
        command.setStashRef(index);
        try {
          command.call();
          repo.fireEvent(new RefsChangedEvent());
        } catch (JGitInternalException e) {
          throw new TeamException(e.getLocalizedMessage(),
              e.getCause());
        } catch (GitAPIException e) {
View Full Code Here

TOP

Related Classes of org.eclipse.jgit.api.StashDropCommand

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.