Add Close() method to gogitRepository (#8901)

In investigating #7947 it has become clear that the storage component of go-git repositories needs closing.

This PR adds this Close function and adds the Close functions as necessary.

In TransferOwnership the ctx.Repo.GitRepo is closed if it is open to help prevent the risk of multiple open files.

Fixes #7947
This commit is contained in:
zeripath 2019-11-13 07:01:19 +00:00 committed by GitHub
parent 7b97e04555
commit 722a7c902d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
75 changed files with 391 additions and 106 deletions

View file

@ -56,6 +56,7 @@ func TestEntriesCustomSort(t *testing.T) {
func TestFollowLink(t *testing.T) {
r, err := OpenRepository("tests/repos/repo1_bare")
assert.NoError(t, err)
defer r.Close()
commit, err := r.GetCommit("37991dec2c8e592043f47155ce4808d4580f9123")
assert.NoError(t, err)