From c1d35df630a6cb8c1e604fb2f1458b38578ef861 Mon Sep 17 00:00:00 2001 From: Ruslan Kuprieiev Date: Sun, 4 Mar 2018 15:50:17 +0200 Subject: [PATCH] checkout: don't forget to set perms back Fixes #505 Signed-off-by: Ruslan Kuprieiev --- dvc/command/checkout.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dvc/command/checkout.py b/dvc/command/checkout.py index a3d355967..690e341a1 100644 --- a/dvc/command/checkout.py +++ b/dvc/command/checkout.py @@ -14,10 +14,11 @@ class CmdCheckout(CmdBase): def remove_untracked_hardlinks(self): untracked = self.project.scm.untracked_files() - for file in self.project.cache.find_cache(untracked).keys(): + for file, md5 in self.project.cache.find_cache(untracked).items(): Logger.info(u'Remove \'{}\''.format(file)) os.chmod(file, stat.S_IWRITE) os.remove(file) + os.chmod(self.project.cache.get(md5), stat.S_IREAD) dir = os.path.dirname(file) if len(dir) != 0 and not os.listdir(dir):