From 680e8a01e57cd383048bf4e7d9668ce715d6d649 Mon Sep 17 00:00:00 2001 From: Miriam Rubio Date: Mon, 17 Feb 2020 09:40:32 +0100 Subject: 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 Signed-off-by: Miriam Rubio Signed-off-by: Junio C Hamano --- bisect.h | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'bisect.h') diff --git a/bisect.h b/bisect.h index 4e69a11ea8..c921ead02c 100644 --- a/bisect.h +++ b/bisect.h @@ -31,7 +31,19 @@ struct rev_list_info { const char *header_prefix; }; -int bisect_next_all(struct repository *r, +/* + * enum bisect_error represents the following return codes: + * BISECT_OK: success code. Internally, it means that next + * commit has been found (and possibly checked out) and it + * should be tested. + * BISECT_FAILED error code: default error code. + */ +enum bisect_error { + BISECT_OK = 0, + BISECT_FAILED = -1 +}; + +enum bisect_error bisect_next_all(struct repository *r, const char *prefix, int no_checkout); -- cgit v1.2.3