BeanManager beanManager = CDIUtils.lookUpBeanManager(commandContext);
logger.debug("BeanManager " + beanManager);
IOService ioService = CDIUtils.createBean(IOService.class, beanManager, new NamedLiteral("ioStrategy"));
logger.debug("IoService " + ioService);
Path branchPath = ioService.get(URI.create("git://" + branchName + "@" + gitRepo));
if (compareToBranchName != null) {
Path compareToBranchPath = ioService.get(URI.create("git://" + compareToBranchName + "@" + gitRepo));
VersionAttributeView compareView = ioService.getFileAttributeView( compareToBranchPath, VersionAttributeView.class );
List<VersionRecord> compareLogs = compareView.readAttributes().history().records();
for (VersionRecord ccommit : compareLogs) {
if (startCommitDate != null && startCommitDate.after(ccommit.date())) {
break;
}
existingCommits.add(ccommit.id());
}
}
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