Skip to content

Commit e9f2da4

Browse files
committed
repo: drop_data_index: delete all first level nodes
1 parent 8d23a5e commit e9f2da4

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

dvc/repo/__init__.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -371,10 +371,11 @@ def data_index(self) -> "DataIndex":
371371
return self._data_index
372372

373373
def drop_data_index(self) -> None:
374-
try:
375-
self.data_index.delete_node(("tree",))
376-
except KeyError:
377-
pass
374+
for key in self.data_index.ls((), detail=False):
375+
try:
376+
self.data_index.delete_node(key)
377+
except KeyError:
378+
pass
378379
self.data_index.commit()
379380
self._reset()
380381

@@ -626,7 +627,7 @@ def site_cache_dir(self) -> str:
626627
# components were changed (useful to prevent newer dvc versions from
627628
# using older broken cache). Please reset this back to 0 if other parts
628629
# of the token components are changed.
629-
salt = 1
630+
salt = 2
630631

631632
# NOTE: This helps us avoid accidentally reusing cache for repositories
632633
# that just happened to be at the same path as old deleted ones.

0 commit comments

Comments
 (0)