dvc: properly save symlinks

Signed-off-by: Ruslan Kuprieiev <[email protected]>
This commit is contained in:
Ruslan Kuprieiev
2018-07-05 20:00:58 +03:00
parent 08b3273fcc
commit 468f4beee7
2 changed files with 6 additions and 1 deletions
+1 -1
View File
@@ -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)
+5
View File
@@ -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)