Skip to content

Commit d6c6b10

Browse files
dschogitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 883b98e commit d6c6b10

16 files changed

+240
-240
lines changed

t/t3200-branch.sh

Lines changed: 122 additions & 122 deletions
Large diffs are not rendered by default.

t/t3201-branch-contains.sh

Lines changed: 41 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
test_description='branch --contains <commit>, --no-contains <commit> --merged, and --no-merged'
44

5-
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
5+
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
66
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
77

88
. ./test-lib.sh
@@ -17,47 +17,47 @@ test_expect_success setup '
1717
1818
echo 1 >file &&
1919
test_tick &&
20-
git commit -a -m "second on master" &&
20+
git commit -a -m "second on main" &&
2121
2222
git checkout side &&
2323
echo 1 >file &&
2424
test_tick &&
2525
git commit -a -m "second on side" &&
2626
27-
git merge master
27+
git merge main
2828
2929
'
3030

31-
test_expect_success 'branch --contains=master' '
31+
test_expect_success 'branch --contains=main' '
3232
33-
git branch --contains=master >actual &&
33+
git branch --contains=main >actual &&
3434
{
35-
echo " master" && echo "* side"
35+
echo " main" && echo "* side"
3636
} >expect &&
3737
test_cmp expect actual
3838
3939
'
4040

41-
test_expect_success 'branch --contains master' '
41+
test_expect_success 'branch --contains main' '
4242
43-
git branch --contains master >actual &&
43+
git branch --contains main >actual &&
4444
{
45-
echo " master" && echo "* side"
45+
echo " main" && echo "* side"
4646
} >expect &&
4747
test_cmp expect actual
4848
4949
'
5050

51-
test_expect_success 'branch --no-contains=master' '
51+
test_expect_success 'branch --no-contains=main' '
5252
53-
git branch --no-contains=master >actual &&
53+
git branch --no-contains=main >actual &&
5454
test_must_be_empty actual
5555
5656
'
5757

58-
test_expect_success 'branch --no-contains master' '
58+
test_expect_success 'branch --no-contains main' '
5959
60-
git branch --no-contains master >actual &&
60+
git branch --no-contains main >actual &&
6161
test_must_be_empty actual
6262
6363
'
@@ -76,25 +76,25 @@ test_expect_success 'branch --no-contains=side' '
7676
7777
git branch --no-contains=side >actual &&
7878
{
79-
echo " master"
79+
echo " main"
8080
} >expect &&
8181
test_cmp expect actual
8282
8383
'
8484

8585
test_expect_success 'branch --contains with pattern implies --list' '
8686
87-
git branch --contains=master master >actual &&
87+
git branch --contains=main main >actual &&
8888
{
89-
echo " master"
89+
echo " main"
9090
} >expect &&
9191
test_cmp expect actual
9292
9393
'
9494

9595
test_expect_success 'branch --no-contains with pattern implies --list' '
9696
97-
git branch --no-contains=master master >actual &&
97+
git branch --no-contains=main main >actual &&
9898
test_must_be_empty actual
9999
100100
'
@@ -103,7 +103,7 @@ test_expect_success 'side: branch --merged' '
103103
104104
git branch --merged >actual &&
105105
{
106-
echo " master" &&
106+
echo " main" &&
107107
echo "* side"
108108
} >expect &&
109109
test_cmp expect actual
@@ -112,9 +112,9 @@ test_expect_success 'side: branch --merged' '
112112

113113
test_expect_success 'branch --merged with pattern implies --list' '
114114
115-
git branch --merged=side master >actual &&
115+
git branch --merged=side main >actual &&
116116
{
117-
echo " master"
117+
echo " main"
118118
} >expect &&
119119
test_cmp expect actual
120120
@@ -127,18 +127,18 @@ test_expect_success 'side: branch --no-merged' '
127127
128128
'
129129

130-
test_expect_success 'master: branch --merged' '
130+
test_expect_success 'main: branch --merged' '
131131
132-
git checkout master &&
132+
git checkout main &&
133133
git branch --merged >actual &&
134134
{
135-
echo "* master"
135+
echo "* main"
136136
} >expect &&
137137
test_cmp expect actual
138138
139139
'
140140

141-
test_expect_success 'master: branch --no-merged' '
141+
test_expect_success 'main: branch --no-merged' '
142142
143143
git branch --no-merged >actual &&
144144
{
@@ -150,22 +150,22 @@ test_expect_success 'master: branch --no-merged' '
150150

151151
test_expect_success 'branch --no-merged with pattern implies --list' '
152152
153-
git branch --no-merged=master master >actual &&
153+
git branch --no-merged=main main >actual &&
154154
test_must_be_empty actual
155155
156156
'
157157

158158
test_expect_success 'implicit --list conflicts with modification options' '
159159
160-
test_must_fail git branch --contains=master -d &&
161-
test_must_fail git branch --contains=master -m foo &&
162-
test_must_fail git branch --no-contains=master -d &&
163-
test_must_fail git branch --no-contains=master -m foo
160+
test_must_fail git branch --contains=main -d &&
161+
test_must_fail git branch --contains=main -m foo &&
162+
test_must_fail git branch --no-contains=main -d &&
163+
test_must_fail git branch --no-contains=main -m foo
164164
165165
'
166166

167167
test_expect_success 'Assert that --contains only works on commits, not trees & blobs' '
168-
test_must_fail git branch --contains master^{tree} &&
168+
test_must_fail git branch --contains main^{tree} &&
169169
blob=$(git hash-object -w --stdin <<-\EOF
170170
Some blob
171171
EOF
@@ -175,11 +175,11 @@ test_expect_success 'Assert that --contains only works on commits, not trees & b
175175
'
176176

177177
test_expect_success 'multiple branch --contains' '
178-
git checkout -b side2 master &&
178+
git checkout -b side2 main &&
179179
>feature &&
180180
git add feature &&
181181
git commit -m "add feature" &&
182-
git checkout -b next master &&
182+
git checkout -b next main &&
183183
git merge side &&
184184
git branch --contains side --contains side2 >actual &&
185185
cat >expect <<-\EOF &&
@@ -191,9 +191,9 @@ test_expect_success 'multiple branch --contains' '
191191
'
192192

193193
test_expect_success 'multiple branch --merged' '
194-
git branch --merged next --merged master >actual &&
194+
git branch --merged next --merged main >actual &&
195195
cat >expect <<-\EOF &&
196-
master
196+
main
197197
* next
198198
side
199199
EOF
@@ -203,21 +203,21 @@ test_expect_success 'multiple branch --merged' '
203203
test_expect_success 'multiple branch --no-contains' '
204204
git branch --no-contains side --no-contains side2 >actual &&
205205
cat >expect <<-\EOF &&
206-
master
206+
main
207207
EOF
208208
test_cmp expect actual
209209
'
210210

211211
test_expect_success 'multiple branch --no-merged' '
212-
git branch --no-merged next --no-merged master >actual &&
212+
git branch --no-merged next --no-merged main >actual &&
213213
cat >expect <<-\EOF &&
214214
side2
215215
EOF
216216
test_cmp expect actual
217217
'
218218

219219
test_expect_success 'branch --contains combined with --no-contains' '
220-
git checkout -b seen master &&
220+
git checkout -b seen main &&
221221
git merge side &&
222222
git merge side2 &&
223223
git branch --contains side --no-contains side2 >actual &&
@@ -242,17 +242,17 @@ test_expect_success 'branch --merged combined with --no-merged' '
242242
# that the latter walk does not mess up our flag to see if it was
243243
# merged).
244244
#
245-
# Here "topic" tracks "master" with one extra commit, and "zzz" points to the
246-
# same tip as master The name "zzz" must come alphabetically after "topic"
245+
# Here "topic" tracks "main" with one extra commit, and "zzz" points to the
246+
# same tip as main The name "zzz" must come alphabetically after "topic"
247247
# as we process them in that order.
248248
test_expect_success PREPARE_FOR_MAIN_BRANCH 'branch --merged with --verbose' '
249-
git branch --track topic master &&
249+
git branch --track topic main &&
250250
git branch zzz topic &&
251251
git checkout topic &&
252252
test_commit foo &&
253253
git branch --merged topic >actual &&
254254
cat >expect <<-\EOF &&
255-
master
255+
main
256256
* topic
257257
zzz
258258
EOF

t/t3202-show-branch-octopus.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
test_description='test show-branch with more than 8 heads'
44

5-
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
5+
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
66
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
77

88
. ./test-lib.sh
@@ -18,7 +18,7 @@ test_expect_success 'setup' '
1818
1919
for i in $numbers
2020
do
21-
git checkout -b branch$i master &&
21+
git checkout -b branch$i main &&
2222
> file$i &&
2323
git add file$i &&
2424
test_tick &&

0 commit comments

Comments
 (0)