def get_commit(self, rev):
        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 KeyError:
                pass
        raise KeyError(rev)
Get commit object identified by `rev` (SHA or branch or tag name).
dataset/ETHPy150Open jonashaag/klaus/klaus/repo.py/FancyRepo.get_commit