diff options
author | Spencer Judd <spencercjudd@gmail.com> | 2019-04-03 22:26:03 -0700 |
---|---|---|
committer | Filip Navara <navara@emclient.com> | 2019-04-20 20:45:40 +0200 |
commit | 2e4f90007aace73cc0ba0d9c5c3744c99a20bb97 (patch) | |
tree | 1ebfebe667cd26ddd7dee3baf3fa29299766cb40 /plumbing | |
parent | aa6f288c256ff8baf8a7745546a9752323dc0d89 (diff) | |
download | go-git-2e4f90007aace73cc0ba0d9c5c3744c99a20bb97.tar.gz |
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 <spencercjudd@gmail.com>
Diffstat (limited to 'plumbing')
-rw-r--r-- | plumbing/object/tag.go | 2 |
1 files changed, 1 insertions, 1 deletions
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" } |