diff options
author | Luca BRUNO <luca.bruno@coreos.com> | 2021-12-07 16:13:54 +0000 |
---|---|---|
committer | Luca BRUNO <luca.bruno@coreos.com> | 2021-12-07 16:21:21 +0000 |
commit | f1e24945fa03c12417ba0e47fedc8e87c9c0a1f1 (patch) | |
tree | 8a08540cfb34dbbe6ade272241f38b792369cac1 | |
parent | a07b8d6c0076d424555c37b6fa462ce279b831c0 (diff) | |
download | ostree-f1e24945fa03c12417ba0e47fedc8e87c9c0a1f1.tar.gz |
lib/repo: assert that writable state and error agree
This adds an assertion to check that writable stable and error
are in sync. The subsequent logic uses them interchangeably.
-rw-r--r-- | src/libostree/ostree-repo.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/libostree/ostree-repo.c b/src/libostree/ostree-repo.c index a9be9f94..85700b03 100644 --- a/src/libostree/ostree-repo.c +++ b/src/libostree/ostree-repo.c @@ -1560,8 +1560,10 @@ gboolean ostree_repo_is_writable (OstreeRepo *self, GError **error) { - g_return_val_if_fail (self->inited, FALSE); + g_assert (self != NULL); + g_assert (self->inited); + g_assert (self->writable == (self->writable_error == NULL)); if (error != NULL && self->writable_error != NULL) *error = g_error_copy (self->writable_error); |