]> git.ipfire.org Git - thirdparty/git.git/commitdiff
bisect--helper: return error codes from `cmd_bisect__helper()`
authorPranit Bauva <pranit.bauva@gmail.com>
Mon, 17 Feb 2020 08:40:33 +0000 (09:40 +0100)
committerJunio C Hamano <gitster@pobox.com>
Wed, 19 Feb 2020 17:37:14 +0000 (09:37 -0800)
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>
builtin/bisect--helper.c

index e21d3d1a4c16c4c2e497b7f1d374f2f1d36e16a1..e6bd4d6645a1d5263dbaec38f2d52ab4b74985fc 100644 (file)
@@ -713,5 +713,5 @@ int cmd_bisect__helper(int argc, const char **argv, const char *prefix)
                return error("BUG: unknown subcommand '%d'", cmdmode);
        }
        free_terms(&terms);
-       return !!res;
+       return abs(res);
 }