-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MutableOcflRepository fails on writing files with the same hash #105
Comments
Creating a mutable head revision that only contains a file with identical contents to a file already in the mutable head is now properly writen to the object. Resolves OCFL#105
Creating a mutable head revision that only contains a file with identical contents to a file already in the mutable head is now properly writen to the object. Resolves OCFL#105
@Mewel Thanks for the report! I created a PR that you're welcome to review if you'd like before I merge. |
I checked out your branch, but my test case now leads to this exception:
|
@Mewel Thanks, I should have run your test case. I missed that your code was doing a commit between the writes, so there are two bugs here. Will update the PR shortly. |
Now correctly stages a file with identical content to a file that is already in the object. Previously, this would fail on the first mutable head revision, when the revision did not contain any content files. Resolves OCFL#105
@Mewel are you good with the fix now? |
Creating a mutable head revision that only contains a file with identical contents to a file already in the mutable head is now properly writen to the object. Resolves #105
Now correctly stages a file with identical content to a file that is already in the object. Previously, this would fail on the first mutable head revision, when the revision did not contain any content files. Resolves #105
The fix is in version 2.0.1, which I just released. Let me know if you have any further issues. |
Looks good! Thanks for the fast fix! |
Writing a file with the same hash leads to a IllegalArgumentException due to the fact that the source directory is empty. Before copying, the MutableOcflRepository should check if the hash is already present in the inventory.json.
Changing one of the byte[] { 1 } to byte[] { 2 } will work as expected.
The text was updated successfully, but these errors were encountered: