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.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/routers/private/hook_verification_test.go b/routers/private/hook_verification_test.go
index f6c2e1087f..8653e34daa 100644
--- a/routers/private/hook_verification_test.go
+++ b/routers/private/hook_verification_test.go
@@ -18,7 +18,9 @@ func TestVerifyCommits(t *testing.T) {
unittest.PrepareTestEnv(t)
gitRepo, err := git.OpenRepository(t.Context(), testReposDir+"repo1_hook_verification")
- defer gitRepo.Close()
+ if err != nil {
+ defer gitRepo.Close()
+ }
assert.NoError(t, err)
objectFormat, err := gitRepo.GetObjectFormat()