mirror of
https://github.com/octoleo/restic.git
synced 2024-11-26 06:46:34 +00:00
cmd/mount: honour --no-lock flag
Do not lock the repository if --no-lock global flag is set. This allows to mount repositories which are archived on a read only system. Signed-off-by: Sébastien Gross <seb•ɑƬ•chezwam•ɖɵʈ•org>
This commit is contained in:
parent
66d089e239
commit
9be4fe3e84
8
changelog/unreleased/pull-2821
Normal file
8
changelog/unreleased/pull-2821
Normal 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
|
@ -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)
|
||||||
|
Loading…
Reference in New Issue
Block a user