Only check and config git on web subcommand but not others (#7236)

* only check and config git on web subcommand but not others

* add Init in git tests
This commit is contained in:
Lunny Xiao 2019-06-20 00:53:37 +08:00 committed by Lauris BH
parent a71cabbd53
commit 8ec659722d
4 changed files with 35 additions and 25 deletions

View file

@ -65,6 +65,9 @@ func initDBEngine() (err error) {
// GlobalInit is for global configuration reload-able.
func GlobalInit() {
setting.NewContext()
if err := git.Init(); err != nil {
log.Fatal("Git module init failed: %v", err)
}
setting.CheckLFSVersion()
log.Trace("AppPath: %s", setting.AppPath)
log.Trace("AppWorkPath: %s", setting.AppWorkPath)