- commit = lookup_commit_reference(oid.hash);
- read_tree_recursive(commit->tree, "", 0, 0, &paths, walk_tree, &walk_tree_ctx);
- type = sha1_object_info(oid.hash, &size);
+ commit = lookup_commit_reference(the_repository, &oid);
+ read_tree_recursive(the_repository,
+ repo_get_commit_tree(the_repository, commit),
+ "", 0, 0, &paths, walk_tree,
+ &walk_tree_ctx);
+ type = oid_object_info(the_repository, &oid, &size);