diff options
author | Mark <git@happybeing.com> | 2020-12-01 16:10:44 +0000 |
---|---|---|
committer | Michael Muré <batolettre@gmail.com> | 2020-12-05 21:41:09 +0100 |
commit | ecf1215ac92d96648f7fd5cc3990e81c61da43f8 (patch) | |
tree | 04c8e368f09c93470d0c6b466c0964101aefece8 /repository | |
parent | 61bfc51ebe4420982aa40e6b9d56d8ca114151c4 (diff) | |
download | git-bug-ecf1215ac92d96648f7fd5cc3990e81c61da43f8.tar.gz |
Add RepoStorage interface (for draft PR)
Diffstat (limited to 'repository')
-rw-r--r-- | repository/repo.go | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/repository/repo.go b/repository/repo.go index 4b45a1c5..93069d61 100644 --- a/repository/repo.go +++ b/repository/repo.go @@ -5,6 +5,7 @@ import ( "errors" "github.com/MichaelMure/git-bug/util/lamport" + "github.com/go-git/go-billy/v5" ) var ( @@ -20,6 +21,7 @@ type Repo interface { RepoKeyring RepoCommon RepoData + RepoStorage } // ClockedRepo is a Repo that also has Lamport clocks @@ -64,6 +66,11 @@ type RepoCommon interface { GetRemotes() (map[string]string, error) } +type RepoStorage interface { + // Storage returns a billy.Filesystem giving access to $RepoPath/.git/git-bug + Storage() billy.Filesystem +} + // RepoData give access to the git data storage type RepoData interface { // FetchRefs fetch git refs from a remote @@ -145,4 +152,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 } |