aboutsummaryrefslogtreecommitdiffstats
path: root/plumbing/transport/server
diff options
context:
space:
mode:
authorMáximo Cuadros <mcuadros@gmail.com>2018-09-08 09:31:20 +0200
committerGitHub <noreply@github.com>2018-09-08 09:31:20 +0200
commit208b3c3c32beaab14ebb7adf162fc136c939e99c (patch)
tree33e2e984150cebe2105d84479538128bfaf2ff93 /plumbing/transport/server
parenta4b12e4161738af6f724776c0c8c55f90542f06f (diff)
parent8f6b3127c1ff7661113fff2662416c328971a285 (diff)
downloadgo-git-208b3c3c32beaab14ebb7adf162fc136c939e99c.tar.gz
Merge pull request #949 from kuba--/custom-cache
Expose Storage cache.
Diffstat (limited to 'plumbing/transport/server')
-rw-r--r--plumbing/transport/server/loader.go3
-rw-r--r--plumbing/transport/server/server_test.go4
2 files changed, 4 insertions, 3 deletions
diff --git a/plumbing/transport/server/loader.go b/plumbing/transport/server/loader.go
index c83752c..13b3526 100644
--- a/plumbing/transport/server/loader.go
+++ b/plumbing/transport/server/loader.go
@@ -1,6 +1,7 @@
package server
import (
+ "gopkg.in/src-d/go-git.v4/plumbing/cache"
"gopkg.in/src-d/go-git.v4/plumbing/storer"
"gopkg.in/src-d/go-git.v4/plumbing/transport"
"gopkg.in/src-d/go-git.v4/storage/filesystem"
@@ -43,7 +44,7 @@ func (l *fsLoader) Load(ep *transport.Endpoint) (storer.Storer, error) {
return nil, transport.ErrRepositoryNotFound
}
- return filesystem.NewStorage(fs)
+ return filesystem.NewStorage(fs, cache.NewObjectLRUDefault()), nil
}
// MapLoader is a Loader that uses a lookup map of storer.Storer by
diff --git a/plumbing/transport/server/server_test.go b/plumbing/transport/server/server_test.go
index 33d74d1..302ff48 100644
--- a/plumbing/transport/server/server_test.go
+++ b/plumbing/transport/server/server_test.go
@@ -3,6 +3,7 @@ package server_test
import (
"testing"
+ "gopkg.in/src-d/go-git.v4/plumbing/cache"
"gopkg.in/src-d/go-git.v4/plumbing/transport"
"gopkg.in/src-d/go-git.v4/plumbing/transport/client"
"gopkg.in/src-d/go-git.v4/plumbing/transport/server"
@@ -53,8 +54,7 @@ func (s *BaseSuite) prepareRepositories(c *C) {
fs := fixtures.Basic().One().DotGit()
s.Endpoint, err = transport.NewEndpoint(fs.Root())
c.Assert(err, IsNil)
- s.loader[s.Endpoint.String()], err = filesystem.NewStorage(fs)
- c.Assert(err, IsNil)
+ s.loader[s.Endpoint.String()] = filesystem.NewStorage(fs, cache.NewObjectLRUDefault())
s.EmptyEndpoint, err = transport.NewEndpoint("/empty.git")
c.Assert(err, IsNil)