summaryrefslogtreecommitdiff
path: root/t/t7004-tag.sh
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2018-04-13 21:18:35 (GMT)
committerJunio C Hamano <gitster@pobox.com>2018-04-16 05:15:03 (GMT)
commit8b44b2be89bf59c0fada6095bdfea66ff53c6074 (patch)
tree18d3cd098a0cbc8b989f0fd7945927ec75c4f524 /t/t7004-tag.sh
parentf68f2dd57f55e0b1782b20b615dd7a96d7fb6a41 (diff)
downloadgit-8b44b2be89bf59c0fada6095bdfea66ff53c6074.zip
git-8b44b2be89bf59c0fada6095bdfea66ff53c6074.tar.gz
git-8b44b2be89bf59c0fada6095bdfea66ff53c6074.tar.bz2
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>
Diffstat (limited to 't/t7004-tag.sh')
-rwxr-xr-xt/t7004-tag.sh11
1 files changed, 11 insertions, 0 deletions
diff --git a/t/t7004-tag.sh b/t/t7004-tag.sh
index ee093b3..e3f1e01 100755
--- a/t/t7004-tag.sh
+++ b/t/t7004-tag.sh
@@ -1059,6 +1059,17 @@ test_expect_success GPG \
git tag -v blanknonlfile-signed-tag
'
+test_expect_success GPG 'signed tag with embedded PGP message' '
+ cat >msg <<-\EOF &&
+ -----BEGIN PGP MESSAGE-----
+
+ this is not a real PGP message
+ -----END PGP MESSAGE-----
+ EOF
+ git tag -s -F msg confusing-pgp-message &&
+ git tag -v confusing-pgp-message
+'
+
# messages with commented lines for signed tags:
cat >sigcommentsfile <<EOF