Fix git hooks update to receive required arguments. Fixes #2090 (#2095)

* Changed migration calling so that migrations can use models package
This commit is contained in:
Lauris BH 2017-07-02 16:50:57 +03:00 committed by Lunny Xiao
parent f99489d5c5
commit f189ccd2d6
5 changed files with 28 additions and 7 deletions

View file

@ -10,6 +10,7 @@ import (
"code.gitea.io/git"
"code.gitea.io/gitea/models"
"code.gitea.io/gitea/models/migrations"
"code.gitea.io/gitea/modules/cron"
"code.gitea.io/gitea/modules/highlight"
"code.gitea.io/gitea/modules/indexer"
@ -50,7 +51,7 @@ func GlobalInit() {
if setting.InstallLock {
highlight.NewContext()
markdown.NewSanitizer()
if err := models.NewEngine(); err != nil {
if err := models.NewEngine(migrations.Migrate); err != nil {
log.Fatal(4, "Failed to initialize ORM engine: %v", err)
}
models.HasEngine = true