Stop descending into excluded directories
Docs / docs (push) Canceled after 0s
Docs / deploy (push) Canceled after 0s

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:
T. R. Bernstein
2026-09-13 23:15:21 +02:00
parent 134034f3ea
commit c79691cb6f
2 changed files with 16 additions and 9 deletions
@@ -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])
}
}
}