/* Mark all branch commits */
for (Entry<Id, Id> entry : tmpBranches.entrySet()) {
Id branchRootId = entry.getKey();
Id branchHeadId = entry.getValue();
while (!branchHeadId.equals(branchRootId)) {
StoredCommit commit = getCommit(branchHeadId);
markCommit(commit);
branchHeadId = commit.getParentId();
}
}
/* Mark all master commits till the first branch root id */
if (!tmpBranches.isEmpty()) {
Id firstBranchRootId = tmpBranches.keySet().iterator().next();
StoredCommit commit = getHeadCommit();
for (;;) {
markCommit(commit);
if (commit.getId().equals(firstBranchRootId)) {
break;
}
commit = getCommit(commit.getParentId());
}
return firstBranchRootId;
}
return null;
}