backup: Open repository before async status starts

Closes #2080
This commit is contained in:
Alexander Neumann 2018-11-10 12:38:29 +01:00
parent c0572ca15f
commit f9422ff4c7
1 changed files with 6 additions and 6 deletions

View File

@ -385,6 +385,12 @@ func runBackup(opts BackupOptions, gopts GlobalOptions, term *termstatus.Termina
var t tomb.Tomb
term.Print("open repository\n")
repo, err := OpenRepository(gopts)
if err != nil {
return err
}
p := ui.NewBackup(term, gopts.verbosity)
// use the terminal for stdout/stderr
@ -406,12 +412,6 @@ func runBackup(opts BackupOptions, gopts GlobalOptions, term *termstatus.Termina
t.Go(func() error { return p.Run(t.Context(gopts.ctx)) })
p.V("open repository")
repo, err := OpenRepository(gopts)
if err != nil {
return err
}
p.V("lock repository")
lock, err := lockRepo(repo)
defer unlockRepo(lock)