summaryrefslogtreecommitdiff
path: root/tree-walk.c
diff options
context:
space:
mode:
authorbrian m. carlson <sandals@crustytoothpaste.net>2018-05-02 00:25:39 (GMT)
committerJunio C Hamano <gitster@pobox.com>2018-05-02 04:59:50 (GMT)
commite84bc23cb69209c771abd4fe098773340a850c48 (patch)
tree42179f58f8a40a9bf7247fba4c740944971d6bf3 /tree-walk.c
parent00de60633228f11a2941c25fc7738f8028756cb9 (diff)
downloadgit-e84bc23cb69209c771abd4fe098773340a850c48.zip
git-e84bc23cb69209c771abd4fe098773340a850c48.tar.gz
git-e84bc23cb69209c771abd4fe098773340a850c48.tar.bz2
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 <sandals@crustytoothpaste.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'tree-walk.c')
-rw-r--r--tree-walk.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/tree-walk.c b/tree-walk.c
index e11b306..27797c5 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;