From 121606640cf5909abb402647320bb7e85eedbcd0 Mon Sep 17 00:00:00 2001 From: Andy Bradshaw Date: Tue, 3 Jan 2023 13:50:34 -0500 Subject: [PATCH] Update gittest to ignore system and global settings (#297) --- 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)