MCPcopy Index your code
hub / github.com/cli/cli / formatRemoteURL

Function formatRemoteURL

pkg/cmd/gist/clone/clone.go:96–108  ·  view source on GitHub ↗
(hostname string, gistID string, protocol string)

Source from the content-addressed store, hash-verified

94}
95
96func formatRemoteURL(hostname string, gistID string, protocol string) string {
97 if ghauth.IsEnterprise(hostname) {
98 if protocol == "ssh" {
99 return fmt.Sprintf("git@%s:gist/%s.git", hostname, gistID)
100 }
101 return fmt.Sprintf("https://%s/gist/%s.git", hostname, gistID)
102 }
103
104 if protocol == "ssh" {
105 return fmt.Sprintf("git@gist.%s:%s.git", hostname, gistID)
106 }
107 return fmt.Sprintf("https://gist.%s/%s.git", hostname, gistID)
108}

Callers 2

cloneRunFunction · 0.85
Test_formatRemoteURLFunction · 0.85

Calls

no outgoing calls

Tested by 1

Test_formatRemoteURLFunction · 0.68