Skip to content

Commit aeebd98

Browse files
sbeyergitster
authored andcommitted
t3510: test that cherry-pick --abort does not unsafely change HEAD
Signed-off-by: Stephan Beyer <s-beyer@gmx.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
1 parent 1868331 commit aeebd98

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

t/t3510-cherry-pick-sequence.sh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,16 @@ test_expect_success '--abort to cancel single cherry-pick' '
147147
git diff-index --exit-code HEAD
148148
'
149149

150+
test_expect_failure '--abort does not unsafely change HEAD' '
151+
pristine_detach initial &&
152+
test_must_fail git cherry-pick picked anotherpick &&
153+
git reset --hard base &&
154+
test_must_fail git cherry-pick picked anotherpick &&
155+
git cherry-pick --abort 2>actual &&
156+
test_i18ngrep "You seem to have moved HEAD" actual &&
157+
test_cmp_rev base HEAD
158+
'
159+
150160
test_expect_success 'cherry-pick --abort to cancel multiple revert' '
151161
pristine_detach anotherpick &&
152162
test_expect_code 1 git revert base..picked &&

0 commit comments

Comments
 (0)