diff --git a/dvc/system.py b/dvc/system.py index 09c1b285e..666731f6b 100644 --- a/dvc/system.py +++ b/dvc/system.py @@ -61,7 +61,7 @@ class System(object): @staticmethod def inode(path): if System.is_unix(): - return os.stat(path).st_ino + return os.lstat(path).st_ino # getdirinfo from ntfsutils works on both files and dirs info = System.getdirinfo(path) diff --git a/dvc/utils.py b/dvc/utils.py index 509cd101c..25c98198d 100644 --- a/dvc/utils.py +++ b/dvc/utils.py @@ -99,6 +99,11 @@ def move(src, dst): if not os.path.exists(dname): os.makedirs(dname) + if os.path.islink(src): + shutil.copy(os.readlink(src), dst) + os.unlink(src) + return + shutil.move(src, dst)