diff options
Diffstat (limited to 'plumbing/object')
-rw-r--r-- | plumbing/object/commit.go | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/plumbing/object/commit.go b/plumbing/object/commit.go index 6b50934..eb86a01 100644 --- a/plumbing/object/commit.go +++ b/plumbing/object/commit.go @@ -177,6 +177,7 @@ func (c *Commit) Decode(o plumbing.EncodedObject) (err error) { var message bool var pgpsig bool + var msgbuf bytes.Buffer for { line, err := r.ReadBytes('\n') if err != nil && err != io.EOF { @@ -221,13 +222,15 @@ func (c *Commit) Decode(o plumbing.EncodedObject) (err error) { pgpsig = true } } else { - c.Message += string(line) + msgbuf.Write(line) } if err == io.EOF { - return nil + break } } + c.Message = msgbuf.String() + return nil } // Encode transforms a Commit into a plumbing.EncodedObject. |