Fix test isolation from user's global git config#129
Merged
k1LoW merged 1 commit intok1LoW:mainfrom Feb 11, 2026
Merged
Conversation
Tests fail when XDG_CONFIG_HOME is set and the user's global git config contains wt.* settings, because setting HOME to a temp dir does not prevent Git from reading $XDG_CONFIG_HOME/git/config. Add TestMain to set GIT_CONFIG_GLOBAL=/dev/null and GIT_CONFIG_SYSTEM=/dev/null (Git 2.32+) for both internal/git and e2e test packages. Closes k1LoW#128 Co-Authored-By: Claude Opus 4.6 <[email protected]>
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.
Summary
TestMaintointernal/gitande2etest packages to setGIT_CONFIG_GLOBAL=/dev/nullandGIT_CONFIG_SYSTEM=/dev/null, preventing user's global/system git config from leaking into testsXDG_CONFIG_HOMEis set and$XDG_CONFIG_HOME/git/configcontainswt.*settingsCloses #128
Details
Tests previously isolated from global git config by setting
HOMEto a temp directory. However, whenXDG_CONFIG_HOMEis explicitly set, Git reads$XDG_CONFIG_HOME/git/configregardless ofHOME, causing 5 test failures:TestLoadConfigTestIsBaseDirConfigured/not_configuredTestSetConfigTestE2E_LegacyBaseDirMigration/no_legacy_dir_uses_new_defaultTestE2E_LegacyBaseDirMigration/legacy_dir_exists_errorsUsing
GIT_CONFIG_GLOBAL/GIT_CONFIG_SYSTEMenvironment variables (Git 2.32+) is a more robust approach that works regardless ofXDG_CONFIG_HOME.Test plan
make testpassesmake cipassesXDG_CONFIG_HOMEset andwt.*global config present🤖 Generated with Claude Code