]> git.ipfire.org Git - thirdparty/git.git/commitdiff
bisect-run: verify_good: account for non-negative exit status
authorĐoàn Trần Công Danh <congdanhqx@gmail.com>
Thu, 10 Nov 2022 16:36:40 +0000 (23:36 +0700)
committerTaylor Blau <me@ttaylorr.com>
Fri, 11 Nov 2022 22:05:53 +0000 (17:05 -0500)
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>
builtin/bisect--helper.c
t/t6030-bisect-porcelain.sh

index 180c2faa7f4856fa06b4a6ac00c6827c6c7a42bc..e21419059927210f4e9979fc210b9f9108bde773 100644 (file)
@@ -1211,7 +1211,7 @@ static int bisect_run(struct bisect_terms *terms, const char **argv, int argc)
                if (is_first_run && (res == 126 || res == 127)) {
                        int rc = verify_good(terms, command.buf);
                        is_first_run = 0;
-                       if (rc < 0) {
+                       if (rc < 0 || 128 <= rc) {
                                error(_("unable to verify %s on good"
                                        " revision"), command.buf);
                                res = BISECT_FAILED;
index 34fd45a48edaf9018504809ae82f0230b9d4d0f7..03d99b22f1ab8cf3d222035ebe97bfa12cc45d2b 100755 (executable)
@@ -347,7 +347,7 @@ test_expect_success 'git bisect run: negative exit code' "
        test_cmp expect actual
 "
 
-test_expect_failure 'git bisect run: unable to verify on good' "
+test_expect_success 'git bisect run: unable to verify on good' "
        write_script fail.sh <<-'EOF' &&
        head=\$(git rev-parse --verify HEAD)
        good=\$(git rev-parse --verify $HASH1)