Skip no-ops when moving

This commit is contained in:
Jakob Moser 2025-06-01 14:45:00 +02:00
parent e4f7172f88
commit b5649a349b
Signed by: jakob
GPG Key ID: 3EF2BA2851B3F53C

View File

@ -15,6 +15,10 @@ class MoveInstruction(Instruction):
new_path: Path new_path: Path
def __call__(self) -> None: def __call__(self) -> None:
if self.old_path == self.new_path:
# No-op
return
if self.new_path.exists(): if self.new_path.exists():
raise FileExistsError("New path already exists, not moving anything") raise FileExistsError("New path already exists, not moving anything")