You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
test: git_hardening fixture commits fail when commit.gpgsign=true is in user's global git config #57
On a workstation where global git config has commit.gpgsign=true pointing at a GPG/SSH signing agent (e.g. 1Password, Krypton, yubikey-agent) that isn't always available, cargo test --test git_hardening fails 5/6 tests:
test git_external_diff_env_is_stripped ... FAILED
test git_config_global_env_pointing_at_evil_gitconfig_is_stripped ... FAILED
test benign_git_log_still_succeeds ... FAILED
test benign_git_status_still_succeeds ... FAILED
test git_config_count_env_injection_is_stripped ... FAILED
test c_diff_external_arg_is_rejected_with_deny_error ... ok
All failures panic at tests/git_hardening.rs:60:
git ["commit", "-q", "-m", "init"] failed: stderr=error: 1Password: agent returned an error
fatal: failed to write commit object
The one passing test (c_diff_external_arg_is_rejected_with_deny_error) is the arg-only deny path that doesn't use the make_repo() fixture.
Root cause
tests/git_hardening.rs::make_repo() runs git commit to seed a fixture repo. It explicitly sets GIT_AUTHOR_* / GIT_COMMITTER_* but inherits the user's global git config, including commit.gpgsign=true. When the signing agent isn't available, the commit fails and the entire test setup falls over.
Fix
Add -c commit.gpgsign=false -c tag.gpgsign=false -c gpg.format=openpgp to the test's git invocations (or, more aggressively, isolate the test process with GIT_CONFIG_GLOBAL=/dev/null). Either way the test should be hermetic against the user's global git config.
Scope
Not blocking any feature work — confirmed the same failures occur on contextcrawler/develop tip independent of any branch. Recommend a small standalone PR.
Activity
Merge pull request #60 from thehoff/fix/git-hardening-fixture-57
harden(gh/glab/gt): zero-trust env strip + arg deny + passthrough fix (…
test: harden git_hardening fixture against host gpg-sign config (theh…