gitutil: override the locale to ensure consistent output

Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
This commit is contained in:
CrazyMax 2023-02-07 13:26:25 +01:00
parent d2fa4a5724
commit a8eb2a7fbe
No known key found for this signature in database
GPG Key ID: 3248E46B6BB8C7F7
1 changed files with 4 additions and 0 deletions

View File

@ -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