summaryrefslogtreecommitdiffstats
path: root/routers
diff options
context:
space:
mode:
authorLunny Xiao <xiaolunwen@gmail.com>2019-05-15 09:57:00 +0800
committerGitHub <noreply@github.com>2019-05-15 09:57:00 +0800
commit710245e81e0d65c72231dbb3b5c9f860cdc71899 (patch)
tree6987b804cb38ab175e6749e7c4b9e77b0362e499 /routers
parent95d3d42c5fd51bcc64774841edad158f6e5ef60f (diff)
downloadgitea-710245e81e0d65c72231dbb3b5c9f860cdc71899.tar.gz
gitea-710245e81e0d65c72231dbb3b5c9f860cdc71899.zip
Refactor models.NewRepoContext to extract git related codes to modules/git (#6941)
* refactor models.NewRepoContext to extract git related codes to modules/git * fix imports * refactor
Diffstat (limited to 'routers')
-rw-r--r--routers/admin/admin.go3
-rw-r--r--routers/init.go1
2 files changed, 2 insertions, 2 deletions
diff --git a/routers/admin/admin.go b/routers/admin/admin.go
index 7b8422fc61..0e6fa2c242 100644
--- a/routers/admin/admin.go
+++ b/routers/admin/admin.go
@@ -18,6 +18,7 @@ import (
"code.gitea.io/gitea/modules/base"
"code.gitea.io/gitea/modules/context"
"code.gitea.io/gitea/modules/cron"
+ "code.gitea.io/gitea/modules/git"
"code.gitea.io/gitea/modules/process"
"code.gitea.io/gitea/modules/setting"
)
@@ -210,7 +211,7 @@ func Config(ctx *context.Context) {
ctx.Data["DisableRouterLog"] = setting.DisableRouterLog
ctx.Data["RunUser"] = setting.RunUser
ctx.Data["RunMode"] = strings.Title(macaron.Env)
- ctx.Data["GitVersion"] = setting.Git.Version
+ ctx.Data["GitVersion"], _ = git.BinVersion()
ctx.Data["RepoRootPath"] = setting.RepoRootPath
ctx.Data["CustomRootPath"] = setting.CustomPath
ctx.Data["StaticRootPath"] = setting.StaticRootPath
diff --git a/routers/init.go b/routers/init.go
index 47f837c523..88422cc6ed 100644
--- a/routers/init.go
+++ b/routers/init.go
@@ -86,7 +86,6 @@ func GlobalInit() {
log.Fatal("Failed to initialize OAuth2 support: %v", err)
}
- models.LoadRepoConfig()
models.NewRepoContext()
// Booting long running goroutines.