Re: [PATCH v3 23/25] midx: respect 'GIT_TEST_MULTI_PACK_INDEX_WRITE_BITMAP'

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Jul 27, 2021 at 05:20:23PM -0400, Taylor Blau wrote:

> 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:

> @@ -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



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux