From 141b78f42c7a3c1da1e5d605af3fc56aceb921ab Mon Sep 17 00:00:00 2001 From: avi Date: Fri, 17 Jul 2015 21:58:55 +0530 Subject: Added two extra paramaters for commit to take author date and commit date --- git/index/base.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'git/index') diff --git a/git/index/base.py b/git/index/base.py index f8696800..78120da3 100644 --- a/git/index/base.py +++ b/git/index/base.py @@ -922,7 +922,7 @@ class IndexFile(LazyMixin, diff.Diffable, Serializable): return out - def commit(self, message, parent_commits=None, head=True, author=None, committer=None): + def commit(self, message, parent_commits=None, head=True, author=None, committer=None, author_date=None, commit_date=None): """Commit the current default index file, creating a commit object. For more information on the arguments, see tree.commit. @@ -932,7 +932,8 @@ class IndexFile(LazyMixin, diff.Diffable, Serializable): run_commit_hook('pre-commit', self) tree = self.write_tree() rval = Commit.create_from_tree(self.repo, tree, message, parent_commits, - head, author=author, committer=committer) + head, author=author, committer=committer, + author_date=author_date, commit_date=commit_date) run_commit_hook('post-commit', self) return rval -- cgit v1.2.1 From e3068025b64bee24efc1063aba5138708737c158 Mon Sep 17 00:00:00 2001 From: avi Date: Fri, 17 Jul 2015 22:18:46 +0530 Subject: added tests for commits with dates --- git/index/base.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'git/index') diff --git a/git/index/base.py b/git/index/base.py index 78120da3..b955dae4 100644 --- a/git/index/base.py +++ b/git/index/base.py @@ -922,7 +922,8 @@ class IndexFile(LazyMixin, diff.Diffable, Serializable): return out - def commit(self, message, parent_commits=None, head=True, author=None, committer=None, author_date=None, commit_date=None): + def commit(self, message, parent_commits=None, head=True, author=None, + committer=None, author_date=None, commit_date=None): """Commit the current default index file, creating a commit object. For more information on the arguments, see tree.commit. -- cgit v1.2.1