diff options
author | Darragh Bailey <dbailey@hp.com> | 2014-11-17 15:58:04 +0000 |
---|---|---|
committer | Darragh Bailey <dbailey@hp.com> | 2014-11-17 16:30:07 +0000 |
commit | 8df6b87a793434065cd9a01fcaa812e3ea47c4dd (patch) | |
tree | b1d2282d0f8a2c221a61297d302668e8553c299d /git/cmd.py | |
parent | 2af98929bd185cf1b4316391078240f337877f66 (diff) | |
download | gitpython-8df6b87a793434065cd9a01fcaa812e3ea47c4dd.tar.gz |
Copy environment for subprocess execution
Git utilizes multiple environment variables to control various
behaviours. Make sure to set LC_MESSAGES on a copy of the environment
instead of discarding any variables that may be set by the user or
default shell environment such as EDITOR.
Add test to assert that when overriding GIT_EDITOR via os.environ that
the modified value will be picked up by and git commands called.
Diffstat (limited to 'git/cmd.py')
-rw-r--r-- | git/cmd.py | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -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, |