aboutsummaryrefslogtreecommitdiffstats
path: root/models/repo.go
diff options
context:
space:
mode:
authorLauris BH <lauris@nix.lv>2019-01-30 23:04:19 +0200
committerzeripath <art27@cantab.net>2019-01-30 21:04:19 +0000
commit80098bd7526fed84cfb4fa48272be71541b37205 (patch)
treea059983aea63151baa392e1d0a9bfdc320240870 /models/repo.go
parent57a69ef277546414893a38feb70412aa4c32330e (diff)
downloadgitea-80098bd7526fed84cfb4fa48272be71541b37205.tar.gz
gitea-80098bd7526fed84cfb4fa48272be71541b37205.zip
Fix go-get URL generation (#5905)
Diffstat (limited to 'models/repo.go')
-rw-r--r--models/repo.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/models/repo.go b/models/repo.go
index 51ea1c94bc..08908c8b06 100644
--- a/models/repo.go
+++ b/models/repo.go
@@ -11,6 +11,7 @@ import (
"fmt"
"html/template"
"io/ioutil"
+ "net/url"
"os"
"os/exec"
"path"
@@ -834,7 +835,7 @@ type CloneLink struct {
// ComposeHTTPSCloneURL returns HTTPS clone URL based on given owner and repository name.
func ComposeHTTPSCloneURL(owner, repo string) string {
- return fmt.Sprintf("%s%s/%s.git", setting.AppURL, owner, repo)
+ return fmt.Sprintf("%s%s/%s.git", setting.AppURL, url.QueryEscape(owner), url.QueryEscape(repo))
}
func (repo *Repository) cloneLink(e Engine, isWiki bool) *CloneLink {