1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-07-31 14:24:25 +03:00

Worked and fixed a view comments

This commit is contained in:
mjarkk
2018-12-09 13:04:19 +01:00
parent efb82a58ae
commit f14effe5f5
6 changed files with 29 additions and 23 deletions

View File

@ -31,7 +31,7 @@ func RunCommandWithOutputLiveWrapper(c *OSCommand, command string, output func(s
tty, err := pty.Start(cmd)
if err != nil {
return errorMessage, err
return "", err
}
stopAsking := make(chan struct{})

View File

@ -261,9 +261,9 @@ func (c *GitCommand) RenameCommit(name string) error {
}
// Fetch fetch git repo
func (c *GitCommand) Fetch(unamePassQuestion func(string) string, canSskForCredentials bool) error {
func (c *GitCommand) Fetch(unamePassQuestion func(string) string, canAskForCredentials bool) error {
return c.OSCommand.DetectUnamePass("git fetch", func(question string) string {
if canSskForCredentials {
if canAskForCredentials {
return unamePassQuestion(question)
}
return "-"

View File

@ -87,7 +87,10 @@ func (c *OSCommand) DetectUnamePass(command string, ask func(string) string) err
}
for askFor, prompt := range prompts {
if match, _ := regexp.MatchString(prompt.pattern, ttyText); match && prompt.canAskFor {
if !prompt.canAskFor {
continue
}
if match, _ := regexp.MatchString(prompt.pattern, ttyText); match {
prompt.canAskFor = false
ttyText = ""
return ask(askFor)