Re: [PATCH v3 23/25] midx: respect 'GIT_TEST_MULTI_PACK_INDEX_WRITE_BITMAP'
- From
Jeff King <peff@peff.net>
- Date
- Aug 12, 2021, 21:09 UTC
- Message-ID
- <YRWOI8nmhPuCp2TU@coredump.intra.peff.net>
- In-Reply-To
- <50865e52a37590d0bef541fd96c95a0416d7d585.1627420428.git.me@ttaylorr.com>
On Tue, Jul 27, 2021 at 05:20:23PM -0400, Taylor Blau wrote:
Show 13 quoted lines
> diff --git a/builtin/repack.c b/builtin/repack.c
> index 5f9bc74adc..82ab668272 100644
> --- a/builtin/repack.c
> +++ b/builtin/repack.c
> @@ -515,6 +515,10 @@ int cmd_repack(int argc, const char **argv, const char *prefix)
> if (!(pack_everything & ALL_INTO_ONE) ||
> !is_bare_repository())
> write_bitmaps = 0;
> + } else if (write_bitmaps &&
> + git_env_bool(GIT_TEST_MULTI_PACK_INDEX, 0) &&
> + git_env_bool(GIT_TEST_MULTI_PACK_INDEX_WRITE_BITMAP, 0)) {
> + write_bitmaps = 0;
> }This hunk confused me for a minute, since we are turning write_bitmaps _off_ if we see a positive "write midx bitmap". But I guess the point is to turn off the pack bitmap, and then in the later hunk:
Show 12 quoted lines
> @@ -725,8 +729,12 @@ int cmd_repack(int argc, const char **argv, const char *prefix)
> update_server_info(0);
> remove_temporary_files();
>
> - if (git_env_bool(GIT_TEST_MULTI_PACK_INDEX, 0))
> - write_midx_file(get_object_directory(), NULL, 0);
> + if (git_env_bool(GIT_TEST_MULTI_PACK_INDEX, 0)) {
> + unsigned flags = 0;
> + if (git_env_bool(GIT_TEST_MULTI_PACK_INDEX_WRITE_BITMAP, 0))
> + flags |= MIDX_WRITE_BITMAP | MIDX_WRITE_REV_INDEX;
> + write_midx_file(get_object_directory(), NULL, flags);
> + }...we'd turn on the midx one. Makes sense.
-Peff