summaryrefslogtreecommitdiff
path: root/t/t3420-rebase-autostash.sh
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2020-04-29 16:15:27 -0700
committerLibravatar Junio C Hamano <gitster@pobox.com>2020-04-29 16:15:27 -0700
commit3afdeef33e1d7912b8b135df2ea3fef3a3cf60bc (patch)
tree9fd86e666b7c013395c535607130a3027aa3f54a /t/t3420-rebase-autostash.sh
parentMerge branch 'dl/merge-autostash' (diff)
parentrebase: save autostash entry into stash reflog on --quit (diff)
downloadtgif-3afdeef33e1d7912b8b135df2ea3fef3a3cf60bc.tar.xz
Merge branch 'dl/merge-autostash-rebase-quit-fix'
The stash entry created by "git rebase --autosquash" to keep the initial dirty state were discarded by mistake upon "git rebase --quit", which has been corrected. * dl/merge-autostash-rebase-quit-fix: rebase: save autostash entry into stash reflog on --quit
Diffstat (limited to 't/t3420-rebase-autostash.sh')
-rwxr-xr-xt/t3420-rebase-autostash.sh20
1 files changed, 20 insertions, 0 deletions
diff --git a/t/t3420-rebase-autostash.sh b/t/t3420-rebase-autostash.sh
index b97ea62363..ca331733fb 100755
--- a/t/t3420-rebase-autostash.sh
+++ b/t/t3420-rebase-autostash.sh
@@ -184,6 +184,26 @@ testrebase () {
git checkout feature-branch
'
+ test_expect_success "rebase$type: --quit" '
+ test_config rebase.autostash true &&
+ git reset --hard &&
+ git checkout -b rebased-feature-branch feature-branch &&
+ test_when_finished git branch -D rebased-feature-branch &&
+ echo dirty >>file3 &&
+ git diff >expect &&
+ test_must_fail git rebase$type related-onto-branch &&
+ test_path_is_file $dotest/autostash &&
+ test_path_is_missing file3 &&
+ git rebase --quit &&
+ test_when_finished git stash drop &&
+ test_path_is_missing $dotest/autostash &&
+ ! grep dirty file3 &&
+ git stash show -p >actual &&
+ test_cmp expect actual &&
+ git reset --hard &&
+ git checkout feature-branch
+ '
+
test_expect_success "rebase$type: non-conflicting rebase, conflicting stash" '
test_config rebase.autostash true &&
git reset --hard &&