]> git.ipfire.org Git - thirdparty/git.git/commit - cache.h
hex: add functions to parse hex object IDs in any algorithm
authorbrian m. carlson <sandals@crustytoothpaste.net>
Sat, 22 Feb 2020 20:17:29 +0000 (20:17 +0000)
committerJunio C Hamano <gitster@pobox.com>
Mon, 24 Feb 2020 17:33:21 +0000 (09:33 -0800)
commit61e2a70ff26f83f761fa36e0cc16996878d8dd59
treeb1b73887d34402bb39b536c42b3332b413d01c03
parentdadacf10dc9e11046e2c8c49347174e71cef3fa3
hex: add functions to parse hex object IDs in any algorithm

There are some places where we need to parse a hex object ID in any
algorithm without knowing beforehand which algorithm is in use. An
example is when parsing fast-import marks.

Add a get_oid_hex_any to parse an object ID and return the algorithm it
belongs to, and additionally add parse_oid_hex_any which is the
equivalent change for parse_oid_hex. If the object is not parseable, we
return GIT_HASH_UNKNOWN.

Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
cache.h
hex.c