本文整理汇总了Python中git.Commit.new方法的典型用法代码示例。如果您正苦于以下问题:Python Commit.new方法的具体用法?Python Commit.new怎么用?Python Commit.new使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类git.Commit
的用法示例。
在下文中一共展示了Commit.new方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: commit
# 需要导入模块: from git import Commit [as 别名]
# 或者: from git.Commit import new [as 别名]
def commit(self, commit, message):
"""Commits files given a commit message and a given commit"""
self.repo.git.commit()
class CommitFile(object):
"""Holds some information about a file in addition to its diff"""
def __init__(self):
self.isUntracked = None
self.isRenamed = None
self.diff = None
self.lineNumbers = None
#self.
def setDiff(self, diff):
""""""
self.diff = diff
if __name__ == "__main__":
x = GitManager('')
print x.grabUntrackedFiles()
print x.grabAllFilesToBeCommited()
commit = Commit.new(x.repo, x.repo.head.ref)
print commit
print commit.author
print commit.committer
print dir(commit.stats)
print commit.stats.files
#print x.createCommitForPartialFiles()
#print commit.diff(None, None)
#print x.repo.commit().diff(None, None)[1].a_blob.path