mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-31 09:44:59 +00:00
Added support for handling absolute paths in the glob_filtered_to_repo
method.
This commit is contained in:
parent
f9d173cbe6
commit
b4e827ef63
1 changed files with 10 additions and 2 deletions
|
@ -394,7 +394,11 @@ class Commands:
|
|||
|
||||
def glob_filtered_to_repo(self, pattern):
|
||||
try:
|
||||
raw_matched_files = list(Path(self.coder.root).glob(pattern))
|
||||
if os.path.isabs(pattern):
|
||||
# Handle absolute paths
|
||||
raw_matched_files = [Path(pattern)]
|
||||
else:
|
||||
raw_matched_files = list(Path(self.coder.root).glob(pattern))
|
||||
except ValueError as err:
|
||||
self.io.tool_error(f"Error matching {pattern}: {err}")
|
||||
raw_matched_files = []
|
||||
|
@ -403,7 +407,11 @@ class Commands:
|
|||
for fn in raw_matched_files:
|
||||
matched_files += expand_subdir(fn)
|
||||
|
||||
matched_files = [str(Path(fn).relative_to(self.coder.root)) for fn in matched_files]
|
||||
matched_files = [
|
||||
str(Path(fn).relative_to(self.coder.root))
|
||||
for fn in matched_files
|
||||
if Path(fn).is_relative_to(self.coder.root)
|
||||
]
|
||||
|
||||
# if repo, filter against it
|
||||
if self.coder.repo:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue