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 committed 2021-12-07 16:23:02 +00:00
1 parent f1e24945fa
commit 4a0ebe507f
1 file changed
+2 -1
+2 -1
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;
}