aboutsummaryrefslogtreecommitdiff
path: root/modules/middleware/repo.go
diff options
context:
space:
mode:
authorLunny Xiao <xiaolunwen@gmail.com>2014-03-24 22:30:50 +0800
committerLunny Xiao <xiaolunwen@gmail.com>2014-03-24 22:30:50 +0800
commit0e28dcdac402b3bfc8336fe250e3418939467208 (patch)
treef16788377cf724e7d6ea28301f2876632a34d3dc /modules/middleware/repo.go
parent48ea9b12f65e21c8584eb89224bda4ad6c635847 (diff)
parentc9e1eb0a0d9e6bdafa158442158c762b7f188177 (diff)
Merge branch 'master' of github.com:gogits/gogs
Diffstat (limited to 'modules/middleware/repo.go')
-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