Merge branch 'mg/fix-log-mergetag-color'
authorJunio C Hamano <gitster@pobox.com>
Wed, 16 Jul 2014 18:32:36 +0000 (11:32 -0700)
committerJunio C Hamano <gitster@pobox.com>
Wed, 16 Jul 2014 18:32:36 +0000 (11:32 -0700)
* mg/fix-log-mergetag-color:
log: correctly identify mergetag signature verification status

log-tree.c
index 10e68442b35c9bd9ca1c00c52609a4827b8bace5..c13184aafb603c5462d4c1a8befffc1ef61f3deb 100644 (file)
@@ -446,16 +446,17 @@ static void show_one_mergetag(struct rev_info *opt,
 
        payload_size = parse_signature(extra->value, extra->len);
        status = -1;
-       if (extra->len > payload_size)
-               if (verify_signed_buffer(extra->value, payload_size,
-                                        extra->value + payload_size,
-                                        extra->len - payload_size,
-                                        &verify_message, NULL)) {
-                       if (verify_message.len <= gpg_message_offset)
-                               strbuf_addstr(&verify_message, "No signature\n");
-                       else
-                               status = 0;
-               }
+       if (extra->len > payload_size) {
+               /* could have a good signature */
+               if (!verify_signed_buffer(extra->value, payload_size,
+                                         extra->value + payload_size,
+                                         extra->len - payload_size,
+                                         &verify_message, NULL))
+                       status = 0; /* good */
+               else if (verify_message.len <= gpg_message_offset)
+                       strbuf_addstr(&verify_message, "No signature\n");
+               /* otherwise we couldn't verify, which is shown as bad */
+       }
 
        show_sig_lines(opt, status, verify_message.buf);
        strbuf_release(&verify_message);