normalizeGitRemote adds a .git suffix to the Git remote URL if it doesn't already have one. If it's not a Github URL, it returns the string as is. This is for backwards compatibility with old CLIs that sent Github HTML URLs instead of Github remote URLs.
(remote string)
| 1298 | // If it's not a Github URL, it returns the string as is. |
| 1299 | // This is for backwards compatibility with old CLIs that sent Github HTML URLs instead of Github remote URLs. |
| 1300 | func normalizeGitRemote(remote string) string { |
| 1301 | if !strings.HasPrefix(remote, "https://github.com") { |
| 1302 | return remote // Not a Github remote, return as is |
| 1303 | } |
| 1304 | if strings.HasSuffix(remote, ".git") { |
| 1305 | return remote |
| 1306 | } |
| 1307 | return remote + ".git" |
| 1308 | } |
no outgoing calls
no test coverage detected