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

Method TestGetSizeOfObjectFile

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

Source from the content-addressed store, hash-verified

162}
163
164func (s *FsSuite) TestGetSizeOfObjectFile(c *C) {
165 fs := fixtures.ByTag(".git").ByTag("unpacked").One().DotGit()
166 o := NewObjectStorage(dotgit.New(fs), cache.NewObjectLRUDefault())
167
168 // Get the size of `tree_walker.go`.
169 expected := plumbing.NewHash("cbd81c47be12341eb1185b379d1c82675aeded6a")
170 size, err := o.EncodedObjectSize(expected)
171 c.Assert(err, IsNil)
172 c.Assert(size, Equals, int64(2412))
173}
174
175func (s *FsSuite) TestGetSizeFromPackfile(c *C) {
176 fixtures.Basic().ByTag(".git").Test(c, func(f *fixtures.Fixture) {

Callers

nothing calls this directly

Calls 5

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

Tested by

no test coverage detected