MCPcopy Index your code
hub / github.com/cli/cli / CredentialPatternFromHost

Function CredentialPatternFromHost

git/client.go:134–138  ·  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

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

Callers 3

checkoutRunFunction · 0.92

Calls 1

HostPrefixFunction · 0.92

Tested by 1