Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVictoria Dye <vdye@github.com>2021-11-23 03:20:32 +0300
committerJunio C Hamano <gitster@pobox.com>2021-11-25 03:32:38 +0300
commitb93fea08d24b0ceb498445cc80c91e26a6bff29b (patch)
tree7f8a5a42a3c0faae3c1127e165eae5199319f531 /sparse-index.h
parent13f69f30826001d6a98a36854d0c92a61d0dfcb8 (diff)
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.h1
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.