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

Method TestGetSizeOfAllObjectFiles

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

Source from the content-addressed store, hash-verified

152}
153
154func (s *FsSuite) TestGetSizeOfAllObjectFiles(c *C) {
155 fs := fixtures.ByTag(".git").One().DotGit()
156 o := NewObjectStorage(dotgit.New(fs), cache.NewObjectLRUDefault())
157
158 // Get the size of `tree_walker.go`.
159 err := o.ForEachObjectHash(func(h plumbing.Hash) error {
160 size, err := o.EncodedObjectSize(h)
161 c.Assert(err, IsNil)
162 c.Assert(size, Not(Equals), int64(0))
163 return nil
164 })
165 c.Assert(err, IsNil)
166}
167
168func (s *FsSuite) TestGetFromPackfileMultiplePackfiles(c *C) {
169 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