]> git.ipfire.org Git - thirdparty/git.git/blobdiff - hash.h
Start the 2.46 cycle
[thirdparty/git.git] / hash.h
diff --git a/hash.h b/hash.h
index 615ae0691d070b4bdc110fecad3a0c484d2b234c..e064807c17333ab1ab5572adb4f331305bcad954 100644 (file)
--- a/hash.h
+++ b/hash.h
@@ -73,10 +73,15 @@ static inline void oidclr(struct object_id *oid)
        oid->algo = hash_algo_by_ptr(the_hash_algo);
 }
 
+static inline void oidread_algop(struct object_id *oid, const unsigned char *hash, const struct git_hash_algo *algop)
+{
+       memcpy(oid->hash, hash, algop->rawsz);
+       oid->algo = hash_algo_by_ptr(algop);
+}
+
 static inline void oidread(struct object_id *oid, const unsigned char *hash)
 {
-       memcpy(oid->hash, hash, the_hash_algo->rawsz);
-       oid->algo = hash_algo_by_ptr(the_hash_algo);
+       oidread_algop(oid, hash, the_hash_algo);
 }
 
 static inline int is_empty_blob_sha1(const unsigned char *sha1)