Skip to content

Commit a9568db

Browse files
dschogitster
authored andcommitted
t5411: adjust the remaining support files for init.defaultBranch=main
This trick was performed via $ sed -i -e 's/master/main/g' -e 's/MASTER/MAIN/g' \ -e 's/Master/Main/g' -- t/t5411/* In the previous commit, we adjusted roughly half of the support files, to stay under the 100kB limit (mails larger than that are rejected by the Git mailing list). Signed-off-by: Johannes Schindelin <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 8f0a264 commit a9568db

18 files changed

+355
-355
lines changed

t/t5411/common-functions.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ create_commits_in () {
2828
shift ||
2929
return 1
3030
done &&
31-
git -C "$repo" update-ref refs/heads/master $oid
31+
git -C "$repo" update-ref refs/heads/main $oid
3232
}
3333

3434
# Format the output of git-push, git-show-ref and other commands to make a

t/t5411/once-0010-report-status-v1.sh

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@ test_expect_success "setup proc-receive hook" '
66
write_script "$upstream/hooks/proc-receive" <<-EOF
77
printf >&2 "# proc-receive hook\n"
88
test-tool proc-receive -v \
9-
-r "ok refs/for/master/topic1" \
9+
-r "ok refs/for/main/topic1" \
1010
-r "option fall-through" \
11-
-r "ok refs/for/master/topic2" \
11+
-r "ok refs/for/main/topic2" \
1212
-r "option refname refs/for/changes/23/123/1" \
1313
-r "option new-oid $A" \
14-
-r "ok refs/for/master/topic2" \
14+
-r "ok refs/for/main/topic2" \
1515
-r "option refname refs/for/changes/24/124/2" \
1616
-r "option old-oid $B" \
1717
-r "option new-oid $A" \
@@ -20,26 +20,26 @@ test_expect_success "setup proc-receive hook" '
2020
EOF
2121
'
2222

23-
# Refs of upstream : master(A)
24-
# Refs of workbench: master(A) tags/v123
25-
# git push : (B) refs/for/master/topic1(A) foo(A) refs/for/next/topic(A) refs/for/master/topic2(A)
23+
# Refs of upstream : main(A)
24+
# Refs of workbench: main(A) tags/v123
25+
# git push : (B) refs/for/main/topic1(A) foo(A) refs/for/next/topic(A) refs/for/main/topic2(A)
2626
test_expect_success "proc-receive: report status v1" '
2727
{
2828
if test -z "$GIT_DEFAULT_HASH" || test "$GIT_DEFAULT_HASH" = "sha1"
2929
then
30-
printf "%s %s refs/heads/master\0report-status\n" \
30+
printf "%s %s refs/heads/main\0report-status\n" \
3131
$A $B | packetize
3232
else
33-
printf "%s %s refs/heads/master\0report-status object-format=$GIT_DEFAULT_HASH\n" \
33+
printf "%s %s refs/heads/main\0report-status object-format=$GIT_DEFAULT_HASH\n" \
3434
$A $B | packetize
3535
fi &&
36-
printf "%s %s refs/for/master/topic1\n" \
36+
printf "%s %s refs/for/main/topic1\n" \
3737
$ZERO_OID $A | packetize &&
3838
printf "%s %s refs/heads/foo\n" \
3939
$ZERO_OID $A | packetize &&
4040
printf "%s %s refs/for/next/topic\n" \
4141
$ZERO_OID $A | packetize &&
42-
printf "%s %s refs/for/master/topic2\n" \
42+
printf "%s %s refs/for/main/topic2\n" \
4343
$ZERO_OID $A | packetize &&
4444
printf 0000 &&
4545
printf "" | git -C "$upstream" pack-objects --stdout
@@ -48,35 +48,35 @@ test_expect_success "proc-receive: report status v1" '
4848
make_user_friendly_and_stable_output <out >actual &&
4949
cat >expect <<-EOF &&
5050
# pre-receive hook
51-
pre-receive< <COMMIT-A> <COMMIT-B> refs/heads/master
52-
pre-receive< <ZERO-OID> <COMMIT-A> refs/for/master/topic1
51+
pre-receive< <COMMIT-A> <COMMIT-B> refs/heads/main
52+
pre-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic1
5353
pre-receive< <ZERO-OID> <COMMIT-A> refs/heads/foo
5454
pre-receive< <ZERO-OID> <COMMIT-A> refs/for/next/topic
55-
pre-receive< <ZERO-OID> <COMMIT-A> refs/for/master/topic2
55+
pre-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic2
5656
# proc-receive hook
57-
proc-receive< <ZERO-OID> <COMMIT-A> refs/for/master/topic1
57+
proc-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic1
5858
proc-receive< <ZERO-OID> <COMMIT-A> refs/for/next/topic
59-
proc-receive< <ZERO-OID> <COMMIT-A> refs/for/master/topic2
60-
proc-receive> ok refs/for/master/topic1
59+
proc-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic2
60+
proc-receive> ok refs/for/main/topic1
6161
proc-receive> option fall-through
62-
proc-receive> ok refs/for/master/topic2
62+
proc-receive> ok refs/for/main/topic2
6363
proc-receive> option refname refs/for/changes/23/123/1
6464
proc-receive> option new-oid <COMMIT-A>
65-
proc-receive> ok refs/for/master/topic2
65+
proc-receive> ok refs/for/main/topic2
6666
proc-receive> option refname refs/for/changes/24/124/2
6767
proc-receive> option old-oid <COMMIT-B>
6868
proc-receive> option new-oid <COMMIT-A>
6969
proc-receive> option forced-update
7070
proc-receive> ng refs/for/next/topic target branch not exist
7171
000eunpack ok
72-
0019ok refs/heads/master
73-
001eok refs/for/master/topic1
72+
0019ok refs/heads/main
73+
001eok refs/for/main/topic1
7474
0016ok refs/heads/foo
7575
0033ng refs/for/next/topic target branch not exist
76-
001eok refs/for/master/topic2
76+
001eok refs/for/main/topic2
7777
0000# post-receive hook
78-
post-receive< <COMMIT-A> <COMMIT-B> refs/heads/master
79-
post-receive< <ZERO-OID> <COMMIT-A> refs/for/master/topic1
78+
post-receive< <COMMIT-A> <COMMIT-B> refs/heads/main
79+
post-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic1
8080
post-receive< <ZERO-OID> <COMMIT-A> refs/heads/foo
8181
post-receive< <ZERO-OID> <COMMIT-A> refs/for/changes/23/123/1
8282
post-receive< <COMMIT-B> <COMMIT-A> refs/for/changes/24/124/2
@@ -86,9 +86,9 @@ test_expect_success "proc-receive: report status v1" '
8686
git -C "$upstream" show-ref >out &&
8787
make_user_friendly_and_stable_output <out >actual &&
8888
cat >expect <<-EOF &&
89-
<COMMIT-A> refs/for/master/topic1
89+
<COMMIT-A> refs/for/main/topic1
9090
<COMMIT-A> refs/heads/foo
91-
<COMMIT-B> refs/heads/master
91+
<COMMIT-B> refs/heads/main
9292
EOF
9393
test_cmp expect actual
9494
'

t/t5411/test-0000-standard-git-push.sh

Lines changed: 36 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,39 @@
1-
# Refs of upstream : master(A)
2-
# Refs of workbench: master(A) tags/v123
3-
# git-push : master(B) next(A)
1+
# Refs of upstream : main(A)
2+
# Refs of workbench: main(A) tags/v123
3+
# git-push : main(B) next(A)
44
test_expect_success "git-push ($PROTOCOL)" '
55
git -C workbench push origin \
6-
$B:refs/heads/master \
6+
$B:refs/heads/main \
77
HEAD:refs/heads/next \
88
>out 2>&1 &&
99
make_user_friendly_and_stable_output <out >actual &&
1010
cat >expect <<-EOF &&
1111
remote: # pre-receive hook
12-
remote: pre-receive< <COMMIT-A> <COMMIT-B> refs/heads/master
12+
remote: pre-receive< <COMMIT-A> <COMMIT-B> refs/heads/main
1313
remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/heads/next
1414
remote: # post-receive hook
15-
remote: post-receive< <COMMIT-A> <COMMIT-B> refs/heads/master
15+
remote: post-receive< <COMMIT-A> <COMMIT-B> refs/heads/main
1616
remote: post-receive< <ZERO-OID> <COMMIT-A> refs/heads/next
1717
To <URL/of/upstream.git>
18-
<OID-A>..<OID-B> <COMMIT-B> -> master
18+
<OID-A>..<OID-B> <COMMIT-B> -> main
1919
* [new branch] HEAD -> next
2020
EOF
2121
test_cmp expect actual &&
2222
git -C "$upstream" show-ref >out &&
2323
make_user_friendly_and_stable_output <out >actual &&
2424
cat >expect <<-EOF &&
25-
<COMMIT-B> refs/heads/master
25+
<COMMIT-B> refs/heads/main
2626
<COMMIT-A> refs/heads/next
2727
EOF
2828
test_cmp expect actual
2929
'
3030

31-
# Refs of upstream : master(B) next(A)
32-
# Refs of workbench: master(A) tags/v123
33-
# git-push --atomic: master(A) next(B)
31+
# Refs of upstream : main(B) next(A)
32+
# Refs of workbench: main(A) tags/v123
33+
# git-push --atomic: main(A) next(B)
3434
test_expect_success "git-push --atomic ($PROTOCOL)" '
3535
test_must_fail git -C workbench push --atomic origin \
36-
master \
36+
main \
3737
$B:refs/heads/next \
3838
>out 2>&1 &&
3939
make_user_friendly_and_stable_output <out |
@@ -43,28 +43,28 @@ test_expect_success "git-push --atomic ($PROTOCOL)" '
4343
>actual &&
4444
cat >expect <<-EOF &&
4545
To <URL/of/upstream.git>
46-
! [rejected] master -> master (non-fast-forward)
46+
! [rejected] main -> main (non-fast-forward)
4747
! [rejected] <COMMIT-B> -> next (atomic push failed)
4848
EOF
4949
test_cmp expect actual &&
5050
git -C "$upstream" show-ref >out &&
5151
make_user_friendly_and_stable_output <out >actual &&
5252
cat >expect <<-EOF &&
53-
<COMMIT-B> refs/heads/master
53+
<COMMIT-B> refs/heads/main
5454
<COMMIT-A> refs/heads/next
5555
EOF
5656
test_cmp expect actual
5757
'
5858

59-
# Refs of upstream : master(B) next(A)
60-
# Refs of workbench: master(A) tags/v123
61-
# git-push : master(A) next(B)
59+
# Refs of upstream : main(B) next(A)
60+
# Refs of workbench: main(A) tags/v123
61+
# git-push : main(A) next(B)
6262
test_expect_success "non-fast-forward git-push ($PROTOCOL)" '
6363
test_must_fail git \
6464
-C workbench \
6565
-c advice.pushUpdateRejected=false \
6666
push origin \
67-
master \
67+
main \
6868
$B:refs/heads/next \
6969
>out 2>&1 &&
7070
make_user_friendly_and_stable_output <out >actual &&
@@ -75,68 +75,68 @@ test_expect_success "non-fast-forward git-push ($PROTOCOL)" '
7575
remote: post-receive< <COMMIT-A> <COMMIT-B> refs/heads/next
7676
To <URL/of/upstream.git>
7777
<OID-A>..<OID-B> <COMMIT-B> -> next
78-
! [rejected] master -> master (non-fast-forward)
78+
! [rejected] main -> main (non-fast-forward)
7979
EOF
8080
test_cmp expect actual &&
8181
git -C "$upstream" show-ref >out &&
8282
make_user_friendly_and_stable_output <out >actual &&
8383
cat >expect <<-EOF &&
84-
<COMMIT-B> refs/heads/master
84+
<COMMIT-B> refs/heads/main
8585
<COMMIT-B> refs/heads/next
8686
EOF
8787
test_cmp expect actual
8888
'
8989

90-
# Refs of upstream : master(B) next(B)
91-
# Refs of workbench: master(A) tags/v123
92-
# git-push -f : master(A) NULL tags/v123 refs/review/master/topic(A) a/b/c(A)
90+
# Refs of upstream : main(B) next(B)
91+
# Refs of workbench: main(A) tags/v123
92+
# git-push -f : main(A) NULL tags/v123 refs/review/main/topic(A) a/b/c(A)
9393
test_expect_success "git-push -f ($PROTOCOL)" '
9494
git -C workbench push -f origin \
9595
refs/tags/v123 \
9696
:refs/heads/next \
97-
master \
98-
master:refs/review/master/topic \
97+
main \
98+
main:refs/review/main/topic \
9999
HEAD:refs/heads/a/b/c \
100100
>out 2>&1 &&
101101
make_user_friendly_and_stable_output <out >actual &&
102102
cat >expect <<-EOF &&
103103
remote: # pre-receive hook
104-
remote: pre-receive< <COMMIT-B> <COMMIT-A> refs/heads/master
104+
remote: pre-receive< <COMMIT-B> <COMMIT-A> refs/heads/main
105105
remote: pre-receive< <COMMIT-B> <ZERO-OID> refs/heads/next
106106
remote: pre-receive< <ZERO-OID> <TAG-v123> refs/tags/v123
107-
remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/review/master/topic
107+
remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/review/main/topic
108108
remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/heads/a/b/c
109109
remote: # post-receive hook
110-
remote: post-receive< <COMMIT-B> <COMMIT-A> refs/heads/master
110+
remote: post-receive< <COMMIT-B> <COMMIT-A> refs/heads/main
111111
remote: post-receive< <COMMIT-B> <ZERO-OID> refs/heads/next
112112
remote: post-receive< <ZERO-OID> <TAG-v123> refs/tags/v123
113-
remote: post-receive< <ZERO-OID> <COMMIT-A> refs/review/master/topic
113+
remote: post-receive< <ZERO-OID> <COMMIT-A> refs/review/main/topic
114114
remote: post-receive< <ZERO-OID> <COMMIT-A> refs/heads/a/b/c
115115
To <URL/of/upstream.git>
116-
+ <OID-B>...<OID-A> master -> master (forced update)
116+
+ <OID-B>...<OID-A> main -> main (forced update)
117117
- [deleted] next
118118
* [new tag] v123 -> v123
119-
* [new reference] master -> refs/review/master/topic
119+
* [new reference] main -> refs/review/main/topic
120120
* [new branch] HEAD -> a/b/c
121121
EOF
122122
test_cmp expect actual &&
123123
git -C "$upstream" show-ref >out &&
124124
make_user_friendly_and_stable_output <out >actual &&
125125
cat >expect <<-EOF &&
126126
<COMMIT-A> refs/heads/a/b/c
127-
<COMMIT-A> refs/heads/master
128-
<COMMIT-A> refs/review/master/topic
127+
<COMMIT-A> refs/heads/main
128+
<COMMIT-A> refs/review/main/topic
129129
<TAG-v123> refs/tags/v123
130130
EOF
131131
test_cmp expect actual
132132
'
133133

134-
# Refs of upstream : master(A) tags/v123 refs/review/master/topic(A) a/b/c(A)
135-
# Refs of workbench: master(A) tags/v123
134+
# Refs of upstream : main(A) tags/v123 refs/review/main/topic(A) a/b/c(A)
135+
# Refs of workbench: main(A) tags/v123
136136
test_expect_success "cleanup ($PROTOCOL)" '
137137
(
138138
cd "$upstream" &&
139-
git update-ref -d refs/review/master/topic &&
139+
git update-ref -d refs/review/main/topic &&
140140
git update-ref -d refs/tags/v123 &&
141141
git update-ref -d refs/heads/a/b/c
142142
)

0 commit comments

Comments
 (0)