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

Commit 9b73a3e

Browse files
committed
plumbing: object, correct tag PGP encoding
As with the update in ec3d2a8, tag encoding needed to be corrected to ensure extra newlines were not being added in during tag object encoding, so that it did not corrupt the object for verification. Signed-off-by: Chris Marchesi <chrism@vancluevertech.com>
1 parent b9f5efe commit 9b73a3e

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

plumbing/object/tag.go

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -195,13 +195,9 @@ func (t *Tag) encode(o plumbing.EncodedObject, includeSig bool) (err error) {
195195
return err
196196
}
197197

198-
if t.PGPSignature != "" && includeSig {
199-
// Split all the signature lines and write with a newline at the end.
200-
lines := strings.Split(t.PGPSignature, "\n")
201-
for _, line := range lines {
202-
if _, err = fmt.Fprintf(w, "%s\n", line); err != nil {
203-
return err
204-
}
198+
if includeSig {
199+
if _, err = fmt.Fprint(w, "\n"+t.PGPSignature); err != nil {
200+
return err
205201
}
206202
}
207203

0 commit comments

Comments
 (0)