Skip to content

Commit 0f9087f

Browse files
committed
code_review: PR #1078
- Remove `ForceEnglishLocale` because we want all `git` outputs in English - Remove locale settings for `ExecuteCustomAction` Signed-off-by: leo <[email protected]>
1 parent 860f521 commit 0f9087f

File tree

3 files changed

+2
-18
lines changed

3 files changed

+2
-18
lines changed

src/Commands/Command.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ public enum EditorType
3737
public string Args { get; set; } = string.Empty;
3838
public bool RaiseError { get; set; } = true;
3939
public bool TraitErrorAsOutput { get; set; } = false;
40-
protected bool ForceEnglishLocale { get; set; } = false;
4140

4241
public bool Exec()
4342
{
@@ -193,8 +192,8 @@ private ProcessStartInfo CreateGitStartInfo()
193192
if (!start.Environment.ContainsKey("GIT_SSH_COMMAND") && !string.IsNullOrEmpty(SSHKey))
194193
start.Environment.Add("GIT_SSH_COMMAND", $"ssh -i '{SSHKey}'");
195194

196-
// Force using en_US.UTF-8 locale to avoid GCM crash
197-
if (ForceEnglishLocale || OperatingSystem.IsLinux())
195+
// Force using en_US.UTF-8 locale
196+
if (OperatingSystem.IsLinux())
198197
{
199198
start.Environment.Add("LANG", "C");
200199
start.Environment.Add("LC_ALL", "C");

src/Commands/ExecuteCustomAction.cs

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,6 @@ public static void Run(string repo, string file, string args)
1717
start.CreateNoWindow = true;
1818
start.WorkingDirectory = repo;
1919

20-
// Force using en_US.UTF-8 locale to avoid GCM crash
21-
if (OperatingSystem.IsLinux())
22-
{
23-
start.Environment.Add("LANG", "C");
24-
start.Environment.Add("LC_ALL", "C");
25-
}
26-
2720
// Fix macOS `PATH` env
2821
if (OperatingSystem.IsMacOS() && !string.IsNullOrEmpty(Native.OS.CustomPathEnv))
2922
start.Environment.Add("PATH", Native.OS.CustomPathEnv);
@@ -51,13 +44,6 @@ public static void RunAndWait(string repo, string file, string args, Action<stri
5144
start.StandardErrorEncoding = Encoding.UTF8;
5245
start.WorkingDirectory = repo;
5346

54-
// Force using en_US.UTF-8 locale to avoid GCM crash
55-
if (OperatingSystem.IsLinux())
56-
{
57-
start.Environment.Add("LANG", "C");
58-
start.Environment.Add("LC_ALL", "C");
59-
}
60-
6147
// Fix macOS `PATH` env
6248
if (OperatingSystem.IsMacOS() && !string.IsNullOrEmpty(Native.OS.CustomPathEnv))
6349
start.Environment.Add("PATH", Native.OS.CustomPathEnv);

src/Commands/QueryBranches.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ public QueryBranches(string repo)
1414
{
1515
WorkingDirectory = repo;
1616
Context = repo;
17-
ForceEnglishLocale = true;
1817
Args = "branch -l --all -v --format=\"%(refname)%00%(objectname)%00%(HEAD)%00%(upstream)%00%(upstream:trackshort)\"";
1918
}
2019

0 commit comments

Comments
 (0)