MCPcopy
hub / github.com/go-git/go-git / TestLogFileWithOtherParamsPass

Method TestLogFileWithOtherParamsPass

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

Source from the content-addressed store, hash-verified

2135}
2136
2137func (s *RepositorySuite) TestLogFileWithOtherParamsPass(c *C) {
2138 r, _ := Init(memory.NewStorage(), nil)
2139 err := r.clone(context.Background(), &CloneOptions{
2140 URL: s.GetBasicLocalRepositoryURL(),
2141 })
2142 c.Assert(err, IsNil)
2143
2144 fileName := "LICENSE"
2145 cIter, err := r.Log(&LogOptions{
2146 Order: LogOrderCommitterTime,
2147 FileName: &fileName,
2148 From: plumbing.NewHash("35e85108805c84807bc66a02d91535e1e24b38b9"),
2149 })
2150 c.Assert(err, IsNil)
2151 commitVal, iterErr := cIter.Next()
2152 c.Assert(iterErr, Equals, nil)
2153 c.Assert(commitVal.Hash.String(), Equals, "b029517f6300c2da0f4b651b8642506cd6aaf45d")
2154
2155 _, iterErr = cIter.Next()
2156 c.Assert(iterErr, Equals, io.EOF)
2157}
2158
2159type mockErrCommitIter struct{}
2160

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