diff --git a/lfs/client.go b/lfs/client.go index 55099a2d..d5f7711a 100644 --- a/lfs/client.go +++ b/lfs/client.go @@ -43,6 +43,7 @@ type objectResource struct { Oid string `json:"oid,omitempty"` Size int64 `json:"size"` Actions map[string]*linkRelation `json:"actions,omitempty"` + Links map[string]*linkRelation `json:"_links,omitempty"` Error objectError `json:"error,omitempty"` } @@ -66,11 +67,16 @@ func (o *objectResource) NewRequest(relation, method string) (*http.Request, Cre } func (o *objectResource) Rel(name string) (*linkRelation, bool) { - if o.Actions == nil { + actions := o.Actions + if actions == nil { + actions = o.Links + } + + if actions == nil { return nil, false } - rel, ok := o.Actions[name] + rel, ok := actions[name] return rel, ok } diff --git a/lfs/transfer_queue.go b/lfs/transfer_queue.go index 45aefb23..4ad09c87 100644 --- a/lfs/transfer_queue.go +++ b/lfs/transfer_queue.go @@ -175,7 +175,7 @@ func (q *TransferQueue) batchApiRoutine() { } for _, o := range objects { - if _, ok := o.Actions[q.transferKind]; ok { + if _, ok := o.Rel(q.transferKind); ok { // This object needs to be transferred if transfer, ok := q.transferables[o.Oid]; ok { transfer.SetObject(o)