Skip to content

Commit 8031ae1

Browse files
committed
invoke recursive discovery and loading newly found files before finalizing patterns
1 parent 1a9e264 commit 8031ae1

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/core/ignore/GitIgnoreController.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,16 @@ export class GitIgnoreController extends BaseIgnoreController {
5959
}
6060
}
6161

62+
// Also discover arbitrary nested .gitignore files across the workspace
63+
await this.findGitignoreFilesRecursively(this.cwd)
64+
65+
// Load any files discovered by recursion that weren't loaded yet
66+
for (const p of this.gitignoreFiles) {
67+
if (!this.gitignoreContents.has(p)) {
68+
await this.loadGitignoreFile(p)
69+
}
70+
}
71+
6272
// Always ignore .gitignore files themselves
6373
this.ignoreInstance.add(".gitignore")
6474
} catch (error) {

0 commit comments

Comments
 (0)