From 3f1820053910d2753871b1c4be2c54c2c691208e Mon Sep 17 00:00:00 2001 From: Ruslan Kuprieiev Date: Sun, 21 Oct 2018 07:13:13 +0300 Subject: [PATCH] link: don't create links for empty files Related to #1222 Signed-off-by: Ruslan Kuprieiev --- dvc/remote/local.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/dvc/remote/local.py b/dvc/remote/local.py index 3406af86a..7e1c2d2d1 100644 --- a/dvc/remote/local.py +++ b/dvc/remote/local.py @@ -127,6 +127,14 @@ class RemoteLOCAL(RemoteBase): if not os.path.exists(dname): os.makedirs(dname) + # NOTE: just create an empty file for an empty cache + if os.path.getsize(cache) == 0: + open(path, 'w+').close() + msg = "Created empty file: {} -> {}" + self.project.logger.info(msg.format(os.path.relpath(cache), + os.path.relpath(path))) + return + i = len(self.cache_types) while i > 0: try: