traverse: Require variant when traversing dirtree

The dirtree object is required for traversing, so don't use the
load_variant_if_exists() function. This will return a
G_IO_ERROR_NOT_FOUND to the caller rather than trying to ref a NULL
variant in ostree_repo_commit_traverse_iter_init_dirtree() if the object
is missing.

https://bugzilla.gnome.org/show_bug.cgi?id=764091
This commit is contained in:
Dan Nicholson 2016-03-23 09:32:29 -07:00 committed by Colin Walters
parent 7232b2940b
commit 7524e904b9

View File

@ -377,9 +377,8 @@ traverse_dirtree (OstreeRepo *repo,
ostree_cleanup_repo_commit_traverse_iter
OstreeRepoCommitTraverseIter iter = { 0, };
if (!ostree_repo_load_variant_if_exists (repo, OSTREE_OBJECT_TYPE_DIR_TREE,
checksum, &dirtree,
error))
if (!ostree_repo_load_variant (repo, OSTREE_OBJECT_TYPE_DIR_TREE, checksum,
&dirtree, error))
goto out;
if (!ostree_repo_commit_traverse_iter_init_dirtree (&iter, repo, dirtree,