invoke recursive discovery and loading newly found files before finalizing patterns

This commit is contained in:
John Evans 2025-10-03 08:58:58 -04:00
parent 1a9e2648dd
commit 8031ae1877

View file

@ -59,6 +59,16 @@ export class GitIgnoreController extends BaseIgnoreController {
}
}
// Also discover arbitrary nested .gitignore files across the workspace
await this.findGitignoreFilesRecursively(this.cwd)
// Load any files discovered by recursion that weren't loaded yet
for (const p of this.gitignoreFiles) {
if (!this.gitignoreContents.has(p)) {
await this.loadGitignoreFile(p)
}
}
// Always ignore .gitignore files themselves
this.ignoreInstance.add(".gitignore")
} catch (error) {