Stop descending into excluded directories
The resolver skipped an excluded directory in its result but still walked its subtree, so watches were installed below names such as `.git` or `node_modules`. Exclusion now prunes the walk.
This commit is contained in:
@@ -14,4 +14,14 @@ struct DirectoryResolverTests {
|
||||
#expect(directories.map { $0.description } == [dir, "\(dir)/Subfolder", subDirectory])
|
||||
}
|
||||
}
|
||||
|
||||
@Test func doesNotDescendIntoExcludedDirectories() async throws {
|
||||
try await withTempDir { dir in
|
||||
let excludedSubdirectory = "\(dir)/Excluded/Inside"
|
||||
try FileManager.default.createDirectory(atPath: excludedSubdirectory, withIntermediateDirectories: true)
|
||||
let directories = try await DirectoryResolver.resolve(dir, excluding: ["Excluded"])
|
||||
|
||||
#expect(directories.map { $0.description } == [dir])
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user