t550*: 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' -- t550*.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
3275f4e886b124b832b8b822c48e3e07b5b143ed
8 files changed
+130
-130
t/t5500-fetch-pack.sh
+15
-15
@@ -5,7 +5,7 @@
5
6
test_description='Testing multi_ack pack fetching'
7
8
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
8
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
9
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
10
11
. ./test-lib.sh
@@ -410,14 +410,14 @@ test_expect_success 'in_vain resetted upon ACK' '
410
rm -rf myserver myclient &&
411
git init myserver &&
412
413
- # Linked list of commits on master. The first is common; the rest are
413
+ # Linked list of commits on main. The first is common; the rest are
414
# not.
415
- test_commit -C myserver first_master_commit &&
415
+ test_commit -C myserver first_main_commit &&
416
git clone "file://$(pwd)/myserver" myclient &&
417
test_commit_bulk -C myclient 255 &&
418
419
# Another linked list of commits on anotherbranch with no connection to
420
- # master. The first is common; the rest are not.
420
+ # main. The first is common; the rest are not.
421
git -C myserver checkout --orphan anotherbranch &&
422
test_commit -C myserver first_anotherbranch_commit &&
423
git -C myclient fetch origin anotherbranch:refs/heads/anotherbranch &&
@@ -425,14 +425,14 @@ test_expect_success 'in_vain resetted upon ACK' '
425
test_commit_bulk -C myclient 255 &&
426
427
# The new commit that the client wants to fetch.
428
- git -C myserver checkout master &&
428
+ git -C myserver checkout main &&
429
test_commit -C myserver to_fetch &&
430
431
# The client will send (as "have"s) all 256 commits in anotherbranch
432
# first. The 256th commit is common between the client and the server,
433
# and should reset in_vain. This allows negotiation to continue until
434
# the client reports that first_anotherbranch_commit is common.
435
- git -C myclient fetch --progress origin master 2>log &&
435
+ git -C myclient fetch --progress origin main 2>log &&
436
test_i18ngrep "Total 3 " log
437
'
438
@@ -640,7 +640,7 @@ test_expect_success 'shallow fetch with tags does not break the repository' '
640
mkdir repo2 &&
641
cd repo2 &&
642
git init &&
643
- git fetch --depth=2 ../.git master:branch &&
643
+ git fetch --depth=2 ../.git main:branch &&
644
git fsck
645
)
646
'
@@ -665,7 +665,7 @@ test_expect_success 'fetch-pack can fetch a raw sha1 that is advertised as a ref
665
666
git init client &&
667
git -C client fetch-pack ../server \
668
- $(git -C server rev-parse refs/heads/master)
668
+ $(git -C server rev-parse refs/heads/main)
669
'
670
671
test_expect_success 'fetch-pack can fetch a raw sha1 overlapping a named ref' '
@@ -691,7 +691,7 @@ test_expect_success 'fetch-pack cannot fetch a raw sha1 that is not advertised a
691
# Some protocol versions (e.g. 2) support fetching
692
# unadvertised objects, so restrict this test to v0.
693
test_must_fail env GIT_TEST_PROTOCOL_VERSION=0 git -C client fetch-pack ../server \
694
- $(git -C server rev-parse refs/heads/master^) 2>err &&
694
+ $(git -C server rev-parse refs/heads/main^) 2>err &&
695
test_i18ngrep "Server does not allow request for unadvertised object" err
696
'
697
@@ -825,7 +825,7 @@ test_expect_success 'clone shallow since ...' '
825
826
test_expect_success 'fetch shallow since ...' '
827
git -C shallow11 fetch --shallow-since "200000000 +0700" origin &&
828
- git -C shallow11 log --pretty=tformat:%s origin/master >actual &&
828
+ git -C shallow11 log --pretty=tformat:%s origin/main >actual &&
829
cat >expected <<-\EOF &&
830
three
831
two
@@ -866,7 +866,7 @@ test_expect_success 'shallow since with commit graph and already-seen commit' '
866
(
867
cd shallow-since-graph &&
868
test_commit base &&
869
- test_commit master &&
869
+ test_commit main &&
870
git checkout -b other HEAD^ &&
871
test_commit other &&
872
git commit-graph write --reachable &&
@@ -877,7 +877,7 @@ test_expect_success 'shallow since with commit graph and already-seen commit' '
877
$(echo "object-format=$(test_oid algo)" | packetize)
878
00010013deepen-since 1
879
$(echo "want $(git rev-parse other)" | packetize)
880
- $(echo "have $(git rev-parse master)" | packetize)
880
+ $(echo "have $(git rev-parse main)" | packetize)
881
0000
882
EOF
883
)
@@ -899,7 +899,7 @@ test_expect_success 'shallow clone exclude tag two' '
899
900
test_expect_success 'fetch exclude tag one' '
901
git -C shallow12 fetch --shallow-exclude one origin &&
902
- git -C shallow12 log --pretty=tformat:%s origin/master >actual &&
902
+ git -C shallow12 log --pretty=tformat:%s origin/main >actual &&
903
test_write_lines three two >expected &&
904
test_cmp expected actual
905
'
@@ -913,11 +913,11 @@ test_expect_success 'fetching deepen' '
913
test_commit three &&
914
git clone --depth 1 "file://$(pwd)/." deepen &&
915
test_commit four &&
916
- git -C deepen log --pretty=tformat:%s master >actual &&
916
+ git -C deepen log --pretty=tformat:%s main >actual &&
917
echo three >expected &&
918
test_cmp expected actual &&
919
git -C deepen fetch --deepen=1 &&
920
- git -C deepen log --pretty=tformat:%s origin/master >actual &&
920
+ git -C deepen log --pretty=tformat:%s origin/main >actual &&
921
cat >expected <<-\EOF &&
922
four
923
three
t/t5501-fetch-push-alternates.sh
+3
-3
@@ -1,7 +1,7 @@
1
#!/bin/sh
2
3
test_description='fetch/push involving alternates'
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
. ./test-lib.sh
@@ -48,7 +48,7 @@ test_expect_success setup '
48
test_expect_success 'pushing into a repository with the same alternate' '
49
(
50
cd one &&
51
- git push ../receiver master:refs/heads/it
51
+ git push ../receiver main:refs/heads/it
52
) &&
53
(
54
cd receiver &&
@@ -60,7 +60,7 @@ test_expect_success 'pushing into a repository with the same alternate' '
60
test_expect_success 'fetching from a repository with the same alternate' '
61
(
62
cd fetcher &&
63
- git fetch ../one master:refs/heads/it &&
63
+ git fetch ../one main:refs/heads/it &&
64
count_objects >../fetcher.count
65
) &&
66
test_cmp one.count fetcher.count
t/t5502-quickfetch.sh
+4
-4
@@ -2,7 +2,7 @@
2
3
test_description='test quickfetch from local'
4
5
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
5
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
6
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
7
8
. ./test-lib.sh
@@ -111,14 +111,14 @@ test_expect_success 'quickfetch should not copy from alternate' '
111
q
112
}"
113
) ) &&
114
- origin_master=$( (
114
+ origin_main=$( (
115
cd quickclone &&
116
- git rev-parse origin/master
116
+ git rev-parse origin/main
117
) ) &&
118
echo "loose objects: $obj_cnt, packfiles: $pck_cnt" &&
119
test $obj_cnt -eq 0 &&
120
test $pck_cnt -eq 0 &&
121
- test z$origin_master = z$(git rev-parse master)
121
+ test z$origin_main = z$(git rev-parse main)
122
123
'
124
t/t5503-tagfollow.sh
+7
-7
@@ -2,7 +2,7 @@
2
3
test_description='test automatic tag following'
4
5
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
5
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
6
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
7
8
. ./test-lib.sh
@@ -14,7 +14,7 @@ export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
14
# L - A ------ O ------ B
15
# \ \ \
16
# \ C - origin/cat \
17
-# origin/master master
17
+# origin/main main
18
19
test_expect_success setup '
20
test_tick &&
@@ -60,7 +60,7 @@ test_expect_success 'fetch A (new commit : 1 connection)' '
60
(
61
cd cloned &&
62
GIT_TRACE_PACKET=$UPATH git fetch &&
63
- test $A = $(git rev-parse --verify origin/master)
63
+ test $A = $(git rev-parse --verify origin/main)
64
) &&
65
get_needs $U >actual &&
66
test_cmp expect actual
@@ -75,7 +75,7 @@ test_expect_success "create tag T on A, create C on branch cat" '
75
git add file &&
76
git commit -m C &&
77
C=$(git rev-parse --verify HEAD) &&
78
- git checkout master
78
+ git checkout main
79
'
80
81
test_expect_success 'setup expect' '
@@ -126,7 +126,7 @@ test_expect_success 'fetch B, S (commit and tag : 1 connection)' '
126
(
127
cd cloned &&
128
GIT_TRACE_PACKET=$UPATH git fetch &&
129
- test $B = $(git rev-parse --verify origin/master) &&
129
+ test $B = $(git rev-parse --verify origin/main) &&
130
test $B = $(git rev-parse --verify tag2^0) &&
131
test $S = $(git rev-parse --verify tag2)
132
) &&
@@ -141,7 +141,7 @@ want $S
141
EOF
142
'
143
144
-test_expect_success 'new clone fetch master and tags' '
144
+test_expect_success 'new clone fetch main and tags' '
145
test_might_fail git branch -D cat &&
146
rm -f $U &&
147
(
@@ -150,7 +150,7 @@ test_expect_success 'new clone fetch master and tags' '
150
git init &&
151
git remote add origin .. &&
152
GIT_TRACE_PACKET=$UPATH git fetch &&
153
- test $B = $(git rev-parse --verify origin/master) &&
153
+ test $B = $(git rev-parse --verify origin/main) &&
154
test $S = $(git rev-parse --verify tag2) &&
155
test $B = $(git rev-parse --verify tag2^0) &&
156
test $T = $(git rev-parse --verify tag1) &&
t/t5504-fetch-receive-strict.sh
+11
-11
@@ -1,7 +1,7 @@
1
#!/bin/sh
2
3
test_description='fetch/receive strict mode'
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
. ./test-lib.sh
@@ -28,7 +28,7 @@ test_expect_success 'fetch without strict' '
28
cd dst &&
29
git config fetch.fsckobjects false &&
30
git config transfer.fsckobjects false &&
31
- test_must_fail git fetch ../.git master
31
+ test_must_fail git fetch ../.git main
32
)
33
'
34
@@ -39,7 +39,7 @@ test_expect_success 'fetch with !fetch.fsckobjects' '
39
cd dst &&
40
git config fetch.fsckobjects false &&
41
git config transfer.fsckobjects true &&
42
- test_must_fail git fetch ../.git master
42
+ test_must_fail git fetch ../.git main
43
)
44
'
45
@@ -50,7 +50,7 @@ test_expect_success 'fetch with fetch.fsckobjects' '
50
cd dst &&
51
git config fetch.fsckobjects true &&
52
git config transfer.fsckobjects false &&
53
- test_must_fail git fetch ../.git master
53
+ test_must_fail git fetch ../.git main
54
)
55
'
56
@@ -60,13 +60,13 @@ test_expect_success 'fetch with transfer.fsckobjects' '
60
(
61
cd dst &&
62
git config transfer.fsckobjects true &&
63
- test_must_fail git fetch ../.git master
63
+ test_must_fail git fetch ../.git main
64
)
65
'
66
67
cat >exp <<EOF
68
To dst
69
-! refs/heads/master:refs/heads/test [remote rejected] (missing necessary objects)
69
+! refs/heads/main:refs/heads/test [remote rejected] (missing necessary objects)
70
Done
71
EOF
72
@@ -78,7 +78,7 @@ test_expect_success 'push without strict' '
78
git config fetch.fsckobjects false &&
79
git config transfer.fsckobjects false
80
) &&
81
- test_must_fail git push --porcelain dst master:refs/heads/test >act &&
81
+ test_must_fail git push --porcelain dst main:refs/heads/test >act &&
82
test_cmp exp act
83
'
84
@@ -90,13 +90,13 @@ test_expect_success 'push with !receive.fsckobjects' '
90
git config receive.fsckobjects false &&
91
git config transfer.fsckobjects true
92
) &&
93
- test_must_fail git push --porcelain dst master:refs/heads/test >act &&
93
+ test_must_fail git push --porcelain dst main:refs/heads/test >act &&
94
test_cmp exp act
95
'
96
97
cat >exp <<EOF
98
To dst
99
-! refs/heads/master:refs/heads/test [remote rejected] (unpacker error)
99
+! refs/heads/main:refs/heads/test [remote rejected] (unpacker error)
100
EOF
101
102
test_expect_success 'push with receive.fsckobjects' '
@@ -107,7 +107,7 @@ test_expect_success 'push with receive.fsckobjects' '
107
git config receive.fsckobjects true &&
108
git config transfer.fsckobjects false
109
) &&
110
- test_must_fail git push --porcelain dst master:refs/heads/test >act &&
110
+ test_must_fail git push --porcelain dst main:refs/heads/test >act &&
111
test_cmp exp act
112
'
113
@@ -118,7 +118,7 @@ test_expect_success 'push with transfer.fsckobjects' '
118
cd dst &&
119
git config transfer.fsckobjects true
120
) &&
121
- test_must_fail git push --porcelain dst master:refs/heads/test >act &&
121
+ test_must_fail git push --porcelain dst main:refs/heads/test >act &&
122
test_cmp exp act
123
'
124
t/t5505-remote.sh
+71
-71
@@ -2,7 +2,7 @@
2
3
test_description='git remote porcelain-ish'
4
5
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
5
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
6
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
7
8
. ./test-lib.sh
@@ -20,7 +20,7 @@ setup_repository () {
20
git add elif &&
21
test_tick &&
22
git commit -m "Second" &&
23
- git checkout master
23
+ git checkout main
24
)
25
}
26
@@ -63,8 +63,8 @@ test_expect_success C_LOCALE_OUTPUT 'remote information for the origin' '
63
(
64
cd test &&
65
tokens_match origin "$(git remote)" &&
66
- check_remote_track origin master side &&
67
- check_tracking_branch origin HEAD master side
66
+ check_remote_track origin main side &&
67
+ check_tracking_branch origin HEAD main side
68
)
69
'
70
@@ -73,7 +73,7 @@ test_expect_success 'add another remote' '
73
cd test &&
74
git remote add -f second ../two &&
75
tokens_match "origin second" "$(git remote)" &&
76
- check_tracking_branch second master side another &&
76
+ check_tracking_branch second main side another &&
77
git for-each-ref "--format=%(refname)" refs/remotes |
78
sed -e "/^refs\/remotes\/origin\//d" \
79
-e "/^refs\/remotes\/second\//d" >actual &&
@@ -84,8 +84,8 @@ test_expect_success 'add another remote' '
84
test_expect_success C_LOCALE_OUTPUT 'check remote-tracking' '
85
(
86
cd test &&
87
- check_remote_track origin master side &&
88
- check_remote_track second master side another
87
+ check_remote_track origin main side &&
88
+ check_remote_track second main side another
89
)
90
'
91
@@ -102,7 +102,7 @@ test_expect_success 'remote forces tracking branches' '
102
test_expect_success 'remove remote' '
103
(
104
cd test &&
105
- git symbolic-ref refs/remotes/second/HEAD refs/remotes/second/master &&
105
+ git symbolic-ref refs/remotes/second/HEAD refs/remotes/second/main &&
106
git remote rm second
107
)
108
'
@@ -111,7 +111,7 @@ test_expect_success C_LOCALE_OUTPUT 'remove remote' '
111
(
112
cd test &&
113
tokens_match origin "$(git remote)" &&
114
- check_remote_track origin master side &&
114
+ check_remote_track origin main side &&
115
git for-each-ref "--format=%(refname)" refs/remotes |
116
sed -e "/^refs\/remotes\/origin\//d" >actual &&
117
test_must_be_empty actual
@@ -124,13 +124,13 @@ test_expect_success 'remove remote protects local branches' '
124
cat >expect1 <<-\EOF &&
125
Note: A branch outside the refs/remotes/ hierarchy was not removed;
126
to delete it, use:
127
- git branch -d master
127
+ git branch -d main
128
EOF
129
cat >expect2 <<-\EOF &&
130
Note: Some branches outside the refs/remotes/ hierarchy were not removed;
131
to delete them, use:
132
git branch -d foobranch
133
- git branch -d master
133
+ git branch -d main
134
EOF
135
git tag footag &&
136
git config --add remote.oops.fetch "+refs/*:refs/*" &&
@@ -156,7 +156,7 @@ test_expect_success 'remove errors out early when deleting non-existent branch'
156
157
test_expect_success 'remove remote with a branch without configured merge' '
158
test_when_finished "(
159
- git -C test checkout master;
159
+ git -C test checkout main;
160
git -C test branch -D two;
161
git -C test config --remove-section remote.two;
162
git -C test config --remove-section branch.second;
@@ -166,9 +166,9 @@ test_expect_success 'remove remote with a branch without configured merge' '
166
cd test &&
167
git remote add two ../two &&
168
git fetch two &&
169
- git checkout -b second two/master^0 &&
169
+ git checkout -b second two/main^0 &&
170
git config branch.second.remote two &&
171
- git checkout master &&
171
+ git checkout main &&
172
git remote rm two
173
)
174
'
@@ -214,7 +214,7 @@ cat >test/expect <<EOF
214
* remote origin
215
Fetch URL: $(pwd)/one
216
Push URL: $(pwd)/one
217
- HEAD branch: master
217
+ HEAD branch: main
218
Remote branches:
219
main new (next fetch will store in remotes/origin)
220
side tracked
@@ -224,14 +224,14 @@ cat >test/expect <<EOF
224
octopus merges with remote topic-a
225
and with remote topic-b
226
and with remote topic-c
227
- rebase rebases onto remote master
227
+ rebase rebases onto remote main
228
Local refs configured for 'git push':
229
main pushes to main (local out of date)
230
main pushes to upstream (create)
231
* remote two
232
Fetch URL: ../two
233
Push URL: ../three
234
- HEAD branch: master
234
+ HEAD branch: main
235
Local refs configured for 'git push':
236
ahead forces to main (fast-forwardable)
237
main pushes to another (up to date)
@@ -240,16 +240,16 @@ EOF
240
test_expect_success PREPARE_FOR_MAIN_BRANCH 'show' '
241
(
242
cd test &&
243
- git config --add remote.origin.fetch refs/heads/master:refs/heads/upstream &&
243
+ git config --add remote.origin.fetch refs/heads/main:refs/heads/upstream &&
244
git fetch &&
245
- git checkout -b ahead origin/master &&
245
+ git checkout -b ahead origin/main &&
246
echo 1 >>file &&
247
test_tick &&
248
git commit -m update file &&
249
- git checkout master &&
250
- git branch --track octopus origin/master &&
251
- git branch --track rebase origin/master &&
252
- git branch -d -r origin/master &&
249
+ git checkout main &&
250
+ git branch --track octopus origin/main &&
251
+ git branch --track rebase origin/main &&
252
+ git branch -d -r origin/main &&
253
git config --add remote.two.url ../two &&
254
git config --add remote.two.pushurl ../three &&
255
git config branch.rebase.rebase true &&
@@ -261,10 +261,10 @@ test_expect_success PREPARE_FOR_MAIN_BRANCH 'show' '
261
git commit -m update file
262
) &&
263
git config --add remote.origin.push : &&
264
- git config --add remote.origin.push refs/heads/master:refs/heads/upstream &&
264
+ git config --add remote.origin.push refs/heads/main:refs/heads/upstream &&
265
git config --add remote.origin.push +refs/tags/lastbackup &&
266
- git config --add remote.two.push +refs/heads/ahead:refs/heads/master &&
267
- git config --add remote.two.push refs/heads/master:refs/heads/another &&
266
+ git config --add remote.two.push +refs/heads/ahead:refs/heads/main &&
267
+ git config --add remote.two.push refs/heads/main:refs/heads/another &&
268
git remote show origin two >output &&
269
git branch -d rebase octopus &&
270
test_i18ncmp expect output
@@ -277,7 +277,7 @@ cat >test/expect <<EOF
277
Push URL: $(pwd)/one
278
HEAD branch: (not queried)
279
Remote branches: (status not queried)
280
- master
280
+ main
281
side
282
Local branches configured for 'git pull':
283
ahead merges with remote main
@@ -325,7 +325,7 @@ test_expect_success 'set-head --auto' '
325
(
326
cd test &&
327
git remote set-head --auto origin &&
328
- echo refs/remotes/origin/master >expect &&
328
+ echo refs/remotes/origin/main >expect &&
329
git symbolic-ref refs/remotes/origin/HEAD >output &&
330
test_cmp expect output
331
)
@@ -336,7 +336,7 @@ test_expect_success PREPARE_FOR_MAIN_BRANCH 'set-head --auto has no problem w/mu
336
cd test &&
337
git fetch two "refs/heads/*:refs/remotes/two/*" &&
338
git remote set-head --auto two >output 2>&1 &&
339
- echo "two/HEAD set to master" >expect &&
339
+ echo "two/HEAD set to main" >expect &&
340
test_i18ncmp expect output
341
)
342
'
@@ -350,7 +350,7 @@ test_expect_success 'set-head explicit' '
350
cd test &&
351
git remote set-head origin side2 &&
352
git symbolic-ref refs/remotes/origin/HEAD >output &&
353
- git remote set-head origin master &&
353
+ git remote set-head origin main &&
354
test_cmp expect output
355
)
356
'
@@ -413,7 +413,7 @@ test_expect_success 'fetch mirrors act as mirrors during fetch' '
413
(
414
cd mirror-fetch/parent &&
415
git branch new &&
416
- git branch -m master renamed
416
+ git branch -m main renamed
417
) &&
418
(
419
cd mirror-fetch/child &&
@@ -427,7 +427,7 @@ test_expect_success 'fetch mirrors can prune' '
427
(
428
cd mirror-fetch/child &&
429
git remote prune parent &&
430
- test_must_fail git rev-parse --verify refs/heads/master
430
+ test_must_fail git rev-parse --verify refs/heads/main
431
)
432
'
433
@@ -480,14 +480,14 @@ test_expect_success 'push mirrors act as mirrors during push' '
480
(
481
cd mirror-push/private &&
482
git branch new &&
483
- git branch -m master renamed &&
483
+ git branch -m main renamed &&
484
git push public
485
) &&
486
(
487
cd mirror-push/private &&
488
git rev-parse --verify refs/heads/new &&
489
git rev-parse --verify refs/heads/renamed &&
490
- test_must_fail git rev-parse --verify refs/heads/master
490
+ test_must_fail git rev-parse --verify refs/heads/main
491
)
492
'
493
@@ -613,10 +613,10 @@ test_expect_success 'reject --no-no-tags' '
613
'
614
615
cat >one/expect <<\EOF
616
- apis/master
616
+ apis/main
617
apis/side
618
drosophila/another
619
- drosophila/master
619
+ drosophila/main
620
drosophila/side
621
EOF
622
@@ -633,11 +633,11 @@ test_expect_success 'update' '
633
634
cat >one/expect <<\EOF
635
drosophila/another
636
- drosophila/master
636
+ drosophila/main
637
drosophila/side
638
- manduca/master
638
+ manduca/main
639
manduca/side
640
- megaloprepus/master
640
+ megaloprepus/main
641
megaloprepus/side
642
EOF
643
@@ -676,11 +676,11 @@ test_expect_success 'update --prune' '
676
'
677
678
cat >one/expect <<-\EOF
679
- apis/master
679
+ apis/main
680
apis/side
681
- manduca/master
681
+ manduca/main
682
manduca/side
683
- megaloprepus/master
683
+ megaloprepus/main
684
megaloprepus/side
685
EOF
686
@@ -700,7 +700,7 @@ test_expect_success 'update default' '
700
701
cat >one/expect <<\EOF
702
drosophila/another
703
- drosophila/master
703
+ drosophila/main
704
drosophila/side
705
EOF
706
@@ -754,14 +754,14 @@ test_expect_success 'rename a remote' '
754
git clone one four &&
755
(
756
cd four &&
757
- git config branch.master.pushRemote origin &&
757
+ git config branch.main.pushRemote origin &&
758
git remote rename origin upstream &&
759
test -z "$(git for-each-ref refs/remotes/origin)" &&
760
- test "$(git symbolic-ref refs/remotes/upstream/HEAD)" = "refs/remotes/upstream/master" &&
761
- test "$(git rev-parse upstream/master)" = "$(git rev-parse master)" &&
760
+ test "$(git symbolic-ref refs/remotes/upstream/HEAD)" = "refs/remotes/upstream/main" &&
761
+ test "$(git rev-parse upstream/main)" = "$(git rev-parse main)" &&
762
test "$(git config remote.upstream.fetch)" = "+refs/heads/*:refs/remotes/upstream/*" &&
763
- test "$(git config branch.master.remote)" = "upstream" &&
764
- test "$(git config branch.master.pushRemote)" = "upstream" &&
763
+ test "$(git config branch.main.remote)" = "upstream" &&
764
+ test "$(git config branch.main.pushRemote)" = "upstream" &&
765
test "$(git config --global remote.pushDefault)" = "origin"
766
)
767
'
@@ -807,7 +807,7 @@ test_expect_success 'rename does not update a non-default fetch refspec' '
807
git config remote.origin.fetch +refs/heads/*:refs/heads/origin/* &&
808
git remote rename origin upstream &&
809
test "$(git config remote.upstream.fetch)" = "+refs/heads/*:refs/heads/origin/*" &&
810
- git rev-parse -q origin/master
810
+ git rev-parse -q origin/main
811
)
812
'
813
@@ -827,7 +827,7 @@ test_expect_success 'rename a remote with name prefix of other remote' '
827
cd four.three &&
828
git remote add o git://example.com/repo.git &&
829
git remote rename o upstream &&
830
- test "$(git rev-parse origin/master)" = "$(git rev-parse master)"
830
+ test "$(git rev-parse origin/main)" = "$(git rev-parse main)"
831
)
832
'
833
@@ -843,11 +843,11 @@ test_expect_success 'remove a remote' '
843
git clone one four.five &&
844
(
845
cd four.five &&
846
- git config branch.master.pushRemote origin &&
846
+ git config branch.main.pushRemote origin &&
847
git remote remove origin &&
848
test -z "$(git for-each-ref refs/remotes/origin)" &&
849
- test_must_fail git config branch.master.remote &&
850
- test_must_fail git config branch.master.pushRemote &&
849
+ test_must_fail git config branch.main.remote &&
850
+ test_must_fail git config branch.main.pushRemote &&
851
test "$(git config --global remote.pushDefault)" = "origin"
852
)
853
'
@@ -888,9 +888,9 @@ test_expect_success 'remove a remote removes repo remote.pushDefault but keeps g
888
889
cat >remotes_origin <<EOF
890
URL: $(pwd)/one
891
-Push: refs/heads/master:refs/heads/upstream
891
+Push: refs/heads/main:refs/heads/upstream
892
Push: refs/heads/next:refs/heads/upstream2
893
-Pull: refs/heads/master:refs/heads/origin
893
+Pull: refs/heads/main:refs/heads/origin
894
Pull: refs/heads/next:refs/heads/origin2
895
EOF
896
@@ -906,11 +906,11 @@ test_expect_success 'migrate a remote from named file in $GIT_DIR/remotes' '
906
test_path_is_missing .git/remotes/origin &&
907
test "$(git config remote.origin.url)" = "$origin_url" &&
908
cat >push_expected <<-\EOF &&
909
- refs/heads/master:refs/heads/upstream
909
+ refs/heads/main:refs/heads/upstream
910
refs/heads/next:refs/heads/upstream2
911
EOF
912
cat >fetch_expected <<-\EOF &&
913
- refs/heads/master:refs/heads/origin
913
+ refs/heads/main:refs/heads/origin
914
refs/heads/next:refs/heads/origin2
915
EOF
916
git config --get-all remote.origin.push >push_actual &&
@@ -930,8 +930,8 @@ test_expect_success 'migrate a remote from named file in $GIT_DIR/branches' '
930
git remote rename origin origin &&
931
test_path_is_missing .git/branches/origin &&
932
test "$(git config remote.origin.url)" = "$origin_url" &&
933
- test "$(git config remote.origin.fetch)" = "refs/heads/master:refs/heads/origin" &&
934
- test "$(git config remote.origin.push)" = "HEAD:refs/heads/master"
933
+ test "$(git config remote.origin.fetch)" = "refs/heads/main:refs/heads/origin" &&
934
+ test "$(git config remote.origin.push)" = "HEAD:refs/heads/main"
935
)
936
'
937
@@ -954,7 +954,7 @@ test_expect_success 'remote prune to cause a dangling symref' '
954
(
955
cd one &&
956
git checkout side2 &&
957
- git branch -D master
957
+ git branch -D main
958
) &&
959
(
960
cd eight &&
@@ -997,22 +997,22 @@ test_expect_success 'remote set-branches' '
997
EOF
998
sort <<-\EOF >expect.replace &&
999
+refs/heads/maint:refs/remotes/scratch/maint
1000
- +refs/heads/master:refs/remotes/scratch/master
1000
+ +refs/heads/main:refs/remotes/scratch/main
1001
+refs/heads/next:refs/remotes/scratch/next
1002
EOF
1003
sort <<-\EOF >expect.add-two &&
1004
+refs/heads/maint:refs/remotes/scratch/maint
1005
- +refs/heads/master:refs/remotes/scratch/master
1005
+ +refs/heads/main:refs/remotes/scratch/main
1006
+refs/heads/next:refs/remotes/scratch/next
1007
+refs/heads/seen:refs/remotes/scratch/seen
1008
+refs/heads/t/topic:refs/remotes/scratch/t/topic
1009
EOF
1010
sort <<-\EOF >expect.setup-ffonly &&
1011
- refs/heads/master:refs/remotes/scratch/master
1011
+ refs/heads/main:refs/remotes/scratch/main
1012
+refs/heads/next:refs/remotes/scratch/next
1013
EOF
1014
sort <<-\EOF >expect.respect-ffonly &&
1015
- refs/heads/master:refs/remotes/scratch/master
1015
+ refs/heads/main:refs/remotes/scratch/main
1016
+refs/heads/next:refs/remotes/scratch/next
1017
+refs/heads/seen:refs/remotes/scratch/seen
1018
EOF
@@ -1028,7 +1028,7 @@ test_expect_success 'remote set-branches' '
1028
git config --get-all remote.scratch.fetch >config-result &&
1029
sort <config-result >../actual.add &&
1030
1031
- git remote set-branches scratch maint master next &&
1031
+ git remote set-branches scratch maint main next &&
1032
git config --get-all remote.scratch.fetch >config-result &&
1033
sort <config-result >../actual.replace &&
1034
@@ -1038,7 +1038,7 @@ test_expect_success 'remote set-branches' '
1038
1039
git config --unset-all remote.scratch.fetch &&
1040
git config remote.scratch.fetch \
1041
- refs/heads/master:refs/remotes/scratch/master &&
1041
+ refs/heads/main:refs/remotes/scratch/main &&
1042
git config --add remote.scratch.fetch \
1043
+refs/heads/next:refs/remotes/scratch/next &&
1044
git config --get-all remote.scratch.fetch >config-result &&
@@ -1058,14 +1058,14 @@ test_expect_success 'remote set-branches' '
1058
1059
test_expect_success 'remote set-branches with --mirror' '
1060
echo "+refs/*:refs/*" >expect.initial &&
1061
- echo "+refs/heads/master:refs/heads/master" >expect.replace &&
1061
+ echo "+refs/heads/main:refs/heads/main" >expect.replace &&
1062
git clone --mirror .git/ setbranches-mirror &&
1063
(
1064
cd setbranches-mirror &&
1065
git remote rename origin scratch &&
1066
git config --get-all remote.scratch.fetch >../actual.initial &&
1067
1068
- git remote set-branches scratch heads/master &&
1068
+ git remote set-branches scratch heads/main &&
1069
git config --get-all remote.scratch.fetch >../actual.replace
1070
) &&
1071
test_cmp expect.initial actual.initial &&
@@ -1311,7 +1311,7 @@ test_extra_arg () {
1311
test_extra_arg add nick url
1312
test_extra_arg rename origin newname
1313
test_extra_arg remove origin
1314
-test_extra_arg set-head origin master
1314
+test_extra_arg set-head origin main
1315
# set-branches takes any number of args
1316
test_extra_arg get-url origin newurl
1317
test_extra_arg set-url origin newurl oldurl
@@ -1328,7 +1328,7 @@ test_expect_success 'unqualified <dst> refspec DWIM and advice' '
1328
test_when_finished "(cd test && git tag -d some-tag)" &&
1329
(
1330
cd test &&
1331
- git tag -a -m "Some tag" some-tag master &&
1331
+ git tag -a -m "Some tag" some-tag main &&
1332
exit_with=true &&
1333
for type in commit tag tree blob
1334
do
@@ -1354,7 +1354,7 @@ test_expect_success 'unqualified <dst> refspec DWIM and advice' '
1354
test_expect_success PREPARE_FOR_MAIN_BRANCH 'refs/remotes/* <src> refspec and unqualified <dst> DWIM and advice' '
1355
(
1356
cd two &&
1357
- git tag -a -m "Some tag" my-tag master &&
1357
+ git tag -a -m "Some tag" my-tag main &&
1358
git update-ref refs/trees/my-head-tree HEAD^{tree} &&
1359
git update-ref refs/blobs/my-file-blob HEAD:file
1360
) &&
t/t5506-remote-groups.sh
+3
-3
@@ -1,7 +1,7 @@
1
#!/bin/sh
2
3
test_description='git remote group handling'
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
. ./test-lib.sh
@@ -34,8 +34,8 @@ repo_fetched() {
34
test_expect_success 'setup' '
35
mkdir one && (cd one && git init) &&
36
mkdir two && (cd two && git init) &&
37
- git remote add -m master one one &&
38
- git remote add -m master two two
37
+ git remote add -m main one one &&
38
+ git remote add -m main two two
39
'
40
41
test_expect_success 'no group updates all' '
t/t5509-fetch-push-namespaces.sh
+16
-16
@@ -1,7 +1,7 @@
1
#!/bin/sh
2
3
test_description='fetch/push involving ref namespaces'
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
. ./test-lib.sh
@@ -30,9 +30,9 @@ test_expect_success setup '
30
test_expect_success 'pushing into a repository using a ref namespace' '
31
(
32
cd original &&
33
- git push pushee-namespaced master &&
33
+ git push pushee-namespaced main &&
34
git ls-remote pushee-namespaced >actual &&
35
- printf "$commit1\trefs/heads/master\n" >expected &&
35
+ printf "$commit1\trefs/heads/main\n" >expected &&
36
test_cmp expected actual &&
37
git push pushee-namespaced --tags &&
38
git ls-remote pushee-namespaced >actual &&
@@ -59,7 +59,7 @@ test_expect_success 'pulling from a repository using a ref namespace' '
59
cd puller &&
60
git remote add -f pushee-namespaced "ext::git --namespace=namespace %s ../pushee" &&
61
git for-each-ref refs/ >actual &&
62
- printf "$commit1 commit\trefs/remotes/pushee-namespaced/master\n" >expected &&
62
+ printf "$commit1 commit\trefs/remotes/pushee-namespaced/main\n" >expected &&
63
printf "$commit0 commit\trefs/tags/0\n" >>expected &&
64
printf "$commit1 commit\trefs/tags/1\n" >>expected &&
65
test_cmp expected actual
@@ -79,7 +79,7 @@ test_expect_success 'mirroring a repository using a ref namespace' '
79
(
80
cd mirror &&
81
git for-each-ref refs/ >actual &&
82
- printf "$commit1 commit\trefs/namespaces/namespace/refs/heads/master\n" >expected &&
82
+ printf "$commit1 commit\trefs/namespaces/namespace/refs/heads/main\n" >expected &&
83
printf "$commit0 commit\trefs/namespaces/namespace/refs/tags/0\n" >>expected &&
84
printf "$commit1 commit\trefs/namespaces/namespace/refs/tags/1\n" >>expected &&
85
test_cmp expected actual
@@ -90,7 +90,7 @@ test_expect_success 'hide namespaced refs with transfer.hideRefs' '
90
GIT_NAMESPACE=namespace \
91
git -C pushee -c transfer.hideRefs=refs/tags \
92
ls-remote "ext::git %s ." >actual &&
93
- printf "$commit1\trefs/heads/master\n" >expected &&
93
+ printf "$commit1\trefs/heads/main\n" >expected &&
94
test_cmp expected actual
95
'
96
@@ -98,7 +98,7 @@ test_expect_success 'check that transfer.hideRefs does not match unstripped refs
98
GIT_NAMESPACE=namespace \
99
git -C pushee -c transfer.hideRefs=refs/namespaces/namespace/refs/tags \
100
ls-remote "ext::git %s ." >actual &&
101
- printf "$commit1\trefs/heads/master\n" >expected &&
101
+ printf "$commit1\trefs/heads/main\n" >expected &&
102
printf "$commit0\trefs/tags/0\n" >>expected &&
103
printf "$commit1\trefs/tags/1\n" >>expected &&
104
test_cmp expected actual
@@ -108,23 +108,23 @@ test_expect_success 'hide full refs with transfer.hideRefs' '
108
GIT_NAMESPACE=namespace \
109
git -C pushee -c transfer.hideRefs="^refs/namespaces/namespace/refs/tags" \
110
ls-remote "ext::git %s ." >actual &&
111
- printf "$commit1\trefs/heads/master\n" >expected &&
111
+ printf "$commit1\trefs/heads/main\n" >expected &&
112
test_cmp expected actual
113
'
114
115
test_expect_success 'try to update a hidden ref' '
116
- test_config -C pushee transfer.hideRefs refs/heads/master &&
117
- test_must_fail git -C original push pushee-namespaced master
116
+ test_config -C pushee transfer.hideRefs refs/heads/main &&
117
+ test_must_fail git -C original push pushee-namespaced main
118
'
119
120
test_expect_success 'try to update a ref that is not hidden' '
121
- test_config -C pushee transfer.hideRefs refs/namespaces/namespace/refs/heads/master &&
122
- git -C original push pushee-namespaced master
121
+ test_config -C pushee transfer.hideRefs refs/namespaces/namespace/refs/heads/main &&
122
+ git -C original push pushee-namespaced main
123
'
124
125
test_expect_success 'try to update a hidden full ref' '
126
- test_config -C pushee transfer.hideRefs "^refs/namespaces/namespace/refs/heads/master" &&
127
- test_must_fail git -C original push pushee-namespaced master
126
+ test_config -C pushee transfer.hideRefs "^refs/namespaces/namespace/refs/heads/main" &&
127
+ test_must_fail git -C original push pushee-namespaced main
128
'
129
130
test_expect_success 'set up ambiguous HEAD' '
@@ -160,9 +160,9 @@ test_expect_success 'denyCurrentBranch and unborn branch with ref namespace' '
160
cd original &&
161
git init unborn &&
162
git remote add unborn-namespaced "ext::git --namespace=namespace %s unborn" &&
163
- test_must_fail git push unborn-namespaced HEAD:master &&
163
+ test_must_fail git push unborn-namespaced HEAD:main &&
164
git -C unborn config receive.denyCurrentBranch updateInstead &&
165
- git push unborn-namespaced HEAD:master
165
+ git push unborn-namespaced HEAD:main
166
)
167
'
168