summaryrefslogtreecommitdiffstats
path: root/modules
diff options
context:
space:
mode:
authorwxiaoguang <wxiaoguang@gmail.com>2022-08-14 00:33:18 +0800
committerGitHub <noreply@github.com>2022-08-14 00:33:18 +0800
commit11dc6df5be5ae1da8d570e440f97060d2284dd13 (patch)
tree69ef29359c9fcb5dc89bb82c8cab68151b9d674b /modules
parent3d7058adbec95036ca6eec6f988179cfdad9ba3f (diff)
downloadgitea-11dc6df5be5ae1da8d570e440f97060d2284dd13.tar.gz
gitea-11dc6df5be5ae1da8d570e440f97060d2284dd13.zip
Fix git.Init for doctor sub-command (#20782)
Diffstat (limited to 'modules')
-rw-r--r--modules/doctor/doctor.go7
1 files changed, 6 insertions, 1 deletions
diff --git a/modules/doctor/doctor.go b/modules/doctor/doctor.go
index c8975a788e..5d14cef55c 100644
--- a/modules/doctor/doctor.go
+++ b/modules/doctor/doctor.go
@@ -11,6 +11,7 @@ import (
"strings"
"code.gitea.io/gitea/models/db"
+ "code.gitea.io/gitea/modules/git"
"code.gitea.io/gitea/modules/log"
"code.gitea.io/gitea/modules/setting"
)
@@ -49,7 +50,11 @@ func initDBDisableConsole(ctx context.Context, disableConsole bool) error {
setting.NewXORMLogService(disableConsole)
if err := db.InitEngine(ctx); err != nil {
- return fmt.Errorf("models.SetEngine: %v", err)
+ return fmt.Errorf("db.InitEngine: %w", err)
+ }
+ // some doctor sub-commands need to use git command
+ if err := git.InitFull(ctx); err != nil {
+ return fmt.Errorf("git.InitFull: %w", err)
}
return nil
}