aboutsummaryrefslogtreecommitdiffstats
path: root/object-file.c
diff options
context:
space:
mode:
authorHan-Wen Nienhuys <hanwen@google.com>2021-08-30 14:57:37 +0000
committerJunio C Hamano <gitster@pobox.com>2021-09-07 10:47:43 -0700
commit27f3796ac1f9b711fae506f63186034ed178690c (patch)
treed82c23124c2df0f3fa49b3c781f33a065a9d7dc7 /object-file.c
parentc4203212e360b25a1c69467b5a8437d45a373cac (diff)
downloadgit-27f3796ac1f9b711fae506f63186034ed178690c.tar.gz
hash.h: provide constants for the hash IDs
This will simplify referencing them from code that is not deeply integrated with Git, in particular, the reftable library. Signed-off-by: Han-Wen Nienhuys <hanwen@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'object-file.c')
-rw-r--r--object-file.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/object-file.c b/object-file.c
index a8be899481..7bfd5e6e2e 100644
--- a/object-file.c
+++ b/object-file.c
@@ -164,7 +164,6 @@ static void git_hash_unknown_final_oid(struct object_id *oid, git_hash_ctx *ctx)
BUG("trying to finalize unknown hash");
}
-
const struct git_hash_algo hash_algos[GIT_HASH_NALGOS] = {
{
NULL,
@@ -183,8 +182,7 @@ const struct git_hash_algo hash_algos[GIT_HASH_NALGOS] = {
},
{
"sha1",
- /* "sha1", big-endian */
- 0x73686131,
+ GIT_SHA1_FORMAT_ID,
GIT_SHA1_RAWSZ,
GIT_SHA1_HEXSZ,
GIT_SHA1_BLKSZ,
@@ -199,8 +197,7 @@ const struct git_hash_algo hash_algos[GIT_HASH_NALGOS] = {
},
{
"sha256",
- /* "s256", big-endian */
- 0x73323536,
+ GIT_SHA256_FORMAT_ID,
GIT_SHA256_RAWSZ,
GIT_SHA256_HEXSZ,
GIT_SHA256_BLKSZ,