MCPcopy Create free account
hub / github.com/cli/cli / fillCredentials

Function fillCredentials

pkg/cmd/auth/shared/gitcredentials/updater_test.go:28–42  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

26}
27
28func fillCredentials(t *testing.T) string {
29 gc := &git.Client{}
30 fillCmd, err := gc.Command(context.Background(), "credential", "fill")
31 require.NoError(t, err)
32
33 fillCmd.Stdin = bytes.NewBufferString(heredoc.Docf(`
34 protocol=https
35 host=%s
36 `, "github.com"))
37
38 b, err := fillCmd.Output()
39 require.NoError(t, err)
40
41 return string(b)
42}
43
44func TestUpdateAddsNewCredentials(t *testing.T) {
45 // Given we have an isolated git config and we're using the built in store credential helper

Callers 2

Calls 2

CommandMethod · 0.95
OutputMethod · 0.65

Tested by

no test coverage detected