diff options
author | Junio C Hamano <gitster@pobox.com> | 2022-06-03 23:30:35 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2022-06-03 23:30:35 +0200 |
commit | c276c21da6d055060b1c216de1b1c04fb058425f (patch) | |
tree | 6db5f39ef5a4b55adbd3401db6fc63fe25b7694e /cache.h | |
parent | Merge branch 'tb/midx-race-in-pack-objects' (diff) | |
parent | sparse-checkout: integrate with sparse index (diff) | |
download | git-c276c21da6d055060b1c216de1b1c04fb058425f.tar.xz git-c276c21da6d055060b1c216de1b1c04fb058425f.zip |
Merge branch 'ds/sparse-sparse-checkout'
"sparse-checkout" learns to work well with the sparse-index
feature.
* ds/sparse-sparse-checkout:
sparse-checkout: integrate with sparse index
p2000: add test for 'git sparse-checkout [add|set]'
sparse-index: complete partial expansion
sparse-index: partially expand directories
sparse-checkout: --no-sparse-index needs a full index
cache-tree: implement cache_tree_find_path()
sparse-index: introduce partially-sparse indexes
sparse-index: create expand_index()
t1092: stress test 'git sparse-checkout set'
t1092: refactor 'sparse-index contents' test
Diffstat (limited to 'cache.h')
-rw-r--r-- | cache.h | 33 |
1 files changed, 25 insertions, 8 deletions
@@ -310,6 +310,29 @@ struct untracked_cache; struct progress; struct pattern_list; +enum sparse_index_mode { + /* + * There are no sparse directories in the index at all. + * + * Repositories that don't use cone-mode sparse-checkout will + * always have their indexes in this mode. + */ + INDEX_EXPANDED = 0, + + /* + * The index has already been collapsed to sparse directories + * whereever possible. + */ + INDEX_COLLAPSED, + + /* + * The sparse directories that exist are outside the + * sparse-checkout boundary, but it is possible that some file + * entries could collapse to sparse directory entries. + */ + INDEX_PARTIALLY_SPARSE, +}; + struct index_state { struct cache_entry **cache; unsigned int version; @@ -323,14 +346,8 @@ struct index_state { drop_cache_tree : 1, updated_workdir : 1, updated_skipworktree : 1, - fsmonitor_has_run_once : 1, - - /* - * sparse_index == 1 when sparse-directory - * entries exist. Requires sparse-checkout - * in cone mode. - */ - sparse_index : 1; + fsmonitor_has_run_once : 1; + enum sparse_index_mode sparse_index; struct hashmap name_hash; struct hashmap dir_hash; struct object_id oid; |