@matheusbsbs / matheus-bagliano / commits / 7613ec594a
Fork 0

bisect--helper: return error codes from `cmd_bisect__helper()`

Since we want to get rid of git-bisect.sh, it would be necessary to convert bisect.c exit() calls to return statements so that errors can be reported. Let's prepare for that by making it possible to return different error codes than just 0 or 1. Different error codes might enable a bisecting script calling the bisect command that uses this function to do different things depending on the exit status of the bisect command. Mentored-by: Christian Couder <chriscool@tuxfamily.org> Mentored-by: Johannes Schindelin <Johannes.Schindelin@gmx.de> Signed-off-by: Tanushree Tumane <tanushreetumane@gmail.com> Signed-off-by: Miriam Rubio <mirucam@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Pranit Bauva committed Feb 17, 2020 at 09:40 UTC 7613ec594a3cb3a5b67bd4f363a557374e744dfb
1 file changed +1 -1
builtin/bisect--helper.c
+1 -1
@@ -713,5 +713,5 @@ int cmd_bisect__helper(int argc, const char **argv, const char *prefix)
713 return error("BUG: unknown subcommand '%d'", cmdmode);
714 }
715 free_terms(&terms);
716 - return !!res;
716 + return abs(res);
717 }