Community
Participate
Working Groups
DiffCommand has the following methods for controlling what should be compared: setOldTree(AbstractTreeIterator oldTree) setNewTree(AbstractTreeIterator newTree) For doing a simple "git diff HEAD", the caller needs to do this to get oldTree: ObjectId head = repo.resolve(Constants.HEAD + "^{tree}"); CanonicalTreeParser oldTree = new CanonicalTreeParser(); ObjectReader reader = db.newObjectReader(); try { oldTree.reset(reader, head); } finally { reader.release(); } Instead, we should have API that allows the caller to pass a String which we resolve to a tree, e.g. "HEAD", or "master".
This should be pretty simple to implement, added keywords. Patches welcome!