summaryrefslogtreecommitdiffstats
path: root/services/wiki
diff options
context:
space:
mode:
authorEarl Warren <109468362+earl-warren@users.noreply.github.com>2023-09-19 16:45:44 +0200
committerGitHub <noreply@github.com>2023-09-19 16:45:44 +0200
commitf7c64976d597f73ce7448d04099e5afc0d66e9f0 (patch)
tree3c87dfb9e59bc67769f52d0f98c8579a28373d91 /services/wiki
parentUse fetch helpers instead of fetch (#27026) (diff)
downloadforgejo-f7c64976d597f73ce7448d04099e5afc0d66e9f0.tar.xz
forgejo-f7c64976d597f73ce7448d04099e5afc0d66e9f0.zip
services/wiki: Close() after error handling (#27129)
Refs: https://codeberg.org/forgejo/forgejo/pulls/1385 Signed-off-by: Lars Lehtonen <lars.lehtonen@gmail.com> (cherry picked from commit 589e7d346f51de4a0e2c461b220c8cad34133b2f) Co-authored-by: Lars Lehtonen <lars.lehtonen@gmail.com>
Diffstat (limited to 'services/wiki')
-rw-r--r--services/wiki/wiki_test.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/services/wiki/wiki_test.go b/services/wiki/wiki_test.go
index 0621456f3e..6f05dedab6 100644
--- a/services/wiki/wiki_test.go
+++ b/services/wiki/wiki_test.go
@@ -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)