refs: convert read_raw_ref backends to struct object_id

Convert the unsigned char * parameter to struct object_id * for
files_read_raw_ref and packed_read_raw_ref.  Update the documentation.
Switch from using get_sha1_hex and a hard-coded 40 to using
parse_oid_hex.

Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
brian m. carlson
2017-10-15 22:07:11 +00:00
committed by Junio C Hamano
parent ac2ed0d7d5
commit 99afe91a6c
4 changed files with 18 additions and 17 deletions

View File

@ -716,7 +716,7 @@ static struct snapshot *get_snapshot(struct packed_ref_store *refs)
}
static int packed_read_raw_ref(struct ref_store *ref_store,
const char *refname, unsigned char *sha1,
const char *refname, struct object_id *oid,
struct strbuf *referent, unsigned int *type)
{
struct packed_ref_store *refs =
@ -734,7 +734,7 @@ static int packed_read_raw_ref(struct ref_store *ref_store,
return -1;
}
if (get_sha1_hex(rec, sha1))
if (get_oid_hex(rec, oid))
die_invalid_line(refs->path, rec, snapshot->eof - rec);
*type = REF_ISPACKED;