aboutsummaryrefslogtreecommitdiffstats
path: root/models/migrations
diff options
context:
space:
mode:
authorwxiaoguang <wxiaoguang@gmail.com>2022-06-11 11:56:27 +0800
committerGitHub <noreply@github.com>2022-06-11 11:56:27 +0800
commit88f2e457d891c4e91a9eddab8143d0109e08dfa9 (patch)
tree7746767e490260ddfb2e28d3d9e142c29d3b2a14 /models/migrations
parent23422f9909e9843308b4c6f2becca9ba1ad5cef2 (diff)
downloadgitea-88f2e457d891c4e91a9eddab8143d0109e08dfa9.tar.gz
gitea-88f2e457d891c4e91a9eddab8143d0109e08dfa9.zip
Fix data-race problems in git module (quick patch) (#19934)
* Fix data-race problems in git module * use HomeDir instead of setting.RepoRootPath Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Diffstat (limited to 'models/migrations')
-rw-r--r--models/migrations/migrations_test.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/models/migrations/migrations_test.go b/models/migrations/migrations_test.go
index 2c4d21d974..0c8e74f734 100644
--- a/models/migrations/migrations_test.go
+++ b/models/migrations/migrations_test.go
@@ -203,7 +203,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.InitWithConfigSync(context.Background()))
+ assert.NoError(t, git.InitOnceWithSync(context.Background()))
ownerDirs, err := os.ReadDir(setting.RepoRootPath)
if err != nil {
assert.NoError(t, err, "unable to read the new repo root: %v\n", err)