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
336520d4
Unverified
Commit
336520d4
authored
Jun 28, 2018
by
Whyrusleeping
Committed by
GitHub
Jun 28, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #5167 from djdv/fix-addr
add: use file name instead of path name
parents
b183da36
6da92a1f
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
3 additions
and
2 deletions
+3
-2
core/coreunix/add.go
core/coreunix/add.go
+2
-1
core/coreunix/add_test.go
core/coreunix/add_test.go
+1
-1
core/coreunix/test/data/colors/orange
core/coreunix/test/data/colors/orange
+0
-0
core/coreunix/test/data/corps/apple
core/coreunix/test/data/corps/apple
+0
-0
core/coreunix/test/data/fruits/apple
core/coreunix/test/data/fruits/apple
+0
-0
core/coreunix/test/data/fruits/orange
core/coreunix/test/data/fruits/orange
+0
-0
No files found.
core/coreunix/add.go
View file @
336520d4
...
...
@@ -7,6 +7,7 @@ import (
"io/ioutil"
"os"
gopath
"path"
"path/filepath"
"strconv"
core
"github.com/ipfs/go-ipfs/core"
...
...
@@ -316,7 +317,7 @@ func AddR(n *core.IpfsNode, root string) (key string, err error) {
return
""
,
err
}
f
,
err
:=
files
.
NewSerialFile
(
root
,
root
,
false
,
stat
)
f
,
err
:=
files
.
NewSerialFile
(
filepath
.
Base
(
root
)
,
root
,
false
,
stat
)
if
err
!=
nil
{
return
""
,
err
}
...
...
core/coreunix/add_test.go
View file @
336520d4
...
...
@@ -41,7 +41,7 @@ func TestAddRecursive(t *testing.T) {
if
err
!=
nil
{
t
.
Fatal
(
err
)
}
if
k
,
err
:=
AddR
(
node
,
"test
_
data"
);
err
!=
nil
{
if
k
,
err
:=
AddR
(
node
,
"test
/
data"
);
err
!=
nil
{
t
.
Fatal
(
err
)
}
else
if
k
!=
"QmWCCga8AbTyfAQ7pTnGT6JgmRMAB3Qp8ZmTEFi5q5o8jC"
{
t
.
Fatal
(
"keys do not match: "
,
k
)
...
...
core/coreunix/test
_
data/colors/orange
→
core/coreunix/test
/
data/colors/orange
View file @
336520d4
File moved
core/coreunix/test
_
data/corps/apple
→
core/coreunix/test
/
data/corps/apple
View file @
336520d4
File moved
core/coreunix/test
_
data/fruits/apple
→
core/coreunix/test
/
data/fruits/apple
View file @
336520d4
File moved
core/coreunix/test
_
data/fruits/orange
→
core/coreunix/test
/
data/fruits/orange
View file @
336520d4
File moved
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