def set_repository(value):
    from pygit2 import discover_repository, Repository
    global _repository
    if value is None:
        _repository = None
        return
    try:
        path = discover_repository(value)
    except __HOLE__:
        raise GitError('no repository found in "{}"'.format(value))
    _repository = Repository(path)
dataset/ETHPy150Open natano/python-git-orm/git_orm/__init__.py/set_repository