MCPcopy
hub / github.com/cli/cli / IsOurs

Method IsOurs

pkg/cmd/auth/shared/gitcredentials/helper_config.go:78–89  ·  view source on GitHub ↗

IsOurs returns true if the helper command is the GitHub CLI credential helper

()

Source from the content-addressed store, hash-verified

76
77// IsOurs returns true if the helper command is the GitHub CLI credential helper
78func (h Helper) IsOurs() bool {
79 if !strings.HasPrefix(h.Cmd, "!") {
80 return false
81 }
82
83 args, err := shlex.Split(h.Cmd[1:])
84 if err != nil || len(args) == 0 {
85 return false
86 }
87
88 return strings.TrimSuffix(filepath.Base(args[0]), ".exe") == "gh"
89}
90
91// ConfiguredHelper returns the configured git credential helper for a given hostname.
92func (hc *HelperConfig) ConfiguredHelper(hostname string) (Helper, error) {

Callers 4

TestHelperIsOursFunction · 0.95
PromptMethod · 0.80
TestMethod · 0.80

Calls 1

BaseMethod · 0.80

Tested by 2

TestHelperIsOursFunction · 0.76