diff options
author | Victoria Dye <vdye@github.com> | 2021-11-23 00:20:31 +0000 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2021-11-24 16:32:38 -0800 |
commit | 13f69f30826001d6a98a36854d0c92a61d0dfcb8 (patch) | |
tree | 8821622932992b632d768690d196310475cc49a2 /split-index.h | |
parent | test-read-cache.c: prepare_repo_settings after config init (diff) | |
download | tgif-13f69f30826001d6a98a36854d0c92a61d0dfcb8.tar.xz |
sparse-index: avoid unnecessary cache tree clearing
When converting a full index to sparse, clear and recreate the cache tree
only if the cache tree is not fully valid. The convert_to_sparse operation
should exit silently if a cache tree update cannot be successfully completed
(e.g., due to a conflicted entry state). However, because this failure
scenario only occurs when at least a portion of the cache tree is invalid,
we can save ourselves the cost of clearing and recreating the cache tree by
skipping the check when the cache tree is fully valid.
Helped-by: Derrick Stolee <dstolee@microsoft.com>
Co-authored-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Victoria Dye <vdye@github.com>
Reviewed-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'split-index.h')
0 files changed, 0 insertions, 0 deletions