Skip to content

Commit f7c6497

Browse files
earl-warrenalrs
andauthored
services/wiki: Close() after error handling (#27129)
Refs: https://codeberg.org/forgejo/forgejo/pulls/1385 Signed-off-by: Lars Lehtonen <[email protected]> (cherry picked from commit 589e7d3) Co-authored-by: Lars Lehtonen <[email protected]>
1 parent ae8e8f0 commit f7c6497

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)