Skip to content
This repository has been archived by the owner on Aug 12, 2020. It is now read-only.

chore: use same hash for empty node as go #213

Merged
merged 5 commits into from
Jun 11, 2018

Conversation

achingbrain
Copy link
Collaborator

Fixes the breakage that ipfs/js-ipfs-unixfs#25 causes.

@ghost ghost assigned achingbrain May 18, 2018
@ghost ghost added the status/in-progress In progress label May 18, 2018
vmx
vmx previously approved these changes May 19, 2018
Copy link
Contributor

@vmx vmx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just like to mention what I tell almost everybody :) I'd prefer if the things that are mentioned in the pull request description are also part of the commit message (I usually just put everything into the commit message, it will then automatically be the pull request description). This way you get all the background also from the Git history, not only from GitHub.

Though, there's no need to change this for this commit, it's just for future commits :)

@achingbrain
Copy link
Collaborator Author

Requires the following to be merged:

ipfs/js-ipfs-unixfs#24
ipfs/js-ipfs-unixfs#25

Part of making the hases emitted by js-ipfs the same as go-ipfs meant unsetting
the data attribute of UnixFS metadata objects if the data buffer had 0 length.

ipfs.files.get converts a pull stream of files into a readable stream of files
and all of the content pull streams too. If an empty buffer is not emitted by
the file content pull stream for file with no data then no file is written
out to the filesystem.

This was a fun bug to track down.

This module used to emit empty buffers for UnixFS metadata with no data
property but I removed it as part of #208 as there was no test that failed
without it so here we reinstate it and add a test.
@achingbrain
Copy link
Collaborator Author

Mac slaves segfaulting after the tests pass, I think this is fine to merge.

@achingbrain achingbrain merged commit 0af9bf4 into master Jun 11, 2018
@ghost ghost removed the status/in-progress In progress label Jun 11, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants