commit: Allow skipping automatic summary generation

If a commit is being made during summary generation, then it would
trigger the summary to be generated again. That's either unwanted busy
work or could result in an infinite loop. Add a boolean in
`OstreeRepoTxn` to disable automatic summary generation as seen fit.
This commit is contained in:
Dan Nicholson 2019-10-15 16:31:23 -06:00 committed by Dan Nicholson
parent 582d7071d2
commit b2f02337f8
2 changed files with 3 additions and 1 deletions

View File

@ -2350,7 +2350,8 @@ ostree_repo_commit_transaction (OstreeRepo *self,
/* 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 ((self->txn.refs || self->txn.collection_refs) && if (!self->txn.disable_auto_summary &&
(self->txn.refs || self->txn.collection_refs) &&
!_ostree_repo_maybe_regenerate_summary (self, cancellable, error)) !_ostree_repo_maybe_regenerate_summary (self, cancellable, error))
return FALSE; return FALSE;

View File

@ -101,6 +101,7 @@ typedef struct {
/* Implementation of min-free-space-percent */ /* Implementation of min-free-space-percent */
gulong blocksize; gulong blocksize;
fsblkcnt_t max_blocks; fsblkcnt_t max_blocks;
gboolean disable_auto_summary;
} OstreeRepoTxn; } OstreeRepoTxn;
typedef struct { typedef struct {