stage: fix commit (#3816)

This commit is contained in:
Ruslan Kuprieiev
2020-05-19 03:30:52 +03:00
committed by GitHub
parent afbb3a0add
commit 81d04f887a
2 changed files with 11 additions and 5 deletions
+1 -5
View File
@@ -377,11 +377,7 @@ class Stage(params.StageParams):
@staticmethod
def _changed_entries(entries):
return [
str(entry)
for entry in entries
if entry.checksum and entry.changed_checksum()
]
return [str(entry) for entry in entries if entry.changed_checksum()]
def _changed_stage_entry(self):
return f"'md5' of {self} changed."
+10
View File
@@ -70,3 +70,13 @@ def test_commit_changed_md5(tmp_dir, dvc):
dvc.commit(stage.path)
dvc.commit(stage.path, force=True)
def test_commit_no_exec(tmp_dir, dvc):
tmp_dir.gen({"dep": "dep", "out": "out"})
stage = dvc.run(
name="my", cmd="mycmd", deps=["dep"], outs=["out"], no_exec=True
)
assert dvc.status(stage.path)
dvc.commit(stage.path, force=True)
assert dvc.status(stage.path) == {}