From b6994aaceefd35490be58fbf7422a55e99532dc3 Mon Sep 17 00:00:00 2001 From: "Paul Gauthier (aider)" Date: Tue, 6 Aug 2024 10:25:27 -0300 Subject: [PATCH] fix: Normalize current working directory in `ignored_file_raw` method --- aider/repo.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/aider/repo.py b/aider/repo.py index e0cf98fdd..5403c5845 100644 --- a/aider/repo.py +++ b/aider/repo.py @@ -307,9 +307,9 @@ class GitRepo: def ignored_file_raw(self, fname): if self.subtree_only: fname_path = Path(self.normalize_path(fname)) - cwd_path = Path(self.normalize_path(Path.cwd())) + cwd_path = Path.cwd().resolve().relative_to(Path(self.root).resolve()) - if cwd_path not in fname_path.parents: + if cwd_path not in fname_path.parents and fname_path != cwd_path: return True if not self.aider_ignore_file or not self.aider_ignore_file.is_file():