Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/hash.h
diff options
context:
space:
mode:
authorbrian m. carlson <sandals@crustytoothpaste.net>2019-02-19 03:05:17 +0300
committerJunio C Hamano <gitster@pobox.com>2019-04-01 05:57:39 +0300
commit95399788d158e4628e25db20569d44af21a40906 (patch)
tree4051c49eddd71f891f7961fec6b251452af31f6b /hash.h
parent9c9492e8aafdcc2ec464e9261b78619b05a835f8 (diff)
hash: add a function to lookup hash algorithm by length
There are some cases, such as the dumb HTTP transport and bundles, where we can only determine the hash algorithm in use by the length of the object IDs. Provide a function that looks up the algorithm by length. Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'hash.h')
-rw-r--r--hash.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/hash.h b/hash.h
index adde708cf2..661c9f2281 100644
--- a/hash.h
+++ b/hash.h
@@ -131,6 +131,8 @@ extern const struct git_hash_algo hash_algos[GIT_HASH_NALGOS];
int hash_algo_by_name(const char *name);
/* Identical, except based on the format ID. */
int hash_algo_by_id(uint32_t format_id);
+/* Identical, except based on the length. */
+int hash_algo_by_length(int len);
/* Identical, except for a pointer to struct git_hash_algo. */
static inline int hash_algo_by_ptr(const struct git_hash_algo *p)
{