Group of 4 Under the hood
Git 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
What
- The internal fast-forward helper used to advance a branch now takes
commonDirandlayoutparameters, checks the branch ref lock, HEAD lock, and their.pid.lockcompanion 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. - The function that applies an incoming cloud-session commit to a local checkout now takes a
layoutparameter 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 ofrefs/andobjects/) hasn't changed since it was first read. - Git working-tree status and conflict-state enums gain two new values:
ref_lockedandlayout_changed, used to abort these operations instead of writing on top of a moved or altered checkout.
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.