MCPcopy
hub / github.com/cli/cli / Setup

Method Setup

pkg/cmd/auth/shared/git_credential.go:80–89  ·  view source on GitHub ↗
(hostname, username, authToken string)

Source from the content-addressed store, hash-verified

78}
79
80func (flow *GitCredentialFlow) Setup(hostname, username, authToken string) error {
81 // If there is no credential helper configured then we will set ourselves up as
82 // the credential helper for this host.
83 if !flow.helper.IsConfigured() {
84 return flow.HelperConfig.ConfigureOurs(hostname)
85 }
86
87 // Otherwise, we'll tell git to inform the existing credential helper of the new credentials.
88 return flow.Updater.Update(hostname, username, authToken)
89}

Callers 5

refreshRunFunction · 0.95
TestSetup_setOurs_nonGHFunction · 0.95
LoginFunction · 0.80

Calls 3

IsConfiguredMethod · 0.80
ConfigureOursMethod · 0.65
UpdateMethod · 0.65

Tested by 3

TestSetup_setOurs_nonGHFunction · 0.76