fix(hooks): clear repository git environment for tests

Signed-off-by: Brian McNaboe <bmcnaboe@gmail.com>
This commit is contained in:
Brian McNaboe
2026-08-19 10:14:08 -04:00
parent 46ae198fc1
commit 7883507db6
+10 -1
View File
@@ -17,4 +17,13 @@ echo "pre-commit: security audit (source-level)..."
scripts/security-audit.sh
echo "pre-commit: building and running tests..."
make -j$(sysctl -n hw.ncpu 2>/dev/null || nproc) -f Makefile.cbm test
(
# Git exports repository-local variables to hooks. The test suite creates
# independent repositories and linked worktrees, so keep the commit's
# index and object paths out of those fixtures.
while IFS= read -r variable; do
unset "$variable"
done < <(git rev-parse --local-env-vars)
make -j"$(sysctl -n hw.ncpu 2>/dev/null || nproc)" -f Makefile.cbm test
)