Object returns an Object with the given hash. If not found plumbing.ErrObjectNotFound is returned.
(t plumbing.ObjectType, h plumbing.Hash)
| 1483 | // Object returns an Object with the given hash. If not found |
| 1484 | // plumbing.ErrObjectNotFound is returned. |
| 1485 | func (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. |
| 1495 | func (r *Repository) Objects() (*object.ObjectIter, error) { |