From b2f02337f86efe55f56ea2ad641a55059c2a2623 Mon Sep 17 00:00:00 2001 From: Dan Nicholson Date: Tue, 15 Oct 2019 16:31:23 -0600 Subject: 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. --- src/libostree/ostree-repo-commit.c | 3 ++- src/libostree/ostree-repo-private.h | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/libostree/ostree-repo-commit.c b/src/libostree/ostree-repo-commit.c index 63286351..51bfd46e 100644 --- a/src/libostree/ostree-repo-commit.c +++ b/src/libostree/ostree-repo-commit.c @@ -2350,7 +2350,8 @@ ostree_repo_commit_transaction (OstreeRepo *self, /* Update the summary if auto-update-summary is set, because doing so was * 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)) return FALSE; diff --git a/src/libostree/ostree-repo-private.h b/src/libostree/ostree-repo-private.h index 18e0199e..9a0ea2be 100644 --- a/src/libostree/ostree-repo-private.h +++ b/src/libostree/ostree-repo-private.h @@ -101,6 +101,7 @@ typedef struct { /* Implementation of min-free-space-percent */ gulong blocksize; fsblkcnt_t max_blocks; + gboolean disable_auto_summary; } OstreeRepoTxn; typedef struct { -- cgit v1.2.1