chunker: refactor to use fspath.SplitFs instead of fspath.Parse #4996

This commit is contained in:
Nick Craig-Wood 2021-02-10 14:32:01 +00:00
parent 71554c1371
commit 3761cf68b4
1 changed files with 1 additions and 5 deletions

View File

@ -277,14 +277,10 @@ func NewFs(ctx context.Context, name, rpath string, m configmap.Mapper) (fs.Fs,
return nil, errors.New("can't point remote at itself - check the value of the remote setting")
}
parsed, err := fspath.Parse(remote)
baseName, basePath, err := fspath.SplitFs(remote)
if err != nil {
return nil, errors.Wrapf(err, "failed to parse remote %q to wrap", remote)
}
baseName, basePath := parsed.ConfigString, parsed.Path
if baseName != "" {
baseName += ":"
}
// Look for a file first
remotePath := fspath.JoinRootPath(basePath, rpath)
baseFs, err := cache.Get(ctx, baseName+remotePath)