Repository navigation
Conversation
Contributor
|
Thanks @skevy for the PR. This repo needs approval before a PR. Join the #contributors channel in Discord (https://discord.gg/kvBU6tJhcJ) and explain what you want to open a PR for and why. A maintainer then adds you to the allow list. This PR now closes on its own. Reopen it or open a new one after approval. |
Author
|
Sorry about this...wasn't an intentional PR. My apologies! |
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.
Human comments
What was wrong
A retry of completed Worktree provisioning required Git's symbolic HEAD to match the requested branch. JJ colocation detaches HEAD after creation, so a valid completed workspace fell through to forced removal and branch reset. Retrying could erase tracked edits, new files, deletions, staged changes, and JJ workspace state.
What changed
Reuse completed detached worktrees when the existing completion marker matches the request. Validate the canonical Git common directory and the exact registered, non-main worktree before reuse; leave foreign or unverifiable completed targets alone. Creation scans all worktree records for this identity check while adoption retains its existing 500-entry listing limit. Incomplete detached attempts and attached targets on the wrong branch keep their existing recovery behavior. No wire, CLI, or public SDK changes.
How you verified
pnpm exec turbo run test typecheck --filter=bb-plugin-environment-git-worktree: 106 tests across five files passed; typechecking passed.jj-worktree-overlay; source state and workspace registration stayed unchanged.git diff --checkpassed.