]> git.ipfire.org Git - thirdparty/git.git/blobdiff - log-tree.c
object-file API: have hash_object_file() take "enum object_type"
[thirdparty/git.git] / log-tree.c
index 644893fd8cfff6a9ee9cda0b512c2adb9c8a6953..27a5b0bd61a3aaf558da3aaf9412619d2e6f94fe 100644 (file)
@@ -513,8 +513,9 @@ static void show_signature(struct rev_info *opt, struct commit *commit)
        if (parse_signed_commit(commit, &payload, &signature, the_hash_algo) <= 0)
                goto out;
 
-       status = check_signature(payload.buf, payload.len, signature.buf,
-                                signature.len, &sigc);
+       sigc.payload_type = SIGNATURE_PAYLOAD_COMMIT;
+       sigc.payload = strbuf_detach(&payload, &sigc.payload_len);
+       status = check_signature(&sigc, signature.buf, signature.len);
        if (status && !sigc.output)
                show_sig_lines(opt, status, "No signature\n");
        else
@@ -560,7 +561,7 @@ static int show_one_mergetag(struct commit *commit,
        struct strbuf signature = STRBUF_INIT;
 
        hash_object_file(the_hash_algo, extra->value, extra->len,
-                        type_name(OBJ_TAG), &oid);
+                        OBJ_TAG, &oid);
        tag = lookup_tag(the_repository, &oid);
        if (!tag)
                return -1; /* error message already given */
@@ -583,8 +584,9 @@ static int show_one_mergetag(struct commit *commit,
        status = -1;
        if (parse_signature(extra->value, extra->len, &payload, &signature)) {
                /* could have a good signature */
-               status = check_signature(payload.buf, payload.len,
-                                        signature.buf, signature.len, &sigc);
+               sigc.payload_type = SIGNATURE_PAYLOAD_TAG;
+               sigc.payload = strbuf_detach(&payload, &sigc.payload_len);
+               status = check_signature(&sigc, signature.buf, signature.len);
                if (sigc.output)
                        strbuf_addstr(&verify_message, sigc.output);
                else