diff options
author | Marc Cornellà <marc.cornella@live.com> | 2019-04-10 20:30:30 +0200 |
---|---|---|
committer | Marc Cornellà <marc.cornella@live.com> | 2019-04-10 20:30:30 +0200 |
commit | 3c8f73c312d1639826a3a5cc499197f423508833 (patch) | |
tree | 8b77e329fa7300fe5558a5a35cf56f3195b396f2 /plugins | |
parent | 7824dc637db296aebc88263d9f5a3ea36fd50bb5 (diff) | |
download | zsh-3c8f73c312d1639826a3a5cc499197f423508833.tar.gz zsh-3c8f73c312d1639826a3a5cc499197f423508833.tar.bz2 zsh-3c8f73c312d1639826a3a5cc499197f423508833.zip |
git-prompt: fix LANG override for git status call
The previous version modified the whole environment leading to
problems (see #7757). This version *adds* LANG=C to the current
env, without overriding it completely.
Fixes #7757.
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/git-prompt/gitstatus.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/plugins/git-prompt/gitstatus.py b/plugins/git-prompt/gitstatus.py index 5243af23c..390a50a6f 100644 --- a/plugins/git-prompt/gitstatus.py +++ b/plugins/git-prompt/gitstatus.py @@ -1,6 +1,7 @@ #!/usr/bin/env python from __future__ import print_function +import os import sys import re import shlex @@ -30,7 +31,7 @@ def get_tagname_or_hash(): # `git status --porcelain --branch` can collect all information # branch, remote_branch, untracked, staged, changed, conflicts, ahead, behind -po = Popen(['git', 'status', '--porcelain', '--branch'], env={"LANG": "C"}, stdout=PIPE, stderr=PIPE) +po = Popen(['git', 'status', '--porcelain', '--branch'], env=dict(os.environ, LANG="C"), stdout=PIPE, stderr=PIPE) stdout, sterr = po.communicate() if po.returncode != 0: sys.exit(0) # Not a git repository |