Skip to content

Commit 2319eee

Browse files
authored
Update filesystem.py
1 parent 92fd34c commit 2319eee

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

python_agent_harness/tools/filesystem.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,9 @@ def run(self, args: dict, ctx: ToolContext) -> str:
275275
def _git_root(path: str) -> str | None:
276276
d = Path(path).resolve()
277277
for parent in [d, *d.parents]:
278-
if (parent / ".git").exists() or (parent / ".git").is_dir():
278+
# .git is a directory in a normal clone and a file in worktrees
279+
# / submodules; exists() covers both.
280+
if (parent / ".git").exists():
279281
return str(parent)
280282
return None
281283

0 commit comments

Comments
 (0)