diff --git a/changelog/unreleased/issue-1106 b/changelog/unreleased/issue-1106 new file mode 100644 index 000000000..1df3e1981 --- /dev/null +++ b/changelog/unreleased/issue-1106 @@ -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 diff --git a/cmd/restic/cmd_list.go b/cmd/restic/cmd_list.go index af711da3d..811b17e41 100644 --- a/cmd/restic/cmd_list.go +++ b/cmd/restic/cmd_list.go @@ -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 {