summaryrefslogtreecommitdiff
path: root/src/libostree/ostree-repo.c
diff options
context:
space:
mode:
authorLuca BRUNO <luca.bruno@coreos.com>2021-12-07 16:16:39 +0000
committerLuca BRUNO <luca.bruno@coreos.com>2021-12-07 16:23:02 +0000
commit4a0ebe507fae41e7f080e15c492f629fdeeaf4ca (patch)
tree90a2afa1ca4ea4b98fb8ed04bb8e25ce646a0cce /src/libostree/ostree-repo.c
parentf1e24945fa03c12417ba0e47fedc8e87c9c0a1f1 (diff)
downloadostree-4a0ebe507fae41e7f080e15c492f629fdeeaf4ca.tar.gz
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.
Diffstat (limited to 'src/libostree/ostree-repo.c')
-rw-r--r--src/libostree/ostree-repo.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/libostree/ostree-repo.c b/src/libostree/ostree-repo.c
index 85700b03..f07d2235 100644
--- a/src/libostree/ostree-repo.c
+++ b/src/libostree/ostree-repo.c
@@ -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;
}