Skip to content

Commit d045719

Browse files
phillipwoodgitster
authored andcommitted
t3407: rework rebase --quit tests
9512177 ("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>
1 parent 1e14bc1 commit d045719

File tree

1 file changed

+12
-22
lines changed

1 file changed

+12
-22
lines changed

t/t3407-rebase-abort.sh

Lines changed: 12 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -86,31 +86,21 @@ testrebase() {
8686
test_must_fail git rebase --abort -v &&
8787
git rebase --abort
8888
'
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+
'
89101
}
90102

91103
testrebase " --apply" .git/rebase-apply
92104
testrebase " --merge" .git/rebase-merge
93105

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-
116106
test_done

0 commit comments

Comments
 (0)