def _get_commit(self):
        """
        :return:
            Commit object we point to, works for detached and non-detached
            SymbolicReferences. The symbolic reference will be dereferenced recursively."""
        obj = self._get_object()
        if obj.type == 'tag':
            obj = obj.object
        # END dereference tag

        if obj.type != Commit.type:
            raise TypeError("Symbolic Reference pointed to object %r, commit was required" % obj)
        # END handle type
        return obj
dataset/ETHPy150Open gitpython-developers/GitPython/git/refs/symbolic.py/SymbolicReference._get_commit/original