t8*: adjust the references 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' -- t8*.sh annotate*.sh) 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>

Johannes Schindelin committed Nov 18, 2020 at 23:44 UTC 747f6c6805c442cc74608743d14a1a47a3b1afa8
6 files changed +19 -19
t/annotate-tests.sh
+4 -4
@@ -95,7 +95,7 @@ test_expect_success 'blame 2 authors' '
95 '
96
97 test_expect_success 'setup B1 lines (branch1)' '
98 - git checkout -b branch1 master &&
98 + git checkout -b branch1 main &&
99 echo "3A slow green fox jumps into the" >>file &&
100 echo "well." >>file &&
101 GIT_AUTHOR_NAME="B1" GIT_AUTHOR_EMAIL="B1@test.git" \
@@ -107,7 +107,7 @@ test_expect_success 'blame 2 authors + 1 branch1 author' '
107 '
108
109 test_expect_success 'setup B2 lines (branch2)' '
110 - git checkout -b branch2 master &&
110 + git checkout -b branch2 main &&
111 sed -e "s/2A quick brown/4A quick brown lazy dog/" <file >file.new &&
112 mv file.new file &&
113 GIT_AUTHOR_NAME="B2" GIT_AUTHOR_EMAIL="B2@test.git" \
@@ -131,11 +131,11 @@ test_expect_success 'blame --first-parent blames merge for branch1' '
131 '
132
133 test_expect_success 'blame ancestor' '
134 - check_count -h master A 2 B 2
134 + check_count -h main A 2 B 2
135 '
136
137 test_expect_success 'blame great-ancestor' '
138 - check_count -h master^ A 2
138 + check_count -h main^ A 2
139 '
140
141 test_expect_success 'setup evil merge' '
t/t8001-annotate.sh
+2 -2
@@ -1,7 +1,7 @@
1 #!/bin/sh
2
3 test_description='git annotate'
4 -GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
4 +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
5 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
6
7 . ./test-lib.sh
@@ -10,7 +10,7 @@ PROG='git annotate'
10 . "$TEST_DIRECTORY"/annotate-tests.sh
11
12 test_expect_success 'annotate old revision' '
13 - git annotate file master >actual &&
13 + git annotate file main >actual &&
14 awk "{ print \$3; }" <actual >authors &&
15 test 2 = $(grep A <authors | wc -l) &&
16 test 2 = $(grep B <authors | wc -l)
t/t8002-blame.sh
+1 -1
@@ -1,7 +1,7 @@
1 #!/bin/sh
2
3 test_description='git blame'
4 -GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
4 +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
5 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
6
7 . ./test-lib.sh
t/t8003-blame-corner-cases.sh
+3 -3
@@ -1,7 +1,7 @@
1 #!/bin/sh
2
3 test_description='git blame corner cases'
4 -GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
4 +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
5 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
6
7 . ./test-lib.sh
@@ -164,13 +164,13 @@ test_expect_success 'blame wholesale copy and more in the index' '
164
165 test_expect_success 'blame during cherry-pick with file rename conflict' '
166
167 - test_when_finished "git reset --hard && git checkout master" &&
167 + test_when_finished "git reset --hard && git checkout main" &&
168 git checkout HEAD~3 &&
169 echo MOUSE >> mouse &&
170 git mv mouse rodent &&
171 git add rodent &&
172 GIT_AUTHOR_NAME=Rodent git commit -m "rodent" &&
173 - git checkout --detach master &&
173 + git checkout --detach main &&
174 (git cherry-pick HEAD@{1} || test $? -eq 1) &&
175 git show HEAD@{1}:rodent > rodent &&
176 git add rodent &&
t/t8004-blame-with-conflicts.sh
+8 -8
@@ -3,7 +3,7 @@
3 # Based on a test case submitted by Björn Steinbrink.
4
5 test_description='git blame on conflicted files'
6 -GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
6 +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
7 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
8
9 . ./test-lib.sh
@@ -24,16 +24,16 @@ test_expect_success 'setup first case' '
24 git add file2 &&
25 git commit --author "U Gly <ug@localhost>" -m ugly &&
26
27 - # Back to master and change something
28 - git checkout master &&
27 + # Back to main and change something
28 + git checkout main &&
29 echo "
30
31 bla" >> file1 &&
32 git commit --author "Old Line <ol@localhost>" -a -m file1.b &&
33
34 - # Back to foo and merge master
34 + # Back to foo and merge main
35 git checkout foo &&
36 - if git merge master; then
36 + if git merge main; then
37 echo needed conflict here
38 exit 1
39 else
@@ -47,8 +47,8 @@ Even more" > file2 &&
47 git rm file1 &&
48 git commit --author "M Result <mr@localhost>" -a -m merged &&
49
50 - # Back to master and change file1 again
51 - git checkout master &&
50 + # Back to main and change file1 again
51 + git checkout main &&
52 sed s/bla/foo/ <file1 >X &&
53 rm file1 &&
54 mv X file1 &&
@@ -56,7 +56,7 @@ Even more" > file2 &&
56
57 # Try to merge into foo again
58 git checkout foo &&
59 - if git merge master; then
59 + if git merge main; then
60 echo needed conflict here
61 exit 1
62 else
t/t8012-blame-colors.sh
+1 -1
@@ -1,7 +1,7 @@
1 #!/bin/sh
2
3 test_description='colored git blame'
4 -GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
4 +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
5 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
6
7 . ./test-lib.sh