bisect: libify `check_good_are_ancestors_of_bad` and its dependents
authorPranit Bauva <redacted>
Mon, 17 Feb 2020 08:40:37 +0000 (09:40 +0100)
committerJunio C Hamano <redacted>
Wed, 19 Feb 2020 17:37:14 +0000 (09:37 -0800)
commit45b6370812cb9bc50212d50f071c8ae5dd851698
tree42c80045e6a4bd009b75d51d219fc4e4010d67de
parentcdd4dc2d6a3e420178100efc780a987495a1a3bd
bisect: libify `check_good_are_ancestors_of_bad` and its dependents

Since we want to get rid of git-bisect.sh, it would be necessary to
convert those exit() calls to return statements so that errors can be
reported.

Emulate try catch in C by converting `exit(<positive-value>)` to
`return <negative-value>`. Follow POSIX conventions to return
<negative-value> to indicate error.

Code that turns BISECT_INTERNAL_SUCCESS_MERGE_BASE (-11)
 to BISECT_OK (0) from `check_good_are_ancestors_of_bad()` has been moved to
`cmd_bisect__helper()`.

Update all callers to handle the error returns.

Mentored-by: Christian Couder <redacted>
Mentored by: Johannes Schindelin <redacted>
Signed-off-by: Pranit Bauva <redacted>
Signed-off-by: Tanushree Tumane <redacted>
Signed-off-by: Miriam Rubio <redacted>
Signed-off-by: Junio C Hamano <redacted>
bisect.c
builtin/bisect--helper.c
git clone https://git.99rst.org/PROJECT