aboutsummaryrefslogtreecommitdiffstats
path: root/repository/mock_repo.go
diff options
context:
space:
mode:
Diffstat (limited to 'repository/mock_repo.go')
-rw-r--r--repository/mock_repo.go23
1 files changed, 16 insertions, 7 deletions
diff --git a/repository/mock_repo.go b/repository/mock_repo.go
index 23534b89..356f59d8 100644
--- a/repository/mock_repo.go
+++ b/repository/mock_repo.go
@@ -14,13 +14,14 @@ var _ ClockedRepo = &mockRepoForTest{}
// mockRepoForTest defines an instance of Repo that can be used for testing.
type mockRepoForTest struct {
- config map[string]string
- blobs map[git.Hash][]byte
- trees map[git.Hash]string
- commits map[git.Hash]commit
- refs map[string]git.Hash
- createClock lamport.Clock
- editClock lamport.Clock
+ config map[string]string
+ globalConfig map[string]string
+ blobs map[git.Hash][]byte
+ trees map[git.Hash]string
+ commits map[git.Hash]commit
+ refs map[string]git.Hash
+ createClock lamport.Clock
+ editClock lamport.Clock
}
type commit struct {
@@ -40,6 +41,14 @@ func NewMockRepoForTest() *mockRepoForTest {
}
}
+func (r *mockRepoForTest) LocalConfig() Config {
+ return newRuntimeConfig(r.config)
+}
+
+func (r *mockRepoForTest) GlobalConfig() Config {
+ return newRuntimeConfig(r.globalConfig)
+}
+
// GetPath returns the path to the repo.
func (r *mockRepoForTest) GetPath() string {
return "~/mockRepo/"