Skip to content

Commit 8962f8f

Browse files
sgnttaylorr
authored andcommitted
bisect-run: verify_good: account for non-negative exit status
Some system never reports negative exit code at all, they reports them as bigger-than-128 instead. We take extra care for those systems in the later check for normal 'do_bisect_run' loop. Let's check it here, too. Signed-off-by: Đoàn Trần Công Danh <[email protected]> Signed-off-by: Taylor Blau <[email protected]>
1 parent 461fec4 commit 8962f8f

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

builtin/bisect--helper.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1211,7 +1211,7 @@ static int bisect_run(struct bisect_terms *terms, const char **argv, int argc)
12111211
if (is_first_run && (res == 126 || res == 127)) {
12121212
int rc = verify_good(terms, command.buf);
12131213
is_first_run = 0;
1214-
if (rc < 0) {
1214+
if (rc < 0 || 128 <= rc) {
12151215
error(_("unable to verify %s on good"
12161216
" revision"), command.buf);
12171217
res = BISECT_FAILED;

t/t6030-bisect-porcelain.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,7 @@ test_expect_success 'git bisect run: negative exit code' "
347347
test_cmp expect actual
348348
"
349349

350-
test_expect_failure 'git bisect run: unable to verify on good' "
350+
test_expect_success 'git bisect run: unable to verify on good' "
351351
write_script fail.sh <<-'EOF' &&
352352
head=\$(git rev-parse --verify HEAD)
353353
good=\$(git rev-parse --verify $HASH1)

0 commit comments

Comments
 (0)