Commit d714fa7
Isolate test suite git commands from ambient global/system git config
Central_test_helpers.init_repo already isolates the throwaway test repos
from the local machine's user.name/user.email, but nothing else: a global
commit.gpgsign (blocking on a hardware key or gpg-agent prompt) or a global
core.hooksPath (running pre-commit/pre-push hooks) still apply to every
commit and push the test suite makes, and can turn an otherwise ~1-2s test
run into one that hangs or crawls for reasons that have nothing to do with
central itself.
Point GIT_CONFIG_GLOBAL and GIT_CONFIG_SYSTEM at /dev/null for the test
process - git's documented way to load no config file there. The spawned
central.exe subprocess (and any git it shells out to) inherits this
process's environment, so this isolates every git invocation the suite
makes, not just the ones issued directly.
Verified with a fake HOME carrying commit.gpgsign pointed at a slow signer
plus a sleeping core.hooksPath hook: one partition (todo.ml) went from
3.28s to 0.32s (~10x) with this change, and dune build @ALL @runtest /
@fmt / @lint all still pass clean.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>1 parent d85a8f9 commit d714fa7
1 file changed
Lines changed: 17 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
7 | 24 | | |
8 | 25 | | |
9 | 26 | | |
| |||
0 commit comments