Skip to content

Commit

Permalink
Disable "ipfs add -rn" with tracking bug.
Browse files Browse the repository at this point in the history
License: MIT
Signed-off-by: Stephen Whitmore <noffle@ipfs.io>
  • Loading branch information
hackergrrl committed Jun 1, 2016
1 parent af57caf commit 74517ea
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
16 changes: 12 additions & 4 deletions core/commands/add.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,11 +120,19 @@ You can now refer to the added file in a gateway, like so:
trickle, _, _ := req.Option(trickleOptionName).Bool()
wrap, _, _ := req.Option(wrapOptionName).Bool()
hash, _, _ := req.Option(onlyHashOptionName).Bool()
recursive, _, _ := req.Option("recursive").Bool()
hidden, _, _ := req.Option(hiddenOptionName).Bool()
silent, _, _ := req.Option(silentOptionName).Bool()
chunker, _, _ := req.Option(chunkerOptionName).String()
dopin, _, _ := req.Option(pinOptionName).Bool()

// Temporarily disabled. See https://github.com/ipfs/go-ipfs/issues/2784
if hash && recursive {
err = fmt.Errorf("Recursive hash-only functionality temporarily disabled.\n\nSee https://github.com/ipfs/go-ipfs/issues/2784")
res.SetError(err, cmds.ErrClient)
return
}

if hash {
nilnode, err := core.NewNode(n.Context(), &core.BuildCfg{
//TODO: need this to be true or all files
Expand Down Expand Up @@ -171,16 +179,16 @@ You can now refer to the added file in a gateway, like so:
}
}

if hash {
return nil
}

// copy intermediary nodes from editor to our actual dagservice
_, err := fileAdder.Finalize()
if err != nil {
return err
}

if hash {
return nil
}

return fileAdder.PinRoot()
}

Expand Down
4 changes: 2 additions & 2 deletions test/sharness/t0040-add-and-cat.sh
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ test_expect_success "'ipfs add -r' output looks good" '
test_cmp expected actual
'

test_expect_success "'ipfs add -rn' succeeds" '
test_expect_failure "'ipfs add -rn' succeeds" '
mkdir -p mountdir/moons/jupiter &&
mkdir -p mountdir/moons/saturn &&
echo "Hello Europa!" >mountdir/moons/jupiter/europa.txt &&
Expand All @@ -314,7 +314,7 @@ test_expect_success "'ipfs add -rn' succeeds" '
ipfs add -rn mountdir/moons >actual
'

test_expect_success "'ipfs add -rn' output looks good" '
test_expect_failure "'ipfs add -rn' output looks good" '
MOONS="QmVKvomp91nMih5j6hYBA8KjbiaYvEetU2Q7KvtZkLe9nQ" &&
EUROPA="Qmbjg7zWdqdMaK2BucPncJQDxiALExph5k3NkQv5RHpccu" &&
JUPITER="QmS5mZddhFPLWFX3w6FzAy9QxyYkaxvUpsWCtZ3r7jub9J" &&
Expand Down

0 comments on commit 74517ea

Please sign in to comment.