Skip to content

Instantly share code, notes, and snippets.

@steos
Created February 1, 2011 15:17
Show Gist options
  • Save steos/805992 to your computer and use it in GitHub Desktop.
Save steos/805992 to your computer and use it in GitHub Desktop.
jgit: walk tree at specific revision
RevWalk rw = new RevWalk(repo);
RevCommit rev = rw.parseCommit(repo.resolve("HEAD"));
RevTree rt = rev.getTree();
TreeWalk tw = new TreeWalk(repo);
tw.addTree(rt);
tw.setRecursive(true);
while (tw.next()) {
System.out.println(tw.getPathString());
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment