1
0
Fork 0
mirror of https://github.com/restic/restic.git synced 2024-12-23 16:26:11 +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,10 +73,12 @@ func runCopy(opts CopyOptions, gopts GlobalOptions, args []string) error {
return err return err
} }
srcLock, err := lockRepo(ctx, srcRepo) if !gopts.NoLock {
defer unlockRepo(srcLock) srcLock, err := lockRepo(ctx, srcRepo)
if err != nil { defer unlockRepo(srcLock)
return err if err != nil {
return err
}
} }
dstLock, err := lockRepo(ctx, dstRepo) dstLock, err := lockRepo(ctx, dstRepo)