Skip to content

Commit

Permalink
for each git.OpenRepositoryCtx, call Close
Browse files Browse the repository at this point in the history
  • Loading branch information
Loïc Dachary authored and singuliere committed Feb 14, 2022
1 parent 72cd64e commit a8c5b17
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions services/migrations/gitea_uploader_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,7 @@ func TestGiteaUploadUpdateGitForPullRequest(t *testing.T) {
Message: "Initial Commit",
}))
fromGitRepo, err := git.OpenRepositoryCtx(git.DefaultContext, fromRepo.RepoPath())
defer fromGitRepo.Close()
assert.NoError(t, err)
baseSHA, err := fromGitRepo.GetBranchCommitID(baseRef)
assert.NoError(t, err)
Expand Down Expand Up @@ -290,6 +291,7 @@ func TestGiteaUploadUpdateGitForPullRequest(t *testing.T) {
Message: "branch2 commit",
}))
forkGitRepo, err := git.OpenRepositoryCtx(git.DefaultContext, forkRepo.RepoPath())
defer forkGitRepo.Close()
assert.NoError(t, err)
forkHeadSHA, err := forkGitRepo.GetBranchCommitID(forkHeadRef)
assert.NoError(t, err)
Expand Down

0 comments on commit a8c5b17

Please sign in to comment.