diff options
author | Giuseppe Scrivano <gscrivan@redhat.com> | 2014-10-23 15:38:44 +0200 |
---|---|---|
committer | Colin Walters <walters@verbum.org> | 2014-10-24 11:18:45 -0400 |
commit | 7973a58607ebb8be9e75cbad71c02ac1b2f9c752 (patch) | |
tree | 7820bdc00e2bfcdd679aa0ecb9f7e599711131e8 /src/libostree/ostree-repo-checkout.c | |
parent | 0c89abee6d1142b6b20ba2539eceece2cbd3b9eb (diff) | |
download | ostree-7973a58607ebb8be9e75cbad71c02ac1b2f9c752.tar.gz |
checkout: permit checkout of a single file
fixes a coredump when using a command like:
$ ostree --repo=repo checkout -U --subpath=/usr/lib/passwd \
fedora-atomic/rawhide/x86_64/docker-host usrlib-new
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
Diffstat (limited to 'src/libostree/ostree-repo-checkout.c')
-rw-r--r-- | src/libostree/ostree-repo-checkout.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/libostree/ostree-repo-checkout.c b/src/libostree/ostree-repo-checkout.c index 29639963..03efd601 100644 --- a/src/libostree/ostree-repo-checkout.c +++ b/src/libostree/ostree-repo-checkout.c @@ -587,6 +587,16 @@ checkout_tree_at (OstreeRepo *self, } } + if (g_file_info_get_file_type (source_info) != G_FILE_TYPE_DIRECTORY) + { + ret = checkout_one_file_at (self, (GFile *) source, + source_info, + destination_dfd, destination, + g_file_info_get_name (source_info), + mode, TRUE, + cancellable, error); + goto out; + } dir_enum = g_file_enumerate_children ((GFile*)source, OSTREE_GIO_FAST_QUERYINFO, G_FILE_QUERY_INFO_NOFOLLOW_SYMLINKS, |