Repository navigation
test: plugin install over git reads no host git config (orca #48, slice 6) - #54
Merged
nachumi-a2zoperations merged 1 commit intoNov 15, 2026
Conversation
…ce 6)
Root cause of plugin-cli-install.integration.test.ts failing on the
MacBook ("fatal: Remote branch master not found in upstream origin",
on Node and on Bun): the test made its repositories with a plain
`git init` and later asks the catalog source for ref 'master'. A plain
init takes its first branch from host config, and this MacBook's git
(2.54.0, Apple Git-157) reads Xcode's system gitconfig, which sets
init.defaultBranch=main. A host without that setting passed.
Fix (test only; the Leader's rule: no host or Xcode git config read at
all):
- both inits name the branch: --initial-branch=master;
- isolateGitConfig(): GIT_CONFIG_NOSYSTEM=1, GIT_CONFIG_GLOBAL = a file
in the test's own root holding the test identity, and every
env-passed git config of the caller (GIT_CONFIG_COUNT/KEY_n/VALUE_n,
GIT_CONFIG_PARAMETERS) cleared; the test's git and the installer's
git both inherit it. All GIT_CONFIG* variables are restored after
each test. HOME is not moved: the plugin code derives its folders
from it, and GIT_CONFIG_GLOBAL already replaces ~/.gitconfig and the
XDG file.
- the git helper no longer passes -c identity (it is in the file).
New test: `git config --list --show-origin` lists only the test's own
file. It caught one more leak while being written: this session's
shell passes core.quotePath through GIT_CONFIG_COUNT/KEY_0/VALUE_0.
Red before on the MacBook (the catalog-move test); green now: 5/5 on
the Bun runner and on plain Node.
Refs #48
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.
Refs #48 (slice 6:
plugin-cli-install.integration.test.ts, 1 red file). #48 stays open for the rest.Root cause
The test made its repositories with a plain
git init, and later asks the catalog source for refmaster. A plain init takes its first branch from host config. This MacBook's git (2.54.0, Apple Git-157) reads Xcode's system gitconfig, which setsinit.defaultBranch=main: hencefatal: Remote branch master not found in upstream origin, on Node and on Bun. A host without that setting passed.Fix (test only)
Following the Leader's rule that no host or Xcode git config is read at all:
Both inits name the branch:
--initial-branch=master.isolateGitConfig(), run by the harness:GIT_CONFIG_NOSYSTEM=1;GIT_CONFIG_GLOBAL= a file in the test's own root, holding the test identity;GIT_CONFIG_COUNT/KEY_n/VALUE_n,GIT_CONFIG_PARAMETERS).The test's git and the installer's git both inherit this. All
GIT_CONFIG*variables are restored after each test.HOMEis not moved. The plugin code derives its folders from it, andGIT_CONFIG_GLOBALalready replaces both~/.gitconfigand the XDG file.New test:
git config --list --show-originlists only the test's own file. While being written, it caught one more leak: this session's shell passescore.quotePaththroughGIT_CONFIG_COUNT/KEY_0/VALUE_0.Tests
check-changed: 23/23.