/** * Finds the common {@link RevCommit commit} ancestor of two commits. * * @return an {@link Optional} of the ancestor commit, or {@link Optional#absent()} if no common * ancestor was found */ @Override protected Optional<ObjectId> _call() { Preconditions.checkState(left != null, "Left commit has not been set."); Preconditions.checkState(right != null, "Right commit has not been set."); if (left.equals(right)) { // They are the same commit return Optional.of(left); } getProgressListener().started(); Optional<ObjectId> ancestor = findLowestCommonAncestor(left, right); getProgressListener().complete(); return ancestor; }
/** * Finds the common {@link RevCommit commit} ancestor of two commits. * * @return an {@link Optional} of the ancestor commit, or {@link Optional#absent()} if no common * ancestor was found */ @Override protected Optional<ObjectId> _call() { Preconditions.checkState(left != null, "Left commit has not been set."); Preconditions.checkState(right != null, "Right commit has not been set."); if (left.equals(right)) { // They are the same commit return Optional.of(left); } getProgressListener().started(); Optional<ObjectId> ancestor = findLowestCommonAncestor(left, right); getProgressListener().complete(); return ancestor; }