aboutsummaryrefslogtreecommitdiff
path: root/hash.c
diff options
context:
space:
mode:
Diffstat (limited to 'hash.c')
-rw-r--r--hash.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/hash.c b/hash.c
index 81b4f87027..97fd473607 100644
--- a/hash.c
+++ b/hash.c
@@ -241,6 +241,13 @@ const char *empty_tree_oid_hex(const struct git_hash_algo *algop)
return oid_to_hex_r(buf, algop->empty_tree);
}
+const struct git_hash_algo *hash_algo_ptr_by_number(uint32_t algo)
+{
+ if (algo >= GIT_HASH_NALGOS)
+ return NULL;
+ return &hash_algos[algo];
+}
+
uint32_t hash_algo_by_name(const char *name)
{
if (!name)