services/wiki: Close() after error handling

Signed-off-by: Lars Lehtonen <lars.lehtonen@gmail.com>
This commit is contained in:
Lars Lehtonen 2023-09-06 09:08:28 -07:00
parent 9283604810
commit c6a85d7606
No known key found for this signature in database
GPG key ID: 8137D474EBCB04F2

View file

@ -249,8 +249,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
@ -301,8 +301,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)