summaryrefslogtreecommitdiff
path: root/run-command.c
diff options
context:
space:
mode:
authorLibravatar Ramkumar Ramachandra <artagnon@gmail.com>2011-08-04 16:09:16 +0530
committerLibravatar Junio C Hamano <gitster@pobox.com>2011-08-08 09:28:46 -0700
commitcf3e2486d698356a130ebcda9d728c53a0569813 (patch)
tree62fc6106782a2cff195c3a73eb0dd8038cce2319 /run-command.c
parentrevert: Introduce --continue to continue the operation (diff)
downloadtgif-cf3e2486d698356a130ebcda9d728c53a0569813.tar.xz
revert: Propagate errors upwards from do_pick_commit
Currently, revert_or_cherry_pick can fail in two ways. If it encounters a conflict, it returns a positive number indicating the intended exit status for the git wrapper to pass on; for all other errors, it calls die(). The latter behavior is inconsiderate towards callers, as it denies them the opportunity to recover from errors and do other things. After this patch, revert_or_cherry_pick will still return a positive return value to indicate an exit status for conflicts as before, while for some other errors, it will print an error message and return -1 instead of die()-ing. The cmd_revert and cmd_cherry_pick are adjusted to handle the fatal errors by die()-ing themselves. While the full benefits of this patch will only be seen once all the "die" calls are replaced with calls to "error", its immediate impact is to change some "fatal:" messages to say "error:" and to add a new "fatal: cherry-pick failed" message at the end when the operation fails. Inspired-by: Christian Couder <chriscool@tuxfamily.org> Mentored-by: Jonathan Nieder <jrnieder@gmail.com> Helped-by: Junio C Hamano <gitster@pobox.com> Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com> Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'run-command.c')
0 files changed, 0 insertions, 0 deletions