repo_scan.py 文件源码

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

项目:spdx-github 作者: spdx 项目源码 文件源码
def commit_file(file_name, repo, environment):
    #The index of the repo is used to add the spdx file to be committed.
    index = repo.index
    #Add the SPDX file to be committed
    index.add([file_name])
    repo.git.add(file_name)
    #Set the author, committer, and commit message.
    author = Actor(environment['git_name'], environment['git_email'])
    committer = Actor(environment['git_name'], environment['git_email'])
    commit_message = environment['git_commit_message']
    #Get the head commit
    head_commit = str(repo.head.commit)
    #Make the commit locally of the new SPDX file
    index.commit(commit_message, author=author, committer=committer)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号