Skip to content

test: plugin install over git reads no host git config (orca #48, slice 6) - #54

Merged
nachumi-a2zoperations merged 1 commit into
blowzer/fork-onlyfrom
nachumi-a2zoperations/issue-48-plugin-git-branch
Nov 15, 2026
Merged

nachumi-a2zoperations merged 1 commit into
blowzer/fork-onlyfrom
nachumi-a2zoperations/issue-48-plugin-git-branch

Conversation

@nachumi-a2zoperations

Copy link
Copy Markdown

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 ref master. 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 sets init.defaultBranch=main: hence fatal: 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;
    • every env-passed git config of the caller cleared (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.

  • HOME is not moved. The plugin code derives its folders from it, and GIT_CONFIG_GLOBAL already replaces both ~/.gitconfig and the XDG file.

New test: git config --list --show-origin lists only the test's own file. While being written, it caught one more leak: this session's shell passes core.quotePath through GIT_CONFIG_COUNT/KEY_0/VALUE_0.

Tests

  • Red before on the MacBook (the catalog-move test).
  • Green now: 5/5 on the Bun runner and on plain Node.
  • Preflight check-changed: 23/23.
  • Touches no file of PRs 50–53.

…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
@nachumi-a2zoperations
nachumi-a2zoperations merged commit 1d04d4b into blowzer/fork-only Nov 15, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant