fix(mr create): support non-english languages

This commit is contained in:
Jay McCure 2023-10-30 16:20:43 +10:00
parent ebb39ffaae
commit d687fefab4
No known key found for this signature in database
1 changed files with 5 additions and 0 deletions

View File

@ -22,6 +22,11 @@ func GetRemoteURL(remoteAlias string) (string, error) {
// GetDefaultBranch finds and returns the remote's default branch
func GetDefaultBranch(remote string) (string, error) {
getDefBranch := exec.Command("git", "remote", "show", remote)
// Ensure output from git is in English
getDefBranch.Env = os.Environ()
getDefBranch.Env = append(getDefBranch.Env, "LC_ALL=C")
output, err := run.PrepareCmd(getDefBranch).Output()
if err != nil {
return "master", err