From 4a0100271fa239d0dc8145f1c9d1b4de63fb62f6 Mon Sep 17 00:00:00 2001 From: "Paul Gauthier (aider)" Date: Wed, 27 Nov 2024 16:19:55 -0800 Subject: [PATCH] refactor: conditionally use git root and gitignore in FileWatcher initialization --- aider/main.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/aider/main.py b/aider/main.py index ba96f0dc6..1394c8011 100644 --- a/aider/main.py +++ b/aider/main.py @@ -794,10 +794,11 @@ def main(argv=None, input=None, output=None, force_git_root=None, return_coder=F if return_coder: return coder - # ai if git_root, use gitignore - gitignore = [str(Path(root) / ".gitignore")] - # ai pass coder.root to FW! - self.file_watcher = FileWatcher(root, encoding=self.encoding, gitignores=gitignore) + if git_root: + gitignore = [str(Path(git_root) / ".gitignore")] + self.file_watcher = FileWatcher(git_root, encoding=self.encoding, gitignores=gitignore) + else: + self.file_watcher = FileWatcher(".", encoding=self.encoding) coder.show_announcements()