Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
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
Empty file added git/test/fixtures/ls_tree_empty
Empty file.
15 changes: 15 additions & 0 deletions git/test/test_git.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,21 @@ def test_it_ignores_false_kwargs(self, git):
self.git.version(pass_this_kwarg=False)
assert_true("pass_this_kwarg" not in git.call_args[1])

def test_it_accepts_environment_variables(self):
filename = fixture_path("ls_tree_empty")
with open(filename, 'r') as fh:
tree = self.git.mktree(istream=fh)
env = {
'GIT_AUTHOR_NAME': 'Author Name',
'GIT_AUTHOR_EMAIL': 'author@example.com',
'GIT_AUTHOR_DATE': '1400000000+0000',
'GIT_COMMITTER_NAME': 'Committer Name',
'GIT_COMMITTER_EMAIL': 'committer@example.com',
'GIT_COMMITTER_DATE': '1500000000+0000',
}
commit = self.git.commit_tree(tree, m='message', env=env)
assert_equal(commit, '4cfd6b0314682d5a58f80be39850bad1640e9241')

def test_persistent_cat_file_command(self):
# read header only
import subprocess as sp
Expand Down