Merge pull request #707 from efiop/master

dvc: print warning when file/dir is empty
This commit is contained in:
Ruslan Kuprieiev
2018-05-15 23:08:58 +03:00
committed by GitHub
2 changed files with 5 additions and 1 deletions
+4
View File
@@ -98,6 +98,10 @@ class Dependency(object):
if not os.path.isfile(self.path) and not os.path.isdir(self.path):
raise CmdOutputIsNotFileOrDirError(self.rel_path)
if (os.path.isfile(self.path) and os.path.getsize(self.path) == 0) or \
(os.path.isdir(self.path) and len(os.listdir(self.path)) == 0):
self.project.logger.warn("File/directory '{}' is empty.".format(self.rel_path))
self.md5 = self.project.state.update(self.path)
@staticmethod
+1 -1
View File
@@ -87,7 +87,7 @@ class Git(Base):
gitignore = os.path.abspath(os.path.realpath(gitignore))
if not gitignore.startswith(self.root_dir):
raise FileNotInRepoError()
raise FileNotInRepoError(path)
return entry, gitignore