Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions src/Commands/Command.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ public enum EditorType
public string Args { get; set; } = string.Empty;
public bool RaiseError { get; set; } = true;
public bool TraitErrorAsOutput { get; set; } = false;
protected bool ForceEnglishLocale { get; set; } = false;

public bool Exec()
{
Expand Down Expand Up @@ -193,8 +194,11 @@ private ProcessStartInfo CreateGitStartInfo()
start.Environment.Add("GIT_SSH_COMMAND", $"ssh -i '{SSHKey}'");

// Force using en_US.UTF-8 locale to avoid GCM crash
if (OperatingSystem.IsLinux())
start.Environment.Add("LANG", "en_US.UTF-8");
if (ForceEnglishLocale || OperatingSystem.IsLinux())
{
start.Environment.Add("LANG", "C");
start.Environment.Add("LC_ALL", "C");
}

// Fix macOS `PATH` env
if (OperatingSystem.IsMacOS() && !string.IsNullOrEmpty(Native.OS.CustomPathEnv))
Expand Down
10 changes: 8 additions & 2 deletions src/Commands/ExecuteCustomAction.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,10 @@ public static void Run(string repo, string file, string args)

// Force using en_US.UTF-8 locale to avoid GCM crash
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
if (OperatingSystem.IsMacOS() && !string.IsNullOrEmpty(Native.OS.CustomPathEnv))
Expand Down Expand Up @@ -50,7 +53,10 @@ public static void RunAndWait(string repo, string file, string args, Action<stri

// Force using en_US.UTF-8 locale to avoid GCM crash
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
if (OperatingSystem.IsMacOS() && !string.IsNullOrEmpty(Native.OS.CustomPathEnv))
Expand Down
1 change: 1 addition & 0 deletions src/Commands/QueryBranches.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ public QueryBranches(string repo)
{
WorkingDirectory = repo;
Context = repo;
ForceEnglishLocale = true;
Args = "branch -l --all -v --format=\"%(refname)%00%(objectname)%00%(HEAD)%00%(upstream)%00%(upstream:trackshort)\"";
}

Expand Down