From 8440e881c0979d1222638f8bbef27c3c4266e662 Mon Sep 17 00:00:00 2001 From: "Paul Gauthier (aider)" Date: Tue, 4 Feb 2025 13:10:45 -0800 Subject: [PATCH] fix: Use relative path for matching files against .gitignore patterns --- aider/watch.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aider/watch.py b/aider/watch.py index fb3899e6b..5a305882e 100644 --- a/aider/watch.py +++ b/aider/watch.py @@ -120,7 +120,7 @@ class FileWatcher: roots_to_watch = [ str(path) for path in self.root.iterdir() - if not self.gitignore_spec.match_file(path.name) + if not self.gitignore_spec.match_file(str(path.relative_to(self.root))) ] # Fallback to watching root if all top-level items are filtered out if not roots_to_watch: