MCPcopy
hub / github.com/go-git/go-git / TestObject

Method TestObject

repository_test.go:3066–3077  ·  view source on GitHub ↗
(c *C)

Source from the content-addressed store, hash-verified

3064}
3065
3066func (s *RepositorySuite) TestObject(c *C) {
3067 r, _ := Init(memory.NewStorage(), nil)
3068 err := r.clone(context.Background(), &CloneOptions{URL: s.GetBasicLocalRepositoryURL()})
3069 c.Assert(err, IsNil)
3070
3071 hash := plumbing.NewHash("6ecf0ef2c2dffb796033e5a02219af86ec6584e5")
3072 o, err := r.Object(plumbing.CommitObject, hash)
3073 c.Assert(err, IsNil)
3074
3075 c.Assert(o.ID().IsZero(), Equals, false)
3076 c.Assert(o.Type(), Equals, plumbing.CommitObject)
3077}
3078
3079func (s *RepositorySuite) TestObjects(c *C) {
3080 r, _ := Init(memory.NewStorage(), nil)

Callers

nothing calls this directly

Calls 9

NewStorageFunction · 0.92
NewHashFunction · 0.92
InitFunction · 0.85
cloneMethod · 0.80
IsZeroMethod · 0.65
IDMethod · 0.65
TypeMethod · 0.65
ObjectMethod · 0.45

Tested by

no test coverage detected