Skip no-ops when moving
This commit is contained in:
@@ -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")
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user