From 7418da801dddd67a17d89fae587191aedf893b98 Mon Sep 17 00:00:00 2001 From: Dan Nguyen Date: Wed, 23 Sep 2015 09:22:56 -0500 Subject: [PATCH] Set LC_ALL=C to force branch output to English --- gitstatus.py | 3 ++- gitstatus.sh | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/gitstatus.py b/gitstatus.py index 3b12c3b..54ada71 100755 --- a/gitstatus.py +++ b/gitstatus.py @@ -74,7 +74,8 @@ def get_stash(): # `git status --porcelain --branch` can collect all information # 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() if po.returncode != 0: sys.exit(0) # Not a git repository diff --git a/gitstatus.sh b/gitstatus.sh index 0d58678..cea824a 100755 --- a/gitstatus.sh +++ b/gitstatus.sh @@ -18,7 +18,7 @@ if [ -z "${__GIT_PROMPT_DIR}" ]; then __GIT_PROMPT_DIR="$( cd -P "$( dirname "${SOURCE}" )" && pwd )" fi -gitstatus=`git status --porcelain --branch` +gitstatus=`LC_ALL=C git status --porcelain --branch` # if the status is fatal, exit now [[ "$?" -ne 0 ]] && exit 0