Skip to content

fix(locks): see claims written by a submodule under a linked worktree#643

Merged
NagyVikt merged 2 commits into
mainfrom
agent/claude/fix-file-registry-submodule-gitdir-root-2026-06-09-22-27
Jun 9, 2026
Merged

fix(locks): see claims written by a submodule under a linked worktree#643
NagyVikt merged 2 commits into
mainfrom
agent/claude/fix-file-registry-submodule-gitdir-root-2026-06-09-22-27

Conversation

@NagyVikt

@NagyVikt NagyVikt commented Jun 9, 2026

Copy link
Copy Markdown
Collaborator

Bug

git worktree list egy 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. A load_all_locks csak ezekből a rootokból olvasott, így a validate nem 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 a load_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

NagyVikt 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.
@NagyVikt NagyVikt merged commit 16632aa into main Jun 9, 2026
2 of 3 checks passed
@NagyVikt NagyVikt deleted the agent/claude/fix-file-registry-submodule-gitdir-root-2026-06-09-22-27 branch June 9, 2026 20:42
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.

1 participant