* file, listed under the %OSTREE_SUMMARY_COLLECTION_MAP key. Collection IDs
* and refs in %OSTREE_SUMMARY_COLLECTION_MAP are guaranteed to be in
* lexicographic order.
+ *
+ * Locking: exclusive
*/
gboolean
ostree_repo_regenerate_summary (OstreeRepo *self,
GCancellable *cancellable,
GError **error)
{
+ /* Take an exclusive lock. This makes sure the commits and deltas don't get
+ * deleted while generating the summary. It also means we can be sure refs
+ * won't be created/updated/deleted during the operation, without having to
+ * add exclusive locks to those operations which would prevent concurrent
+ * commits from working.
+ */
+ g_autoptr(OstreeRepoAutoLock) lock = NULL;
+ lock = _ostree_repo_auto_lock_push (self, OSTREE_REPO_LOCK_EXCLUSIVE,
+ cancellable, error);
+ if (!lock)
+ return FALSE;
+
g_auto(GVariantDict) additional_metadata_builder = OT_VARIANT_BUILDER_INITIALIZER;
g_variant_dict_init (&additional_metadata_builder, additional_metadata);
g_autoptr(GVariantBuilder) refs_builder = g_variant_builder_new (G_VARIANT_TYPE ("a(s(taya{sv}))"));