mirror of
https://github.com/octoleo/restic.git
synced 2024-11-13 00:36:35 +00:00
ls: add missing read lock
As `ls` reads data from the repository, it must acquire a read lock unless `--no-lock` was specified. The old behavior is equivalent to `ls --no-lock`.
This commit is contained in:
parent
dc441c57a7
commit
d18726cd70
@ -309,10 +309,11 @@ func runLs(ctx context.Context, opts LsOptions, gopts GlobalOptions, args []stri
|
||||
return false
|
||||
}
|
||||
|
||||
repo, err := OpenRepository(ctx, gopts)
|
||||
ctx, repo, unlock, err := openWithReadLock(ctx, gopts, gopts.NoLock)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
defer unlock()
|
||||
|
||||
snapshotLister, err := restic.MemorizeList(ctx, repo, restic.SnapshotFile)
|
||||
if err != nil {
|
||||
|
Loading…
Reference in New Issue
Block a user