]> git.ipfire.org Git - thirdparty/git.git/commit
t/test-repository: fix leaking repository
authorPatrick Steinhardt <ps@pks.im>
Thu, 1 Aug 2024 10:40:56 +0000 (12:40 +0200)
committerJunio C Hamano <gitster@pobox.com>
Thu, 1 Aug 2024 15:47:37 +0000 (08:47 -0700)
commit11f841c1cc9c7ffadf5d462d25a378fcab5bb6e1
treefd03655da0f37f65038aac6f6d40b826f581e307
parent145c9790207b9847b609d997c86c7cf8cec043b2
t/test-repository: fix leaking repository

The test-repository test helper zeroes out `the_repository` such that it
can be sure that our codebase only ends up using the supplied repository
that we initialize in the respective helper functions. This does cause
memory leaks though as the data that `the_repository` has been holding
onto is not referenced anymore.

Fix this by calling `repo_clear()` instead.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/helper/test-repository.c
t/t5318-commit-graph.sh