Skip to content

Commit

Permalink
Merge branch 'mg/fix-log-mergetag-color' into maint
Browse files Browse the repository at this point in the history
* mg/fix-log-mergetag-color:
  log: correctly identify mergetag signature verification status
  • Loading branch information
Junio C Hamano committed Jul 22, 2014
2 parents 5796c5b + 42c55ce commit 514dd21
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions log-tree.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 514dd21

Please sign in to comment.