X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=object.c;h=1a7823c234406a418d360bf5ea322fe2321aec06;hb=136f2e548a34f1f504b0f062f87ddf33e8d6e83b;hp=4d46e0d5e4285251e60d2a6d938f38355ac5d2c0;hpb=12d81ce59846e17676c5534257ca2f1783829d63;p=git.git diff --git a/object.c b/object.c index 4d46e0d5..1a7823c2 100644 --- a/object.c +++ b/object.c @@ -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);