mirror of
https://github.com/git/git.git
synced 2024-11-23 18:05:29 +08:00
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>
This commit is contained in:
parent
00de606332
commit
e84bc23cb6
@ -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;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user