2
2
mirror of https://github.com/octoleo/restic.git synced 2024-05-31 16:10:49 +00:00

Make copy honor --no-lock

This commit is contained in:
Kyle Brennan 2021-12-03 09:50:28 -08:00
parent 882d58abce
commit 8eb83029a8
No known key found for this signature in database
GPG Key ID: 8F080E9BF300A483

View File

@ -73,11 +73,13 @@ func runCopy(opts CopyOptions, gopts GlobalOptions, args []string) error {
return err
}
if !gopts.NoLock {
srcLock, err := lockRepo(ctx, srcRepo)
defer unlockRepo(srcLock)
if err != nil {
return err
}
}
dstLock, err := lockRepo(ctx, dstRepo)
defer unlockRepo(dstLock)