test: normalize limited git write paths

Co-authored-by: Codex noreply@openai.com
This commit is contained in:
viyatb-oai
2026-06-01 15:16:02 -07:00
co-authored by Codex noreply@openai.com
parent 57bd99c83c
commit 6c55eb9226
+7 -5
View File
@@ -826,12 +826,14 @@ async fn sandbox_workspace_write_allow_limited_git_writes_keeps_config_and_hooks
)
.await?;
let file_system = config.permissions.file_system_sandbox_policy();
let cwd = config.cwd.as_path();
let git_dir = config.cwd.join(".git");
let git_config = git_dir.join("config");
let git_hooks = git_dir.join("hooks");
assert!(file_system.can_write_path_with_cwd(git_dir.join("index").as_path(), cwd.path()));
assert!(!file_system.can_write_path_with_cwd(git_config.as_path(), cwd.path()));
assert!(
!file_system.can_write_path_with_cwd(git_hooks.join("pre-commit").as_path(), cwd.path())
);
assert!(file_system.can_write_path_with_cwd(git_dir.join("index").as_path(), cwd));
assert!(!file_system.can_write_path_with_cwd(git_config.as_path(), cwd));
assert!(!file_system.can_write_path_with_cwd(git_hooks.join("pre-commit").as_path(), cwd));
Ok(())
}