Subject: [PATCH v3 07/13] bisect--helper: return error codes from `cmd_bisect__helper()`

From: Miriam Rubio <[email-masked]>
Date: Sat, 8 Feb 2020 10:06:58 +0100

From: Pranit Bauva <[email-masked]>

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 <[email-masked]>
Mentored-by: Johannes Schindelin <[email-masked]>
Signed-off-by: Tanushree Tumane <[email-masked]>
Signed-off-by: Miriam Rubio <[email-masked]>
---
 builtin/bisect--helper.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/builtin/bisect--helper.c b/builtin/bisect--helper.c
index e21d3d1a4c..e6bd4d6645 100644
--- a/builtin/bisect--helper.c
+++ b/builtin/bisect--helper.c
@@ -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);
 }
-- 
2.25.0