Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhillip Wood <phillip.wood@dunelm.org.uk>2021-09-13 18:19:18 +0300
committerJunio C Hamano <gitster@pobox.com>2021-09-13 22:47:07 +0300
commitd045719ac8ab2b2c6f4d7ce61ad3d35843556bbf (patch)
tree3c37e34d46ad9f609d32043cf9419e1d6889e469 /t/t3407-rebase-abort.sh
parent1e14bc11ed01e876809e62d2b13db71d6c0d265c (diff)
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>
Diffstat (limited to 't/t3407-rebase-abort.sh')
-rwxr-xr-xt/t3407-rebase-abort.sh34
1 files changed, 12 insertions, 22 deletions
diff --git a/t/t3407-rebase-abort.sh b/t/t3407-rebase-abort.sh
index f8264449b6..162112ba5e 100755
--- a/t/t3407-rebase-abort.sh
+++ b/t/t3407-rebase-abort.sh
@@ -86,31 +86,21 @@ testrebase() {
test_must_fail git rebase --abort -v &&
git rebase --abort
'
+
+ test_expect_success "rebase$type --quit" '
+ test_when_finished "git symbolic-ref HEAD refs/heads/to-rebase" &&
+ # Clean up the state from the previous one
+ git reset --hard pre-rebase &&
+ test_must_fail git rebase$type main &&
+ test_path_is_dir $state_dir &&
+ head_before=$(git rev-parse HEAD) &&
+ git rebase --quit &&
+ test_cmp_rev HEAD $head_before &&
+ test_path_is_missing .git/rebase-apply
+ '
}
testrebase " --apply" .git/rebase-apply
testrebase " --merge" .git/rebase-merge
-test_expect_success 'rebase --apply --quit' '
- # Clean up the state from the previous one
- git reset --hard pre-rebase &&
- test_must_fail git rebase --apply main &&
- test_path_is_dir .git/rebase-apply &&
- head_before=$(git rev-parse HEAD) &&
- git rebase --quit &&
- test_cmp_rev HEAD $head_before &&
- test_path_is_missing .git/rebase-apply
-'
-
-test_expect_success 'rebase --merge --quit' '
- # Clean up the state from the previous one
- git reset --hard pre-rebase &&
- test_must_fail git rebase --merge main &&
- test_path_is_dir .git/rebase-merge &&
- head_before=$(git rev-parse HEAD) &&
- git rebase --quit &&
- test_cmp_rev HEAD $head_before &&
- test_path_is_missing .git/rebase-merge
-'
-
test_done