{"version":"2.1.269","anchor":"new-git-status-failure-reasons-ref-locked-layout-changed","canonical_anchor":"new-git-status-failure-reasons-ref-locked-layout-changed","heading":"Git checkout\/branch operations now detect stale locks and layout changes","tier":"notice","area":"Git Internals","scope":null,"heads_up":null,"url":"https:\/\/changelogs.core-directive.com\/v\/2.1.269\/e\/new-git-status-failure-reasons-ref-locked-layout-changed","release_url":"https:\/\/changelogs.core-directive.com\/v\/2.1.269","markdown":"### Git checkout\/branch operations now detect stale locks and layout changes\n\nGit branch-update and checkout-apply operations now check for stale locks and re-verify the working tree's layout before writing, failing safely instead of corrupting state\n\n**What**\n\n- The internal fast-forward helper used to advance a branch now takes `commonDir` and `layout` parameters, checks the branch ref lock, HEAD lock, and their `.pid.lock` companion files for staleness, adds a timeout to the underlying git calls, and re-verifies the on-disk layout hasn't changed before writing the new ref.\n\n- The function that applies an incoming cloud-session commit to a local checkout now takes a `layout` parameter and, right before writing, re-checks that the checkout's git directory (its identity, HEAD, the session ref and reflog, packed-refs, and the shape of `refs\/` and `objects\/`) hasn't changed since it was first read.\n\n- Git working-tree status and conflict-state enums gain two new values: `ref_locked` and `layout_changed`, used to abort these operations instead of writing on top of a moved or altered checkout.\n\n**Why** This protects against corrupting a repository when something else (another process, a concurrent session) has changed the git directory or holds a stale lock during a fast-forward or cloud-session sync, failing safely with a clear reason instead of writing bad state.\n\n- Area: Git Internals\n- Tier: You'll notice\n- Useful: 2\/5\n- Signal: 1\/5"}