fix(git): preserve effective character locale

(cherry picked from commit ef7abf60ad1b80642ba1731e043f8eeb82c6a6aa)
This commit is contained in:
can1357
2026-07-29 23:08:21 +02:00
parent 3bce6527b3
commit 2c99f2f2e8
2 changed files with 7 additions and 7 deletions
+1 -5
View File
@@ -385,11 +385,7 @@ function buildNonInteractiveEnv(
pinnedEnv: Record<string, string | undefined>,
): Record<string, string | undefined> {
const preservedCharacterLocale =
(env.LC_CTYPE === undefined || env.LC_CTYPE === "") &&
env.LC_ALL !== undefined &&
/(?:^|[._-])utf-?8(?:$|[.@_-])/i.test(env.LC_ALL)
? env.LC_ALL
: undefined;
env.LC_ALL !== undefined && /(?:^|[._-])utf-?8(?:$|[.@_-])/i.test(env.LC_ALL) ? env.LC_ALL : undefined;
return {
...env,
...(preservedCharacterLocale === undefined ? {} : { LC_CTYPE: preservedCharacterLocale }),