return ret;
}
-int gpg_verify_tag(const unsigned char *sha1, const char *name_to_report,
+int gpg_verify_tag(const struct object_id *oid, const char *name_to_report,
unsigned flags)
{
enum object_type type;
unsigned long size;
int ret;
- type = sha1_object_info(sha1, NULL);
+ type = sha1_object_info(oid->hash, NULL);
if (type != OBJ_TAG)
return error("%s: cannot verify a non-tag object of type %s.",
name_to_report ?
name_to_report :
- find_unique_abbrev(sha1, DEFAULT_ABBREV),
- typename(type));
+ find_unique_abbrev(oid->hash, DEFAULT_ABBREV),
+ type_name(type));
- buf = read_sha1_file(sha1, &type, &size);
+ buf = read_sha1_file(oid->hash, &type, &size);
if (!buf)
return error("%s: unable to read file.",
name_to_report ?
name_to_report :
- find_unique_abbrev(sha1, DEFAULT_ABBREV));
+ find_unique_abbrev(oid->hash, DEFAULT_ABBREV));
ret = run_gpg_verify(buf, size, flags);
bufptr = nl + 1;
if (!strcmp(type, blob_type)) {
- item->tagged = &lookup_blob(&oid)->object;
+ item->tagged = (struct object *)lookup_blob(&oid);
} else if (!strcmp(type, tree_type)) {
- item->tagged = &lookup_tree(&oid)->object;
+ item->tagged = (struct object *)lookup_tree(&oid);
} else if (!strcmp(type, commit_type)) {
- item->tagged = &lookup_commit(&oid)->object;
+ item->tagged = (struct object *)lookup_commit(&oid);
} else if (!strcmp(type, tag_type)) {
- item->tagged = &lookup_tag(&oid)->object;
+ item->tagged = (struct object *)lookup_tag(&oid);
} else {
error("Unknown type %s", type);
item->tagged = NULL;