Package org.eclipse.jgit.api

Examples of org.eclipse.jgit.api.ResetCommand.call()


    if (hard)
      mode = selectMode(mode, ResetType.HARD);
    if (mode == null)
      throw die("no reset mode set");
    command.setMode(mode);
    command.call();
  }

  private static ResetType selectMode(ResetType mode, ResetType want) {
    if (mode != null)
      throw die("reset modes are mutually exclusive, select one");
View Full Code Here


          return statusHandler.handleRequest(request, response, new ServerStatus(IStatus.ERROR, HttpServletResponse.SC_BAD_REQUEST, msg, null));
        }
        reset.addPath(projectRelativePath);
      }
      try {
        reset.call();
      } catch (GitAPIException e) {
        return statusHandler.handleRequest(request, response, new ServerStatus(IStatus.ERROR, HttpServletResponse.SC_BAD_REQUEST, e.getMessage(), e));
      }
      return true;
    }
View Full Code Here

    try {
      Git git = new Git(currentRepository);
      ResetCommand reset = git.reset();
      for (String path : paths)
        reset.addPath(path);
      reset.call();
    } catch (GitAPIException e) {
      Activator.handleError(e.getMessage(), e, true);
    }
  }
View Full Code Here

    ResetCommand reset = Git.wrap(repository).reset();
    reset.setMode(type);
    reset.setRef(refName);
    try {
      reset.call();
    } catch (GitAPIException e) {
      throw new TeamException(e.getLocalizedMessage(), e.getCause());
    }
    monitor.worked(1);
View Full Code Here

    public void onPostReceive(ReceivePack rp, Collection<ReceiveCommand> commands) {
        try {
            ResetCommand cmd = new Git(rp.getRepository()).reset();
            cmd.setMode(ResetType.HARD);
            cmd.setRef("master");
            cmd.call();
           
            WfUtil.deployAllToEngine();
        } catch (Exception e) {
            StringWriter sw = new StringWriter();
            e.printStackTrace(new PrintWriter(sw));
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.