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