summaryrefslogtreecommitdiffstats
path: root/models/repo.go
diff options
context:
space:
mode:
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 {