Skip to content

Commit 0f6abbf

Browse files
committed
BF: do not bother copying file into itself
1 parent 900e48b commit 0f6abbf

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

heudiconv/utils.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -358,6 +358,9 @@ def safe_copyfile(src, dest, overwrite=False):
358358
"""
359359
if op.isdir(dest):
360360
dest = op.join(dest, op.basename(src))
361+
if op.realpath(src) == op.realpath(dest):
362+
lgr.debug("Source %s = destination %s", src, dest)
363+
return
361364
if op.lexists(dest):
362365
if not overwrite:
363366
raise RuntimeError(

0 commit comments

Comments
 (0)