gpg-interface: find the last gpg signature line
commit8b44b2be89bf59c0fada6095bdfea66ff53c6074
authorJeff King <peff@peff.net>
Fri, 13 Apr 2018 21:18:35 +0000 (13 15:18 -0600)
committerJunio C Hamano <gitster@pobox.com>
Mon, 16 Apr 2018 05:15:03 +0000 (16 14:15 +0900)
tree18d3cd098a0cbc8b989f0fd7945927ec75c4f524
parentf68f2dd57f55e0b1782b20b615dd7a96d7fb6a41
gpg-interface: find the last gpg signature line

A signed tag has a detached signature like this:

  object ...
  [...more header...]

  This is the tag body.

  -----BEGIN PGP SIGNATURE-----
  [opaque gpg data]
  -----END PGP SIGNATURE-----

Our parser finds the _first_ line that appears to start a
PGP signature block, meaning we may be confused by a
signature (or a signature-like line) in the actual body.
Let's keep parsing and always find the final block, which
should be the detached signature over all of the preceding
content.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Ben Toews <mastahyeti@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
gpg-interface.c
t/t7004-tag.sh