]> Kevux Git Server - rit/commit
hash: require hash algorithm in `hasheq()`, `hashcmp()` and `hashclr()`
authorPatrick Steinhardt <ps@pks.im>
Fri, 14 Jun 2024 06:49:50 +0000 (08:49 +0200)
committerJunio C Hamano <gitster@pobox.com>
Fri, 14 Jun 2024 17:26:32 +0000 (10:26 -0700)
commitf4836570a7adbd8c70ad7a8edf6ae5a977647c06
tree568c8b46cc7324a45e2c1d42f07ed80b36bf1230
parent129cb1b99df46771889c6d432055be4edd2b81b9
hash: require hash algorithm in `hasheq()`, `hashcmp()` and `hashclr()`

Many of our hash functions have two variants, one receiving a `struct
git_hash_algo` and one that derives it via `the_repository`. Adapt all
of those functions to always require the hash algorithm as input and
drop the variants that do not accept one.

As those functions are now independent of `the_repository`, we can move
them from "hash.h" to "hash-ll.h".

Note that both in this and subsequent commits in this series we always
just pass `the_repository->hash_algo` as input even if it is obvious
that there is a repository in the context that we should be using the
hash from instead. This is done to be on the safe side and not introduce
any regressions. All callsites should eventually be amended to use a
repo passed via parameters, but this is outside the scope of this patch
series.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 files changed:
builtin/index-pack.c
builtin/pack-redundant.c
builtin/unpack-objects.c
commit-graph.c
csum-file.c
hash-ll.h
hash-lookup.c
hash.h
http-walker.c
match-trees.c
notes.c
pack-bitmap-write.c
pack-bitmap.c
pack-check.c
pack-write.c
packfile.c
read-cache.c