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
This commit is contained in:
Jasper St. Pierre committed 2013-09-09 22:31:59 -04:00
1 parent ac2d61dd51
commit 33db74d0ce
7 files changed
+111 -119

No files matched your search

+7 -4
View File
@@ -1413,18 +1413,21 @@ ostree_repo_read_commit (OstreeRepo *self,
GError **error)
{
gboolean ret = FALSE;
gs_unref_object GFile *ret_root = NULL;
gs_unref_object OstreeRepoFile *ret_root = NULL;
gs_free char *resolved_rev = NULL;
if (!ostree_repo_resolve_rev (self, rev, FALSE, &resolved_rev, error))
goto out;
ret_root = ostree_repo_file_new_root (self, resolved_rev);
if (!ostree_repo_file_ensure_resolved ((OstreeRepoFile*)ret_root, error))
ret_root = _ostree_repo_file_new_for_commit (self, resolved_rev, error);
if (!ret_root)
goto out;
if (!ostree_repo_file_ensure_resolved (ret_root, error))
goto out;
ret = TRUE;
ot_transfer_out_value(out_root, &ret_root);
ot_transfer_out_value(out_root, (GFile **) &ret_root);
out:
return ret;
}