Merge "Allow use theirs merge strategy to snap back to previous commit"

This commit is contained in:
Shawn Pearce
2016-09-18 15:24:24 +00:00
committed by Gerrit Code Review

View File

@@ -213,7 +213,8 @@ public class MergeUtil {
PersonIdent committerIndent, String commitMsg, RevWalk rw)
throws IOException, MergeIdenticalTreeException, MergeConflictException {
if (rw.isMergedInto(originalCommit, mergeTip)) {
if (!MergeStrategy.THEIRS.getName().equals(mergeStrategy) &&
rw.isMergedInto(originalCommit, mergeTip)) {
throw new ChangeAlreadyMergedException(
"'" + originalCommit.getName() + "' has already been merged");
}