MCPcopy Index your code
hub / github.com/go-git/go-git / TestGetSizeOfAllObjectFiles

Method TestGetSizeOfAllObjectFiles

storage/filesystem/object_test.go:188–200  ·  view source on GitHub ↗
(c *C)

Source from the content-addressed store, hash-verified

186}
187
188func (s *FsSuite) TestGetSizeOfAllObjectFiles(c *C) {
189 fs := fixtures.ByTag(".git").One().DotGit()
190 o := NewObjectStorage(dotgit.New(fs), cache.NewObjectLRUDefault())
191
192 // Get the size of `tree_walker.go`.
193 err := o.ForEachObjectHash(func(h plumbing.Hash) error {
194 size, err := o.EncodedObjectSize(h)
195 c.Assert(err, IsNil)
196 c.Assert(size, Not(Equals), int64(0))
197 return nil
198 })
199 c.Assert(err, IsNil)
200}
201
202func (s *FsSuite) TestGetFromPackfileMultiplePackfiles(c *C) {
203 fs := fixtures.ByTag(".git").ByTag("multi-packfile").One().DotGit()

Callers

nothing calls this directly

Calls 5

ForEachObjectHashMethod · 0.95
EncodedObjectSizeMethod · 0.95
NewFunction · 0.92
NewObjectLRUDefaultFunction · 0.92
NewObjectStorageFunction · 0.70

Tested by

no test coverage detected