mirror of
https://github.com/octoleo/restic.git
synced 2024-11-22 21:05:10 +00:00
Make copy honor --no-lock
This commit is contained in:
parent
882d58abce
commit
8eb83029a8
@ -73,10 +73,12 @@ func runCopy(opts CopyOptions, gopts GlobalOptions, args []string) error {
|
||||
return err
|
||||
}
|
||||
|
||||
srcLock, err := lockRepo(ctx, srcRepo)
|
||||
defer unlockRepo(srcLock)
|
||||
if err != nil {
|
||||
return err
|
||||
if !gopts.NoLock {
|
||||
srcLock, err := lockRepo(ctx, srcRepo)
|
||||
defer unlockRepo(srcLock)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
dstLock, err := lockRepo(ctx, dstRepo)
|
||||
|
Loading…
Reference in New Issue
Block a user