aboutsummaryrefslogtreecommitdiffstats
path: root/repository/repo.go
diff options
context:
space:
mode:
authorMichael Muré <batolettre@gmail.com>2020-07-27 00:14:01 +0200
committerMichael Muré <batolettre@gmail.com>2020-09-29 20:42:21 +0200
commitb127481364176ac7ecb56c1604e1460251574859 (patch)
tree389e4f4596183c009ed53a078ad93bc72d6c4564 /repository/repo.go
parentd171e11028f5993137a5f83beb7fe002bed866f5 (diff)
downloadgit-bug-b127481364176ac7ecb56c1604e1460251574859.tar.gz
repository: add access to the system keyring, with fallback on a file
Diffstat (limited to 'repository/repo.go')
-rw-r--r--repository/repo.go11
1 files changed, 9 insertions, 2 deletions
diff --git a/repository/repo.go b/repository/repo.go
index 30d95806..696b032e 100644
--- a/repository/repo.go
+++ b/repository/repo.go
@@ -10,8 +10,6 @@ import (
)
var (
- ErrNoConfigEntry = errors.New("no config entry for the given key")
- ErrMultipleConfigEntry = errors.New("multiple config entry for the given key")
// ErrNotARepo is the error returned when the git repo root wan't be found
ErrNotARepo = errors.New("not a git repository")
// ErrClockNotExist is the error returned when a clock can't be found
@@ -24,9 +22,17 @@ type RepoConfig interface {
LocalConfig() Config
// GlobalConfig give access to the git global configuration
+ // Deprecated: to remove in favor of Keyring()
+ // TODO: remove
GlobalConfig() Config
}
+// RepoKeyring give access to a user-wide storage for secrets
+type RepoKeyring interface {
+ // Keyring give access to a user-wide storage for secrets
+ Keyring() Keyring
+}
+
// RepoCommon represent the common function the we want all the repo to implement
type RepoCommon interface {
// GetPath returns the path to the repo.
@@ -48,6 +54,7 @@ type RepoCommon interface {
// Repo represents a source code repository.
type Repo interface {
RepoConfig
+ RepoKeyring
RepoCommon
// FetchRefs fetch git refs from a remote