fix(locks): see claims written by a submodule under a linked worktree#643
Merged
NagyVikt merged 2 commits intoJun 9, 2026
Conversation
added 2 commits
June 9, 2026 22:30
`git worktree list` inside a submodule that lives in a LINKED worktree
reports the gitdir (<parent>/.git/worktrees/<wt>/modules/<sub>) as the
worktree path, not the actual working tree. load_all_locks only read
lock files from those reported roots, so validate could not see claims
the same checkout had just recorded — agent commits in such submodules
were always blocked ("staged files must be safely claimed").
Always include the caller's resolved repo_root in the roots list.
Regression test: parent repo + submodule + linked worktree; claim then
validate from inside the worktree's submodule (fails without the fix,
11/11 suite pass with it).
Review follow-up: cmd_status iterates list_worktree_roots directly, so the gitdir-quirk fix in load_all_locks left `gx locks status` blind to the same submodule-under-linked-worktree claims. Hoist the guard into list_worktree_roots so every caller (claim conflict scan, validate, status) sees the caller's own lock file; load_all_locks drops its local copy of the guard.
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.
Bug
git worktree listegy LINKED worktree-ben lévő submodule-ból a gitdirt (<parent>/.git/worktrees/<wt>/modules/<sub>) adja vissza worktree útként, nem a tényleges working tree-t. Aload_all_lockscsak ezekből a rootokból olvasott, így avalidatenem látta a saját, frissen felvett claimeket — az agent commitok ilyen submodule-okban mindig blokkolódtak (ma egy LIFTEDV2 session-ben kézzel kellett a lock-fájlt a gitdir alá tükrözni).Fix
A hívó feloldott
repo_root-ja mindig bekerül a rootok listájába (1 guardolt append aload_all_locks-ban).Teszt
Új regressziós teszt (parent + submodule + linked worktree, claim→validate a worktree submodule-jából): fix nélkül FAIL, fixszel a teljes suite 11/11 PASS.
🤖 Generated with Claude Code