Revert sandbox after each exec to prevent stale state leaking back#376
Merged
Revert sandbox after each exec to prevent stale state leaking back#376
Conversation
When a user syncs changes to the sandbox and later reverts them locally, the next exec with an empty patch would skip the dirty file reset but update refs/rwx-sync to HEAD, causing pull to diff the stale sandbox working tree against a clean baseline and pull old changes back. Instead of relying on the next sync to clean up the previous exec's state, revert the sandbox to a clean HEAD immediately after pull. This simplifies sync (removes the per-file dirty reset) and ensures the sandbox is always in a known state between exec calls.
dc8209e to
245cc36
Compare
dan-manges
approved these changes
Feb 23, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
syncChangesToSandboxsince the sandbox is now always clean when sync runsgit checkout .) and then running exec again would pull stale files back from the sandbox, because the empty-patch path in sync skipped the dirty file resetTest plan
rwx-testing-sandbox.shthat reproduces the exact bug: syncs a file, deletes it locally from a fully clean working tree, execs again, and asserts the file doesn't reappearBefore
After