aboutsummaryrefslogtreecommitdiffstats
path: root/repository.go
diff options
context:
space:
mode:
authorMáximo Cuadros <mcuadros@gmail.com>2016-08-29 23:06:10 +0200
committerMáximo Cuadros <mcuadros@gmail.com>2016-08-29 23:06:10 +0200
commitb73657f1aa7016bdd4c2cbd50bee4c20d5ab69ef (patch)
tree7f93f11b91b84e605a26f573d40791a4f6cb49d0 /repository.go
parente4246138cb9ffb819c052ba17a9fbdf915427291 (diff)
downloadgo-git-b73657f1aa7016bdd4c2cbd50bee4c20d5ab69ef.tar.gz
core: Storage.Get, switch order of args
Diffstat (limited to 'repository.go')
-rw-r--r--repository.go10
1 files changed, 5 insertions, 5 deletions
diff --git a/repository.go b/repository.go
index 1a5f4a7..049c7db 100644
--- a/repository.go
+++ b/repository.go
@@ -226,7 +226,7 @@ func (r *Repository) Pull(o *PullOptions) error {
// Commit return the commit with the given hash
func (r *Repository) Commit(h core.Hash) (*Commit, error) {
- obj, err := r.s.ObjectStorage().Get(h, core.CommitObject)
+ obj, err := r.s.ObjectStorage().Get(core.CommitObject, h)
if err != nil {
if err == core.ErrObjectNotFound {
return nil, ErrObjectNotFound
@@ -250,7 +250,7 @@ func (r *Repository) Commits() (*CommitIter, error) {
// Tree return the tree with the given hash
func (r *Repository) Tree(h core.Hash) (*Tree, error) {
- obj, err := r.s.ObjectStorage().Get(h, core.TreeObject)
+ obj, err := r.s.ObjectStorage().Get(core.TreeObject, h)
if err != nil {
if err == core.ErrObjectNotFound {
return nil, ErrObjectNotFound
@@ -264,7 +264,7 @@ func (r *Repository) Tree(h core.Hash) (*Tree, error) {
// Blob returns the blob with the given hash
func (r *Repository) Blob(h core.Hash) (*Blob, error) {
- obj, err := r.s.ObjectStorage().Get(h, core.BlobObject)
+ obj, err := r.s.ObjectStorage().Get(core.BlobObject, h)
if err != nil {
if err == core.ErrObjectNotFound {
return nil, ErrObjectNotFound
@@ -278,7 +278,7 @@ func (r *Repository) Blob(h core.Hash) (*Blob, error) {
// Tag returns a tag with the given hash.
func (r *Repository) Tag(h core.Hash) (*Tag, error) {
- obj, err := r.s.ObjectStorage().Get(h, core.TagObject)
+ obj, err := r.s.ObjectStorage().Get(core.TagObject, h)
if err != nil {
if err == core.ErrObjectNotFound {
return nil, ErrObjectNotFound
@@ -303,7 +303,7 @@ func (r *Repository) Tags() (*TagIter, error) {
// Object returns an object with the given hash.
func (r *Repository) Object(h core.Hash, t core.ObjectType) (Object, error) {
- obj, err := r.s.ObjectStorage().Get(h, t)
+ obj, err := r.s.ObjectStorage().Get(t, h)
if err != nil {
if err == core.ErrObjectNotFound {
return nil, ErrObjectNotFound