summaryrefslogtreecommitdiff
path: root/builtin/repack.c
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2018-11-13 22:37:19 +0900
committerLibravatar Junio C Hamano <gitster@pobox.com>2018-11-13 22:37:19 +0900
commit5fb9263295b425c7acfde66c8abe5d53fa55d2c3 (patch)
tree8e62ddfccfdc49a24407fcf1eafc67e5548fdfd8 /builtin/repack.c
parentMerge branch 'nd/wildmatch-double-asterisk' (diff)
parentpackfile: close multi-pack-index in close_all_packs (diff)
downloadtgif-5fb9263295b425c7acfde66c8abe5d53fa55d2c3.tar.xz
Merge branch 'ds/test-multi-pack-index'
Tests for the recently introduced multi-pack index machinery. * ds/test-multi-pack-index: packfile: close multi-pack-index in close_all_packs multi-pack-index: define GIT_TEST_MULTI_PACK_INDEX midx: close multi-pack-index on repack midx: fix broken free() in close_midx()
Diffstat (limited to 'builtin/repack.c')
-rw-r--r--builtin/repack.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/builtin/repack.c b/builtin/repack.c
index 82c19b7555..45583683ee 100644
--- a/builtin/repack.c
+++ b/builtin/repack.c
@@ -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);