t3404: decouple some test cases from outcomes of previous test cases

Originally, the `--preserve-merges` option of the `git rebase` command piggy-backed on top of the `--interactive` feature. For that reason, the early test cases were added to the very same test script that contains the `git rebase -i` tests: `t3404-rebase-interactive.sh`. However, since c42abfe7857 (rebase: introduce a dedicated backend for --preserve-merges, 2018-05-28), the `--preserve-merges` feature got its own backend, in preparation for converting the rest of the `--interactive` code to built-in code, written in C rather than shell. The reason why the `--preserve-merges` feature was not converted at the same time is that we have something much better now: `--rebase-merges`. That option intends to supersede `--preserve-merges`, and we will probably deprecate the latter soon. Once `--preserve-merges` has been deprecated for a good amount of time, it will be time to remove it, and along with it, its tests. In preparation for that, let's make the rest of the test cases in `t3404-rebase-interactive.sh` independent of the test cases dedicated to `--preserve-merges`. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Johannes Schindelin committed Oct 31, 2018 at 13:01 UTC 6c8fbae619da9ab2066c0d0e74de79f90c998118
1 file changed +8 -7
t/t3404-rebase-interactive.sh
+8 -7
@@ -387,6 +387,7 @@ test_expect_success 'edit ancestor with -p' '
387 '
388
389 test_expect_success '--continue tries to commit' '
390 + git reset --hard D &&
391 test_tick &&
392 set_fake_editor &&
393 test_must_fail git rebase -i --onto new-branch1 HEAD^ &&
@@ -426,7 +427,7 @@ test_expect_success C_LOCALE_OUTPUT 'multi-fixup does not fire up editor' '
427 git rebase -i $base &&
428 test $base = $(git rev-parse HEAD^) &&
429 test 0 = $(git show | grep NEVER | wc -l) &&
429 - git checkout to-be-rebased &&
430 + git checkout @{-1} &&
431 git branch -D multi-fixup
432 '
433
@@ -441,7 +442,7 @@ test_expect_success 'commit message used after conflict' '
442 git rebase --continue &&
443 test $base = $(git rev-parse HEAD^) &&
444 test 1 = $(git show | grep ONCE | wc -l) &&
444 - git checkout to-be-rebased &&
445 + git checkout @{-1} &&
446 git branch -D conflict-fixup
447 '
448
@@ -456,7 +457,7 @@ test_expect_success 'commit message retained after conflict' '
457 git rebase --continue &&
458 test $base = $(git rev-parse HEAD^) &&
459 test 2 = $(git show | grep TWICE | wc -l) &&
459 - git checkout to-be-rebased &&
460 + git checkout @{-1} &&
461 git branch -D conflict-squash
462 '
463
@@ -481,7 +482,7 @@ test_expect_success C_LOCALE_OUTPUT 'squash and fixup generate correct log messa
482 grep "^# This is a combination of 3 commits\." &&
483 git cat-file commit HEAD@{3} |
484 grep "^# This is a combination of 2 commits\." &&
484 - git checkout to-be-rebased &&
485 + git checkout @{-1} &&
486 git branch -D squash-fixup
487 '
488
@@ -494,7 +495,7 @@ test_expect_success C_LOCALE_OUTPUT 'squash ignores comments' '
495 git rebase -i $base &&
496 test $base = $(git rev-parse HEAD^) &&
497 test 1 = $(git show | grep ONCE | wc -l) &&
497 - git checkout to-be-rebased &&
498 + git checkout @{-1} &&
499 git branch -D skip-comments
500 '
501
@@ -507,7 +508,7 @@ test_expect_success C_LOCALE_OUTPUT 'squash ignores blank lines' '
508 git rebase -i $base &&
509 test $base = $(git rev-parse HEAD^) &&
510 test 1 = $(git show | grep ONCE | wc -l) &&
510 - git checkout to-be-rebased &&
511 + git checkout @{-1} &&
512 git branch -D skip-blank-lines
513 '
514
@@ -648,7 +649,7 @@ test_expect_success 'rebase with a file named HEAD in worktree' '
649 ) &&
650
651 set_fake_editor &&
651 - FAKE_LINES="1 squash 2" git rebase -i to-be-rebased &&
652 + FAKE_LINES="1 squash 2" git rebase -i @{-1} &&
653 test "$(git show -s --pretty=format:%an)" = "Squashed Away"
654
655 '