union: fix mkdir at root with remote:/

Before the this fix if you specified remote:/ then the union backend
would fail to notice the root directory existed.

This was fixed by stripping the trailing / from the root.

See: https://forum.rclone.org/t/upgraded-from-1-45-to-1-54-now-cant-create-new-directory-within-union-mount/22284/
This commit is contained in:
Nick Craig-Wood 2021-02-16 16:05:27 +00:00
parent fdc0528bd5
commit d809930e1d
1 changed files with 1 additions and 1 deletions

View File

@ -67,7 +67,7 @@ func New(ctx context.Context, remote, root string, cacheTime time.Duration) (*Fs
return nil, err
}
f := &Fs{
RootPath: root,
RootPath: strings.TrimRight(root, "/"),
writable: true,
creatable: true,
cacheExpiry: time.Now().Unix(),