Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
dms3
go-dms3
Commits
59ad0f8c
Unverified
Commit
59ad0f8c
authored
Mar 22, 2018
by
Whyrusleeping
Committed by
GitHub
Mar 22, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #4755 from schomatis/fix/add/hash-only
add: hash-only: set the prefix for MFS root
parents
c44191e0
5d7e8a89
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
1 deletion
+13
-1
core/commands/add.go
core/commands/add.go
+4
-1
test/sharness/t0043-add-w.sh
test/sharness/t0043-add-w.sh
+9
-0
No files found.
core/commands/add.go
View file @
59ad0f8c
...
...
@@ -283,7 +283,10 @@ You can now check what blocks have been created by:
if
hash
{
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
{
res
.
SetError
(
err
,
cmdkit
.
ErrNormal
)
return
...
...
test/sharness/t0043-add-w.sh
View file @
59ad0f8c
...
...
@@ -149,6 +149,15 @@ test_add_w() {
echo "$add_w_d1_v1" >expected &&
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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment