Skip to content

fix: atomic clone/restore to prevent mirror directory destruction#222

Merged
alecthomas merged 1 commit intomainfrom
aat/atomic-clone-restore
Mar 24, 2026
Merged

fix: atomic clone/restore to prevent mirror directory destruction#222
alecthomas merged 1 commit intomainfrom
aat/atomic-clone-restore

Conversation

@alecthomas
Copy link
Collaborator

@alecthomas alecthomas commented Mar 24, 2026

Clone and snapshot restore now operate in a temporary directory and
rename into place only on success. Previously, a bogus upstream URL
like "https://github.com/" resolved to "state/git-mirrors/github.com"
and a failed restore would os.RemoveAll that path, nuking every GitHub
mirror on the pod.

@alecthomas alecthomas requested a review from a team as a code owner March 24, 2026 06:55
@alecthomas alecthomas requested review from stuartwdouglas and removed request for a team March 24, 2026 06:55
@alecthomas alecthomas enabled auto-merge (squash) March 24, 2026 06:55
@alecthomas alecthomas disabled auto-merge March 24, 2026 06:56
Clone and snapshot restore now operate in a temporary directory and
rename into place only on success. Previously, a bogus upstream URL
like "https://github.com/" resolved to "state/git-mirrors/github.com"
and a failed restore would os.RemoveAll that path, nuking every GitHub
mirror on the pod.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@alecthomas alecthomas force-pushed the aat/atomic-clone-restore branch from de77c25 to a9e5fcf Compare March 24, 2026 06:57
@alecthomas alecthomas changed the title aat/atomic clone restore fix: atomic clone/restore to prevent mirror directory destruction Mar 24, 2026
@alecthomas alecthomas merged commit 66344df into main Mar 24, 2026
8 checks passed
@alecthomas alecthomas deleted the aat/atomic-clone-restore branch March 24, 2026 06:59
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.

2 participants