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)
| 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. |
| 134 | func 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. |