Skip to content
Snippets Groups Projects
Commit 3e1c32a3 authored by Georg Seibt's avatar Georg Seibt :nerd:
Browse files

Merge remote-tracking branch 'origin/master'

parents ef5e2faa 54a020f2
No related branches found
No related tags found
No related merge requests found
......@@ -2,7 +2,7 @@ package de.uni_passau.fim.seibt.gitwrapper.repo;
import java.util.Optional;
import de.uni_passau.fim.seibt.gitwrapper.process.ProcessExecutor.ExecRes;
import static de.uni_passau.fim.seibt.gitwrapper.process.ProcessExecutor.ExecRes;
/**
* A {@link MergeStrategy} representing the default 'git merge' merge implementation.
......@@ -24,14 +24,8 @@ public class DefaultMergeStrategy implements MergeStrategy {
@Override
public Optional<Status> merge(Reference left, Reference right) {
Optional<ExecRes> mergeRes = repo.getGit().exec(repo.getDir(), "merge", "-n", "-q", right.getId());
if (mergeRes.isPresent() && mergeRes.get().failed()) {
// merge failed, and we don't want to know the state of the repo at the parent
return Optional.empty();
}
return mergeRes.flatMap(res -> repo.getStatus());
Optional<ExecRes> mergeBase = repo.getGit().exec(repo.getDir(), "merge", "-n", "-q", right.getId());
return mergeBase.flatMap(res -> repo.getStatus());
}
@Override
......
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