Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 889aeef

Browse files
committed
fixed issue with passed date parameter
1 parent 1f66e25 commit 889aeef

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

git/objects/commit.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ def __init__(self, repo, binsha, tree=None, author=None, authored_date=None, aut
8181
:param tree: Tree
8282
Tree object
8383
:param author: Actor
84-
is the author Actor object
84+
is the author string ( will be implicitly converted into an Actor object )
8585
:param authored_date: int_seconds_since_epoch
8686
is the authored DateTime - use time.gmtime() to convert it into a
8787
different format
@@ -280,7 +280,7 @@ def _iter_from_process_or_stream(cls, repo, proc_or_stream):
280280

281281
@classmethod
282282
def create_from_tree(cls, repo, tree, message, parent_commits=None, head=False, author=None, committer=None,
283-
author_date=None, commit_date=None):
283+
author_date=None, commit_date=None, author_timezone=None):
284284
"""Commit the given tree, creating a commit object.
285285
286286
:param repo: Repo object the commit should be part of
@@ -345,7 +345,7 @@ def create_from_tree(cls, repo, tree, message, parent_commits=None, head=False,
345345

346346
author_date_str = env.get(cls.env_author_date, '')
347347
if author_date:
348-
author_time, author_offset = parse_date(author_date)
348+
author_time, author_offset = author_date, author_timezone
349349
elif author_date_str:
350350
author_time, author_offset = parse_date(author_date_str)
351351
else:
@@ -354,7 +354,7 @@ def create_from_tree(cls, repo, tree, message, parent_commits=None, head=False,
354354

355355
committer_date_str = env.get(cls.env_committer_date, '')
356356
if commit_date:
357-
committer_time, committer_offset = parse_date(commit_date)
357+
committer_time, committer_offset = commit_date, author_timezone
358358
elif committer_date_str:
359359
committer_time, committer_offset = parse_date(committer_date_str)
360360
else:
@@ -530,4 +530,4 @@ def _deserialize(self, stream):
530530

531531
return self
532532

533-
#} END serializable implementation
533+
#} END serializable implementation

0 commit comments

Comments
 (0)