diff options
author | Michael Muré <batolettre@gmail.com> | 2021-04-09 13:01:14 +0200 |
---|---|---|
committer | Michael Muré <batolettre@gmail.com> | 2021-04-09 13:01:14 +0200 |
commit | 1520f678f7a2bc6e01d9b01df5ce49f2f46be7d7 (patch) | |
tree | f6d71c1f29cf06ccab9e4ae434b19ab17caa4385 /bridge/core | |
parent | 0fd570171d171aa574d7f01d6033a9c01d668465 (diff) | |
parent | bc5f618eba812859bf87ce2c31b278bd518d4555 (diff) | |
download | git-bug-1520f678f7a2bc6e01d9b01df5ce49f2f46be7d7.tar.gz |
Merge remote-tracking branch 'origin/master' into dev-gh-bridge
Diffstat (limited to 'bridge/core')
-rw-r--r-- | bridge/core/auth/credential.go | 6 | ||||
-rw-r--r-- | bridge/core/auth/credential_test.go | 4 |
2 files changed, 6 insertions, 4 deletions
diff --git a/bridge/core/auth/credential.go b/bridge/core/auth/credential.go index 2327a6fc..20343c9c 100644 --- a/bridge/core/auth/credential.go +++ b/bridge/core/auth/credential.go @@ -3,12 +3,13 @@ package auth import ( "encoding/base64" "encoding/json" - "errors" "fmt" "strconv" "strings" "time" + "github.com/pkg/errors" + "github.com/MichaelMure/git-bug/entity" "github.com/MichaelMure/git-bug/repository" ) @@ -159,7 +160,8 @@ func List(repo repository.RepoKeyring, opts ...ListOption) ([]Credential, error) item, err := repo.Keyring().Get(key) if err != nil { - return nil, err + // skip unreadable items, nothing much we can do for them anyway + continue } cred, err := decode(item) diff --git a/bridge/core/auth/credential_test.go b/bridge/core/auth/credential_test.go index 60c631d7..8bb25835 100644 --- a/bridge/core/auth/credential_test.go +++ b/bridge/core/auth/credential_test.go @@ -11,7 +11,7 @@ import ( ) func TestCredential(t *testing.T) { - repo := repository.NewMockRepoForTest() + repo := repository.NewMockRepo() storeToken := func(val string, target string) *Token { token := NewToken(target, val) @@ -102,7 +102,7 @@ func sameIds(t *testing.T, a []Credential, b []Credential) { } func testCredentialSerial(t *testing.T, original Credential) Credential { - repo := repository.NewMockRepoForTest() + repo := repository.NewMockRepo() original.SetMetadata("test", "value") |