summaryrefslogtreecommitdiffstats
path: root/dir.c
diff options
context:
space:
mode:
authorDerrick Stolee <dstolee@microsoft.com>2019-11-21 23:04:43 +0100
committerJunio C Hamano <gitster@pobox.com>2019-11-22 08:11:44 +0100
commiteb42feca974a333e58c2ca0f3cfa8bf0dd421402 (patch)
tree5e9e8425ec5a8f1b9cffd3fb9226d3457a31f927 /dir.c
parentsparse-checkout: init and set in cone mode (diff)
downloadgit-eb42feca974a333e58c2ca0f3cfa8bf0dd421402.tar.xz
git-eb42feca974a333e58c2ca0f3cfa8bf0dd421402.zip
unpack-trees: hash less in cone mode
The sparse-checkout feature in "cone mode" can use the fact that the recursive patterns are "connected" to the root via parent patterns to decide if a directory is entirely contained in the sparse-checkout or entirely removed. In these cases, we can skip hashing the paths within those directories and simply set the skipworktree bit to the correct value. Signed-off-by: Derrick Stolee <dstolee@microsoft.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'dir.c')
-rw-r--r--dir.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/dir.c b/dir.c
index 35c1ca9e24..2ef92a50a0 100644
--- a/dir.c
+++ b/dir.c
@@ -1270,7 +1270,7 @@ enum pattern_match_result path_matches_pattern_list(
if (hashmap_contains_path(&pl->recursive_hashmap,
&parent_pathname)) {
- result = MATCHED;
+ result = MATCHED_RECURSIVE;
goto done;
}
@@ -1292,7 +1292,7 @@ enum pattern_match_result path_matches_pattern_list(
if (hashmap_contains_parent(&pl->recursive_hashmap,
pathname,
&parent_pathname))
- result = MATCHED;
+ result = MATCHED_RECURSIVE;
done:
strbuf_release(&parent_pathname);