diff options
author | Sebastian Thiel <byronimo@gmail.com> | 2017-09-28 15:45:34 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-09-28 15:45:34 +0200 |
commit | ddb828ecd0e28d346934fd1838a5f1c74363fba6 (patch) | |
tree | 1e07af3b22ba20b59dadd4a5b8008a3217c40bb5 /git/test | |
parent | 2eb6cf0855232da2b8f37785677d1f58c8e86817 (diff) | |
parent | 2e482a20ab221cb6eca51f12f1bd29cda4eec484 (diff) | |
download | gitpython-ddb828ecd0e28d346934fd1838a5f1c74363fba6.tar.gz |
Merge pull request #645 from AJMansfield/master
Implemented Per-Call Environment Variables
Diffstat (limited to 'git/test')
-rw-r--r-- | git/test/fixtures/ls_tree_empty | 0 | ||||
-rw-r--r-- | git/test/test_git.py | 15 |
2 files changed, 15 insertions, 0 deletions
diff --git a/git/test/fixtures/ls_tree_empty b/git/test/fixtures/ls_tree_empty new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/git/test/fixtures/ls_tree_empty diff --git a/git/test/test_git.py b/git/test/test_git.py index 00577e33..0a0d7ef7 100644 --- a/git/test/test_git.py +++ b/git/test/test_git.py @@ -106,6 +106,21 @@ class TestGit(TestBase): 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 |