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:
1 file changed
+2
-1
@@ -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;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user