I can get an indication that a file was Added, Modified or Deleted using the git log --pretty=format: --name-status command.
What part of the JGit API would give me access to this status?
For example, the jGit cookbook does give an example of getting file modes:
TreeWalk treeWalk = new TreeWalk(repository);
treeWalk.addTree(tree);
treeWalk.setRecursive(false);
treeWalk.setFilter(PathFilter.create("src"));
if (!treeWalk.next()) {
throw new IllegalStateException("Did not find expected file 'README.md'");
}
// FileMode now indicates that this is a directory, i.e. FileMode.TREE.equals(fileMode) holds true
FileMode fileMode = treeWalk.getFileMode(0);
Where your can get info of the type of file from:
FileMode.REGULAR_FILE
I have looked at the API documentation at org.eclipse.jgit.lib.AnyObjectId
etc. but am not finding an obvious path to where the API would provide information about the operation being an Add, Delete or Modification on the file in the commit.