diff options
| author | Junio C Hamano <gitster@pobox.com> | 2021-05-10 16:59:46 +0900 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2021-05-10 16:59:46 +0900 |
| commit | aaa3c8065d86e8f25850eb79e90da68d6adcf03f (patch) | |
| tree | ac8883284fe2e056252c14f6916e5ee9312eff1a /builtin/unpack-objects.c | |
| parent | The fourteenth batch (diff) | |
| parent | hex: print objects using the hash algorithm member (diff) | |
| download | git-aaa3c8065d86e8f25850eb79e90da68d6adcf03f.tar.gz git-aaa3c8065d86e8f25850eb79e90da68d6adcf03f.zip | |
Merge branch 'bc/hash-transition-interop-part-1'
SHA-256 transition.
* bc/hash-transition-interop-part-1:
hex: print objects using the hash algorithm member
hex: default to the_hash_algo on zero algorithm value
builtin/pack-objects: avoid using struct object_id for pack hash
commit-graph: don't store file hashes as struct object_id
builtin/show-index: set the algorithm for object IDs
hash: provide per-algorithm null OIDs
hash: set, copy, and use algo field in struct object_id
builtin/pack-redundant: avoid casting buffers to struct object_id
Use the final_oid_fn to finalize hashing of object IDs
hash: add a function to finalize object IDs
http-push: set algorithm when reading object ID
Always use oidread to read into struct object_id
hash: add an algo member to struct object_id
Diffstat (limited to 'builtin/unpack-objects.c')
| -rw-r--r-- | builtin/unpack-objects.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/builtin/unpack-objects.c b/builtin/unpack-objects.c index 4a70b17f8f..4a9466295b 100644 --- a/builtin/unpack-objects.c +++ b/builtin/unpack-objects.c @@ -355,7 +355,7 @@ static void unpack_delta_entry(enum object_type type, unsigned long delta_size, struct object_id base_oid; if (type == OBJ_REF_DELTA) { - hashcpy(base_oid.hash, fill(the_hash_algo->rawsz)); + oidread(&base_oid, fill(the_hash_algo->rawsz)); use(the_hash_algo->rawsz); delta_data = get_data(delta_size); if (dry_run || !delta_data) { @@ -421,7 +421,8 @@ static void unpack_delta_entry(enum object_type type, unsigned long delta_size, * has not been resolved yet. */ oidclr(&obj_list[nr].oid); - add_delta_to_list(nr, &null_oid, base_offset, delta_data, delta_size); + add_delta_to_list(nr, null_oid(), base_offset, + delta_data, delta_size); return; } } @@ -576,7 +577,7 @@ int cmd_unpack_objects(int argc, const char **argv, const char *prefix) the_hash_algo->init_fn(&ctx); unpack_all(); the_hash_algo->update_fn(&ctx, buffer, offset); - the_hash_algo->final_fn(oid.hash, &ctx); + the_hash_algo->final_oid_fn(&oid, &ctx); if (strict) { write_rest(); if (fsck_finish(&fsck_options)) |
