1
1
mirror of https://github.com/go-gitea/gitea synced 2025-07-22 18:28:37 +00:00

#2825 early response 200 when ?go-get=1

This commit is contained in:
Unknwon
2016-08-07 14:29:16 -07:00
parent 0c2b9bbb2b
commit e5bf4281b5
5 changed files with 41 additions and 5 deletions

View File

@@ -494,6 +494,11 @@ type CloneLink struct {
Git string
}
// 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)
}
func (repo *Repository) cloneLink(isWiki bool) *CloneLink {
repoName := repo.Name
if isWiki {
@@ -507,7 +512,7 @@ func (repo *Repository) cloneLink(isWiki bool) *CloneLink {
} else {
cl.SSH = fmt.Sprintf("%s@%s:%s/%s.git", setting.RunUser, setting.SSH.Domain, repo.Owner.Name, repoName)
}
cl.HTTPS = fmt.Sprintf("%s%s/%s.git", setting.AppUrl, repo.Owner.Name, repoName)
cl.HTTPS = ComposeHTTPSCloneURL(repo.Owner.Name, repo.Name)
return cl
}