mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-11-27 22:38:09 +02:00
Translated credentials error with git push/pull/fetch
This commit is contained in:
@@ -25,7 +25,7 @@ func RunCommandWithOutputLiveWrapper(c *OSCommand, command string, output func(s
|
|||||||
cmd := exec.Command(splitCmd[0], splitCmd[1:]...)
|
cmd := exec.Command(splitCmd[0], splitCmd[1:]...)
|
||||||
|
|
||||||
cmd.Env = os.Environ()
|
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
|
var stderr bytes.Buffer
|
||||||
cmd.Stderr = &stderr
|
cmd.Stderr = &stderr
|
||||||
|
|||||||
@@ -1,6 +1,9 @@
|
|||||||
package gui
|
package gui
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"errors"
|
||||||
|
"strings"
|
||||||
|
|
||||||
"github.com/jesseduffield/gocui"
|
"github.com/jesseduffield/gocui"
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -89,6 +92,9 @@ func (gui *Gui) HandleCredentialsPopup(g *gocui.Gui, popupOpened bool, cmdErr er
|
|||||||
_, _ = gui.g.SetViewOnBottom("credentials")
|
_, _ = gui.g.SetViewOnBottom("credentials")
|
||||||
}
|
}
|
||||||
if cmdErr != nil {
|
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
|
// we are not logging this error because it may contain a password
|
||||||
_ = gui.createSpecificErrorPanel(cmdErr.Error(), gui.getFilesView(gui.g), false)
|
_ = gui.createSpecificErrorPanel(cmdErr.Error(), gui.getFilesView(gui.g), false)
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user