fix: expand ~ in git mount target paths to avoid /tmp
This commit is contained in:
@@ -110,6 +110,13 @@ async def _resolve_single_git_mount(
|
|||||||
logger.warning("Invalid git mount skipped: missing remote_url or target_path")
|
logger.warning("Invalid git mount skipped: missing remote_url or target_path")
|
||||||
return []
|
return []
|
||||||
|
|
||||||
|
# Expand ~ to the working directory or a default home path
|
||||||
|
# (The container may have HOME set to /tmp, so we resolve it ourselves)
|
||||||
|
if target_path.startswith("~"):
|
||||||
|
home = working_directory or "/home/user"
|
||||||
|
target_path = home + target_path[1:]
|
||||||
|
logger.info("Expanded ~ to %s", target_path)
|
||||||
|
|
||||||
# Resolve relative target paths against working directory
|
# Resolve relative target paths against working directory
|
||||||
if target_path and not target_path.startswith("/"):
|
if target_path and not target_path.startswith("/"):
|
||||||
base = working_directory or "/home/user"
|
base = working_directory or "/home/user"
|
||||||
|
|||||||
Reference in New Issue
Block a user