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 <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Johannes Schindelin committed Nov 12, 2018 at 15:25 UTC f08110ddd84438f4a8d69c145fae7f65fc91940f
1 file changed +16
t/t3430-rebase-merges.sh
+16
@@ -396,4 +396,20 @@ test_expect_success 'with --autosquash and --exec' '
396 grep "G: +G" actual
397 '
398
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 +
415 test_done