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