pack-bitmap: load writer config from repository parameter

In bitmap_writer_init(), we take a repository parameter but ever look at
it. Most of the initialization here is independent of the repository,
but we do load some config. So let's pass the repo we get down to
load_pseudo_merges_from_config(), which in turn can use repo_config(),
rather than depending on the_repository via git_config().

The outcome is the same, since all callers pass in the_repository
anyway. But it takes us a step closer to getting rid of the global, and
as a bonus it silences an unused parameter warning.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Jeff King
2024-08-17 03:26:53 -04:00
committed by Junio C Hamano
parent 65e7a4478c
commit ecc6fa9ae9
3 changed files with 6 additions and 4 deletions

View File

@ -51,7 +51,7 @@ void bitmap_writer_init(struct bitmap_writer *writer, struct repository *r)
string_list_init_dup(&writer->pseudo_merge_groups);
load_pseudo_merges_from_config(&writer->pseudo_merge_groups);
load_pseudo_merges_from_config(r, &writer->pseudo_merge_groups);
}
static void free_pseudo_merge_commit_idx(struct pseudo_merge_commit_idx *idx)