Problem
packages/host/engine/tests/integration/git-diff.test.ts creates temporary Git repositories.
The fixture commits inherit the user's global core.hooksPath.
A global commit-msg hook can reject fixture messages such as init.
This causes the integration test to fail before it reaches readGitDiff.
Reproduction
Set a global hooks path that runs commitlint.
git config --global core.hooksPath ~/.git-hooks
Run:
pnpm exec vitest run packages/host/engine/tests/integration/git-diff.test.ts
The fixture commit fails with subject-empty and type-empty.
The test already disables GPG signing with commit.gpgsign=false.
Root cause
The test does not override core.hooksPath for fixture commits.
Git therefore runs hooks from the user environment.
Fix
In packages/host/engine/tests/integration/git-diff.test.ts, add this config before commit:
'-c',
`core.hooksPath=${join(cwd, '.git', 'hooks')}`,
Use the fixture repository's own .git/hooks directory.
The default hooks there are safe and do not inherit user hooks.
Validation
A minimal temporary repository commits init successfully when this override is set.
The same commit fails without it when the global commitlint hook is active.
Problem
packages/host/engine/tests/integration/git-diff.test.tscreates temporary Git repositories.The fixture commits inherit the user's global
core.hooksPath.A global
commit-msghook can reject fixture messages such asinit.This causes the integration test to fail before it reaches
readGitDiff.Reproduction
Set a global hooks path that runs commitlint.
git config --global core.hooksPath ~/.git-hooksRun:
pnpm exec vitest run packages/host/engine/tests/integration/git-diff.test.tsThe fixture commit fails with
subject-emptyandtype-empty.The test already disables GPG signing with
commit.gpgsign=false.Root cause
The test does not override
core.hooksPathfor fixture commits.Git therefore runs hooks from the user environment.
Fix
In
packages/host/engine/tests/integration/git-diff.test.ts, add this config beforecommit:Use the fixture repository's own
.git/hooksdirectory.The default hooks there are safe and do not inherit user hooks.
Validation
A minimal temporary repository commits
initsuccessfully when this override is set.The same commit fails without it when the global commitlint hook is active.