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 <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Johannes Schindelin committed
Nov 18, 2020 at 23:44 UTC
765577b5d0ea1440f762ec9b6ba94792b3495221
8 files changed
+48
-48
t/lib-cvs.sh
+1
-1
@@ -36,7 +36,7 @@ setup_cvs_test_repository () {
36
test_cvs_co () {
37
# Usage: test_cvs_co BRANCH_NAME
38
rm -rf module-cvs-"$1"
39
- if [ "$1" = "master" ]
39
+ if [ "$1" = "main" ]
40
then
41
$CVS co -P -d module-cvs-"$1" -A module
42
else
t/t9500-gitweb-standalone-no-errors.sh
+11
-11
@@ -10,7 +10,7 @@ commandline, and checks that it would not write any errors
10
or warnings to log.'
11
12
13
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
13
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
14
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
15
16
. ./gitweb-lib.sh
@@ -330,7 +330,7 @@ test_expect_success \
330
echo "Branch" >>b &&
331
git add b &&
332
git commit -a -m "On branch" &&
333
- git checkout master &&
333
+ git checkout main &&
334
git merge b &&
335
git tag merge_commit'
336
@@ -367,7 +367,7 @@ test_expect_success \
367
echo "Changed and have mode changed" >07-change-mode-change &&
368
test_chmod +x 07-change-mode-change &&
369
git commit -a -m "Large commit" &&
370
- git checkout master'
370
+ git checkout main'
371
372
test_expect_success \
373
'commit(1): large commit' \
@@ -405,7 +405,7 @@ test_expect_success 'side-by-side: merge commit' '
405
406
test_expect_success \
407
'tags: list of different types of tags' \
408
- 'git checkout master &&
408
+ 'git checkout main &&
409
git tag -a -m "Tag commit object" tag-commit HEAD &&
410
git tag -a -m "" tag-commit-nomessage HEAD &&
411
git tag -a -m "Tag tag object" tag-tag tag-commit &&
@@ -446,7 +446,7 @@ test_expect_success \
446
447
test_expect_success \
448
'logs: history (implicit HEAD, deleted file)' \
449
- 'git checkout master &&
449
+ 'git checkout main &&
450
echo "to be deleted" >deleted_file &&
451
git add deleted_file &&
452
git commit -m "Add file to be deleted" &&
@@ -466,11 +466,11 @@ test_expect_success \
466
467
test_expect_success \
468
'path_info: project/branch:file' \
469
- 'gitweb_run "" "/.git/master:file"'
469
+ 'gitweb_run "" "/.git/main:file"'
470
471
test_expect_success \
472
'path_info: project/branch:dir/' \
473
- 'gitweb_run "" "/.git/master:foo/"'
473
+ 'gitweb_run "" "/.git/main:foo/"'
474
475
test_expect_success \
476
'path_info: project/branch (non-existent)' \
@@ -482,16 +482,16 @@ test_expect_success \
482
483
test_expect_success \
484
'path_info: project/branch:file (non-existent)' \
485
- 'gitweb_run "" "/.git/master:non-existent"'
485
+ 'gitweb_run "" "/.git/main:non-existent"'
486
487
test_expect_success \
488
'path_info: project/branch:dir/ (non-existent)' \
489
- 'gitweb_run "" "/.git/master:non-existent/"'
489
+ 'gitweb_run "" "/.git/main:non-existent/"'
490
491
492
test_expect_success \
493
'path_info: project/branch:/file' \
494
- 'gitweb_run "" "/.git/master:/file"'
494
+ 'gitweb_run "" "/.git/main:/file"'
495
496
test_expect_success \
497
'path_info: project/:/file (implicit HEAD)' \
@@ -804,7 +804,7 @@ test_expect_success \
804
git checkout orphan_branch ||
805
git checkout --orphan orphan_branch
806
} &&
807
- test_when_finished "git checkout master" &&
807
+ test_when_finished "git checkout main" &&
808
gitweb_run "p=.git;a=summary"'
809
810
test_done
t/t9501-gitweb-standalone-http-status.sh
+8
-8
@@ -10,7 +10,7 @@ commandline, and checks that it returns the expected HTTP status
10
code and message.'
11
12
13
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
13
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
14
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
15
16
. ./gitweb-lib.sh
@@ -88,7 +88,7 @@ test_debug 'cat gitweb.headers'
88
# snapshot hash ids
89
90
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" &&
92
grep "Status: 200 OK" gitweb.output
93
'
94
test_debug 'cat gitweb.headers'
@@ -126,7 +126,7 @@ test_debug 'cat gitweb.output'
126
# modification times (Last-Modified and If-Modified-Since)
127
128
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" &&
130
grep "Status: 200 OK" gitweb.headers &&
131
grep "Last-modified: Thu, 7 Apr 2005 22:14:13 +0000" gitweb.headers
132
'
@@ -136,7 +136,7 @@ test_expect_success DATE_PARSER 'modification: feed if-modified-since (modified)
136
HTTP_IF_MODIFIED_SINCE="Wed, 6 Apr 2005 22:14:13 +0000" &&
137
export HTTP_IF_MODIFIED_SINCE &&
138
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" &&
140
grep "Status: 200 OK" gitweb.headers
141
'
142
test_debug 'cat gitweb.headers'
@@ -145,13 +145,13 @@ test_expect_success DATE_PARSER 'modification: feed if-modified-since (unmodifie
145
HTTP_IF_MODIFIED_SINCE="Thu, 7 Apr 2005 22:14:13 +0000" &&
146
export HTTP_IF_MODIFIED_SINCE &&
147
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" &&
149
grep "Status: 304 Not Modified" gitweb.headers
150
'
151
test_debug 'cat gitweb.headers'
152
153
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" &&
155
grep "Status: 200 OK" gitweb.headers &&
156
grep "Last-modified: Thu, 7 Apr 2005 22:14:13 +0000" gitweb.headers
157
'
@@ -161,7 +161,7 @@ test_expect_success DATE_PARSER 'modification: snapshot if-modified-since (modif
161
HTTP_IF_MODIFIED_SINCE="Wed, 6 Apr 2005 22:14:13 +0000" &&
162
export HTTP_IF_MODIFIED_SINCE &&
163
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" &&
165
grep "Status: 200 OK" gitweb.headers
166
'
167
test_debug 'cat gitweb.headers'
@@ -170,7 +170,7 @@ test_expect_success DATE_PARSER 'modification: snapshot if-modified-since (unmod
170
HTTP_IF_MODIFIED_SINCE="Thu, 7 Apr 2005 22:14:13 +0000" &&
171
export HTTP_IF_MODIFIED_SINCE &&
172
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" &&
174
grep "Status: 304 Not Modified" gitweb.headers
175
'
176
test_debug 'cat gitweb.headers'
t/t9502-gitweb-standalone-parse-output.sh
+9
-9
@@ -10,7 +10,7 @@ commandline, and checks that it produces the correct output, either
10
in the HTTP header or the actual script output.'
11
12
13
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
13
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
14
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
15
16
. ./gitweb-lib.sh
@@ -82,10 +82,10 @@ test_expect_success 'snapshot: HEAD' '
82
'
83
test_debug 'cat gitweb.headers && cat file_list'
84
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"
89
'
90
test_debug 'cat gitweb.headers && cat file_list'
91
@@ -96,10 +96,10 @@ test_expect_success 'snapshot: short tag name (first)' '
96
'
97
test_debug 'cat gitweb.headers && cat file_list'
98
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"
103
'
104
test_debug 'cat gitweb.headers && cat file_list'
105
t/t9600-cvsimport.sh
+2
-2
@@ -1,7 +1,7 @@
1
#!/bin/sh
2
3
test_description='git cvsimport basic tests'
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
. ./lib-cvs.sh
@@ -162,6 +162,6 @@ test_expect_success PERL 'no .git/cvs-revisions created by default' '
162
163
'
164
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'
166
167
test_done
t/t9601-cvsimport-vendor-branch.sh
+9
-9
@@ -32,7 +32,7 @@
32
# tag has been removed.
33
34
test_description='git cvsimport handling of vendor branches'
35
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
35
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
36
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
37
38
. ./lib-cvs.sh
@@ -45,43 +45,43 @@ test_expect_success PERL 'import a module with a vendor branch' '
45
46
'
47
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'
49
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'
51
52
test_expect_success PERL 'check a file that was imported once' '
53
54
- test_cmp_branch_file master imported-once.txt
54
+ test_cmp_branch_file main imported-once.txt
55
56
'
57
58
test_expect_failure PERL 'check a file that was imported twice' '
59
60
- test_cmp_branch_file master imported-twice.txt
60
+ test_cmp_branch_file main imported-twice.txt
61
62
'
63
64
test_expect_success PERL 'check a file that was imported then modified on HEAD' '
65
66
- test_cmp_branch_file master imported-modified.txt
66
+ test_cmp_branch_file main imported-modified.txt
67
68
'
69
70
test_expect_success PERL 'check a file that was imported, modified, then imported again' '
71
72
- test_cmp_branch_file master imported-modified-imported.txt
72
+ test_cmp_branch_file main imported-modified-imported.txt
73
74
'
75
76
test_expect_success PERL 'check a file that was added to HEAD then imported' '
77
78
- test_cmp_branch_file master added-imported.txt
78
+ test_cmp_branch_file main added-imported.txt
79
80
'
81
82
test_expect_success PERL 'a vendor branch whose tag has been removed' '
83
84
- test_cmp_branch_file master imported-anonymously.txt
84
+ test_cmp_branch_file main imported-anonymously.txt
85
86
'
87
t/t9602-cvsimport-branches-tags.sh
+3
-3
@@ -4,7 +4,7 @@
4
# t9602/README.
5
6
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
8
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
9
10
. ./lib-cvs.sh
@@ -17,9 +17,9 @@ test_expect_success PERL 'import module' '
17
18
'
19
20
-test_expect_success PERL 'test branch master' '
20
+test_expect_success PERL 'test branch main' '
21
22
- test_cmp_branch_tree master
22
+ test_cmp_branch_tree main
23
24
'
25
t/t9603-cvsimport-patchsets.sh
+5
-5
@@ -12,7 +12,7 @@
12
# bug.
13
14
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
16
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
17
18
. ./lib-cvs.sh
@@ -23,16 +23,16 @@ test_expect_failure PERL 'import with criss cross times on revisions' '
23
git cvsimport -p"-x" -C module-git module &&
24
(
25
cd module-git &&
26
- git log --pretty=format:%s > ../actual-master &&
26
+ git log --pretty=format:%s > ../actual-main &&
27
git log A~2..A --pretty="format:%s %ad" -- > ../actual-A &&
28
- echo "" >> ../actual-master &&
28
+ echo "" >> ../actual-main &&
29
echo "" >> ../actual-A
30
) &&
31
echo "Rev 4
32
Rev 3
33
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 &&
36
37
echo "Rev 5 Branch A Wed Mar 11 19:09:10 2009 +0000
38
Rev 4 Branch A Wed Mar 11 19:03:52 2009 +0000" > expect-A &&