Skip to content

Commit 66713e8

Browse files
dschogitster
authored andcommitted
tests: prepare aligned mentions of the default branch name
In some tests, the default branch name is part of aligned output. As we want to change the default branch name to `main`, which is two characters shorter than the old default branch name, we will have to adjust those tests. Since we use the original default branch name until the entire test suite has been adjusted accordingly, the touched test cases need to be guarded by a prereq (that is so far disabled so that they are skipped for now). The test cases that depend on those test cases that are newly guarded by that prereq naturally have to be guarded, too. Signed-off-by: Johannes Schindelin <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 8164360 commit 66713e8

8 files changed

+82
-82
lines changed

t/t3200-branch.sh

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -321,11 +321,11 @@ test_expect_success 'git branch --list -v with --abbrev' '
321321
322322
'
323323

324-
test_expect_success 'git branch --column' '
324+
test_expect_success PREPARE_FOR_MAIN_BRANCH 'git branch --column' '
325325
COLUMNS=81 git branch --column=column >actual &&
326326
cat >expect <<\EOF &&
327-
a/b/c bam foo l * master n o/p r
328-
abc bar j/k m/m mb o/o q topic
327+
a/b/c bam foo l * main n o/p r
328+
abc bar j/k m/m mb o/o q topic
329329
EOF
330330
test_cmp expect actual
331331
'
@@ -358,15 +358,15 @@ EOF
358358
test_cmp expect actual
359359
'
360360

361-
test_expect_success 'git branch with column.*' '
361+
test_expect_success PREPARE_FOR_MAIN_BRANCH 'git branch with column.*' '
362362
git config column.ui column &&
363363
git config column.branch "dense" &&
364364
COLUMNS=80 git branch >actual &&
365365
git config --unset column.branch &&
366366
git config --unset column.ui &&
367367
cat >expect <<\EOF &&
368-
a/b/c bam foo l * master n o/p r
369-
abc bar j/k m/m mb o/o q topic
368+
a/b/c bam foo l * main n o/p r
369+
abc bar j/k m/m mb o/o q topic
370370
EOF
371371
test_cmp expect actual
372372
'

t/t3201-branch-contains.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ test_expect_success 'branch --merged combined with --no-merged' '
242242
# Here "topic" tracks "master" with one extra commit, and "zzz" points to the
243243
# same tip as master The name "zzz" must come alphabetically after "topic"
244244
# as we process them in that order.
245-
test_expect_success 'branch --merged with --verbose' '
245+
test_expect_success PREPARE_FOR_MAIN_BRANCH 'branch --merged with --verbose' '
246246
git branch --track topic master &&
247247
git branch zzz topic &&
248248
git checkout topic &&
@@ -256,9 +256,9 @@ test_expect_success 'branch --merged with --verbose' '
256256
test_cmp expect actual &&
257257
git branch --verbose --merged topic >actual &&
258258
cat >expect <<-EOF &&
259-
master $(git rev-parse --short master) second on master
260-
* topic $(git rev-parse --short topic ) [ahead 1] foo
261-
zzz $(git rev-parse --short zzz ) second on master
259+
main $(git rev-parse --short main) second on main
260+
* topic $(git rev-parse --short topic ) [ahead 1] foo
261+
zzz $(git rev-parse --short zzz ) second on main
262262
EOF
263263
test_i18ncmp expect actual
264264
'

t/t3203-branch-output.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -329,15 +329,15 @@ test_expect_success '--color overrides auto-color' '
329329
test_cmp expect.color actual
330330
'
331331

332-
test_expect_success 'verbose output lists worktree path' '
332+
test_expect_success PREPARE_FOR_MAIN_BRANCH 'verbose output lists worktree path' '
333333
one=$(git rev-parse --short HEAD) &&
334334
two=$(git rev-parse --short master) &&
335335
cat >expect <<-EOF &&
336336
* (HEAD detached from fromtag) $one one
337337
ambiguous $one one
338338
branch-one $two two
339339
+ branch-two $one ($(pwd)/worktree_dir) one
340-
master $two two
340+
main $two two
341341
ref-to-branch $two two
342342
ref-to-remote $two two
343343
EOF

t/t3205-branch-color.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,12 @@ test_expect_success 'regular output shows colors' '
2828
test_cmp expect actual
2929
'
3030

31-
test_expect_success 'verbose output shows colors' '
31+
test_expect_success PREPARE_FOR_MAIN_BRANCH 'verbose output shows colors' '
3232
oid=$(git rev-parse --short HEAD) &&
3333
cat >expect <<-EOF &&
34-
* <CYAN>master <RESET> $oid foo
35-
<BLUE>other <RESET> $oid foo
36-
<YELLOW>remotes/origin/master<RESET> $oid foo
34+
* <CYAN>main <RESET> $oid foo
35+
<BLUE>other <RESET> $oid foo
36+
<YELLOW>remotes/origin/main<RESET> $oid foo
3737
EOF
3838
git branch --color -v -a >actual.raw &&
3939
test_decode_color <actual.raw >actual &&

t/t5505-remote.sh

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -200,28 +200,28 @@ cat >test/expect <<EOF
200200
Push URL: $(pwd)/one
201201
HEAD branch: master
202202
Remote branches:
203-
master new (next fetch will store in remotes/origin)
204-
side tracked
203+
main new (next fetch will store in remotes/origin)
204+
side tracked
205205
Local branches configured for 'git pull':
206-
ahead merges with remote master
207-
master merges with remote master
206+
ahead merges with remote main
207+
main merges with remote main
208208
octopus merges with remote topic-a
209209
and with remote topic-b
210210
and with remote topic-c
211211
rebase rebases onto remote master
212212
Local refs configured for 'git push':
213-
master pushes to master (local out of date)
214-
master pushes to upstream (create)
213+
main pushes to main (local out of date)
214+
main pushes to upstream (create)
215215
* remote two
216216
Fetch URL: ../two
217217
Push URL: ../three
218218
HEAD branch: master
219219
Local refs configured for 'git push':
220-
ahead forces to master (fast-forwardable)
221-
master pushes to another (up to date)
220+
ahead forces to main (fast-forwardable)
221+
main pushes to another (up to date)
222222
EOF
223223

224-
test_expect_success 'show' '
224+
test_expect_success PREPARE_FOR_MAIN_BRANCH 'show' '
225225
(
226226
cd test &&
227227
git config --add remote.origin.fetch refs/heads/master:refs/heads/upstream &&
@@ -264,15 +264,15 @@ cat >test/expect <<EOF
264264
master
265265
side
266266
Local branches configured for 'git pull':
267-
ahead merges with remote master
268-
master merges with remote master
267+
ahead merges with remote main
268+
main merges with remote main
269269
Local refs configured for 'git push' (status not queried):
270270
(matching) pushes to (matching)
271-
refs/heads/master pushes to refs/heads/upstream
271+
refs/heads/main pushes to refs/heads/upstream
272272
refs/tags/lastbackup forces to refs/tags/lastbackup
273273
EOF
274274

275-
test_expect_success 'show -n' '
275+
test_expect_success PREPARE_FOR_MAIN_BRANCH 'show -n' '
276276
mv one one.unreachable &&
277277
(
278278
cd test &&
@@ -315,7 +315,7 @@ test_expect_success 'set-head --auto' '
315315
)
316316
'
317317

318-
test_expect_success 'set-head --auto has no problem w/multiple HEADs' '
318+
test_expect_success PREPARE_FOR_MAIN_BRANCH 'set-head --auto has no problem w/multiple HEADs' '
319319
(
320320
cd test &&
321321
git fetch two "refs/heads/*:refs/remotes/two/*" &&
@@ -1335,7 +1335,7 @@ test_expect_success 'unqualified <dst> refspec DWIM and advice' '
13351335
)
13361336
'
13371337

1338-
test_expect_success 'refs/remotes/* <src> refspec and unqualified <dst> DWIM and advice' '
1338+
test_expect_success PREPARE_FOR_MAIN_BRANCH 'refs/remotes/* <src> refspec and unqualified <dst> DWIM and advice' '
13391339
(
13401340
cd two &&
13411341
git tag -a -m "Some tag" my-tag master &&

t/t5510-fetch.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -942,7 +942,7 @@ test_expect_success 'fetching with auto-gc does not lock up' '
942942
)
943943
'
944944

945-
test_expect_success C_LOCALE_OUTPUT 'fetch aligned output' '
945+
test_expect_success PREPARE_FOR_MAIN_BRANCH,C_LOCALE_OUTPUT 'fetch aligned output' '
946946
git clone . full-output &&
947947
test_commit looooooooooooong-tag &&
948948
(
@@ -951,13 +951,13 @@ test_expect_success C_LOCALE_OUTPUT 'fetch aligned output' '
951951
grep -e "->" actual | cut -c 22- >../actual
952952
) &&
953953
cat >expect <<-\EOF &&
954-
master -> origin/master
954+
main -> origin/main
955955
looooooooooooong-tag -> looooooooooooong-tag
956956
EOF
957957
test_cmp expect actual
958958
'
959959

960-
test_expect_success C_LOCALE_OUTPUT 'fetch compact output' '
960+
test_expect_success PREPARE_FOR_MAIN_BRANCH,C_LOCALE_OUTPUT 'fetch compact output' '
961961
git clone . compact &&
962962
test_commit extraaa &&
963963
(
@@ -966,7 +966,7 @@ test_expect_success C_LOCALE_OUTPUT 'fetch compact output' '
966966
grep -e "->" actual | cut -c 22- >../actual
967967
) &&
968968
cat >expect <<-\EOF &&
969-
master -> origin/*
969+
main -> origin/*
970970
extraaa -> *
971971
EOF
972972
test_cmp expect actual

0 commit comments

Comments
 (0)