diff options
author | Patrick Steinhardt <ps@pks.im> | 2023-11-06 11:45:53 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2023-11-07 08:51:40 +0900 |
commit | 40e9136ff641682e2ef739a3dbce03047ed5426f (patch) | |
tree | 32194f6d4238e1b9605b0f37a6d52e236d230d72 | |
parent | 61a22ddaf0626111193a17ac12f366bd6d167dff (diff) | |
download | git-40e9136ff641682e2ef739a3dbce03047ed5426f.tar.gz |
test-bloom: stop setting up Git directory twice
We're setting up the Git directory twice in the `test-tool bloom`
helper, once at the beginning of `cmd_bloom()` and once in the local
subcommand implementation `get_bloom_filter_for_commit()`. This can lead
to memory leaks as we'll overwrite variables of `the_repository` with
newly allocated data structures. On top of that it's simply unnecessary.
Fix this by only setting up the Git directory once.
Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
-rw-r--r-- | t/helper/test-bloom.c | 1 |
1 files changed, 0 insertions, 1 deletions
diff --git a/t/helper/test-bloom.c b/t/helper/test-bloom.c index aabe31d724..1281e66876 100644 --- a/t/helper/test-bloom.c +++ b/t/helper/test-bloom.c @@ -40,7 +40,6 @@ static void get_bloom_filter_for_commit(const struct object_id *commit_oid) { struct commit *c; struct bloom_filter *filter; - setup_git_directory(); c = lookup_commit(the_repository, commit_oid); filter = get_or_compute_bloom_filter(the_repository, c, 1, &settings, |