Skip to content

Commit 882e465

Browse files
GiteaBotearl-warrenalrs
authored
services/wiki: Close() after error handling (#27129) (#27137)
Backport #27129 by @earl-warren Refs: https://codeberg.org/forgejo/forgejo/pulls/1385 Signed-off-by: Lars Lehtonen <[email protected]> (cherry picked from commit 589e7d3) Co-authored-by: Earl Warren <[email protected]> Co-authored-by: Lars Lehtonen <[email protected]>
1 parent b139234 commit 882e465

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
@@ -249,8 +249,8 @@ func TestPrepareWikiFileName(t *testing.T) {
249249
unittest.PrepareTestEnv(t)
250250
repo := unittest.AssertExistsAndLoadBean(t, &repo_model.Repository{ID: 1})
251251
gitRepo, err := git.OpenRepository(git.DefaultContext, repo.WikiPath())
252-
defer gitRepo.Close()
253252
assert.NoError(t, err)
253+
defer gitRepo.Close()
254254

255255
tests := []struct {
256256
name string
@@ -301,8 +301,8 @@ func TestPrepareWikiFileName_FirstPage(t *testing.T) {
301301
assert.NoError(t, err)
302302

303303
gitRepo, err := git.OpenRepository(git.DefaultContext, tmpDir)
304-
defer gitRepo.Close()
305304
assert.NoError(t, err)
305+
defer gitRepo.Close()
306306

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

0 commit comments

Comments
 (0)