summaryrefslogtreecommitdiff
path: root/hex.c
diff options
context:
space:
mode:
authorbrian m. carlson <sandals@crustytoothpaste.net>2021-04-26 01:03:01 (GMT)
committerJunio C Hamano <gitster@pobox.com>2021-04-27 07:31:39 (GMT)
commit3dd71461e25b4cc7ea2a2d8deef1c0486bb32580 (patch)
treecf8b9de174d76c8dcfe6c5a0156e721588c33752 /hex.c
parentb8505ecbf2b1e4ef27b9597fd113cb1679792b29 (diff)
downloadgit-3dd71461e25b4cc7ea2a2d8deef1c0486bb32580.zip
git-3dd71461e25b4cc7ea2a2d8deef1c0486bb32580.tar.gz
git-3dd71461e25b4cc7ea2a2d8deef1c0486bb32580.tar.bz2
hex: print objects using the hash algorithm member
Now that all code paths correctly set the hash algorithm member of struct object_id, write an object's hex representation using the hash algorithm member embedded in it. Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'hex.c')
-rw-r--r--hex.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/hex.c b/hex.c
index 74d256f..4f64d34 100644
--- a/hex.c
+++ b/hex.c
@@ -143,7 +143,7 @@ char *hash_to_hex_algop_r(char *buffer, const unsigned char *hash,
char *oid_to_hex_r(char *buffer, const struct object_id *oid)
{
- return hash_to_hex_algop_r(buffer, oid->hash, the_hash_algo);
+ return hash_to_hex_algop_r(buffer, oid->hash, &hash_algos[oid->algo]);
}
char *hash_to_hex_algop(const unsigned char *hash, const struct git_hash_algo *algop)
@@ -161,5 +161,5 @@ char *hash_to_hex(const unsigned char *hash)
char *oid_to_hex(const struct object_id *oid)
{
- return hash_to_hex_algop(oid->hash, the_hash_algo);
+ return hash_to_hex_algop(oid->hash, &hash_algos[oid->algo]);
}