Package org.eclipse.jgit.api

Examples of org.eclipse.jgit.api.StashCreateCommand


    boolean includeUntracked = requestPayload.optBoolean(GitConstants.KEY_STASH_INCLUDE_UNTRACKED, false);

    try {

      Git git = new Git(db);
      StashCreateCommand stashCreate = git.stashCreate();
      stashCreate.setPerson(new PersonIdent(db));
      stashCreate.setIncludeUntracked(includeUntracked);

      if (!indexMessage.isEmpty())
        stashCreate.setIndexMessage(indexMessage);

      if (!workingDirectoryMessage.isEmpty())
        stashCreate.setWorkingDirectoryMessage(workingDirectoryMessage);

      stashCreate.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 {
        try {
          StashCreateCommand command = Git.wrap(repository).stashCreate();
          if (message != null)
            command.setWorkingDirectoryMessage(message);
          command.setIncludeUntracked(includeUntracked);
          commit = command.call();
        } catch (JGitInternalException e) {
          throw new TeamException(e.getLocalizedMessage(),
              e.getCause());
        } catch (GitAPIException e) {
          throw new TeamException(e.getLocalizedMessage(),
View Full Code Here

TOP

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

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.