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
This commit is contained in:
Junio C Hamano
2021-05-10 16:59:46 +09:00
58 changed files with 305 additions and 198 deletions

6
dir.c
View File

@ -3344,7 +3344,7 @@ static void read_oid(size_t pos, void *cb)
rd->data = rd->end + 1;
return;
}
hashcpy(ud->exclude_oid.hash, rd->data);
oidread(&ud->exclude_oid, rd->data);
rd->data += the_hash_algo->rawsz;
}
@ -3352,7 +3352,7 @@ static void load_oid_stat(struct oid_stat *oid_stat, const unsigned char *data,
const unsigned char *sha1)
{
stat_data_from_disk(&oid_stat->stat, data);
hashcpy(oid_stat->oid.hash, sha1);
oidread(&oid_stat->oid, sha1);
oid_stat->valid = 1;
}
@ -3558,7 +3558,7 @@ static void connect_wt_gitdir_in_nested(const char *sub_worktree,
*/
i++;
sub = submodule_from_path(&subrepo, &null_oid, ce->name);
sub = submodule_from_path(&subrepo, null_oid(), ce->name);
if (!sub || !is_submodule_active(&subrepo, ce->name))
/* .gitmodules broken or inactive sub */
continue;