Package org.eclipse.jgit.api

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


          ObjectId toCommitId = db.resolve(toCommitName);
          Ref toCommitRef = db.getRef(toCommitName);
          toCommitId = getCommitObjectId(db, toCommitId);
          lc.add(toCommitId);
          lc.setMaxCount(this.commitsSize);
          Iterable<RevCommit> commits = lc.call();
          Log log = new Log(cloneLocation, db, commits, null, null, toCommitRef);
          log.setPaging(1, commitsSize);
          children.put(tag.toJSON(log.toJSON()));
        }
      }
View Full Code Here

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

    op.execute(new NullProgressMonitor());

    assertEquals(2, countCommitsInHead());

    LogCommand log = new Git(testRepository.getRepository()).log();
    Iterable<RevCommit> logCommits = log.call();
    RevCommit latestCommit = logCommits.iterator().next();
    assertEquals("squashed", latestCommit.getFullMessage());
  }

  private int countCommitsInHead() throws GitAPIException {
View Full Code Here

    assertEquals("squashed", latestCommit.getFullMessage());
  }

  private int countCommitsInHead() throws GitAPIException {
    LogCommand log = new Git(testRepository.getRepository()).log();
    Iterable<RevCommit> commits = log.call();
    int result = 0;
    for (Iterator i = commits.iterator(); i.hasNext();) {
      i.next();
      result++;
    }
View Full Code Here

        try {
            RevCommit commit = walker.parseCommit(ref.getObjectId());
            LogCommand command = git.log();
            command.add(commit.getId());
            command.setMaxCount(12);
            for (RevCommit rev : command.call()) {
                commit = walker.parseCommit(rev);
                print(commit);
            }
        } finally {
            walker.dispose();
View Full Code Here

        command.setMaxCount(pageSize);

        // Add the first set of commits ...
        int actual = 0;
        String commitId = null;
        for (RevCommit commit : command.call()) {
            commitId = commit.getName();
            writer.addChild(spec.childId(commitId), commitId);
            ++actual;
        }
        if (actual == pageSize) {
View Full Code Here

            command.add(lastCommitId);
            command.setMaxCount(pageSize + 1);
            // Add the first set of commits ...
            int actual = 0;
            String commitId = null;
            for (RevCommit commit : command.call()) {
                commitId = commit.getName();
                if (commitId.equals(lastCommitIdName)) continue;
                writer.addChild(spec.childId(commitId), commitId);
                ++actual;
            }
View Full Code Here

    RewordCommitOperation op = new RewordCommitOperation(
        testRepository.getRepository(), commit, "new message");
    op.execute(new NullProgressMonitor());

    LogCommand log = new Git(testRepository.getRepository()).log();
    RevCommit newCommit = log.call().iterator().next();
    assertEquals("new message", newCommit.getFullMessage());
  }
}
View Full Code Here

    config.save();
  }

  private int countCommitsInHead() throws GitAPIException {
    LogCommand log = new Git(testRepository.getRepository()).log();
    Iterable<RevCommit> commits = log.call();
    int result = 0;
    for (Iterator i = commits.iterator(); i.hasNext();) {
      i.next();
      result++;
    }
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.