diff options
author | Máximo Cuadros <mcuadros@gmail.com> | 2016-08-23 00:37:36 +0200 |
---|---|---|
committer | Máximo Cuadros <mcuadros@gmail.com> | 2016-08-23 00:37:36 +0200 |
commit | 9ae3c5808fcfa468d1f9394c9b16bc02f573ba79 (patch) | |
tree | 917c5dc717c02654baeebd06bef89436ad4c65ec /commit_test.go | |
parent | 2ed3474ab8e52c98a87e390d5128d45d693a115d (diff) | |
download | go-git-9ae3c5808fcfa468d1f9394c9b16bc02f573ba79.tar.gz |
WalkCommitHistory adn Commit.History
Diffstat (limited to 'commit_test.go')
-rw-r--r-- | commit_test.go | 8 |
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"+ |