Address CR feedback
License: MIT Signed-off-by: Jeromy <jeromyj@gmail.com>
Jeromy committed
Mar 6, 2017 at 00:36 UTC
9ec4c25e31ad8d92d4a77194188cc0c046197cd4
1 file changed
+6
-2
core/commands/add.go
+6
-2
@@ -144,10 +144,14 @@ You can now refer to the added file in a gateway, like so:
144
silent, _, _ := req.Option(silentOptionName).Bool()
145
chunker, _, _ := req.Option(chunkerOptionName).String()
146
dopin, _, _ := req.Option(pinOptionName).Bool()
147
- rawblks, _, _ := req.Option(rawLeavesOptionName).Bool()
147
+ rawblks, rbset, _ := req.Option(rawLeavesOptionName).Bool()
148
nocopy, _, _ := req.Option(noCopyOptionName).Bool()
149
fscache, _, _ := req.Option(fstoreCacheOptionName).Bool()
150
151
+ if nocopy && !rbset {
152
+ rawblks = true
153
+ }
154
+
155
if nocopy && !rawblks {
156
res.SetError(fmt.Errorf("nocopy option requires '--raw-leaves' to be enabled as well"), cmds.ErrNormal)
157
return
@@ -167,7 +171,7 @@ You can now refer to the added file in a gateway, like so:
171
}
172
173
addblockstore := n.Blockstore
170
- if !fscache && !nocopy {
174
+ if !(fscache || nocopy) {
175
addblockstore = bstore.NewGCBlockstore(n.BaseBlocks, n.GCLocker)
176
}
177