Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 0 additions & 18 deletions core/coreapi/unixfs.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,9 @@ import (
"github.com/ipfs/boxo/files"
filestore "github.com/ipfs/boxo/filestore"
merkledag "github.com/ipfs/boxo/ipld/merkledag"
dagtest "github.com/ipfs/boxo/ipld/merkledag/test"
ft "github.com/ipfs/boxo/ipld/unixfs"
unixfile "github.com/ipfs/boxo/ipld/unixfs/file"
uio "github.com/ipfs/boxo/ipld/unixfs/io"
"github.com/ipfs/boxo/mfs"
"github.com/ipfs/boxo/path"
cid "github.com/ipfs/go-cid"
cidutil "github.com/ipfs/go-cidutil"
Expand Down Expand Up @@ -171,22 +169,6 @@ func (api *UnixfsAPI) Add(ctx context.Context, files files.Node, opts ...options
}
}

if settings.OnlyHash {
md := dagtest.Mock()
emptyDirNode := ft.EmptyDirNode()
// Use the same prefix for the "empty" MFS root as for the file adder.
err := emptyDirNode.SetCidBuilder(fileAdder.CidBuilder)
if err != nil {
return path.ImmutablePath{}, err
}
mr, err := mfs.NewRoot(ctx, md, emptyDirNode, nil)
if err != nil {
return path.ImmutablePath{}, err
}

fileAdder.SetMfsRoot(mr)
}

nd, err := fileAdder.AddAllAndPin(ctx, files)
if err != nil {
return path.ImmutablePath{}, err
Expand Down
Loading