From 33ee100a499f544222f23f1c593053b1e10af58b Mon Sep 17 00:00:00 2001 From: Andy Bradshaw Date: Thu, 15 Dec 2022 13:52:16 -0500 Subject: [PATCH] Update gittest to ignore system and global settings --- gittest/gittest.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/gittest/gittest.go b/gittest/gittest.go index 8cbea41f..f3163629 100644 --- a/gittest/gittest.go +++ b/gittest/gittest.go @@ -6,6 +6,7 @@ package gittest import ( "io/ioutil" + "os" "os/exec" "runtime/debug" "testing" @@ -45,6 +46,7 @@ func Merge(t *testing.T, gitDir, branch string) { func RunGitCommand(t *testing.T, gitDir string, args ...string) string { cmd := exec.Command("git", args...) cmd.Dir = gitDir + cmd.Env = append(os.Environ(), "GIT_CONFIG_SYSTEM=''", "GIT_CONFIG_GLOBAL=''") output, err := cmd.CombinedOutput() requireNoError(t, err, string(output)) return string(output)