[PATCH 04/17] commit: express tree entry constants in terms of the_hash_algo
- From
brian m. carlson <sandals@crustytoothpaste.net>
- Date
- Jul 8, 2018, 23:36 UTC
- Message-ID
- <20180708233638.520172-5-sandals@crustytoothpaste.net>
- In-Reply-To
- <20180708233638.520172-1-sandals@crustytoothpaste.net>
Specify these constants in terms of the size of the hash algorithm currently in use.
Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net> --- commit.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/commit.c b/commit.c index 0c3b75aeff..ff05d04570 100644 --- a/commit.c +++ b/commit.c @@ -364,8 +364,8 @@ int parse_commit_buffer(struct commit *item, const void *buffer, unsigned long s struct object_id parent; struct commit_list **pptr; struct commit_graft *graft; - const int tree_entry_len = GIT_SHA1_HEXSZ + 5; - const int parent_entry_len = GIT_SHA1_HEXSZ + 7; + const int tree_entry_len = the_hash_algo->hexsz + 5; + const int parent_entry_len = the_hash_algo->hexsz + 7; if (item->object.parsed) return 0;