mirror of
https://github.com/restic/restic.git
synced 2026-04-14 09:08:51 +00:00
cat: Respect --no-lock flag
This commit is contained in:
committed by
Alexander Neumann
parent
9a97095a4c
commit
666768cd17
@@ -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