Package org.eclipse.orion.server.git.jobs

Examples of org.eclipse.orion.server.git.jobs.StashApplyCommand


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

      StashApplyCommand applyCommand = new StashApplyCommand(db);

      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));
        }

        applyCommand.setStashRef(stashRef.getStringRef());
        applyCommand.setApplyUntracked(applyUntracked);
        applyCommand.setApplyIndex(applyIndex);
        applyCommand.call();

      } else {

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

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

View Full Code Here

TOP

Related Classes of org.eclipse.orion.server.git.jobs.StashApplyCommand

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.