From 1c6cdb97ae6da0def5b18308daa5f36c2307ac20 Mon Sep 17 00:00:00 2001 From: "Paul Gauthier (aider)" Date: Thu, 1 Aug 2024 16:25:41 -0300 Subject: [PATCH] refactor: Split `ignored_file` into `ignored_file` and `ignored_file_raw` --- aider/repo.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/aider/repo.py b/aider/repo.py index 6ec4a0f4a..41b0b5d8a 100644 --- a/aider/repo.py +++ b/aider/repo.py @@ -259,10 +259,14 @@ class GitRepo: return str(Path(PurePosixPath((Path(self.root) / path).relative_to(self.root)))) def ignored_file(self, fname): - orig_fname = fname if fname in self.ignore_file_cache: return self.ignore_file_cache[fname] + result = self.ignored_file_raw(fname) + self.ignore_file_cache[fname] = result + return result + + def ignored_file_raw(self, fname): if self.subtree_only: try: fname_path = Path(self.normalize_path(fname)).resolve() @@ -291,9 +295,7 @@ class GitRepo: lines, ) - result = self.aider_ignore_spec.match_file(fname) - self.ignore_file_cache[orig_fname] = result - return result + return self.aider_ignore_spec.match_file(fname) def path_in_repo(self, path): if not self.repo: