mirror of
https://github.com/octoleo/restic.git
synced 2024-12-22 02:48:55 +00:00
list: Never lock the repository when listing lock files
There's no point in locking the repository just to list the currently existing lock files. This won't work for an exclusively locked repository and is also confusing to users.
This commit is contained in:
parent
44d543ede3
commit
7af69fd7b9
10
changelog/unreleased/issue-1106
Normal file
10
changelog/unreleased/issue-1106
Normal file
@ -0,0 +1,10 @@
|
||||
Bugfix: Never lock repository for `list locks`
|
||||
|
||||
The `list locks` command previously locked to the repository by default. This
|
||||
has the problem that it won't work for an exclusively locked repository and
|
||||
that the command will also display its own lock file which can be confusing.
|
||||
|
||||
Now, the `list locks` command cnever locks the repository.
|
||||
|
||||
https://github.com/restic/restic/issues/1106
|
||||
https://github.com/restic/restic/pull/3665
|
@ -39,7 +39,7 @@ func runList(cmd *cobra.Command, opts GlobalOptions, args []string) error {
|
||||
return err
|
||||
}
|
||||
|
||||
if !opts.NoLock {
|
||||
if !opts.NoLock && args[0] != "locks" {
|
||||
lock, err := lockRepo(opts.ctx, repo)
|
||||
defer unlockRepo(lock)
|
||||
if err != nil {
|
||||
|
Loading…
Reference in New Issue
Block a user