aboutsummaryrefslogtreecommitdiffstats
path: root/common_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'common_test.go')
-rw-r--r--common_test.go20
1 files changed, 4 insertions, 16 deletions
diff --git a/common_test.go b/common_test.go
index f8f4e61..dad0a37 100644
--- a/common_test.go
+++ b/common_test.go
@@ -4,6 +4,7 @@ import (
"testing"
"gopkg.in/src-d/go-git.v4/plumbing"
+ "gopkg.in/src-d/go-git.v4/plumbing/cache"
"gopkg.in/src-d/go-git.v4/plumbing/format/packfile"
"gopkg.in/src-d/go-git.v4/plumbing/transport"
"gopkg.in/src-d/go-git.v4/storage/filesystem"
@@ -59,10 +60,7 @@ func (s *BaseSuite) NewRepository(f *fixtures.Fixture) *Repository {
dotgit = f.DotGit()
worktree = memfs.New()
- st, err := filesystem.NewStorage(dotgit)
- if err != nil {
- panic(err)
- }
+ st := filesystem.NewStorage(dotgit, cache.NewObjectLRUDefault())
r, err := Open(st, worktree)
if err != nil {
@@ -89,10 +87,7 @@ func (s *BaseSuite) NewRepositoryWithEmptyWorktree(f *fixtures.Fixture) *Reposit
worktree := memfs.New()
- st, err := filesystem.NewStorage(dotgit)
- if err != nil {
- panic(err)
- }
+ st := filesystem.NewStorage(dotgit, cache.NewObjectLRUDefault())
r, err := Open(st, worktree)
if err != nil {
@@ -113,14 +108,7 @@ func (s *BaseSuite) NewRepositoryFromPackfile(f *fixtures.Fixture) *Repository {
p := f.Packfile()
defer p.Close()
- n := packfile.NewScanner(p)
- d, err := packfile.NewDecoder(n, storer)
- if err != nil {
- panic(err)
- }
-
- _, err = d.Decode()
- if err != nil {
+ if err := packfile.UpdateObjectStorage(storer, p); err != nil {
panic(err)
}