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;
return -1;
commit = commit->parents->item;
}
- hashcpy(result, get_object_hash(commit->object));
+ hashcpy(result, commit->object.oid.hash);
return 0;
}
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;
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;
if (!o)
return -1;
- hashcpy(sha1, get_object_hash(*o));
+ hashcpy(sha1, o->oid.hash);
if (sp[0] == '/') {
/* "$commit^{/foo}" */
char *prefix;
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");
unuse_commit_buffer(commit, buf);
if (matches) {
- hashcpy(sha1, get_object_hash(commit->object));
+ hashcpy(sha1, commit->object.oid.hash);
found = 1;
break;
}