aboutsummaryrefslogtreecommitdiffstats
path: root/commit_test.go
diff options
context:
space:
mode:
authorMáximo Cuadros <mcuadros@gmail.com>2016-08-23 00:37:36 +0200
committerMáximo Cuadros <mcuadros@gmail.com>2016-08-23 00:37:36 +0200
commit9ae3c5808fcfa468d1f9394c9b16bc02f573ba79 (patch)
tree917c5dc717c02654baeebd06bef89436ad4c65ec /commit_test.go
parent2ed3474ab8e52c98a87e390d5128d45d693a115d (diff)
downloadgo-git-9ae3c5808fcfa468d1f9394c9b16bc02f573ba79.tar.gz
WalkCommitHistory adn Commit.History
Diffstat (limited to 'commit_test.go')
-rw-r--r--commit_test.go8
1 files changed, 8 insertions, 0 deletions
diff --git a/commit_test.go b/commit_test.go
index 82133da..9a05cd8 100644
--- a/commit_test.go
+++ b/commit_test.go
@@ -72,6 +72,14 @@ func (s *SuiteCommit) TestNumParents(c *C) {
c.Assert(s.Commit.NumParents(), Equals, 2)
}
+func (s *SuiteCommit) TestHistory(c *C) {
+ commits, err := s.Commit.History()
+ c.Assert(err, IsNil)
+ c.Assert(commits, HasLen, 5)
+ c.Assert(commits[0].Hash.String(), Equals, s.Commit.Hash.String())
+ c.Assert(commits[len(commits)-1].Hash.String(), Equals, "b029517f6300c2da0f4b651b8642506cd6aaf45d")
+}
+
func (s *SuiteCommit) TestString(c *C) {
c.Assert(s.Commit.String(), Equals, ""+
"commit 1669dce138d9b841a518c64b10914d88f5e488ea\n"+