reftable/system: stop depending on "hash.h"

We include "hash.h" in "reftable/system.h" such that we can use hash
format IDs as well as the raw size of SHA1 and SHA256. As we are in the
process of converting the reftable library to become standalone we of
course cannot rely on those constants anymore.

Introduce a new `enum reftable_hash` to replace internal uses of the
hash format IDs and new constants that replace internal uses of the hash
size. Adapt the reftable backend to set up the correct hash function.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Patrick Steinhardt
2024-11-18 16:33:57 +01:00
committed by Junio C Hamano
parent 88e297275b
commit c2f08236ed
25 changed files with 166 additions and 143 deletions

View File

@@ -148,7 +148,7 @@ char *reftable_strdup(const char *str);
/* Find the longest shared prefix size of `a` and `b` */
int common_prefix_size(struct reftable_buf *a, struct reftable_buf *b);
int hash_size(uint32_t id);
int hash_size(enum reftable_hash id);
/*
* Format IDs that identify the hash function used by a reftable. Note that