diff options
author | brian m. carlson <sandals@crustytoothpaste.net> | 2021-04-26 01:02:50 +0000 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2021-04-27 16:31:38 +0900 |
commit | 92e2cab96b8b8ea9a076dc279864226b3d0863e9 (patch) | |
tree | e0bf6b151c7624d1a751eedcf0247a47c3284709 /builtin/index-pack.c | |
parent | hash: add an algo member to struct object_id (diff) | |
download | tgif-92e2cab96b8b8ea9a076dc279864226b3d0863e9.tar.xz |
Always use oidread to read into struct object_id
In the future, we'll want oidread to automatically set the hash
algorithm member for an object ID we read into it, so ensure we use
oidread instead of hashcpy everywhere we're copying a hash value into a
struct object_id.
Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/index-pack.c')
-rw-r--r-- | builtin/index-pack.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/builtin/index-pack.c b/builtin/index-pack.c index 15507b5cff..41e2c240b8 100644 --- a/builtin/index-pack.c +++ b/builtin/index-pack.c @@ -524,7 +524,7 @@ static void *unpack_raw_entry(struct object_entry *obj, switch (obj->type) { case OBJ_REF_DELTA: - hashcpy(ref_oid->hash, fill(the_hash_algo->rawsz)); + oidread(ref_oid, fill(the_hash_algo->rawsz)); use(the_hash_algo->rawsz); break; case OBJ_OFS_DELTA: @@ -1358,7 +1358,7 @@ static struct object_entry *append_obj_to_pack(struct hashfile *f, obj[1].idx.offset += write_compressed(f, buf, size); obj[0].idx.crc32 = crc32_end(f); hashflush(f); - hashcpy(obj->idx.oid.hash, sha1); + oidread(&obj->idx.oid, sha1); return obj; } |