[PATCH] git-cvs2git: create tags
[git.git] / object.c
index deb6830..5e72a78 100644 (file)
--- a/object.c
+++ b/object.c
@@ -5,8 +5,6 @@
 #include "cache.h"
 #include "tag.h"
 #include "delta.h"
-#include <stdlib.h>
-#include <string.h>
 
 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);