Skip to content
This repository was archived by the owner on Sep 11, 2020. It is now read-only.

Commit 2e4f900

Browse files
scjuddfilipnavara
authored andcommitted
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>
1 parent aa6f288 commit 2e4f900

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

plumbing/object/tag.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ func (t *Tag) Decode(o plumbing.EncodedObject) (err error) {
141141
if pgpsig {
142142
if bytes.Contains(l, []byte(endpgp)) {
143143
t.PGPSignature += endpgp + "\n"
144-
pgpsig = false
144+
break
145145
} else {
146146
t.PGPSignature += string(l) + "\n"
147147
}

0 commit comments

Comments
 (0)