Subject: [PATCH 02/17] fixup! packv4-parse.c: add tree offset caching

From: Nguyễn Thái Ngọc Duy <[email-masked]>
Date: Sat, 21 Sep 2013 20:57:48 +0700

we need to pass an offset pointing to the header because
unpack_entry() needs that..

Signed-off-by: Nguyễn Thái Ngọc Duy <[email-masked]>
---
 packv4-parse.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/packv4-parse.c b/packv4-parse.c
index 6abd62e..e833cd2 100644
--- a/packv4-parse.c
+++ b/packv4-parse.c
@@ -470,8 +470,7 @@ static int decode_entries(struct packed_git *p, struct pack_window **w_curs,
 
 		/* is this a canonical tree object? */
 		if ((*scp & 0xf) == OBJ_TREE) {
-			offset = obj_offset + (scp - src);
-			return copy_canonical_tree_entries(p, offset,
+			return copy_canonical_tree_entries(p, obj_offset,
 							   start, count,
 							   dstp, sizep);
 		}
@@ -647,7 +646,7 @@ static int decode_entries(struct packed_git *p, struct pack_window **w_curs,
 		c->offset = offset;
 		c->last_copy_base = copy_objoffset;
 	}
-						
+
 	return 0;
 }
 
-- 
1.8.2.83.gc99314b