From: brian m. carlson Date: Mon, 26 Apr 2021 01:03:01 +0000 (+0000) Subject: hex: print objects using the hash algorithm member X-Git-Tag: v2.32.0-rc0~31^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=3dd71461e25b4cc7ea2a2d8deef1c0486bb32580;p=thirdparty%2Fgit.git 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 Signed-off-by: Junio C Hamano --- diff --git a/hex.c b/hex.c index 74d256f239..4f64d34696 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]); }