diff options
author | Linus Torvalds <torvalds@osdl.org> | 2006-05-29 12:16:46 -0700 |
---|---|---|
committer | Junio C Hamano <junkio@cox.net> | 2006-05-29 19:05:06 -0700 |
commit | 3a7c352bd0ecac4b4c96c0995d61de9ef8d814f9 (patch) | |
tree | 3ced54e201e6968c284baea7f996a4a45554caec /builtin-read-tree.c | |
parent | 136f2e548a34f1f504b0f062f87ddf33e8d6e83b (diff) | |
download | git-3a7c352bd0ecac4b4c96c0995d61de9ef8d814f9.tar.gz |
Make "tree_entry" have a SHA1 instead of a union of object pointers
This is preparatory work for further cleanups, where we try to make
tree_entry look more like the more efficient tree-walk descriptor.
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'builtin-read-tree.c')
-rw-r--r-- | builtin-read-tree.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/builtin-read-tree.c b/builtin-read-tree.c index 6876f3d793..5e513c85ca 100644 --- a/builtin-read-tree.c +++ b/builtin-read-tree.c @@ -161,9 +161,10 @@ static int unpack_trees_rec(struct tree_entry_list **posns, int len, } if (posns[i]->directory) { + struct tree *tree = lookup_tree(posns[i]->sha1); any_dirs = 1; - parse_tree(posns[i]->item.tree); - subposns[i] = posns[i]->item.tree->entries; + parse_tree(tree); + subposns[i] = tree->entries; posns[i] = posns[i]->next; src[i + merge] = &df_conflict_entry; continue; @@ -187,7 +188,7 @@ static int unpack_trees_rec(struct tree_entry_list **posns, int len, any_files = 1; - memcpy(ce->sha1, posns[i]->item.any->sha1, 20); + memcpy(ce->sha1, posns[i]->sha1, 20); src[i + merge] = ce; subposns[i] = &df_conflict_list; posns[i] = posns[i]->next; @@ -783,7 +784,7 @@ static void prime_cache_tree_rec(struct cache_tree *it, struct tree *tree) cnt++; else { struct cache_tree_sub *sub; - struct tree *subtree = (struct tree *)ent->item.tree; + struct tree *subtree = lookup_tree(ent->sha1); if (!subtree->object.parsed) parse_tree(subtree); sub = cache_tree_sub(it, ent->name); |