diff options
author | Pranit Bauva <pranit.bauva@gmail.com> | 2020-02-17 09:40:36 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2020-02-19 09:37:14 -0800 |
commit | cdd4dc2d6a3e420178100efc780a987495a1a3bd (patch) | |
tree | 2c3dfea5fd2a94667a4b549b35da4627adfc7aea /csum-file.c | |
parent | bisect: libify `bisect_checkout` (diff) | |
download | tgif-cdd4dc2d6a3e420178100efc780a987495a1a3bd.tar.xz |
bisect: libify `check_merge_bases` 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.
In `check_merge_bases()` there is an early success special case,
so we have introduced special error code
BISECT_INTERNAL_SUCCESS_MERGE_BASE (-11) which indicates early
success. This BISECT_INTERNAL_SUCCESS_MERGE_BASE is converted back
to BISECT_OK (0) in `check_good_are_ancestors_of_bad()`.
Update all callers to handle the error returns.
Mentored-by: Christian Couder <chriscool@tuxfamily.org>
Mentored by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Pranit Bauva <pranit.bauva@gmail.com>
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>
Diffstat (limited to 'csum-file.c')
0 files changed, 0 insertions, 0 deletions