sha1_file: allow link_alt_odb_entries to handle arbitrary repositories
[gitweb.git] / object.c
index 581347b53553ebba82d50bc8e56208caabf91f22..4c2cf7ff5d525b8559fc9099b1b957b0e61f3f97 100644 (file)
--- a/object.c
+++ b/object.c
@@ -5,6 +5,7 @@
 #include "commit.h"
 #include "tag.h"
 #include "object-store.h"
+#include "packfile.h"
 
 static struct object **obj_hash;
 static int nr_objs, obj_hash_size;
@@ -452,6 +453,7 @@ struct raw_object_store *raw_object_store_new(void)
        struct raw_object_store *o = xmalloc(sizeof(*o));
 
        memset(o, 0, sizeof(*o));
+       INIT_LIST_HEAD(&o->packed_git_mru);
        return o;
 }
 
@@ -480,4 +482,8 @@ void raw_object_store_clear(struct raw_object_store *o)
 
        free_alt_odbs(o);
        o->alt_odb_tail = NULL;
+
+       INIT_LIST_HEAD(&o->packed_git_mru);
+       close_all_packs(o);
+       o->packed_git = NULL;
 }