MCPcopy
hub / github.com/git-lfs/git-lfs / fetchEnvironmentInternal

Function fetchEnvironmentInternal

subprocess/subprocess.go:212–227  ·  view source on GitHub ↗

fetchEnvironmentInternal should only be called from fetchEnvironment or ResetEnvironment, who will hold the required lock.

()

Source from the content-addressed store, hash-verified

210// fetchEnvironmentInternal should only be called from fetchEnvironment or
211// ResetEnvironment, who will hold the required lock.
212func fetchEnvironmentInternal() []string {
213 if env != nil {
214 return env
215 }
216
217 realEnv := os.Environ()
218 env = make([]string, 0, len(realEnv))
219
220 for _, kv := range realEnv {
221 if strings.HasPrefix(kv, traceEnv) || strings.HasPrefix(kv, superPrefixEnv) {
222 continue
223 }
224 env = append(env, kv)
225 }
226 return env
227}
228
229// ResetEnvironment resets the cached environment that's used in subprocess
230// calls.

Callers 2

fetchEnvironmentFunction · 0.85
ResetEnvironmentFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected