aboutsummaryrefslogtreecommitdiff
path: root/modules/middleware
diff options
context:
space:
mode:
authorslene <vslene@gmail.com>2014-03-23 20:58:27 +0800
committerslene <vslene@gmail.com>2014-03-23 20:58:27 +0800
commit809a4eab6774c265c8c07313fa9957c274e52aaf (patch)
tree9f8c1e86554e9bc1199fdcad36e02335ea0ce69d /modules/middleware
parent559cd63fc5feace32bb44c695207579609516f15 (diff)
parent97debac18534e030924654befc6dc1eeb870a38b (diff)
Merge branch 'master' of github.com:gogits/gogs
Diffstat (limited to 'modules/middleware')
-rw-r--r--modules/middleware/repo.go6
1 files changed, 5 insertions, 1 deletions
diff --git a/modules/middleware/repo.go b/modules/middleware/repo.go
index 3864caaf..eea2570c 100644
--- a/modules/middleware/repo.go
+++ b/modules/middleware/repo.go
@@ -69,8 +69,12 @@ func RepoAssignment(redirect bool) martini.Handler {
ctx.Repo.IsWatching = models.IsWatching(ctx.User.Id, repo.Id)
}
ctx.Repo.Repository = repo
+ scheme := "http"
+ if base.EnableHttpsClone {
+ scheme = "https"
+ }
ctx.Repo.CloneLink.SSH = fmt.Sprintf("git@%s:%s/%s.git", base.Domain, user.LowerName, repo.LowerName)
- ctx.Repo.CloneLink.HTTPS = fmt.Sprintf("https://%s/%s/%s.git", base.Domain, user.LowerName, repo.LowerName)
+ ctx.Repo.CloneLink.HTTPS = fmt.Sprintf("%s://%s/%s/%s.git", scheme, base.Domain, user.LowerName, repo.LowerName)
ctx.Data["IsRepositoryValid"] = true
ctx.Data["Repository"] = repo