Reworked read-tree.
- From
Junio C Hamano <junkio@cox.net>
- Date
- Sep 1, 2005, 07:10 UTC
- Message-ID
- <7vpsrt1cwc.fsf_-_@assigned-by-dhcp.cox.net>
- In-Reply-To
- <7vvf1l1env.fsf@assigned-by-dhcp.cox.net>
Daniel, I do not know what your current status is, but I think you need something like this.
I was scratching my head figuring out why it passes all the t/ tests but couldn't do a simple 'git-read-tree HEAD'.
---
diff --git a/tree.c b/tree.c --- a/tree.c +++ b/tree.c @@ -224,10 +224,12 @@ struct tree *parse_tree_indirect(const u if (obj->type == tree_type) return (struct tree *) obj; else if (obj->type == commit_type) - return ((struct commit *) obj)->tree; + obj = (struct object *)(((struct commit *) obj)->tree); else if (obj->type == tag_type) - obj = ((struct tag *) obj)->tagged; + obj = deref_tag(obj); else return NULL; + if (!obj->parsed) + parse_object(obj->sha1); } while (1); }