mirror of
https://gitea.com/Lydanne/buildx.git
synced 2025-05-18 09:17:49 +08:00
gitutil: override the locale to ensure consistent output
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com> (cherry picked from commit a8eb2a7fbe3fe316ec428bf1c723815afac1b128)
This commit is contained in:
parent
cc87bd104e
commit
02cf539a08
@ -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…
x
Reference in New Issue
Block a user