From 3ff361bfe8ed547c2aae4f8f8426479709e38876 Mon Sep 17 00:00:00 2001 From: dave Date: Tue, 28 Apr 2026 16:38:43 +0000 Subject: [PATCH] chore: silence git init defaultBranch hints in script/test MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Tests that create temp repos call `git init` without specifying a branch. Git then prints a 12-line "hint: Using 'master' as the name for the initial branch..." block — every test, every run. The output drowns out actual failures. Set init.defaultBranch=master via GIT_CONFIG_COUNT/KEY/VALUE env vars in script/test. This affects only subprocesses spawned by the test runner; no change to the user's real git config. Verified: cargo test --bin huskies emits 0 `hint:` lines after this change, all 2732 tests still pass. --- script/test | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/script/test b/script/test index a1c86185..be789814 100755 --- a/script/test +++ b/script/test @@ -1,6 +1,13 @@ #!/usr/bin/env bash set -euo pipefail +# Silence git's "default branch name" hints emitted on every `git init` in +# tests that create temp repos. Sets init.defaultBranch=master via env so we +# don't have to touch the user's real git config. +export GIT_CONFIG_COUNT=1 +export GIT_CONFIG_KEY_0=init.defaultBranch +export GIT_CONFIG_VALUE_0=master + SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)" PROJECT_ROOT="$(cd "$SCRIPT_DIR/.." && pwd)"