sparse-index: complete partial expansion
[git/debian.git] / sparse-index.h
blobb1f2cdbb1649db605be639db5d0fdce6cec178f4
1 #ifndef SPARSE_INDEX_H__
2 #define SPARSE_INDEX_H__
4 struct index_state;
5 #define SPARSE_INDEX_MEMORY_ONLY (1 << 0)
6 int convert_to_sparse(struct index_state *istate, int flags);
7 void ensure_correct_sparsity(struct index_state *istate);
8 void clear_skip_worktree_from_present_files(struct index_state *istate);
11 * Some places in the codebase expect to search for a specific path.
12 * This path might be outside of the sparse-checkout definition, in
13 * which case a sparse-index may not contain a path for that index.
15 * Given an index and a path, check to see if a leading directory for
16 * 'path' exists in the index as a sparse directory. In that case,
17 * expand that sparse directory to a full range of cache entries and
18 * populate the index accordingly.
20 void expand_to_path(struct index_state *istate,
21 const char *path, size_t pathlen, int icase);
23 struct repository;
24 int set_sparse_index_config(struct repository *repo, int enable);
26 struct pattern_list;
28 /**
29 * Scan the given index and compare its entries to the given pattern list.
30 * If the index is sparse and the pattern list uses cone mode patterns,
31 * then modify the index to contain the all of the file entries within that
32 * new pattern list. This expands sparse directories only as far as needed.
34 * If the pattern list is NULL or does not use cone mode patterns, then the
35 * index is expanded to a full index.
37 void expand_index(struct index_state *istate, struct pattern_list *pl);
39 #endif