Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit5d602f2

Browse files
committed
add param to create_from_tree
1 parent9d0473c commit5d602f2

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

‎git/objects/commit.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ def _iter_from_process_or_stream(cls, repo, proc_or_stream):
254254

255255

256256
@classmethod
257-
defcreate_from_tree(cls,repo,tree,message,parent_commits=None,head=False):
257+
defcreate_from_tree(cls,repo,tree,message,parent_commits=None,head=False,author=None,committer=None):
258258
"""Commit the given tree, creating a commit object.
259259
260260
:param repo: Repo object the commit should be part of
@@ -299,8 +299,13 @@ def create_from_tree(cls, repo, tree, message, parent_commits=None, head=False):
299299
cr=repo.config_reader()
300300
env=os.environ
301301

302-
committer=Actor.committer(cr)
303-
author=Actor.author(cr)
302+
ifauthorisNoneandcommitterisNone:
303+
committer=Actor.committer(cr)
304+
author=Actor.author(cr)
305+
elifauthorisNone:
306+
author=Actor.author(cr)
307+
elifcommitterisNone:
308+
committer=Actor.committer(cr)
304309

305310
# PARSE THE DATES
306311
unix_time=int(time())

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp