diff --git a/nixpkgs_review/builddir.py b/nixpkgs_review/builddir.py index c53652b..e4fd9d5 100644 --- a/nixpkgs_review/builddir.py +++ b/nixpkgs_review/builddir.py @@ -1,5 +1,4 @@ import os -import shutil import signal from pathlib import Path from tempfile import TemporaryDirectory @@ -74,7 +73,6 @@ def __exit__(self, exc_type: Any, exc_value: Any, traceback: Any) -> None: os.environ.update(self.environ) with DisableKeyboardInterrupt(): - shutil.rmtree(self.worktree_dir) - sh(["git", "worktree", "prune"]) + sh(["git", "worktree", "remove", "-f", str(self.worktree_dir)]) self.overlay.cleanup()