From b92adfcb5f79f2b32c3dafb0fc3e7f1b753b6197 Mon Sep 17 00:00:00 2001 From: Michael Muré Date: Sun, 8 Dec 2019 21:15:06 +0100 Subject: bridge: huge refactor to accept multiple kind of credentials --- repository/repo.go | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'repository/repo.go') diff --git a/repository/repo.go b/repository/repo.go index 71bd7a8e..e8517508 100644 --- a/repository/repo.go +++ b/repository/repo.go @@ -15,6 +15,15 @@ var ( ErrMultipleConfigEntry = errors.New("multiple config entry for the given key") ) +// RepoConfig access the configuration of a repository +type RepoConfig interface { + // LocalConfig give access to the repository scoped configuration + LocalConfig() Config + + // GlobalConfig give access to the git global configuration + GlobalConfig() Config +} + // RepoCommon represent the common function the we want all the repo to implement type RepoCommon interface { // GetPath returns the path to the repo. @@ -31,16 +40,11 @@ type RepoCommon interface { // GetRemotes returns the configured remotes repositories. GetRemotes() (map[string]string, error) - - // LocalConfig give access to the repository scoped configuration - LocalConfig() Config - - // GlobalConfig give access to the git global configuration - GlobalConfig() Config } // Repo represents a source code repository. type Repo interface { + RepoConfig RepoCommon // FetchRefs fetch git refs from a remote -- cgit