Skip to main content

commit_metadata

Function commit_metadata 

Source
pub fn commit_metadata(
    entries: impl IntoIterator<Item = (String, Value)>,
    refs: Option<&[&str]>,
    collection_id: Option<&str>,
) -> Value
Expand description

Returns the a{sv} metadata dict of a new commit.

The entry order is part of the commit checksum. The dict holds these entries, in this order:

  1. entries, in the order given, with duplicate keys kept
  2. ostree.ref-binding with the ref_binding value for refs, if refs is set
  3. ostree.collection-binding with collection_id, if collection_id is set

If refs is None, the dict holds neither binding key, and the function ignores collection_id. Each value in entries must be a Value::Variant, or Commit::serialize returns an error.