From b5bd08b83d0b8b09c3a250efabd797bfc83a1573 Mon Sep 17 00:00:00 2001 From: Chris Bookholt Date: Tue, 7 Jul 2026 02:23:38 -0700 Subject: [PATCH] test(git-utils): unset Windows symlink default --- .../src/guarded_config/status_policy_tests.rs | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/codex-rs/git-utils/src/guarded_config/status_policy_tests.rs b/codex-rs/git-utils/src/guarded_config/status_policy_tests.rs index 1749139aba..45b978fbf9 100644 --- a/codex-rs/git-utils/src/guarded_config/status_policy_tests.rs +++ b/codex-rs/git-utils/src/guarded_config/status_policy_tests.rs @@ -21,6 +21,21 @@ fn run_git(cwd: &Path, args: &[&str]) { ); } +fn unset_git_config(cwd: &Path, key: &str) { + let mut command = std::process::Command::new("git"); + isolate_git_command_environment(&mut command); + let output = command + .current_dir(cwd) + .args(["config", "--unset-all", key]) + .output() + .expect("Git"); + assert!( + output.status.success() || output.status.code() == Some(5), + "git config --unset-all {key}: {}", + String::from_utf8_lossy(&output.stderr) + ); +} + fn run_isolated_config_test(test_name: &str) { let environment = tempfile::tempdir().expect("isolated Git environment"); let global_config = environment.path().join("global.gitconfig"); @@ -166,6 +181,9 @@ async fn status_replaces_filter_config_with_an_owned_helper_free_context() { } let repo = tempfile::tempdir().expect("repo"); run_git(repo.path(), &["init", "-q"]); + // Git for Windows may write this platform default during `init`. Remove it + // so this fixture actually exercises the absent-config branch everywhere. + unset_git_config(repo.path(), "core.symlinks"); std::fs::write(repo.path().join("file.txt"), "contents\n").expect("tracked file"); std::fs::write(repo.path().join(".gitattributes"), "file.txt filter=demo\n") .expect("attributes");