t/helper: fix leaking subrepo in nested submodule config helper

In the "submodule-nested-repo-config" helper we create a submodule repository and print its configuration. We do not clear the repo, causing a memory leak. Plug it. Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Patrick Steinhardt committed Sep 26, 2024 at 13:46 UTC f1652c04b5da814a6bd15873a0a0323bf58badcf
2 files changed +2 -1
t/helper/test-submodule-nested-repo-config.c
+1 -1
@@ -29,6 +29,6 @@ int cmd__submodule_nested_repo_config(int argc, const char **argv)
29 print_config_from_gitmodules(&subrepo, argv[2]);
30
31 submodule_free(the_repository);
32 -
32 + repo_clear(&subrepo);
33 return 0;
34 }
t/t7411-submodule-config.sh
+1
@@ -10,6 +10,7 @@ from the database and from the worktree works.
10 '
11
12 TEST_NO_CREATE_REPO=1
13 +TEST_PASSES_SANITIZE_LEAK=true
14 . ./test-lib.sh
15
16 test_expect_success 'setup' '