Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohannes Schindelin <johannes.schindelin@gmx.de>2020-11-19 02:44:23 +0300
committerJunio C Hamano <gitster@pobox.com>2020-11-20 02:44:18 +0300
commitd6c6b10817409ed93d3c1f65b3d0d2b0875165d4 (patch)
tree5a9990c3ab13c2a91abc705199c79f1ec030690d /t/t3201-branch-contains.sh
parent883b98efade212bf1496a93dd8a691355a31daf0 (diff)
t3[0-3]*: adjust the references to the default branch name "main"
Carefully excluding t3040, 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' -- t3[0-3]*.sh t3206/* && git checkout HEAD -- t3040\*) This allows us to define `GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main` for those tests. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t3201-branch-contains.sh')
-rwxr-xr-xt/t3201-branch-contains.sh82
1 files changed, 41 insertions, 41 deletions
diff --git a/t/t3201-branch-contains.sh b/t/t3201-branch-contains.sh
index 532cdbe9ae..8e626afbb9 100755
--- a/t/t3201-branch-contains.sh
+++ b/t/t3201-branch-contains.sh
@@ -2,7 +2,7 @@
test_description='branch --contains <commit>, --no-contains <commit> --merged, and --no-merged'
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
. ./test-lib.sh
@@ -17,47 +17,47 @@ test_expect_success setup '
echo 1 >file &&
test_tick &&
- git commit -a -m "second on master" &&
+ git commit -a -m "second on main" &&
git checkout side &&
echo 1 >file &&
test_tick &&
git commit -a -m "second on side" &&
- git merge master
+ git merge main
'
-test_expect_success 'branch --contains=master' '
+test_expect_success 'branch --contains=main' '
- git branch --contains=master >actual &&
+ git branch --contains=main >actual &&
{
- echo " master" && echo "* side"
+ echo " main" && echo "* side"
} >expect &&
test_cmp expect actual
'
-test_expect_success 'branch --contains master' '
+test_expect_success 'branch --contains main' '
- git branch --contains master >actual &&
+ git branch --contains main >actual &&
{
- echo " master" && echo "* side"
+ echo " main" && echo "* side"
} >expect &&
test_cmp expect actual
'
-test_expect_success 'branch --no-contains=master' '
+test_expect_success 'branch --no-contains=main' '
- git branch --no-contains=master >actual &&
+ git branch --no-contains=main >actual &&
test_must_be_empty actual
'
-test_expect_success 'branch --no-contains master' '
+test_expect_success 'branch --no-contains main' '
- git branch --no-contains master >actual &&
+ git branch --no-contains main >actual &&
test_must_be_empty actual
'
@@ -76,7 +76,7 @@ test_expect_success 'branch --no-contains=side' '
git branch --no-contains=side >actual &&
{
- echo " master"
+ echo " main"
} >expect &&
test_cmp expect actual
@@ -84,9 +84,9 @@ test_expect_success 'branch --no-contains=side' '
test_expect_success 'branch --contains with pattern implies --list' '
- git branch --contains=master master >actual &&
+ git branch --contains=main main >actual &&
{
- echo " master"
+ echo " main"
} >expect &&
test_cmp expect actual
@@ -94,7 +94,7 @@ test_expect_success 'branch --contains with pattern implies --list' '
test_expect_success 'branch --no-contains with pattern implies --list' '
- git branch --no-contains=master master >actual &&
+ git branch --no-contains=main main >actual &&
test_must_be_empty actual
'
@@ -103,7 +103,7 @@ test_expect_success 'side: branch --merged' '
git branch --merged >actual &&
{
- echo " master" &&
+ echo " main" &&
echo "* side"
} >expect &&
test_cmp expect actual
@@ -112,9 +112,9 @@ test_expect_success 'side: branch --merged' '
test_expect_success 'branch --merged with pattern implies --list' '
- git branch --merged=side master >actual &&
+ git branch --merged=side main >actual &&
{
- echo " master"
+ echo " main"
} >expect &&
test_cmp expect actual
@@ -127,18 +127,18 @@ test_expect_success 'side: branch --no-merged' '
'
-test_expect_success 'master: branch --merged' '
+test_expect_success 'main: branch --merged' '
- git checkout master &&
+ git checkout main &&
git branch --merged >actual &&
{
- echo "* master"
+ echo "* main"
} >expect &&
test_cmp expect actual
'
-test_expect_success 'master: branch --no-merged' '
+test_expect_success 'main: branch --no-merged' '
git branch --no-merged >actual &&
{
@@ -150,22 +150,22 @@ test_expect_success 'master: branch --no-merged' '
test_expect_success 'branch --no-merged with pattern implies --list' '
- git branch --no-merged=master master >actual &&
+ git branch --no-merged=main main >actual &&
test_must_be_empty actual
'
test_expect_success 'implicit --list conflicts with modification options' '
- test_must_fail git branch --contains=master -d &&
- test_must_fail git branch --contains=master -m foo &&
- test_must_fail git branch --no-contains=master -d &&
- test_must_fail git branch --no-contains=master -m foo
+ test_must_fail git branch --contains=main -d &&
+ test_must_fail git branch --contains=main -m foo &&
+ test_must_fail git branch --no-contains=main -d &&
+ test_must_fail git branch --no-contains=main -m foo
'
test_expect_success 'Assert that --contains only works on commits, not trees & blobs' '
- test_must_fail git branch --contains master^{tree} &&
+ test_must_fail git branch --contains main^{tree} &&
blob=$(git hash-object -w --stdin <<-\EOF
Some blob
EOF
@@ -175,11 +175,11 @@ test_expect_success 'Assert that --contains only works on commits, not trees & b
'
test_expect_success 'multiple branch --contains' '
- git checkout -b side2 master &&
+ git checkout -b side2 main &&
>feature &&
git add feature &&
git commit -m "add feature" &&
- git checkout -b next master &&
+ git checkout -b next main &&
git merge side &&
git branch --contains side --contains side2 >actual &&
cat >expect <<-\EOF &&
@@ -191,9 +191,9 @@ test_expect_success 'multiple branch --contains' '
'
test_expect_success 'multiple branch --merged' '
- git branch --merged next --merged master >actual &&
+ git branch --merged next --merged main >actual &&
cat >expect <<-\EOF &&
- master
+ main
* next
side
EOF
@@ -203,13 +203,13 @@ test_expect_success 'multiple branch --merged' '
test_expect_success 'multiple branch --no-contains' '
git branch --no-contains side --no-contains side2 >actual &&
cat >expect <<-\EOF &&
- master
+ main
EOF
test_cmp expect actual
'
test_expect_success 'multiple branch --no-merged' '
- git branch --no-merged next --no-merged master >actual &&
+ git branch --no-merged next --no-merged main >actual &&
cat >expect <<-\EOF &&
side2
EOF
@@ -217,7 +217,7 @@ test_expect_success 'multiple branch --no-merged' '
'
test_expect_success 'branch --contains combined with --no-contains' '
- git checkout -b seen master &&
+ git checkout -b seen main &&
git merge side &&
git merge side2 &&
git branch --contains side --no-contains side2 >actual &&
@@ -242,17 +242,17 @@ test_expect_success 'branch --merged combined with --no-merged' '
# that the latter walk does not mess up our flag to see if it was
# merged).
#
-# Here "topic" tracks "master" with one extra commit, and "zzz" points to the
-# same tip as master The name "zzz" must come alphabetically after "topic"
+# Here "topic" tracks "main" with one extra commit, and "zzz" points to the
+# same tip as main The name "zzz" must come alphabetically after "topic"
# as we process them in that order.
test_expect_success PREPARE_FOR_MAIN_BRANCH 'branch --merged with --verbose' '
- git branch --track topic master &&
+ git branch --track topic main &&
git branch zzz topic &&
git checkout topic &&
test_commit foo &&
git branch --merged topic >actual &&
cat >expect <<-\EOF &&
- master
+ main
* topic
zzz
EOF