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:
parent
882d58abce
commit
8eb83029a8
1 changed files with 6 additions and 4 deletions
|
@ -73,11 +73,13 @@ func runCopy(opts CopyOptions, gopts GlobalOptions, args []string) error {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if !gopts.NoLock {
|
||||||
srcLock, err := lockRepo(ctx, srcRepo)
|
srcLock, err := lockRepo(ctx, srcRepo)
|
||||||
defer unlockRepo(srcLock)
|
defer unlockRepo(srcLock)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
dstLock, err := lockRepo(ctx, dstRepo)
|
dstLock, err := lockRepo(ctx, dstRepo)
|
||||||
defer unlockRepo(dstLock)
|
defer unlockRepo(dstLock)
|
||||||
|
|
Loading…
Reference in a new issue