fix: keep fixture scripts isolated when they set GIT_CONFIG_COUNT themselves - #2982
Merged
Sebastian Thiel (Byron) merged 2 commits intoSep 9, 2026
Conversation
…mselves The isolation configuration (no signing, no auto-maintenance, `init.defaultBranch=main`) reached scripts only as `GIT_CONFIG_COUNT` variables, so a script exporting its own `GIT_CONFIG_COUNT` replaced all of it. With maintenance back on, each commit in such a script spawned a detached `git maintenance run --auto` that could outlive the script and mutate the fixture while it was being copied, failing tests with a bare ENOENT. - the isolation now lives in a global configuration file under `tests/fixtures/generated-do-not-edit/`, written once per process; a script's own `GIT_CONFIG_COUNT` layers on top of it - ambient `GIT_CONFIG_COUNT` is removed from the script environment, as it used to be overwritten - a script or `git()` call that writes global configuration fails with a clear message and the file is restored, so the mistake stays contained to the offender Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 13d784dce6
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "Codex (@codex) review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "Codex (@codex) address that feedback".
Member
|
Thanks a lot for the hint! This was definitely a shortcoming of the current implementation, and it's now using |
Sebastian Thiel (Byron)
force-pushed
the
testtools-config-file-isolation
branch
from
September 9, 2026 03:13
de6cb5c to
bc9185d
Compare
Mattias Granlund (mtsgrd)
added a commit
to gitbutlerapp/gitbutler
that referenced
this pull request
Sep 9, 2026
- no test references merge-signed-with-two-branches-line-offset or two-signed-commits-with-line-offset; only their committed archives and the archive whitelist mentioned them - both scripts replaced GIT_CONFIG_COUNT with their own entries, dropping gix-testtools' isolation; the live signed fixtures do the same, and the fix for that is upstream (GitoxideLabs/gitoxide#2982), arriving with the next gix bump Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The isolation config (no signing, no auto-maintenance,
init.defaultBranch=main) reaches fixture scripts only asGIT_CONFIG_COUNTvariables, so a script exporting its ownGIT_CONFIG_COUNTdrops all of it. Each commit then spawns a detachedgit maintenance run --autothat races the fixture copy, and the test fails with a bare ENOENT. We hit this as a flaky test in GitButler and worked around it per script in gitbutlerapp/gitbutler#15785; this fixes it at the source.tests/fixtures/generated-do-not-edit/; a script's ownGIT_CONFIG_COUNTlayers on topgit()call that writes global config fails and the file is restored, matching the oldGIT_CONFIG_GLOBAL=/dev/nullbehaviourVerified with
cargo test -p gix-testtools(newisolationtest) andGIX_TEST_IGNORE_ARCHIVES=1 cargo testfor gix-config, gix-merge, gix-ref, gix-discover, gix-dir and gix-status.🤖 Generated with Claude Code