revert: report success when using option --strategy
authorChristian Couder <chriscool@tuxfamily.org>
Tue, 13 Jul 2010 23:28:12 +0000 (01:28 +0200)
committerJunio C Hamano <gitster@pobox.com>
Fri, 16 Jul 2010 22:20:58 +0000 (15:20 -0700)
commit7b53b92fdb22b90d2be558db84c725641c4ad170
treedc7eb6e3abc4e6f91a08e59edb2455965ef7eaa7
parent53b304224a561b5fd4ae35cedc0a978d91d4b1da
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>
builtin/revert.c
t/t3508-cherry-pick-many-commits.sh