mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-25 06:44:59 +00:00
fix: Handle ValueError when getting relative path in ignored_file_raw
This commit is contained in:
parent
1fe2be4633
commit
8f583ca119
1 changed files with 7 additions and 1 deletions
|
@ -344,7 +344,13 @@ class GitRepo:
|
|||
def ignored_file_raw(self, fname):
|
||||
if self.subtree_only:
|
||||
fname_path = Path(self.normalize_path(fname))
|
||||
cwd_path = Path.cwd().resolve().relative_to(Path(self.root).resolve())
|
||||
try:
|
||||
cwd_path = Path.cwd().resolve().relative_to(Path(self.root).resolve())
|
||||
except ValueError:
|
||||
# Issue #1524
|
||||
# ValueError: 'C:\\dev\\squid-certbot' is not in the subpath of 'C:\\dev\\squid-certbot
|
||||
# Clearly, fname is not under cwd... so ignore it
|
||||
return True
|
||||
|
||||
if cwd_path not in fname_path.parents and fname_path != cwd_path:
|
||||
return True
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue