core: Fix "cat" crashing when it should have returned ENOENT
This commit is contained in:
parent
eb4302517f
commit
db93c43255
|
|
@ -992,6 +992,9 @@ ostree_repo_file_read (GFile *file,
|
||||||
OstreeRepoFile *self = OSTREE_REPO_FILE (file);
|
OstreeRepoFile *self = OSTREE_REPO_FILE (file);
|
||||||
const char *checksum;
|
const char *checksum;
|
||||||
|
|
||||||
|
if (!ostree_repo_file_ensure_resolved (self, error))
|
||||||
|
goto out;
|
||||||
|
|
||||||
if (self->tree_contents)
|
if (self->tree_contents)
|
||||||
{
|
{
|
||||||
g_set_error_literal (error, G_IO_ERROR,
|
g_set_error_literal (error, G_IO_ERROR,
|
||||||
|
|
|
||||||
|
|
@ -41,9 +41,6 @@ cat_one_file (GFile *f,
|
||||||
gboolean ret = FALSE;
|
gboolean ret = FALSE;
|
||||||
GInputStream *in = NULL;
|
GInputStream *in = NULL;
|
||||||
|
|
||||||
if (!ostree_repo_file_ensure_resolved ((OstreeRepoFile*)f, NULL))
|
|
||||||
g_assert_not_reached ();
|
|
||||||
|
|
||||||
in = (GInputStream*)g_file_read (f, cancellable, error);
|
in = (GInputStream*)g_file_read (f, cancellable, error);
|
||||||
if (!in)
|
if (!in)
|
||||||
goto out;
|
goto out;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue