mirror of
https://github.com/go-gitea/gitea.git
synced 2026-08-03 12:34:34 +00:00
refactor: use WithRepo instead of WithDir for most git operations, clean up model migrations (#38555)
by the way, remove some unnecessary "models" imports from model migration package, fix migration test model init bug (modelmigration/migrationtest/tests.go)
This commit is contained in:
@@ -58,7 +58,11 @@ func PrepareTestEnv(t *testing.T, skip int, syncModels ...any) (base.EngineMigra
|
||||
}
|
||||
}
|
||||
|
||||
db.ResetModels()
|
||||
if len(syncModels) > 0 {
|
||||
for _, syncModel := range syncModels {
|
||||
db.RegisterModel(syncModel)
|
||||
}
|
||||
if err := x.Sync(syncModels...); err != nil {
|
||||
t.Errorf("error during sync: %v", err)
|
||||
return x, deferFn
|
||||
|
||||
Reference in New Issue
Block a user