summaryrefslogtreecommitdiff
path: root/midx.c
diff options
context:
space:
mode:
authorTaylor Blau <me@ttaylorr.com>2021-10-08 21:46:35 (GMT)
committerJunio C Hamano <gitster@pobox.com>2021-10-15 20:08:11 (GMT)
commitc0f1f9dec4457ffecf9e087665e6eb28da19c18f (patch)
tree6736b3b6d2aca71e3e084d9fbe8fea53f1af6071 /midx.c
parent98926e0d015e03a3b922ba6d8ca652f1da7b4429 (diff)
downloadgit-c0f1f9dec4457ffecf9e087665e6eb28da19c18f.zip
git-c0f1f9dec4457ffecf9e087665e6eb28da19c18f.tar.gz
git-c0f1f9dec4457ffecf9e087665e6eb28da19c18f.tar.bz2
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>
Diffstat (limited to 'midx.c')
-rw-r--r--midx.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/midx.c b/midx.c
index 053279b..f2c9760 100644
--- a/midx.c
+++ b/midx.c
@@ -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;
}