]> git.ipfire.org Git - thirdparty/git.git/commit
pack-write: pass hash_algo to `fixup_pack_header_footer()`
authorKarthik Nayak <karthik.188@gmail.com>
Sun, 19 Jan 2025 11:19:26 +0000 (12:19 +0100)
committerJunio C Hamano <gitster@pobox.com>
Tue, 21 Jan 2025 20:36:34 +0000 (12:36 -0800)
commit8244d01de6402606c9fb588ce2143aa629aa7d0e
treebeec447534938776b2ebecb945192f1ec4057984
parentfbe8d3079d4a96aeb4e4529cc93cc0043b759a05
pack-write: pass hash_algo to `fixup_pack_header_footer()`

The `fixup_pack_header_footer()` function uses the global
`the_hash_algo` variable to access the repository's hash function. To
avoid global variable usage, pass a hash_algo from the layers above.

Altough the layers above could have access to the hash_algo internally,
simply pass in `the_hash_algo`. This avoids any compatibility issues and
bubbles up global variable usage to upper layers which can be eventually
resolved.

Signed-off-by: Karthik Nayak <karthik.188@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/fast-import.c
builtin/index-pack.c
builtin/pack-objects.c
bulk-checkin.c
pack-write.c
pack.h