summaryrefslogtreecommitdiffstats
path: root/modules/test/context_tests.go
diff options
context:
space:
mode:
Diffstat (limited to 'modules/test/context_tests.go')
-rw-r--r--modules/test/context_tests.go1
1 files changed, 1 insertions, 0 deletions
diff --git a/modules/test/context_tests.go b/modules/test/context_tests.go
index 92df1c5762..cf9c5fbc54 100644
--- a/modules/test/context_tests.go
+++ b/modules/test/context_tests.go
@@ -55,6 +55,7 @@ func LoadRepo(t *testing.T, ctx *context.Context, repoID int64) {
func LoadRepoCommit(t *testing.T, ctx *context.Context) {
gitRepo, err := git.OpenRepository(ctx.Repo.Repository.RepoPath())
assert.NoError(t, err)
+ defer gitRepo.Close()
branch, err := gitRepo.GetHEADBranch()
assert.NoError(t, err)
ctx.Repo.Commit, err = gitRepo.GetBranchCommit(branch.Name)