mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2024-11-11 00:10:08 +00:00
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.
This commit is contained in:
parent
7824dc637d
commit
3c8f73c312
1 changed files with 2 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue