mirror of
https://github.com/go-gitea/gitea.git
synced 2026-09-08 22:13:26 +09: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:
@@ -7,7 +7,6 @@ import (
|
||||
"context"
|
||||
|
||||
"gitea.dev/modelmigration/base"
|
||||
repo_model "gitea.dev/models/repo"
|
||||
"gitea.dev/modules/git"
|
||||
"gitea.dev/modules/setting"
|
||||
)
|
||||
@@ -159,7 +158,7 @@ func migratePushMirrors(x base.EngineMigration) error {
|
||||
|
||||
func getRemoteAddress(ownerName, repoName, remoteName string) (string, error) {
|
||||
ctx := context.Background()
|
||||
repo := repo_model.CodeRepoByName(ownerName, repoName)
|
||||
repo := base.LocalCodeGitRepo(ownerName, repoName)
|
||||
if exist, _ := git.IsRepositoryExist(ctx, repo); !exist {
|
||||
return "", nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user