diff options
| author | Patrick Steinhardt <ps@pks.im> | 2025-03-10 08:13:20 +0100 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2025-03-10 13:16:18 -0700 |
| commit | 228457c9d9f32f000f5c04c36fcce9002f72965a (patch) | |
| tree | 93bba303fb1b835729222a1978e493d0e9e5a843 /builtin/pack-objects.c | |
| parent | A few more after -rc1 (diff) | |
| download | git-228457c9d9f32f000f5c04c36fcce9002f72965a.tar.gz git-228457c9d9f32f000f5c04c36fcce9002f72965a.zip | |
csum-file: stop depending on `the_repository`
There are multiple sites in "csum-file.c" where we use the global
`the_repository` variable, either explicitly or implicitly by using
`the_hash_algo`.
Refactor the code to stop using `the_repository` by adapting functions
to receive required data as parameters. Adapt callsites accordingly by
either using `the_repository->hash_algo`, or by using a context-provided
hash algorithm in case the subsystem already got rid of its dependency
on `the_repository`.
Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/pack-objects.c')
| -rw-r--r-- | builtin/pack-objects.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/builtin/pack-objects.c b/builtin/pack-objects.c index 58a9b16126..8e282f2a98 100644 --- a/builtin/pack-objects.c +++ b/builtin/pack-objects.c @@ -1311,7 +1311,8 @@ static void write_pack_file(void) char *pack_tmp_name = NULL; if (pack_to_stdout) - f = hashfd_throughput(1, "<stdout>", progress_state); + f = hashfd_throughput(the_repository->hash_algo, 1, + "<stdout>", progress_state); else f = create_tmp_packfile(&pack_tmp_name); |
