mirror of
https://github.com/ipfs/kubo.git
synced 2025-06-29 01:12:24 +08:00
Merge pull request #4755 from schomatis/fix/add/hash-only
add: hash-only: set the prefix for MFS root
This commit is contained in:
@ -283,7 +283,10 @@ You can now check what blocks have been created by:
|
|||||||
|
|
||||||
if hash {
|
if hash {
|
||||||
md := dagtest.Mock()
|
md := dagtest.Mock()
|
||||||
mr, err := mfs.NewRoot(req.Context, md, ft.EmptyDirNode(), nil)
|
emptyDirNode := ft.EmptyDirNode()
|
||||||
|
// Use the same prefix for the "empty" MFS root as for the file adder.
|
||||||
|
emptyDirNode.Prefix = *fileAdder.Prefix
|
||||||
|
mr, err := mfs.NewRoot(req.Context, md, emptyDirNode, nil)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
res.SetError(err, cmdkit.ErrNormal)
|
res.SetError(err, cmdkit.ErrNormal)
|
||||||
return
|
return
|
||||||
|
@ -149,6 +149,15 @@ test_add_w() {
|
|||||||
echo "$add_w_d1_v1" >expected &&
|
echo "$add_w_d1_v1" >expected &&
|
||||||
test_sort_cmp expected actual
|
test_sort_cmp expected actual
|
||||||
'
|
'
|
||||||
|
|
||||||
|
test_expect_success "ipfs add -w -r -n (dir) --cid-version=1 succeeds" '
|
||||||
|
ipfs add -r -w -n --cid-version=1 m/t_1wp-8a2/_jo7 >actual
|
||||||
|
'
|
||||||
|
|
||||||
|
test_expect_success "ipfs add -w -r -n (dir) --cid-version=1 is correct" '
|
||||||
|
echo "$add_w_d1_v1" > expected &&
|
||||||
|
test_sort_cmp expected actual
|
||||||
|
'
|
||||||
}
|
}
|
||||||
|
|
||||||
test_init_ipfs
|
test_init_ipfs
|
||||||
|
Reference in New Issue
Block a user