Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
t3510: test that cherry-pick --abort does not unsafely change HEAD
author
Stephan Beyer
<s-beyer@gmx.net>
Wed, 7 Dec 2016 21:51:31 +0000
(22:51 +0100)
committer
Junio C Hamano
<gitster@pobox.com>
Fri, 9 Dec 2016 22:50:45 +0000
(14:50 -0800)
Signed-off-by: Stephan Beyer <s-beyer@gmx.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/t3510-cherry-pick-sequence.sh
patch
|
blob
|
history
raw
|
patch
|
inline
| side by side (parent:
1868331
)
diff --git
a/t/t3510-cherry-pick-sequence.sh
b/t/t3510-cherry-pick-sequence.sh
index 7b7a89dbd5ce578e0a722345a00f247e383689ef..efcd4fc4859b4dcc5c32e8d7229ee5d48b26f254 100755
(executable)
--- 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
'
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 &&
test_expect_success 'cherry-pick --abort to cancel multiple revert' '
pristine_detach anotherpick &&
test_expect_code 1 git revert base..picked &&