mirror of
https://github.com/octoleo/restic.git
synced 2024-11-29 00:06:32 +00:00
parent
495982232c
commit
34f3b13b7c
8
changelog/unreleased/issue-4513
Normal file
8
changelog/unreleased/issue-4513
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
Bugfix: Make `key list` command honor `--no-lock`
|
||||||
|
|
||||||
|
This allows to determine which keys a repo can be accessed by without the
|
||||||
|
need for having write access (e.g., read-only sftp access, filesystem
|
||||||
|
snapshot).
|
||||||
|
|
||||||
|
https://github.com/restic/restic/issues/4513
|
||||||
|
https://github.com/restic/restic/pull/4514
|
@ -212,10 +212,13 @@ func runKey(ctx context.Context, gopts GlobalOptions, args []string) error {
|
|||||||
|
|
||||||
switch args[0] {
|
switch args[0] {
|
||||||
case "list":
|
case "list":
|
||||||
lock, ctx, err := lockRepo(ctx, repo, gopts.RetryLock, gopts.JSON)
|
if !gopts.NoLock {
|
||||||
defer unlockRepo(lock)
|
var lock *restic.Lock
|
||||||
if err != nil {
|
lock, ctx, err = lockRepo(ctx, repo, gopts.RetryLock, gopts.JSON)
|
||||||
return err
|
defer unlockRepo(lock)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return listKeys(ctx, repo, gopts)
|
return listKeys(ctx, repo, gopts)
|
||||||
|
Loading…
Reference in New Issue
Block a user