Package org.eclipse.jgit.revwalk

Examples of org.eclipse.jgit.revwalk.RevWalk.parseBody()


    try {
      for (int i = 0; i < commits.length; i++)
        walk.markStart(walk.parseCommit(commits[i]));
      final RevCommit base = walk.next();
      if (base != null)
        walk.parseBody(base);
      return base;
    } catch (IOException e) {
      throw new GitException(e, repository);
    } finally {
      walk.release();
View Full Code Here


    // Load parents
    RevWalk walk = new RevWalk(db);
    try {
      for (RevCommit parent : commit.getParents())
        walk.parseBody(parent);
    } finally {
      walk.release();
    }

    assertEquals(1, commit.getParent(1).getParentCount());
View Full Code Here

    writeTrashFile("file", "content2");
    RevCommit stashedWorkTree = Git.wrap(db).stashCreate().call();
    validateStashedCommit(stashedWorkTree);
    RevWalk walk = new RevWalk(db);
    RevCommit stashedIndex = stashedWorkTree.getParent(1);
    walk.parseBody(stashedIndex);
    walk.parseBody(stashedIndex.getTree());
    walk.parseBody(stashedIndex.getParent(0));
    List<DiffEntry> workTreeStashAgainstWorkTree = diffWorkingAgainstHead(stashedWorkTree);
    assertEquals(1, workTreeStashAgainstWorkTree.size());
    List<DiffEntry> workIndexAgainstWorkTree = diffIndexAgainstHead(stashedWorkTree);
View Full Code Here

    RevCommit stashedWorkTree = Git.wrap(db).stashCreate().call();
    validateStashedCommit(stashedWorkTree);
    RevWalk walk = new RevWalk(db);
    RevCommit stashedIndex = stashedWorkTree.getParent(1);
    walk.parseBody(stashedIndex);
    walk.parseBody(stashedIndex.getTree());
    walk.parseBody(stashedIndex.getParent(0));
    List<DiffEntry> workTreeStashAgainstWorkTree = diffWorkingAgainstHead(stashedWorkTree);
    assertEquals(1, workTreeStashAgainstWorkTree.size());
    List<DiffEntry> workIndexAgainstWorkTree = diffIndexAgainstHead(stashedWorkTree);
    assertEquals(1, workIndexAgainstWorkTree.size());
View Full Code Here

    validateStashedCommit(stashedWorkTree);
    RevWalk walk = new RevWalk(db);
    RevCommit stashedIndex = stashedWorkTree.getParent(1);
    walk.parseBody(stashedIndex);
    walk.parseBody(stashedIndex.getTree());
    walk.parseBody(stashedIndex.getParent(0));
    List<DiffEntry> workTreeStashAgainstWorkTree = diffWorkingAgainstHead(stashedWorkTree);
    assertEquals(1, workTreeStashAgainstWorkTree.size());
    List<DiffEntry> workIndexAgainstWorkTree = diffIndexAgainstHead(stashedWorkTree);
    assertEquals(1, workIndexAgainstWorkTree.size());
    List<DiffEntry> indexStashAgainstWorkTree = diffIndexAgainstWorking(stashedWorkTree);
View Full Code Here

      try {
        RevObject obj = rw.parseAny(objectId);
        while (obj instanceof RevTag) {
          show((RevTag) obj);
          obj = ((RevTag) obj).getObject();
          rw.parseBody(obj);
        }

        switch (obj.getType()) {
        case Constants.OBJ_COMMIT:
          show(rw, (RevCommit) obj);
View Full Code Here

    Git git = new Git(db);
    RevWalk walk = new RevWalk(db);
    try {
      ObjectId objectId = db.resolve(commitId);
      RevCommit revCommit = walk.lookupCommit(objectId);
      walk.parseBody(revCommit);

      GitTagHandlerV1.tag(git, revCommit, tagName);

      URI cloneLocation = BaseToCloneConverter.getCloneLocation(getURI(request), BaseToCloneConverter.COMMIT_REFRANGE);
      Commit commit = new Commit(cloneLocation, db, revCommit, null);
View Full Code Here

                RevCommit base = walk.next();
                reporter.debugText(getCommandName(),"checking if remote is at our merge base");
                if (null != base)
                {
                    walk.parseBody(base);

                    //remote is behind
                    if (remoteCommit.equals(base))
                    {
                        reporter.debugText(getCommandName(),"remote equals merge base, branch is newer");
View Full Code Here

      TreeWalk treewalk = new TreeWalk(revWalk.getObjectReader());
      treewalk.setRecursive(true);
      treewalk.setFilter(TreeFilter.ANY_DIFF);
      try {
        for (RevCommit parent : commit.getParents())
          revWalk.parseBody(parent);
        diffs = FileDiff.compute(repository, treewalk, commit, parents,
            TreeFilter.ALL);
      } catch (IOException e) {
        diffs = new FileDiff[0];
      } finally {
View Full Code Here

  private void loadParents() throws IOException {
    RevWalk revWalk = new RevWalk(repository);
    try {
      for (RevCommit parent : commit.getParents())
        revWalk.parseBody(parent);
    } finally {
      revWalk.release();
    }
  }
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.