Summary
Nine of the ten growth-guards/tests/*.test.sh suites run git init / git commit against
fixture repos while INHERITING the caller's global and system git configuration. Only
install-git-hooks.test.sh neutralizes it.
Evidence
install-git-hooks.test.sh sets HOME, XDG_CONFIG_HOME and GIT_CONFIG_NOSYSTEM before
touching a fixture. The other nine do not, so on a machine carrying any of:
core.hooksPath — the caller's own hooks run against the fixture repos;
init.templateDir — fixture repos are seeded with the caller's template, including hooks;
commit.gpgsign = true — fixture commits block or fail on a missing/locked key;
commit.template, core.autocrlf, core.safecrlf — commit bodies and line endings shift;
…the suites produce spurious reds, or worse, silently execute the developer's hooks against
generated fixtures.
This is not theoretical for consumers that WIRE these suites into CI (drovr now does, via
tools/vendored-skill-tests growth-guards): a hosted runner is clean, but a developer machine
or a self-hosted runner need not be.
Suggested fix
Hoist the neutralization install-git-hooks.test.sh already does into the shared setup every
suite sources, so all ten get HOME / XDG_CONFIG_HOME pointed at the scratch dir and
GIT_CONFIG_NOSYSTEM=1 exported.
Repro
git config --global core.hooksPath /tmp/somewhere, then run any of the nine.
Summary
Nine of the ten
growth-guards/tests/*.test.shsuites rungit init/git commitagainstfixture repos while INHERITING the caller's global and system git configuration. Only
install-git-hooks.test.shneutralizes it.Evidence
install-git-hooks.test.shsetsHOME,XDG_CONFIG_HOMEandGIT_CONFIG_NOSYSTEMbeforetouching a fixture. The other nine do not, so on a machine carrying any of:
core.hooksPath— the caller's own hooks run against the fixture repos;init.templateDir— fixture repos are seeded with the caller's template, including hooks;commit.gpgsign = true— fixture commits block or fail on a missing/locked key;commit.template,core.autocrlf,core.safecrlf— commit bodies and line endings shift;…the suites produce spurious reds, or worse, silently execute the developer's hooks against
generated fixtures.
This is not theoretical for consumers that WIRE these suites into CI (drovr now does, via
tools/vendored-skill-tests growth-guards): a hosted runner is clean, but a developer machineor a self-hosted runner need not be.
Suggested fix
Hoist the neutralization
install-git-hooks.test.shalready does into the shared setup everysuite sources, so all ten get
HOME/XDG_CONFIG_HOMEpointed at the scratch dir andGIT_CONFIG_NOSYSTEM=1exported.Repro
git config --global core.hooksPath /tmp/somewhere, then run any of the nine.