def get_commit(self, rev):
        """Get commit object identified by `rev` (SHA or branch or tag name)."""
        for prefix in ['refs/heads/', 'refs/tags/', '']:
            key = prefix + rev
            try:
                obj = self[encode_for_git(key)]
                if isinstance(obj, dulwich.objects.Tag):
                    obj = self[obj.object[1]]
                return obj
            except __HOLE__:
                pass
        raise KeyError(rev)
dataset/ETHPy150Open jonashaag/klaus/klaus/repo.py/FancyRepo.get_commit