diff options
author | Chris Marchesi <chrism@vancluevertech.com> | 2018-08-21 17:38:09 -0700 |
---|---|---|
committer | Chris Marchesi <chrism@vancluevertech.com> | 2018-08-21 17:43:55 -0700 |
commit | 9b73a3ead6559576cb017b09c41c23c251b5af1c (patch) | |
tree | 64e7a99439c394209b548de6feecb1ebade9f739 /plumbing/object | |
parent | b9f5efe3dbee0cd15a553bcc03f7a37f3dcaa676 (diff) | |
download | go-git-9b73a3ead6559576cb017b09c41c23c251b5af1c.tar.gz |
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>
Diffstat (limited to 'plumbing/object')
-rw-r--r-- | plumbing/object/tag.go | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/plumbing/object/tag.go b/plumbing/object/tag.go index 905206b..6354973 100644 --- a/plumbing/object/tag.go +++ b/plumbing/object/tag.go @@ -195,13 +195,9 @@ func (t *Tag) encode(o plumbing.EncodedObject, includeSig bool) (err error) { return err } - if t.PGPSignature != "" && includeSig { - // Split all the signature lines and write with a newline at the end. - lines := strings.Split(t.PGPSignature, "\n") - for _, line := range lines { - if _, err = fmt.Fprintf(w, "%s\n", line); err != nil { - return err - } + if includeSig { + if _, err = fmt.Fprint(w, "\n"+t.PGPSignature); err != nil { + return err } } |