1
0
Fork 0
mirror of https://github.com/git/git.git synced 2024-05-23 05:36:09 +02:00

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>
This commit is contained in:
Đoàn Trần Công Danh 2022-11-10 23:36:40 +07:00 committed by Taylor Blau
parent 461fec41fa
commit 8962f8f888
2 changed files with 2 additions and 2 deletions

View 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;

View File

@ -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)