MCPcopy
hub / github.com/cli/cli / GenerateRepoURL

Function GenerateRepoURL

internal/ghrepo/repo.go:85–93  ·  view source on GitHub ↗
(repo Interface, p string, args ...interface{})

Source from the content-addressed store, hash-verified

83}
84
85func GenerateRepoURL(repo Interface, p string, args ...interface{}) string {
86 baseURL := fmt.Sprintf("%s%s/%s", ghinstance.HostPrefix(repo.RepoHost()), repo.RepoOwner(), repo.RepoName())
87 if p != "" {
88 if path := fmt.Sprintf(p, args...); path != "" {
89 return baseURL + "/" + path
90 }
91 }
92 return baseURL
93}
94
95func FormatRemoteURL(repo Interface, protocol string) string {
96 if protocol == "ssh" {

Callers 15

viewRunFunction · 0.92
openInBrowserFunction · 0.92
listRunFunction · 0.92
checkRunFunction · 0.92
listRunFunction · 0.92
listRunFunction · 0.92
createRunFunction · 0.92
generatePreviewURLFunction · 0.92
runBrowseFunction · 0.92
listRunFunction · 0.92
generateBranchURLFunction · 0.92
forkRunFunction · 0.92

Calls 4

HostPrefixFunction · 0.92
RepoHostMethod · 0.65
RepoOwnerMethod · 0.65
RepoNameMethod · 0.65

Tested by 2

Test_repoCreateFunction · 0.74
TestFindFunction · 0.74