diff options
| author | Junio C Hamano <gitster@pobox.com> | 2025-09-22 11:54:29 -0700 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2025-09-22 11:54:29 -0700 |
| commit | dc4168c337d4e35f1be9c59ae96982c99f524920 (patch) | |
| tree | 9c49315c9ef1adb07f61f852cfa75952149e4064 /t | |
| parent | Merge branch 'pw/3.0-default-initial-branch-to-main' into next (diff) | |
| parent | initial branch: give hints after switching the default name (diff) | |
| download | git-dc4168c337d4e35f1be9c59ae96982c99f524920.tar.gz git-dc4168c337d4e35f1be9c59ae96982c99f524920.zip | |
Merge branch 'jc/3.0-default-initial-branch-to-main-addendum' into next
Keep giving hint about the default initial branch name for users
who may be surprised after Git 3.0 switchover.
* jc/3.0-default-initial-branch-to-main-addendum:
initial branch: give hints after switching the default name
Diffstat (limited to 't')
| -rwxr-xr-x | t/t0001-init.sh | 2 | ||||
| -rw-r--r-- | t/test-lib.sh | 10 |
2 files changed, 8 insertions, 4 deletions
diff --git a/t/t0001-init.sh b/t/t0001-init.sh index df0040b9ac..618da080dc 100755 --- a/t/t0001-init.sh +++ b/t/t0001-init.sh @@ -868,7 +868,7 @@ test_expect_success 'overridden default initial branch name (config)' ' grep nmb actual ' -test_expect_success !WITH_BREAKING_CHANGES 'advice on unconfigured init.defaultBranch' ' +test_expect_success 'advice on unconfigured init.defaultBranch' ' GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME= git -c color.advice=always \ init unconfigured-default-branch-name 2>err && test_decode_color <err >decoded && diff --git a/t/test-lib.sh b/t/test-lib.sh index b191954c3c..562f950fb0 100644 --- a/t/test-lib.sh +++ b/t/test-lib.sh @@ -127,13 +127,17 @@ then export GIT_TEST_DISALLOW_ABBREVIATED_OPTIONS fi +# Explicitly set the default branch name for testing, to squelch hints +# from "git init" during the transition period. Should be removed +# after we decide to remove ADVICE_DEFAULT_BRANCH_NAME if test -z "$WITH_BREAKING_CHANGES" then - # Explicitly set the default branch name for testing, to avoid the - # transitory "git init" warning under --verbose. : ${GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME:=master} - export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME +else + : ${GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME:=main} fi +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + ################################################################ # It appears that people try to run tests without building... |
