1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-01-04 03:48:07 +02:00

Fix flakey pull_merge_conflict test

It's not clear what was happening but it seemed like we sometimes weren't
fully writing to our stdout buffer (which is used for the error message)
even though we had returned from cmd.Wait().

Not sure what the cause was but removing an unnecessary goroutine fixed it.
This commit is contained in:
Jesse Duffield 2023-07-10 17:11:22 +10:00
parent c05a1ae711
commit 90613056ce

View File

@ -249,7 +249,11 @@ func (self *cmdObjRunner) runAndStreamAux(
if cmdObj.ShouldIgnoreEmptyError() {
return nil
}
return errors.New(stdout.String())
stdoutStr := stdout.String()
if stdoutStr != "" {
return errors.New(stdoutStr)
}
return errors.New("Command exited with non-zero exit code, but no output")
}
return nil
@ -308,9 +312,7 @@ func (self *cmdObjRunner) runAndDetectCredentialRequest(
return self.runAndStreamAux(cmdObj, func(handler *cmdHandler, cmdWriter io.Writer) {
tr := io.TeeReader(handler.stdoutPipe, cmdWriter)
go utils.Safe(func() {
self.processOutput(tr, handler.stdinPipe, promptUserForCredential, cmdObj.GetTask())
})
self.processOutput(tr, handler.stdinPipe, promptUserForCredential, cmdObj.GetTask())
})
}