Git fork

midx-write: put failing response value back

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>

authored by

Derrick Stolee and committed by
Junio C Hamano
3a45c7be c9388d90

+5 -1
+1
midx-write.c
··· 1122 1122 m = m->base_midx; 1123 1123 } 1124 1124 } else if (ctx.m && fill_packs_from_midx(&ctx)) { 1125 + result = 1; 1125 1126 goto cleanup; 1126 1127 } 1127 1128
+4 -1
t/t5319-multi-pack-index.sh
··· 1100 1100 mv $idx.bak $idx && 1101 1101 1102 1102 mv $pack $pack.bak && 1103 - git cat-file --batch-check="%(objectsize:disk)" <tip 1103 + git cat-file --batch-check="%(objectsize:disk)" <tip && 1104 + 1105 + test_must_fail git multi-pack-index write 2>err && 1106 + test_grep "could not load pack" err 1104 1107 ) 1105 1108 ' 1106 1109