Backport #8901 - Adjusted slightly for 1.9 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:
parent
2ef37522b6
commit
fb5af37b3e
71 changed files with 275 additions and 31 deletions
|
@ -37,6 +37,8 @@ THE SOFTWARE.
|
|||
`
|
||||
repo, err := OpenRepository("../../.git")
|
||||
assert.NoError(t, err)
|
||||
defer repo.Close()
|
||||
|
||||
testBlob, err := repo.GetBlob("a8d4b49dd073a4a38a7e58385eeff7cc52568697")
|
||||
assert.NoError(t, err)
|
||||
|
||||
|
@ -55,6 +57,8 @@ func Benchmark_Blob_Data(b *testing.B) {
|
|||
if err != nil {
|
||||
b.Fatal(err)
|
||||
}
|
||||
defer repo.Close()
|
||||
|
||||
testBlob, err := repo.GetBlob("a8d4b49dd073a4a38a7e58385eeff7cc52568697")
|
||||
if err != nil {
|
||||
b.Fatal(err)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue