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

Method TestObjects

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

Source from the content-addressed store, hash-verified

3111}
3112
3113func (s *RepositorySuite) TestObjects(c *C) {
3114 r, _ := Init(memory.NewStorage(), nil)
3115 err := r.clone(context.Background(), &CloneOptions{URL: s.GetBasicLocalRepositoryURL()})
3116 c.Assert(err, IsNil)
3117
3118 count := 0
3119 objects, err := r.Objects()
3120 c.Assert(err, IsNil)
3121 for {
3122 o, err := objects.Next()
3123 if err != nil {
3124 break
3125 }
3126
3127 count++
3128 c.Assert(o.ID().IsZero(), Equals, false)
3129 c.Assert(o.Type(), Not(Equals), plumbing.AnyObject)
3130 }
3131
3132 c.Assert(count, Equals, 31)
3133}
3134
3135func (s *RepositorySuite) TestObjectNotFound(c *C) {
3136 r, _ := Init(memory.NewStorage(), nil)

Callers

nothing calls this directly

Calls 9

NewStorageFunction · 0.92
InitFunction · 0.85
cloneMethod · 0.80
NextMethod · 0.65
IsZeroMethod · 0.65
IDMethod · 0.65
TypeMethod · 0.65
ObjectsMethod · 0.45

Tested by

no test coverage detected