cache.h: extract enum declaration from inside a struct declaration
[gitweb.git] / object.c
index 8e29f63bf2325327027edc1ffd25e89b53309bcf..9b0f819fae38bcc2fe6b15bfe8e5b9b17f7385bc 100644 (file)
--- a/object.c
+++ b/object.c
@@ -1,6 +1,7 @@
 #include "cache.h"
 #include "object.h"
 #include "replace-object.h"
+#include "object-store.h"
 #include "blob.h"
 #include "tree.h"
 #include "commit.h"
@@ -213,7 +214,7 @@ struct object *parse_object_buffer(const struct object_id *oid, enum object_type
        } else if (type == OBJ_COMMIT) {
                struct commit *commit = lookup_commit(oid);
                if (commit) {
-                       if (parse_commit_buffer(commit, buffer, size))
+                       if (parse_commit_buffer(commit, buffer, size, 1))
                                return NULL;
                        if (!get_cached_commit_buffer(commit, NULL)) {
                                set_commit_buffer(commit, buffer, size);
@@ -463,6 +464,9 @@ struct parsed_object_pool *parsed_object_pool_new(void)
        o->tag_state = allocate_alloc_state();
        o->object_state = allocate_alloc_state();
 
+       o->is_shallow = -1;
+       o->shallow_stat = xcalloc(1, sizeof(*o->shallow_stat));
+
        return o;
 }
 
@@ -498,6 +502,9 @@ void raw_object_store_clear(struct raw_object_store *o)
        FREE_AND_NULL(o->objectdir);
        FREE_AND_NULL(o->alternate_db);
 
+       oidmap_free(o->replace_map, 1);
+       FREE_AND_NULL(o->replace_map);
+
        free_alt_odbs(o);
        o->alt_odb_tail = NULL;