MCPcopy Create free account
hub / github.com/go-git/go-git / TestLogFileWithOtherParamsPass

Method TestLogFileWithOtherParamsPass

repository_test.go:2169–2189  ·  view source on GitHub ↗
(c *C)

Source from the content-addressed store, hash-verified

2167}
2168
2169func (s *RepositorySuite) TestLogFileWithOtherParamsPass(c *C) {
2170 r, _ := Init(memory.NewStorage(), nil)
2171 err := r.clone(context.Background(), &CloneOptions{
2172 URL: s.GetBasicLocalRepositoryURL(),
2173 })
2174 c.Assert(err, IsNil)
2175
2176 fileName := "LICENSE"
2177 cIter, err := r.Log(&LogOptions{
2178 Order: LogOrderCommitterTime,
2179 FileName: &fileName,
2180 From: plumbing.NewHash("35e85108805c84807bc66a02d91535e1e24b38b9"),
2181 })
2182 c.Assert(err, IsNil)
2183 commitVal, iterErr := cIter.Next()
2184 c.Assert(iterErr, Equals, nil)
2185 c.Assert(commitVal.Hash.String(), Equals, "b029517f6300c2da0f4b651b8642506cd6aaf45d")
2186
2187 _, iterErr = cIter.Next()
2188 c.Assert(iterErr, Equals, io.EOF)
2189}
2190
2191type mockErrCommitIter struct{}
2192

Callers

nothing calls this directly

Calls 8

NewStorageFunction · 0.92
NewHashFunction · 0.92
InitFunction · 0.85
cloneMethod · 0.80
LogMethod · 0.80
NextMethod · 0.65
StringMethod · 0.65

Tested by

no test coverage detected