mirror of
https://github.com/octoleo/restic.git
synced 2024-11-29 16:23:59 +00:00
Merge pull request #4356 from MichaelEischer/fix-unlock-hint
lock: fix missing hint to unlock command if repository is locked
This commit is contained in:
commit
49a6a4f5bf
@ -2,6 +2,7 @@ package main
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
"fmt"
|
||||||
"sync"
|
"sync"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
@ -97,7 +98,7 @@ retryLoop:
|
|||||||
return nil, ctx, errors.Fatalf("%v\n\nthe `unlock --remove-all` command can be used to remove invalid locks. Make sure that no other restic process is accessing the repository when running the command", err)
|
return nil, ctx, errors.Fatalf("%v\n\nthe `unlock --remove-all` command can be used to remove invalid locks. Make sure that no other restic process is accessing the repository when running the command", err)
|
||||||
}
|
}
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, ctx, errors.Fatalf("unable to create lock in backend: %v", err)
|
return nil, ctx, fmt.Errorf("unable to create lock in backend: %w", err)
|
||||||
}
|
}
|
||||||
debug.Log("create lock %p (exclusive %v)", lock, exclusive)
|
debug.Log("create lock %p (exclusive %v)", lock, exclusive)
|
||||||
|
|
||||||
|
@ -90,6 +90,7 @@ func TestLockConflict(t *testing.T) {
|
|||||||
if err == nil {
|
if err == nil {
|
||||||
t.Fatal("second lock should have failed")
|
t.Fatal("second lock should have failed")
|
||||||
}
|
}
|
||||||
|
test.Assert(t, restic.IsAlreadyLocked(err), "unexpected error %v", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
type writeOnceBackend struct {
|
type writeOnceBackend struct {
|
||||||
|
Loading…
Reference in New Issue
Block a user