aboutsummaryrefslogtreecommitdiffstats
path: root/commit_test.go
diff options
context:
space:
mode:
authorMáximo Cuadros <mcuadros@gmail.com>2016-09-21 22:53:25 +0200
committerMáximo Cuadros <mcuadros@gmail.com>2016-09-21 22:53:25 +0200
commit4912552b913f1f575f9cc358b46bcdbe884e7279 (patch)
treebb9af82a517d32c2d7ce66240989f3c65b2f44b6 /commit_test.go
parent18d7e8eb4610a224c28ec848692d199669be3e8e (diff)
downloadgo-git-4912552b913f1f575f9cc358b46bcdbe884e7279.tar.gz
tags tests, Tag.String and Commit.String
Diffstat (limited to 'commit_test.go')
-rw-r--r--commit_test.go25
1 files changed, 24 insertions, 1 deletions
diff --git a/commit_test.go b/commit_test.go
index 744d6f3..b80d2c6 100644
--- a/commit_test.go
+++ b/commit_test.go
@@ -121,10 +121,33 @@ func (s *SuiteCommit) TestString(c *C) {
c.Assert(s.Commit.String(), Equals, ""+
"commit 1669dce138d9b841a518c64b10914d88f5e488ea\n"+
"Author: Máximo Cuadros Ortiz <mcuadros@gmail.com>\n"+
- "Date: 2015-03-31 13:48:14 +0200 +0200\n",
+ "Date: Tue Mar 31 13:48:14 2015 +0200\n"+
+ "\n"+
+ " Merge branch 'master' of github.com:tyba/git-fixture\n"+
+ "\n",
)
}
+func (s *SuiteCommit) TestStringMultiLine(c *C) {
+ hash := core.NewHash("e7d896db87294e33ca3202e536d4d9bb16023db3")
+
+ commit, err := s.Repositories["https://github.com/src-d/go-git.git"].Commit(hash)
+ c.Assert(err, IsNil)
+
+ c.Assert(commit.String(), Equals, ""+
+ "commit e7d896db87294e33ca3202e536d4d9bb16023db3\n"+
+ "Author: Alberto Cortés <alberto@sourced.tech>\n"+
+ "Date: Wed Jan 27 11:13:49 2016 +0100\n"+
+ "\n"+
+ " fix zlib invalid header error\n"+
+ "\n"+
+ " The return value of reads to the packfile were being ignored, so zlib\n"+
+ " was getting invalid data on it read buffers.\n"+
+ "\n",
+ )
+
+}
+
func (s *SuiteCommit) TestCommitIterNext(c *C) {
i := s.Commit.Parents()