Files
gitea/modules/git/main_test.go
wxiaoguang 1acf93d854 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.
2026-07-23 01:22:26 +00:00

26 lines
544 B
Go

// Copyright 2025 The Gitea Authors. All rights reserved.
// SPDX-License-Identifier: MIT
package git
import (
"path/filepath"
"testing"
"gitea.dev/modules/git/gitrepo"
)
const testReposDir = "tests/repos/"
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 gitrepo.RepositoryUnmanaged(repoPath)
}
func TestMain(m *testing.M) {
RunGitTests(m)
}