Examples of call()


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

        if (startPoint != null && !startPoint.isEmpty()) {
          cc.setStartPoint(startPoint);
          cc.setUpstreamMode(SetupUpstreamMode.TRACK);
        }

        Ref ref = cc.call();

        URI cloneLocation = BaseToCloneConverter.getCloneLocation(getURI(request), BaseToCloneConverter.BRANCH_LIST);
        JSONObject result = new Branch(cloneLocation, db, ref).toJSON();
        OrionServlet.writeJSONResponse(request, response, result, JsonURIUnqualificationStrategy.ALL_NO_GIT);
        response.setHeader(ProtocolConstants.HEADER_LOCATION, result.getString(ProtocolConstants.KEY_LOCATION));
View Full Code Here

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

      if (gitSegment != null) {
        DeleteBranchCommand cc = git.branchDelete();
        cc.setBranchNames(gitSegment);
        // TODO: the force flag should be passed in the API call
        cc.setForce(true);
        cc.call();

        // TODO: do something with the result
        return true;
      }
      return false;
View Full Code Here

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

    DescribeCommand cmd = new Git(db).describe();
    if (tree != null)
      cmd.setTarget(tree);
    String result = null;
    try {
      result = cmd.call();
    } catch (RefNotFoundException e) {
      throw die(CLIText.get().noNamesFound, e);
    }
    if (result == null)
      throw die(CLIText.get().noNamesFound);
View Full Code Here

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

      fetch.setDryRun(dryRun);
      fetch.setRemote(remote);
      fetch.setThin(thin);
      fetch.setProgressMonitor(new TextProgressMonitor());

      FetchResult result = fetch.call();
      return result;
   }

   /**
    * Initialize a new git repository.
View Full Code Here

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

  protected void runImpl() throws IOException, Failure {
    try {
      GarbageCollectCommand gc = Git.wrap(repo).gc();
      logGcInfo("before:", gc.getStatistics());
      gc.setProgressMonitor(NullProgressMonitor.INSTANCE);
      Properties statistics = gc.call();
      logGcInfo("after: ", statistics);
    } catch (Exception e) {
      throw new Failure(1, "fatal: Cannot run gc: ", e);
    }
  }
View Full Code Here

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

      FileResource<?> gitDir = project.getProjectRoot().getChildDirectory(".git").reify(FileResource.class);
      if(!gitDir.exists())
      {
         InitCommand init = Git.init();
         init.setDirectory(project.getProjectRoot().getUnderlyingResourceObject());
         init.call();
      }

      return true;
   }
View Full Code Here

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

        command.setListMode(ListMode.REMOTE);

      if (containsCommitish != null)
        command.setContains(containsCommitish);

      List<Ref> refs = command.call();
      for (Ref ref : refs) {
        if (ref.getName().equals(Constants.HEAD))
          addRef("(no branch)", head); //$NON-NLS-1$
      }
View Full Code Here

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

        throw die(MessageFormat.format(CLIText.get().tagAlreadyExists,
            tagName));
      }
    } else {
      ListTagCommand command = git.tagList();
      List<Ref> list = command.call();
      for (Ref ref : list) {
        outw.println(Repository.shortenRefName(ref.getName()));
      }
    }
  }
View Full Code Here

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

              toObjectId = getCommitObjectId(db, toObjectId);

              // set the commit range
              lc.add(toObjectId);
              lc.setMaxCount(this.commitsSize);
              Iterable<RevCommit> commits = lc.call();
              Log log = new Log(cloneLocation, db, commits, null, null, toRefId);
              log.setPaging(1, commitsSize);
              branch.put(GitConstants.KEY_TAG_COMMIT, log.toJSON());
              newChildren.put(branch);
            }
View Full Code Here

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

    LsRemoteCommand cmd = git.lsRemote().setRemote(repoURL);
    if (credentialsProvider != null) {
      cmd.setCredentialsProvider(credentialsProvider);
    }
    try {
      Collection<Ref> collection = cmd.call();
      List<String> refNames = new ArrayList<String>();
      if (collection != null) {
        for (Ref ref : collection) {
          if (log.isDebugEnabled()) {
            log.debug(repoURL + ": " + ref.getName());
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.