summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Thiel <byronimo@gmail.com>2014-11-17 17:54:18 +0100
committerSebastian Thiel <byronimo@gmail.com>2014-11-17 17:54:18 +0100
commitda09f02e67cb18e2c5312b9a36d2891b80cd9dcd (patch)
treeb1d2282d0f8a2c221a61297d302668e8553c299d
parent2af98929bd185cf1b4316391078240f337877f66 (diff)
parent8df6b87a793434065cd9a01fcaa812e3ea47c4dd (diff)
downloadgitpython-da09f02e67cb18e2c5312b9a36d2891b80cd9dcd.tar.gz
Merge branch 'electrofelix-0.3-fix-env-usage' into 0.3
-rw-r--r--git/cmd.py4
-rw-r--r--git/test/test_git.py6
2 files changed, 9 insertions, 1 deletions
diff --git a/git/cmd.py b/git/cmd.py
index 9cc6b1fa..f97dd3f6 100644
--- a/git/cmd.py
+++ b/git/cmd.py
@@ -341,8 +341,10 @@ class Git(LazyMixin):
cwd = self._working_dir
# Start the process
+ env = os.environ.copy()
+ env["LC_MESSAGES"] = "C"
proc = Popen(command,
- env={"LC_MESSAGES": "C"},
+ env=env,
cwd=cwd,
stdin=istream,
stderr=PIPE,
diff --git a/git/test/test_git.py b/git/test/test_git.py
index 49c256ca..063a4d38 100644
--- a/git/test/test_git.py
+++ b/git/test/test_git.py
@@ -5,6 +5,7 @@
# the BSD License: http://www.opensource.org/licenses/bsd-license.php
import os
+import mock
from git.test.lib import (TestBase,
patch,
raises,
@@ -128,3 +129,8 @@ class TestGit(TestBase):
def test_change_to_transform_kwargs_does_not_break_command_options(self):
self.git.log(n=1)
+
+ def test_env_vars_passed_to_git(self):
+ editor = 'non_existant_editor'
+ with mock.patch.dict('os.environ', {'GIT_EDITOR': editor}):
+ assert self.git.var("GIT_EDITOR") == editor