Skip to content

Commit b755f52

Browse files
committed
Use C locale instead of en_US.UTF-8 to force English language
Some users reported that en_US.UTF-8 is not available on their systems, leading to warnings in the command log. "C" also forces the language to English, and is guaranteed to be available everywhere.
1 parent c31b604 commit b755f52

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

pkg/commands/git_commands/rebase.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -244,8 +244,8 @@ func (self *RebaseCommands) PrepareInteractiveRebaseCommand(opts PrepareInteract
244244

245245
cmdObj.AddEnvVars(
246246
"DEBUG="+debug,
247-
"LANG=en_US.UTF-8", // Force using EN as language
248-
"LC_ALL=en_US.UTF-8", // Force using EN as language
247+
"LANG=C", // Force using English language
248+
"LC_ALL=C", // Force using English language
249249
"GIT_SEQUENCE_EDITOR="+gitSequenceEditor,
250250
)
251251

@@ -277,8 +277,8 @@ func (self *RebaseCommands) GitRebaseEditTodo(todosFileContent []byte) error {
277277

278278
cmdObj.AddEnvVars(
279279
"DEBUG="+debug,
280-
"LANG=en_US.UTF-8", // Force using EN as language
281-
"LC_ALL=en_US.UTF-8", // Force using EN as language
280+
"LANG=C", // Force using English language
281+
"LC_ALL=C", // Force using English language
282282
"GIT_EDITOR="+ex,
283283
"GIT_SEQUENCE_EDITOR="+ex,
284284
)

pkg/commands/oscommands/cmd_obj_runner.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,7 @@ func (self *cmdObjRunner) runAndDetectCredentialRequest(
330330
promptUserForCredential func(CredentialType) <-chan string,
331331
) error {
332332
// setting the output to english so we can parse it for a username/password request
333-
cmdObj.AddEnvVars("LANG=en_US.UTF-8", "LC_ALL=en_US.UTF-8")
333+
cmdObj.AddEnvVars("LANG=C", "LC_ALL=C")
334334

335335
return self.runAndStreamAux(cmdObj, func(handler *cmdHandler, cmdWriter io.Writer) {
336336
tr := io.TeeReader(handler.stdoutPipe, cmdWriter)

0 commit comments

Comments
 (0)