bisect: add enum to represent bisect returning codes

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.

Create an enum called `bisect_error` with the bisecting return codes
to use in `bisect.c` libification process.

Change bisect_next_all() to make it return this enum.

Mentored-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Miriam Rubio <mirucam@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Miriam Rubio
2020-02-17 09:40:32 +01:00
committed by Junio C Hamano
parent bfacfce7d9
commit 680e8a01e5
2 changed files with 14 additions and 2 deletions

View File

@ -945,7 +945,7 @@ void read_bisect_terms(const char **read_bad, const char **read_good)
* If no_checkout is non-zero, the bisection process does not
* checkout the trial commit but instead simply updates BISECT_HEAD.
*/
int bisect_next_all(struct repository *r, const char *prefix, int no_checkout)
enum bisect_error bisect_next_all(struct repository *r, const char *prefix, int no_checkout)
{
struct rev_info revs;
struct commit_list *tried;