gitutil: strip SSH port from submodule URL when rendering for HTML link (#7383)

Co-authored-by: Joe Chen <jc@unknwon.io>
This commit is contained in:
TheDarkUndoing
2023-03-05 07:00:56 -05:00
committed by GitHub
parent 6fa552994a
commit 5483d97f73
6 changed files with 9 additions and 5 deletions

View File

@@ -50,7 +50,7 @@ func InferSubmoduleURL(baseURL string, mod *git.Submodule) string {
case "http", "https":
raw = parsed.String()
case "ssh":
raw = fmt.Sprintf("http://%s%s", parsed.Host, parsed.Path)
raw = fmt.Sprintf("http://%s%s", parsed.Hostname(), parsed.Path)
default:
return raw
}