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>

Taylor Blau committed Oct 8, 2021 at 17:46 UTC c0f1f9dec4457ffecf9e087665e6eb28da19c18f
1 file changed +1 -4
midx.c
+1 -4
@@ -1861,7 +1861,7 @@ int midx_repack(struct repository *r, const char *object_dir, size_t batch_size,
1861 struct child_process cmd = CHILD_PROCESS_INIT;
1862 FILE *cmd_in;
1863 struct strbuf base_name = STRBUF_INIT;
1864 - struct multi_pack_index *m = load_multi_pack_index(object_dir, 1);
1864 + struct multi_pack_index *m = lookup_multi_pack_index(r, object_dir);
1865
1866 /*
1867 * 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,
1933 }
1934
1935 result = write_midx_internal(object_dir, NULL, NULL, NULL, NULL, flags);
1936 - m = NULL;
1936
1937 cleanup:
1939 - if (m)
1940 - close_midx(m);
1938 free(include_pack);
1939 return result;
1940 }