If the cherry-pick fails due to a merge conflict, it just returns an exit status of 0.
Please don't tell me about --abort
. I need to detect, in a script, if the original cherry-pick command fails.
Using git version 1.8.3.1 on CentOS 7.2.
EDIT: my script was doing the cherry-pick in an if !
and I didn't exit properly in the then
clause with a non-zero exit. Sorry for the noise.
$?
holds the return code of the last process run in bash.
$ ls /dev/null/foo
ls: /dev/null/foo: Not a directory
$ echo $?
1