mirror of
https://github.com/scm-manager/scm-manager.git
synced 2026-03-04 03:10:50 +01:00
added message to NoCommonHistoryException
This commit is contained in:
@@ -8,7 +8,11 @@ import static java.util.Collections.emptyList;
|
||||
public class NoCommonHistoryException extends BadRequestException {
|
||||
|
||||
public NoCommonHistoryException() {
|
||||
super(emptyList(), "no common history");
|
||||
this("no common history");
|
||||
}
|
||||
|
||||
public NoCommonHistoryException(String message) {
|
||||
super(emptyList(), message);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -735,7 +735,8 @@ public final class GitUtil
|
||||
mergeBaseWalk.markStart(mergeBaseWalk.parseCommit(revision2));
|
||||
RevCommit ancestor = mergeBaseWalk.next();
|
||||
if (ancestor == null) {
|
||||
throw new NoCommonHistoryException();
|
||||
String msg = "revisions %s and %s are not related and therefore do not have a common ancestor";
|
||||
throw new NoCommonHistoryException(String.format(msg, revision1.name(), revision2.name()));
|
||||
}
|
||||
return ancestor.getId();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user