I want to get a list of changed/added/deleted files between revision XXXXXX and HEAD. This is what I have so far:
String oldHash = \"a97e5553e37a25bd1a3c99ea
You can get the tree id for HEAD and the hash by calling:
ObjectId head = repository.resolve("HEAD^{tree}");
and for the revision id:
ObjectId old = repository.resolve(oldHash + "^{tree}");
Once you have the tree ids you can create the tree iterators and get the diffs:
ObjectReader reader = repository.newObjectReader();
CanonicalTreeParser oldTreeIter = new CanonicalTreeParser();
oldTreeIter.reset(reader, oldId);
CanonicalTreeParser newTreeIter = new CanonicalTreeParser();
newTreeIter.reset(reader, headId);
List<DiffEntry> diffs= git.diff()
.setNewTree(newTreeIter)
.setOldTree(oldTreeIter)
.call();