From cfa9d5d6dfd533988345366345f1ee776dc830f9 Mon Sep 17 00:00:00 2001 From: Siwei Chen Date: Thu, 21 Sep 2017 00:15:18 -0500 Subject: [PATCH] fix wrong Upper/Lower case in HTTP/SSH CloneLinks use origin repo name for HTTP clone link use lower case repo name for SSH clone link --- models/repo.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/models/repo.go b/models/repo.go index 998914d5b..8546bffc6 100644 --- a/models/repo.go +++ b/models/repo.go @@ -615,13 +615,14 @@ func (repo *Repository) cloneLink(isWiki bool) *CloneLink { if isWiki { repoName += ".wiki" } + repoLowerName := strings.ToLower(repoName) repo.Owner = repo.MustOwner() cl := new(CloneLink) if setting.SSH.Port != 22 { - cl.SSH = fmt.Sprintf("ssh://%s@%s:%d/%s/%s.git", setting.RunUser, setting.SSH.Domain, setting.SSH.Port, repo.Owner.Name, repoName) + cl.SSH = fmt.Sprintf("ssh://%s@%s:%d/%s/%s.git", setting.RunUser, setting.SSH.Domain, setting.SSH.Port, repo.Owner.Name, repoLowerName) } else { - cl.SSH = fmt.Sprintf("%s@%s:%s/%s.git", setting.RunUser, setting.SSH.Domain, repo.Owner.Name, repoName) + cl.SSH = fmt.Sprintf("%s@%s:%s/%s.git", setting.RunUser, setting.SSH.Domain, repo.Owner.Name, repoLowerName) } cl.HTTPS = ComposeHTTPSCloneURL(repo.Owner.Name, repoName) return cl