sparse-index: expose 'is_sparse_index_allowed()'

Expose 'is_sparse_index_allowed()' publicly so that it may be used by callers outside of 'sparse-index.c'. While no such callers exist yet, it will be used in a subsequent commit. Signed-off-by: Victoria Dye <vdye@github.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Victoria Dye committed May 10, 2022 at 23:32 UTC cfde4cd6ffdca7670b62a292b144425767fb1759
2 files changed +2 -1
sparse-index.c
+1 -1
@@ -118,7 +118,7 @@ static int index_has_unmerged_entries(struct index_state *istate)
118 return 0;
119 }
120
121 -static int is_sparse_index_allowed(struct index_state *istate, int flags)
121 +int is_sparse_index_allowed(struct index_state *istate, int flags)
122 {
123 if (!core_apply_sparse_checkout || !core_sparse_checkout_cone)
124 return 0;
sparse-index.h
+1
@@ -3,6 +3,7 @@
3
4 struct index_state;
5 #define SPARSE_INDEX_MEMORY_ONLY (1 << 0)
6 +int is_sparse_index_allowed(struct index_state *istate, int flags);
7 int convert_to_sparse(struct index_state *istate, int flags);
8 void ensure_correct_sparsity(struct index_state *istate);
9 void clear_skip_worktree_from_present_files(struct index_state *istate);