diff options
author | Johannes Schindelin <johannes.schindelin@gmx.de> | 2020-11-18 23:44:21 +0000 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2020-11-19 15:44:18 -0800 |
commit | 06d531486e9078c88c324ad6f87376cfa897f058 (patch) | |
tree | c3ed8ffad4583e9bd1e717c782dc8b20784f2d91 /t/t1402-check-ref-format.sh | |
parent | t0060: preemptively adjust alignment (diff) | |
download | tgif-06d531486e9078c88c324ad6f87376cfa897f058.tar.xz |
t[01]*: adjust the references to the default branch name "main"
Carefully excluding t1309, which sees independent development elsewhere
at the time of writing, we transition above-mentioned tests to the
default branch name `main`. This trick was performed via
$ (cd t &&
sed -i -e 's/master/main/g' -e 's/MASTER/MAIN/g' \
-e 's/Master/Main/g' -e 's/naster/nain/g' -- t[01]*.sh &&
git checkout HEAD -- t1309\*)
Note that t5533 contains a variation of the name `master` (`naster`)
that we rename here, too.
This allows us to define `GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main`
for those tests.
Helped-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t1402-check-ref-format.sh')
-rwxr-xr-x | t/t1402-check-ref-format.sh | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/t/t1402-check-ref-format.sh b/t/t1402-check-ref-format.sh index 98e4a8613b..cabc516ae9 100755 --- a/t/t1402-check-ref-format.sh +++ b/t/t1402-check-ref-format.sh @@ -134,18 +134,18 @@ valid_ref !MINGW "$ref" '--refspec-pattern --allow-onelevel --normalize' test_expect_success "check-ref-format --branch @{-1}" ' T=$(git write-tree) && sha1=$(echo A | git commit-tree $T) && - git update-ref refs/heads/master $sha1 && - git update-ref refs/remotes/origin/master $sha1 && - git checkout master && - git checkout origin/master && - git checkout master && + git update-ref refs/heads/main $sha1 && + git update-ref refs/remotes/origin/main $sha1 && + git checkout main && + git checkout origin/main && + git checkout main && refname=$(git check-ref-format --branch @{-1}) && test "$refname" = "$sha1" && refname2=$(git check-ref-format --branch @{-2}) && - test "$refname2" = master' + test "$refname2" = main' -test_expect_success 'check-ref-format --branch -naster' ' - test_must_fail git check-ref-format --branch -naster >actual && +test_expect_success 'check-ref-format --branch -nain' ' + test_must_fail git check-ref-format --branch -nain >actual && test_must_be_empty actual ' @@ -154,11 +154,11 @@ test_expect_success 'check-ref-format --branch from subdir' ' T=$(git write-tree) && sha1=$(echo A | git commit-tree $T) && - git update-ref refs/heads/master $sha1 && - git update-ref refs/remotes/origin/master $sha1 && - git checkout master && - git checkout origin/master && - git checkout master && + git update-ref refs/heads/main $sha1 && + git update-ref refs/remotes/origin/main $sha1 && + git checkout main && + git checkout origin/main && + git checkout main && refname=$( cd subdir && git check-ref-format --branch @{-1} @@ -171,9 +171,9 @@ test_expect_success 'check-ref-format --branch @{-1} from non-repo' ' test_must_be_empty actual ' -test_expect_success 'check-ref-format --branch master from non-repo' ' - echo master >expect && - nongit git check-ref-format --branch master >actual && +test_expect_success 'check-ref-format --branch main from non-repo' ' + echo main >expect && + nongit git check-ref-format --branch main >actual && test_cmp expect actual ' |