core: Add detached metadata, readd metadata to commits

Previously I thought we'd have to ditch the current commit
format to avoid a{sv} due to

See https://bugzilla.gnome.org/show_bug.cgi?id=673012

But I realized that we don't really have to care about
unpacking/repacking commit objects, so let's just re-expose the
existing metadata a{sv} in commits in the API.

Also, add support for "detached" metadata that can be updated at any
time post-commit.  This is specifically designed for GPG signatures.

https://bugzilla.gnome.org/show_bug.cgi?id=707379
This commit is contained in:
Colin Walters committed 2013-09-09 17:01:32 -04:00
1 parent b4b700c163
commit ac2d61dd51
7 files changed
+217 -16

No files matched your search

+7
View File
@@ -64,6 +64,13 @@ maybe_prune_loose_object (OtPruneData *data,
if (info)
{
if (objtype == OSTREE_OBJECT_TYPE_COMMIT)
{
gs_unref_object GFile *detached_metadata =
_ostree_repo_get_commit_metadata_loose_path (data->repo, checksum);
if (!ot_gfile_ensure_unlinked (detached_metadata, cancellable, error))
goto out;
}
if (!gs_file_unlink (objf, cancellable, error))
goto out;
data->freed_bytes += g_file_info_get_size (info);