]> git.ipfire.org Git - thirdparty/git.git/commit - sparse-index.c
sparse-index: add ensure_correct_sparsity function
authorVictoria Dye <vdye@github.com>
Tue, 23 Nov 2021 00:20:32 +0000 (00:20 +0000)
committerJunio C Hamano <gitster@pobox.com>
Thu, 25 Nov 2021 00:32:38 +0000 (16:32 -0800)
commitb93fea08d24b0ceb498445cc80c91e26a6bff29b
tree7f8a5a42a3c0faae3c1127e165eae5199319f531
parent13f69f30826001d6a98a36854d0c92a61d0dfcb8
sparse-index: add ensure_correct_sparsity function

The `ensure_correct_sparsity` function is intended to provide a means of
aligning the in-core index with the sparsity required by the repository
settings and other properties of the index. The function first checks
whether a sparse index is allowed (per repository & sparse checkout pattern
settings). If the sparse index may be used, the index is converted to
sparse; otherwise, it is explicitly expanded with `ensure_full_index`.

Helped-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>
sparse-index.c
sparse-index.h