From 6f3d57b6e43d6c6f13c94371f16b79fcdece25bc Mon Sep 17 00:00:00 2001 From: "brian m. carlson" Date: Tue, 10 Nov 2015 02:22:25 +0000 Subject: ref_newer: convert to use struct object_id Convert ref_newer and its caller to use struct object_id instead of unsigned char *. Signed-off-by: brian m. carlson Signed-off-by: Jeff King --- remote.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'remote.c') diff --git a/remote.c b/remote.c index 4beebadcc3..bdae86c618 100644 --- a/remote.c +++ b/remote.c @@ -1590,7 +1590,7 @@ void set_ref_status_for_push(struct ref *remote_refs, int send_mirror, else if (!lookup_commit_reference_gently(ref->old_oid.hash, 1) || !lookup_commit_reference_gently(ref->new_oid.hash, 1)) reject_reason = REF_STATUS_REJECT_NEEDS_FORCE; - else if (!ref_newer(ref->new_oid.hash, ref->old_oid.hash)) + else if (!ref_newer(&ref->new_oid, &ref->old_oid)) reject_reason = REF_STATUS_REJECT_NONFASTFORWARD; } @@ -1944,7 +1944,7 @@ static void unmark_and_free(struct commit_list *list, unsigned int mark) } } -int ref_newer(const unsigned char *new_sha1, const unsigned char *old_sha1) +int ref_newer(const struct object_id *new_oid, const struct object_id *old_oid) { struct object *o; struct commit *old, *new; @@ -1955,12 +1955,12 @@ int ref_newer(const unsigned char *new_sha1, const unsigned char *old_sha1) * Both new and old must be commit-ish and new is descendant of * old. Otherwise we require --force. */ - o = deref_tag(parse_object(old_sha1), NULL, 0); + o = deref_tag(parse_object(old_oid->hash), NULL, 0); if (!o || o->type != OBJ_COMMIT) return 0; old = (struct commit *) o; - o = deref_tag(parse_object(new_sha1), NULL, 0); + o = deref_tag(parse_object(new_oid->hash), NULL, 0); if (!o || o->type != OBJ_COMMIT) return 0; new = (struct commit *) o; -- cgit v1.2.1