Lookup a tree object from the repository. The generated tree object is owned by the revision repo and shall not be freed by the user.
pointer to the looked up tree
the repo to use when locating the tree.
identity of the tree to locate.
0 on success; error code otherwise