Skip to content
Snippets Groups Projects
Commit ef56db95 authored by Florian Heck's avatar Florian Heck
Browse files

report failed merge with default strategy as such

parent 965ec5fa
No related branches found
No related tags found
No related merge requests found
......@@ -23,6 +23,10 @@ public class DefaultMergeStrategy implements MergeStrategy {
@Override
public Optional<Status> merge(Reference left, Reference right) {
Optional<ProcessExecutor.ExecRes> mergeBase = repo.getGit().exec(repo.getDir(), "merge", "-n", "-q", right.getId());
if (mergeBase.isPresent() && mergeBase.get().failed()) {
// merge failed, and we don't want to know the state of the repo at the parent
return Optional.empty();
}
return mergeBase.flatMap(res -> repo.getStatus());
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment