diff options
author | Unknwon <u@gogs.io> | 2016-08-07 14:29:16 -0700 |
---|---|---|
committer | Unknwon <u@gogs.io> | 2016-08-07 14:29:16 -0700 |
commit | e5bf4281b5519d845dd85a153831ba5cc1117590 (patch) | |
tree | 4c5c7ed3edc6b5b7a8e32db1ccf6fbb3573840cb /models | |
parent | 0c2b9bbb2b6d4620f9b674e8500e7a0bcea8c1d3 (diff) | |
download | gitea-e5bf4281b5519d845dd85a153831ba5cc1117590.tar.gz gitea-e5bf4281b5519d845dd85a153831ba5cc1117590.zip |
#2825 early response 200 when ?go-get=1
Diffstat (limited to 'models')
-rw-r--r-- | models/repo.go | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/models/repo.go b/models/repo.go index 02b4e9fbc7..7de9499ae5 100644 --- a/models/repo.go +++ b/models/repo.go @@ -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 } |