diff --git a/object.c b/object.c
index deb683076d7e1a91e913398ff905085230014a4f..5e72a7878488922cfeeb5dba385d72049253f7c3 100644 (file)
--- a/object.c
+++ b/object.c
#include "cache.h"
#include "tag.h"
#include "delta.h"
-#include <stdlib.h>
-#include <string.h>
struct object **objs;
int nr_objs;
} 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);