lib/repo: do no return an arbitrary mode on failure

This turns the existing check into an assert. Otherwise, the previous
code may return an arbitrary repo mode (bare) on failure.
This commit is contained in:
Luca BRUNO 2021-12-07 16:16:39 +00:00
parent f1e24945fa
commit 4a0ebe507f
No known key found for this signature in database
GPG Key ID: A9834A2252078E4E
1 changed files with 2 additions and 1 deletions

View File

@ -3816,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;
}