mirror of
https://github.com/restic/restic.git
synced 2025-04-26 16:10:47 +00:00
cat: Respect --no-lock flag
This commit is contained in:
parent
9a97095a4c
commit
666768cd17
5
changelog/unreleased/issue-2739
Normal file
5
changelog/unreleased/issue-2739
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
Bugfix: Make cat command respect --no-lock
|
||||||
|
|
||||||
|
Restic cat would not respect the --no-lock flag, it now does.
|
||||||
|
|
||||||
|
https://github.com/restic/restic/issues/2739
|
@ -42,10 +42,13 @@ func runCat(gopts GlobalOptions, args []string) error {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
lock, err := lockRepo(gopts.ctx, repo)
|
if !gopts.NoLock {
|
||||||
defer unlockRepo(lock)
|
lock, err := lockRepo(gopts.ctx, repo)
|
||||||
if err != nil {
|
// Make the linter happy
|
||||||
return err
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
defer func() { _ = unlockRepo(lock) }()
|
||||||
}
|
}
|
||||||
|
|
||||||
tpe := args[0]
|
tpe := args[0]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user