core: Look up refs like origin/foo correctly again

We want to support both "bare" lookups where "foo" can be local, or in
any remote, as well as prefixed ones for a specific remote.

This fixes ostree-pull noticing that nothing has changed.
This commit is contained in:
Colin Walters committed 2012-02-24 16:08:34 -05:00
1 parent a90e091037
commit 51916a7002
2 files changed
+16 -11

No files matched your search

+16 -9
View File
@@ -384,19 +384,26 @@ ostree_repo_resolve_rev (OstreeRepo *self,
{
g_clear_object (&child);
if (!find_rev_in_remotes (self, rev, &child, error))
goto out;
child = g_file_resolve_relative_path (priv->remote_heads_dir, rev);
if (child == NULL)
if (!g_file_query_exists (child, NULL))
{
if (!allow_noent)
g_clear_object (&child);
if (!find_rev_in_remotes (self, rev, &child, error))
goto out;
if (child == NULL)
{
g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED,
"Rev '%s' not found", rev);
goto out;
if (!allow_noent)
{
g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED,
"Rev '%s' not found", rev);
goto out;
}
else
g_clear_object (&child);
}
else
g_clear_object (&child);
}
}