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

Function CredentialPatternFromHost

git/client.go:135–139  ·  view source on GitHub ↗

CredentialPatternFromHost expects host to be in the form "github.com" and returns the credential pattern that should be used for it. It does not perform any canonicalisation e.g. "api.github.com" will not work as expected.

(host string)

Source from the content-addressed store, hash-verified

133// the credential pattern that should be used for it.
134// It does not perform any canonicalisation e.g. "api.github.com" will not work as expected.
135func CredentialPatternFromHost(host string) CredentialPattern {
136 return CredentialPattern{
137 pattern: strings.TrimSuffix(ghinstance.HostPrefix(host), "/"),
138 }
139}
140
141// AuthenticatedCommand is a wrapper around Command that included configuration to use gh
142// as the credential helper for git.

Callers 3

checkoutRunFunction · 0.92

Calls 1

HostPrefixFunction · 0.92

Tested by 1