gitutil: override the locale to ensure consistent output

Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
(cherry picked from commit a8eb2a7fbe)
pull/1609/head
CrazyMax 2 years ago
parent cc87bd104e
commit 02cf539a08
No known key found for this signature in database
GPG Key ID: 3248E46B6BB8C7F7

@ -3,6 +3,7 @@ package gitutil
import ( import (
"bytes" "bytes"
"context" "context"
"os"
"os/exec" "os/exec"
"strings" "strings"
@ -116,6 +117,9 @@ func (c *Git) run(args ...string) (string, error) {
cmd.Dir = c.wd cmd.Dir = c.wd
} }
// Override the locale to ensure consistent output
cmd.Env = append(os.Environ(), "LC_ALL=C")
stdout := bytes.Buffer{} stdout := bytes.Buffer{}
stderr := bytes.Buffer{} stderr := bytes.Buffer{}
cmd.Stdout = &stdout cmd.Stdout = &stdout

Loading…
Cancel
Save