Skip to content

Commit

Permalink
Address CR feedback
Browse files Browse the repository at this point in the history
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
  • Loading branch information
whyrusleeping committed Mar 6, 2017
1 parent 8082af7 commit 9ec4c25
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions core/commands/add.go
Expand Up @@ -144,10 +144,14 @@ You can now refer to the added file in a gateway, like so:
silent, _, _ := req.Option(silentOptionName).Bool()
chunker, _, _ := req.Option(chunkerOptionName).String()
dopin, _, _ := req.Option(pinOptionName).Bool()
rawblks, _, _ := req.Option(rawLeavesOptionName).Bool()
rawblks, rbset, _ := req.Option(rawLeavesOptionName).Bool()
nocopy, _, _ := req.Option(noCopyOptionName).Bool()
fscache, _, _ := req.Option(fstoreCacheOptionName).Bool()

if nocopy && !rbset {
rawblks = true
}

if nocopy && !rawblks {
res.SetError(fmt.Errorf("nocopy option requires '--raw-leaves' to be enabled as well"), cmds.ErrNormal)
return
Expand All @@ -167,7 +171,7 @@ You can now refer to the added file in a gateway, like so:
}

addblockstore := n.Blockstore
if !fscache && !nocopy {
if !(fscache || nocopy) {
addblockstore = bstore.NewGCBlockstore(n.BaseBlocks, n.GCLocker)
}

Expand Down

0 comments on commit 9ec4c25

Please sign in to comment.