aboutsummaryrefslogtreecommitdiffstats
path: root/plumbing/transport/server/loader.go
diff options
context:
space:
mode:
Diffstat (limited to 'plumbing/transport/server/loader.go')
-rw-r--r--plumbing/transport/server/loader.go10
1 files changed, 7 insertions, 3 deletions
diff --git a/plumbing/transport/server/loader.go b/plumbing/transport/server/loader.go
index 386c2f0..d4eccd4 100644
--- a/plumbing/transport/server/loader.go
+++ b/plumbing/transport/server/loader.go
@@ -5,8 +5,8 @@ import (
"gopkg.in/src-d/go-git.v4/plumbing/transport"
"gopkg.in/src-d/go-git.v4/storage/filesystem"
- "gopkg.in/src-d/go-billy.v2"
- "gopkg.in/src-d/go-billy.v2/osfs"
+ "gopkg.in/src-d/go-billy.v3"
+ "gopkg.in/src-d/go-billy.v3/osfs"
)
// DefaultLoader is a filesystem loader ignoring host and resolving paths to /.
@@ -34,7 +34,11 @@ func NewFilesystemLoader(base billy.Filesystem) Loader {
// storer for it. Returns transport.ErrRepositoryNotFound if a repository does
// not exist in the given path.
func (l *fsLoader) Load(ep transport.Endpoint) (storer.Storer, error) {
- fs := l.base.Dir(ep.Path())
+ fs, err := l.base.Chroot(ep.Path())
+ if err != nil {
+ return nil, err
+ }
+
if _, err := fs.Stat("config"); err != nil {
return nil, transport.ErrRepositoryNotFound
}