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 <congdanhqx@gmail.com> Signed-off-by: Taylor Blau <me@ttaylorr.com>

Đoàn Trần Công Danh committed Nov 10, 2022 at 23:36 UTC 8962f8f8887c15b3e55ebc348a2490290a55d8a5
2 files changed +2 -2
builtin/bisect--helper.c
+1 -1
@@ -1211,7 +1211,7 @@ static int bisect_run(struct bisect_terms *terms, const char **argv, int argc)
1211 if (is_first_run && (res == 126 || res == 127)) {
1212 int rc = verify_good(terms, command.buf);
1213 is_first_run = 0;
1214 - if (rc < 0) {
1214 + if (rc < 0 || 128 <= rc) {
1215 error(_("unable to verify %s on good"
1216 " revision"), command.buf);
1217 res = BISECT_FAILED;
t/t6030-bisect-porcelain.sh
+1 -1
@@ -347,7 +347,7 @@ test_expect_success 'git bisect run: negative exit code' "
347 test_cmp expect actual
348 "
349
350 -test_expect_failure 'git bisect run: unable to verify on good' "
350 +test_expect_success 'git bisect run: unable to verify on good' "
351 write_script fail.sh <<-'EOF' &&
352 head=\$(git rev-parse --verify HEAD)
353 good=\$(git rev-parse --verify $HASH1)