diff options
-rw-r--r-- | object.c | 3 | ||||
-rw-r--r-- | refs.c | 3 | ||||
-rw-r--r-- | replace-object.c | 2 |
3 files changed, 7 insertions, 1 deletions
@@ -481,6 +481,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; @@ -1668,6 +1668,9 @@ struct ref_store *get_main_ref_store(struct repository *r) if (r->refs) return r->refs; + if (!r->gitdir) + BUG("attempting to get main_ref_store outside of repository"); + r->refs = ref_store_init(r->gitdir, REF_STORE_ALL_CAPS); return r->refs; } diff --git a/replace-object.c b/replace-object.c index 246b98cd4f..801b5c1678 100644 --- a/replace-object.c +++ b/replace-object.c @@ -37,7 +37,7 @@ static void prepare_replace_object(struct repository *r) return; r->objects->replace_map = - xmalloc(sizeof(*the_repository->objects->replace_map)); + xmalloc(sizeof(*r->objects->replace_map)); oidmap_init(r->objects->replace_map, 0); for_each_replace_ref(r, register_replace_ref, NULL); |