From 1eafde6a3d70a73b05eaaaae7b91cc29707db707 Mon Sep 17 00:00:00 2001 From: viyatb-oai Date: Mon, 1 Jun 2026 15:58:32 -0700 Subject: [PATCH] test: use relative git metadata paths Co-authored-by: Codex noreply@openai.com --- codex-rs/core/src/config/config_tests.rs | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/codex-rs/core/src/config/config_tests.rs b/codex-rs/core/src/config/config_tests.rs index 0a6406fa60..3a32dc8d0d 100644 --- a/codex-rs/core/src/config/config_tests.rs +++ b/codex-rs/core/src/config/config_tests.rs @@ -827,13 +827,9 @@ 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)); - 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)); + assert!(file_system.can_write_path_with_cwd(Path::new(".git/index"), cwd)); + assert!(!file_system.can_write_path_with_cwd(Path::new(".git/config"), cwd)); + assert!(!file_system.can_write_path_with_cwd(Path::new(".git/hooks/pre-commit"), cwd)); Ok(()) }