MCPcopy
hub / github.com/cli/cli / withIsolatedGitConfig

Function withIsolatedGitConfig

pkg/cmd/auth/shared/gitcredentials/helper_config_test.go:16–27  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

14)
15
16func withIsolatedGitConfig(t *testing.T) {
17 t.Helper()
18
19 // https://git-scm.com/docs/git-config#ENVIRONMENT
20 // Set the global git config to a temporary file
21 tmpDir := t.TempDir()
22 configFile := filepath.Join(tmpDir, ".gitconfig")
23 t.Setenv("GIT_CONFIG_GLOBAL", configFile)
24
25 // And disable git reading the system config
26 t.Setenv("GIT_CONFIG_NOSYSTEM", "true")
27}
28
29func configureTestCredentialHelper(t *testing.T, key string) {
30 t.Helper()

Calls 2

JoinMethod · 0.80
HelperMethod · 0.65

Tested by

no test coverage detected