Re: [PATCH 2/3] midx: close multi-pack-index on repack
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Oct 9, 2018, 09:10 UTC
- Message-ID
- <xmqq4ldvqyci.fsf@gitster-ct.c.googlers.com>
- In-Reply-To
- <725ebadc92a91469eed089eb501b705c2dd2c627.1539011820.git.gitgitgadget@gmail.com>
"Derrick Stolee via GitGitGadget" <gitgitgadget@gmail.com> writes:
Show 14 quoted lines
> diff --git a/builtin/repack.c b/builtin/repack.c
> index c6a7943d5c..7925bb976e 100644
> --- a/builtin/repack.c
> +++ b/builtin/repack.c
> @@ -432,6 +432,10 @@ int cmd_repack(int argc, const char **argv, const char *prefix)
>
> if (!midx_cleared) {
> /* if we move a packfile, it will invalidated the midx */
> + if (the_repository->objects) {
> + close_midx(the_repository->objects->multi_pack_index);
> + the_repository->objects->multi_pack_index = NULL;
> + }
> clear_midx_file(get_object_directory());
> midx_cleared = 1;It somehow looks like a bit of layering violation, doesn't it? When we are clearing a midx file, don't we always want to do this as well?