aboutsummaryrefslogtreecommitdiffstats
path: root/storage/filesystem/object_test.go
diff options
context:
space:
mode:
authorMáximo Cuadros <mcuadros@gmail.com>2016-08-21 01:06:59 +0200
committerMáximo Cuadros <mcuadros@gmail.com>2016-08-21 01:06:59 +0200
commitc9f0c29f423f9bb26f32d6e8c7098f275171afb9 (patch)
tree9c746b16c92a6820f34d504a2a2dd6881d65f559 /storage/filesystem/object_test.go
parent4652c0e753c88e63ba111d49aa58edc655806c03 (diff)
downloadgo-git-c9f0c29f423f9bb26f32d6e8c7098f275171afb9.tar.gz
storage/filesystem: ConfigStore implementation
Diffstat (limited to 'storage/filesystem/object_test.go')
-rw-r--r--storage/filesystem/object_test.go17
1 files changed, 9 insertions, 8 deletions
diff --git a/storage/filesystem/object_test.go b/storage/filesystem/object_test.go
index 8bca5c6..692a69b 100644
--- a/storage/filesystem/object_test.go
+++ b/storage/filesystem/object_test.go
@@ -104,7 +104,7 @@ func (s *FsSuite) TestGetCompareWithMemoryStorage(c *C) {
}
}
-func memStorageFromGitDir(fs fs.FS, path string) (*memory.ObjectStorage, error) {
+func memStorageFromGitDir(fs fs.FS, path string) (core.ObjectStorage, error) {
dir, err := dotgit.New(fs, path)
if err != nil {
return nil, err
@@ -120,10 +120,11 @@ func memStorageFromGitDir(fs fs.FS, path string) (*memory.ObjectStorage, error)
return nil, err
}
- sto := memory.NewObjectStorage()
+ sto := memory.NewStorage()
r := packfile.NewStream(f)
d := packfile.NewDecoder(r)
- err = d.Decode(sto)
+
+ err = d.Decode(sto.ObjectStorage())
if err != nil {
return nil, err
}
@@ -133,7 +134,7 @@ func memStorageFromGitDir(fs fs.FS, path string) (*memory.ObjectStorage, error)
return nil, err
}
- return sto, nil
+ return sto.ObjectStorage(), nil
}
func equalsStorages(a, b core.ObjectStorage) (bool, string, error) {
@@ -246,7 +247,7 @@ func (s *FsSuite) TestIterCompareWithMemoryStorage(c *C) {
}
}
-func memStorageFromDirPath(fs fs.FS, path string) (*memory.ObjectStorage, error) {
+func memStorageFromDirPath(fs fs.FS, path string) (core.ObjectStorage, error) {
dir, err := dotgit.New(fs, path)
if err != nil {
return nil, err
@@ -257,7 +258,7 @@ func memStorageFromDirPath(fs fs.FS, path string) (*memory.ObjectStorage, error)
return nil, err
}
- sto := memory.NewObjectStorage()
+ sto := memory.NewStorage()
f, err := fs.Open(packfilePath)
if err != nil {
return nil, err
@@ -265,7 +266,7 @@ func memStorageFromDirPath(fs fs.FS, path string) (*memory.ObjectStorage, error)
r := packfile.NewStream(f)
d := packfile.NewDecoder(r)
- err = d.Decode(sto)
+ err = d.Decode(sto.ObjectStorage())
if err != nil {
return nil, err
}
@@ -274,7 +275,7 @@ func memStorageFromDirPath(fs fs.FS, path string) (*memory.ObjectStorage, error)
return nil, err
}
- return sto, nil
+ return sto.ObjectStorage(), nil
}
func iterToSortedSlice(storage core.ObjectStorage, typ core.ObjectType) ([]core.Object,