mirror of
https://github.com/sourcegit-scm/sourcegit
synced 2025-05-21 04:04:59 +00:00
fix: Force English locale in branch query command. (#1078)
This commit is contained in:
parent
b4fbc2372b
commit
860f52153b
3 changed files with 15 additions and 4 deletions
|
@ -37,6 +37,7 @@ namespace SourceGit.Commands
|
||||||
public string Args { get; set; } = string.Empty;
|
public string Args { get; set; } = string.Empty;
|
||||||
public bool RaiseError { get; set; } = true;
|
public bool RaiseError { get; set; } = true;
|
||||||
public bool TraitErrorAsOutput { get; set; } = false;
|
public bool TraitErrorAsOutput { get; set; } = false;
|
||||||
|
protected bool ForceEnglishLocale { get; set; } = false;
|
||||||
|
|
||||||
public bool Exec()
|
public bool Exec()
|
||||||
{
|
{
|
||||||
|
@ -193,8 +194,11 @@ namespace SourceGit.Commands
|
||||||
start.Environment.Add("GIT_SSH_COMMAND", $"ssh -i '{SSHKey}'");
|
start.Environment.Add("GIT_SSH_COMMAND", $"ssh -i '{SSHKey}'");
|
||||||
|
|
||||||
// Force using en_US.UTF-8 locale to avoid GCM crash
|
// Force using en_US.UTF-8 locale to avoid GCM crash
|
||||||
if (OperatingSystem.IsLinux())
|
if (ForceEnglishLocale || OperatingSystem.IsLinux())
|
||||||
start.Environment.Add("LANG", "en_US.UTF-8");
|
{
|
||||||
|
start.Environment.Add("LANG", "C");
|
||||||
|
start.Environment.Add("LC_ALL", "C");
|
||||||
|
}
|
||||||
|
|
||||||
// Fix macOS `PATH` env
|
// Fix macOS `PATH` env
|
||||||
if (OperatingSystem.IsMacOS() && !string.IsNullOrEmpty(Native.OS.CustomPathEnv))
|
if (OperatingSystem.IsMacOS() && !string.IsNullOrEmpty(Native.OS.CustomPathEnv))
|
||||||
|
|
|
@ -19,7 +19,10 @@ namespace SourceGit.Commands
|
||||||
|
|
||||||
// Force using en_US.UTF-8 locale to avoid GCM crash
|
// Force using en_US.UTF-8 locale to avoid GCM crash
|
||||||
if (OperatingSystem.IsLinux())
|
if (OperatingSystem.IsLinux())
|
||||||
start.Environment.Add("LANG", "en_US.UTF-8");
|
{
|
||||||
|
start.Environment.Add("LANG", "C");
|
||||||
|
start.Environment.Add("LC_ALL", "C");
|
||||||
|
}
|
||||||
|
|
||||||
// Fix macOS `PATH` env
|
// Fix macOS `PATH` env
|
||||||
if (OperatingSystem.IsMacOS() && !string.IsNullOrEmpty(Native.OS.CustomPathEnv))
|
if (OperatingSystem.IsMacOS() && !string.IsNullOrEmpty(Native.OS.CustomPathEnv))
|
||||||
|
@ -50,7 +53,10 @@ namespace SourceGit.Commands
|
||||||
|
|
||||||
// Force using en_US.UTF-8 locale to avoid GCM crash
|
// Force using en_US.UTF-8 locale to avoid GCM crash
|
||||||
if (OperatingSystem.IsLinux())
|
if (OperatingSystem.IsLinux())
|
||||||
start.Environment.Add("LANG", "en_US.UTF-8");
|
{
|
||||||
|
start.Environment.Add("LANG", "C");
|
||||||
|
start.Environment.Add("LC_ALL", "C");
|
||||||
|
}
|
||||||
|
|
||||||
// Fix macOS `PATH` env
|
// Fix macOS `PATH` env
|
||||||
if (OperatingSystem.IsMacOS() && !string.IsNullOrEmpty(Native.OS.CustomPathEnv))
|
if (OperatingSystem.IsMacOS() && !string.IsNullOrEmpty(Native.OS.CustomPathEnv))
|
||||||
|
|
|
@ -14,6 +14,7 @@ namespace SourceGit.Commands
|
||||||
{
|
{
|
||||||
WorkingDirectory = repo;
|
WorkingDirectory = repo;
|
||||||
Context = repo;
|
Context = repo;
|
||||||
|
ForceEnglishLocale = true;
|
||||||
Args = "branch -l --all -v --format=\"%(refname)%00%(objectname)%00%(HEAD)%00%(upstream)%00%(upstream:trackshort)\"";
|
Args = "branch -l --all -v --format=\"%(refname)%00%(objectname)%00%(HEAD)%00%(upstream)%00%(upstream:trackshort)\"";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue