t5[6-9]*: 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' -- t5[6-9]*.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
95cf2c01875fd66421d3551e9e86db435523575d
18 files changed
+186
-186
t/t5601-clone.sh
+3
-3
@@ -2,7 +2,7 @@
2
3
test_description=clone
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
@@ -220,7 +220,7 @@ test_expect_success 'clone respects global branch.autosetuprebase' '
220
rm -fr dst &&
221
git clone src dst &&
222
cd dst &&
223
- actual="z$(git config branch.master.rebase)" &&
223
+ actual="z$(git config branch.main.rebase)" &&
224
test ztrue = $actual
225
)
226
'
@@ -594,7 +594,7 @@ test_expect_success 'clone from a repository with two identical branches' '
594
595
(
596
cd src &&
597
- git checkout -b another master
597
+ git checkout -b another main
598
) &&
599
git clone src target-11 &&
600
test "z$( cd target-11 && git symbolic-ref HEAD )" = zrefs/heads/another
t/t5604-clone-reference.sh
+7
-7
@@ -4,7 +4,7 @@
4
#
5
6
test_description='test clone --reference'
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
. ./test-lib.sh
@@ -52,7 +52,7 @@ test_expect_success 'existence of info/alternates' '
52
'
53
54
test_expect_success 'pulling from reference' '
55
- git -C C pull ../B master
55
+ git -C C pull ../B main
56
'
57
58
test_expect_success 'that reference gets used' '
@@ -73,7 +73,7 @@ test_expect_success 'existence of info/alternates' '
73
'
74
75
test_expect_success 'pulling from reference' '
76
- git -C D pull ../B master
76
+ git -C D pull ../B main
77
'
78
79
test_expect_success 'that reference gets used' '
@@ -139,11 +139,11 @@ test_expect_success 'prepare branched repository' '
139
git clone A J &&
140
(
141
cd J &&
142
- git checkout -b other master^ &&
142
+ git checkout -b other main^ &&
143
echo other >otherfile &&
144
git add otherfile &&
145
git commit -m other &&
146
- git checkout master
146
+ git checkout main
147
)
148
'
149
@@ -155,9 +155,9 @@ test_expect_success 'fetch with incomplete alternates' '
155
git remote add J "file://$base_dir/J" &&
156
GIT_TRACE_PACKET=$U.K git fetch J
157
) &&
158
- master_object=$(cd A && git for-each-ref --format="%(objectname)" refs/heads/master) &&
158
+ main_object=$(cd A && git for-each-ref --format="%(objectname)" refs/heads/main) &&
159
test -s "$U.K" &&
160
- ! grep " want $master_object" "$U.K" &&
160
+ ! grep " want $main_object" "$U.K" &&
161
tag_object=$(cd A && git for-each-ref --format="%(objectname)" refs/tags/HEAD) &&
162
! grep " want $tag_object" "$U.K"
163
'
t/t5605-clone-local.sh
+6
-6
@@ -1,7 +1,7 @@
1
#!/bin/sh
2
3
test_description='test local clone'
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
@@ -18,7 +18,7 @@ test_expect_success 'preparing origin repository' '
18
test "$(cd a.git && git config --bool core.bare)" = true &&
19
test "$(cd x && git config --bool core.bare)" = true &&
20
git bundle create b1.bundle --all &&
21
- git bundle create b2.bundle master &&
21
+ git bundle create b2.bundle main &&
22
mkdir dir &&
23
cp b1.bundle dir/b3 &&
24
cp b1.bundle b4
@@ -87,7 +87,7 @@ test_expect_success 'bundle clone with nonexistent HEAD' '
87
git clone b2.bundle b2 &&
88
(cd b2 &&
89
git fetch &&
90
- test_must_fail git rev-parse --verify refs/heads/master)
90
+ test_must_fail git rev-parse --verify refs/heads/main)
91
'
92
93
test_expect_success 'clone empty repository' '
@@ -101,9 +101,9 @@ test_expect_success 'clone empty repository' '
101
echo "content" >> foo &&
102
git add foo &&
103
git commit -m "Initial commit" &&
104
- git push origin master &&
105
- expected=$(git rev-parse master) &&
106
- actual=$(git --git-dir=../empty/.git rev-parse master) &&
104
+ git push origin main &&
105
+ expected=$(git rev-parse main) &&
106
+ actual=$(git --git-dir=../empty/.git rev-parse main) &&
107
test $actual = $expected)
108
'
109
t/t5606-clone-options.sh
+5
-5
@@ -1,7 +1,7 @@
1
#!/bin/sh
2
3
test_description='basic clone options'
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
@@ -18,7 +18,7 @@ test_expect_success 'setup' '
18
test_expect_success 'clone -o' '
19
20
git clone -o foo parent clone-o &&
21
- git -C clone-o rev-parse --verify refs/remotes/foo/master
21
+ git -C clone-o rev-parse --verify refs/remotes/foo/main
22
23
'
24
@@ -48,7 +48,7 @@ test_expect_success 'disallows --bare with --separate-git-dir' '
48
test_expect_success 'uses "origin" for default remote name' '
49
50
git clone parent clone-default-origin &&
51
- git -C clone-default-origin rev-parse --verify refs/remotes/origin/master
51
+ git -C clone-default-origin rev-parse --verify refs/remotes/origin/main
52
53
'
54
@@ -77,14 +77,14 @@ test_expect_success 'prefers config "clone.defaultRemoteName" over default' '
77
78
test_config_global clone.defaultRemoteName from_config &&
79
git clone parent clone-config-origin &&
80
- git -C clone-config-origin rev-parse --verify refs/remotes/from_config/master
80
+ git -C clone-config-origin rev-parse --verify refs/remotes/from_config/main
81
82
'
83
84
test_expect_success 'prefers --origin over -c config' '
85
86
git clone -c clone.defaultRemoteName=inline --origin from_option parent clone-o-and-inline-config &&
87
- git -C clone-o-and-inline-config rev-parse --verify refs/remotes/from_option/master
87
+ git -C clone-o-and-inline-config rev-parse --verify refs/remotes/from_option/main
88
89
'
90
t/t5607-clone-bundle.sh
+8
-8
@@ -1,7 +1,7 @@
1
#!/bin/sh
2
3
test_description='some bundle related 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
. ./test-lib.sh
@@ -22,7 +22,7 @@ test_expect_success 'setup' '
22
'
23
24
test_expect_success '"verify" needs a worktree' '
25
- git bundle create tip.bundle -1 master &&
25
+ git bundle create tip.bundle -1 main &&
26
nongit test_must_fail git bundle verify ../tip.bundle 2>err &&
27
test_i18ngrep "need a repository" err
28
'
@@ -42,15 +42,15 @@ test_expect_success 'die if bundle file cannot be created' '
42
'
43
44
test_expect_failure 'bundle --stdin' '
45
- echo master | git bundle create stdin-bundle.bdl --stdin &&
45
+ echo main | git bundle create stdin-bundle.bdl --stdin &&
46
git ls-remote stdin-bundle.bdl >output &&
47
- grep master output
47
+ grep main output
48
'
49
50
test_expect_failure 'bundle --stdin <rev-list options>' '
51
- echo master | git bundle create hybrid-bundle.bdl --stdin tag &&
51
+ echo main | git bundle create hybrid-bundle.bdl --stdin tag &&
52
git ls-remote hybrid-bundle.bdl >output &&
53
- grep master output
53
+ grep main output
54
'
55
56
test_expect_success 'empty bundle file is rejected' '
@@ -86,14 +86,14 @@ test_expect_success 'prerequisites with an empty commit message' '
86
87
test_expect_success 'failed bundle creation does not leave cruft' '
88
# This fails because the bundle would be empty.
89
- test_must_fail git bundle create fail.bundle master..master &&
89
+ test_must_fail git bundle create fail.bundle main..main &&
90
test_path_is_missing fail.bundle.lock
91
'
92
93
test_expect_success 'fetch SHA-1 from bundle' '
94
test_create_repo foo &&
95
test_commit -C foo x &&
96
- git -C foo bundle create tip.bundle -1 master &&
96
+ git -C foo bundle create tip.bundle -1 main &&
97
git -C foo rev-parse HEAD >hash &&
98
99
# Exercise to ensure that fetching a SHA-1 from a bundle works with no
t/t5608-clone-2gb.sh
+1
-1
@@ -26,7 +26,7 @@ test_expect_success 'setup' '
26
i=$(($i+1)) ||
27
echo $? > exit-status
28
done &&
29
- echo "commit refs/heads/master" &&
29
+ echo "commit refs/heads/main" &&
30
echo "author A U Thor <author@email.com> 123456789 +0000" &&
31
echo "committer C O Mitter <committer@email.com> 123456789 +0000" &&
32
echo "data 5" &&
t/t5609-clone-branch.sh
+4
-4
@@ -1,7 +1,7 @@
1
#!/bin/sh
2
3
test_description='clone --branch option'
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
@@ -23,7 +23,7 @@ test_expect_success 'setup' '
23
echo one >file && git add file && git commit -m one &&
24
git checkout -b two &&
25
echo two >file && git add file && git commit -m two &&
26
- git checkout master) &&
26
+ git checkout main) &&
27
mkdir empty &&
28
(cd empty && git init)
29
'
@@ -31,7 +31,7 @@ test_expect_success 'setup' '
31
test_expect_success 'vanilla clone chooses HEAD' '
32
git clone parent clone &&
33
(cd clone &&
34
- check_HEAD master &&
34
+ check_HEAD main &&
35
check_file one
36
)
37
'
@@ -56,7 +56,7 @@ test_expect_success 'clone -b sets up tracking' '
56
57
test_expect_success 'clone -b does not munge remotes/origin/HEAD' '
58
(cd clone-two &&
59
- echo refs/remotes/origin/master >expect &&
59
+ echo refs/remotes/origin/main >expect &&
60
git symbolic-ref refs/remotes/origin/HEAD >actual &&
61
test_cmp expect actual
62
)
t/t5610-clone-detached.sh
+3
-3
@@ -1,7 +1,7 @@
1
#!/bin/sh
2
3
test_description='test cloning a repository with detached HEAD'
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
@@ -23,7 +23,7 @@ test_expect_success 'setup' '
23
'
24
25
test_expect_success 'clone repo (detached HEAD points to branch)' '
26
- git checkout master^0 &&
26
+ git checkout main^0 &&
27
git clone "file://$PWD" detached-branch
28
'
29
test_expect_success 'cloned HEAD matches' '
@@ -62,7 +62,7 @@ test_expect_success 'cloned HEAD is detached' '
62
'
63
64
test_expect_success 'clone repo (orphan detached HEAD)' '
65
- git checkout master^0 &&
65
+ git checkout main^0 &&
66
echo four >file &&
67
git commit -a -m four &&
68
git clone "file://$PWD" detached-orphan
t/t5611-clone-config.sh
+9
-9
@@ -1,7 +1,7 @@
1
#!/bin/sh
2
3
test_description='tests for git clone -c key=value'
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
@@ -50,16 +50,16 @@ test_expect_success 'clone -c config is available during clone' '
50
51
test_expect_success 'clone -c remote.origin.fetch=<refspec> works' '
52
rm -rf child &&
53
- git update-ref refs/grab/it refs/heads/master &&
54
- git update-ref refs/leave/out refs/heads/master &&
53
+ git update-ref refs/grab/it refs/heads/main &&
54
+ git update-ref refs/leave/out refs/heads/main &&
55
git clone -c "remote.origin.fetch=+refs/grab/*:refs/grab/*" . child &&
56
git -C child for-each-ref --format="%(refname)" >actual &&
57
58
cat >expect <<-\EOF &&
59
refs/grab/it
60
- refs/heads/master
60
+ refs/heads/main
61
refs/remotes/origin/HEAD
62
- refs/remotes/origin/master
62
+ refs/remotes/origin/main
63
EOF
64
test_cmp expect actual
65
'
@@ -71,9 +71,9 @@ test_expect_success 'git -c remote.origin.fetch=<refspec> clone works' '
71
72
cat >expect <<-\EOF &&
73
refs/grab/it
74
- refs/heads/master
74
+ refs/heads/main
75
refs/remotes/origin/HEAD
76
- refs/remotes/origin/master
76
+ refs/remotes/origin/main
77
EOF
78
test_cmp expect actual
79
'
@@ -88,9 +88,9 @@ test_expect_success 'clone -c remote.<remote>.fetch=<refspec> --origin=<name>' '
88
89
cat >expect <<-\EOF &&
90
refs/grab/it
91
- refs/heads/master
91
+ refs/heads/main
92
refs/remotes/upstream/HEAD
93
- refs/remotes/upstream/master
93
+ refs/remotes/upstream/main
94
EOF
95
test_cmp expect actual
96
'
t/t5612-clone-refspec.sh
+22
-22
@@ -1,13 +1,13 @@
1
#!/bin/sh
2
3
test_description='test refspec written by clone-command'
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
8
9
test_expect_success 'setup' '
10
- # Make two branches, "master" and "side"
10
+ # Make two branches, "main" and "side"
11
echo one >file &&
12
git add file &&
13
git commit -m one &&
@@ -19,7 +19,7 @@ test_expect_success 'setup' '
19
git checkout -b side &&
20
echo four >file &&
21
git commit -a -m four &&
22
- git checkout master &&
22
+ git checkout main &&
23
git tag five &&
24
25
# default clone
@@ -28,18 +28,18 @@ test_expect_success 'setup' '
28
# default clone --no-tags
29
git clone --no-tags . dir_all_no_tags &&
30
31
- # default --single that follows HEAD=master
32
- git clone --single-branch . dir_master &&
31
+ # default --single that follows HEAD=main
32
+ git clone --single-branch . dir_main &&
33
34
- # default --single that follows HEAD=master with no tags
35
- git clone --single-branch --no-tags . dir_master_no_tags &&
34
+ # default --single that follows HEAD=main with no tags
35
+ git clone --single-branch --no-tags . dir_main_no_tags &&
36
37
# default --single that follows HEAD=side
38
git checkout side &&
39
git clone --single-branch . dir_side &&
40
41
# explicit --single that follows side
42
- git checkout master &&
42
+ git checkout main &&
43
git clone --single-branch --branch side . dir_side2 &&
44
45
# default --single with --mirror
@@ -58,11 +58,11 @@ test_expect_success 'setup' '
58
# explicit --single with tag and --no-tags
59
git clone --single-branch --no-tags --branch two . dir_tag_no_tags &&
60
61
- # advance both "master" and "side" branches
61
+ # advance both "main" and "side" branches
62
git checkout side &&
63
echo five >file &&
64
git commit -a -m five &&
65
- git checkout master &&
65
+ git checkout main &&
66
echo six >file &&
67
git commit -a -m six &&
68
@@ -78,7 +78,7 @@ test_expect_success 'by default all branches will be kept updated' '
78
sed -e "/HEAD$/d" \
79
-e "s|/remotes/origin/|/heads/|" refs >../actual
80
) &&
81
- # follow both master and side
81
+ # follow both main and side
82
git for-each-ref refs/heads >expect &&
83
test_cmp expect actual
84
'
@@ -103,20 +103,20 @@ test_expect_success 'clone with --no-tags' '
103
test_must_be_empty actual
104
'
105
106
-test_expect_success '--single-branch while HEAD pointing at master' '
106
+test_expect_success '--single-branch while HEAD pointing at main' '
107
(
108
- cd dir_master &&
108
+ cd dir_main &&
109
git fetch --force &&
110
git for-each-ref refs/remotes/origin >refs &&
111
sed -e "/HEAD$/d" \
112
-e "s|/remotes/origin/|/heads/|" refs >../actual
113
) &&
114
- # only follow master
115
- git for-each-ref refs/heads/master >expect &&
114
+ # only follow main
115
+ git for-each-ref refs/heads/main >expect &&
116
# get & check latest tags
117
test_cmp expect actual &&
118
(
119
- cd dir_master &&
119
+ cd dir_main &&
120
git fetch --tags --force &&
121
git for-each-ref refs/tags >../actual
122
) &&
@@ -125,20 +125,20 @@ test_expect_success '--single-branch while HEAD pointing at master' '
125
test_line_count = 2 actual
126
'
127
128
-test_expect_success '--single-branch while HEAD pointing at master and --no-tags' '
128
+test_expect_success '--single-branch while HEAD pointing at main and --no-tags' '
129
(
130
- cd dir_master_no_tags &&
130
+ cd dir_main_no_tags &&
131
git fetch &&
132
git for-each-ref refs/remotes/origin >refs &&
133
sed -e "/HEAD$/d" \
134
-e "s|/remotes/origin/|/heads/|" refs >../actual
135
) &&
136
- # only follow master
137
- git for-each-ref refs/heads/master >expect &&
136
+ # only follow main
137
+ git for-each-ref refs/heads/main >expect &&
138
test_cmp expect actual &&
139
# get tags (noop)
140
(
141
- cd dir_master_no_tags &&
141
+ cd dir_main_no_tags &&
142
git fetch &&
143
git for-each-ref refs/tags >../actual
144
) &&
@@ -146,7 +146,7 @@ test_expect_success '--single-branch while HEAD pointing at master and --no-tags
146
test_line_count = 0 actual &&
147
# get tags with --tags overrides tagOpt
148
(
149
- cd dir_master_no_tags &&
149
+ cd dir_main_no_tags &&
150
git fetch --tags &&
151
git for-each-ref refs/tags >../actual
152
) &&
t/t5614-clone-submodules-shallow.sh
+1
-1
@@ -7,7 +7,7 @@ test_description='Test shallow cloning of repos with submodules'
7
pwd=$(pwd)
8
9
test_expect_success 'setup' '
10
- git checkout -b master &&
10
+ git checkout -b main &&
11
test_commit commit1 &&
12
test_commit commit2 &&
13
mkdir sub &&
t/t5616-partial-clone.sh
+26
-26
@@ -2,7 +2,7 @@
2
3
test_description='git partial clone'
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
@@ -54,14 +54,14 @@ test_expect_success 'verify that .promisor file contains refs fetched' '
54
test_line_count = 1 promisorlist &&
55
git -C srv.bare rev-parse --verify HEAD >headhash &&
56
grep "$(cat headhash) HEAD" $(cat promisorlist) &&
57
- grep "$(cat headhash) refs/heads/master" $(cat promisorlist)
57
+ grep "$(cat headhash) refs/heads/main" $(cat promisorlist)
58
'
59
60
-# checkout master to force dynamic object fetch of blobs at HEAD.
60
+# checkout main to force dynamic object fetch of blobs at HEAD.
61
test_expect_success 'verify checkout with dynamic object fetch' '
62
git -C pc1 rev-list --quiet --objects --missing=print HEAD >observed &&
63
test_line_count = 4 observed &&
64
- git -C pc1 checkout master &&
64
+ git -C pc1 checkout main &&
65
git -C pc1 rev-list --quiet --objects --missing=print HEAD >observed &&
66
test_line_count = 0 observed
67
'
@@ -76,8 +76,8 @@ test_expect_success 'push new commits to server' '
76
git -C src add file.1.txt
77
git -C src commit -m "mod $x"
78
done &&
79
- git -C src blame master -- file.1.txt >expect.blame &&
80
- git -C src push -u srv master
79
+ git -C src blame main -- file.1.txt >expect.blame &&
80
+ git -C src push -u srv main
81
'
82
83
# (partial) fetch in the partial clone repo from the promisor remote.
@@ -86,26 +86,26 @@ test_expect_success 'push new commits to server' '
86
test_expect_success 'partial fetch inherits filter settings' '
87
git -C pc1 fetch origin &&
88
git -C pc1 rev-list --quiet --objects --missing=print \
89
- master..origin/master >observed &&
89
+ main..origin/main >observed &&
90
test_line_count = 5 observed
91
'
92
93
# force dynamic object fetch using diff.
94
-# we should only get 1 new blob (for the file in origin/master).
94
+# we should only get 1 new blob (for the file in origin/main).
95
test_expect_success 'verify diff causes dynamic object fetch' '
96
- git -C pc1 diff master..origin/master -- file.1.txt &&
96
+ git -C pc1 diff main..origin/main -- file.1.txt &&
97
git -C pc1 rev-list --quiet --objects --missing=print \
98
- master..origin/master >observed &&
98
+ main..origin/main >observed &&
99
test_line_count = 4 observed
100
'
101
102
# force full dynamic object fetch of the file's history using blame.
103
# we should get the intermediate blobs for the file.
104
test_expect_success 'verify blame causes dynamic object fetch' '
105
- git -C pc1 blame origin/master -- file.1.txt >observed.blame &&
105
+ git -C pc1 blame origin/main -- file.1.txt >observed.blame &&
106
test_cmp expect.blame observed.blame &&
107
git -C pc1 rev-list --quiet --objects --missing=print \
108
- master..origin/master >observed &&
108
+ main..origin/main >observed &&
109
test_line_count = 0 observed
110
'
111
@@ -118,7 +118,7 @@ test_expect_success 'push new commits to server for file.2.txt' '
118
git -C src add file.2.txt
119
git -C src commit -m "mod $x"
120
done &&
121
- git -C src push -u srv master
121
+ git -C src push -u srv main
122
'
123
124
# Do FULL fetch by disabling inherited filter-spec using --no-filter.
@@ -126,7 +126,7 @@ test_expect_success 'push new commits to server for file.2.txt' '
126
test_expect_success 'override inherited filter-spec using --no-filter' '
127
git -C pc1 fetch --no-filter origin &&
128
git -C pc1 rev-list --quiet --objects --missing=print \
129
- master..origin/master >observed &&
129
+ main..origin/main >observed &&
130
test_line_count = 0 observed
131
'
132
@@ -139,7 +139,7 @@ test_expect_success 'push new commits to server for file.3.txt' '
139
git -C src add file.3.txt
140
git -C src commit -m "mod $x"
141
done &&
142
- git -C src push -u srv master
142
+ git -C src push -u srv main
143
'
144
145
# Do a partial fetch and then try to manually fetch the missing objects.
@@ -149,7 +149,7 @@ test_expect_success 'manual prefetch of missing objects' '
149
git -C pc1 fetch --filter=blob:none origin &&
150
151
git -C pc1 rev-list --quiet --objects --missing=print \
152
- master..origin/master >revs &&
152
+ main..origin/main >revs &&
153
awk -f print_1.awk revs |
154
sed "s/?//" |
155
sort >observed.oids &&
@@ -158,7 +158,7 @@ test_expect_success 'manual prefetch of missing objects' '
158
git -C pc1 fetch-pack --stdin "file://$(pwd)/srv.bare" <observed.oids &&
159
160
git -C pc1 rev-list --quiet --objects --missing=print \
161
- master..origin/master >revs &&
161
+ main..origin/main >revs &&
162
awk -f print_1.awk revs |
163
sed "s/?//" |
164
sort >observed.oids &&
@@ -199,7 +199,7 @@ test_expect_success 'use fsck before and after manually fetching a missing subtr
199
echo "in dir" >src/dir/file.txt &&
200
git -C src add dir/file.txt &&
201
git -C src commit -m "file in dir" &&
202
- git -C src push -u srv master &&
202
+ git -C src push -u srv main &&
203
SUBTREE=$(git -C src rev-parse HEAD:dir) &&
204
205
rm -rf dst &&
@@ -207,7 +207,7 @@ test_expect_success 'use fsck before and after manually fetching a missing subtr
207
git -C dst fsck &&
208
209
# Make sure we only have commits, and all trees and blobs are missing.
210
- git -C dst rev-list --missing=allow-any --objects master \
210
+ git -C dst rev-list --missing=allow-any --objects main \
211
>fetched_objects &&
212
awk -f print_1.awk fetched_objects |
213
xargs -n1 git -C dst cat-file -t >fetched_types &&
@@ -224,7 +224,7 @@ test_expect_success 'use fsck before and after manually fetching a missing subtr
224
git -C dst fsck &&
225
226
# Auto-fetch all remaining trees and blobs with --missing=error
227
- git -C dst rev-list --missing=error --objects master >fetched_objects &&
227
+ git -C dst rev-list --missing=error --objects main >fetched_objects &&
228
test_line_count = 70 fetched_objects &&
229
230
awk -f print_1.awk fetched_objects |
@@ -334,7 +334,7 @@ test_expect_success 'setup src repo for sparse filter' '
334
test_expect_success 'partial clone with sparse filter succeeds' '
335
rm -rf dst.git &&
336
git clone --no-local --bare \
337
- --filter=sparse:oid=master:only-one \
337
+ --filter=sparse:oid=main:only-one \
338
sparse-src dst.git &&
339
(
340
cd dst.git &&
@@ -347,11 +347,11 @@ test_expect_success 'partial clone with sparse filter succeeds' '
347
test_expect_success 'partial clone with unresolvable sparse filter fails cleanly' '
348
rm -rf dst.git &&
349
test_must_fail git clone --no-local --bare \
350
- --filter=sparse:oid=master:no-such-name \
350
+ --filter=sparse:oid=main:no-such-name \
351
sparse-src dst.git 2>err &&
352
- test_i18ngrep "unable to access sparse blob in .master:no-such-name" err &&
352
+ test_i18ngrep "unable to access sparse blob in .main:no-such-name" err &&
353
test_must_fail git clone --no-local --bare \
354
- --filter=sparse:oid=master \
354
+ --filter=sparse:oid=main \
355
sparse-src dst.git 2>err &&
356
test_i18ngrep "unable to parse sparse filter data in" err
357
'
@@ -406,7 +406,7 @@ test_expect_success 'fetch lazy-fetches only to resolve deltas' '
406
# promisor remote other than for the big tree (because it needs to
407
# resolve the delta).
408
GIT_TRACE_PACKET="$(pwd)/trace" git -C client \
409
- fetch "file://$(pwd)/server" master &&
409
+ fetch "file://$(pwd)/server" main &&
410
411
# Verify the assumption that the client needed to fetch the delta base
412
# to resolve the delta.
@@ -425,7 +425,7 @@ test_expect_success 'fetch lazy-fetches only to resolve deltas, protocol v2' '
425
# promisor remote other than for the big blob (because it needs to
426
# resolve the delta).
427
GIT_TRACE_PACKET="$(pwd)/trace" git -C client \
428
- fetch "file://$(pwd)/server" master &&
428
+ fetch "file://$(pwd)/server" main &&
429
430
# Verify that protocol version 2 was used.
431
grep "fetch< version 2" trace &&
t/t5617-clone-submodules-remote.sh
+4
-4
@@ -2,7 +2,7 @@
2
3
test_description='Test cloning repos with submodules using remote-tracking branches'
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
@@ -10,7 +10,7 @@ export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
10
pwd=$(pwd)
11
12
test_expect_success 'setup' '
13
- git checkout -b master &&
13
+ git checkout -b main &&
14
test_commit commit1 &&
15
mkdir sub &&
16
(
@@ -42,7 +42,7 @@ test_expect_success 'clone with --remote-submodules' '
42
git clone --recurse-submodules --remote-submodules "file://$pwd/." super_clone &&
43
(
44
cd super_clone/sub &&
45
- git diff --exit-code remotes/origin/master
45
+ git diff --exit-code remotes/origin/main
46
)
47
'
48
@@ -60,7 +60,7 @@ test_expect_success 'clone with --single-branch' '
60
git clone --recurse-submodules --single-branch "file://$pwd/." super_clone &&
61
(
62
cd super_clone/sub &&
63
- git rev-parse --verify origin/master &&
63
+ git rev-parse --verify origin/main &&
64
test_must_fail git rev-parse --verify origin/other
65
)
66
'
t/t5700-protocol-v1.sh
+9
-9
@@ -8,7 +8,7 @@ TEST_NO_CREATE_REPO=1
8
GIT_TEST_PROTOCOL_VERSION=0
9
export GIT_TEST_PROTOCOL_VERSION
10
11
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
11
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
12
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
13
14
. ./test-lib.sh
@@ -44,7 +44,7 @@ test_expect_success 'fetch with git:// using protocol v1' '
44
GIT_TRACE_PACKET=1 git -C daemon_child -c protocol.version=1 \
45
fetch 2>log &&
46
47
- git -C daemon_child log -1 --format=%s origin/master >actual &&
47
+ git -C daemon_child log -1 --format=%s origin/main >actual &&
48
git -C "$daemon_parent" log -1 --format=%s >expect &&
49
test_cmp expect actual &&
50
@@ -72,7 +72,7 @@ test_expect_success 'push with git:// using protocol v1' '
72
test_commit -C daemon_child three &&
73
74
# Push to another branch, as the target repository has the
75
- # master branch checked out and we cannot push into it.
75
+ # main branch checked out and we cannot push into it.
76
GIT_TRACE_PACKET=1 git -C daemon_child -c protocol.version=1 \
77
push origin HEAD:client_branch 2>log &&
78
@@ -113,7 +113,7 @@ test_expect_success 'fetch with file:// using protocol v1' '
113
GIT_TRACE_PACKET=1 git -C file_child -c protocol.version=1 \
114
fetch 2>log &&
115
116
- git -C file_child log -1 --format=%s origin/master >actual &&
116
+ git -C file_child log -1 --format=%s origin/main >actual &&
117
git -C file_parent log -1 --format=%s >expect &&
118
test_cmp expect actual &&
119
@@ -137,7 +137,7 @@ test_expect_success 'push with file:// using protocol v1' '
137
test_commit -C file_child three &&
138
139
# Push to another branch, as the target repository has the
140
- # master branch checked out and we cannot push into it.
140
+ # main branch checked out and we cannot push into it.
141
GIT_TRACE_PACKET=1 git -C file_child -c protocol.version=1 \
142
push origin HEAD:client_branch 2>log &&
143
@@ -191,7 +191,7 @@ test_expect_success 'fetch with ssh:// using protocol v1' '
191
fetch 2>log &&
192
expect_ssh git-upload-pack &&
193
194
- git -C ssh_child log -1 --format=%s origin/master >actual &&
194
+ git -C ssh_child log -1 --format=%s origin/main >actual &&
195
git -C ssh_parent log -1 --format=%s >expect &&
196
test_cmp expect actual &&
197
@@ -216,7 +216,7 @@ test_expect_success 'push with ssh:// using protocol v1' '
216
test_commit -C ssh_child three &&
217
218
# Push to another branch, as the target repository has the
219
- # master branch checked out and we cannot push into it.
219
+ # main branch checked out and we cannot push into it.
220
GIT_TRACE_PACKET=1 git -C ssh_child -c protocol.version=1 \
221
push origin HEAD:client_branch 2>log &&
222
expect_ssh git-receive-pack &&
@@ -260,7 +260,7 @@ test_expect_success 'fetch with http:// using protocol v1' '
260
GIT_TRACE_PACKET=1 git -C http_child -c protocol.version=1 \
261
fetch 2>log &&
262
263
- git -C http_child log -1 --format=%s origin/master >actual &&
263
+ git -C http_child log -1 --format=%s origin/main >actual &&
264
git -C "$HTTPD_DOCUMENT_ROOT_PATH/http_parent" log -1 --format=%s >expect &&
265
test_cmp expect actual &&
266
@@ -284,7 +284,7 @@ test_expect_success 'push with http:// using protocol v1' '
284
test_commit -C http_child three &&
285
286
# Push to another branch, as the target repository has the
287
- # master branch checked out and we cannot push into it.
287
+ # main branch checked out and we cannot push into it.
288
GIT_TRACE_PACKET=1 git -C http_child -c protocol.version=1 \
289
push origin HEAD:client_branch && #2>log &&
290
t/t5701-git-serve.sh
+9
-9
@@ -2,7 +2,7 @@
2
3
test_description='test protocol v2 server commands'
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
@@ -86,9 +86,9 @@ test_expect_success 'wrong object-format' '
86
#
87
test_expect_success 'setup some refs and tags' '
88
test_commit one &&
89
- git branch dev master &&
89
+ git branch dev main &&
90
test_commit two &&
91
- git symbolic-ref refs/heads/release refs/heads/master &&
91
+ git symbolic-ref refs/heads/release refs/heads/main &&
92
git tag -a -m "annotated tag" annotated-tag
93
'
94
@@ -102,7 +102,7 @@ test_expect_success 'basics of ls-refs' '
102
cat >expect <<-EOF &&
103
$(git rev-parse HEAD) HEAD
104
$(git rev-parse refs/heads/dev) refs/heads/dev
105
- $(git rev-parse refs/heads/master) refs/heads/master
105
+ $(git rev-parse refs/heads/main) refs/heads/main
106
$(git rev-parse refs/heads/release) refs/heads/release
107
$(git rev-parse refs/tags/annotated-tag) refs/tags/annotated-tag
108
$(git rev-parse refs/tags/one) refs/tags/one
@@ -120,13 +120,13 @@ test_expect_success 'basic ref-prefixes' '
120
command=ls-refs
121
object-format=$(test_oid algo)
122
0001
123
- ref-prefix refs/heads/master
123
+ ref-prefix refs/heads/main
124
ref-prefix refs/tags/one
125
0000
126
EOF
127
128
cat >expect <<-EOF &&
129
- $(git rev-parse refs/heads/master) refs/heads/master
129
+ $(git rev-parse refs/heads/main) refs/heads/main
130
$(git rev-parse refs/tags/one) refs/tags/one
131
0000
132
EOF
@@ -147,7 +147,7 @@ test_expect_success 'refs/heads prefix' '
147
148
cat >expect <<-EOF &&
149
$(git rev-parse refs/heads/dev) refs/heads/dev
150
- $(git rev-parse refs/heads/master) refs/heads/master
150
+ $(git rev-parse refs/heads/main) refs/heads/main
151
$(git rev-parse refs/heads/release) refs/heads/release
152
0000
153
EOF
@@ -191,8 +191,8 @@ test_expect_success 'symrefs parameter' '
191
192
cat >expect <<-EOF &&
193
$(git rev-parse refs/heads/dev) refs/heads/dev
194
- $(git rev-parse refs/heads/master) refs/heads/master
195
- $(git rev-parse refs/heads/release) refs/heads/release symref-target:refs/heads/master
194
+ $(git rev-parse refs/heads/main) refs/heads/main
195
+ $(git rev-parse refs/heads/release) refs/heads/release symref-target:refs/heads/main
196
0000
197
EOF
198
t/t5702-protocol-v2.sh
+26
-26
@@ -4,7 +4,7 @@ test_description='test git wire-protocol version 2'
4
5
TEST_NO_CREATE_REPO=1
6
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
. ./test-lib.sh
@@ -39,10 +39,10 @@ test_expect_success 'ref advertisement is filtered with ls-remote using protocol
39
test_when_finished "rm -f log" &&
40
41
GIT_TRACE_PACKET="$(pwd)/log" git -c protocol.version=2 \
42
- ls-remote "$GIT_DAEMON_URL/parent" master >actual &&
42
+ ls-remote "$GIT_DAEMON_URL/parent" main >actual &&
43
44
cat >expect <<-EOF &&
45
- $(git -C "$daemon_parent" rev-parse refs/heads/master)$(printf "\t")refs/heads/master
45
+ $(git -C "$daemon_parent" rev-parse refs/heads/main)$(printf "\t")refs/heads/main
46
EOF
47
48
test_cmp expect actual
@@ -72,7 +72,7 @@ test_expect_success 'fetch with git:// using protocol v2' '
72
GIT_TRACE_PACKET="$(pwd)/log" git -C daemon_child -c protocol.version=2 \
73
fetch &&
74
75
- git -C daemon_child log -1 --format=%s origin/master >actual &&
75
+ git -C daemon_child log -1 --format=%s origin/main >actual &&
76
git -C "$daemon_parent" log -1 --format=%s >expect &&
77
test_cmp expect actual &&
78
@@ -121,7 +121,7 @@ test_expect_success 'push with git:// and a config of v2 does not request v2' '
121
test_commit -C daemon_child three &&
122
123
# Push to another branch, as the target repository has the
124
- # master branch checked out and we cannot push into it.
124
+ # main branch checked out and we cannot push into it.
125
GIT_TRACE_PACKET="$(pwd)/log" git -C daemon_child -c protocol.version=2 \
126
push origin HEAD:client_branch &&
127
@@ -161,10 +161,10 @@ test_expect_success 'ref advertisement is filtered with ls-remote using protocol
161
test_when_finished "rm -f log" &&
162
163
GIT_TRACE_PACKET="$(pwd)/log" git -c protocol.version=2 \
164
- ls-remote "file://$(pwd)/file_parent" master >actual &&
164
+ ls-remote "file://$(pwd)/file_parent" main >actual &&
165
166
cat >expect <<-EOF &&
167
- $(git -C file_parent rev-parse refs/heads/master)$(printf "\t")refs/heads/master
167
+ $(git -C file_parent rev-parse refs/heads/main)$(printf "\t")refs/heads/main
168
EOF
169
170
test_cmp expect actual
@@ -174,10 +174,10 @@ test_expect_success 'server-options are sent when using ls-remote' '
174
test_when_finished "rm -f log" &&
175
176
GIT_TRACE_PACKET="$(pwd)/log" git -c protocol.version=2 \
177
- ls-remote -o hello -o world "file://$(pwd)/file_parent" master >actual &&
177
+ ls-remote -o hello -o world "file://$(pwd)/file_parent" main >actual &&
178
179
cat >expect <<-EOF &&
180
- $(git -C file_parent rev-parse refs/heads/master)$(printf "\t")refs/heads/master
180
+ $(git -C file_parent rev-parse refs/heads/main)$(printf "\t")refs/heads/main
181
EOF
182
183
test_cmp expect actual &&
@@ -187,7 +187,7 @@ test_expect_success 'server-options are sent when using ls-remote' '
187
188
test_expect_success 'warn if using server-option with ls-remote with legacy protocol' '
189
test_must_fail env GIT_TEST_PROTOCOL_VERSION=0 git -c protocol.version=0 \
190
- ls-remote -o hello -o world "file://$(pwd)/file_parent" master 2>err &&
190
+ ls-remote -o hello -o world "file://$(pwd)/file_parent" main 2>err &&
191
192
test_i18ngrep "see protocol.version in" err &&
193
test_i18ngrep "server options require protocol version 2 or later" err
@@ -220,7 +220,7 @@ test_expect_success 'fetch with file:// using protocol v2' '
220
GIT_TRACE_PACKET="$(pwd)/log" git -C file_child -c protocol.version=2 \
221
fetch origin &&
222
223
- git -C file_child log -1 --format=%s origin/master >actual &&
223
+ git -C file_child log -1 --format=%s origin/main >actual &&
224
git -C file_parent log -1 --format=%s >expect &&
225
test_cmp expect actual &&
226
@@ -235,13 +235,13 @@ test_expect_success 'ref advertisement is filtered during fetch using protocol v
235
git -C file_parent branch unwanted-branch three &&
236
237
GIT_TRACE_PACKET="$(pwd)/log" git -C file_child -c protocol.version=2 \
238
- fetch origin master &&
238
+ fetch origin main &&
239
240
- git -C file_child log -1 --format=%s origin/master >actual &&
240
+ git -C file_child log -1 --format=%s origin/main >actual &&
241
git -C file_parent log -1 --format=%s >expect &&
242
test_cmp expect actual &&
243
244
- grep "refs/heads/master" log &&
244
+ grep "refs/heads/main" log &&
245
! grep "refs/heads/unwanted-branch" log
246
'
247
@@ -251,9 +251,9 @@ test_expect_success 'server-options are sent when fetching' '
251
test_commit -C file_parent four &&
252
253
GIT_TRACE_PACKET="$(pwd)/log" git -C file_child -c protocol.version=2 \
254
- fetch -o hello -o world origin master &&
254
+ fetch -o hello -o world origin main &&
255
256
- git -C file_child log -1 --format=%s origin/master >actual &&
256
+ git -C file_child log -1 --format=%s origin/main >actual &&
257
git -C file_parent log -1 --format=%s >expect &&
258
test_cmp expect actual &&
259
@@ -267,7 +267,7 @@ test_expect_success 'warn if using server-option with fetch with legacy protocol
267
git init temp_child &&
268
269
test_must_fail env GIT_TEST_PROTOCOL_VERSION=0 git -C temp_child -c protocol.version=0 \
270
- fetch -o hello -o world "file://$(pwd)/file_parent" master 2>err &&
270
+ fetch -o hello -o world "file://$(pwd)/file_parent" main 2>err &&
271
272
test_i18ngrep "see protocol.version in" err &&
273
test_i18ngrep "server options require protocol version 2 or later" err
@@ -328,7 +328,7 @@ test_expect_success 'partial clone' '
328
grep "version 2" trace &&
329
330
# Ensure that the old version of the file is missing
331
- git -C client rev-list --quiet --objects --missing=print master \
331
+ git -C client rev-list --quiet --objects --missing=print main \
332
>observed.oids &&
333
grep "$(git -C server rev-parse message1:a.txt)" observed.oids &&
334
@@ -353,7 +353,7 @@ test_expect_success 'partial fetch' '
353
SERVER="file://$(pwd)/server" &&
354
355
GIT_TRACE_PACKET="$(pwd)/trace" git -C client -c protocol.version=2 \
356
- fetch --filter=blob:none "$SERVER" master:refs/heads/other &&
356
+ fetch --filter=blob:none "$SERVER" main:refs/heads/other &&
357
grep "version 2" trace &&
358
359
# Ensure that the old version of the file is missing
@@ -398,7 +398,7 @@ test_expect_success 'even with handcrafted request, filter does not work if not
398
command=fetch
399
object-format=$(test_oid algo)
400
0001
401
- want $(git -C server rev-parse master)
401
+ want $(git -C server rev-parse main)
402
filter blob:none
403
0000
404
EOF
@@ -542,7 +542,7 @@ test_expect_success 'deepen-relative' '
542
test_commit -C server four &&
543
544
# Sanity check that only "three" is downloaded
545
- git -C client log --pretty=tformat:%s master >actual &&
545
+ git -C client log --pretty=tformat:%s main >actual &&
546
echo three >expected &&
547
test_cmp expected actual &&
548
@@ -551,7 +551,7 @@ test_expect_success 'deepen-relative' '
551
# Ensure that protocol v2 is used
552
grep "fetch< version 2" trace &&
553
554
- git -C client log --pretty=tformat:%s origin/master >actual &&
554
+ git -C client log --pretty=tformat:%s origin/main >actual &&
555
cat >expected <<-\EOF &&
556
four
557
three
@@ -673,7 +673,7 @@ test_expect_success 'fetch with http:// using protocol v2' '
673
GIT_TRACE_PACKET="$(pwd)/log" git -C http_child -c protocol.version=2 \
674
fetch &&
675
676
- git -C http_child log -1 --format=%s origin/master >actual &&
676
+ git -C http_child log -1 --format=%s origin/main >actual &&
677
git -C "$HTTPD_DOCUMENT_ROOT_PATH/http_parent" log -1 --format=%s >expect &&
678
test_cmp expect actual &&
679
@@ -701,11 +701,11 @@ test_expect_success 'fetch from namespaced repo respects namespaces' '
701
test_commit -C "$HTTPD_DOCUMENT_ROOT_PATH/nsrepo" one &&
702
test_commit -C "$HTTPD_DOCUMENT_ROOT_PATH/nsrepo" two &&
703
git -C "$HTTPD_DOCUMENT_ROOT_PATH/nsrepo" \
704
- update-ref refs/namespaces/ns/refs/heads/master one &&
704
+ update-ref refs/namespaces/ns/refs/heads/main one &&
705
706
GIT_TRACE_PACKET="$(pwd)/log" git -C http_child -c protocol.version=2 \
707
fetch "$HTTPD_URL/smart_namespace/nsrepo" \
708
- refs/heads/master:refs/heads/theirs &&
708
+ refs/heads/main:refs/heads/theirs &&
709
710
# Server responded using protocol v2
711
grep "fetch< version 2" log &&
@@ -736,7 +736,7 @@ test_expect_success 'push with http:// and a config of v2 does not request v2' '
736
test_commit -C http_child three &&
737
738
# Push to another branch, as the target repository has the
739
- # master branch checked out and we cannot push into it.
739
+ # main branch checked out and we cannot push into it.
740
GIT_TRACE_PACKET="$(pwd)/log" git -C http_child -c protocol.version=2 \
741
push origin HEAD:client_branch &&
742
t/t5703-upload-pack-ref-in-want.sh
+30
-30
@@ -2,7 +2,7 @@
2
3
test_description='upload-pack ref-in-want'
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
@@ -41,7 +41,7 @@ write_command () {
41
42
# c(o/foo) d(o/bar)
43
# \ /
44
-# b e(baz) f(master)
44
+# b e(baz) f(main)
45
# \__ | __/
46
# \ | /
47
# a
@@ -54,7 +54,7 @@ test_expect_success 'setup repository' '
54
test_commit d &&
55
git checkout -b baz a &&
56
test_commit e &&
57
- git checkout master &&
57
+ git checkout main &&
58
test_commit f
59
'
60
@@ -91,7 +91,7 @@ test_expect_success 'invalid want-ref line' '
91
test_expect_success 'basic want-ref' '
92
oid=$(git rev-parse f) &&
93
cat >expected_refs <<-EOF &&
94
- $oid refs/heads/master
94
+ $oid refs/heads/main
95
EOF
96
git rev-parse f >expected_commits &&
97
@@ -100,7 +100,7 @@ test_expect_success 'basic want-ref' '
100
$(write_command fetch)
101
0001
102
no-progress
103
- want-ref refs/heads/master
103
+ want-ref refs/heads/main
104
have $oid
105
done
106
0000
@@ -138,7 +138,7 @@ test_expect_success 'multiple want-ref lines' '
138
test_expect_success 'mix want and want-ref' '
139
oid=$(git rev-parse f) &&
140
cat >expected_refs <<-EOF &&
141
- $oid refs/heads/master
141
+ $oid refs/heads/main
142
EOF
143
git rev-parse e f >expected_commits &&
144
@@ -146,7 +146,7 @@ test_expect_success 'mix want and want-ref' '
146
$(write_command fetch)
147
0001
148
no-progress
149
- want-ref refs/heads/master
149
+ want-ref refs/heads/main
150
want $(git rev-parse e)
151
have $(git rev-parse a)
152
done
@@ -185,7 +185,7 @@ LOCAL_PRISTINE="$(pwd)/local_pristine"
185
# $REPO
186
# c(o/foo) d(o/bar)
187
# \ /
188
-# b e(baz) f(master)
188
+# b e(baz) f(main)
189
# \__ | __/
190
# \ | /
191
# a
@@ -196,7 +196,7 @@ LOCAL_PRISTINE="$(pwd)/local_pristine"
196
# .
197
# .
198
# |
199
-# a(master)
199
+# a(main)
200
test_expect_success 'setup repos for fetching with ref-in-want tests' '
201
(
202
git init "$REPO" &&
@@ -212,7 +212,7 @@ test_expect_success 'setup repos for fetching with ref-in-want tests' '
212
test_commit_bulk --id=s 33 &&
213
214
# Add novel commits to upstream
215
- git checkout master &&
215
+ git checkout main &&
216
cd "$REPO" &&
217
git checkout -b o/foo &&
218
test_commit b &&
@@ -221,7 +221,7 @@ test_expect_success 'setup repos for fetching with ref-in-want tests' '
221
test_commit d &&
222
git checkout -b baz a &&
223
test_commit e &&
224
- git checkout master &&
224
+ git checkout main &&
225
test_commit f
226
) &&
227
git -C "$REPO" config uploadpack.allowRefInWant true &&
@@ -248,12 +248,12 @@ test_expect_success 'fetching multiple refs' '
248
249
rm -rf local &&
250
cp -r "$LOCAL_PRISTINE" local &&
251
- GIT_TRACE_PACKET="$(pwd)/log" git -C local fetch origin master baz &&
251
+ GIT_TRACE_PACKET="$(pwd)/log" git -C local fetch origin main baz &&
252
253
- git -C "$REPO" rev-parse "master" "baz" >expected &&
254
- git -C local rev-parse refs/remotes/origin/master refs/remotes/origin/baz >actual &&
253
+ git -C "$REPO" rev-parse "main" "baz" >expected &&
254
+ git -C local rev-parse refs/remotes/origin/main refs/remotes/origin/baz >actual &&
255
test_cmp expected actual &&
256
- grep "want-ref refs/heads/master" log &&
256
+ grep "want-ref refs/heads/main" log &&
257
grep "want-ref refs/heads/baz" log
258
'
259
@@ -264,13 +264,13 @@ test_expect_success 'fetching ref and exact OID' '
264
cp -r "$LOCAL_PRISTINE" local &&
265
oid=$(git -C "$REPO" rev-parse b) &&
266
GIT_TRACE_PACKET="$(pwd)/log" git -C local fetch origin \
267
- master "$oid":refs/heads/actual &&
267
+ main "$oid":refs/heads/actual &&
268
269
- git -C "$REPO" rev-parse "master" "b" >expected &&
270
- git -C local rev-parse refs/remotes/origin/master refs/heads/actual >actual &&
269
+ git -C "$REPO" rev-parse "main" "b" >expected &&
270
+ git -C local rev-parse refs/remotes/origin/main refs/heads/actual >actual &&
271
test_cmp expected actual &&
272
grep "want $oid" log &&
273
- grep "want-ref refs/heads/master" log
273
+ grep "want-ref refs/heads/main" log
274
'
275
276
test_expect_success 'fetching with wildcard that does not match any refs' '
@@ -319,7 +319,7 @@ test_expect_success 'setup repos for change-while-negotiating test' '
319
test_commit_bulk --id=s 33 &&
320
321
# Add novel commits to upstream
322
- git checkout master &&
322
+ git checkout main &&
323
cd "$REPO" &&
324
test_commit m2 &&
325
test_commit m3 &&
@@ -345,7 +345,7 @@ test_expect_success 'server is initially ahead - no ref in want' '
345
git -C "$REPO" config uploadpack.allowRefInWant false &&
346
rm -rf local &&
347
cp -r "$LOCAL_PRISTINE" local &&
348
- inconsistency master $(test_oid numeric) &&
348
+ inconsistency main $(test_oid numeric) &&
349
test_must_fail git -C local fetch 2>err &&
350
test_i18ngrep "fatal: remote error: upload-pack: not our ref" err
351
'
@@ -354,11 +354,11 @@ test_expect_success 'server is initially ahead - ref in want' '
354
git -C "$REPO" config uploadpack.allowRefInWant true &&
355
rm -rf local &&
356
cp -r "$LOCAL_PRISTINE" local &&
357
- inconsistency master $(test_oid numeric) &&
357
+ inconsistency main $(test_oid numeric) &&
358
git -C local fetch &&
359
360
- git -C "$REPO" rev-parse --verify master >expected &&
361
- git -C local rev-parse --verify refs/remotes/origin/master >actual &&
360
+ git -C "$REPO" rev-parse --verify main >expected &&
361
+ git -C local rev-parse --verify refs/remotes/origin/main >actual &&
362
test_cmp expected actual
363
'
364
@@ -366,11 +366,11 @@ test_expect_success 'server is initially behind - no ref in want' '
366
git -C "$REPO" config uploadpack.allowRefInWant false &&
367
rm -rf local &&
368
cp -r "$LOCAL_PRISTINE" local &&
369
- inconsistency master "master^" &&
369
+ inconsistency main "main^" &&
370
git -C local fetch &&
371
372
- git -C "$REPO" rev-parse --verify "master^" >expected &&
373
- git -C local rev-parse --verify refs/remotes/origin/master >actual &&
372
+ git -C "$REPO" rev-parse --verify "main^" >expected &&
373
+ git -C local rev-parse --verify refs/remotes/origin/main >actual &&
374
test_cmp expected actual
375
'
376
@@ -378,11 +378,11 @@ test_expect_success 'server is initially behind - ref in want' '
378
git -C "$REPO" config uploadpack.allowRefInWant true &&
379
rm -rf local &&
380
cp -r "$LOCAL_PRISTINE" local &&
381
- inconsistency master "master^" &&
381
+ inconsistency main "main^" &&
382
git -C local fetch &&
383
384
- git -C "$REPO" rev-parse --verify "master" >expected &&
385
- git -C local rev-parse --verify refs/remotes/origin/master >actual &&
384
+ git -C "$REPO" rev-parse --verify "main" >expected &&
385
+ git -C local rev-parse --verify refs/remotes/origin/main >actual &&
386
test_cmp expected actual
387
'
388
t/t5801-remote-helpers.sh
+13
-13
@@ -5,7 +5,7 @@
5
6
test_description='Test remote-helper import and export commands'
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
@@ -74,18 +74,18 @@ test_expect_success 'fetch multiple branches' '
74
(cd local &&
75
git fetch
76
) &&
77
- compare_refs server master local refs/remotes/origin/master &&
77
+ compare_refs server main local refs/remotes/origin/main &&
78
compare_refs server new local refs/remotes/origin/new
79
'
80
81
test_expect_success 'push when remote has extra refs' '
82
(cd local &&
83
- git reset --hard origin/master &&
83
+ git reset --hard origin/main &&
84
echo content >>file &&
85
git commit -a -m six &&
86
git push
87
) &&
88
- compare_refs local master server master
88
+ compare_refs local main server main
89
'
90
91
test_expect_success 'push new branch by name' '
@@ -177,7 +177,7 @@ test_expect_failure 'pushing without marks' '
177
178
test_expect_success 'push all with existing object' '
179
(cd local &&
180
- git branch dup2 master &&
180
+ git branch dup2 main &&
181
git push origin --all
182
) &&
183
compare_refs local dup2 server dup2
@@ -185,7 +185,7 @@ test_expect_success 'push all with existing object' '
185
186
test_expect_success 'push ref with existing object' '
187
(cd local &&
188
- git branch dup master &&
188
+ git branch dup main &&
189
git push origin dup
190
) &&
191
compare_refs local dup server dup
@@ -193,7 +193,7 @@ test_expect_success 'push ref with existing object' '
193
194
test_expect_success GPG 'push signed tag' '
195
(cd local &&
196
- git checkout master &&
196
+ git checkout main &&
197
git tag -s -m signed-tag signed-tag &&
198
git push origin signed-tag
199
) &&
@@ -203,7 +203,7 @@ test_expect_success GPG 'push signed tag' '
203
204
test_expect_success GPG 'push signed tag with signed-tags capability' '
205
(cd local &&
206
- git checkout master &&
206
+ git checkout main &&
207
git tag -s -m signed-tag signed-tag-2 &&
208
GIT_REMOTE_TESTGIT_SIGNED_TAGS=1 git push origin signed-tag-2
209
) &&
@@ -212,7 +212,7 @@ test_expect_success GPG 'push signed tag with signed-tags capability' '
212
213
test_expect_success 'push update refs' '
214
(cd local &&
215
- git checkout -b update master &&
215
+ git checkout -b update main &&
216
echo update >>file &&
217
git commit -a -m update &&
218
git push origin update &&
@@ -263,7 +263,7 @@ test_expect_success 'proper failure checks for fetching' '
263
test_expect_success 'proper failure checks for pushing' '
264
test_when_finished "rm -rf local/git.marks local/testgit.marks" &&
265
(cd local &&
266
- git checkout -b crash master &&
266
+ git checkout -b crash main &&
267
echo crash >>file &&
268
git commit -a -m crash &&
269
test_must_fail env GIT_REMOTE_TESTGIT_FAILURE=1 git push --all &&
@@ -275,7 +275,7 @@ test_expect_success 'proper failure checks for pushing' '
275
276
test_expect_success 'push messages' '
277
(cd local &&
278
- git checkout -b new_branch master &&
278
+ git checkout -b new_branch main &&
279
echo new >>file &&
280
git commit -a -m new &&
281
git push origin new_branch &&
@@ -289,7 +289,7 @@ test_expect_success 'push messages' '
289
290
test_expect_success 'fetch HEAD' '
291
(cd server &&
292
- git checkout master &&
292
+ git checkout main &&
293
echo more >>file &&
294
git commit -a -m more
295
) &&
@@ -301,7 +301,7 @@ test_expect_success 'fetch HEAD' '
301
302
test_expect_success 'fetch url' '
303
(cd server &&
304
- git checkout master &&
304
+ git checkout main &&
305
echo more >>file &&
306
git commit -a -m more
307
) &&