summaryrefslogtreecommitdiff
path: root/sha1_name.c
diff options
context:
space:
mode:
authorbrian m. carlson <sandals@crustytoothpaste.net>2015-11-10 02:22:29 +0000
committerJeff King <peff@peff.net>2015-11-20 08:02:05 -0500
commited1c9977cb1b63e4270ad8bdf967a2d02580aa08 (patch)
treef5b52ccae09103672c62c1c11ff0bddc78199829 /sha1_name.c
parentf2fd0760f62e79609fef7bfd7ecebb002e8e4ced (diff)
downloadgit-ed1c9977cb1b63e4270ad8bdf967a2d02580aa08.tar.gz
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 <sandals@crustytoothpaste.net> Signed-off-by: Jeff King <peff@peff.net>
Diffstat (limited to 'sha1_name.c')
-rw-r--r--sha1_name.c16
1 files changed, 8 insertions, 8 deletions
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;
}