From 26ce6873cd02fd381bdce026046c262a9fd79eba Mon Sep 17 00:00:00 2001 From: Chris Bookholt Date: Mon, 6 Jul 2026 16:13:28 -0700 Subject: [PATCH] test(git): assert Windows sharing violation --- codex-rs/git-utils/src/git_command_tests.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/codex-rs/git-utils/src/git_command_tests.rs b/codex-rs/git-utils/src/git_command_tests.rs index ab563f94f9..b0a77aac26 100644 --- a/codex-rs/git-utils/src/git_command_tests.rs +++ b/codex-rs/git-utils/src/git_command_tests.rs @@ -1599,7 +1599,12 @@ fn active_worktree_identity_pins_repository_for_runner_lifetime() { let error = std::fs::rename(&root, &moved_root) .expect_err("live repository identity handle must block replacement"); - assert_eq!(error.kind(), io::ErrorKind::PermissionDenied, "{error}"); + const WINDOWS_ERROR_SHARING_VIOLATION: i32 = 32; + assert_eq!( + error.raw_os_error(), + Some(WINDOWS_ERROR_SHARING_VIOLATION), + "{error}" + ); assert!(root.join(".git").is_dir()); assert!(!moved_root.exists());