private static DiffEntry diffFile(Repository repo, String oldCommit,
String newCommit, String path) throws IOException, GitAPIException {
Config config = new Config();
config.setBoolean("diff", null, "renames", true);
DiffConfig diffConfig = config.get(DiffConfig.KEY);
List<DiffEntry> diffList = new Git(repo).diff().
setOldTree(prepareTreeParser(repo, oldCommit)).
setNewTree(prepareTreeParser(repo, newCommit)).
setPathFilter(FollowFilter.create(path, diffConfig)).
call();