mirror of
https://github.com/ostreedev/ostree.git
synced 2024-12-22 17:35:55 +03:00
Merge pull request #2496 from lucab/ups/repo-asserts
lib/repo: fix problematic invariant checks
This commit is contained in:
commit
b56786c415
@ -1558,8 +1558,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);
|
||||
|
||||
@ -1595,7 +1597,8 @@ _ostree_repo_update_mtime (OstreeRepo *self,
|
||||
GKeyFile *
|
||||
ostree_repo_get_config (OstreeRepo *self)
|
||||
{
|
||||
g_return_val_if_fail (self->inited, NULL);
|
||||
g_assert (self != NULL);
|
||||
g_assert (self->inited);
|
||||
|
||||
return self->config;
|
||||
}
|
||||
@ -1613,7 +1616,8 @@ ostree_repo_copy_config (OstreeRepo *self)
|
||||
char *data;
|
||||
gsize len;
|
||||
|
||||
g_return_val_if_fail (self->inited, NULL);
|
||||
g_assert (self != NULL);
|
||||
g_assert (self->inited);
|
||||
|
||||
copy = g_key_file_new ();
|
||||
data = g_key_file_to_data (self->config, &len, NULL);
|
||||
@ -3812,7 +3816,8 @@ ostree_repo_equal (OstreeRepo *a,
|
||||
OstreeRepoMode
|
||||
ostree_repo_get_mode (OstreeRepo *self)
|
||||
{
|
||||
g_return_val_if_fail (self->inited, FALSE);
|
||||
g_assert (self != NULL);
|
||||
g_assert (self->inited);
|
||||
|
||||
return self->mode;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user