summaryrefslogtreecommitdiff
path: root/refs.c
diff options
context:
space:
mode:
authorbrian m. carlson <sandals@crustytoothpaste.net>2017-10-15 22:07:10 +0000
committerJunio C Hamano <gitster@pobox.com>2017-10-16 11:05:52 +0900
commitac2ed0d7d51e5c0b402797ecf01f38e9bfc82e0e (patch)
tree7fcbdf85704b9d0d14fa41eae0154377282f8e5d /refs.c
parent49e61479be913f67e66bb3fdf8de9475c41b58bd (diff)
downloadgit-ac2ed0d7d51e5c0b402797ecf01f38e9bfc82e0e.tar.gz
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.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/refs.c b/refs.c
index 72c45a513b..6546346b6a 100644
--- a/refs.c
+++ b/refs.c
@@ -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)