Skip to content

Commit

Permalink
destroy: also remove dvcignore file
Browse files Browse the repository at this point in the history
  • Loading branch information
dtrifiro committed Feb 10, 2022
1 parent 31a3461 commit 4db9d19
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
7 changes: 7 additions & 0 deletions dvc/ignore.py
Original file line number Diff line number Diff line change
Expand Up @@ -399,3 +399,10 @@ def init(path):
)

return dvcignore


def destroy(path):
from dvc.utils.fs import remove

dvcignore = os.path.join(path, DvcIgnore.DVCIGNORE_FILE)
remove(dvcignore)
2 changes: 2 additions & 0 deletions dvc/repo/destroy.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from dvc.ignore import destroy as destroy_dvcignore
from dvc.utils.fs import remove

from . import locked
Expand All @@ -15,4 +16,5 @@ def _destroy_stages(repo):
def destroy(repo):
_destroy_stages(repo)
repo.close()
destroy_dvcignore(repo.root_dir)
remove(repo.dvc_dir)
1 change: 1 addition & 0 deletions tests/func/test_repo.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ def test_destroy(tmp_dir, dvc, run_copy):
# Remove all the files related to DVC
for path in [
".dvc",
".dvcignore",
"file.dvc",
"file2.dvc",
"dir.dvc",
Expand Down

0 comments on commit 4db9d19

Please sign in to comment.