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

Method TestGetSizeOfObjectFile

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

Source from the content-addressed store, hash-verified

128}
129
130func (s *FsSuite) TestGetSizeOfObjectFile(c *C) {
131 fs := fixtures.ByTag(".git").ByTag("unpacked").One().DotGit()
132 o := NewObjectStorage(dotgit.New(fs), cache.NewObjectLRUDefault())
133
134 // Get the size of `tree_walker.go`.
135 expected := plumbing.NewHash("cbd81c47be12341eb1185b379d1c82675aeded6a")
136 size, err := o.EncodedObjectSize(expected)
137 c.Assert(err, IsNil)
138 c.Assert(size, Equals, int64(2412))
139}
140
141func (s *FsSuite) TestGetSizeFromPackfile(c *C) {
142 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