@@ -171,25 +171,6 @@ func MainTest(m *testing.M, testOpts ...*TestOptions) {
171
171
if err = git .InitFull (context .Background ()); err != nil {
172
172
fatalTestError ("git.Init: %v\n " , err )
173
173
}
174
- ownerDirs , err := os .ReadDir (setting .RepoRootPath )
175
- if err != nil {
176
- fatalTestError ("unable to read the new repo root: %v\n " , err )
177
- }
178
- for _ , ownerDir := range ownerDirs {
179
- if ! ownerDir .Type ().IsDir () {
180
- continue
181
- }
182
- repoDirs , err := os .ReadDir (filepath .Join (setting .RepoRootPath , ownerDir .Name ()))
183
- if err != nil {
184
- fatalTestError ("unable to read the new repo root: %v\n " , err )
185
- }
186
- for _ , repoDir := range repoDirs {
187
- _ = os .MkdirAll (filepath .Join (setting .RepoRootPath , ownerDir .Name (), repoDir .Name (), "objects" , "pack" ), 0o755 )
188
- _ = os .MkdirAll (filepath .Join (setting .RepoRootPath , ownerDir .Name (), repoDir .Name (), "objects" , "info" ), 0o755 )
189
- _ = os .MkdirAll (filepath .Join (setting .RepoRootPath , ownerDir .Name (), repoDir .Name (), "refs" , "heads" ), 0o755 )
190
- _ = os .MkdirAll (filepath .Join (setting .RepoRootPath , ownerDir .Name (), repoDir .Name (), "refs" , "tag" ), 0o755 )
191
- }
192
- }
193
174
194
175
if len (testOpts ) > 0 && testOpts [0 ].SetUp != nil {
195
176
if err := testOpts [0 ].SetUp (); err != nil {
@@ -254,21 +235,5 @@ func PrepareTestEnv(t testing.TB) {
254
235
assert .NoError (t , PrepareTestDatabase ())
255
236
metaPath := filepath .Join (giteaRoot , "tests" , "gitea-repositories-meta" )
256
237
assert .NoError (t , SyncDirs (metaPath , setting .RepoRootPath ))
257
- ownerDirs , err := os .ReadDir (setting .RepoRootPath )
258
- assert .NoError (t , err )
259
- for _ , ownerDir := range ownerDirs {
260
- if ! ownerDir .Type ().IsDir () {
261
- continue
262
- }
263
- repoDirs , err := os .ReadDir (filepath .Join (setting .RepoRootPath , ownerDir .Name ()))
264
- assert .NoError (t , err )
265
- for _ , repoDir := range repoDirs {
266
- _ = os .MkdirAll (filepath .Join (setting .RepoRootPath , ownerDir .Name (), repoDir .Name (), "objects" , "pack" ), 0o755 )
267
- _ = os .MkdirAll (filepath .Join (setting .RepoRootPath , ownerDir .Name (), repoDir .Name (), "objects" , "info" ), 0o755 )
268
- _ = os .MkdirAll (filepath .Join (setting .RepoRootPath , ownerDir .Name (), repoDir .Name (), "refs" , "heads" ), 0o755 )
269
- _ = os .MkdirAll (filepath .Join (setting .RepoRootPath , ownerDir .Name (), repoDir .Name (), "refs" , "tag" ), 0o755 )
270
- }
271
- }
272
-
273
238
base .SetupGiteaRoot () // Makes sure GITEA_ROOT is set
274
239
}
0 commit comments