

def get_remote():
    repo_check(require_remote=True)
    reader = repo.config_reader()
    if (not reader.has_option('legit', 'remote')):
        return repo.remotes[0]
    remote_name = reader.get('legit', 'remote')
    if (not (remote_name in [r.name for r in repo.remotes])):
        raise ValueError('Remote "{0}" does not exist! Please update your git configuration.'.format(remote_name))
    return repo.remote(remote_name)

dataset/ETHPy150Open kennethreitz/legit/legit/scm.py get_remote/original