gitutil: override the locale to ensure consistent output

Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
pull/1592/head
CrazyMax 2 years ago
parent d2fa4a5724
commit a8eb2a7fbe
No known key found for this signature in database
GPG Key ID: 3248E46B6BB8C7F7

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

Loading…
Cancel
Save