diff options
author | Victoria Dye <vdye@github.com> | 2021-11-23 00:20:32 +0000 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2021-11-24 16:32:38 -0800 |
commit | b93fea08d24b0ceb498445cc80c91e26a6bff29b (patch) | |
tree | 7f8a5a42a3c0faae3c1127e165eae5199319f531 /sparse-index.h | |
parent | 13f69f30826001d6a98a36854d0c92a61d0dfcb8 (diff) | |
download | git-b93fea08d24b0ceb498445cc80c91e26a6bff29b.tar.gz |
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>
Diffstat (limited to 'sparse-index.h')
-rw-r--r-- | sparse-index.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/sparse-index.h b/sparse-index.h index 9f3d7bc7fa..656bd835b2 100644 --- a/sparse-index.h +++ b/sparse-index.h @@ -4,6 +4,7 @@ struct index_state; #define SPARSE_INDEX_MEMORY_ONLY (1 << 0) int convert_to_sparse(struct index_state *istate, int flags); +void ensure_correct_sparsity(struct index_state *istate); /* * Some places in the codebase expect to search for a specific path. |