summaryrefslogtreecommitdiff
path: root/sparse-index.h
diff options
context:
space:
mode:
authorDerrick Stolee <dstolee@microsoft.com>2021-03-30 13:11:00 (GMT)
committerJunio C Hamano <gitster@pobox.com>2021-03-30 19:57:48 (GMT)
commit122ba1f7b52612e197db76aded1f9681b80f3085 (patch)
tree96c6481a4c55e07f93667a601b475a6e759c4195 /sparse-index.h
parent58300f4743231724686d9ddf481aeefa4f90d2f7 (diff)
downloadgit-122ba1f7b52612e197db76aded1f9681b80f3085.zip
git-122ba1f7b52612e197db76aded1f9681b80f3085.tar.gz
git-122ba1f7b52612e197db76aded1f9681b80f3085.tar.bz2
sparse-checkout: toggle sparse index from builtin
The sparse index extension is used to signal that index writes should be in sparse mode. This was only updated using GIT_TEST_SPARSE_INDEX=1. Add a '--[no-]sparse-index' option to 'git sparse-checkout init' that specifies if the sparse index should be used. It also updates the index to use the correct format, either way. Add a warning in the documentation that the use of a repository extension might reduce compatibility with third-party tools. 'git sparse-checkout init' already sets extension.worktreeConfig, which places most sparse-checkout users outside of the scope of most third-party tools. Update t1092-sparse-checkout-compatibility.sh to use this CLI instead of GIT_TEST_SPARSE_INDEX=1. Signed-off-by: Derrick Stolee <dstolee@microsoft.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'sparse-index.h')
-rw-r--r--sparse-index.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/sparse-index.h b/sparse-index.h
index 64380e1..39dcc85 100644
--- a/sparse-index.h
+++ b/sparse-index.h
@@ -5,4 +5,7 @@ struct index_state;
void ensure_full_index(struct index_state *istate);
int convert_to_sparse(struct index_state *istate);
+struct repository;
+int set_sparse_index_config(struct repository *repo, int enable);
+
#endif