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

Method Setup

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

Source from the content-addressed store, hash-verified

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

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