mirror of
https://github.com/restic/restic.git
synced 2026-10-07 19:07:12 +00:00
cat: Respect --no-lock flag
This commit is contained in:
1 parent
9a97095a4c
commit
666768cd17
2 files changed
+12
-4
No files matched your search
@@ -42,10 +42,13 @@ func runCat(gopts GlobalOptions, args []string) error {
|
||||
return err
|
||||
}
|
||||
|
||||
lock, err := lockRepo(gopts.ctx, repo)
|
||||
defer unlockRepo(lock)
|
||||
if err != nil {
|
||||
return err
|
||||
if !gopts.NoLock {
|
||||
lock, err := lockRepo(gopts.ctx, repo)
|
||||
// Make the linter happy
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
defer func() { _ = unlockRepo(lock) }()
|
||||
}
|
||||
|
||||
tpe := args[0]
|
||||
|
||||
Reference in new issue
Block a user