From ed1c9977cb1b63e4270ad8bdf967a2d02580aa08 Mon Sep 17 00:00:00 2001 From: "brian m. carlson" Date: Tue, 10 Nov 2015 02:22:29 +0000 Subject: Remove get_object_hash. Convert all instances of get_object_hash to use an appropriate reference to the hash member of the oid member of struct object. This provides no functional change, as it is essentially a macro substitution. Signed-off-by: brian m. carlson Signed-off-by: Jeff King --- sha1_name.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'sha1_name.c') diff --git a/sha1_name.c b/sha1_name.c index 37ba126d9b..892db21813 100644 --- a/sha1_name.c +++ b/sha1_name.c @@ -616,13 +616,13 @@ static int get_parent(const char *name, int len, if (parse_commit(commit)) return -1; if (!idx) { - hashcpy(result, get_object_hash(commit->object)); + hashcpy(result, commit->object.oid.hash); return 0; } p = commit->parents; while (p) { if (!--idx) { - hashcpy(result, get_object_hash(p->item->object)); + hashcpy(result, p->item->object.oid.hash); return 0; } p = p->next; @@ -649,7 +649,7 @@ static int get_nth_ancestor(const char *name, int len, return -1; commit = commit->parents->item; } - hashcpy(result, get_object_hash(commit->object)); + hashcpy(result, commit->object.oid.hash); return 0; } @@ -659,7 +659,7 @@ struct object *peel_to_type(const char *name, int namelen, if (name && !namelen) namelen = strlen(name); while (1) { - if (!o || (!o->parsed && !parse_object(get_object_hash(*o)))) + if (!o || (!o->parsed && !parse_object(o->oid.hash))) return NULL; if (expected_type == OBJ_ANY || o->type == expected_type) return o; @@ -736,7 +736,7 @@ static int peel_onion(const char *name, int len, unsigned char *sha1) return -1; if (!expected_type) { o = deref_tag(o, name, sp - name - 2); - if (!o || (!o->parsed && !parse_object(get_object_hash(*o)))) + if (!o || (!o->parsed && !parse_object(o->oid.hash))) return -1; hashcpy(sha1, o->oid.hash); return 0; @@ -751,7 +751,7 @@ static int peel_onion(const char *name, int len, unsigned char *sha1) if (!o) return -1; - hashcpy(sha1, get_object_hash(*o)); + hashcpy(sha1, o->oid.hash); if (sp[0] == '/') { /* "$commit^{/foo}" */ char *prefix; @@ -899,7 +899,7 @@ static int get_sha1_oneline(const char *prefix, unsigned char *sha1, int matches; commit = pop_most_recent_commit(&list, ONELINE_SEEN); - if (!parse_object(get_object_hash(commit->object))) + if (!parse_object(commit->object.oid.hash)) continue; buf = get_commit_buffer(commit, NULL); p = strstr(buf, "\n\n"); @@ -907,7 +907,7 @@ static int get_sha1_oneline(const char *prefix, unsigned char *sha1, unuse_commit_buffer(commit, buf); if (matches) { - hashcpy(sha1, get_object_hash(commit->object)); + hashcpy(sha1, commit->object.oid.hash); found = 1; break; } -- cgit v1.2.3