ipfs-cluster/adder
Hector Sanjuan 78b8f47c14 Fix: Wrap-in-directory
Usually we had wrap-in-directory enabled by default because otherwise
we had an error when adding single, non-directory files.

wrap-in-directory happens automatically when adding more than one file
so that was no problem. Thigns also worked when adding a folder and Wrap was
disabled. The only case was adding a single with wrap disabled (a default option).

This patches the ipfsadd/add.go file to remember the last added file so that
we can use it's Cid as the resulting root of the adding process without
having to fetch it from our dummy dagservice.

We have to pass this CID to our Finalize() functions, because it turns out that
in this case (single file without wrap-in-directory), the last block added to the DAG
is not the IPFS root (the ipfsadd/Adder adds the mfs root folder last always).

This was the case when wrap-in-directory was enabled by default.

License: MIT
Signed-off-by: Hector Sanjuan <code@hector.link>
2018-08-09 01:16:30 +02:00
..
ipfsadd Fix: Wrap-in-directory 2018-08-09 01:16:30 +02:00
local Fix: Wrap-in-directory 2018-08-09 01:16:30 +02:00
sharding Fix: Wrap-in-directory 2018-08-09 01:16:30 +02:00
adder_test.go Fix: Wrap-in-directory 2018-08-09 01:16:30 +02:00
adder.go Fix: Wrap-in-directory 2018-08-09 01:16:30 +02:00
util.go Golint and improved error messages 2018-08-08 21:29:21 +02:00