diff options
author | Linus Torvalds <torvalds@osdl.org> | 2006-05-29 12:16:12 -0700 |
---|---|---|
committer | Junio C Hamano <junkio@cox.net> | 2006-05-29 19:05:02 -0700 |
commit | 136f2e548a34f1f504b0f062f87ddf33e8d6e83b (patch) | |
tree | e5dcfa1d5325c5bbe1ba8e7f1295a298b3aa7091 /object.c | |
parent | e0c97ca63df2590026fe1f9a76fefba54b291d06 (diff) | |
download | git-136f2e548a34f1f504b0f062f87ddf33e8d6e83b.tar.gz |
Make "struct tree" contain the pointer to the tree buffer
This allows us to avoid allocating information for names etc, because
we can just use the information from the tree buffer directly.
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'object.c')
-rw-r--r-- | object.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -200,8 +200,11 @@ struct object *parse_object(const unsigned char *sha1) obj = &blob->object; } else if (!strcmp(type, tree_type)) { struct tree *tree = lookup_tree(sha1); - parse_tree_buffer(tree, buffer, size); obj = &tree->object; + if (!tree->object.parsed) { + parse_tree_buffer(tree, buffer, size); + buffer = NULL; + } } else if (!strcmp(type, commit_type)) { struct commit *commit = lookup_commit(sha1); parse_commit_buffer(commit, buffer, size); |