summaryrefslogtreecommitdiffstatshomepage
path: root/repository/mock_repo.go
diff options
context:
space:
mode:
authorMichael Muré <batolettre@gmail.com>2019-12-10 00:42:23 +0100
committerGitHub <noreply@github.com>2019-12-10 00:42:23 +0100
commitf1ed857cbd3a253d77b31c0c896fdc4ade40844f (patch)
treed1efe28a1fa666039bf8180bbed0202f0437910f /repository/mock_repo.go
parent69af7a1e0c2647c354fd9c5b55a254ba677200e1 (diff)
parent58c0e5aac97eabc02fa890123f3845ae6fe632a8 (diff)
downloadgit-bug-f1ed857cbd3a253d77b31c0c896fdc4ade40844f.tar.gz
git-bug-f1ed857cbd3a253d77b31c0c896fdc4ade40844f.zip
Merge pull request #271 from MichaelMure/bridge-credentials
bridge: huge refactor to accept multiple kind of credentials
Diffstat (limited to 'repository/mock_repo.go')
-rw-r--r--repository/mock_repo.go23
1 files changed, 12 insertions, 11 deletions
diff --git a/repository/mock_repo.go b/repository/mock_repo.go
index 88c5a1326..89d0f395a 100644
--- a/repository/mock_repo.go
+++ b/repository/mock_repo.go
@@ -12,8 +12,8 @@ var _ ClockedRepo = &mockRepoForTest{}
// mockRepoForTest defines an instance of Repo that can be used for testing.
type mockRepoForTest struct {
- config map[string]string
- globalConfig map[string]string
+ config *MemConfig
+ globalConfig *MemConfig
blobs map[git.Hash][]byte
trees map[git.Hash]string
commits map[git.Hash]commit
@@ -29,24 +29,25 @@ type commit struct {
func NewMockRepoForTest() *mockRepoForTest {
return &mockRepoForTest{
- config: make(map[string]string),
- blobs: make(map[git.Hash][]byte),
- trees: make(map[git.Hash]string),
- commits: make(map[git.Hash]commit),
- refs: make(map[string]git.Hash),
- createClock: lamport.NewClock(),
- editClock: lamport.NewClock(),
+ config: NewMemConfig(),
+ globalConfig: NewMemConfig(),
+ blobs: make(map[git.Hash][]byte),
+ trees: make(map[git.Hash]string),
+ commits: make(map[git.Hash]commit),
+ refs: make(map[string]git.Hash),
+ createClock: lamport.NewClock(),
+ editClock: lamport.NewClock(),
}
}
// LocalConfig give access to the repository scoped configuration
func (r *mockRepoForTest) LocalConfig() Config {
- return newMemConfig(r.config)
+ return r.config
}
// GlobalConfig give access to the git global configuration
func (r *mockRepoForTest) GlobalConfig() Config {
- return newMemConfig(r.globalConfig)
+ return r.globalConfig
}
// GetPath returns the path to the repo.