diff options
| author | Patrick Steinhardt <ps@pks.im> | 2024-11-18 16:33:57 +0100 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2024-11-19 12:23:10 +0900 |
| commit | c2f08236ed786a48e50af33ecc5c0f951c14761b (patch) | |
| tree | 2bf85fa99746b31ee4b1b3fc5d53bb5ce1c5ea6b /t/unit-tests/lib-reftable.c | |
| parent | 88e297275b94f2fbbc60b770f37654796799b907 (diff) | |
| download | git-c2f08236ed786a48e50af33ecc5c0f951c14761b.tar.gz | |
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>
Diffstat (limited to 't/unit-tests/lib-reftable.c')
| -rw-r--r-- | t/unit-tests/lib-reftable.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/t/unit-tests/lib-reftable.c b/t/unit-tests/lib-reftable.c index 2ddf480588..c1631f4527 100644 --- a/t/unit-tests/lib-reftable.c +++ b/t/unit-tests/lib-reftable.c @@ -3,7 +3,7 @@ #include "reftable/constants.h" #include "reftable/writer.h" -void t_reftable_set_hash(uint8_t *p, int i, uint32_t id) +void t_reftable_set_hash(uint8_t *p, int i, enum reftable_hash id) { memset(p, (uint8_t)i, hash_size(id)); } @@ -82,7 +82,7 @@ void t_reftable_write_to_buf(struct reftable_buf *buf, size_t off = i * (opts.block_size ? opts.block_size : DEFAULT_BLOCK_SIZE); if (!off) - off = header_size(opts.hash_id == GIT_SHA256_FORMAT_ID ? 2 : 1); + off = header_size(opts.hash_id == REFTABLE_HASH_SHA256 ? 2 : 1); check_char(buf->buf[off], ==, 'r'); } |
