mirror of
https://github.com/Aider-AI/aider.git
synced 2025-06-03 11:14: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,6 +394,10 @@ class Commands:
|
||||||
|
|
||||||
def glob_filtered_to_repo(self, pattern):
|
def glob_filtered_to_repo(self, pattern):
|
||||||
try:
|
try:
|
||||||
|
if os.path.isabs(pattern):
|
||||||
|
# Handle absolute paths
|
||||||
|
raw_matched_files = [Path(pattern)]
|
||||||
|
else:
|
||||||
raw_matched_files = list(Path(self.coder.root).glob(pattern))
|
raw_matched_files = list(Path(self.coder.root).glob(pattern))
|
||||||
except ValueError as err:
|
except ValueError as err:
|
||||||
self.io.tool_error(f"Error matching {pattern}: {err}")
|
self.io.tool_error(f"Error matching {pattern}: {err}")
|
||||||
|
@ -403,7 +407,11 @@ class Commands:
|
||||||
for fn in raw_matched_files:
|
for fn in raw_matched_files:
|
||||||
matched_files += expand_subdir(fn)
|
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 repo, filter against it
|
||||||
if self.coder.repo:
|
if self.coder.repo:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue