diff --git a/dvc/path/data_item.py b/dvc/path/data_item.py index de93fe5ff..6a40c0ff1 100644 --- a/dvc/path/data_item.py +++ b/dvc/path/data_item.py @@ -1,4 +1,5 @@ import os +import stat import shutil from dvc.path.path import Path @@ -104,6 +105,6 @@ class DataItem(object): md5 = file_md5(self.data.relative)[0] self._cache_file = os.path.join(self.cache_dir, md5) self._git.modify_gitignore([self.data.relative]) - if os.path.isfile(self.cache.relative): - return - System.hardlink(self.data.relative, self.cache.relative) + if not os.path.isfile(self.cache.relative): + System.hardlink(self.data.relative, self.cache.relative) + os.chmod(self.data.relative, stat.S_IREAD)