fix(tests): silence mkrep's git-init default-branch hint in CI #165

Merged
rootiest merged 1 commits from fix/mkrep-test-defaultbranch-hint into main 2026-09-22 07:17:29 +00:00
Owner

Summary

tests/test-mkrep.fish exercises mkrep, which runs a bare git init per case. On a runner with no init.defaultBranch configured, git prints its "Using 'master' as the name for the initial branch..." advice block on every one — 20 occurrences in CI's test job log, all traced to this file (confirmed via full-log grep, nothing else in CI triggers it).

What / Why

tests/test-agents-vault.fish already solved this exact problem for its own git init calls via GIT_CONFIG_COUNT/GIT_CONFIG_KEY_0/GIT_CONFIG_VALUE_0 pinning init.defaultBranch=main for the test process only. Applied the same pattern to tests/test-mkrep.fish.

Deliberately not touched: functions/mkrep.fish itself. Pinning the config in mkrep.fish would override a real user's own global git config choice; the test environment is what's missing the config, so that's where the fix belongs.

Verification

  • tests/test-mkrep.fish run standalone (no ambient GIT_CONFIG_*) — 78/78 passed, 0 occurrences of the hint on stderr (previously present)
  • fish tests/run-tests.fish — full suite passes, $status 0
  • fish -n tests/test-mkrep.fish — syntax clean

Manual verification checklist

  • Confirm CI's test job log for this branch shows zero hint: Using 'master' lines
  • Spot-check test-agents-vault.fish's pinning comment still reads consistently now that a second file uses the same pattern
## Summary `tests/test-mkrep.fish` exercises `mkrep`, which runs a bare `git init` per case. On a runner with no `init.defaultBranch` configured, git prints its "Using 'master' as the name for the initial branch..." advice block on every one — 20 occurrences in CI's `test` job log, all traced to this file (confirmed via full-log grep, nothing else in CI triggers it). ## What / Why `tests/test-agents-vault.fish` already solved this exact problem for its own `git init` calls via `GIT_CONFIG_COUNT`/`GIT_CONFIG_KEY_0`/`GIT_CONFIG_VALUE_0` pinning `init.defaultBranch=main` for the test process only. Applied the same pattern to `tests/test-mkrep.fish`. Deliberately not touched: `functions/mkrep.fish` itself. Pinning the config in `mkrep.fish` would override a real user's own global git config choice; the test *environment* is what's missing the config, so that's where the fix belongs. ## Verification - [x] `tests/test-mkrep.fish` run standalone (no ambient `GIT_CONFIG_*`) — 78/78 passed, 0 occurrences of the hint on stderr (previously present) - [x] `fish tests/run-tests.fish` — full suite passes, `$status` 0 - [x] `fish -n tests/test-mkrep.fish` — syntax clean ## Manual verification checklist - [x] Confirm CI's `test` job log for this branch shows zero `hint: Using 'master'` lines - [x] Spot-check `test-agents-vault.fish`'s pinning comment still reads consistently now that a second file uses the same pattern
rootiest added 1 commit 2026-09-22 04:05:12 +00:00
Every mkrep call in this suite runs a bare `git init`. On a runner with
no init.defaultBranch configured, git prints its "Using 'master' as the
name for the initial branch" advice block on each one (20 occurrences in
CI's test-job log, all from this file). test-agents-vault.fish already
pins the same setting via GIT_CONFIG_COUNT/KEY/VALUE for the identical
reason; apply the same fix here rather than in mkrep.fish itself, so a
real user's own git config still wins in normal use.
rootiest added the Kind/BugKind/Testing labels 2026-09-22 04:05:19 +00:00
rootiest merged commit 7724ec6d31 into main 2026-09-22 07:17:29 +00:00
rootiest deleted branch fix/mkrep-test-defaultbranch-hint 2026-09-22 07:17:29 +00:00
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: rootiest/fish-config#165