X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=object.c;h=5e72a7878488922cfeeb5dba385d72049253f7c3;hb=000182eacf99cde27d5916aa415921924b82972c;hp=deb683076d7e1a91e913398ff905085230014a4f;hpb=d1af002dc608be3213ba18df1a99ced0ab42e6d6;p=git.git diff --git a/object.c b/object.c index deb68307..5e72a787 100644 --- a/object.c +++ b/object.c @@ -5,8 +5,6 @@ #include "cache.h" #include "tag.h" #include "delta.h" -#include -#include struct object **objs; int nr_objs; @@ -131,6 +129,10 @@ struct object *parse_object(unsigned char *sha1) } else if (!strcmp(type, "commit")) { struct commit *commit = lookup_commit(sha1); parse_commit_buffer(commit, buffer, size); + if (!commit->buffer) { + commit->buffer = buffer; + buffer = NULL; + } obj = &commit->object; } else if (!strcmp(type, "tag")) { struct tag *tag = lookup_tag(sha1);