def to_commit(obj):
    if obj.type == 'tag':
        obj = deref_tag(obj)

    if obj.type != "commit":
        raise ValueError("Cannot convert object %r to type commit" % obj)
    # END verify type
    return obj
Convert the given object to a commit if possible and return it
dataset/ETHPy150Open gitpython-developers/GitPython/git/repo/fun.py/to_commit