t3407: rework rebase --quit tests

9512177b68 ("rebase: add --quit to cleanup rebase, leave everything else untouched", 2016-11-12) seems to have copied the --abort tests but added two separate tests for the two rebase backends rather than adding a single test into the existing testrebase() function. Signed-off-by: Phillip Wood <phillip.wood@dunelm.org.uk> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Phillip Wood committed Sep 13, 2021 at 15:19 UTC d045719ac8ab2b2c6f4d7ce61ad3d35843556bbf
1 file changed +12 -22
t/t3407-rebase-abort.sh
+12 -22
@@ -86,31 +86,21 @@ testrebase() {
86 test_must_fail git rebase --abort -v &&
87 git rebase --abort
88 '
89 +
90 + test_expect_success "rebase$type --quit" '
91 + test_when_finished "git symbolic-ref HEAD refs/heads/to-rebase" &&
92 + # Clean up the state from the previous one
93 + git reset --hard pre-rebase &&
94 + test_must_fail git rebase$type main &&
95 + test_path_is_dir $state_dir &&
96 + head_before=$(git rev-parse HEAD) &&
97 + git rebase --quit &&
98 + test_cmp_rev HEAD $head_before &&
99 + test_path_is_missing .git/rebase-apply
100 + '
101 }
102
103 testrebase " --apply" .git/rebase-apply
104 testrebase " --merge" .git/rebase-merge
105
94 -test_expect_success 'rebase --apply --quit' '
95 - # Clean up the state from the previous one
96 - git reset --hard pre-rebase &&
97 - test_must_fail git rebase --apply main &&
98 - test_path_is_dir .git/rebase-apply &&
99 - head_before=$(git rev-parse HEAD) &&
100 - git rebase --quit &&
101 - test_cmp_rev HEAD $head_before &&
102 - test_path_is_missing .git/rebase-apply
103 -'
104 -
105 -test_expect_success 'rebase --merge --quit' '
106 - # Clean up the state from the previous one
107 - git reset --hard pre-rebase &&
108 - test_must_fail git rebase --merge main &&
109 - test_path_is_dir .git/rebase-merge &&
110 - head_before=$(git rev-parse HEAD) &&
111 - git rebase --quit &&
112 - test_cmp_rev HEAD $head_before &&
113 - test_path_is_missing .git/rebase-merge
114 -'
115 -
106 test_done