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

Method TestLogFileNext

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

Source from the content-addressed store, hash-verified

1968}
1969
1970func (s *RepositorySuite) TestLogFileNext(c *C) {
1971 r, _ := Init(memory.NewStorage(), nil)
1972 err := r.clone(context.Background(), &CloneOptions{
1973 URL: s.GetBasicLocalRepositoryURL(),
1974 })
1975
1976 c.Assert(err, IsNil)
1977
1978 fileName := "vendor/foo.go"
1979 cIter, err := r.Log(&LogOptions{FileName: &fileName})
1980
1981 c.Assert(err, IsNil)
1982
1983 commitOrder := []plumbing.Hash{
1984 plumbing.NewHash("6ecf0ef2c2dffb796033e5a02219af86ec6584e5"),
1985 }
1986
1987 for _, o := range commitOrder {
1988 commit, err := cIter.Next()
1989 c.Assert(err, IsNil)
1990 c.Assert(commit.Hash, Equals, o)
1991 }
1992 _, err = cIter.Next()
1993 c.Assert(err, Equals, io.EOF)
1994}
1995
1996func (s *RepositorySuite) TestLogFileForEach(c *C) {
1997 r, _ := Init(memory.NewStorage(), nil)

Callers

nothing calls this directly

Calls 7

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

Tested by

no test coverage detected