Skip to content

Commit 40e9136

Browse files
pks-tgitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 61a22dd commit 40e9136

File tree

1 file changed

+0
-1
lines changed

1 file changed

+0
-1
lines changed

t/helper/test-bloom.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ static void get_bloom_filter_for_commit(const struct object_id *commit_oid)
4040
{
4141
struct commit *c;
4242
struct bloom_filter *filter;
43-
setup_git_directory();
4443
c = lookup_commit(the_repository, commit_oid);
4544
filter = get_or_compute_bloom_filter(the_repository, c, 1,
4645
&settings,

0 commit comments

Comments
 (0)