repo: move: save stage after moving

This commit is contained in:
pared
2019-08-21 14:34:23 +02:00
parent 4d267ef742
commit c4de07b2bd
2 changed files with 9 additions and 0 deletions
+1
View File
@@ -65,5 +65,6 @@ def move(self, from_path, to_path):
with self.state:
out.move(to_out)
stage.save()
stage.dump()
+8
View File
@@ -192,3 +192,11 @@ class TestMoveFileInsideDirectory(TestDvc):
dvc_fullpath = os.path.join(self.DATA_DIR, "data.txt.dvc")
self.assertTrue(os.path.exists(data_fullpath))
self.assertTrue(os.path.exists(dvc_fullpath))
def test_move_should_save_stage_info(dvc_repo, repo_dir):
dvc_repo.add(repo_dir.DATA_DIR)
dvc_repo.move(repo_dir.DATA_DIR, "new_name")
assert dvc_repo.status() == {}