@@ -44,6 +44,8 @@ const (
44
44
fstoreCacheOptionName = "fscache"
45
45
cidVersionOptionName = "cid-version"
46
46
hashOptionName = "hash"
47
+ inlineOptionName = "inline"
48
+ idHashLimitOptionName = "id-hash-limit"
47
49
)
48
50
49
51
const adderOutChanSize = 8
@@ -120,6 +122,8 @@ You can now check what blocks have been created by:
120
122
cmdkit .BoolOption (fstoreCacheOptionName , "Check the filestore for pre-existing blocks. (experimental)" ),
121
123
cmdkit .IntOption (cidVersionOptionName , "CID version. Defaults to 0 unless an option that depends on CIDv1 is passed. (experimental)" ),
122
124
cmdkit .StringOption (hashOptionName , "Hash function to use. Implies CIDv1 if not sha2-256. (experimental)" ).WithDefault ("sha2-256" ),
125
+ cmdkit .BoolOption (inlineOptionName , "Inline small objects using identity hash. (experimental)" ),
126
+ cmdkit .IntOption (idHashLimitOptionName , "Identity hash maxium size. (experimental)" ).WithDefault (64 ),
123
127
},
124
128
PreRun : func (req * cmds.Request , env cmds.Environment ) error {
125
129
quiet , _ := req .Options [quietOptionName ].(bool )
@@ -173,6 +177,8 @@ You can now check what blocks have been created by:
173
177
fscache , _ := req .Options [fstoreCacheOptionName ].(bool )
174
178
cidVer , cidVerSet := req .Options [cidVersionOptionName ].(int )
175
179
hashFunStr , _ := req .Options [hashOptionName ].(string )
180
+ inline , _ := req .Options [inlineOptionName ].(bool )
181
+ idHashLimit , _ := req .Options [idHashLimitOptionName ].(int )
176
182
177
183
// The arguments are subject to the following constraints.
178
184
//
@@ -281,6 +287,10 @@ You can now check what blocks have been created by:
281
287
fileAdder .NoCopy = nocopy
282
288
fileAdder .Prefix = & prefix
283
289
290
+ if inline {
291
+ fileAdder .Prefix = Inliner {fileAdder .Prefix , idHashLimit }
292
+ }
293
+
284
294
if hash {
285
295
md := dagtest .Mock ()
286
296
emptyDirNode := ft .EmptyDirNode ()
0 commit comments