shade: Fix VFS test issues

This commit is contained in:
jhasse-shade 2025-12-16 12:21:22 -05:00 committed by GitHub
parent fd439fab62
commit 3e21a7261b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 23 additions and 1 deletions

View File

@ -311,6 +311,8 @@ func (f *Fs) Move(ctx context.Context, src fs.Object, remote string) (fs.Object,
o := &Object{ o := &Object{
fs: f, fs: f,
remote: remote, remote: remote,
mtime: srcObj.mtime,
size: srcObj.size,
} }
fromFullPath := path.Join(src.Fs().Root(), srcObj.remote) fromFullPath := path.Join(src.Fs().Root(), srcObj.remote)
toFullPath := path.Join(f.root, remote) toFullPath := path.Join(f.root, remote)
@ -367,7 +369,18 @@ func (f *Fs) DirMove(ctx context.Context, src fs.Fs, srcRemote, dstRemote string
return fs.ErrorDirExists return fs.ErrorDirExists
} }
err := f.ensureParentDirectories(ctx, dstRemote) fullPathSrc := f.buildFullPath(srcRemote)
fullPathSrcUnencoded, err := url.QueryUnescape(fullPathSrc)
if err != nil {
return err
}
fullPathDstUnencoded, err := url.QueryUnescape(fullPath)
if err != nil {
return err
}
err = f.ensureParentDirectories(ctx, dstRemote)
if err != nil { if err != nil {
return err return err
} }
@ -378,6 +391,15 @@ func (f *Fs) DirMove(ctx context.Context, src fs.Fs, srcRemote, dstRemote string
} }
_, err = f.Move(ctx, o, dstRemote) _, err = f.Move(ctx, o, dstRemote)
if err == nil {
f.createdDirMu.Lock()
f.createdDirs[fullPathSrcUnencoded] = false
f.createdDirs[fullPathDstUnencoded] = true
f.createdDirMu.Unlock()
}
return err return err
} }