Browse Source

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
pull/4789/head
Siwei Chen 7 years ago committed by GitHub
parent
commit
cfa9d5d6df
  1. 5
      models/repo.go

5
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

Loading…
Cancel
Save