diff options
Diffstat (limited to 'repository/mock_repo.go')
-rw-r--r-- | repository/mock_repo.go | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/repository/mock_repo.go b/repository/mock_repo.go index c2cef8ef..6ea5c71e 100644 --- a/repository/mock_repo.go +++ b/repository/mock_repo.go @@ -9,7 +9,6 @@ import ( "github.com/99designs/keyring" "github.com/ProtonMail/go-crypto/openpgp" - "github.com/go-git/go-billy/v5" "github.com/go-git/go-billy/v5/memfs" "github.com/MichaelMure/git-bug/util/lamport" @@ -123,14 +122,14 @@ func (r *mockRepoCommon) GetRemotes() (map[string]string, error) { var _ RepoStorage = &mockRepoStorage{} type mockRepoStorage struct { - localFs billy.Filesystem + localFs LocalStorage } func NewMockRepoStorage() *mockRepoStorage { - return &mockRepoStorage{localFs: memfs.New()} + return &mockRepoStorage{localFs: billyLocalStorage{Filesystem: memfs.New()}} } -func (m *mockRepoStorage) LocalStorage() billy.Filesystem { +func (m *mockRepoStorage) LocalStorage() LocalStorage { return m.localFs } @@ -204,6 +203,11 @@ func (m *mockIndex) DocCount() (uint64, error) { return uint64(len(*m)), nil } +func (m *mockIndex) Remove(id string) error { + delete(*m, id) + return nil +} + func (m *mockIndex) Clear() error { for k, _ := range *m { delete(*m, k) |