summaryrefslogtreecommitdiff
path: root/midx.h
diff options
context:
space:
mode:
authorDerrick Stolee <dstolee@microsoft.com>2018-10-12 10:34:19 -0700
committerJunio C Hamano <gitster@pobox.com>2018-10-22 10:42:46 +0900
commit1dcd9f2043a38f0c9684d47c71b9e383942660ac (patch)
treeccc137d372ff6f1d4a6285f7448ac7f5e465eba3 /midx.h
parent0ce4ff942125eabed3df694dc27922bec8177624 (diff)
downloadgit-1dcd9f2043a38f0c9684d47c71b9e383942660ac.tar.gz
midx: close multi-pack-index on repack
When repacking, we may remove pack-files. This invalidates the multi-pack-index (if it exists). Previously, we removed the multi-pack-index file before removing any pack-file. In some cases, the repack command may load the multi-pack-index into memory. This may lead to later in-memory references to the non-existent pack- files. Signed-off-by: Derrick Stolee <dstolee@microsoft.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'midx.h')
-rw-r--r--midx.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/midx.h b/midx.h
index a210f1af2a..7e60907596 100644
--- a/midx.h
+++ b/midx.h
@@ -42,6 +42,8 @@ int midx_contains_pack(struct multi_pack_index *m, const char *idx_name);
int prepare_multi_pack_index_one(struct repository *r, const char *object_dir, int local);
int write_midx_file(const char *object_dir);
-void clear_midx_file(const char *object_dir);
+void clear_midx_file(struct repository *r);
+
+void close_midx(struct multi_pack_index *m);
#endif