diff options
author | brian m. carlson <sandals@crustytoothpaste.net> | 2017-10-16 01:07:10 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2017-10-16 05:05:52 +0300 |
commit | ac2ed0d7d51e5c0b402797ecf01f38e9bfc82e0e (patch) | |
tree | 7fcbdf85704b9d0d14fa41eae0154377282f8e5d /refs.c | |
parent | 49e61479be913f67e66bb3fdf8de9475c41b58bd (diff) |
refs: convert peel_object to struct object_id
Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'refs.c')
-rw-r--r-- | refs.c | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -252,12 +252,12 @@ static int filter_refs(const char *refname, const struct object_id *oid, return filter->fn(refname, oid, flags, filter->cb_data); } -enum peel_status peel_object(const unsigned char *name, unsigned char *sha1) +enum peel_status peel_object(const struct object_id *name, struct object_id *oid) { - struct object *o = lookup_unknown_object(name); + struct object *o = lookup_unknown_object(name->hash); if (o->type == OBJ_NONE) { - int type = sha1_object_info(name, NULL); + int type = sha1_object_info(name->hash, NULL); if (type < 0 || !object_as_type(o, type, 0)) return PEEL_INVALID; } @@ -269,7 +269,7 @@ enum peel_status peel_object(const unsigned char *name, unsigned char *sha1) if (!o) return PEEL_INVALID; - hashcpy(sha1, o->oid.hash); + oidcpy(oid, &o->oid); return PEEL_PEELED; } @@ -1714,7 +1714,7 @@ int refs_peel_ref(struct ref_store *refs, const char *refname, RESOLVE_REF_READING, &base, &flag)) return -1; - return peel_object(base.hash, oid->hash); + return peel_object(&base, oid); } int peel_ref(const char *refname, struct object_id *oid) |