From: brian m. carlson Date: Wed, 2 May 2018 00:25:39 +0000 (+0000) Subject: tree-walk: avoid hard-coded 20 constant X-Git-Tag: v2.18.0-rc0~17^2~31 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/e84bc23cb69209c771abd4fe098773340a850c48 tree-walk: avoid hard-coded 20 constant Use the_hash_algo to look up the length of our current hash instead of hard-coding the value 20. Signed-off-by: brian m. carlson Signed-off-by: Junio C Hamano --- diff --git a/tree-walk.c b/tree-walk.c index e11b3063af..27797c5406 100644 --- a/tree-walk.c +++ b/tree-walk.c @@ -105,7 +105,7 @@ static void entry_extract(struct tree_desc *t, struct name_entry *a) static int update_tree_entry_internal(struct tree_desc *desc, struct strbuf *err) { const void *buf = desc->buffer; - const unsigned char *end = desc->entry.oid->hash + 20; + const unsigned char *end = desc->entry.oid->hash + the_hash_algo->rawsz; unsigned long size = desc->size; unsigned long len = end - (const unsigned char *)buf;