projects
/
ostree.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
a07b8d6
)
lib/repo: assert that writable state and error agree
author
Luca BRUNO
<luca.bruno@coreos.com>
Tue, 7 Dec 2021 16:13:54 +0000
(16:13 +0000)
committer
Luca BRUNO
<luca.bruno@coreos.com>
Tue, 7 Dec 2021 16:21:21 +0000
(16:21 +0000)
This adds an assertion to check that writable stable and error
are in sync. The subsequent logic uses them interchangeably.
src/libostree/ostree-repo.c
patch
|
blob
|
history
diff --git
a/src/libostree/ostree-repo.c
b/src/libostree/ostree-repo.c
index a9be9f948e1ec1be718e972f211c18f26e5b70c0..85700b03abd609c03a4d70d1690b9d7e1e04a87e 100644
(file)
--- 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);