mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-07-30 03:23:08 +03:00
explicitly return newlines to our live command stdin
This commit is contained in:
@ -41,10 +41,7 @@ func RunCommandWithOutputLiveWrapper(c *OSCommand, command string, output func(s
|
||||
scanner.Split(scanWordsWithNewLines)
|
||||
for scanner.Scan() {
|
||||
toOutput := strings.Trim(scanner.Text(), " ")
|
||||
toWrite := output(toOutput)
|
||||
if len(toWrite) > 0 {
|
||||
_, _ = ptmx.WriteString(toWrite + "\n")
|
||||
}
|
||||
_, _ = ptmx.WriteString(output(toOutput))
|
||||
}
|
||||
}()
|
||||
|
||||
|
@ -266,7 +266,7 @@ func (c *GitCommand) Fetch(unamePassQuestion func(string) string, canAskForCrede
|
||||
if canAskForCredentials {
|
||||
return unamePassQuestion(question)
|
||||
}
|
||||
return "-"
|
||||
return "\n"
|
||||
})
|
||||
}
|
||||
|
||||
|
@ -1045,7 +1045,7 @@ func TestGitCommandPush(t *testing.T) {
|
||||
gitCmd := newDummyGitCommand()
|
||||
gitCmd.OSCommand.command = s.command
|
||||
err := gitCmd.Push("test", s.forcePush, func(passOrUname string) string {
|
||||
return "-"
|
||||
return "\n"
|
||||
})
|
||||
s.test(err)
|
||||
})
|
||||
|
Reference in New Issue
Block a user