aboutsummaryrefslogtreecommitdiffstats
path: root/routers/private/hook_verification_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'routers/private/hook_verification_test.go')
-rw-r--r--routers/private/hook_verification_test.go7
1 files changed, 4 insertions, 3 deletions
diff --git a/routers/private/hook_verification_test.go b/routers/private/hook_verification_test.go
index 04445b8eaf..8653e34daa 100644
--- a/routers/private/hook_verification_test.go
+++ b/routers/private/hook_verification_test.go
@@ -4,7 +4,6 @@
package private
import (
- "context"
"testing"
"code.gitea.io/gitea/models/unittest"
@@ -18,8 +17,10 @@ var testReposDir = "tests/repos/"
func TestVerifyCommits(t *testing.T) {
unittest.PrepareTestEnv(t)
- gitRepo, err := git.OpenRepository(context.Background(), testReposDir+"repo1_hook_verification")
- defer gitRepo.Close()
+ gitRepo, err := git.OpenRepository(t.Context(), testReposDir+"repo1_hook_verification")
+ if err != nil {
+ defer gitRepo.Close()
+ }
assert.NoError(t, err)
objectFormat, err := gitRepo.GetObjectFormat()