Fix submitting changes with commits that were already merged

Due to bugs it can happen that a change gets into an inconsistent
state where the commit of the last patch set is already merged into
the destination branch, but the change status is still NEW. In this
case the inconsistency should get resolved by submitting the change
again. The submit detects that the commit is already merged and then
only the change status is updated to MERGED.

This already worked for all cases except for Fast Forward Only if
several changes got merged, but stayed open. Then submitting the first
change again was not possible since the MergeUtil.canFastForward
claimed that the change was not mergeable.

Change-Id: I73641f02e58298baf6f13da27d37500a44ad6d2b
Signed-off-by: Edwin Kempin <ekempin@google.com>
This commit is contained in:
Edwin Kempin
2016-12-22 11:03:15 +01:00
parent e3db98f674
commit 3facbc6033
2 changed files with 97 additions and 1 deletions

View File

@@ -496,7 +496,8 @@ public class MergeUtil {
}
try {
return mergeTip == null || rw.isMergedInto(mergeTip, toMerge);
return mergeTip == null || rw.isMergedInto(mergeTip, toMerge)
|| rw.isMergedInto(toMerge, mergeTip);
} catch (IOException e) {
throw new IntegrationException("Cannot fast-forward test during merge", e);
}