mirror of
https://github.com/go-gitea/gitea.git
synced 2026-08-06 07:00:00 +00:00
refactor: clean up git repo and model migration packages (#38564)
enable the golangci depguard lint rule: deny "models" and its sub packages in "modelmigration" package.
This commit is contained in:
@@ -7,17 +7,17 @@ import (
|
||||
"path/filepath"
|
||||
"testing"
|
||||
|
||||
"gitea.dev/modules/git/gitcmd"
|
||||
"gitea.dev/modules/git/gitrepo"
|
||||
)
|
||||
|
||||
const testReposDir = "tests/repos/"
|
||||
|
||||
func mockRepository(repoPath string) gitcmd.RepositoryFacade {
|
||||
func mockRepository(repoPath string) RepositoryFacade {
|
||||
if !filepath.IsAbs(repoPath) {
|
||||
// resolve repository path relative to the unit test fixture directory
|
||||
repoPath, _ = filepath.Abs(filepath.Join(testReposDir, repoPath))
|
||||
}
|
||||
return gitcmd.RepositoryUnmanaged(repoPath)
|
||||
return gitrepo.RepositoryUnmanaged(repoPath)
|
||||
}
|
||||
|
||||
func TestMain(m *testing.M) {
|
||||
|
||||
Reference in New Issue
Block a user