diff options
author | firm1 <dralliw@users.noreply.github.com> | 2014-03-24 14:52:44 +0100 |
---|---|---|
committer | firm1 <dralliw@users.noreply.github.com> | 2014-03-24 14:52:44 +0100 |
commit | 5d602f267c32e1e917599d9bcdcfec4eef05d477 (patch) | |
tree | 6e694f5a413938a50b7d73a58059e9c75c3f2dc2 /git/objects/commit.py | |
parent | 9d0473c1d1e6cadd986102712fff9196fff96212 (diff) | |
download | gitpython-5d602f267c32e1e917599d9bcdcfec4eef05d477.tar.gz |
add param to create_from_tree
Diffstat (limited to 'git/objects/commit.py')
-rw-r--r-- | git/objects/commit.py | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/git/objects/commit.py b/git/objects/commit.py index cbfd5097..f1c2a23d 100644 --- a/git/objects/commit.py +++ b/git/objects/commit.py @@ -254,7 +254,7 @@ class Commit(base.Object, Iterable, Diffable, Traversable, Serializable): @classmethod - def create_from_tree(cls, repo, tree, message, parent_commits=None, head=False): + def create_from_tree(cls, repo, tree, message, parent_commits=None, head=False, author=None, committer=None): """Commit the given tree, creating a commit object. :param repo: Repo object the commit should be part of @@ -299,8 +299,13 @@ class Commit(base.Object, Iterable, Diffable, Traversable, Serializable): cr = repo.config_reader() env = os.environ - committer = Actor.committer(cr) - author = Actor.author(cr) + if author is None and committer is None: + committer = Actor.committer(cr) + author = Actor.author(cr) + elif author is None: + author = Actor.author(cr) + elif committer is None: + committer = Actor.committer(cr) # PARSE THE DATES unix_time = int(time()) |