pull: Cleanly error when doing local pulls of remote-prefixed refs
In the storage PR I was trying to do a `pull-local` of the whole `/ostree/repo` on the system, which ended up triggering a `g_critical()` in the collections code, since we tried to parse a remote-prefixed ref `fedora:fedora/26/x86_64/atomic-host` as a ref. I'm not sure offhand what our behavior in this case *should* be. I think git only clones local refs, but I need to check. This corner case arises only with `pull-local`. But in any case, while we were previously saying this is programmer error, since it's so easy to pass various unchecked input into the pull machinery, make invalid refs an explicit error. Closes: #992 Approved by: jlebon
This commit is contained in:
1 parent
1f5ce1a9f7
commit
3234295324
2 files changed
+23
-1
No files matched your search
@@ -3561,6 +3561,8 @@ ostree_repo_pull_with_options (OstreeRepo *self,
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!ostree_validate_rev (branch, error))
|
||||
goto out;
|
||||
char *commitid = commitid_strviter ? g_strdup (*commitid_strviter) : NULL;
|
||||
g_hash_table_insert (requested_refs_to_fetch,
|
||||
ostree_collection_ref_new (NULL, branch), commitid);
|
||||
|
||||
Reference in new issue
Block a user