Skip to content

Commit

Permalink
Update gittest to ignore system and global settings (#297)
Browse files Browse the repository at this point in the history
  • Loading branch information
andybradshaw committed Jan 3, 2023
1 parent 333ce36 commit 1216066
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions gittest/gittest.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ package gittest

import (
"io/ioutil"
"os"
"os/exec"
"runtime/debug"
"testing"
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 1216066

Please sign in to comment.