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/t1507-rev-parse-upstream.sh | |
parent | c2fdc8820c306c257a8ff11af3d18e3269a81213 (diff) | |
download | git-06d531486e9078c88c324ad6f87376cfa897f058.tar.gz |
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/t1507-rev-parse-upstream.sh')
-rwxr-xr-x | t/t1507-rev-parse-upstream.sh | 42 |
1 files changed, 21 insertions, 21 deletions
diff --git a/t/t1507-rev-parse-upstream.sh b/t/t1507-rev-parse-upstream.sh index 521233a3c3..73b4f34c6e 100755 --- a/t/t1507-rev-parse-upstream.sh +++ b/t/t1507-rev-parse-upstream.sh @@ -2,7 +2,7 @@ test_description='test <branch>@{upstream} syntax' -GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME . ./test-lib.sh @@ -13,20 +13,20 @@ test_expect_success 'setup' ' test_commit 1 && git checkout -b side && test_commit 2 && - git checkout master && + git checkout main && git clone . clone && test_commit 3 && (cd clone && test_commit 4 && git branch --track my-side origin/side && - git branch --track local-master master && + git branch --track local-main main && git branch --track fun@ny origin/side && git branch --track @funny origin/side && git branch --track funny@ origin/side && - git remote add -t master master-only .. && - git fetch master-only && + git remote add -t main main-only .. && + git fetch main-only && git branch bad-upstream && - git config branch.bad-upstream.remote master-only && + git config branch.bad-upstream.remote main-only && git config branch.bad-upstream.merge refs/heads/side ) ' @@ -42,7 +42,7 @@ error_message () { } test_expect_success '@{upstream} resolves to correct full name' ' - echo refs/remotes/origin/master >expect && + echo refs/remotes/origin/main >expect && git -C clone rev-parse --symbolic-full-name @{upstream} >actual && test_cmp expect actual && git -C clone rev-parse --symbolic-full-name @{UPSTREAM} >actual && @@ -52,7 +52,7 @@ test_expect_success '@{upstream} resolves to correct full name' ' ' test_expect_success '@{u} resolves to correct full name' ' - echo refs/remotes/origin/master >expect && + echo refs/remotes/origin/main >expect && git -C clone rev-parse --symbolic-full-name @{u} >actual && test_cmp expect actual && git -C clone rev-parse --symbolic-full-name @{U} >actual && @@ -135,7 +135,7 @@ test_expect_success 'checkout -b new my-side@{u} forks from the same' ' test_expect_success 'merge my-side@{u} records the correct name' ' ( cd clone && - git checkout master && + git checkout main && test_might_fail git branch -D new && git branch -t new my-side@{u} && git merge -s ours new@{u} && @@ -146,24 +146,24 @@ test_expect_success 'merge my-side@{u} records the correct name' ' ' test_expect_success 'branch -d other@{u}' ' - git checkout -t -b other master && + git checkout -t -b other main && git branch -d @{u} && - git for-each-ref refs/heads/master >actual && + git for-each-ref refs/heads/main >actual && test_must_be_empty actual ' test_expect_success 'checkout other@{u}' ' - git branch -f master HEAD && - git checkout -t -b another master && + git branch -f main HEAD && + git checkout -t -b another main && git checkout @{u} && git symbolic-ref HEAD >actual && - echo refs/heads/master >expect && + echo refs/heads/main >expect && test_cmp expect actual ' test_expect_success 'branch@{u} works when tracking a local branch' ' - echo refs/heads/master >expect && - git -C clone rev-parse --symbolic-full-name local-master@{u} >actual && + echo refs/heads/main >expect && + git -C clone rev-parse --symbolic-full-name local-main@{u} >actual && test_cmp expect actual ' @@ -177,7 +177,7 @@ test_expect_success 'branch@{u} error message when no upstream' ' test_expect_success '@{u} error message when no upstream' ' cat >expect <<-EOF && - fatal: no upstream configured for branch ${SQ}master${SQ} + fatal: no upstream configured for branch ${SQ}main${SQ} EOF test_must_fail git rev-parse --verify @{u} 2>actual && test_i18ncmp expect actual @@ -211,14 +211,14 @@ test_expect_success 'branch@{u} error message if upstream branch not fetched' ' test_expect_success 'pull works when tracking a local branch' ' ( cd clone && - git checkout local-master && + git checkout local-main && git pull ) ' # makes sense if the previous one succeeded test_expect_success '@{u} works when tracking a local branch' ' - echo refs/heads/master >expect && + echo refs/heads/main >expect && git -C clone rev-parse --symbolic-full-name @{u} >actual && test_cmp expect actual ' @@ -227,7 +227,7 @@ test_expect_success 'log -g other@{u}' ' commit=$(git rev-parse HEAD) && cat >expect <<-EOF && commit $commit - Reflog: master@{0} (C O Mitter <committer@example.com>) + Reflog: main@{0} (C O Mitter <committer@example.com>) Reflog message: branch: Created from HEAD Author: A U Thor <author@example.com> Date: Thu Apr 7 15:15:13 2005 -0700 @@ -242,7 +242,7 @@ test_expect_success 'log -g other@{u}@{now}' ' commit=$(git rev-parse HEAD) && cat >expect <<-EOF && commit $commit - Reflog: master@{Thu Apr 7 15:17:13 2005 -0700} (C O Mitter <committer@example.com>) + Reflog: main@{Thu Apr 7 15:17:13 2005 -0700} (C O Mitter <committer@example.com>) Reflog message: branch: Created from HEAD Author: A U Thor <author@example.com> Date: Thu Apr 7 15:15:13 2005 -0700 |