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:
Michael Eischer
2022-03-05 10:29:13 +01:00
parent 44d543ede3
commit 7af69fd7b9
2 changed files with 11 additions and 1 deletions
+1 -1
View File
@@ -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 {