Commit 6da92a1f authored by camelmasa's avatar camelmasa Committed by Dominic Della Valle

Fix wrong added filename

License: MIT
Signed-off-by: default avatarMasahiro Saito <camelmasa@gmail.com>
parent b183da36
......@@ -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
}
......
......@@ -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)
......
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