summaryrefslogtreecommitdiff
path: root/t/t3507-cherry-pick-conflict.sh
diff options
context:
space:
mode:
authorPhil Hord <hordp@cisco.com>2012-02-22 00:44:17 (GMT)
committerJunio C Hamano <gitster@pobox.com>2012-02-22 19:13:43 (GMT)
commited727b192bb3506ee7904c1c9e8370d6b4ecaf5d (patch)
treede21fef09f9d9bcbc64f28b194d0b23c3f9b46e4 /t/t3507-cherry-pick-conflict.sh
parent7010146f90abf0e4954690f6cd38a8463786fec7 (diff)
downloadgit-ed727b192bb3506ee7904c1c9e8370d6b4ecaf5d.zip
git-ed727b192bb3506ee7904c1c9e8370d6b4ecaf5d.tar.gz
git-ed727b192bb3506ee7904c1c9e8370d6b4ecaf5d.tar.bz2
cherry-pick: No advice to commit if --no-commit
When cherry-pick fails it offers a helpful hint about how to proceed. The hint tells the user how to do the cleanup needed by the conflicted cherry-pick and finish the job after conflict resolution. In case of cherry-pick --no-commit, the hint goes too far. It tells the user to finish up with 'git commit'. That is not what this git-cherry-pick was trying to do in the first place. Restrict the hint in case of --no-commit to avoid giving this extra advice. Also, add a test verifying the reduced hint for the --no-commit version of cherry-pick. Signed-off-by: Phil Hord <hordp@cisco.com> Acked-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t3507-cherry-pick-conflict.sh')
-rwxr-xr-xt/t3507-cherry-pick-conflict.sh14
1 files changed, 14 insertions, 0 deletions
diff --git a/t/t3507-cherry-pick-conflict.sh b/t/t3507-cherry-pick-conflict.sh
index ee1659c..0c81b3c 100755
--- a/t/t3507-cherry-pick-conflict.sh
+++ b/t/t3507-cherry-pick-conflict.sh
@@ -59,6 +59,20 @@ test_expect_success 'advice from failed cherry-pick' "
test_i18ncmp expected actual
"
+test_expect_success 'advice from failed cherry-pick --no-commit' "
+ pristine_detach initial &&
+
+ picked=\$(git rev-parse --short picked) &&
+ cat <<-EOF >expected &&
+ error: could not apply \$picked... picked
+ hint: after resolving the conflicts, mark the corrected paths
+ hint: with 'git add <paths>' or 'git rm <paths>'
+ EOF
+ test_must_fail git cherry-pick --no-commit picked 2>actual &&
+
+ test_i18ncmp expected actual
+"
+
test_expect_success 'failed cherry-pick sets CHERRY_PICK_HEAD' '
pristine_detach initial &&
test_must_fail git cherry-pick picked &&