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

Method TestLogInvalidFile

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

Source from the content-addressed store, hash-verified

2067}
2068
2069func (s *RepositorySuite) TestLogInvalidFile(c *C) {
2070 r, _ := Init(memory.NewStorage(), nil)
2071 err := r.clone(context.Background(), &CloneOptions{
2072 URL: s.GetBasicLocalRepositoryURL(),
2073 })
2074 c.Assert(err, IsNil)
2075
2076 // Throwing in a file that does not exist
2077 fileName := "vendor/foo12.go"
2078 cIter, err := r.Log(&LogOptions{FileName: &fileName})
2079 // Not raising an error since `git log -- vendor/foo12.go` responds silently
2080 c.Assert(err, IsNil)
2081 defer cIter.Close()
2082
2083 _, err = cIter.Next()
2084 c.Assert(err, Equals, io.EOF)
2085}
2086
2087func (s *RepositorySuite) TestLogFileInitialCommit(c *C) {
2088 r, _ := Init(memory.NewStorage(), nil)

Callers

nothing calls this directly

Calls 7

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

Tested by

no test coverage detected