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

Method DetectConfiguredHelper

pkg/cmd/auth/shared/git_credential.go:143–149  ·  view source on GitHub ↗

DetectConfiguredHelper reads the git credential helper configured for hostname and returns its category ("ours", "other", or "none"), or "error" when the read fails. It performs its own read instead of relying on Prompt having run, so callers can observe the helper even for non-interactive or SSH si

(hostname string)

Source from the content-addressed store, hash-verified

141// setup runs. The read is intentionally not cached: a repeated read inside Prompt stays cheap and keeps each caller's
142// error handling independent.
143func (flow *GitCredentialFlow) DetectConfiguredHelper(hostname string) string {
144 flow.helper, flow.helperDetectErr = flow.HelperConfig.ConfiguredHelper(hostname)
145 if flow.helperDetectErr != nil {
146 return "error"
147 }
148 return helperCategory(flow.helper)
149}
150
151// ResultingHelperCategory reports the git credential helper in effect after Setup ran, as one of "ours", "other", or
152// "none", or "error" when helper detection failed and no setup replaced it. It reflects the flow's own decisions

Callers 4

refreshRunFunction · 0.95
LoginFunction · 0.80

Calls 2

helperCategoryFunction · 0.85
ConfiguredHelperMethod · 0.65