summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2017-03-17 13:50:28 -0700
committerLibravatar Junio C Hamano <gitster@pobox.com>2017-03-17 13:50:28 -0700
commit9c96637163ef26c7726e693984c2d4d9599d4e7e (patch)
tree23ff95a0b958cb006f75f155a3aef4b54c320ec9 /t
parentMerge branch 'js/early-config' (diff)
parentcherry-pick: detect bogus arguments to --mainline (diff)
downloadtgif-9c96637163ef26c7726e693984c2d4d9599d4e7e.tar.xz
Merge branch 'jk/cherry-pick-0-mainline'
"git revert -m 0 $merge_commit" complained that reverting a merge needs to say relative to which parent the reversion needs to happen, as if "-m 0" weren't given. The correct diagnosis is that "-m 0" does not refer to the first parent ("-m 1" does). This has been fixed. * jk/cherry-pick-0-mainline: cherry-pick: detect bogus arguments to --mainline
Diffstat (limited to 't')
-rwxr-xr-xt/t3502-cherry-pick-merge.sh9
1 files changed, 9 insertions, 0 deletions
diff --git a/t/t3502-cherry-pick-merge.sh b/t/t3502-cherry-pick-merge.sh
index e37547f41a..b1602718f8 100755
--- a/t/t3502-cherry-pick-merge.sh
+++ b/t/t3502-cherry-pick-merge.sh
@@ -31,6 +31,15 @@ test_expect_success setup '
'
+test_expect_success 'cherry-pick -m complains of bogus numbers' '
+ # expect 129 here to distinguish between cases where
+ # there was nothing to cherry-pick
+ test_expect_code 129 git cherry-pick -m &&
+ test_expect_code 129 git cherry-pick -m foo b &&
+ test_expect_code 129 git cherry-pick -m -1 b &&
+ test_expect_code 129 git cherry-pick -m 0 b
+'
+
test_expect_success 'cherry-pick a non-merge with -m should fail' '
git reset --hard &&