Re: [PATCH 3/3] multi-pack-index: use hash version byte
- From
brian m. carlson <sandals@crustytoothpaste.net>
- Date
- Aug 14, 2020, 20:14 UTC
- Message-ID
- <20200814201448.GL8085@camp.crustytoothpaste.net>
- In-Reply-To
- <b4645789adf26e46cea721896867135941fb7654.1597428440.git.gitgitgadget@gmail.com>
On 2020-08-14 at 18:07:20, Derrick Stolee via GitGitGadget wrote:
Show 24 quoted lines
> diff --git a/midx.c b/midx.c
> index a5fb797ede..0c165a40f5 100644
> --- a/midx.c
> +++ b/midx.c
> @@ -17,7 +17,6 @@
> #define MIDX_BYTE_HASH_VERSION 5
> #define MIDX_BYTE_NUM_CHUNKS 6
> #define MIDX_BYTE_NUM_PACKS 8
> -#define MIDX_HASH_VERSION 1
> #define MIDX_HEADER_SIZE 12
> #define MIDX_MIN_SIZE (MIDX_HEADER_SIZE + the_hash_algo->rawsz)
>
> @@ -36,6 +35,15 @@
>
> #define PACK_EXPIRED UINT_MAX
>
> +static uint8_t oid_version(void)
> +{
> + if (the_hash_algo->rawsz == GIT_SHA1_RAWSZ)
> + return 1;
> + if (the_hash_algo->rawsz == GIT_SHA256_RAWSZ)
> + return 2;
> + die(_("invalid hash version"));
> +}I think my same response to the last patch applies here.
Beyond the things I mentioned in the last patch and here, I think this series looks fine.
-- brian m. carlson: Houston, Texas, US