From 889aeef9945f0cb71dbb13cc9523d8d1073aabc3 Mon Sep 17 00:00:00 2001 From: "juanse254@gitlab.com" Date: Tue, 23 Apr 2019 17:53:17 +0200 Subject: [PATCH 1/2] fixed issue with passed date parameter --- git/objects/commit.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/git/objects/commit.py b/git/objects/commit.py index 9736914af..556335a82 100644 --- a/git/objects/commit.py +++ b/git/objects/commit.py @@ -81,7 +81,7 @@ def __init__(self, repo, binsha, tree=None, author=None, authored_date=None, aut :param tree: Tree Tree object :param author: Actor - is the author Actor object + is the author string ( will be implicitly converted into an Actor object ) :param authored_date: int_seconds_since_epoch is the authored DateTime - use time.gmtime() to convert it into a different format @@ -280,7 +280,7 @@ def _iter_from_process_or_stream(cls, repo, proc_or_stream): @classmethod def create_from_tree(cls, repo, tree, message, parent_commits=None, head=False, author=None, committer=None, - author_date=None, commit_date=None): + author_date=None, commit_date=None, author_timezone=None): """Commit the given tree, creating a commit object. :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, author_date_str = env.get(cls.env_author_date, '') if author_date: - author_time, author_offset = parse_date(author_date) + author_time, author_offset = author_date, author_timezone elif author_date_str: author_time, author_offset = parse_date(author_date_str) else: @@ -354,7 +354,7 @@ def create_from_tree(cls, repo, tree, message, parent_commits=None, head=False, committer_date_str = env.get(cls.env_committer_date, '') if commit_date: - committer_time, committer_offset = parse_date(commit_date) + committer_time, committer_offset = commit_date, author_timezone elif committer_date_str: committer_time, committer_offset = parse_date(committer_date_str) else: @@ -530,4 +530,4 @@ def _deserialize(self, stream): return self - #} END serializable implementation + #} END serializable implementation \ No newline at end of file From 36fd4fac60129ab7873f07e4785eab91d70b3bee Mon Sep 17 00:00:00 2001 From: Nicolas Gordillo Date: Tue, 9 Jul 2019 20:43:58 +0200 Subject: [PATCH 2/2] with committer time --- git/objects/commit.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/git/objects/commit.py b/git/objects/commit.py index 556335a82..9cae47cff 100644 --- a/git/objects/commit.py +++ b/git/objects/commit.py @@ -280,7 +280,7 @@ def _iter_from_process_or_stream(cls, repo, proc_or_stream): @classmethod def create_from_tree(cls, repo, tree, message, parent_commits=None, head=False, author=None, committer=None, - author_date=None, commit_date=None, author_timezone=None): + author_date=None, commit_date=None, author_timezone=None, committer_timezone=None): """Commit the given tree, creating a commit object. :param repo: Repo object the commit should be part of @@ -354,7 +354,7 @@ def create_from_tree(cls, repo, tree, message, parent_commits=None, head=False, committer_date_str = env.get(cls.env_committer_date, '') if commit_date: - committer_time, committer_offset = commit_date, author_timezone + committer_time, committer_offset = commit_date, committer_timezone elif committer_date_str: committer_time, committer_offset = parse_date(committer_date_str) else: @@ -530,4 +530,4 @@ def _deserialize(self, stream): return self - #} END serializable implementation \ No newline at end of file + #} END serializable implementation