Re: [PATCH v2 13/13] commit-graph: specify OID version for SHA-256
- From
Derrick Stolee <stolee@gmail.com>
- Date
- Oct 17, 2018, 12:21 UTC
- Message-ID
- <d7412414-61a0-2da5-257f-f3d9764e15dd@gmail.com>
- In-Reply-To
- <20181015021900.1030041-14-sandals@crustytoothpaste.net>
On 10/14/2018 10:19 PM, brian m. carlson wrote:
Show 20 quoted lines
> Since the commit-graph code wants to serialize the hash algorithm into
> the data store, specify a version number for each supported algorithm.
> Note that we don't use the values of the constants themselves, as they
> are internal and could change in the future.
>
> Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
> ---
> commit-graph.c | 9 ++++++++-
> 1 file changed, 8 insertions(+), 1 deletion(-)
>
> diff --git a/commit-graph.c b/commit-graph.c
> index 7a28fbb03f..e587c21bb6 100644
> --- a/commit-graph.c
> +++ b/commit-graph.c
> @@ -45,7 +45,14 @@ char *get_commit_graph_filename(const char *obj_dir)
>
> static uint8_t oid_version(void)
> {
> - return 1;
> + switch (hash_algo_by_ptr(the_hash_algo)) {hash_algo_by_ptr is specified as an inline function in hash.h, so this leads to a linking error in jch and pu right now.
I think the fix is simply to add '#include "hash.h"' to the list of includes.
Thanks, -Stolee