lib/commit: Only auto-update summary if refs were written
Closes: #1693 Approved by: mwleeds
This commit is contained in:
parent
72a54fa877
commit
521e0ec3ac
|
|
@ -2195,19 +2195,21 @@ ostree_repo_commit_transaction (OstreeRepo *self,
|
||||||
if (self->txn.refs)
|
if (self->txn.refs)
|
||||||
if (!_ostree_repo_update_refs (self, self->txn.refs, cancellable, error))
|
if (!_ostree_repo_update_refs (self, self->txn.refs, cancellable, error))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
g_clear_pointer (&self->txn.refs, g_hash_table_destroy);
|
|
||||||
|
|
||||||
if (self->txn.collection_refs)
|
if (self->txn.collection_refs)
|
||||||
if (!_ostree_repo_update_collection_refs (self, self->txn.collection_refs, cancellable, error))
|
if (!_ostree_repo_update_collection_refs (self, self->txn.collection_refs, cancellable, error))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
g_clear_pointer (&self->txn.collection_refs, g_hash_table_destroy);
|
|
||||||
|
|
||||||
/* Update the summary if auto-update-summary is set, because doing so was
|
/* Update the summary if auto-update-summary is set, because doing so was
|
||||||
* delayed for each ref change during the transaction.
|
* delayed for each ref change during the transaction.
|
||||||
*/
|
*/
|
||||||
if (!_ostree_repo_maybe_regenerate_summary (self, cancellable, error))
|
if ((self->txn.refs || self->txn.collection_refs) &&
|
||||||
|
!_ostree_repo_maybe_regenerate_summary (self, cancellable, error))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
|
g_clear_pointer (&self->txn.refs, g_hash_table_destroy);
|
||||||
|
g_clear_pointer (&self->txn.collection_refs, g_hash_table_destroy);
|
||||||
|
|
||||||
self->in_transaction = FALSE;
|
self->in_transaction = FALSE;
|
||||||
|
|
||||||
if (!ot_ensure_unlinked_at (self->repo_dir_fd, "transaction", 0))
|
if (!ot_ensure_unlinked_at (self->repo_dir_fd, "transaction", 0))
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue