8994: Check for subdirs in vfs loader exclusions. r=matklad a=ammkrn

The current logic used to transfer global_excludes into vfs exclusions
only transfers global_excludes that are the parent of an item in
dirs.include.
This commit additionally adds an item from global_exclude to the vfs
exclusions if the global_exclude is a child of an included item.

Co-authored-by: ammkrn <ammkrn@tuta.io>
This commit is contained in:
bors[bot] 2021-05-25 16:40:57 +00:00 committed by GitHub
commit 3b10f9e714
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -455,7 +455,11 @@ impl ProjectFolders {
dirs.include.extend(root.include);
dirs.exclude.extend(root.exclude);
for excl in global_excludes {
if dirs.include.iter().any(|incl| incl.starts_with(excl)) {
if dirs
.include
.iter()
.any(|incl| incl.starts_with(excl) || excl.starts_with(incl))
{
dirs.exclude.push(excl.clone());
}
}