зеркало из https://github.com/microsoft/git.git
virtualfilesystem: check if directory is included
Add check to see if a directory is included in the virtualfilesystem before checking the directory hashmap. This allows a directory entry like foo/ to find all untracked files in subdirectories.
This commit is contained in:
Родитель
0dcea80534
Коммит
36f84e957b
|
@ -222,6 +222,8 @@ test_expect_success 'verify folder entries include all files' '
|
||||||
cat > expected <<-\EOF &&
|
cat > expected <<-\EOF &&
|
||||||
?? dir1/a
|
?? dir1/a
|
||||||
?? dir1/b
|
?? dir1/b
|
||||||
|
?? dir1/dir2/a
|
||||||
|
?? dir1/dir2/b
|
||||||
?? dir1/untracked.txt
|
?? dir1/untracked.txt
|
||||||
EOF
|
EOF
|
||||||
test_cmp expected actual
|
test_cmp expected actual
|
||||||
|
|
|
@ -232,6 +232,10 @@ int is_excluded_from_virtualfilesystem(const char *pathname, int pathlen, int dt
|
||||||
}
|
}
|
||||||
|
|
||||||
if (dtype == DT_DIR) {
|
if (dtype == DT_DIR) {
|
||||||
|
int ret = is_included_in_virtualfilesystem(pathname, pathlen);
|
||||||
|
if (ret > 0)
|
||||||
|
return 0;
|
||||||
|
|
||||||
if (!parent_directory_hashmap.tablesize && virtual_filesystem_data.len)
|
if (!parent_directory_hashmap.tablesize && virtual_filesystem_data.len)
|
||||||
initialize_parent_directory_hashmap(&parent_directory_hashmap, &virtual_filesystem_data);
|
initialize_parent_directory_hashmap(&parent_directory_hashmap, &virtual_filesystem_data);
|
||||||
if (!parent_directory_hashmap.tablesize)
|
if (!parent_directory_hashmap.tablesize)
|
||||||
|
|
Загрузка…
Ссылка в новой задаче