]> git.ipfire.org Git - thirdparty/git.git/commitdiff
fsck: ensure full index
authorDerrick Stolee <dstolee@microsoft.com>
Thu, 1 Apr 2021 01:49:47 +0000 (01:49 +0000)
committerJunio C Hamano <gitster@pobox.com>
Wed, 14 Apr 2021 20:47:11 +0000 (13:47 -0700)
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>
builtin/fsck.c

index 821e7798c706dfa1b6f2ae61b7fb08a036280242..4d7f5c63ce0db31013cd2abdcc7cc8efa662b3fc 100644 (file)
@@ -883,6 +883,8 @@ int cmd_fsck(int argc, const char **argv, const char *prefix)
                verify_index_checksum = 1;
                verify_ce_order = 1;
                read_cache();
+               /* TODO: audit for interaction with sparse-index. */
+               ensure_full_index(&the_index);
                for (i = 0; i < active_nr; i++) {
                        unsigned int mode;
                        struct blob *blob;