You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 0a61db1
Browse filesBrowse the repository at this point in the historyBrowse files
fix(tooling): isolate git children from ambient GIT_* and make a shared core.bare flip loud (#16646)
A gate self-test that shells out to `git` inherited the repository location a
hook exports (`GIT_DIR` / `GIT_WORK_TREE` / `GIT_INDEX_FILE`), which outranks
`cwd`: its `git add -A` staged 8,190 paths as deleted in the real index and its
`git init` wrote `core.bare = true` into the SHARED `.git/config`, breaking the
primary checkout for every agent on the box. Every case still printed `ok`.
- scripts/git-env.mjs: the class rule in one place. `gitFreeEnv()` for a git
child that must stay inside its own `cwd`, `withoutGitEnv()` for a call one
frame down that passes no environment of its own, and the boundary stated
where it can be read: never strip for a child that fetches or pushes, because
GIT_CONFIG_* and GIT_SSL_* carry the transport configuration. Its self-test
reproduces the leak against real git (red) before proving the strip (green).
- scripts/symbol-anchors.mjs: `trackedFiles` passes an explicit stripped
environment, so a sweep of a synthetic root can no longer answer with the real
repository's file list. Pinned by a self-test case that injects a bogus
GIT_DIR and requires the sweep to resolve its own tree; before the change that
case threw.
- The two corpus gates built on that resolver build their fixture repositories
the same way, so both spawn stripped too.
- scripts/check-system-context-census.mjs drops its local copy of the strip and
imports the shared one; its regression pin is unchanged.
- scripts/setup-git-hooks.mjs carries the tripwire. In the flipped state no
commit is possible, so no hook can be the alarm; `pnpm install` is the first
thing that runs after the damage. It warns there and refuses under
`--self-test`. Measured: `rev-parse --is-inside-work-tree` prints `false` and
exits 0 under the flip, so the predicate reads `core.bare` on the shared
common dir, which is also the only reading a linked worktree can take.
Refs #16624
Claude-Session: https://claude.ai/code/session_01Vbw3RPgdtqesx4azk9SbW8
Co-authored-by: Claude <noreply@anthropic.com>
0 commit comments