aboutsummaryrefslogtreecommitdiffstats
path: root/repository/repo.go
diff options
context:
space:
mode:
authorMichael Muré <batolettre@gmail.com>2020-12-01 21:19:23 +0100
committerMichael Muré <batolettre@gmail.com>2020-12-05 21:41:10 +0100
commitbca9ae82745ffd619fd321f4200016c184849f94 (patch)
tree6223d23c3e865bd2d29ea888d944a57467f2b44d /repository/repo.go
parent28adf41af6a5c0f4b19875912d056b03ea6710f8 (diff)
downloadgit-bug-bca9ae82745ffd619fd321f4200016c184849f94.tar.gz
repo: more work towards RepoStorage
Diffstat (limited to 'repository/repo.go')
-rw-r--r--repository/repo.go17
1 files changed, 14 insertions, 3 deletions
diff --git a/repository/repo.go b/repository/repo.go
index 4b45a1c5..d34995f9 100644
--- a/repository/repo.go
+++ b/repository/repo.go
@@ -4,6 +4,8 @@ package repository
import (
"errors"
+ "github.com/go-git/go-billy/v5"
+
"github.com/MichaelMure/git-bug/util/lamport"
)
@@ -20,6 +22,7 @@ type Repo interface {
RepoKeyring
RepoCommon
RepoData
+ RepoStorage
}
// ClockedRepo is a Repo that also has Lamport clocks
@@ -48,9 +51,6 @@ type RepoKeyring interface {
// RepoCommon represent the common function the we want all the repo to implement
type RepoCommon interface {
- // GetPath returns the path to the repo.
- GetPath() string
-
// GetUserName returns the name the the user has used to configure git
GetUserName() (string, error)
@@ -64,6 +64,11 @@ type RepoCommon interface {
GetRemotes() (map[string]string, error)
}
+type RepoStorage interface {
+ // LocalStorage return a billy.Filesystem giving access to $RepoPath/.git/git-bug
+ LocalStorage() billy.Filesystem
+}
+
// RepoData give access to the git data storage
type RepoData interface {
// FetchRefs fetch git refs from a remote
@@ -145,4 +150,10 @@ type TestedRepo interface {
type repoTest interface {
// AddRemote add a new remote to the repository
AddRemote(name string, url string) error
+
+ // GetLocalRemote return the URL to use to add this repo as a local remote
+ GetLocalRemote() string
+
+ // EraseFromDisk delete this repository entirely from the disk
+ EraseFromDisk() error
}