| 733 | } |
| 734 | |
| 735 | func (s *SuiteCommit) TestMalformedHeader(c *C) { |
| 736 | encoded := &plumbing.MemoryObject{} |
| 737 | decoded := &Commit{} |
| 738 | commit := *s.Commit |
| 739 | |
| 740 | commit.PGPSignature = "\n" |
| 741 | commit.Author.Name = "\n" |
| 742 | commit.Author.Email = "\n" |
| 743 | commit.Committer.Name = "\n" |
| 744 | commit.Committer.Email = "\n" |
| 745 | |
| 746 | err := commit.Encode(encoded) |
| 747 | c.Assert(err, IsNil) |
| 748 | |
| 749 | err = decoded.Decode(encoded) |
| 750 | c.Assert(err, IsNil) |
| 751 | } |
| 752 | |
| 753 | func (s *SuiteCommit) TestEncodeWithoutSignature(c *C) { |
| 754 | tests := []struct { |