Skip to content

Commit f08110d

Browse files
dschogitster
authored andcommitted
rebase -r: demonstrate bug with conflicting merges
When calling `merge` on a branch that has already been merged, that `merge` is skipped quietly, but currently a MERGE_HEAD file is being left behind and will then be grabbed by the next `pick` (that did not want to create a *merge* commit). Demonstrate this. Signed-off-by: Johannes Schindelin <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 8858448 commit f08110d

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

t/t3430-rebase-merges.sh

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -396,4 +396,20 @@ test_expect_success 'with --autosquash and --exec' '
396396
grep "G: +G" actual
397397
'
398398

399+
test_expect_failure '--continue after resolving conflicts after a merge' '
400+
git checkout -b already-has-g E &&
401+
git cherry-pick E..G &&
402+
test_commit H2 &&
403+
404+
git checkout -b conflicts-in-merge H &&
405+
test_commit H2 H2.t conflicts H2-conflict &&
406+
test_must_fail git rebase -r already-has-g &&
407+
grep conflicts H2.t &&
408+
echo resolved >H2.t &&
409+
git add -u &&
410+
git rebase --continue &&
411+
test_must_fail git rev-parse --verify HEAD^2 &&
412+
test_path_is_missing .git/MERGE_HEAD
413+
'
414+
399415
test_done

0 commit comments

Comments
 (0)