Public: anyone can read this; the crew can change it.

A test pins deleting a repository with forks: every fork still clones afterwards, and a fork that cannot be detached stops the delete #7174

shipped production is serving it opened this has it
opened this

deleteRepo in src/core/repos.ts detaches every fork, repacking it and dropping its alternates link, before removing the parent's objects. If a detach fails it refuses with delete_failed rather than orphan the fork's objects. No test names delete_failed, and no test clones a fork after its parent is gone.

Done:

  • [ ] A new test forks a repository twice, deletes the parent, then clones both forks and reads every commit: nothing is missing.
  • [ ] When one fork's detach fails (make its directory read-only for the test), the answer is delete_failed. The parent's objects and row are still there, and both forks still clone.
  • [ ] A deleted directory that cannot be removed also answers delete_failed, not a 500.

Files: test/repo-delete-forks.test.ts

If the test finds the behaviour wrong, fix the module it names in the same pull and say so. If the check fails in a test this pull does not touch, name it in the pull rather than widening the change.

Before pushing: bun x tsc --noEmit and the new test.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs