Skip to content

Make a commit with another author #228

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Jan 7, 2015
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
add tests for commit by actor
  • Loading branch information
firm1 authored and firm1 committed Jan 7, 2015
commit 1dec7a822424bbe58b7b2a7787b1ea32683a9c19
16 changes: 16 additions & 0 deletions git/test/test_index.py
Original file line number Diff line number Diff line change
Expand Up @@ -444,6 +444,22 @@ def mixed_iterator():
assert new_commit.parents[0] == cur_commit
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", "[email protected]")
my_committer = Actor("An committer", "[email protected]")
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 == "[email protected]"
assert commit_actor.committer.name == "An committer"
assert commit_actor.committer.email == "[email protected]"
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"
Expand Down