repo.py 文件源码

python
阅读 27 收藏 0 点赞 0 评论 0

项目:github-reviewboard-sync 作者: Apptimize-OSS 项目源码 文件源码
def _get_remote(repo, name):
    """
    Gets the remote object raising a MissingRemoteException
    when it does not exist

    :param Repo repo:
    :param unicode name: The remote name
    :return: The remote object
    :rtype: git.remote.Remote
    :raises: MissingRemoteException
    """
    try:
        return repo.remotes[name]
    except IndexError:  # I have no idea why they raise an IndexError instead of KeyError
        raise MissingRemoteException('The remote "{0}" does not exist.  '
                                     'Please select a different remote or'
                                     ' add it using "git remote add" command')
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号