if (!have_to_commit)
{
- FetchObjectData *fetch_data = g_new0 (FetchObjectData, 1);
+ FetchObjectData *fetch_data;
+ g_autofree char *detached_path = _ostree_get_relative_static_delta_path (from_revision, to_revision, "commitmeta");
+ g_autoptr(GVariant) detached_data = NULL;
+
+ detached_data = g_variant_lookup_value (metadata, detached_path, G_VARIANT_TYPE("a{sv}"));
+ if (detached_data && !ostree_repo_write_commit_detached_metadata (pull_data->repo,
+ to_revision,
+ detached_data,
+ cancellable,
+ error))
+ goto out;
+
+ fetch_data = g_new0 (FetchObjectData, 1);
fetch_data->pull_data = pull_data;
fetch_data->object = ostree_object_name_serialize (to_checksum, OSTREE_OBJECT_TYPE_COMMIT);
fetch_data->is_detached_meta = FALSE;
g_autoptr(GFile) descriptor_dir = NULL;
g_autoptr(GVariant) tmp_metadata = NULL;
g_autoptr(GVariant) fallback_headers = NULL;
+ g_autoptr(GVariant) detached = NULL;
gboolean inline_parts;
g_autoptr(GFile) tmp_dir = NULL;
-
builder.parts = g_ptr_array_new_with_free_func ((GDestroyNotify)ostree_static_delta_part_builder_unref);
builder.fallback_objects = g_ptr_array_new_with_free_func ((GDestroyNotify)g_variant_unref);
cancellable, error))
goto out;
+ if (!ostree_repo_read_commit_detached_metadata (self, to, &detached, cancellable, error))
+ goto out;
+
+ if (detached)
+ {
+ g_autofree char *detached_key = _ostree_get_relative_static_delta_path (from, to, "commitmeta");
+ g_variant_builder_add (&metadata_builder, "{sv}", detached_key, detached);
+ }
+
/* Generate OSTREE_STATIC_DELTA_SUPERBLOCK_FORMAT */
{
GDateTime *now = g_date_time_new_now_utc ();
/* Parsing OSTREE_STATIC_DELTA_SUPERBLOCK_FORMAT */
+ metadata = g_variant_get_child_value (meta, 0);
+
/* Write the to-commit object */
{
g_autoptr(GVariant) to_csum_v = NULL;
if (!have_to_commit)
{
+ g_autofree char *detached_path = _ostree_get_relative_static_delta_path (from_checksum, to_checksum, "commitmeta");
+ g_autoptr(GVariant) detached_data = NULL;
+
+ detached_data = g_variant_lookup_value (metadata, detached_path, G_VARIANT_TYPE("a{sv}"));
+ if (detached_data && !ostree_repo_write_commit_detached_metadata (self,
+ to_checksum,
+ detached_data,
+ cancellable,
+ error))
+ goto out;
+
to_commit = g_variant_get_child_value (meta, 4);
if (!ostree_repo_write_metadata (self, OSTREE_OBJECT_TYPE_COMMIT,
to_checksum, to_commit, NULL,
}
headers = g_variant_get_child_value (meta, 6);
- metadata = g_variant_get_child_value (meta, 0);
n = g_variant_n_children (headers);
for (i = 0; i < n; i++)
{