Skip to content

Commit 7a8d7aa

Browse files
dschogitster
authored andcommitted
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 <[email protected]> Signed-off-by: Ævar Arnfjörð Bjarmason <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent a38d39a commit 7a8d7aa

File tree

1 file changed

+1
-8
lines changed

1 file changed

+1
-8
lines changed

builtin/bisect.c

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1440,12 +1440,5 @@ int cmd_bisect(int argc, const char **argv, const char *prefix)
14401440
res = fn(argc, argv, prefix);
14411441
}
14421442

1443-
/*
1444-
* Handle early success
1445-
* From check_merge_bases > check_good_are_ancestors_of_bad > bisect_next_all
1446-
*/
1447-
if ((res == BISECT_INTERNAL_SUCCESS_MERGE_BASE) || (res == BISECT_INTERNAL_SUCCESS_1ST_BAD_FOUND))
1448-
res = BISECT_OK;
1449-
1450-
return -res;
1443+
return is_bisect_success(res) ? 0 : -res;
14511444
}

0 commit comments

Comments
 (0)