mirror of
https://github.com/MichaelMure/git-bug.git
synced 2024-12-15 02:01:43 +03:00
Move new RepoStorage interface to GoGitRepo, revert repoTest
This commit is contained in:
parent
ecf1215ac9
commit
28adf41af6
@ -13,6 +13,7 @@ import (
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"github.com/go-git/go-billy"
|
||||
gogit "github.com/go-git/go-git/v5"
|
||||
"github.com/go-git/go-git/v5/config"
|
||||
"github.com/go-git/go-git/v5/plumbing"
|
||||
@ -32,6 +33,12 @@ type GoGitRepo struct {
|
||||
clocks map[string]lamport.Clock
|
||||
|
||||
keyring Keyring
|
||||
RepoStorage
|
||||
}
|
||||
|
||||
type RepoStorage interface {
|
||||
// Storage returns a billy.Filesystem giving access to $RepoPath/.git/git-bug
|
||||
Storage() billy.Filesystem
|
||||
}
|
||||
|
||||
func NewGoGitRepo(path string, clockLoaders []ClockLoader) (*GoGitRepo, error) {
|
||||
|
@ -5,7 +5,6 @@ import (
|
||||
"errors"
|
||||
|
||||
"github.com/MichaelMure/git-bug/util/lamport"
|
||||
"github.com/go-git/go-billy/v5"
|
||||
)
|
||||
|
||||
var (
|
||||
@ -21,7 +20,6 @@ type Repo interface {
|
||||
RepoKeyring
|
||||
RepoCommon
|
||||
RepoData
|
||||
RepoStorage
|
||||
}
|
||||
|
||||
// ClockedRepo is a Repo that also has Lamport clocks
|
||||
@ -66,11 +64,6 @@ 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
|
||||
@ -152,10 +145,4 @@ 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
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user