aboutsummaryrefslogtreecommitdiffstats
path: root/models/unittest/testdb.go
diff options
context:
space:
mode:
Diffstat (limited to 'models/unittest/testdb.go')
-rw-r--r--models/unittest/testdb.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/models/unittest/testdb.go b/models/unittest/testdb.go
index d1a4498510..baea46dbce 100644
--- a/models/unittest/testdb.go
+++ b/models/unittest/testdb.go
@@ -117,9 +117,11 @@ func MainTest(m *testing.M, testOpts *TestOptions) {
if err = CopyDir(filepath.Join(testOpts.GiteaRootPath, "integrations", "gitea-repositories-meta"), setting.RepoRootPath); err != nil {
fatalTestError("util.CopyDir: %v\n", err)
}
+
if err = git.InitOnceWithSync(context.Background()); err != nil {
fatalTestError("git.Init: %v\n", err)
}
+ git.CheckLFSVersion()
ownerDirs, err := os.ReadDir(setting.RepoRootPath)
if err != nil {
@@ -202,7 +204,7 @@ func PrepareTestEnv(t testing.TB) {
assert.NoError(t, util.RemoveAll(setting.RepoRootPath))
metaPath := filepath.Join(giteaRoot, "integrations", "gitea-repositories-meta")
assert.NoError(t, CopyDir(metaPath, setting.RepoRootPath))
- assert.NoError(t, git.InitOnceWithSync(context.Background()))
+ assert.NoError(t, git.InitOnceWithSync(context.Background())) // the gitconfig has been removed above, so sync the gitconfig again
ownerDirs, err := os.ReadDir(setting.RepoRootPath)
assert.NoError(t, err)