From 4934a3b2fe3d95ae827c64ca7b75b1e6debd2b9a Mon Sep 17 00:00:00 2001 From: Alexander Schepanovski Date: Thu, 4 Jul 2019 19:51:27 +0700 Subject: [PATCH] dvc: fix #2219 --- dvc/remote/base.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/dvc/remote/base.py b/dvc/remote/base.py index 58cf47995..f7ede2e81 100644 --- a/dvc/remote/base.py +++ b/dvc/remote/base.py @@ -242,6 +242,17 @@ class RemoteBASE(object): return None checksum = self.state.get(path_info) + + # If we have dir checksum in state db, but dir cache file is lost, + # then we need to recollect the dir via .get_dir_checksum() call below, + # see https://github.com/iterative/dvc/issues/2219 for context + if ( + checksum + and self.is_dir_checksum(checksum) + and not self.exists(self.cache.checksum_to_path_info(checksum)) + ): + checksum = None + if checksum: return checksum