Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohannes Schindelin <johannes.schindelin@gmx.de>2023-01-12 18:19:09 +0300
committerJunio C Hamano <gitster@pobox.com>2023-01-14 01:17:13 +0300
commit7a8d7aaa47d952f255f29528359ee5e4edb7c6d2 (patch)
tree089daba968e778336ec565f46640e394f8c96557 /builtin/bisect.c
parenta38d39a4c50d1275833aba54c4dbdfce9e2e9ca1 (diff)
bisect--helper: simplify exit code computation
We _already_ have a function to determine whether a given `enum bisect_error` value is non-zero but still _actually_ indicates success. Let's use it instead of duplicating the logic. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/bisect.c')
-rw-r--r--builtin/bisect.c9
1 files changed, 1 insertions, 8 deletions
diff --git a/builtin/bisect.c b/builtin/bisect.c
index cc9483e851..09505fc4dc 100644
--- a/builtin/bisect.c
+++ b/builtin/bisect.c
@@ -1440,12 +1440,5 @@ int cmd_bisect(int argc, const char **argv, const char *prefix)
res = fn(argc, argv, prefix);
}
- /*
- * Handle early success
- * From check_merge_bases > check_good_are_ancestors_of_bad > bisect_next_all
- */
- if ((res == BISECT_INTERNAL_SUCCESS_MERGE_BASE) || (res == BISECT_INTERNAL_SUCCESS_1ST_BAD_FOUND))
- res = BISECT_OK;
-
- return -res;
+ return is_bisect_success(res) ? 0 : -res;
}