Handle absolute workspace globs
This commit is contained in:
+6
-1
@@ -2169,10 +2169,15 @@ print("\n".join(matches) if matches else "(no matches)")
|
||||
if result.exit_code != 0:
|
||||
raise ToolExecutionError(result.stdout.strip() or 'remote glob_search failed')
|
||||
return result.stdout.strip() or '(no matches)'
|
||||
root_resolved = context.root.resolve()
|
||||
if Path(pattern).is_absolute():
|
||||
try:
|
||||
pattern = str(Path(pattern).resolve().relative_to(root_resolved))
|
||||
except ValueError:
|
||||
return '(no matches)'
|
||||
matches = sorted(context.root.glob(pattern))
|
||||
if not matches:
|
||||
return '(no matches)'
|
||||
root_resolved = context.root.resolve()
|
||||
validated: list[str] = []
|
||||
for path in matches:
|
||||
try:
|
||||
|
||||
Reference in New Issue
Block a user