MCPcopy Create free account
hub / github.com/cli/cli / remoteURL

Function remoteURL

pkg/cmd/repo/clone/clone.go:245–253  ·  view source on GitHub ↗
(repo *api.Repository, protocol string)

Source from the content-addressed store, hash-verified

243}
244
245func remoteURL(repo *api.Repository, protocol string) (string, error) {
246 if protocol != "ssh" {
247 return ghrepo.FormatRemoteURL(repo, protocol), nil
248 }
249 if repo.SSHURL == "" {
250 return "", fmt.Errorf("invalid API response: repository %s is missing sshUrl", ghrepo.FullName(repo))
251 }
252 return repo.SSHURL, nil
253}
254
255// simplifyURL strips given URL of extra parts like extra path segments (i.e.,
256// anything beyond `/owner/repo`), query strings, or fragments. This function

Callers 1

cloneRunFunction · 0.70

Calls 3

FormatRemoteURLFunction · 0.92
FullNameFunction · 0.92
ErrorfMethod · 0.65

Tested by

no test coverage detected