Skip to content

Commit

Permalink
modifications for ResolveToLastNode changes
Browse files Browse the repository at this point in the history
see: ipfs/go-path#1

License: MIT
Signed-off-by: Steven Allen <[email protected]>
  • Loading branch information
Stebalien committed Aug 7, 2018
1 parent 902ddf1 commit df1334b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
11 changes: 8 additions & 3 deletions core/commands/dag/dag.go
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,12 @@ format.
return
}

obj, rem, err := n.Resolver.ResolveToLastNode(req.Context(), p)
lastCid, rem, err := n.Resolver.ResolveToLastNode(req.Context(), p)
if err != nil {
res.SetError(err, cmdkit.ErrNormal)
return
}
obj, err := n.DAG.Get(req.Context(), lastCid)
if err != nil {
res.SetError(err, cmdkit.ErrNormal)
return
Expand Down Expand Up @@ -251,14 +256,14 @@ var DagResolveCmd = &cmds.Command{
return
}

obj, rem, err := n.Resolver.ResolveToLastNode(req.Context(), p)
lastCid, rem, err := n.Resolver.ResolveToLastNode(req.Context(), p)
if err != nil {
res.SetError(err, cmdkit.ErrNormal)
return
}

res.SetOutput(&ResolveOutput{
Cid: obj.Cid(),
Cid: lastCid,
RemPath: path.Join(rem),
})
},
Expand Down
2 changes: 1 addition & 1 deletion core/coreapi/path.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,5 +80,5 @@ func resolvePath(ctx context.Context, ng ipld.NodeGetter, nsys namesys.NameSyste
return nil, err
}

return coreiface.NewResolvedPath(ipath, node.Cid(), root, gopath.Join(rest...)), nil
return coreiface.NewResolvedPath(ipath, node, root, gopath.Join(rest...)), nil
}

0 comments on commit df1334b

Please sign in to comment.