]> Kevux Git Server - rit/commit
csum-file: stop depending on `the_repository`
authorPatrick Steinhardt <ps@pks.im>
Mon, 10 Mar 2025 07:13:20 +0000 (08:13 +0100)
committerJunio C Hamano <gitster@pobox.com>
Mon, 10 Mar 2025 20:16:18 +0000 (13:16 -0700)
commit228457c9d9f32f000f5c04c36fcce9002f72965a
tree93bba303fb1b835729222a1978e493d0e9e5a843
parente969bc875963a10890d61ba84eab3a460bd9e535
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>
14 files changed:
builtin/fast-import.c
builtin/index-pack.c
builtin/pack-objects.c
commit-graph.c
csum-file.c
csum-file.h
midx-write.c
midx.c
pack-bitmap-write.c
pack-bitmap.c
pack-check.c
pack-revindex.c
pack-write.c
read-cache.c