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

Method TestObject

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

Source from the content-addressed store, hash-verified

3098}
3099
3100func (s *RepositorySuite) TestObject(c *C) {
3101 r, _ := Init(memory.NewStorage(), nil)
3102 err := r.clone(context.Background(), &CloneOptions{URL: s.GetBasicLocalRepositoryURL()})
3103 c.Assert(err, IsNil)
3104
3105 hash := plumbing.NewHash("6ecf0ef2c2dffb796033e5a02219af86ec6584e5")
3106 o, err := r.Object(plumbing.CommitObject, hash)
3107 c.Assert(err, IsNil)
3108
3109 c.Assert(o.ID().IsZero(), Equals, false)
3110 c.Assert(o.Type(), Equals, plumbing.CommitObject)
3111}
3112
3113func (s *RepositorySuite) TestObjects(c *C) {
3114 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