Skip to content

Commit 32e4e08

Browse files
committed
fix(git-cmd): use LC_ALL instead of LC_MESSAGES
Previously, only program messages where forced to the C-locale, now we force the entire program. That way, we should assure a remote will not provide us with branch information in any other language but english. Related to #290
1 parent 1199f90 commit 32e4e08

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

git/cmd.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -530,7 +530,7 @@ def execute(self, command,
530530
* output_stream if extended_output = False
531531
* tuple(int(status), output_stream, str(stderr)) if extended_output = True
532532
533-
Note git is executed with LC_MESSAGES="C" to ensure consitent
533+
Note git is executed with LC_MESSAGES="C" to ensure consistent
534534
output regardless of system language.
535535
536536
:raise GitCommandError:
@@ -549,7 +549,9 @@ def execute(self, command,
549549

550550
# Start the process
551551
env = os.environ.copy()
552-
env["LC_MESSAGES"] = "C"
552+
# Attempt to force all output to plain ascii english, which is what some parsing code
553+
# may expect.
554+
env["LC_ALL"] = "C"
553555
env.update(self._environment)
554556

555557
if sys.platform == 'win32':

0 commit comments

Comments
 (0)