Set LC_ALL=C to force branch output to English

master
Dan Nguyen 10 years ago
parent 00558b8de8
commit 7418da801d
  1. 3
      gitstatus.py
  2. 2
      gitstatus.sh

@ -74,7 +74,8 @@ def get_stash():
# `git status --porcelain --branch` can collect all information # `git status --porcelain --branch` can collect all information
# branch, remote_branch, untracked, staged, changed, conflicts, ahead, behind # branch, remote_branch, untracked, staged, changed, conflicts, ahead, behind
po = Popen(['git', 'status', '--porcelain', '--branch'], stdout=PIPE, stderr=PIPE) po = Popen(['git', 'status', '--porcelain', '--branch'], env={'LC_ALL': 'C'},
stdout=PIPE, stderr=PIPE)
stdout, sterr = po.communicate() stdout, sterr = po.communicate()
if po.returncode != 0: if po.returncode != 0:
sys.exit(0) # Not a git repository sys.exit(0) # Not a git repository

@ -18,7 +18,7 @@ if [ -z "${__GIT_PROMPT_DIR}" ]; then
__GIT_PROMPT_DIR="$( cd -P "$( dirname "${SOURCE}" )" && pwd )" __GIT_PROMPT_DIR="$( cd -P "$( dirname "${SOURCE}" )" && pwd )"
fi fi
gitstatus=`git status --porcelain --branch` gitstatus=`LC_ALL=C git status --porcelain --branch`
# if the status is fatal, exit now # if the status is fatal, exit now
[[ "$?" -ne 0 ]] && exit 0 [[ "$?" -ne 0 ]] && exit 0

Loading…
Cancel
Save