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

Method Object

repository.go:1476–1483  ·  view source on GitHub ↗

Object returns an Object with the given hash. If not found plumbing.ErrObjectNotFound is returned.

(t plumbing.ObjectType, h plumbing.Hash)

Source from the content-addressed store, hash-verified

1474// Object returns an Object with the given hash. If not found
1475// plumbing.ErrObjectNotFound is returned.
1476func (r *Repository) Object(t plumbing.ObjectType, h plumbing.Hash) (object.Object, error) {
1477 obj, err := r.Storer.EncodedObject(t, h)
1478 if err != nil {
1479 return nil, err
1480 }
1481
1482 return object.DecodeObject(r.Storer, obj)
1483}
1484
1485// Objects returns an unsorted ObjectIter with all the objects in the repository.
1486func (r *Repository) Objects() (*object.ObjectIter, error) {

Callers 4

TestObjectMethod · 0.45
TestObjectNotFoundMethod · 0.45
fetchAndCheckoutMethod · 0.45

Calls 2

DecodeObjectFunction · 0.92
EncodedObjectMethod · 0.65

Tested by 2

TestObjectMethod · 0.36
TestObjectNotFoundMethod · 0.36