mirror of
https://github.com/Aider-AI/aider.git
synced 2025-06-04 11:45:00 +00:00
fix: Remove unnecessary file caching and simplify subtree-only check
This commit is contained in:
parent
24aa48198b
commit
103452aa21
1 changed files with 4 additions and 6 deletions
|
@ -263,17 +263,15 @@ class GitRepo:
|
||||||
return self.ignore_file_cache[fname]
|
return self.ignore_file_cache[fname]
|
||||||
|
|
||||||
result = self.ignored_file_raw(fname)
|
result = self.ignored_file_raw(fname)
|
||||||
dump(fname, result)
|
|
||||||
self.ignore_file_cache[fname] = result
|
self.ignore_file_cache[fname] = result
|
||||||
return result
|
return result
|
||||||
|
|
||||||
def ignored_file_raw(self, fname):
|
def ignored_file_raw(self, fname):
|
||||||
if self.subtree_only:
|
if self.subtree_only:
|
||||||
fname_path = Path(self.normalize_path(fname)).resolve()
|
fname_path = Path(self.normalize_path(fname))
|
||||||
cwd_path = Path.cwd().resolve()
|
cwd_path = Path(self.normalize_path(Path.cwd().relative_to(self.root)))
|
||||||
dump(fname_path)
|
|
||||||
dump(cwd_path)
|
if cwd_path not in fname_path.parents:
|
||||||
if os.path.commonpath([str(fname_path), str(cwd_path)]) != str(cwd_path):
|
|
||||||
return True
|
return True
|
||||||
|
|
||||||
if not self.aider_ignore_file or not self.aider_ignore_file.is_file():
|
if not self.aider_ignore_file or not self.aider_ignore_file.is_file():
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue