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

Method Object

repository.go:1485–1492  ·  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

1483// Object returns an Object with the given hash. If not found
1484// plumbing.ErrObjectNotFound is returned.
1485func (r *Repository) Object(t plumbing.ObjectType, h plumbing.Hash) (object.Object, error) {
1486 obj, err := r.Storer.EncodedObject(t, h)
1487 if err != nil {
1488 return nil, err
1489 }
1490
1491 return object.DecodeObject(r.Storer, obj)
1492}
1493
1494// Objects returns an unsorted ObjectIter with all the objects in the repository.
1495func (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