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 <dstolee@microsoft.com> Reviewed-by: Elijah Newren <newren@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Derrick Stolee committed Apr 1, 2021 at 01:49 UTC 2227ea175f9d2660c66f1bf15e2cd1ad75c9d4ca
1 file changed +2
builtin/fsck.c
+2
@@ -883,6 +883,8 @@ int cmd_fsck(int argc, const char **argv, const char *prefix)
883 verify_index_checksum = 1;
884 verify_ce_order = 1;
885 read_cache();
886 + /* TODO: audit for interaction with sparse-index. */
887 + ensure_full_index(&the_index);
888 for (i = 0; i < active_nr; i++) {
889 unsigned int mode;
890 struct blob *blob;