Skip to content

Commit

Permalink
[GITEA] services/wiki: Close() after error handling
Browse files Browse the repository at this point in the history
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)
  • Loading branch information
alrs authored and earl-warren committed Sep 18, 2023
1 parent aff7aa0 commit 589e7d3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions services/wiki/wiki_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -251,8 +251,8 @@ func TestPrepareWikiFileName(t *testing.T) {
unittest.PrepareTestEnv(t)
repo := unittest.AssertExistsAndLoadBean(t, &repo_model.Repository{ID: 1})
gitRepo, err := git.OpenRepository(git.DefaultContext, repo.WikiPath())
defer gitRepo.Close()
assert.NoError(t, err)
defer gitRepo.Close()

tests := []struct {
name string
Expand Down Expand Up @@ -303,8 +303,8 @@ func TestPrepareWikiFileName_FirstPage(t *testing.T) {
assert.NoError(t, err)

gitRepo, err := git.OpenRepository(git.DefaultContext, tmpDir)
defer gitRepo.Close()
assert.NoError(t, err)
defer gitRepo.Close()

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

0 comments on commit 589e7d3

Please sign in to comment.