aboutsummaryrefslogtreecommitdiffstats
path: root/plumbing/object
diff options
context:
space:
mode:
authorChris Marchesi <chrism@vancluevertech.com>2018-08-21 17:38:09 -0700
committerChris Marchesi <chrism@vancluevertech.com>2018-08-21 17:43:55 -0700
commit9b73a3ead6559576cb017b09c41c23c251b5af1c (patch)
tree64e7a99439c394209b548de6feecb1ebade9f739 /plumbing/object
parentb9f5efe3dbee0cd15a553bcc03f7a37f3dcaa676 (diff)
downloadgo-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.go10
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
}
}