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

Method TestLogInvalidFile

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

Source from the content-addressed store, hash-verified

2099}
2100
2101func (s *RepositorySuite) TestLogInvalidFile(c *C) {
2102 r, _ := Init(memory.NewStorage(), nil)
2103 err := r.clone(context.Background(), &CloneOptions{
2104 URL: s.GetBasicLocalRepositoryURL(),
2105 })
2106 c.Assert(err, IsNil)
2107
2108 // Throwing in a file that does not exist
2109 fileName := "vendor/foo12.go"
2110 cIter, err := r.Log(&LogOptions{FileName: &fileName})
2111 // Not raising an error since `git log -- vendor/foo12.go` responds silently
2112 c.Assert(err, IsNil)
2113 defer cIter.Close()
2114
2115 _, err = cIter.Next()
2116 c.Assert(err, Equals, io.EOF)
2117}
2118
2119func (s *RepositorySuite) TestLogFileInitialCommit(c *C) {
2120 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