Derrick Stolee | 3964fc2 | 2021-03-30 13:10:47 +0000 | [diff] [blame] | 1 | #ifndef SPARSE_INDEX_H__ |
| 2 | #define SPARSE_INDEX_H__ |
| 3 | |
| 4 | struct index_state; |
Derrick Stolee | ce7a9f0 | 2021-09-08 01:42:32 +0000 | [diff] [blame] | 5 | #define SPARSE_INDEX_MEMORY_ONLY (1 << 0) |
| 6 | int convert_to_sparse(struct index_state *istate, int flags); |
Victoria Dye | b93fea0 | 2021-11-23 00:20:32 +0000 | [diff] [blame] | 7 | void ensure_correct_sparsity(struct index_state *istate); |
Derrick Stolee | 3964fc2 | 2021-03-30 13:10:47 +0000 | [diff] [blame] | 8 | |
Derrick Stolee | 71f82d0 | 2021-04-12 21:08:16 +0000 | [diff] [blame] | 9 | /* |
| 10 | * Some places in the codebase expect to search for a specific path. |
| 11 | * This path might be outside of the sparse-checkout definition, in |
| 12 | * which case a sparse-index may not contain a path for that index. |
| 13 | * |
| 14 | * Given an index and a path, check to see if a leading directory for |
| 15 | * 'path' exists in the index as a sparse directory. In that case, |
| 16 | * expand that sparse directory to a full range of cache entries and |
| 17 | * populate the index accordingly. |
| 18 | */ |
| 19 | void expand_to_path(struct index_state *istate, |
| 20 | const char *path, size_t pathlen, int icase); |
| 21 | |
Derrick Stolee | 122ba1f | 2021-03-30 13:11:00 +0000 | [diff] [blame] | 22 | struct repository; |
| 23 | int set_sparse_index_config(struct repository *repo, int enable); |
| 24 | |
Derrick Stolee | 3964fc2 | 2021-03-30 13:10:47 +0000 | [diff] [blame] | 25 | #endif |