We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
env
1 parent 33b4b53 commit 790d3afCopy full SHA for 790d3af
internal/testutils/repoutils.go
@@ -112,8 +112,9 @@ var localEnvVars = func() map[string]bool {
112
// CleanGitEnv returns a clean environment for running `git` commands
113
// so that they won't be affected by the local environment.
114
func CleanGitEnv() []string {
115
- var env []string
116
- for _, e := range os.Environ() {
+ osEnv := os.Environ()
+ env := make([]string, 0, len(osEnv)+3)
117
+ for _, e := range osEnv {
118
i := strings.IndexByte(e, '=')
119
if i == -1 {
120
// This shouldn't happen, but if it does,
0 commit comments