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.
This commit is contained in:
parent
a07b8d6c00
commit
f1e24945fa
|
|
@ -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);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue