From 8031ae1877b20123e6f8faaf6dbad7a5b2fc5b25 Mon Sep 17 00:00:00 2001 From: John Evans Date: Fri, 3 Oct 2025 08:58:58 -0400 Subject: [PATCH] invoke recursive discovery and loading newly found files before finalizing patterns --- src/core/ignore/GitIgnoreController.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/core/ignore/GitIgnoreController.ts b/src/core/ignore/GitIgnoreController.ts index e1be06bde5..ca1a89b91a 100644 --- a/src/core/ignore/GitIgnoreController.ts +++ b/src/core/ignore/GitIgnoreController.ts @@ -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) {