Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
tree-walk: avoid hard-coded 20 constant
author
brian m. carlson
<sandals@crustytoothpaste.net>
Wed, 2 May 2018 00:25:39 +0000
(
00:25
+0000)
committer
Junio C Hamano
<gitster@pobox.com>
Wed, 2 May 2018 04:59:50 +0000
(13:59 +0900)
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>
tree-walk.c
patch
|
blob
|
history
raw
|
patch
| inline |
side by side
(parent:
00de606
)
diff --git
a/tree-walk.c
b/tree-walk.c
index e11b3063afa610239162dc45c24528dd144c4759..27797c540672a6f0922495abd7a35870b424ee45 100644
(file)
--- 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;