Merge pull request #2293 from ostreedev/fix-file-uri-decoding

Fix translation of file:// URIs into paths
This commit is contained in:
OpenShift Merge Robot 2021-03-10 21:14:51 +01:00 committed by GitHub
commit 31e19935b5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 17 additions and 16 deletions

View File

@ -4104,8 +4104,9 @@ ostree_repo_pull_with_options (OstreeRepo *self,
&configured_branches, error))
goto out;
/* TODO reindent later */
{ OstreeFetcherURI *first_uri = pull_data->meta_mirrorlist->pdata[0];
/* Handle file:// URIs */
{
OstreeFetcherURI *first_uri = pull_data->meta_mirrorlist->pdata[0];
g_autofree char *first_scheme = _ostree_fetcher_uri_get_scheme (first_uri);
/* NB: we don't support local mirrors in mirrorlists, so if this passes, it
@ -4116,8 +4117,8 @@ ostree_repo_pull_with_options (OstreeRepo *self,
*/
if (g_str_equal (first_scheme, "file") && !pull_data->require_static_deltas)
{
g_autofree char *path = _ostree_fetcher_uri_get_path (first_uri);
g_autoptr(GFile) remote_repo_path = g_file_new_for_path (path);
g_autofree char *uri = _ostree_fetcher_uri_to_string (first_uri);
g_autoptr(GFile) remote_repo_path = g_file_new_for_uri (uri);
pull_data->remote_repo_local = ostree_repo_new (remote_repo_path);
if (!ostree_repo_open (pull_data->remote_repo_local, cancellable, error))
goto out;