From be8d19438ada078a8598e366ab74aa09e4c521cd Mon Sep 17 00:00:00 2001 From: Antonio Jesus Navarro Perez Date: Mon, 10 Apr 2017 16:48:40 +0200 Subject: Add Repository.Log() method (fix #298) - CommitIter is now an interface - The old CommitIter implementation is now called StorerCommitIter - CommitWalker and CommitWalkerPost are now iterators (CommitPreIterator and CommitPostIterator). - Remove Commit.History() method. There are so many ways to iterate a commit history, depending of the use case. Now, instead of use the History() method, you must use CommitPreIterator or CommitPostIterator. - Move commitSorterer to references.go because is the only place that it is used, and it must not be used into another place. - Make References method private, it must only be used into blame logic. - Added a TODO into references method, where the sortCommits is used to remove it in a near future. --- plumbing/object/commit_test.go | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'plumbing/object/commit_test.go') diff --git a/plumbing/object/commit_test.go b/plumbing/object/commit_test.go index 8b4ee2a..c1f49db 100644 --- a/plumbing/object/commit_test.go +++ b/plumbing/object/commit_test.go @@ -62,6 +62,8 @@ func (s *SuiteCommit) TestParents(c *C) { c.Assert(err, IsNil) c.Assert(output, DeepEquals, expected) + + i.Close() } func (s *SuiteCommit) TestCommitEncodeDecodeIdempotent(c *C) { @@ -110,14 +112,6 @@ 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"+ -- cgit