MCPcopy
hub / github.com/cli/cli / OverrideBaseRepoFunc

Function OverrideBaseRepoFunc

pkg/cmdutil/repo_override.go:75–85  ·  view source on GitHub ↗
(baseRepoFunc func() (ghrepo.Interface, error), override string)

Source from the content-addressed store, hash-verified

73}
74
75func OverrideBaseRepoFunc(baseRepoFunc func() (ghrepo.Interface, error), override string) func() (ghrepo.Interface, error) {
76 if override == "" {
77 override = os.Getenv("GH_REPO")
78 }
79 if override != "" {
80 return func() (ghrepo.Interface, error) {
81 return ghrepo.FromFullName(override)
82 }
83 }
84 return baseRepoFunc
85}

Callers 3

Test_OverrideBaseRepoFunction · 0.92
NewCmdApiFunction · 0.92
EnableRepoOverrideFunction · 0.85

Calls 1

FromFullNameFunction · 0.92

Tested by 1

Test_OverrideBaseRepoFunction · 0.74