diff options
author | Junio C Hamano <gitster@pobox.com> | 2016-12-21 14:55:01 -0800 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2016-12-21 14:55:01 -0800 |
commit | 4fcc0911989493e6e818dd933133cb18a32131fc (patch) | |
tree | c3a388f1064d51fdfd1b9b99a75947be01dd42b8 /t | |
parent | 6610af872f6494a061780ec738c8713a034b848b (diff) | |
parent | ce73bb22d87abe16885b3e871a10de5a261e499f (diff) | |
download | git-4fcc0911989493e6e818dd933133cb18a32131fc.tar.gz git-4fcc0911989493e6e818dd933133cb18a32131fc.tar.xz |
Merge branch 'sb/sequencer-abort-safety'
Unlike "git am --abort", "git cherry-pick --abort" moved HEAD back
to where cherry-pick started while picking multiple changes, when
the cherry-pick stopped to ask for help from the user, and the user
did "git reset --hard" to a different commit in order to re-attempt
the operation.
* sb/sequencer-abort-safety:
Revert "sequencer: remove useless get_dir() function"
sequencer: remove useless get_dir() function
sequencer: make sequencer abort safer
t3510: test that cherry-pick --abort does not unsafely change HEAD
am: change safe_to_abort()'s not rewinding error into a warning
am: fix filename in safe_to_abort() error message
Diffstat (limited to 't')
-rwxr-xr-x | t/t3510-cherry-pick-sequence.sh | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/t/t3510-cherry-pick-sequence.sh b/t/t3510-cherry-pick-sequence.sh index 7b7a89dbd..372307c21 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_success '--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 && |