aboutsummaryrefslogtreecommitdiffstats
path: root/t/unit-tests/lib-reftable.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2024-12-10 10:04:56 +0900
committerJunio C Hamano <gitster@pobox.com>2024-12-10 10:04:56 +0900
commitde9278127e107455fda269d2db280782d77e5eba (patch)
treed6b91c410d041a5b24e8a3c25f9fdba59c629a97 /t/unit-tests/lib-reftable.c
parentMerge branch 'bc/allow-upload-pack-from-other-people' (diff)
parentreftable/system: provide thin wrapper for lockfile subsystem (diff)
downloadgit-de9278127e107455fda269d2db280782d77e5eba.tar.gz
git-de9278127e107455fda269d2db280782d77e5eba.zip
Merge branch 'ps/reftable-detach'
Isolates the reftable subsystem from the rest of Git's codebase by using fewer pieces of Git's infrastructure. * ps/reftable-detach: reftable/system: provide thin wrapper for lockfile subsystem reftable/stack: drop only use of `get_locked_file_path()` reftable/system: provide thin wrapper for tempfile subsystem reftable/stack: stop using `fsync_component()` directly reftable/system: stop depending on "hash.h" reftable: explicitly handle hash format IDs reftable/system: move "dir.h" to its only user
Diffstat (limited to 't/unit-tests/lib-reftable.c')
-rw-r--r--t/unit-tests/lib-reftable.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/t/unit-tests/lib-reftable.c b/t/unit-tests/lib-reftable.c
index 2ddf480588..d795dfb7c9 100644
--- a/t/unit-tests/lib-reftable.c
+++ b/t/unit-tests/lib-reftable.c
@@ -2,8 +2,9 @@
#include "test-lib.h"
#include "reftable/constants.h"
#include "reftable/writer.h"
+#include "strbuf.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 +83,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');
}