sahib / brig

File synchronization on top of ipfs with git like interface & web based UI
https://brig.readthedocs.io
GNU Affero General Public License v3.0
567 stars 33 forks source link

`brig cp` sometimes removes files when copying into subdirectory #9

Closed sahib closed 6 years ago

sahib commented 6 years ago

Test setup:

$ brig touch x
$ brig mkdir sub
$ brig cp x sub
$ brig ls 
sub
# x is missing
$ brig ls sub
x
# at least it's here.

Interestingly enough, this was only observed during testing with the command line. The actual unittests surrounding fs.Copy() seem to cover that case just fine.

(This is a reminder to myself)

sahib commented 6 years ago

This was resolved by d4222bfc.

The new node was added to the new parent before changing it's path. This lead to the same hash as the source node, overwriting it later in the process.

It is still not 100% clear why the tests did not show this problem.