From e81625e334a240a88359d9c2f68e974e212a2934 Mon Sep 17 00:00:00 2001 From: Samuel K Date: Tue, 5 May 2026 17:40:54 -0500 Subject: [PATCH] fix(test): isolate GPG signing key unit tests from host git config --- cmd/ssh_test.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/cmd/ssh_test.go b/cmd/ssh_test.go index a0f8bcafc..afc2df2cd 100644 --- a/cmd/ssh_test.go +++ b/cmd/ssh_test.go @@ -14,7 +14,11 @@ func writeGitConfig(t *testing.T, content string) { t.Setenv("HOME", home) t.Setenv("XDG_CONFIG_HOME", home) t.Setenv("GIT_CONFIG_GLOBAL", filepath.Join(home, ".gitconfig")) - err := os.WriteFile(filepath.Join(home, ".gitconfig"), []byte(content), 0o600) + t.Setenv("GIT_CONFIG_SYSTEM", "/dev/null") + t.Setenv("GIT_DIR", filepath.Join(home, ".git")) + err := os.MkdirAll(filepath.Join(home, ".git"), 0o750) + assert.NoError(t, err) + err = os.WriteFile(filepath.Join(home, ".gitconfig"), []byte(content), 0o600) assert.NoError(t, err) }