mirror of
https://github.com/Stone-Red-Code/dvc.git
synced 2026-11-06 07:18:28 +01:00
Merge pull request #2231 from efiop/2146
checkout: safe_remove output if no checksum is found
This commit is contained in:
+5
-2
@@ -767,8 +767,11 @@ class RemoteBASE(object):
|
||||
|
||||
checksum = checksum_info.get(self.PARAM_CHECKSUM)
|
||||
if not checksum:
|
||||
msg = "No checksum info for '{}'."
|
||||
logger.debug(msg.format(str(path_info)))
|
||||
logger.warning(
|
||||
"No checksum info found for '{}'. "
|
||||
"It won't be created.".format(str(path_info))
|
||||
)
|
||||
self.safe_remove(path_info, force=force)
|
||||
return
|
||||
|
||||
if not self.changed(path_info, checksum_info):
|
||||
|
||||
@@ -575,3 +575,9 @@ class TestCheckoutMovedCacheDirWithSymlinks(TestDvc):
|
||||
relpath(old_data_link, old_cache_dir),
|
||||
relpath(new_data_link, new_cache_dir),
|
||||
)
|
||||
|
||||
|
||||
def test_checkout_no_checksum(repo_dir, dvc_repo):
|
||||
stage = dvc_repo.run(outs=[repo_dir.FOO], no_exec=True, cmd="somecmd")
|
||||
dvc_repo.checkout(stage.path, force=True)
|
||||
assert not os.path.exists(repo_dir.FOO)
|
||||
|
||||
Reference in New Issue
Block a user