diff options
author | Taylor Blau <me@ttaylorr.com> | 2021-10-08 17:46:35 -0400 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2021-10-15 13:08:11 -0700 |
commit | c0f1f9dec4457ffecf9e087665e6eb28da19c18f (patch) | |
tree | 6736b3b6d2aca71e3e084d9fbe8fea53f1af6071 | |
parent | midx.c: lookup MIDX by object directory during expire (diff) | |
download | tgif-c0f1f9dec4457ffecf9e087665e6eb28da19c18f.tar.xz |
midx.c: lookup MIDX by object directory during repack
Apply similar treatment as in the last commit to the MIDX `repack`
operation.
Signed-off-by: Taylor Blau <me@ttaylorr.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
-rw-r--r-- | midx.c | 5 |
1 files changed, 1 insertions, 4 deletions
@@ -1861,7 +1861,7 @@ int midx_repack(struct repository *r, const char *object_dir, size_t batch_size, struct child_process cmd = CHILD_PROCESS_INIT; FILE *cmd_in; struct strbuf base_name = STRBUF_INIT; - struct multi_pack_index *m = load_multi_pack_index(object_dir, 1); + struct multi_pack_index *m = lookup_multi_pack_index(r, object_dir); /* * When updating the default for these configuration @@ -1933,11 +1933,8 @@ int midx_repack(struct repository *r, const char *object_dir, size_t batch_size, } result = write_midx_internal(object_dir, NULL, NULL, NULL, NULL, flags); - m = NULL; cleanup: - if (m) - close_midx(m); free(include_pack); return result; } |