fangorn/ex_git_objectstore
public
ref:37fa655b1f88eff6f643ac15303b3e27b28df263
fix(test): stop git upward-discovery escaping into the real repo
Under the full concurrent suite, integration/protocol tests run `git` in
scratch/temp dirs. If such a dir isn't itself a repo (a setup step raced or
failed under load), a mutating git command walks up the filesystem, finds
THIS project's .git, and silently corrupts the developer's checkout — rewrites
origin to a dead test server, force-updates origin/main, sets core.bare=true,
and leaves stray commits. Reproduced deterministically:
( cd tmp/x/not-a-repo && git config core.bare true ) # sets it on the PROJECT repo
Set GIT_CEILING_DIRECTORIES to the project root in test_helper so git's
upward search stops before the project root; a stray command now fails
`not in a git directory` in place instead of mutating the checkout. Adds a
regression test asserting the guard is set and that git cannot discover the
project repo from a scratch dir.
Contains the corruption; the underlying load-flakiness of the protocol/HTTP
tests is separate follow-up.
Closes #74
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
SHA:
37fa655b1f88eff6f643ac15303b3e27b28df263
Author:
t <t@t.com>
Date:
2026-07-10 06:48
Parents:
6463a30
2 files changed
+64
-0
| Type | ||
|---|---|---|
|
|
test/ex_git_objectstore/test_isolation_test.exs | +50 −0 |
|
||
|
|
test/test_helper.exs | +14 −0 |
|
||