]>
Commit | Line | Data |
---|---|---|
3964fc2a DS |
1 | #ifndef SPARSE_INDEX_H__ |
2 | #define SPARSE_INDEX_H__ | |
3 | ||
4 | struct index_state; | |
ce7a9f01 | 5 | #define SPARSE_INDEX_MEMORY_ONLY (1 << 0) |
cfde4cd6 | 6 | int is_sparse_index_allowed(struct index_state *istate, int flags); |
ce7a9f01 | 7 | int convert_to_sparse(struct index_state *istate, int flags); |
b93fea08 | 8 | void ensure_correct_sparsity(struct index_state *istate); |
af6a5187 | 9 | void clear_skip_worktree_from_present_files(struct index_state *istate); |
3964fc2a | 10 | |
71f82d03 DS |
11 | /* |
12 | * Some places in the codebase expect to search for a specific path. | |
13 | * This path might be outside of the sparse-checkout definition, in | |
14 | * which case a sparse-index may not contain a path for that index. | |
15 | * | |
16 | * Given an index and a path, check to see if a leading directory for | |
17 | * 'path' exists in the index as a sparse directory. In that case, | |
18 | * expand that sparse directory to a full range of cache entries and | |
19 | * populate the index accordingly. | |
20 | */ | |
21 | void expand_to_path(struct index_state *istate, | |
22 | const char *path, size_t pathlen, int icase); | |
23 | ||
122ba1f7 DS |
24 | struct repository; |
25 | int set_sparse_index_config(struct repository *repo, int enable); | |
26 | ||
dce241b0 DS |
27 | struct pattern_list; |
28 | ||
29 | /** | |
30 | * Scan the given index and compare its entries to the given pattern list. | |
31 | * If the index is sparse and the pattern list uses cone mode patterns, | |
32 | * then modify the index to contain the all of the file entries within that | |
33 | * new pattern list. This expands sparse directories only as far as needed. | |
34 | * | |
35 | * If the pattern list is NULL or does not use cone mode patterns, then the | |
36 | * index is expanded to a full index. | |
37 | */ | |
38 | void expand_index(struct index_state *istate, struct pattern_list *pl); | |
39 | ||
3964fc2a | 40 | #endif |