extensions.py 文件源码

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

项目:mimiron 作者: ImageIntelligence 项目源码 文件源码
def commit_changes(repo, commit_message):
    """Commits all changes (staged and untracked) in a single commit.

    Args:
        repo (git.objects.Repo): The git repository to commit changes to
        commit_message (str): The commit message to use

    Returns:
        bool: True if a commit was made, False otherwise

    """
    if not repo.is_dirty():
        return False

    repo.git.add(u=True)
    actor = Actor(const.COMMIT_AUTHOR_NAME, email=const.COMMIT_AUTHOR_EMAIL)
    commit = repo.index.commit(commit_message, author=actor, committer=actor)

    io.info('commit message: "%s"' % (commit_message.split('\n')[0]),)
    io.info('created commit: (id) %s' % (commit.name_rev,))
    return True
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号