(c *C)
| 2085 | } |
| 2086 | |
| 2087 | func (s *RepositorySuite) TestLogFileInitialCommit(c *C) { |
| 2088 | r, _ := Init(memory.NewStorage(), nil) |
| 2089 | err := r.clone(context.Background(), &CloneOptions{ |
| 2090 | URL: s.GetBasicLocalRepositoryURL(), |
| 2091 | }) |
| 2092 | c.Assert(err, IsNil) |
| 2093 | |
| 2094 | fileName := "LICENSE" |
| 2095 | cIter, err := r.Log(&LogOptions{ |
| 2096 | Order: LogOrderCommitterTime, |
| 2097 | FileName: &fileName, |
| 2098 | }) |
| 2099 | c.Assert(err, IsNil) |
| 2100 | defer cIter.Close() |
| 2101 | |
| 2102 | commitOrder := []plumbing.Hash{ |
| 2103 | plumbing.NewHash("b029517f6300c2da0f4b651b8642506cd6aaf45d"), |
| 2104 | } |
| 2105 | |
| 2106 | expectedIndex := 0 |
| 2107 | err = cIter.ForEach(func(commit *object.Commit) error { |
| 2108 | expectedCommitHash := commitOrder[expectedIndex] |
| 2109 | c.Assert(commit.Hash.String(), Equals, expectedCommitHash.String()) |
| 2110 | expectedIndex++ |
| 2111 | return nil |
| 2112 | }) |
| 2113 | c.Assert(err, IsNil) |
| 2114 | c.Assert(expectedIndex, Equals, 1) |
| 2115 | } |
| 2116 | |
| 2117 | func (s *RepositorySuite) TestLogFileWithOtherParamsFail(c *C) { |
| 2118 | r, _ := Init(memory.NewStorage(), nil) |
nothing calls this directly
no test coverage detected