summaryrefslogtreecommitdiff
path: root/builtin/fsck.c
diff options
context:
space:
mode:
authorDerrick Stolee <dstolee@microsoft.com>2021-04-01 01:49:47 (GMT)
committerJunio C Hamano <gitster@pobox.com>2021-04-14 20:47:11 (GMT)
commit2227ea175f9d2660c66f1bf15e2cd1ad75c9d4ca (patch)
tree80ae2bd6ef2e93e9f4489c80a38d30359a8cf1cd /builtin/fsck.c
parent48b3c7da6c58752b0fbc73e891fd5b24c95281b1 (diff)
downloadgit-2227ea175f9d2660c66f1bf15e2cd1ad75c9d4ca.zip
git-2227ea175f9d2660c66f1bf15e2cd1ad75c9d4ca.tar.gz
git-2227ea175f9d2660c66f1bf15e2cd1ad75c9d4ca.tar.bz2
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>
Diffstat (limited to 'builtin/fsck.c')
-rw-r--r--builtin/fsck.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/builtin/fsck.c b/builtin/fsck.c
index 821e779..4d7f5c6 100644
--- a/builtin/fsck.c
+++ b/builtin/fsck.c
@@ -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;