sparse-index: recompute cache-tree
commitf934f1b47fb56d18b2b81d9288590e03e9a0ed23
authorDerrick Stolee <dstolee@microsoft.com>
Tue, 29 Jun 2021 02:13:05 +0000 (29 02:13 +0000)
committerJunio C Hamano <gitster@pobox.com>
Wed, 14 Jul 2021 22:05:53 +0000 (14 15:05 -0700)
tree68edab13b65236d75b315b29165521b6363e3c17
parentdaa1acefc55bb6492c00519634e0a7622b3b6d69
sparse-index: recompute cache-tree

When some commands run with command_requires_full_index=1, then the
index can get in a state where the in-memory cache tree is actually
equal to the sparse index's cache tree instead of the full one.

This results in incorrect entry_count values. By clearing the cache
tree before converting to sparse, we avoid this issue.

Signed-off-by: Derrick Stolee <dstolee@microsoft.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
sparse-index.c