aboutsummaryrefslogtreecommitdiffstats
path: root/modules/git/submodule.go
diff options
context:
space:
mode:
authorzeripath <art27@cantab.net>2020-08-13 05:19:04 +0100
committerGitHub <noreply@github.com>2020-08-13 00:19:04 -0400
commitbe1b33c1971a5fdf5356dafa43b83df837fa656e (patch)
tree5189c06fde10548f46953793b2a3fafe7ceba789 /modules/git/submodule.go
parent4e1c7cc4efb537ed6cb35537f059f58cf402a9d0 (diff)
downloadgitea-be1b33c1971a5fdf5356dafa43b83df837fa656e.tar.gz
gitea-be1b33c1971a5fdf5356dafa43b83df837fa656e.zip
Do not add prefix on http/https submodule links (#12477)
Fix #12345 Signed-off-by: Andrew Thornton <art27@cantab.net>
Diffstat (limited to 'modules/git/submodule.go')
-rw-r--r--modules/git/submodule.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/modules/git/submodule.go b/modules/git/submodule.go
index 222a5e4f8c..bb094bda5d 100644
--- a/modules/git/submodule.go
+++ b/modules/git/submodule.go
@@ -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
}