]> git.ipfire.org Git - thirdparty/git.git/commitdiff
midx-write: put failing response value back
authorDerrick Stolee <stolee@gmail.com>
Fri, 5 Sep 2025 19:26:14 +0000 (19:26 +0000)
committerJunio C Hamano <gitster@pobox.com>
Fri, 5 Sep 2025 19:32:00 +0000 (12:32 -0700)
This instance of setting the result to 1 before going to cleanup was
accidentally removed in fcb2205b77 (midx: implement support for writing
incremental MIDX chains, 2024-08-06). Build upon a test that already deletes
a packfile to verify that this error propagates to full command failure.

Signed-off-by: Derrick Stolee <stolee@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
midx-write.c
t/t5319-multi-pack-index.sh

index 8203b50da1e29075225250e5f43acdf5f9ae9b67..4c8af23861afcde9293013eeab71bfe8cd019c7b 100644 (file)
@@ -1122,6 +1122,7 @@ static int write_midx_internal(struct repository *r, const char *object_dir,
                        m = m->base_midx;
                }
        } else if (ctx.m && fill_packs_from_midx(&ctx)) {
+               result = 1;
                goto cleanup;
        }
 
index 49705c62a25202c87535695b3b672cd614d0afdf..2c22fdb9317d384635ee8450e0d21e831947471c 100755 (executable)
@@ -1100,7 +1100,10 @@ test_expect_success 'load reverse index when missing .idx, .pack' '
                mv $idx.bak $idx &&
 
                mv $pack $pack.bak &&
-               git cat-file --batch-check="%(objectsize:disk)" <tip
+               git cat-file --batch-check="%(objectsize:disk)" <tip &&
+
+               test_must_fail git multi-pack-index write 2>err &&
+               test_grep "could not load pack" err
        )
 '