1
0
Fork 0
mirror of https://github.com/restic/restic.git synced 2024-12-26 01:37:12 +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:
Michael Eischer 2020-05-01 22:38:03 +02:00
parent 070d43e290
commit c882a92cd6

View file

@ -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)