]> git.ipfire.org Git - thirdparty/git.git/commitdiff
t/helper: fix leaking repository in partial-clone helper
authorPatrick Steinhardt <ps@pks.im>
Mon, 30 Sep 2024 09:13:40 +0000 (11:13 +0200)
committerJunio C Hamano <gitster@pobox.com>
Mon, 30 Sep 2024 18:23:05 +0000 (11:23 -0700)
We initialize but never clear a repository in the partial-clone test
helper. Plug this leak.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/helper/test-partial-clone.c
t/t0410-partial-clone.sh

index 0ead529167a1eb18bbb176281bfb7a5d0e1c23f2..a1af9710c31002e30314f28cf9c5c76217590cdf 100644 (file)
@@ -26,6 +26,8 @@ static void object_info(const char *gitdir, const char *oid_hex)
        if (oid_object_info_extended(&r, &oid, &oi, 0))
                die("could not obtain object info");
        printf("%d\n", (int) size);
+
+       repo_clear(&r);
 }
 
 int cmd__partial_clone(int argc, const char **argv)
index 34bdb3ab1f23b70115a47bb7b5bb01fb57beae8f..818700fbecd457a9fbb7cc3bb91984c1224631d5 100755 (executable)
@@ -2,6 +2,7 @@
 
 test_description='partial clone'
 
+TEST_PASSES_SANITIZE_LEAK=true
 . ./test-lib.sh
 . "$TEST_DIRECTORY"/lib-terminal.sh