VersionAttributeView vinit = ioService.getFileAttributeView( branchPath, VersionAttributeView.class );
List<VersionRecord> logs = vinit.readAttributes().history().records();
List<CommitInfo> commits = new ArrayList<CommitInfo>();
JGitFileSystem fs = (JGitFileSystem)ioService.getFileSystem(branchPath.toUri());
Collections.reverse(logs);
for (VersionRecord commit : logs) {
// check if there are already commits in compare to branch
if (existingCommits.contains(commit.id())) {
continue;
}
String shortMessage = commit.comment();
Date commitDate = commit.date();
if (startCommitDate != null && startCommitDate.after(commitDate)) {
break;
}
List<String> files = getFilesInCommit(fs.gitRepo().getRepository(), JGitUtil.resolveObjectId(fs.gitRepo(), commit.id()));
CommitInfo commitInfo = new CommitInfo(commit.id(), shortMessage, commit.author(), commitDate, files);
commits.add(commitInfo);
logger.debug("Found commit {}", commitInfo);
}