mirror of
https://github.com/restic/restic.git
synced 2025-04-26 14:00:49 +00:00
backup: Avoid race between password prompt and open repository message
`term.Print` sends the output via a channel to a goroutine which actually prints the message. This may race with the password prompt printed by `OpenRepository` resulting in a missing prompt.
This commit is contained in:
parent
070d43e290
commit
c882a92cd6
@ -415,7 +415,7 @@ func runBackup(opts BackupOptions, gopts GlobalOptions, term *termstatus.Termina
|
|||||||
var t tomb.Tomb
|
var t tomb.Tomb
|
||||||
|
|
||||||
if gopts.verbosity >= 2 && !gopts.JSON {
|
if gopts.verbosity >= 2 && !gopts.JSON {
|
||||||
term.Print("open repository\n")
|
Verbosef("open repository\n")
|
||||||
}
|
}
|
||||||
|
|
||||||
repo, err := OpenRepository(gopts)
|
repo, err := OpenRepository(gopts)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user