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

Function OverrideBaseRepoFunc

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

Source from the content-addressed store, hash-verified

58}
59
60func OverrideBaseRepoFunc(baseRepoFunc func() (ghrepo.Interface, error), override string) func() (ghrepo.Interface, error) {
61 if override == "" {
62 override = os.Getenv("GH_REPO")
63 }
64 if override != "" {
65 return func() (ghrepo.Interface, error) {
66 return ghrepo.FromFullName(override)
67 }
68 }
69 return baseRepoFunc
70}

Callers 3

Test_OverrideBaseRepoFunction · 0.92
NewCmdApiFunction · 0.92
EnableRepoOverrideFunction · 0.85

Calls 1

FromFullNameFunction · 0.92

Tested by 1

Test_OverrideBaseRepoFunction · 0.74