Skip to content

Commit 589e7d3

Browse files
alrsearl-warren
authored andcommitted
[GITEA] services/wiki: Close() after error handling
Refs: https://codeberg.org/forgejo/forgejo/pulls/1385 Signed-off-by: Lars Lehtonen <[email protected]> (cherry picked from commit c6a85d760693bcecb0a5df24bfe0ee662c593725) (cherry picked from commit fc065c8294322b2d8bd3dbff524bf3f0669bbaec) (cherry picked from commit de7e33e7a5b6c63b68d829e724639bd80811cce5)
1 parent aff7aa0 commit 589e7d3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

services/wiki/wiki_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -251,8 +251,8 @@ func TestPrepareWikiFileName(t *testing.T) {
251251
unittest.PrepareTestEnv(t)
252252
repo := unittest.AssertExistsAndLoadBean(t, &repo_model.Repository{ID: 1})
253253
gitRepo, err := git.OpenRepository(git.DefaultContext, repo.WikiPath())
254-
defer gitRepo.Close()
255254
assert.NoError(t, err)
255+
defer gitRepo.Close()
256256

257257
tests := []struct {
258258
name string
@@ -303,8 +303,8 @@ func TestPrepareWikiFileName_FirstPage(t *testing.T) {
303303
assert.NoError(t, err)
304304

305305
gitRepo, err := git.OpenRepository(git.DefaultContext, tmpDir)
306-
defer gitRepo.Close()
307306
assert.NoError(t, err)
307+
defer gitRepo.Close()
308308

309309
existence, newWikiPath, err := prepareGitPath(gitRepo, "Home")
310310
assert.False(t, existence)

0 commit comments

Comments
 (0)