tests: fix GIT_TEST_INSTALLED's PATH to include t/helper/
[gitweb.git] / builtin / repack.c
index 82c19b755509f83bf189dd70323a678c299c6b66..45583683eef4d59d1c8b957a8d9a8c0834db0e48 100644 (file)
@@ -431,8 +431,7 @@ int cmd_repack(int argc, const char **argv, const char *prefix)
                        char *fname, *fname_old;
 
                        if (!midx_cleared) {
-                               /* if we move a packfile, it will invalidated the midx */
-                               clear_midx_file(get_object_directory());
+                               clear_midx_file(the_repository);
                                midx_cleared = 1;
                        }
 
@@ -561,6 +560,10 @@ int cmd_repack(int argc, const char **argv, const char *prefix)
        if (!no_update_server_info)
                update_server_info(0);
        remove_temporary_files();
+
+       if (git_env_bool(GIT_TEST_MULTI_PACK_INDEX, 0))
+               write_midx_file(get_object_directory());
+
        string_list_clear(&names, 0);
        string_list_clear(&rollback, 0);
        string_list_clear(&existing_packs, 0);