Commit 68f79bf
Add a check that fixture directories are usable by git
Many tests rely on git accepting their fixture directories -- the
GitPython working tree and the vendored gitdb and smmap submodule
working trees. When git rejects one for "dubious ownership", typically
because a CI workflow's safe.directory list is missing an entry,
downstream tests fail in opaque ways: IndexError in
test_docs::Tutorials::test_submodules, AssertionError in
test_repo::TestRepo::test_submodules and
test_submodule::TestSubmodule::test_root_module, plus BrokenPipeError
or ValueError elsewhere depending on a race between Python's flush and
pipe-close on the cached "git cat-file --batch-check" subprocess.
test/test_fixture_health.py runs `git rev-parse --show-toplevel` in
each fixture directory and asserts both that git is willing to operate
there and that it reports the directory as its own toplevel. The
failure message names safe.directory and ownership as the likely
causes, so a misconfigured environment is recognizable directly from
the test output rather than only inferable from the cascade of
downstream failures.
This commit adds the test only. On the Cygwin CI workflow as
configured at this commit, the test fails for gitdb and smmap,
demonstrating the bug. Subsequent commits in this chain reproduce the
bug at scale and apply the fix.
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent cb49492 commit 68f79bf
1 file changed
Lines changed: 87 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
0 commit comments