From 800b40ecc4ba4c144723214dfbc063d536075f1d Mon Sep 17 00:00:00 2001 From: mjarkk Date: Wed, 19 Dec 2018 10:06:58 +0100 Subject: [PATCH] Translated credentials error with git push/pull/fetch --- pkg/commands/exec_live_default.go | 2 +- pkg/gui/credentials_panel.go | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/pkg/commands/exec_live_default.go b/pkg/commands/exec_live_default.go index a61b5f398..6063bb16a 100644 --- a/pkg/commands/exec_live_default.go +++ b/pkg/commands/exec_live_default.go @@ -25,7 +25,7 @@ func RunCommandWithOutputLiveWrapper(c *OSCommand, command string, output func(s cmd := exec.Command(splitCmd[0], splitCmd[1:]...) cmd.Env = os.Environ() - cmd.Env = append(cmd.Env, "LANG=en_US.utf8", "LC_ALL=en_US.UTF-8") + cmd.Env = append(cmd.Env, "LANG=en_US.UTF-8", "LC_ALL=en_US.UTF-8") var stderr bytes.Buffer cmd.Stderr = &stderr diff --git a/pkg/gui/credentials_panel.go b/pkg/gui/credentials_panel.go index f310ac6ea..52ec3e405 100644 --- a/pkg/gui/credentials_panel.go +++ b/pkg/gui/credentials_panel.go @@ -1,6 +1,9 @@ package gui import ( + "errors" + "strings" + "github.com/jesseduffield/gocui" ) @@ -89,6 +92,9 @@ func (gui *Gui) HandleCredentialsPopup(g *gocui.Gui, popupOpened bool, cmdErr er _, _ = gui.g.SetViewOnBottom("credentials") } if cmdErr != nil { + if strings.Contains(cmdErr.Error(), "Invalid username or password") { + cmdErr = errors.New(gui.Tr.SLocalize("PassUnameWrong")) + } // we are not logging this error because it may contain a password _ = gui.createSpecificErrorPanel(cmdErr.Error(), gui.getFilesView(gui.g), false) } else {