Fix checkout of target branch

This commit is contained in:
René Pfeuffer
2018-12-10 08:59:19 +01:00
parent 6193c1edda
commit 8b518d320d

View File

@@ -95,9 +95,10 @@ public class GitMergeCommand extends AbstractGitCommand implements MergeCommand
}
}
private void checkOutTargetBranch() {
private void checkOutTargetBranch() throws IOException {
try {
clone.checkout().setName(target).call();
ObjectId targetRevision = resolveRevision(target);
clone.checkout().setName(targetRevision.getName()).call();
} catch (RefNotFoundException e) {
logger.debug("could not checkout target branch {} for merge", target, e);
throw notFound(entity("revision", target).in(context.getRepository()));