mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-29 16:54:59 +00:00
refactor: Split ignored_file
into ignored_file
and ignored_file_raw
This commit is contained in:
parent
17e2c02a47
commit
1c6cdb97ae
1 changed files with 6 additions and 4 deletions
|
@ -259,10 +259,14 @@ class GitRepo:
|
||||||
return str(Path(PurePosixPath((Path(self.root) / path).relative_to(self.root))))
|
return str(Path(PurePosixPath((Path(self.root) / path).relative_to(self.root))))
|
||||||
|
|
||||||
def ignored_file(self, fname):
|
def ignored_file(self, fname):
|
||||||
orig_fname = fname
|
|
||||||
if fname in self.ignore_file_cache:
|
if fname in self.ignore_file_cache:
|
||||||
return self.ignore_file_cache[fname]
|
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:
|
if self.subtree_only:
|
||||||
try:
|
try:
|
||||||
fname_path = Path(self.normalize_path(fname)).resolve()
|
fname_path = Path(self.normalize_path(fname)).resolve()
|
||||||
|
@ -291,9 +295,7 @@ class GitRepo:
|
||||||
lines,
|
lines,
|
||||||
)
|
)
|
||||||
|
|
||||||
result = self.aider_ignore_spec.match_file(fname)
|
return self.aider_ignore_spec.match_file(fname)
|
||||||
self.ignore_file_cache[orig_fname] = result
|
|
||||||
return result
|
|
||||||
|
|
||||||
def path_in_repo(self, path):
|
def path_in_repo(self, path):
|
||||||
if not self.repo:
|
if not self.repo:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue