]> git.ipfire.org Git - thirdparty/git.git/blobdiff - sha1-file.c
contrib/buildsystems: handle the curl library option
[thirdparty/git.git] / sha1-file.c
index 0299fdd5161a59bf88d9f2c41a83c7e6ecd4cc2b..888b6024d5de050753765e37b65ea0521d91f9fd 100644 (file)
@@ -189,6 +189,14 @@ int hash_algo_by_id(uint32_t format_id)
        return GIT_HASH_UNKNOWN;
 }
 
+int hash_algo_by_length(int len)
+{
+       int i;
+       for (i = 1; i < GIT_HASH_NALGOS; i++)
+               if (len == hash_algos[i].rawsz)
+                       return i;
+       return GIT_HASH_UNKNOWN;
+}
 
 /*
  * This is meant to hold a *small* number of objects that you would