Skip to content

Commit a99953c

Browse files
committed
Merge branch 'tests'
2 parents 24d4926 + 67260a3 commit a99953c

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

Diff for: git/test/fixtures/ls_tree_empty

Whitespace-only changes.

Diff for: git/test/test_git.py

+15
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,21 @@ def test_it_ignores_false_kwargs(self, git):
105105
self.git.version(pass_this_kwarg=False)
106106
assert_true("pass_this_kwarg" not in git.call_args[1])
107107

108+
def test_it_accepts_environment_variables(self):
109+
filename = fixture_path("ls_tree_empty")
110+
with open(filename, 'r') as fh:
111+
tree = self.git.mktree(istream=fh)
112+
env = {
113+
'GIT_AUTHOR_NAME': 'Author Name',
114+
'GIT_AUTHOR_EMAIL': '[email protected]',
115+
'GIT_AUTHOR_DATE': '1400000000+0000',
116+
'GIT_COMMITTER_NAME': 'Committer Name',
117+
'GIT_COMMITTER_EMAIL': '[email protected]',
118+
'GIT_COMMITTER_DATE': '1500000000+0000',
119+
}
120+
commit = self.git.commit_tree(tree, m='message', env=env)
121+
assert_equal(commit, '4cfd6b0314682d5a58f80be39850bad1640e9241')
122+
108123
def test_persistent_cat_file_command(self):
109124
# read header only
110125
import subprocess as sp

0 commit comments

Comments
 (0)