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

Function CredentialPatternFromHost

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

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

Callers 3

checkoutRunFunction · 0.92

Calls 1

HostPrefixFunction · 0.92

Tested by 1