mirror of
https://github.com/Stone-Red-Code/dvc.git
synced 2026-11-08 15:28:26 +01:00
data: set read-only flag
Fixes #278 Fixes #277 Fixes #276 Signed-off-by: Ruslan Kuprieiev <[email protected]>
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user