Change pull-local to just be a wrapper for pull with file:///
This follows up from the previous commit; now that pull knows how to do the efficient link() or copy for local files, we can just have pull-local call into ostree_repo_pull(). As part of this: - pull() can also accept a file:/// URI instead of a remote name (since pull local supports anonymous pulls) - pull() knows an "override-remote-name" option, since pull-local supported writing a ref out even if there wasn't a remote with that name
This commit is contained in:
1 parent
ab3bf493dd
commit
9cc9804195
4 files changed
+124
-205
No files matched your search
@@ -231,6 +231,12 @@ ost_repo_remove_remote (OstreeRepo *self,
|
||||
return removed;
|
||||
}
|
||||
|
||||
gboolean
|
||||
_ostree_repo_remote_name_is_file (const char *remote_name)
|
||||
{
|
||||
return g_str_has_prefix (remote_name, "file://");
|
||||
}
|
||||
|
||||
gboolean
|
||||
_ostree_repo_get_remote_option (OstreeRepo *self,
|
||||
const char *remote_name,
|
||||
@@ -242,6 +248,12 @@ _ostree_repo_get_remote_option (OstreeRepo *self,
|
||||
local_cleanup_remote OstreeRemote *remote = NULL;
|
||||
gboolean ret = FALSE;
|
||||
|
||||
if (_ostree_repo_remote_name_is_file (remote_name))
|
||||
{
|
||||
*out_value = g_strdup (default_value);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
remote = ost_repo_get_remote (self, remote_name, error);
|
||||
|
||||
if (remote != NULL)
|
||||
@@ -267,6 +279,12 @@ _ostree_repo_get_remote_list_option (OstreeRepo *self,
|
||||
local_cleanup_remote OstreeRemote *remote = NULL;
|
||||
gboolean ret = FALSE;
|
||||
|
||||
if (_ostree_repo_remote_name_is_file (remote_name))
|
||||
{
|
||||
*out_value = NULL;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
remote = ost_repo_get_remote (self, remote_name, error);
|
||||
|
||||
if (remote != NULL)
|
||||
@@ -304,6 +322,12 @@ _ostree_repo_get_remote_boolean_option (OstreeRepo *self,
|
||||
local_cleanup_remote OstreeRemote *remote = NULL;
|
||||
gboolean ret = FALSE;
|
||||
|
||||
if (_ostree_repo_remote_name_is_file (remote_name))
|
||||
{
|
||||
*out_value = default_value;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
remote = ost_repo_get_remote (self, remote_name, error);
|
||||
|
||||
if (remote != NULL)
|
||||
|
||||
Reference in new issue
Block a user