aboutsummaryrefslogtreecommitdiffstats
path: root/repository/mock_repo.go
diff options
context:
space:
mode:
authorKalin Staykov <k.t.staykov@gmail.com>2022-11-26 15:49:59 +0200
committerMichael Muré <batolettre@gmail.com>2023-01-11 14:58:58 +0100
commitfc266b733cf0ea794209031e3500ab3f86db6cee (patch)
treebae1996ec19fb74446429200e52cdb942f60ac54 /repository/mock_repo.go
parent9c50a359704f4edd2f33df6d256e032feae3a576 (diff)
downloadgit-bug-fc266b733cf0ea794209031e3500ab3f86db6cee.tar.gz
add wipe sub-command that remove local bugs and identities
Diffstat (limited to 'repository/mock_repo.go')
-rw-r--r--repository/mock_repo.go12
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)