summaryrefslogtreecommitdiff
path: root/git/test/test_index.py
diff options
context:
space:
mode:
authorSebastian Thiel <byronimo@gmail.com>2015-01-07 14:44:02 +0100
committerSebastian Thiel <byronimo@gmail.com>2015-01-07 14:44:02 +0100
commit73790919dbe038285a3612a191c377bc27ae6170 (patch)
treeced3af491a2b4354c15fb161102e9704d180d8d4 /git/test/test_index.py
parent45eb728554953fafcee2aab0f76ca65e005326b0 (diff)
parentb6ed8d46c72366e111b9a97a7c238ef4af3bf4dc (diff)
downloadgitpython-73790919dbe038285a3612a191c377bc27ae6170.tar.gz
Merge branch 'commit_by_actor' of https://github.com/firm1/GitPython into firm1-commit_by_actor
Diffstat (limited to 'git/test/test_index.py')
-rw-r--r--git/test/test_index.py17
1 files changed, 17 insertions, 0 deletions
diff --git a/git/test/test_index.py b/git/test/test_index.py
index f7504b32..f7d1cc6a 100644
--- a/git/test/test_index.py
+++ b/git/test/test_index.py
@@ -10,6 +10,7 @@ from git.test.lib import (
fixture,
with_rw_repo
)
+from git.util import Actor
from git import (
IndexFile,
BlobFilter,
@@ -445,6 +446,22 @@ class TestIndex(TestBase):
assert len(new_commit.parents) == 1
assert cur_head.commit == cur_commit
+ # commit with other actor
+ cur_commit = cur_head.commit
+
+ my_author = Actor("An author", "author@example.com")
+ my_committer = Actor("An committer", "committer@example.com")
+ commit_actor = index.commit(commit_message, author=my_author, committer=my_committer)
+ assert cur_commit != commit_actor
+ assert commit_actor.author.name == "An author"
+ assert commit_actor.author.email == "author@example.com"
+ assert commit_actor.committer.name == "An committer"
+ assert commit_actor.committer.email == "committer@example.com"
+ assert commit_actor.message == commit_message
+ assert commit_actor.parents[0] == cur_commit
+ assert len(new_commit.parents) == 1
+ assert cur_head.commit == cur_commit
+
# same index, no parents
commit_message = "index without parents"
commit_no_parents = index.commit(commit_message, parent_commits=list(), head=True)