diff options
author | Johannes Schindelin <johannes.schindelin@gmx.de> | 2020-10-23 14:00:00 +0000 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2020-10-23 08:57:40 -0700 |
commit | 704fed9ea22230929639c9e5fca122045f84311d (patch) | |
tree | a9cd6c08683ffe31c09316e1e6b79ed39f8384c0 /t/t5606-clone-options.sh | |
parent | t9801: use `--` in preparation for default branch rename (diff) | |
download | tgif-704fed9ea22230929639c9e5fca122045f84311d.tar.xz |
tests: start moving to a different default main branch name
To allow for an incremental conversion to a new default main branch
name, let's introduce `GIT_TEST_DEFAULT_MAIN_BRANCH_NAME`. This
environment variable can be set at the top of each converted test
script, overriding the default main branch name to use when initializing
new repositories (or cloning empty repositories).
Note: the `GIT_TEST_DEFAULT_MAIN_BRANCH_NAME` is _not_ intended to be
used manually; many tests require a specific main branch name and cannot
simply work with another one. This `GIT_TEST_*` variable is meant purely
for the transitional period while the entire test suite is converted to
use `main` as the initial branch name by default.
We also introduce the `PREPARE_FOR_MAIN_BRANCH` prereq that determines
whether the default main branch name is `main`, and adjust a couple of
test functions to use it. This prereq will be used to temporarily
disable a couple test cases to allow for adjusting the test script
incrementally. Once an entire test is adjusted, we will adjust the test
so that it is run with `GIT_TEST_DEFAULT_MAIN_BRANCH_NAME=main`.
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t5606-clone-options.sh')
-rwxr-xr-x | t/t5606-clone-options.sh | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/t/t5606-clone-options.sh b/t/t5606-clone-options.sh index e69427f881..856eebf222 100755 --- a/t/t5606-clone-options.sh +++ b/t/t5606-clone-options.sh @@ -37,6 +37,7 @@ test_expect_success 'redirected clone -v does show progress' ' test_expect_success 'chooses correct default initial branch name' ' git init --bare empty && + GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME= \ git -c init.defaultBranch=up clone empty whats-up && test refs/heads/up = $(git -C whats-up symbolic-ref HEAD) && test refs/heads/up = $(git -C whats-up config branch.up.merge) @@ -51,9 +52,11 @@ test_expect_success 'guesses initial branch name correctly' ' git -c init.defaultBranch=none init --bare no-head && git -C initial-branch push ../no-head guess abc && + GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME= \ git clone no-head is-it2 && test_must_fail git -C is-it2 symbolic-ref refs/remotes/origin/HEAD && git -C no-head update-ref --no-deref HEAD refs/heads/guess && + GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME= \ git -c init.defaultBranch=guess clone no-head is-it3 && test refs/remotes/origin/guess = \ $(git -C is-it3 symbolic-ref refs/remotes/origin/HEAD) |