Repository navigation
Conversation
Collaborator
Author
|
Closing: this needs a worktree finalization failure after |
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.
A failed prepared-worktree creation can remove its checkout but leave the newly created branch behind when a tag has the same name.
symbolic-ref --short HEADdisambiguatesfeatureasheads/feature, so rollback no longer recognizes the branch it just attached. A realheads/featurebranch with a matching tag has the same failure.Reuse the full symbolic-HEAD reader from prerequisite #35040 for this remaining rollback consumer. Compare its exact branch name before the existing owned-checkout removal, then retain the existing conditional branch deletion. Fence this parsed command's WSL login output through the existing capture option. No additional subprocess, filesystem operation, timer, cache, wire field or saved data is introduced.
Evidence and validation
prepareWorktreeCreateCheckoutandfinalizePreparedWorktreeflows run against actual Git 2.25.5 and 2.55.0. A real executablepost-checkouthook exits 23 after Git creates the branch, exercising ordinary failure cleanup without injecting a Git result or replacing the removal path. Each version is asserted through the production runner. Only observability is replaced in the external proof.featurecleans its branch on both versions of the code. A same-namefeaturetag and a realheads/featurebranch with a same-name tag each retain the branch on the parent and remove it after the fix. In all three cases the owned failed checkout registration is removed. A hook that switches to another branch preserves the newly created branch, and a hook that replaces the preparation lock preserves both branch and checkout. All 20 before/after public outcomes are asserted. Main HEAD, index and tracked file bytes remain unchanged; fixtures are removed.a6254dd186c0cffee452c7ee7552bc0d7cd2ad29. Requiredpnpm check:changed --base=2d3e7e452000c26433650d75422e79a06be80684 --maxWorkers=2selected 15 files and passed 21 of 23 checks. Catalog validation fails on three Turkish-only queued-message keys; the catalogs and validators byte-match the pinned baseline. The related-test selection was stopped after 600.65 seconds without an aggregate test summary or individual failure output. All four owned descendants were verified by ancestry/start time and exited. The gate exited 1 after 608.91 seconds; no complete broad-suite pass is claimed.Reachability and integration
Prepared workspace finalization attaches the new branch after moving the owned checkout. Checkout hooks, metadata/config writes, or other subsequent failures enter this existing rollback path. This change retains the fresh ownership-lock checks, double-force eligibility, removal-success condition, detached/unreadable handling, cleanup deadline and cancellation policy. It does not authorize cleanup after a competing owner takes over. The original finalization error still reaches its caller.
Stacked on #35040 because it supplies the existing exact branch-name reader; that PR changes history/upstream consumers but leaves this private short-name query. The rollback query was introduced with #24346 and predates the pinned base. Bounded open-PR searches for prepared-branch and finalization cleanup found no matching correction; this is a scoped search, not an exhaustive duplicate guarantee. Preserve independent preparation-lock and finalization safety work when integrating.
Linux with both Git versions is verified. Native Windows/WSL/macOS, live SSH, physical mobile, Electron and a packaged build were not run. Execution hosts need this backend fix where they perform prepared finalization. Folder-only workspaces do not enter this Git preparation path. The proof concerns rollback correctness, with no measured latency or whole-app RAM claim. Screenshots are not applicable to the backend identity change; public outcomes are recorded directly.