Skip to content

fix: refuse deleting the cwd or its parent - #3

Merged
hc-ui merged 2 commits into
mainfrom
cursor/refuse-cwd-rm-b68c
Aug 26, 2026
Merged

fix: refuse deleting the cwd or its parent#3
hc-ui merged 2 commits into
mainfrom
cursor/refuse-cwd-rm-b68c

Conversation

@hc-ui

@hc-ui hc-ui commented Aug 26, 2026

Copy link
Copy Markdown
Owner

Why

rm already refused filesystem roots, but longpath rm . -y / longpath rm .. -y could still wipe the working tree after confirmation.

What

  • Add cwd_delete_reason and call it from rm_path.
  • Tests cover ., os.getcwd(), .., sibling deletes, and the CLI.

Tests

PYTHONPATH=src python3 -m pytest -q → 158 passed, 7 skipped (Windows-only).

Does not repeat --top validation or py.typed / compileall tests.

@hc-ui
hc-ui marked this pull request as ready for review August 26, 2026 10:30
@hc-ui
hc-ui merged commit e737224 into main Aug 26, 2026
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant