Skip to content

Commit 3a45c7b

Browse files
derrickstoleegitster
authored andcommitted
midx-write: put failing response value back
This instance of setting the result to 1 before going to cleanup was accidentally removed in fcb2205 (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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent c9388d9 commit 3a45c7b

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

midx-write.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1122,6 +1122,7 @@ static int write_midx_internal(struct repository *r, const char *object_dir,
11221122
m = m->base_midx;
11231123
}
11241124
} else if (ctx.m && fill_packs_from_midx(&ctx)) {
1125+
result = 1;
11251126
goto cleanup;
11261127
}
11271128

t/t5319-multi-pack-index.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1100,7 +1100,10 @@ test_expect_success 'load reverse index when missing .idx, .pack' '
11001100
mv $idx.bak $idx &&
11011101
11021102
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
11041107
)
11051108
'
11061109

0 commit comments

Comments
 (0)