From 2e4f90007aace73cc0ba0d9c5c3744c99a20bb97 Mon Sep 17 00:00:00 2001 From: Spencer Judd Date: Wed, 3 Apr 2019 22:26:03 -0700 Subject: plumbing: object, Fix tag message decoding The Decode method was adding one too many newlines to the tag message, causing signature verification to fail. This is because in signed tags produced by `git`, there is a newline after the PGP signature block, resulting in `messageAndSig` having one extra (empty) `[]byte` element. This caused `t.Message` to receive one extra newline. Signed-off-by: Spencer Judd --- plumbing/object/tag.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'plumbing/object') diff --git a/plumbing/object/tag.go b/plumbing/object/tag.go index 03749f9..7f5e406 100644 --- a/plumbing/object/tag.go +++ b/plumbing/object/tag.go @@ -141,7 +141,7 @@ func (t *Tag) Decode(o plumbing.EncodedObject) (err error) { if pgpsig { if bytes.Contains(l, []byte(endpgp)) { t.PGPSignature += endpgp + "\n" - pgpsig = false + break } else { t.PGPSignature += string(l) + "\n" } -- cgit