aboutsummaryrefslogtreecommitdiff
path: root/t/t3508-cherry-pick-many-commits.sh
diff options
context:
space:
mode:
authorChristian Couder <chriscool@tuxfamily.org>2010-07-14 01:28:12 +0200
committerJunio C Hamano <gitster@pobox.com>2010-07-16 15:20:58 -0700
commit7b53b92fdb22b90d2be558db84c725641c4ad170 (patch)
treedc7eb6e3abc4e6f91a08e59edb2455965ef7eaa7 /t/t3508-cherry-pick-many-commits.sh
parent53b304224a561b5fd4ae35cedc0a978d91d4b1da (diff)
downloadgit-7b53b92fdb22b90d2be558db84c725641c4ad170.tar.gz
git-7b53b92fdb22b90d2be558db84c725641c4ad170.tar.xz
revert: report success when using option --strategy
"git cherry-pick foo" has always reported success with "Finished one cherry-pick" but "cherry-pick --strategy" does not print anything. So move the code to write that message from do_recursive_merge() to do_cherry_pick() so other strategies can share it. This patch also refactors the code that prints a message like "Automatic cherry-pick failed. <help message>". This code was duplicated in both do_recursive_merge() and do_pick_commit(). To do that, now do_recursive_merge() returns an int to signal success or failure. And in case of failure we just return 1 from do_pick_commit() instead of doing "exit(1)" from either do_recursive_merge() or do_pick_commit(). Signed-off-by: Christian Couder <chriscool@tuxfamily.org> Reviewed-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t3508-cherry-pick-many-commits.sh')
-rwxr-xr-xt/t3508-cherry-pick-many-commits.sh26
1 files changed, 25 insertions, 1 deletions
diff --git a/t/t3508-cherry-pick-many-commits.sh b/t/t3508-cherry-pick-many-commits.sh
index f90ed3da3..d90b365fd 100755
--- a/t/t3508-cherry-pick-many-commits.sh
+++ b/t/t3508-cherry-pick-many-commits.sh
@@ -23,12 +23,36 @@ test_expect_success setup '
'
test_expect_success 'cherry-pick first..fourth works' '
+ cat <<-\EOF >expected &&
+ Finished one cherry-pick.
+ Finished one cherry-pick.
+ Finished one cherry-pick.
+ EOF
+
+ git checkout -f master &&
+ git reset --hard first &&
+ test_tick &&
+ git cherry-pick first..fourth 2>actual &&
+ git diff --quiet other &&
+ git diff --quiet HEAD other &&
+ test_cmp expected actual &&
+ test "$(git rev-parse --verify HEAD)" != "$(git rev-parse --verify fourth)"
+'
+
+test_expect_success 'cherry-pick --strategy resolve first..fourth works' '
+ cat <<-\EOF >expected &&
+ Finished one cherry-pick with strategy resolve.
+ Finished one cherry-pick with strategy resolve.
+ Finished one cherry-pick with strategy resolve.
+ EOF
+
git checkout -f master &&
git reset --hard first &&
test_tick &&
- git cherry-pick first..fourth &&
+ git cherry-pick --strategy resolve first..fourth 2>actual &&
git diff --quiet other &&
git diff --quiet HEAD other &&
+ test_cmp expected actual &&
test "$(git rev-parse --verify HEAD)" != "$(git rev-parse --verify fourth)"
'