* store is no longer global and instead is a member of the repository
* object.
*/
- add_to_alternates_memory(submodule.objects->objectdir);
- grep_read_lock();
+ add_to_alternates_memory(submodule.objects->odb->path);
grep_read_unlock();
if (oid) {
return 0;
}
-void clear_midx_file(const char *object_dir)
+void clear_midx_file(struct repository *r)
{
- char *midx = get_midx_filename(r->objects->objectdir);
- char *midx = get_midx_filename(object_dir);
++ char *midx = get_midx_filename(r->objects->odb->path);
+
+ if (r->objects && r->objects->multi_pack_index) {
+ close_midx(r->objects->multi_pack_index);
+ r->objects->multi_pack_index = NULL;
+ }
if (remove_path(midx)) {
UNLEAK(midx);