ostree find-remotes is a read-only operation that searches for remotes
which have a given collection-ref. It should not require write access
to the repository. Only when --pull is used does the command actually
write to the repo.
Move the ostree_ensure_repo_writable() check to just before the pull
phase so that read-only find-remotes works on read-only repositories.
Closes #3585
error))
return FALSE;
- if (!ostree_ensure_repo_writable (repo, error))
- return FALSE;
-
if (argc < 3)
{
ot_util_usage_error (context, "At least one COLLECTION-ID REF pair must be specified", error);
if (!opt_pull)
return TRUE;
+ /* Pulling requires write access to the repository. */
+ if (!ostree_ensure_repo_writable (repo, error))
+ return FALSE;
+
{
GVariantBuilder builder;
g_variant_builder_init (&builder, G_VARIANT_TYPE ("a{sv}"));