From: Stephan Beyer Date: Wed, 7 Dec 2016 21:51:31 +0000 (+0100) Subject: t3510: test that cherry-pick --abort does not unsafely change HEAD X-Git-Tag: v2.11.1~47^2~3 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=aeebd98ebe0fbd61f517d9da04f914c37ea0066b;p=thirdparty%2Fgit.git t3510: test that cherry-pick --abort does not unsafely change HEAD Signed-off-by: Stephan Beyer Signed-off-by: Junio C Hamano --- diff --git a/t/t3510-cherry-pick-sequence.sh b/t/t3510-cherry-pick-sequence.sh index 7b7a89dbd5..efcd4fc485 100755 --- a/t/t3510-cherry-pick-sequence.sh +++ b/t/t3510-cherry-pick-sequence.sh @@ -147,6 +147,16 @@ test_expect_success '--abort to cancel single cherry-pick' ' git diff-index --exit-code HEAD ' +test_expect_failure '--abort does not unsafely change HEAD' ' + pristine_detach initial && + test_must_fail git cherry-pick picked anotherpick && + git reset --hard base && + test_must_fail git cherry-pick picked anotherpick && + git cherry-pick --abort 2>actual && + test_i18ngrep "You seem to have moved HEAD" actual && + test_cmp_rev base HEAD +' + test_expect_success 'cherry-pick --abort to cancel multiple revert' ' pristine_detach anotherpick && test_expect_code 1 git revert base..picked &&