--delete-empty-src-dirs doesn't delete the src root, but only if the backend's DirMove doesn't work

What is the problem you are having with rclone?

Looks like the fallback path on sync.MoveDir will delete empty src directories if requested, except for the root of the src.

Is this a bug? It's certainly different from what the backend's DirMove operation does. Normally, when you rename a directory, you don't end up with an empty directory with the old name.

Run the command 'rclone version' and share the full output of the command.

Built from source at head!

rclone v1.70.0-beta.8550.83d3713df.cryptomator
- os/version: darwin 15.1.1 (64 bit)
- os/kernel: 24.1.0 (arm64)
- os/type: darwin
- os/arch: arm64 (ARMv8 compatible)
- go/version: go1.23.4
- go/linking: dynamic
- go/tags: none

Which cloud storage system are you using? (eg Google Drive)

easiest to reproduce with local

The command you were trying to run (eg rclone copy /tmp remote:tmp)

mkdir /tmp/a
# creating b too allows reproducing the problem with the local backend.
# this causes DirMove to fail which makes sync.MoveDir use the fallback path which has the bug.
mkdir /tmp/b
./rclone move --delete-empty-src-dirs /tmp/a /tmp/b

The rclone config contents with secrets removed.

none required

A log from the command with the -vv flag

2025/01/19 22:08:53 DEBUG : rclone: Version "v1.70.0-beta.8550.83d3713df.cryptomator" starting with parameters ["./rclone" "move" "--delete-empty-src-dirs" "/tmp/a" "/tmp/b" "-vv"]
2025/01/19 22:08:53 DEBUG : Creating backend with remote "/tmp/a"
2025/01/19 22:08:53 DEBUG : Using config file from "/Users/tbodt/.config/rclone/rclone.conf"
2025/01/19 22:08:53 DEBUG : Creating backend with remote "/tmp/b"
2025/01/19 22:08:53 DEBUG : Local file system at /tmp/b: Using server-side directory move
2025/01/19 22:08:53 INFO  : Local file system at /tmp/b: Server side directory move failed - fallback to file moves: can't copy directory - destination already exists
2025/01/19 22:08:53 DEBUG : Local file system at /tmp/b: Waiting for checks to finish
2025/01/19 22:08:53 DEBUG : Local file system at /tmp/b: Waiting for transfers to finish
2025/01/19 22:08:53 INFO  : There was nothing to transfer
2025/01/19 22:08:53 INFO  :
Transferred:   	          0 B / 0 B, -, 0 B/s, ETA -
Elapsed time:         0.0s

2025/01/19 22:08:53 DEBUG : 4 go routines active