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:
wxiaoguang authored and GitHub committed 2026-07-21 12:18:00 +00:00
1 parent 8731ea4bbb
commit 91eb14c944
45 files changed
+211 -217

No files matched your search

+1 -2
View File
@@ -5,12 +5,11 @@ package v1_22
import (
"gitea.dev/modelmigration/base"
"gitea.dev/models/perm"
)
func AddRepoUnitEveryoneAccessMode(x base.EngineMigration) error {
type RepoUnit struct { //revive:disable-line:exported
EveryoneAccessMode perm.AccessMode `xorm:"NOT NULL DEFAULT 0"`
EveryoneAccessMode int `xorm:"NOT NULL DEFAULT 0"`
}
return x.Sync(&RepoUnit{})
}