mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-25 14:55:00 +00:00
fix: Use os.path.commonpath() to check if fname_path is below cwd_path
This commit is contained in:
parent
f26862d92c
commit
24aa48198b
1 changed files with 5 additions and 8 deletions
|
@ -269,14 +269,11 @@ class GitRepo:
|
||||||
|
|
||||||
def ignored_file_raw(self, fname):
|
def ignored_file_raw(self, fname):
|
||||||
if self.subtree_only:
|
if self.subtree_only:
|
||||||
try:
|
|
||||||
fname_path = Path(self.normalize_path(fname)).resolve()
|
fname_path = Path(self.normalize_path(fname)).resolve()
|
||||||
cwd_path = Path.cwd().resolve()
|
cwd_path = Path.cwd().resolve()
|
||||||
dump(fname_path)
|
dump(fname_path)
|
||||||
dump(cwd_path)
|
dump(cwd_path)
|
||||||
if not fname_path.is_relative_to(cwd_path):
|
if os.path.commonpath([str(fname_path), str(cwd_path)]) != str(cwd_path):
|
||||||
return True
|
|
||||||
except ValueError:
|
|
||||||
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