aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Muré <batolettre@gmail.com>2020-09-26 14:06:01 +0200
committerMichael Muré <batolettre@gmail.com>2020-09-29 20:42:21 +0200
commitcedcc2772c88b78bc62594afd06c44c7a7c244e4 (patch)
treec08a7924ba65b1f52982e3591c8e009422323b7b
parentcdfbecf3e2b874f0b9dd99b75bcb80aa5be8b4b4 (diff)
downloadgit-bug-cedcc2772c88b78bc62594afd06c44c7a7c244e4.tar.gz
repo: smaller interfaces
-rw-r--r--repository/repo.go16
1 files changed, 12 insertions, 4 deletions
diff --git a/repository/repo.go b/repository/repo.go
index 3deb6f1b..6349007b 100644
--- a/repository/repo.go
+++ b/repository/repo.go
@@ -22,6 +22,12 @@ type Repo interface {
RepoData
}
+// ClockedRepo is a Repo that also has Lamport clocks
+type ClockedRepo interface {
+ Repo
+ RepoClock
+}
+
// RepoConfig access the configuration of a repository
type RepoConfig interface {
// LocalConfig give access to the repository scoped configuration
@@ -103,10 +109,8 @@ type RepoData interface {
ListCommits(ref string) ([]Hash, error)
}
-// ClockedRepo is a Repo that also has Lamport clocks
-type ClockedRepo interface {
- Repo
-
+// RepoClock give access to Lamport clocks
+type RepoClock interface {
// GetOrCreateClock return a Lamport clock stored in the Repo.
// If the clock doesn't exist, it's created.
GetOrCreateClock(name string) (lamport.Clock, error)
@@ -127,7 +131,11 @@ type ClockLoader struct {
// TestedRepo is an extended ClockedRepo with function for testing only
type TestedRepo interface {
ClockedRepo
+ repoTest
+}
+// repoTest give access to test only functions
+type repoTest interface {
// AddRemote add a new remote to the repository
AddRemote(name string, url string) error
}