Skip to content

Commit c21e274

Browse files
test(golang-rewrite): ignore global git config on repotest (#2068)
1 parent afde71b commit c21e274

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

internal/repotest/repotest.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,10 @@ func runCmd(cmdName string, args ...string) error {
206206
cmd.Stdout = &stdout
207207
cmd.Stderr = &stderr
208208

209+
// Global env vars
210+
// GIT_CONFIG_GLOBAL=/dev/null prevents git from looking for user settings like commit.gpgSign and user.name
211+
cmd.Env = []string{"GIT_CONFIG_GLOBAL=/dev/null"}
212+
209213
err := cmd.Run()
210214
if err != nil {
211215
// If command fails print both stderr and stdout

0 commit comments

Comments
 (0)