Skip to content
This repository has been archived by the owner on Feb 7, 2024. It is now read-only.

Add Test for PatchLink for create == false #144

Merged
merged 2 commits into from
Dec 11, 2018

Conversation

bonedaddy
Copy link
Contributor

@bonedaddy bonedaddy commented Dec 11, 2018

While writing this test, it became apparent that whether or not you create intermediary nodes, the resulting root hash is the same. What exactly is the effect of creating/not-creating the intermediary nodes? If there is a big difference I should be able to expand the test to check whether or not the intermediary nodes were created, however I'm not quite able to ascertain what the difference is.

Adds a test for pull/143

@Stebalien
Copy link
Member

When create is passed, IPFS will automatically create intermediate merkledag objects. For example, the following won't work without --create

EMPTY=$(ipfs object new unixfs-dir)
ipfs object patch add-link --create $EMPTY a/b/c $EMPTY

(we should probably improve docs but, really, we're planning on deprecating the "object" APIs anyways in favor of the more general dag APIs).

@bonedaddy
Copy link
Contributor Author

Ah okay that makes sense, thanks for the response, i've updated the tests accordingly. I do like the sound of working with the dag APIs a lot more 😁

@Stebalien Stebalien merged commit cfc216e into ipfs:master Dec 11, 2018
@Stebalien
Copy link
Member

Thanks!

@bonedaddy bonedaddy deleted the test/patch-create branch December 11, 2018 23:10
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.

2 participants