mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2024-11-25 08:59:31 -05:00
[GITEA] services/wiki: Close() after error handling
Refs: https://codeberg.org/forgejo/forgejo/pulls/1385 Signed-off-by: Lars Lehtonen <lars.lehtonen@gmail.com> (cherry picked from commitc6a85d7606
) (cherry picked from commitfc065c8294
) (cherry picked from commitde7e33e7a5
)
This commit is contained in:
parent
aff7aa0858
commit
589e7d346f
1 changed files with 2 additions and 2 deletions
|
@ -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
|
||||
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue