Allow usage of a python type instead of having to use the libgit2 constants.
This simplifies getting one type of object from a higher-level one as well as accepting a commit-ish or tree-ish.