Unverified Commit c35356b2 authored by Steven Allen's avatar Steven Allen Committed by GitHub

Merge pull request #21 from ipfs/feat/remove-wrap

remove Wrap
parents 0c1d0480 33e06486
0.1.15: QmaLFN7mZFjJ1W9aQiPoY2WySnSqphmfZHQCPUtj2iqWVH
0.1.16: QmaWreJcDyf2BEAtGDfL1ETGrGAHR8KS8UCCPWd3QtDg8R
......@@ -33,8 +33,6 @@ type UnixfsAddSettings struct {
FsCache bool
NoCopy bool
Wrap bool
Events chan<- interface{}
Silent bool
Progress bool
......@@ -65,8 +63,6 @@ func UnixfsAddOptions(opts ...UnixfsAddOption) (*UnixfsAddSettings, cid.Prefix,
FsCache: false,
NoCopy: false,
Wrap: false,
Events: nil,
Silent: false,
Progress: false,
......@@ -234,15 +230,6 @@ func (unixfsOpts) HashOnly(hashOnly bool) UnixfsAddOption {
}
}
// Wrap tells the adder to wrap the added file structure with an additional
// directory.
func (unixfsOpts) Wrap(wrap bool) UnixfsAddOption {
return func(settings *UnixfsAddSettings) error {
settings.Wrap = wrap
return nil
}
}
// Events specifies channel which will be used to report events about ongoing
// Add operation.
//
......
......@@ -91,6 +91,6 @@
"license": "",
"name": "interface-go-ipfs-core",
"releaseCmd": "git commit -a -m \"gx publish $VERSION\"",
"version": "0.1.15"
"version": "0.1.16"
}
......@@ -248,13 +248,6 @@ func (tp *provider) TestAdd(t *testing.T) {
data: flatDir,
path: "/ipfs/QmRKGpFfR32FVXdvJiHfo4WJ5TDYBsM1P9raAp1p6APWSp",
},
{
name: "simpleDirWrap",
data: flatDir,
expect: wrapped("QmRKGpFfR32FVXdvJiHfo4WJ5TDYBsM1P9raAp1p6APWSp"),
path: "/ipfs/QmXxCaQkC8Z6Qws1nTkTQfCsL9y4XvWXnrPokp9bhmjC1L",
opts: []options.UnixfsAddOption{options.Unixfs.Wrap(true)},
},
{
name: "simpleDir",
data: flatDir,
......@@ -279,35 +272,6 @@ func (tp *provider) TestAdd(t *testing.T) {
wrap: "foo",
expect: wrapped("foo"),
},
{
name: "stdinWrapped",
path: "/ipfs/QmU3r81oZycjHS9oaSHw37ootMFuFUw1DvMLKXPsezdtqU",
data: func() files.Node {
return files.NewBytesFile([]byte(helloStr))
},
expect: func(files.Node) files.Node {
return files.NewMapDirectory(map[string]files.Node{
"QmQy2Dw4Wk7rdJKjThjYXzfFJNaRKRHhHP5gHHXroJMYxk": files.NewBytesFile([]byte(helloStr)),
})
},
opts: []options.UnixfsAddOption{options.Unixfs.Wrap(true)},
},
{
name: "twoLevelDirWrapped",
data: twoLevelDir(),
wrap: "t",
expect: wrapped("QmPwsL3T5sWhDmmAWZHAzyjKtMVDS9a11aHNRqb3xoVnmg", "t"),
path: "/ipfs/QmXzZwAh34pmNjuKsVGZfpbByis5S5qeZjCCUxa1ajZqzH",
opts: []options.UnixfsAddOption{options.Unixfs.Wrap(true)},
},
{
name: "twoLevelInlineHash",
data: twoLevelDir(),
wrap: "t",
expect: wrapped("zBunoruKoyCHKkALNSWxDvj4L7yuQnMgQ4hUa9j1Z64tVcDEcu6Zdetyu7eeFCxMPfxb7YJvHeFHoFoHMkBUQf6vfdhmi", "t"),
path: "/ipfs/QmUX6GykDGHTMtLmDkfjqs48QwQK82vou51xwaY9TSU7Zo",
opts: []options.UnixfsAddOption{options.Unixfs.Wrap(true), options.Unixfs.Inline(true), options.Unixfs.RawLeaves(true), options.Unixfs.Hash(mh.SHA3)},
},
// hidden
{
name: "hiddenFilesAdded",
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment