aboutsummaryrefslogtreecommitdiffstats
path: root/repository
diff options
context:
space:
mode:
Diffstat (limited to 'repository')
-rw-r--r--repository/mock_repo.go2
-rw-r--r--repository/repo.go12
2 files changed, 11 insertions, 3 deletions
diff --git a/repository/mock_repo.go b/repository/mock_repo.go
index 23d3ef7d..2b911783 100644
--- a/repository/mock_repo.go
+++ b/repository/mock_repo.go
@@ -23,7 +23,7 @@ type commit struct {
parent git.Hash
}
-func NewMockRepoForTest() Repo {
+func NewMockRepoForTest() *mockRepoForTest {
return &mockRepoForTest{
blobs: make(map[git.Hash][]byte),
trees: make(map[git.Hash]string),
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