forked from forgejo/forgejo
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>
This commit is contained in:
parent
23422f9909
commit
88f2e457d8
8 changed files with 46 additions and 55 deletions
|
@ -275,7 +275,7 @@ func prepareTestEnv(t testing.TB, skip ...int) func() {
|
|||
assert.NoError(t, unittest.LoadFixtures())
|
||||
assert.NoError(t, util.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)
|
||||
|
@ -576,7 +576,7 @@ func resetFixtures(t *testing.T) {
|
|||
assert.NoError(t, unittest.LoadFixtures())
|
||||
assert.NoError(t, util.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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue