summaryrefslogtreecommitdiff
path: root/git/index
diff options
context:
space:
mode:
authorSebastian Thiel <byronimo@gmail.com>2015-07-17 18:58:04 +0200
committerSebastian Thiel <byronimo@gmail.com>2015-07-17 18:58:04 +0200
commit58c78e649cbac271dee187b055335c876fcb1937 (patch)
tree5c30bdc8849ae56b887a1da500f7e775b656d582 /git/index
parentc3d33c113b1dfa4be7e3c9924fae029c178505c3 (diff)
parente3068025b64bee24efc1063aba5138708737c158 (diff)
downloadgitpython-58c78e649cbac271dee187b055335c876fcb1937.tar.gz
Merge pull request #317 from avinassh/dates-in-commits
Feature: Make commits with custom `author_date` and `commit_date` (closes #315)
Diffstat (limited to 'git/index')
-rw-r--r--git/index/base.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/git/index/base.py b/git/index/base.py
index f8696800..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):
+ 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 +933,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