diff options
| author | lhchavez <[email protected]> | 2020-12-10 05:35:40 -0800 |
|---|---|---|
| committer | GitHub <[email protected]> | 2020-12-10 05:35:40 -0800 |
| commit | e28cce87c7551bffa1f4602ff492348f9a8cba60 (patch) | |
| tree | 17cda66f878bd6285f24d0867c444e9ca2e191e6 /push_test.go | |
| parent | abf02bc7d79dfb7b0bbcd404ebecb202cff2a18e (diff) | |
Ensure that no pointer handles leak during the test (#712)
This change makes sure that pointer handles are correctly cleaned up
during tests.
Diffstat (limited to 'push_test.go')
| -rw-r--r-- | push_test.go | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/push_test.go b/push_test.go index f372882..311b86d 100644 --- a/push_test.go +++ b/push_test.go @@ -14,15 +14,18 @@ func TestRemotePush(t *testing.T) { remote, err := localRepo.Remotes.Create("test_push", repo.Path()) checkFatal(t, err) + defer remote.Free() seedTestRepo(t, localRepo) err = remote.Push([]string{"refs/heads/master"}, nil) checkFatal(t, err) - _, err = localRepo.References.Lookup("refs/remotes/test_push/master") + ref, err := localRepo.References.Lookup("refs/remotes/test_push/master") checkFatal(t, err) + defer ref.Free() - _, err = repo.References.Lookup("refs/heads/master") + ref, err = repo.References.Lookup("refs/heads/master") checkFatal(t, err) + defer ref.Free() } |
