remote.py 文件源码

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

项目:guides-cms 作者: pluralsight 项目源码 文件源码
def repo_sha_from_github(repo, branch=u'master'):
    """
    Get sha from head of given repo

    :param repo: Path to repo (owner/repo_name)
    :param branch: Name of branch to get sha for
    :returns: Sha of branch
    """

    url = 'repos/%s/git/refs/heads/%s' % (repo, branch)
    app.logger.debug('GET: %s', url)

    resp = github.get(url)

    if resp.status != 200:
        log_error('Failed reading sha', url, resp, branch=branch)
        return None

    return resp.data['object']['sha']
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号