Skip to content

Commit 079dc04

Browse files
committed
fix
1 parent 62c5573 commit 079dc04

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

core/coreiface/options/unixfs.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,12 @@ func UnixfsAddOptions(opts ...UnixfsAddOption) (*UnixfsAddSettings, cid.Prefix,
101101
}
102102
} else {
103103
if options.CidVersion < 0 {
104-
// Default to CIDv0
105-
options.CidVersion = 0
104+
// Defaults to CIDv0 unless RawLeaves is set to true.
105+
if options.RawLeavesSet && options.RawLeaves {
106+
options.CidVersion = 1
107+
} else {
108+
options.CidVersion = 0
109+
}
106110
}
107111
}
108112

0 commit comments

Comments
 (0)