diff options
Diffstat (limited to 'models/migrations/migrations_test.go')
-rw-r--r-- | models/migrations/migrations_test.go | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/models/migrations/migrations_test.go b/models/migrations/migrations_test.go index 0c8e74f73..46782f24a 100644 --- a/models/migrations/migrations_test.go +++ b/models/migrations/migrations_test.go @@ -66,6 +66,10 @@ func TestMain(m *testing.M) { setting.SetCustomPathAndConf("", "", "") setting.LoadForTest() + if err = git.InitOnceWithSync(context.Background()); err != nil { + fmt.Printf("Unable to InitOnceWithSync: %v\n", err) + os.Exit(1) + } git.CheckLFSVersion() setting.InitDBConfig() setting.NewLogServices(true) @@ -203,7 +207,7 @@ func prepareTestEnv(t *testing.T, skip int, syncModels ...interface{}) (*xorm.En deferFn := PrintCurrentTest(t, ourSkip) assert.NoError(t, os.RemoveAll(setting.RepoRootPath)) assert.NoError(t, unittest.CopyDir(path.Join(filepath.Dir(setting.AppPath), "integrations/gitea-repositories-meta"), 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) if err != nil { assert.NoError(t, err, "unable to read the new repo root: %v\n", err) |