diff options
-rw-r--r-- | plumbing/object/tag.go | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/plumbing/object/tag.go b/plumbing/object/tag.go index 6354973..03749f9 100644 --- a/plumbing/object/tag.go +++ b/plumbing/object/tag.go @@ -195,8 +195,13 @@ func (t *Tag) encode(o plumbing.EncodedObject, includeSig bool) (err error) { return err } + // Note that this is highly sensitive to what it sent along in the message. + // Message *always* needs to end with a newline, or else the message and the + // signature will be concatenated into a corrupt object. Since this is a + // lower-level method, we assume you know what you are doing and have already + // done the needful on the message in the caller. if includeSig { - if _, err = fmt.Fprint(w, "\n"+t.PGPSignature); err != nil { + if _, err = fmt.Fprint(w, t.PGPSignature); err != nil { return err } } |