mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-05-11 12:25:47 +02:00
Fix crash when a background fetch prompts for credentials
This happens consistently for my when I close my MacBook's lid. It seems that MacOS locks the user's keychain in this case, and since I have my keychain provide the pass phrases for my ssh keys, fetching fails because it tries to prompt me for a pass phrase. This all worked correctly already, we have the FailOnCredentialRequest() mechanism specifically for this situation, so all is great. The only problem was that it was trying to pause the ongoing task while prompting the user for input; but the task is nil for a background fetch (and should be).
This commit is contained in:
parent
7e9f669421
commit
39f3f150ed
1 changed files with 6 additions and 2 deletions
|
@ -331,9 +331,13 @@ func (self *cmdObjRunner) processOutput(
|
|||
askFor, ok := checkForCredentialRequest(newBytes)
|
||||
if ok {
|
||||
responseChan := promptUserForCredential(askFor)
|
||||
task.Pause()
|
||||
if task != nil {
|
||||
task.Pause()
|
||||
}
|
||||
toInput := <-responseChan
|
||||
task.Continue()
|
||||
if task != nil {
|
||||
task.Continue()
|
||||
}
|
||||
// If the return data is empty we don't write anything to stdin
|
||||
if toInput != "" {
|
||||
_, _ = writer.Write([]byte(toInput))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue