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

Lines changed: 3 additions & 1 deletion
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

Lines changed: 6 additions & 0 deletions
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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy