Do not add prefix on http/https submodule links (#12477)
Fix #12345 Signed-off-by: Andrew Thornton <art27@cantab.net>
This commit is contained in:
parent
4e1c7cc4ef
commit
be1b33c197
2 changed files with 4 additions and 3 deletions
|
@ -97,13 +97,13 @@ func getRefURL(refURL, urlPrefix, repoFullName string) string {
|
|||
|
||||
for _, scheme := range supportedSchemes {
|
||||
if ref.Scheme == scheme {
|
||||
if urlPrefixHostname == refHostname {
|
||||
return urlPrefix + path.Clean(path.Join("/", ref.Path))
|
||||
} else if ref.Scheme == "http" || ref.Scheme == "https" {
|
||||
if ref.Scheme == "http" || ref.Scheme == "https" {
|
||||
if len(ref.User.Username()) > 0 {
|
||||
return ref.Scheme + "://" + fmt.Sprintf("%v", ref.User) + "@" + ref.Host + ref.Path
|
||||
}
|
||||
return ref.Scheme + "://" + ref.Host + ref.Path
|
||||
} else if urlPrefixHostname == refHostname {
|
||||
return urlPrefix + path.Clean(path.Join("/", ref.Path))
|
||||
} else {
|
||||
return "http://" + refHostname + ref.Path
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue