Skip to content

Commit 02cf539

Browse files
committed
gitutil: override the locale to ensure consistent output
Signed-off-by: CrazyMax <[email protected]> (cherry picked from commit a8eb2a7)
1 parent cc87bd1 commit 02cf539

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

util/gitutil/gitutil.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package gitutil
33
import (
44
"bytes"
55
"context"
6+
"os"
67
"os/exec"
78
"strings"
89

@@ -116,6 +117,9 @@ func (c *Git) run(args ...string) (string, error) {
116117
cmd.Dir = c.wd
117118
}
118119

120+
// Override the locale to ensure consistent output
121+
cmd.Env = append(os.Environ(), "LC_ALL=C")
122+
119123
stdout := bytes.Buffer{}
120124
stderr := bytes.Buffer{}
121125
cmd.Stdout = &stdout

0 commit comments

Comments
 (0)