summaryrefslogtreecommitdiff
path: root/commit-graph.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2020-08-19 16:14:52 -0700
committerJunio C Hamano <gitster@pobox.com>2020-08-19 16:14:53 -0700
commit6f8a2138b96c8f33ebbe2055a9444ada40a8e1c8 (patch)
tree8ed6c5420da5f4be6a398ae8da7d30767c2258be /commit-graph.c
parent74a395c4844f846d933b873c5548e19d06e1e89e (diff)
parentd96075428a9a1de720f6019242dadb5dbaa0ac16 (diff)
Merge branch 'ds/sha256-leftover-bits'
midx and commit-graph files now use the byte defined in their file format specification for identifying the hash function used for object names. * ds/sha256-leftover-bits: multi-pack-index: use hash version byte commit-graph: use the "hash version" byte t/README: document GIT_TEST_DEFAULT_HASH
Diffstat (limited to 'commit-graph.c')
-rw-r--r--commit-graph.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/commit-graph.c b/commit-graph.c
index e51c91dd5b..0ed003e218 100644
--- a/commit-graph.c
+++ b/commit-graph.c
@@ -179,7 +179,14 @@ static char *get_chain_filename(struct object_directory *odb)
static uint8_t oid_version(void)
{
- return 1;
+ switch (hash_algo_by_ptr(the_hash_algo)) {
+ case GIT_HASH_SHA1:
+ return 1;
+ case GIT_HASH_SHA256:
+ return 2;
+ default:
+ die(_("invalid hash version"));
+ }
}
static struct commit_graph *alloc_commit_graph(void)