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>
This commit is contained in:

committed by
Junio C Hamano

parent
af09ce24a9
commit
eb42feca97
4
dir.c
4
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);
|
||||
|
Reference in New Issue
Block a user