GNOME Bugzilla – Bug 746123
Delete .commitmeta file when writing empty metadata
Last modified: 2015-03-13 16:37:47 UTC
Now that I have GPG signature deletion working I found a bug with ostree_repo_write_commit_detached_metadata(). When the last signature is deleted I remove the "ostree.gpgsigs" key from the metadata dictionary. This is often the only key that was in the metadata, which means the dictionary is now empty. Apparently g_variant_get_data() returns NULL on a normalized, empty dictionary, and g_file_replace_contents() is not happy about that. I suggest deleting the .commitmeta file if g_variant_get_size() returns 0.
Created attachment 299256 [details] [review] Proposed patch Too simple for a pull request.
Review of attachment 299256 [details] [review]: Right. (Though do note I'd like to port this code to *at relative at some point, doesn't have to be this commit though)
Understood. Don't want to conflate a bug fix with porting work.
https://git.gnome.org/browse/ostree/commit/?id=5a3300fe5b84e0b00223391c415db4501964f30f