Skip to content

fix(clone): claim a clone's directory before writing to it - #178

Open
PiquelChips wants to merge 1 commit into
fix/kill-the-test-server-when-itfrom
fix/claim-a-clone-s-directory-before
Open

PiquelChips wants to merge 1 commit into
fix/kill-the-test-server-when-itfrom
fix/claim-a-clone-s-directory-before

Conversation

@PiquelChips

Copy link
Copy Markdown
Member

Two clones into the same empty directory could both find it empty. If one then failed, its cleanup deleted everything in the directory, including what the other clone wrote, even after that clone had succeeded.

A clone now claims its directory before writing anything, by creating .origin with create_dir. Only one clone can do that. The other fails as if the directory had files in it, and a clone only cleans up a directory it claimed.

Part of #166.

Note

Written by Claude Opus 5.5 in Claude Code (via T3 Code)

@coderabbitai

coderabbitai Bot commented Nov 22, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 73fb6ff4-84f3-4d97-bbf9-7cf912e05611

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@PiquelChips
PiquelChips added this pull request to stack #185 November 22, 2026 20:21
@PiquelChips
PiquelChips removed this pull request from stack #185 November 22, 2026 20:22
Two clones into one empty directory could both find it empty, and when
one failed, cleaning up deleted what the other wrote, even once it had
succeeded. A clone now claims its directory first, by creating `.origin`
with `create_dir`, which only one can do: the other fails as if the
directory had files, and only a clone that claimed the directory ever
cleans it up.
@PiquelChips
PiquelChips force-pushed the fix/kill-the-test-server-when-it branch from 03fa2cf to ca7bcb0 Compare November 22, 2026 20:22
@PiquelChips
PiquelChips force-pushed the fix/claim-a-clone-s-directory-before branch from 0368eb0 to 2cb1d16 Compare November 22, 2026 20:22
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