Skip to content

Commit 2227ea1

Browse files
derrickstoleegitster
authored andcommitted
fsck: ensure full index
When verifying all blobs reachable from the index, ensure that a sparse index has been expanded to a full one to avoid missing some blobs. Signed-off-by: Derrick Stolee <[email protected]> Reviewed-by: Elijah Newren <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 48b3c7d commit 2227ea1

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

builtin/fsck.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -883,6 +883,8 @@ int cmd_fsck(int argc, const char **argv, const char *prefix)
883883
verify_index_checksum = 1;
884884
verify_ce_order = 1;
885885
read_cache();
886+
/* TODO: audit for interaction with sparse-index. */
887+
ensure_full_index(&the_index);
886888
for (i = 0; i < active_nr; i++) {
887889
unsigned int mode;
888890
struct blob *blob;

0 commit comments

Comments
 (0)