diff --git a/aider/watch.py b/aider/watch.py index 42f37dbe9..ba265ef53 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(str(path.relative_to(self.root))) + if not self.gitignore_spec.match_file(str(path.relative_to(self.root)) + ("/" if path.is_dir() else "")) ] # Fallback to watching root if all top-level items are filtered out if not roots_to_watch: