diff options
author | Junio C Hamano <gitster@pobox.com> | 2022-03-17 01:53:08 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2022-03-17 01:53:08 +0100 |
commit | 190f9bf62a17ca6f97dee3f3818450ab2927215b (patch) | |
tree | 9535db8aff0d4abc101106628ab25be60aa7ac07 /dir.c | |
parent | Merge branch 'ab/object-file-api-updates' (diff) | |
parent | read-tree: make three-way merge sparse-aware (diff) | |
download | git-190f9bf62a17ca6f97dee3f3818450ab2927215b.tar.xz git-190f9bf62a17ca6f97dee3f3818450ab2927215b.zip |
Merge branch 'vd/sparse-read-tree'
"git read-tree" has been made to be aware of the sparse-index
feature.
* vd/sparse-read-tree:
read-tree: make three-way merge sparse-aware
read-tree: make two-way merge sparse-aware
read-tree: narrow scope of index expansion for '--prefix'
read-tree: integrate with sparse index
read-tree: expand sparse checkout test coverage
read-tree: explicitly disallow prefixes with a leading '/'
status: fix nested sparse directory diff in sparse index
sparse-index: prevent repo root from becoming sparse
Diffstat (limited to 'dir.c')
-rw-r--r-- | dir.c | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -1463,10 +1463,11 @@ static int path_in_sparse_checkout_1(const char *path, const char *end, *slash; /* - * We default to accepting a path if there are no patterns or - * they are of the wrong type. + * We default to accepting a path if the path is empty, there are no + * patterns, or the patterns are of the wrong type. */ - if (init_sparse_checkout_patterns(istate) || + if (!*path || + init_sparse_checkout_patterns(istate) || (require_cone_mode && !istate->sparse_checkout_patterns->use_cone_patterns)) return 1; |