1
0
Fork 0
mirror of https://github.com/restic/restic.git synced 2024-12-27 10:17:58 +00:00

Merge pull request #2821 from renard/mount-nolock

cmd/mount: honur --no-lock flag
This commit is contained in:
rawtaz 2020-08-03 20:09:26 +02:00 committed by GitHub
commit 5af2815627
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 4 deletions

View file

@ -0,0 +1,8 @@
Change: Honor the --no-lock flag in the mount command
The mount command now does not lock the repository if given the
--no-lock flag. This allows to mount repositories which are archived
on a read only backend/filesystem.
https://github.com/restic/restic/issues/1597
https://github.com/restic/restic/pull/2821

View file

@ -90,10 +90,12 @@ func mount(opts MountOptions, gopts GlobalOptions, mountpoint string) error {
return err return err
} }
lock, err := lockRepo(repo) if !gopts.NoLock {
defer unlockRepo(lock) lock, err := lockRepo(repo)
if err != nil { defer unlockRepo(lock)
return err if err != nil {
return err
}
} }
err = repo.LoadIndex(gopts.ctx) err = repo.LoadIndex(gopts.ctx)