1
0
mirror of https://github.com/ipfs/kubo.git synced 2025-08-06 11:31:54 +08:00

add global config switch for sharding

License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
This commit is contained in:
Jeromy
2017-03-22 16:09:34 -07:00
parent e8764345d6
commit c4c665395a
11 changed files with 124 additions and 39 deletions

View File

@ -190,15 +190,18 @@ func (adder *Adder) PinRoot() error {
func (adder *Adder) Finalize() (node.Node, error) {
root := adder.mr.GetValue()
// cant just call adder.RootNode() here as we need the name for printing
rootNode, err := root.GetNode()
err := root.Flush()
if err != nil {
return nil, err
}
var name string
if !adder.Wrap {
name = rootNode.Links()[0].Name
children, err := root.(*mfs.Directory).ListNames()
if err != nil {
return nil, err
}
name = children[0]
dir, ok := adder.mr.GetValue().(*mfs.Directory)
if !ok {