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

Method TestGetFromObjectFile

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

Source from the content-addressed store, hash-verified

32var _ = Suite(&FsSuite{})
33
34func (s *FsSuite) TestGetFromObjectFile(c *C) {
35 fs := fixtures.ByTag(".git").ByTag("unpacked").One().DotGit()
36 o := NewObjectStorage(dotgit.New(fs), cache.NewObjectLRUDefault())
37
38 expected := plumbing.NewHash("f3dfe29d268303fc6e1bbce268605fc99573406e")
39 obj, err := o.EncodedObject(plumbing.AnyObject, expected)
40 c.Assert(err, IsNil)
41 c.Assert(obj.Hash(), Equals, expected)
42}
43
44func (s *FsSuite) TestGetFromPackfile(c *C) {
45 fixtures.Basic().ByTag(".git").Test(c, func(f *fixtures.Fixture) {

Callers

nothing calls this directly

Calls 6

EncodedObjectMethod · 0.95
NewFunction · 0.92
NewObjectLRUDefaultFunction · 0.92
NewHashFunction · 0.92
NewObjectStorageFunction · 0.70
HashMethod · 0.65

Tested by

no test coverage detected