Skip to content

Commit da09f02

Browse files
committed
Merge branch 'electrofelix-0.3-fix-env-usage' into 0.3
2 parents 2af9892 + 8df6b87 commit da09f02

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

git/cmd.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -341,8 +341,10 @@ def execute(self, command,
341341
cwd = self._working_dir
342342

343343
# Start the process
344+
env = os.environ.copy()
345+
env["LC_MESSAGES"] = "C"
344346
proc = Popen(command,
345-
env={"LC_MESSAGES": "C"},
347+
env=env,
346348
cwd=cwd,
347349
stdin=istream,
348350
stderr=PIPE,

git/test/test_git.py

+6
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
# the BSD License: http://www.opensource.org/licenses/bsd-license.php
66

77
import os
8+
import mock
89
from git.test.lib import (TestBase,
910
patch,
1011
raises,
@@ -128,3 +129,8 @@ def test_single_char_git_options_are_passed_to_git(self):
128129

129130
def test_change_to_transform_kwargs_does_not_break_command_options(self):
130131
self.git.log(n=1)
132+
133+
def test_env_vars_passed_to_git(self):
134+
editor = 'non_existant_editor'
135+
with mock.patch.dict('os.environ', {'GIT_EDITOR': editor}):
136+
assert self.git.var("GIT_EDITOR") == editor

0 commit comments

Comments
 (0)