summaryrefslogtreecommitdiff
path: root/src/ostree/ot-builtin-checkout.c
diff options
context:
space:
mode:
authorJasper St. Pierre <jstpierre@mecheye.net>2013-09-06 23:27:45 -0400
committerJasper St. Pierre <jstpierre@mecheye.net>2013-09-09 22:31:59 -0400
commit33db74d0ce0adbc790574351bb1d9d21f55edbda (patch)
tree4d4b61ccff992f6e1711b5f7dc5889905a5104cf /src/ostree/ot-builtin-checkout.c
parentac2d61dd515e547df6e1fc9e9d438783a201848d (diff)
downloadostree-33db74d0ce0adbc790574351bb1d9d21f55edbda.tar.gz
repo-file: Base OstreeRepoFile on trees instead of commits
We want an OstreeRepoFile to be the way to represent a filesystem tree inside an ostree repository. In order to do this, we need to drop the commit from an OstreeRepoFile, and make that go to callers. Switch all current users of ostree_repo_file_new_root to ostree_repo_read_commit, and make the actual constructor private. https://bugzilla.gnome.org/show_bug.cgi?id=707727
Diffstat (limited to 'src/ostree/ot-builtin-checkout.c')
-rw-r--r--src/ostree/ot-builtin-checkout.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/src/ostree/ot-builtin-checkout.c b/src/ostree/ot-builtin-checkout.c
index 873e2c5d..b2284b43 100644
--- a/src/ostree/ot-builtin-checkout.c
+++ b/src/ostree/ot-builtin-checkout.c
@@ -56,20 +56,19 @@ process_one_checkout (OstreeRepo *repo,
{
gboolean ret = FALSE;
GError *tmp_error = NULL;
- gs_unref_object OstreeRepoFile *root = NULL;
- gs_unref_object OstreeRepoFile *subtree = NULL;
+ gs_unref_object GFile *root = NULL;
+ gs_unref_object GFile *subtree = NULL;
gs_unref_object GFileInfo *file_info = NULL;
- root = (OstreeRepoFile*)ostree_repo_file_new_root (repo, resolved_commit);
- if (!ostree_repo_file_ensure_resolved (root, error))
+ if (!ostree_repo_read_commit (repo, resolved_commit, &root, cancellable, error))
goto out;
-
+
if (subpath)
- subtree = (OstreeRepoFile*)g_file_resolve_relative_path ((GFile*)root, subpath);
+ subtree = g_file_resolve_relative_path (root, subpath);
else
subtree = g_object_ref (root);
- file_info = g_file_query_info ((GFile*)subtree, OSTREE_GIO_FAST_QUERYINFO,
+ file_info = g_file_query_info (subtree, OSTREE_GIO_FAST_QUERYINFO,
G_FILE_QUERY_INFO_NOFOLLOW_SYMLINKS,
cancellable, &tmp_error);
if (!file_info)
@@ -89,7 +88,7 @@ process_one_checkout (OstreeRepo *repo,
if (!ostree_repo_checkout_tree (repo, opt_user_mode ? OSTREE_REPO_CHECKOUT_MODE_USER : 0,
opt_union ? OSTREE_REPO_CHECKOUT_OVERWRITE_UNION_FILES : 0,
- target, subtree, file_info, cancellable, error))
+ target, OSTREE_REPO_FILE (subtree), file_info, cancellable, error))
goto out;
ret = TRUE;