Skip to content

Commit 1367c9a

Browse files
authored
pytest(gitconfig) Avoid always reusing gitconfig (#512)
## Summary - Fix `gitconfig` fixture to always write config - removes early return that skipped writing when file exists - Follow-up to #510, #511 for #509 ## Problem The `gitconfig` fixture had an early return at lines 157-158: ```python if gitconfig.exists(): return gitconfig ``` If ANYTHING creates `.gitconfig` first (empty or incomplete) - git itself during `git init`, the nspawn container setup, another fixture - the fixture returns early WITHOUT writing `protocol.file.allow=always`. Confirmed by reporter running debug script: empty `.gitconfig` was created by container/git before the fixture could write the proper config. ## Solution Remove the early return. The fixture now always writes the complete config with `protocol.file.allow=always`.
2 parents e3ed829 + 522e3c4 commit 1367c9a

2 files changed

Lines changed: 11 additions & 3 deletions

File tree

CHANGES

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,17 @@ $ uv add libvcs --prerelease allow
2020
_Notes on the upcoming release will go here._
2121
<!-- END PLACEHOLDER - ADD NEW CHANGELOG ENTRIES BELOW THIS LINE -->
2222

23+
## libvcs 0.38.5 (unreleased)
24+
25+
### Bug Fixes
26+
27+
- pytest plugin: Fix `gitconfig` fixture to always write config (#512)
28+
29+
Follow-up to #510, #511 for #509: The fixture was returning early if
30+
`.gitconfig` already existed (even if empty or incomplete), skipping
31+
the write of `protocol.file.allow=always`. Now always writes the full
32+
config to ensure submodule operations work in strict build environments.
33+
2334
## libvcs 0.38.4 (2026-01-25)
2435

2536
### Tests

src/libvcs/pytest_plugin.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -154,9 +154,6 @@ def gitconfig(
154154
"""Return git configuration, pytest fixture."""
155155
gitconfig = user_path / ".gitconfig"
156156

157-
if gitconfig.exists():
158-
return gitconfig
159-
160157
gitconfig.write_text(
161158
textwrap.dedent(
162159
f"""

0 commit comments

Comments
 (0)