aboutsummaryrefslogtreecommitdiffstats
path: root/reftable/basics.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 /reftable/basics.c
parent35f40385e441d5aa885f5aa813539d5ed9dc2d26 (diff)
parent988e7f5e952bbb7b6ae885f4da744f536f22693f (diff)
downloadgit-de9278127e107455fda269d2db280782d77e5eba.tar.gz
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 'reftable/basics.c')
-rw-r--r--reftable/basics.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/reftable/basics.c b/reftable/basics.c
index bc4fcc9144..7d84a5d62d 100644
--- a/reftable/basics.c
+++ b/reftable/basics.c
@@ -271,14 +271,15 @@ int common_prefix_size(struct reftable_buf *a, struct reftable_buf *b)
return p;
}
-int hash_size(uint32_t id)
+int hash_size(enum reftable_hash id)
{
+ if (!id)
+ return REFTABLE_HASH_SIZE_SHA1;
switch (id) {
- case 0:
- case GIT_SHA1_FORMAT_ID:
- return GIT_SHA1_RAWSZ;
- case GIT_SHA256_FORMAT_ID:
- return GIT_SHA256_RAWSZ;
+ case REFTABLE_HASH_SHA1:
+ return REFTABLE_HASH_SIZE_SHA1;
+ case REFTABLE_HASH_SHA256:
+ return REFTABLE_HASH_SIZE_SHA256;
}
abort();
}