Skip to content

Commit 765577b

Browse files
dschogitster
authored andcommitted
t9[5-7]*: 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' -- t9[5-7]*.sh lib-cvs.sh) 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 a881baa commit 765577b

8 files changed

+48
-48
lines changed

t/lib-cvs.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ setup_cvs_test_repository () {
3636
test_cvs_co () {
3737
# Usage: test_cvs_co BRANCH_NAME
3838
rm -rf module-cvs-"$1"
39-
if [ "$1" = "master" ]
39+
if [ "$1" = "main" ]
4040
then
4141
$CVS co -P -d module-cvs-"$1" -A module
4242
else

t/t9500-gitweb-standalone-no-errors.sh

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ commandline, and checks that it would not write any errors
1010
or warnings to log.'
1111

1212

13-
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
13+
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
1414
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
1515

1616
. ./gitweb-lib.sh
@@ -330,7 +330,7 @@ test_expect_success \
330330
echo "Branch" >>b &&
331331
git add b &&
332332
git commit -a -m "On branch" &&
333-
git checkout master &&
333+
git checkout main &&
334334
git merge b &&
335335
git tag merge_commit'
336336

@@ -367,7 +367,7 @@ test_expect_success \
367367
echo "Changed and have mode changed" >07-change-mode-change &&
368368
test_chmod +x 07-change-mode-change &&
369369
git commit -a -m "Large commit" &&
370-
git checkout master'
370+
git checkout main'
371371

372372
test_expect_success \
373373
'commit(1): large commit' \
@@ -405,7 +405,7 @@ test_expect_success 'side-by-side: merge commit' '
405405

406406
test_expect_success \
407407
'tags: list of different types of tags' \
408-
'git checkout master &&
408+
'git checkout main &&
409409
git tag -a -m "Tag commit object" tag-commit HEAD &&
410410
git tag -a -m "" tag-commit-nomessage HEAD &&
411411
git tag -a -m "Tag tag object" tag-tag tag-commit &&
@@ -446,7 +446,7 @@ test_expect_success \
446446

447447
test_expect_success \
448448
'logs: history (implicit HEAD, deleted file)' \
449-
'git checkout master &&
449+
'git checkout main &&
450450
echo "to be deleted" >deleted_file &&
451451
git add deleted_file &&
452452
git commit -m "Add file to be deleted" &&
@@ -466,11 +466,11 @@ test_expect_success \
466466

467467
test_expect_success \
468468
'path_info: project/branch:file' \
469-
'gitweb_run "" "/.git/master:file"'
469+
'gitweb_run "" "/.git/main:file"'
470470

471471
test_expect_success \
472472
'path_info: project/branch:dir/' \
473-
'gitweb_run "" "/.git/master:foo/"'
473+
'gitweb_run "" "/.git/main:foo/"'
474474

475475
test_expect_success \
476476
'path_info: project/branch (non-existent)' \
@@ -482,16 +482,16 @@ test_expect_success \
482482

483483
test_expect_success \
484484
'path_info: project/branch:file (non-existent)' \
485-
'gitweb_run "" "/.git/master:non-existent"'
485+
'gitweb_run "" "/.git/main:non-existent"'
486486

487487
test_expect_success \
488488
'path_info: project/branch:dir/ (non-existent)' \
489-
'gitweb_run "" "/.git/master:non-existent/"'
489+
'gitweb_run "" "/.git/main:non-existent/"'
490490

491491

492492
test_expect_success \
493493
'path_info: project/branch:/file' \
494-
'gitweb_run "" "/.git/master:/file"'
494+
'gitweb_run "" "/.git/main:/file"'
495495

496496
test_expect_success \
497497
'path_info: project/:/file (implicit HEAD)' \
@@ -804,7 +804,7 @@ test_expect_success \
804804
git checkout orphan_branch ||
805805
git checkout --orphan orphan_branch
806806
} &&
807-
test_when_finished "git checkout master" &&
807+
test_when_finished "git checkout main" &&
808808
gitweb_run "p=.git;a=summary"'
809809

810810
test_done

t/t9501-gitweb-standalone-http-status.sh

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ commandline, and checks that it returns the expected HTTP status
1010
code and message.'
1111

1212

13-
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
13+
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
1414
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
1515

1616
. ./gitweb-lib.sh
@@ -88,7 +88,7 @@ test_debug 'cat gitweb.headers'
8888
# snapshot hash ids
8989

9090
test_expect_success 'snapshots: good tree-ish id' '
91-
gitweb_run "p=.git;a=snapshot;h=master;sf=tgz" &&
91+
gitweb_run "p=.git;a=snapshot;h=main;sf=tgz" &&
9292
grep "Status: 200 OK" gitweb.output
9393
'
9494
test_debug 'cat gitweb.headers'
@@ -126,7 +126,7 @@ test_debug 'cat gitweb.output'
126126
# modification times (Last-Modified and If-Modified-Since)
127127

128128
test_expect_success DATE_PARSER 'modification: feed last-modified' '
129-
gitweb_run "p=.git;a=atom;h=master" &&
129+
gitweb_run "p=.git;a=atom;h=main" &&
130130
grep "Status: 200 OK" gitweb.headers &&
131131
grep "Last-modified: Thu, 7 Apr 2005 22:14:13 +0000" gitweb.headers
132132
'
@@ -136,7 +136,7 @@ test_expect_success DATE_PARSER 'modification: feed if-modified-since (modified)
136136
HTTP_IF_MODIFIED_SINCE="Wed, 6 Apr 2005 22:14:13 +0000" &&
137137
export HTTP_IF_MODIFIED_SINCE &&
138138
test_when_finished "unset HTTP_IF_MODIFIED_SINCE" &&
139-
gitweb_run "p=.git;a=atom;h=master" &&
139+
gitweb_run "p=.git;a=atom;h=main" &&
140140
grep "Status: 200 OK" gitweb.headers
141141
'
142142
test_debug 'cat gitweb.headers'
@@ -145,13 +145,13 @@ test_expect_success DATE_PARSER 'modification: feed if-modified-since (unmodifie
145145
HTTP_IF_MODIFIED_SINCE="Thu, 7 Apr 2005 22:14:13 +0000" &&
146146
export HTTP_IF_MODIFIED_SINCE &&
147147
test_when_finished "unset HTTP_IF_MODIFIED_SINCE" &&
148-
gitweb_run "p=.git;a=atom;h=master" &&
148+
gitweb_run "p=.git;a=atom;h=main" &&
149149
grep "Status: 304 Not Modified" gitweb.headers
150150
'
151151
test_debug 'cat gitweb.headers'
152152

153153
test_expect_success DATE_PARSER 'modification: snapshot last-modified' '
154-
gitweb_run "p=.git;a=snapshot;h=master;sf=tgz" &&
154+
gitweb_run "p=.git;a=snapshot;h=main;sf=tgz" &&
155155
grep "Status: 200 OK" gitweb.headers &&
156156
grep "Last-modified: Thu, 7 Apr 2005 22:14:13 +0000" gitweb.headers
157157
'
@@ -161,7 +161,7 @@ test_expect_success DATE_PARSER 'modification: snapshot if-modified-since (modif
161161
HTTP_IF_MODIFIED_SINCE="Wed, 6 Apr 2005 22:14:13 +0000" &&
162162
export HTTP_IF_MODIFIED_SINCE &&
163163
test_when_finished "unset HTTP_IF_MODIFIED_SINCE" &&
164-
gitweb_run "p=.git;a=snapshot;h=master;sf=tgz" &&
164+
gitweb_run "p=.git;a=snapshot;h=main;sf=tgz" &&
165165
grep "Status: 200 OK" gitweb.headers
166166
'
167167
test_debug 'cat gitweb.headers'
@@ -170,7 +170,7 @@ test_expect_success DATE_PARSER 'modification: snapshot if-modified-since (unmod
170170
HTTP_IF_MODIFIED_SINCE="Thu, 7 Apr 2005 22:14:13 +0000" &&
171171
export HTTP_IF_MODIFIED_SINCE &&
172172
test_when_finished "unset HTTP_IF_MODIFIED_SINCE" &&
173-
gitweb_run "p=.git;a=snapshot;h=master;sf=tgz" &&
173+
gitweb_run "p=.git;a=snapshot;h=main;sf=tgz" &&
174174
grep "Status: 304 Not Modified" gitweb.headers
175175
'
176176
test_debug 'cat gitweb.headers'

t/t9502-gitweb-standalone-parse-output.sh

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ commandline, and checks that it produces the correct output, either
1010
in the HTTP header or the actual script output.'
1111

1212

13-
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
13+
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
1414
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
1515

1616
. ./gitweb-lib.sh
@@ -82,10 +82,10 @@ test_expect_success 'snapshot: HEAD' '
8282
'
8383
test_debug 'cat gitweb.headers && cat file_list'
8484

85-
test_expect_success 'snapshot: short branch name (master)' '
86-
gitweb_run "p=.git;a=snapshot;h=master;sf=tar" &&
87-
ID=$(git rev-parse --verify --short=7 master) &&
88-
check_snapshot ".git-master-$ID"
85+
test_expect_success 'snapshot: short branch name (main)' '
86+
gitweb_run "p=.git;a=snapshot;h=main;sf=tar" &&
87+
ID=$(git rev-parse --verify --short=7 main) &&
88+
check_snapshot ".git-main-$ID"
8989
'
9090
test_debug 'cat gitweb.headers && cat file_list'
9191

@@ -96,10 +96,10 @@ test_expect_success 'snapshot: short tag name (first)' '
9696
'
9797
test_debug 'cat gitweb.headers && cat file_list'
9898

99-
test_expect_success 'snapshot: full branch name (refs/heads/master)' '
100-
gitweb_run "p=.git;a=snapshot;h=refs/heads/master;sf=tar" &&
101-
ID=$(git rev-parse --verify --short=7 master) &&
102-
check_snapshot ".git-master-$ID"
99+
test_expect_success 'snapshot: full branch name (refs/heads/main)' '
100+
gitweb_run "p=.git;a=snapshot;h=refs/heads/main;sf=tar" &&
101+
ID=$(git rev-parse --verify --short=7 main) &&
102+
check_snapshot ".git-main-$ID"
103103
'
104104
test_debug 'cat gitweb.headers && cat file_list'
105105

t/t9600-cvsimport.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/bin/sh
22

33
test_description='git cvsimport basic tests'
4-
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
4+
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
55
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
66

77
. ./lib-cvs.sh
@@ -162,6 +162,6 @@ test_expect_success PERL 'no .git/cvs-revisions created by default' '
162162
163163
'
164164

165-
test_expect_success PERL 'test entire HEAD' 'test_cmp_branch_tree master'
165+
test_expect_success PERL 'test entire HEAD' 'test_cmp_branch_tree main'
166166

167167
test_done

t/t9601-cvsimport-vendor-branch.sh

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
# tag has been removed.
3333

3434
test_description='git cvsimport handling of vendor branches'
35-
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
35+
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
3636
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
3737

3838
. ./lib-cvs.sh
@@ -45,43 +45,43 @@ test_expect_success PERL 'import a module with a vendor branch' '
4545
4646
'
4747

48-
test_expect_success PERL 'check HEAD out of cvs repository' 'test_cvs_co master'
48+
test_expect_success PERL 'check HEAD out of cvs repository' 'test_cvs_co main'
4949

50-
test_expect_success PERL 'check master out of git repository' 'test_git_co master'
50+
test_expect_success PERL 'check main out of git repository' 'test_git_co main'
5151

5252
test_expect_success PERL 'check a file that was imported once' '
5353
54-
test_cmp_branch_file master imported-once.txt
54+
test_cmp_branch_file main imported-once.txt
5555
5656
'
5757

5858
test_expect_failure PERL 'check a file that was imported twice' '
5959
60-
test_cmp_branch_file master imported-twice.txt
60+
test_cmp_branch_file main imported-twice.txt
6161
6262
'
6363

6464
test_expect_success PERL 'check a file that was imported then modified on HEAD' '
6565
66-
test_cmp_branch_file master imported-modified.txt
66+
test_cmp_branch_file main imported-modified.txt
6767
6868
'
6969

7070
test_expect_success PERL 'check a file that was imported, modified, then imported again' '
7171
72-
test_cmp_branch_file master imported-modified-imported.txt
72+
test_cmp_branch_file main imported-modified-imported.txt
7373
7474
'
7575

7676
test_expect_success PERL 'check a file that was added to HEAD then imported' '
7777
78-
test_cmp_branch_file master added-imported.txt
78+
test_cmp_branch_file main added-imported.txt
7979
8080
'
8181

8282
test_expect_success PERL 'a vendor branch whose tag has been removed' '
8383
84-
test_cmp_branch_file master imported-anonymously.txt
84+
test_cmp_branch_file main imported-anonymously.txt
8585
8686
'
8787

t/t9602-cvsimport-branches-tags.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# t9602/README.
55

66
test_description='git cvsimport handling of branches and tags'
7-
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
7+
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
88
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
99

1010
. ./lib-cvs.sh
@@ -17,9 +17,9 @@ test_expect_success PERL 'import module' '
1717
1818
'
1919

20-
test_expect_success PERL 'test branch master' '
20+
test_expect_success PERL 'test branch main' '
2121
22-
test_cmp_branch_tree master
22+
test_cmp_branch_tree main
2323
2424
'
2525

t/t9603-cvsimport-patchsets.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
# bug.
1313

1414
test_description='git cvsimport testing for correct patchset estimation'
15-
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
15+
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
1616
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
1717

1818
. ./lib-cvs.sh
@@ -23,16 +23,16 @@ test_expect_failure PERL 'import with criss cross times on revisions' '
2323
git cvsimport -p"-x" -C module-git module &&
2424
(
2525
cd module-git &&
26-
git log --pretty=format:%s > ../actual-master &&
26+
git log --pretty=format:%s > ../actual-main &&
2727
git log A~2..A --pretty="format:%s %ad" -- > ../actual-A &&
28-
echo "" >> ../actual-master &&
28+
echo "" >> ../actual-main &&
2929
echo "" >> ../actual-A
3030
) &&
3131
echo "Rev 4
3232
Rev 3
3333
Rev 2
34-
Rev 1" > expect-master &&
35-
test_cmp expect-master actual-master &&
34+
Rev 1" > expect-main &&
35+
test_cmp expect-main actual-main &&
3636
3737
echo "Rev 5 Branch A Wed Mar 11 19:09:10 2009 +0000
3838
Rev 4 Branch A Wed Mar 11 19:03:52 2009 +0000" > expect-A &&

0 commit comments

Comments
 (0)