2 files changed
@@ -105,6 +105,21 @@ def test_it_ignores_false_kwargs(self, git): | |||
| 105 | 105 | self.git.version(pass_this_kwarg=False) | |
| 106 | 106 | assert_true("pass_this_kwarg" not in git.call_args[1]) | |
| 107 | 107 | ||
| 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': 'author@example.com', | ||
| 115 | + 'GIT_AUTHOR_DATE': '1400000000+0000', | ||
| 116 | + 'GIT_COMMITTER_NAME': 'Committer Name', | ||
| 117 | + 'GIT_COMMITTER_EMAIL': 'committer@example.com', | ||
| 118 | + 'GIT_COMMITTER_DATE': '1500000000+0000', | ||
| 119 | + } | ||
| 120 | + commit = self.git.commit_tree(tree, m='message', env=env) | ||
| 121 | + assert_equal(commit, '4cfd6b0314682d5a58f80be39850bad1640e9241') | ||
| 122 | + | ||
| 108 | 123 | def test_persistent_cat_file_command(self): | |
| 109 | 124 | # read header only | |
| 110 | 125 | import subprocess as sp | |
0 commit comments