Re: [PATCH v2 3/4] Integrate hash algorithm support with repo setup
- From
Stefan Beller <sbeller@google.com>
- Date
- Oct 30, 2017, 16:27 UTC
- Message-ID
- <CAGZ79kZZpO6SzGrN=2WKbKijwVCv4Kpj=yHBKN0vkP1UibhE9Q@mail.gmail.com>
- In-Reply-To
- <20171028181239.59458-4-sandals@crustytoothpaste.net>
On Sat, Oct 28, 2017 at 11:12 AM, brian m. carlson <sandals@crustytoothpaste.net> wrote:
> > Include repository.h in cache.h since we now need to have access to > these struct and variable definitions.
Let's see how that works out. I remember having include issues in the repository struct series.
Show 13 quoted lines
> };
> extern const struct git_hash_algo hash_algos[GIT_HASH_NALGOS];
>
> +#define current_hash the_repository->hash_algo
> +
> #if defined(DT_UNKNOWN) && !defined(NO_D_TYPE_IN_DIRENT)
> #define DTYPE(de) ((de)->d_type)
> #else
> @@ -920,6 +923,7 @@ struct repository_format {
> int version;
> int precious_objects;
> int is_bare;
> + int hash_algo;I wonder if this (as well as the #defines in patch 2), ought to be an enum { unknown-hash=0, sha1=1}.