1
mirror of https://github.com/rclone/rclone synced 2024-09-29 04:49:43 +02:00

s3: fix purging of root directory with --s3-directory-markers - fixes #7247

This commit is contained in:
Nick Craig-Wood 2023-08-25 17:39:16 +01:00
parent 9c14562850
commit b95bda1e92

View File

@ -4833,6 +4833,10 @@ func (f *Fs) purge(ctx context.Context, dir string, oldOnly bool) error {
if isDirectory {
return nil
}
// If the root is a dirmarker it will have lost its trailing /
if remote == "" {
remote = "/"
}
oi, err := f.newObjectWithInfo(ctx, remote, object, versionID)
if err != nil {
fs.Errorf(object, "Can't create object %+v", err)