aboutsummaryrefslogtreecommitdiffstats
path: root/repository/repo.go
diff options
context:
space:
mode:
authorMichael Muré <batolettre@gmail.com>2018-09-21 18:18:51 +0200
committerMichael Muré <batolettre@gmail.com>2018-09-21 18:53:37 +0200
commit82eaceffc1d750832a2a66f206749d2dca968cce (patch)
tree1431c8f1fd9baa689b850da7f104d12c20b1d8a7 /repository/repo.go
parent6a575fbf483e2b28821908f67e87637d9e5cea75 (diff)
downloadgit-bug-82eaceffc1d750832a2a66f206749d2dca968cce.tar.gz
repo: split the Repo interface to avoid abstraction leak in RepoCache
Diffstat (limited to 'repository/repo.go')
-rw-r--r--repository/repo.go12
1 files changed, 10 insertions, 2 deletions
diff --git a/repository/repo.go b/repository/repo.go
index 3d18431d..053837db 100644
--- a/repository/repo.go
+++ b/repository/repo.go
@@ -9,8 +9,7 @@ import (
"github.com/MichaelMure/git-bug/util/lamport"
)
-// Repo represents a source code repository.
-type Repo interface {
+type RepoCommon interface {
// GetPath returns the path to the repo.
GetPath() string
@@ -22,6 +21,11 @@ type Repo interface {
// GetCoreEditor returns the name of the editor that the user has used to configure git.
GetCoreEditor() (string, error)
+}
+
+// Repo represents a source code repository.
+type Repo interface {
+ RepoCommon
// FetchRefs fetch git refs from a remote
FetchRefs(remote string, refSpec string) (string, error)
@@ -67,6 +71,10 @@ type Repo interface {
// GetTreeHash return the git tree hash referenced in a commit
GetTreeHash(commit git.Hash) (git.Hash, error)
+}
+
+type ClockedRepo interface {
+ Repo
LoadClocks() error