summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2016-12-19 14:45:35 -0800
committerLibravatar Junio C Hamano <gitster@pobox.com>2016-12-19 14:45:35 -0800
commit06cd5a1e01328724b7709ac232e36263e59f5f26 (patch)
treecd234c23f5d18c2e60ea61b33f1a6b98c08d8619 /t
parentMerge branch 'jk/trailers-placeholder-in-pretty' (diff)
parentrebase: add --quit to cleanup rebase, leave everything else untouched (diff)
downloadtgif-06cd5a1e01328724b7709ac232e36263e59f5f26.tar.xz
Merge branch 'nd/rebase-forget'
"git rebase" learned "--quit" option, which allows a user to remove the metadata left by an earlier "git rebase" that was manually aborted without using "git rebase --abort". * nd/rebase-forget: rebase: add --quit to cleanup rebase, leave everything else untouched
Diffstat (limited to 't')
-rwxr-xr-xt/t3407-rebase-abort.sh24
1 files changed, 24 insertions, 0 deletions
diff --git a/t/t3407-rebase-abort.sh b/t/t3407-rebase-abort.sh
index a6a6c40a98..910f218284 100755
--- a/t/t3407-rebase-abort.sh
+++ b/t/t3407-rebase-abort.sh
@@ -99,4 +99,28 @@ testrebase() {
testrebase "" .git/rebase-apply
testrebase " --merge" .git/rebase-merge
+test_expect_success 'rebase --quit' '
+ cd "$work_dir" &&
+ # Clean up the state from the previous one
+ git reset --hard pre-rebase &&
+ test_must_fail git rebase master &&
+ test_path_is_dir .git/rebase-apply &&
+ head_before=$(git rev-parse HEAD) &&
+ git rebase --quit &&
+ test $(git rev-parse HEAD) = $head_before &&
+ test ! -d .git/rebase-apply
+'
+
+test_expect_success 'rebase --merge --quit' '
+ cd "$work_dir" &&
+ # Clean up the state from the previous one
+ git reset --hard pre-rebase &&
+ test_must_fail git rebase --merge master &&
+ test_path_is_dir .git/rebase-merge &&
+ head_before=$(git rev-parse HEAD) &&
+ git rebase --quit &&
+ test $(git rev-parse HEAD) = $head_before &&
+ test ! -d .git/rebase-merge
+'
+
test_done