diff options
author | Ramkumar Ramachandra <artagnon@gmail.com> | 2011-08-04 16:09:16 +0530 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2011-08-08 09:28:46 -0700 |
commit | cf3e2486d698356a130ebcda9d728c53a0569813 (patch) | |
tree | 62fc6106782a2cff195c3a73eb0dd8038cce2319 /t/t5100/rfc2047-info-0009 | |
parent | revert: Introduce --continue to continue the operation (diff) | |
download | tgif-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 't/t5100/rfc2047-info-0009')
0 files changed, 0 insertions, 0 deletions