aboutsummaryrefslogtreecommitdiffstats
path: root/repository/keyring.go
diff options
context:
space:
mode:
authorMichael Muré <batolettre@gmail.com>2021-04-04 15:49:16 +0200
committerGitHub <noreply@github.com>2021-04-04 15:49:16 +0200
commitfc04af34f5d6dff930003cc1f27ead972d424324 (patch)
tree8b9750d46182fff88d72fcc891e89d5a79ed83b0 /repository/keyring.go
parent2055bd5d0afb534cc98cd11bd9802d66acbb0c8f (diff)
parentcb9b06551ddc1fae33046733f79ede20f8d09f9a (diff)
downloadgit-bug-fc04af34f5d6dff930003cc1f27ead972d424324.tar.gz
Merge pull request #532 from MichaelMure/dag-entity
Work towards a reusable entity datastructure + commit signature
Diffstat (limited to 'repository/keyring.go')
-rw-r--r--repository/keyring.go12
1 files changed, 11 insertions, 1 deletions
diff --git a/repository/keyring.go b/repository/keyring.go
index 4cb3c9ff..6cba303e 100644
--- a/repository/keyring.go
+++ b/repository/keyring.go
@@ -15,7 +15,7 @@ var ErrKeyringKeyNotFound = keyring.ErrKeyNotFound
type Keyring interface {
// Returns an Item matching the key or ErrKeyringKeyNotFound
Get(key string) (Item, error)
- // Stores an Item on the keyring
+ // Stores an Item on the keyring. Set is idempotent.
Set(item Item) error
// Removes the item with matching key
Remove(key string) error
@@ -48,3 +48,13 @@ func defaultKeyring() (Keyring, error) {
},
})
}
+
+// replaceKeyring allow to replace the Keyring of the underlying repo
+type replaceKeyring struct {
+ TestedRepo
+ keyring Keyring
+}
+
+func (rk replaceKeyring) Keyring() Keyring {
+ return rk.keyring
+}