(repo *api.Repository, protocol string)
| 243 | } |
| 244 | |
| 245 | func 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 |
no test coverage detected