t3[5-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' -- t3[5-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 cbc75a12f056c9e6eef30b92db2dc0ce99e97dbe
16 files changed +126 -126
t/t3500-cherry.sh
+7 -7
@@ -5,10 +5,10 @@
5
6 test_description='git cherry should detect patches integrated upstream
7
8 -This test cherry-picks one local change of two into master branch, and
8 +This test cherry-picks one local change of two into main branch, and
9 checks that git cherry only returns the second patch in the local branch
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
@@ -35,7 +35,7 @@ test_expect_success \
35 test_tick &&
36 git commit -m "Add C." &&
37
38 - git checkout -f master &&
38 + git checkout -f main &&
39 rm -f B C &&
40
41 echo Third >> A &&
@@ -43,19 +43,19 @@ test_expect_success \
43 test_tick &&
44 git commit -m "Modify A." &&
45
46 - expr "$(echo $(git cherry master my-topic-branch) )" : "+ [^ ]* + .*"
46 + expr "$(echo $(git cherry main my-topic-branch) )" : "+ [^ ]* + .*"
47 '
48
49 test_expect_success \
50 'check that cherry with limit returns only the top patch'\
51 - 'expr "$(echo $(git cherry master my-topic-branch my-topic-branch^1) )" : "+ [^ ]*"
51 + 'expr "$(echo $(git cherry main my-topic-branch my-topic-branch^1) )" : "+ [^ ]*"
52 '
53
54 test_expect_success \
55 'cherry-pick one of the 2 patches, and check cherry recognized one and only one as new' \
56 'git cherry-pick my-topic-branch^0 &&
57 - echo $(git cherry master my-topic-branch) &&
58 - expr "$(echo $(git cherry master my-topic-branch) )" : "+ [^ ]* - .*"
57 + echo $(git cherry main my-topic-branch) &&
58 + expr "$(echo $(git cherry main my-topic-branch) )" : "+ [^ ]* - .*"
59 '
60
61 test_expect_success 'cherry ignores whitespace' '
t/t3501-revert-cherry-pick.sh
+3 -3
@@ -10,7 +10,7 @@ test_description='test cherry-pick and revert with renames
10
11 '
12
13 -GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
13 +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
14 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
15
16 . ./test-lib.sh
@@ -115,7 +115,7 @@ test_expect_success 'cherry-pick on unborn branch' '
115 test_expect_success 'cherry-pick "-" to pick from previous branch' '
116 git checkout unborn &&
117 test_commit to-pick actual content &&
118 - git checkout master &&
118 + git checkout main &&
119 git cherry-pick - &&
120 echo content >expect &&
121 test_cmp expect actual
@@ -135,7 +135,7 @@ test_expect_success 'cherry-pick "-" is meaningless without checkout' '
135 test_expect_success 'cherry-pick "-" works with arguments' '
136 git checkout -b side-branch &&
137 test_commit change actual change &&
138 - git checkout master &&
138 + git checkout main &&
139 git cherry-pick -s - &&
140 echo "Signed-off-by: C O Mitter <committer@example.com>" >expect &&
141 git cat-file commit HEAD | grep ^Signed-off-by: >signoff &&
t/t3502-cherry-pick-merge.sh
+2 -2
@@ -8,7 +8,7 @@ test_description='cherry picking and reverting a merge
8
9 '
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
@@ -28,7 +28,7 @@ test_expect_success setup '
28 echo new line >B &&
29 git commit -m "add line to B" B &&
30 git tag b &&
31 - git checkout master &&
31 + git checkout main &&
32 git merge side &&
33 git tag c
34
t/t3503-cherry-pick-root.sh
+6 -6
@@ -2,7 +2,7 @@
2
3 test_description='test cherry-picking (and reverting) a root commit'
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
@@ -33,7 +33,7 @@ test_expect_success setup '
33 test_expect_success 'cherry-pick a root commit' '
34
35 git checkout second^0 &&
36 - git cherry-pick master &&
36 + git cherry-pick main &&
37 echo first >expect &&
38 test_cmp expect file1
39
@@ -41,14 +41,14 @@ test_expect_success 'cherry-pick a root commit' '
41
42 test_expect_success 'revert a root commit' '
43
44 - git revert master &&
44 + git revert main &&
45 test_path_is_missing file1
46
47 '
48
49 test_expect_success 'cherry-pick a root commit with an external strategy' '
50
51 - git cherry-pick --strategy=resolve master &&
51 + git cherry-pick --strategy=resolve main &&
52 echo first >expect &&
53 test_cmp expect file1
54
@@ -56,7 +56,7 @@ test_expect_success 'cherry-pick a root commit with an external strategy' '
56
57 test_expect_success 'revert a root commit with an external strategy' '
58
59 - git revert --strategy=resolve master &&
59 + git revert --strategy=resolve main &&
60 test_path_is_missing file1
61
62 '
@@ -68,7 +68,7 @@ test_expect_success 'cherry-pick two root commits' '
68 echo third >expect.file3 &&
69
70 git checkout second^0 &&
71 - git cherry-pick master third &&
71 + git cherry-pick main third &&
72
73 test_cmp expect.file1 file1 &&
74 test_cmp expect.file2 file2 &&
t/t3504-cherry-pick-rerere.sh
+13 -13
@@ -2,15 +2,15 @@
2
3 test_description='cherry-pick should rerere for conflicts'
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
9
10 test_expect_success setup '
11 test_commit foo &&
12 - test_commit foo-master foo &&
13 - test_commit bar-master bar &&
12 + test_commit foo-main foo &&
13 + test_commit bar-main bar &&
14
15 git checkout -b dev foo &&
16 test_commit foo-dev foo &&
@@ -19,7 +19,7 @@ test_expect_success setup '
19 '
20
21 test_expect_success 'conflicting merge' '
22 - test_must_fail git merge master
22 + test_must_fail git merge main
23 '
24
25 test_expect_success 'fixup' '
@@ -32,7 +32,7 @@ test_expect_success 'fixup' '
32 '
33
34 test_expect_success 'cherry-pick conflict with --rerere-autoupdate' '
35 - test_must_fail git cherry-pick --rerere-autoupdate foo..bar-master &&
35 + test_must_fail git cherry-pick --rerere-autoupdate foo..bar-main &&
36 test_cmp foo-expect foo &&
37 git diff-files --quiet &&
38 test_must_fail git cherry-pick --continue &&
@@ -44,7 +44,7 @@ test_expect_success 'cherry-pick conflict with --rerere-autoupdate' '
44
45 test_expect_success 'cherry-pick conflict repsects rerere.autoUpdate' '
46 test_config rerere.autoUpdate true &&
47 - test_must_fail git cherry-pick foo..bar-master &&
47 + test_must_fail git cherry-pick foo..bar-main &&
48 test_cmp foo-expect foo &&
49 git diff-files --quiet &&
50 test_must_fail git cherry-pick --continue &&
@@ -56,7 +56,7 @@ test_expect_success 'cherry-pick conflict repsects rerere.autoUpdate' '
56
57 test_expect_success 'cherry-pick conflict with --no-rerere-autoupdate' '
58 test_config rerere.autoUpdate true &&
59 - test_must_fail git cherry-pick --no-rerere-autoupdate foo..bar-master &&
59 + test_must_fail git cherry-pick --no-rerere-autoupdate foo..bar-main &&
60 test_cmp foo-expect foo &&
61 test_must_fail git diff-files --quiet &&
62 git add foo &&
@@ -69,7 +69,7 @@ test_expect_success 'cherry-pick conflict with --no-rerere-autoupdate' '
69 '
70
71 test_expect_success 'cherry-pick --continue rejects --rerere-autoupdate' '
72 - test_must_fail git cherry-pick --rerere-autoupdate foo..bar-master &&
72 + test_must_fail git cherry-pick --rerere-autoupdate foo..bar-main &&
73 test_cmp foo-expect foo &&
74 git diff-files --quiet &&
75 test_must_fail git cherry-pick --continue --rerere-autoupdate >actual 2>&1 &&
@@ -82,25 +82,25 @@ test_expect_success 'cherry-pick --continue rejects --rerere-autoupdate' '
82 '
83
84 test_expect_success 'cherry-pick --rerere-autoupdate more than once' '
85 - test_must_fail git cherry-pick --rerere-autoupdate --rerere-autoupdate foo..bar-master &&
85 + test_must_fail git cherry-pick --rerere-autoupdate --rerere-autoupdate foo..bar-main &&
86 test_cmp foo-expect foo &&
87 git diff-files --quiet &&
88 git cherry-pick --abort &&
89 - test_must_fail git cherry-pick --rerere-autoupdate --no-rerere-autoupdate --rerere-autoupdate foo..bar-master &&
89 + test_must_fail git cherry-pick --rerere-autoupdate --no-rerere-autoupdate --rerere-autoupdate foo..bar-main &&
90 test_cmp foo-expect foo &&
91 git diff-files --quiet &&
92 git cherry-pick --abort &&
93 - test_must_fail git cherry-pick --rerere-autoupdate --no-rerere-autoupdate foo..bar-master &&
93 + test_must_fail git cherry-pick --rerere-autoupdate --no-rerere-autoupdate foo..bar-main &&
94 test_must_fail git diff-files --quiet &&
95 git cherry-pick --abort
96 '
97
98 test_expect_success 'cherry-pick conflict without rerere' '
99 test_config rerere.enabled false &&
100 - test_must_fail git cherry-pick foo-master &&
100 + test_must_fail git cherry-pick foo-main &&
101 grep ===== foo &&
102 grep foo-dev foo &&
103 - grep foo-master foo
103 + grep foo-main foo
104 '
105
106 test_done
t/t3505-cherry-pick-empty.sh
+13 -13
@@ -2,7 +2,7 @@
2
3 test_description='test cherry-picking an empty commit'
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 @@ test_expect_success setup '
20 test_tick &&
21 git commit --allow-empty-message -m "" &&
22
23 - git checkout master &&
23 + git checkout main &&
24 git checkout -b empty-change-branch &&
25 test_tick &&
26 git commit --allow-empty -m "empty"
@@ -28,7 +28,7 @@ test_expect_success setup '
28 '
29
30 test_expect_success 'cherry-pick an empty commit' '
31 - git checkout master &&
31 + git checkout main &&
32 test_expect_code 1 git cherry-pick empty-change-branch
33 '
34
@@ -38,7 +38,7 @@ test_expect_success 'index lockfile was removed' '
38
39 test_expect_success 'cherry-pick a commit with an empty message' '
40 test_when_finished "git reset --hard empty-message-branch~1" &&
41 - git checkout master &&
41 + git checkout main &&
42 git cherry-pick empty-message-branch
43 '
44
@@ -47,12 +47,12 @@ test_expect_success 'index lockfile was removed' '
47 '
48
49 test_expect_success 'cherry-pick a commit with an empty message with --allow-empty-message' '
50 - git checkout -f master &&
50 + git checkout -f main &&
51 git cherry-pick --allow-empty-message empty-message-branch
52 '
53
54 test_expect_success 'cherry pick an empty non-ff commit without --allow-empty' '
55 - git checkout master &&
55 + git checkout main &&
56 echo fourth >>file2 &&
57 git add file2 &&
58 git commit -m "fourth" &&
@@ -60,22 +60,22 @@ test_expect_success 'cherry pick an empty non-ff commit without --allow-empty' '
60 '
61
62 test_expect_success 'cherry pick an empty non-ff commit with --allow-empty' '
63 - git checkout master &&
63 + git checkout main &&
64 git cherry-pick --allow-empty empty-change-branch
65 '
66
67 test_expect_success 'cherry pick with --keep-redundant-commits' '
68 - git checkout master &&
68 + git checkout main &&
69 git cherry-pick --keep-redundant-commits HEAD^
70 '
71
72 test_expect_success 'cherry-pick a commit that becomes no-op (prep)' '
73 - git checkout master &&
73 + git checkout main &&
74 git branch fork &&
75 echo foo >file2 &&
76 git add file2 &&
77 test_tick &&
78 - git commit -m "add file2 on master" &&
78 + git commit -m "add file2 on main" &&
79
80 git checkout fork &&
81 echo foo >file2 &&
@@ -87,15 +87,15 @@ test_expect_success 'cherry-pick a commit that becomes no-op (prep)' '
87 test_expect_success 'cherry-pick a no-op without --keep-redundant' '
88 git reset --hard &&
89 git checkout fork^0 &&
90 - test_must_fail git cherry-pick master
90 + test_must_fail git cherry-pick main
91 '
92
93 test_expect_success 'cherry-pick a no-op with --keep-redundant' '
94 git reset --hard &&
95 git checkout fork^0 &&
96 - git cherry-pick --keep-redundant-commits master &&
96 + git cherry-pick --keep-redundant-commits main &&
97 git show -s --format=%s >actual &&
98 - echo "add file2 on master" >expect &&
98 + echo "add file2 on main" >expect &&
99 test_cmp expect actual
100 '
101
t/t3506-cherry-pick-ff.sh
+5 -5
@@ -2,7 +2,7 @@
2
3 test_description='test cherry-picking with --ff option'
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
@@ -27,7 +27,7 @@ test_expect_success setup '
27 '
28
29 test_expect_success 'cherry-pick using --ff fast forwards' '
30 - git checkout master &&
30 + git checkout main &&
31 git reset --hard first &&
32 test_tick &&
33 git cherry-pick --ff second &&
@@ -35,7 +35,7 @@ test_expect_success 'cherry-pick using --ff fast forwards' '
35 '
36
37 test_expect_success 'cherry-pick not using --ff does not fast forwards' '
38 - git checkout master &&
38 + git checkout main &&
39 git reset --hard first &&
40 test_tick &&
41 git cherry-pick second &&
@@ -52,7 +52,7 @@ test_expect_success 'cherry-pick not using --ff does not fast forwards' '
52 # (This has been taken from t3502-cherry-pick-merge.sh)
53 #
54 test_expect_success 'merge setup' '
55 - git checkout master &&
55 + git checkout main &&
56 git reset --hard first &&
57 echo new line >A &&
58 git add A &&
@@ -65,7 +65,7 @@ test_expect_success 'merge setup' '
65 test_tick &&
66 git commit -m "add line to B" B &&
67 git tag B &&
68 - git checkout master &&
68 + git checkout main &&
69 git merge side &&
70 git tag C &&
71 git checkout -b new A
t/t3507-cherry-pick-conflict.sh
+2 -2
@@ -9,7 +9,7 @@ test_description='test cherry-pick and revert with conflicts
9
10 '
11
12 -GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
12 +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
13 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
14
15 . ./test-lib.sh
@@ -32,7 +32,7 @@ test_expect_success setup '
32 test_commit redundant-pick foo c redundant &&
33 git commit --allow-empty --allow-empty-message &&
34 git tag empty &&
35 - git checkout master &&
35 + git checkout main &&
36 git config advice.detachedhead false
37
38 '
t/t3508-cherry-pick-many-commits.sh
+20 -20
@@ -2,7 +2,7 @@
2
3 test_description='test cherry-picking many commits'
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
@@ -34,7 +34,7 @@ test_expect_success setup '
34 '
35
36 test_expect_success 'cherry-pick first..fourth works' '
37 - git checkout -f master &&
37 + git checkout -f main &&
38 git reset --hard first &&
39 test_tick &&
40 git cherry-pick first..fourth &&
@@ -48,7 +48,7 @@ test_expect_success 'cherry-pick three one two works' '
48 test_commit one &&
49 test_commit two &&
50 test_commit three &&
51 - git checkout -f master &&
51 + git checkout -f main &&
52 git reset --hard first &&
53 git cherry-pick three one two &&
54 git diff --quiet three &&
@@ -59,28 +59,28 @@ two"
59 '
60
61 test_expect_success 'cherry-pick three one two: fails' '
62 - git checkout -f master &&
62 + git checkout -f main &&
63 git reset --hard first &&
64 test_must_fail git cherry-pick three one two:
65 '
66
67 test_expect_success 'output to keep user entertained during multi-pick' '
68 cat <<-\EOF >expected &&
69 - [master OBJID] second
69 + [main OBJID] second
70 Author: A U Thor <author@example.com>
71 Date: Thu Apr 7 15:14:13 2005 -0700
72 1 file changed, 1 insertion(+)
73 - [master OBJID] third
73 + [main OBJID] third
74 Author: A U Thor <author@example.com>
75 Date: Thu Apr 7 15:15:13 2005 -0700
76 1 file changed, 1 insertion(+)
77 - [master OBJID] fourth
77 + [main OBJID] fourth
78 Author: A U Thor <author@example.com>
79 Date: Thu Apr 7 15:16:13 2005 -0700
80 1 file changed, 1 insertion(+)
81 EOF
82
83 - git checkout -f master &&
83 + git checkout -f main &&
84 git reset --hard first &&
85 test_tick &&
86 git cherry-pick first..fourth >actual &&
@@ -90,7 +90,7 @@ test_expect_success 'output to keep user entertained during multi-pick' '
90 '
91
92 test_expect_success 'cherry-pick --strategy resolve first..fourth works' '
93 - git checkout -f master &&
93 + git checkout -f main &&
94 git reset --hard first &&
95 test_tick &&
96 git cherry-pick --strategy resolve first..fourth &&
@@ -102,23 +102,23 @@ test_expect_success 'cherry-pick --strategy resolve first..fourth works' '
102 test_expect_success 'output during multi-pick indicates merge strategy' '
103 cat <<-\EOF >expected &&
104 Trying simple merge.
105 - [master OBJID] second
105 + [main OBJID] second
106 Author: A U Thor <author@example.com>
107 Date: Thu Apr 7 15:14:13 2005 -0700
108 1 file changed, 1 insertion(+)
109 Trying simple merge.
110 - [master OBJID] third
110 + [main OBJID] third
111 Author: A U Thor <author@example.com>
112 Date: Thu Apr 7 15:15:13 2005 -0700
113 1 file changed, 1 insertion(+)
114 Trying simple merge.
115 - [master OBJID] fourth
115 + [main OBJID] fourth
116 Author: A U Thor <author@example.com>
117 Date: Thu Apr 7 15:16:13 2005 -0700
118 1 file changed, 1 insertion(+)
119 EOF
120
121 - git checkout -f master &&
121 + git checkout -f main &&
122 git reset --hard first &&
123 test_tick &&
124 git cherry-pick --strategy resolve first..fourth >actual &&
@@ -127,7 +127,7 @@ test_expect_success 'output during multi-pick indicates merge strategy' '
127 '
128
129 test_expect_success 'cherry-pick --ff first..fourth works' '
130 - git checkout -f master &&
130 + git checkout -f main &&
131 git reset --hard first &&
132 test_tick &&
133 git cherry-pick --ff first..fourth &&
@@ -137,7 +137,7 @@ test_expect_success 'cherry-pick --ff first..fourth works' '
137 '
138
139 test_expect_success 'cherry-pick -n first..fourth works' '
140 - git checkout -f master &&
140 + git checkout -f main &&
141 git reset --hard first &&
142 test_tick &&
143 git cherry-pick -n first..fourth &&
@@ -147,7 +147,7 @@ test_expect_success 'cherry-pick -n first..fourth works' '
147 '
148
149 test_expect_success 'revert first..fourth works' '
150 - git checkout -f master &&
150 + git checkout -f main &&
151 git reset --hard fourth &&
152 test_tick &&
153 git revert first..fourth &&
@@ -157,7 +157,7 @@ test_expect_success 'revert first..fourth works' '
157 '
158
159 test_expect_success 'revert ^first fourth works' '
160 - git checkout -f master &&
160 + git checkout -f main &&
161 git reset --hard fourth &&
162 test_tick &&
163 git revert ^first fourth &&
@@ -167,7 +167,7 @@ test_expect_success 'revert ^first fourth works' '
167 '
168
169 test_expect_success 'revert fourth fourth~1 fourth~2 works' '
170 - git checkout -f master &&
170 + git checkout -f main &&
171 git reset --hard fourth &&
172 test_tick &&
173 git revert fourth fourth~1 fourth~2 &&
@@ -177,7 +177,7 @@ test_expect_success 'revert fourth fourth~1 fourth~2 works' '
177 '
178
179 test_expect_success 'cherry-pick -3 fourth works' '
180 - git checkout -f master &&
180 + git checkout -f main &&
181 git reset --hard first &&
182 test_tick &&
183 git cherry-pick -3 fourth &&
@@ -187,7 +187,7 @@ test_expect_success 'cherry-pick -3 fourth works' '
187 '
188
189 test_expect_success 'cherry-pick --stdin works' '
190 - git checkout -f master &&
190 + git checkout -f main &&
191 git reset --hard first &&
192 test_tick &&
193 git rev-list --reverse first..fourth | git cherry-pick --stdin &&
t/t3509-cherry-pick-merge-df.sh
+2 -2
@@ -1,7 +1,7 @@
1 #!/bin/sh
2
3 test_description='Test cherry-pick with directory/file conflicts'
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
@@ -31,7 +31,7 @@ test_expect_success 'Setup rename across paths each below D/F conflicts' '
31
32 test_expect_success 'Cherry-pick succeeds with rename across D/F conflicts' '
33 git reset --hard &&
34 - git checkout master^0 &&
34 + git checkout main^0 &&
35 git cherry-pick branch
36 '
37
t/t3512-cherry-pick-submodule.sh
+2 -2
@@ -2,7 +2,7 @@
2
3 test_description='cherry-pick can handle submodules'
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
@@ -38,7 +38,7 @@ test_expect_success 'unrelated submodule/file conflict is ignored' '
38 git add a_file &&
39 git commit -m "modify a file" &&
40
41 - git checkout master &&
41 + git checkout main &&
42
43 git submodule add ../sub sub &&
44 git submodule update sub &&
t/t3600-rm.sh
+6 -6
@@ -5,7 +5,7 @@
5
6 test_description='Test of the various options to git rm.'
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
@@ -486,16 +486,16 @@ test_expect_success 'setup submodule conflict' '
486 echo 1 >nitfol &&
487 git add nitfol &&
488 git commit -m "added nitfol 1" &&
489 - git checkout -b branch2 master &&
489 + git checkout -b branch2 main &&
490 echo 2 >nitfol &&
491 git add nitfol &&
492 git commit -m "added nitfol 2" &&
493 - git checkout -b conflict1 master &&
493 + git checkout -b conflict1 main &&
494 git -C submod fetch &&
495 git -C submod checkout branch1 &&
496 git add submod &&
497 git commit -m "submod 1" &&
498 - git checkout -b conflict2 master &&
498 + git checkout -b conflict2 main &&
499 git -C submod checkout branch2 &&
500 git add submod &&
501 git commit -m "submod 2"
@@ -607,7 +607,7 @@ test_expect_success 'rm of a conflicted unpopulated submodule succeeds' '
607 '
608
609 test_expect_success 'rm of a populated submodule with a .git directory migrates git dir' '
610 - git checkout -f master &&
610 + git checkout -f main &&
611 git reset --hard &&
612 git submodule update &&
613 (
@@ -720,7 +720,7 @@ test_expect_success 'checking out a commit after submodule removal needs manual
720 git checkout HEAD^ &&
721 git submodule update &&
722 git checkout -q HEAD^ &&
723 - git checkout -q master 2>actual &&
723 + git checkout -q main 2>actual &&
724 test_i18ngrep "^warning: unable to rmdir '\''submod'\'':" actual &&
725 git status -s submod >actual &&
726 echo "?? submod/" >expected &&
t/t3701-add-interactive.sh
+3 -3
@@ -1,7 +1,7 @@
1 #!/bin/sh
2
3 test_description='add -i basic tests'
4 -GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
4 +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
5 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
6
7 . ./test-lib.sh
@@ -552,8 +552,8 @@ test_expect_success 'patch mode ignores unmerged entries' '
552 test_commit non-conflict &&
553 git checkout -b side &&
554 test_commit side conflict.t &&
555 - git checkout master &&
556 - test_commit master conflict.t &&
555 + git checkout main &&
556 + test_commit main conflict.t &&
557 test_must_fail git merge side &&
558 echo changed >non-conflict.t &&
559 echo y | git add -p >output &&
t/t3901-i18n-patch.sh
+21 -21
@@ -5,7 +5,7 @@
5
6 test_description='i18n settings and format-patch | am pipe'
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
@@ -48,7 +48,7 @@ test_expect_success setup '
48
49 # the first commit on the side branch is UTF-8
50 test_tick &&
51 - git checkout -b side master^ &&
51 + git checkout -b side main^ &&
52 echo Another file >yours &&
53 git add yours &&
54 git commit -s -m "Second on side" &&
@@ -72,7 +72,7 @@ test_expect_success setup '
72 test_expect_success 'format-patch output (ISO-8859-1)' '
73 git config i18n.logoutputencoding ISO8859-1 &&
74
75 - git format-patch --stdout master..HEAD^ >out-l1 &&
75 + git format-patch --stdout main..HEAD^ >out-l1 &&
76 git format-patch --stdout HEAD^ >out-l2 &&
77 grep "^Content-Type: text/plain; charset=ISO8859-1" out-l1 &&
78 grep "^From: =?ISO8859-1?q?=C1=E9=ED=20=F3=FA?=" out-l1 &&
@@ -83,7 +83,7 @@ test_expect_success 'format-patch output (ISO-8859-1)' '
83 test_expect_success 'format-patch output (UTF-8)' '
84 git config i18n.logoutputencoding UTF-8 &&
85
86 - git format-patch --stdout master..HEAD^ >out-u1 &&
86 + git format-patch --stdout main..HEAD^ >out-u1 &&
87 git format-patch --stdout HEAD^ >out-u2 &&
88 grep "^Content-Type: text/plain; charset=UTF-8" out-u1 &&
89 grep "^From: =?UTF-8?q?=C3=81=C3=A9=C3=AD=20=C3=B3=C3=BA?=" out-u1 &&
@@ -105,7 +105,7 @@ test_expect_success 'rebase (U/U)' '
105 # we want UTF-8 encoded name.
106 . "$TEST_DIRECTORY"/t3901/utf8.txt &&
107 git checkout -b test &&
108 - git rebase master &&
108 + git rebase main &&
109
110 check_encoding 2
111 '
@@ -116,7 +116,7 @@ test_expect_success 'rebase (U/L)' '
116 . "$TEST_DIRECTORY"/t3901/utf8.txt &&
117
118 git reset --hard side &&
119 - git rebase master &&
119 + git rebase main &&
120
121 check_encoding 2
122 '
@@ -128,7 +128,7 @@ test_expect_success !MINGW 'rebase (L/L)' '
128 . "$TEST_DIRECTORY"/t3901/8859-1.txt &&
129
130 git reset --hard side &&
131 - git rebase master &&
131 + git rebase main &&
132
133 check_encoding 2 8859
134 '
@@ -141,7 +141,7 @@ test_expect_success !MINGW 'rebase (L/U)' '
141 . "$TEST_DIRECTORY"/t3901/8859-1.txt &&
142
143 git reset --hard side &&
144 - git rebase master &&
144 + git rebase main &&
145
146 check_encoding 2 8859
147 '
@@ -153,7 +153,7 @@ test_expect_success 'cherry-pick(U/U)' '
153 git config i18n.logoutputencoding UTF-8 &&
154 . "$TEST_DIRECTORY"/t3901/utf8.txt &&
155
156 - git reset --hard master &&
156 + git reset --hard main &&
157 git cherry-pick side^ &&
158 git cherry-pick side &&
159 git revert HEAD &&
@@ -168,7 +168,7 @@ test_expect_success !MINGW 'cherry-pick(L/L)' '
168 git config i18n.logoutputencoding ISO8859-1 &&
169 . "$TEST_DIRECTORY"/t3901/8859-1.txt &&
170
171 - git reset --hard master &&
171 + git reset --hard main &&
172 git cherry-pick side^ &&
173 git cherry-pick side &&
174 git revert HEAD &&
@@ -183,7 +183,7 @@ test_expect_success 'cherry-pick(U/L)' '
183 git config i18n.logoutputencoding ISO8859-1 &&
184 . "$TEST_DIRECTORY"/t3901/utf8.txt &&
185
186 - git reset --hard master &&
186 + git reset --hard main &&
187 git cherry-pick side^ &&
188 git cherry-pick side &&
189 git revert HEAD &&
@@ -199,7 +199,7 @@ test_expect_success !MINGW 'cherry-pick(L/U)' '
199 git config i18n.logoutputencoding UTF-8 &&
200 . "$TEST_DIRECTORY"/t3901/8859-1.txt &&
201
202 - git reset --hard master &&
202 + git reset --hard main &&
203 git cherry-pick side^ &&
204 git cherry-pick side &&
205 git revert HEAD &&
@@ -213,7 +213,7 @@ test_expect_success 'rebase --merge (U/U)' '
213 . "$TEST_DIRECTORY"/t3901/utf8.txt &&
214
215 git reset --hard side &&
216 - git rebase --merge master &&
216 + git rebase --merge main &&
217
218 check_encoding 2
219 '
@@ -224,7 +224,7 @@ test_expect_success 'rebase --merge (U/L)' '
224 . "$TEST_DIRECTORY"/t3901/utf8.txt &&
225
226 git reset --hard side &&
227 - git rebase --merge master &&
227 + git rebase --merge main &&
228
229 check_encoding 2
230 '
@@ -236,7 +236,7 @@ test_expect_success 'rebase --merge (L/L)' '
236 . "$TEST_DIRECTORY"/t3901/8859-1.txt &&
237
238 git reset --hard side &&
239 - git rebase --merge master &&
239 + git rebase --merge main &&
240
241 check_encoding 2 8859
242 '
@@ -249,7 +249,7 @@ test_expect_success 'rebase --merge (L/U)' '
249 . "$TEST_DIRECTORY"/t3901/8859-1.txt &&
250
251 git reset --hard side &&
252 - git rebase --merge master &&
252 + git rebase --merge main &&
253
254 check_encoding 2 8859
255 '
@@ -259,7 +259,7 @@ test_expect_success 'am (U/U)' '
259 git config i18n.commitencoding UTF-8 &&
260 . "$TEST_DIRECTORY"/t3901/utf8.txt &&
261
262 - git reset --hard master &&
262 + git reset --hard main &&
263 git am out-u1 out-u2 &&
264
265 check_encoding 2
@@ -270,7 +270,7 @@ test_expect_success !MINGW 'am (L/L)' '
270 git config i18n.commitencoding ISO8859-1 &&
271 . "$TEST_DIRECTORY"/t3901/8859-1.txt &&
272
273 - git reset --hard master &&
273 + git reset --hard main &&
274 git am out-l1 out-l2 &&
275
276 check_encoding 2 8859
@@ -280,7 +280,7 @@ test_expect_success 'am (U/L)' '
280 # Apply ISO-8859-1 patches with UTF-8 commitencoding
281 git config i18n.commitencoding UTF-8 &&
282 . "$TEST_DIRECTORY"/t3901/utf8.txt &&
283 - git reset --hard master &&
283 + git reset --hard main &&
284
285 # am specifies --utf8 by default.
286 git am out-l1 out-l2 &&
@@ -293,7 +293,7 @@ test_expect_success 'am --no-utf8 (U/L)' '
293 git config i18n.commitencoding UTF-8 &&
294 . "$TEST_DIRECTORY"/t3901/utf8.txt &&
295
296 - git reset --hard master &&
296 + git reset --hard main &&
297 git am --no-utf8 out-l1 out-l2 2>err &&
298
299 # commit-tree will warn that the commit message does not contain valid UTF-8
@@ -308,7 +308,7 @@ test_expect_success !MINGW 'am (L/U)' '
308 git config i18n.commitencoding ISO8859-1 &&
309 . "$TEST_DIRECTORY"/t3901/8859-1.txt &&
310
311 - git reset --hard master &&
311 + git reset --hard main &&
312 # mailinfo will re-code the commit message to the charset specified by
313 # i18n.commitencoding
314 git am out-u1 out-u2 &&
t/t3903-stash.sh
+17 -17
@@ -5,7 +5,7 @@
5
6 test_description='Test git stash'
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
@@ -223,14 +223,14 @@ test_expect_success 'stash branch' '
223 git commit file -m second &&
224 git stash branch stashbranch &&
225 test refs/heads/stashbranch = $(git symbolic-ref HEAD) &&
226 - test $(git rev-parse HEAD) = $(git rev-parse master^) &&
226 + test $(git rev-parse HEAD) = $(git rev-parse main^) &&
227 git diff --cached >output &&
228 diff_cmp expect output &&
229 git diff >output &&
230 diff_cmp expect1 output &&
231 git add file &&
232 git commit -m alternate\ second &&
233 - git diff master..stashbranch >output &&
233 + git diff main..stashbranch >output &&
234 diff_cmp output expect2 &&
235 test 0 = $(git stash list | wc -l)
236 '
@@ -523,7 +523,7 @@ test_expect_success 'stash branch - no stashes on stack, stash-like argument' '
523 STASH_ID=$(git stash create) &&
524 git reset --hard &&
525 git stash branch stash-branch ${STASH_ID} &&
526 - test_when_finished "git reset --hard HEAD && git checkout master &&
526 + test_when_finished "git reset --hard HEAD && git checkout main &&
527 git branch -D stash-branch" &&
528 test $(git ls-files --modified | wc -l) -eq 1
529 '
@@ -539,7 +539,7 @@ test_expect_success 'stash branch - stashes on stack, stash-like argument' '
539 STASH_ID=$(git stash create) &&
540 git reset --hard &&
541 git stash branch stash-branch ${STASH_ID} &&
542 - test_when_finished "git reset --hard HEAD && git checkout master &&
542 + test_when_finished "git reset --hard HEAD && git checkout main &&
543 git branch -D stash-branch" &&
544 test $(git ls-files --modified | wc -l) -eq 1
545 '
@@ -741,7 +741,7 @@ test_expect_success 'valid ref of the form "n", n < N' '
741 git stash &&
742 git stash show 0 &&
743 git stash branch tmp 0 &&
744 - git checkout master &&
744 + git checkout main &&
745 git stash &&
746 git stash apply 0 &&
747 git reset --hard &&
@@ -758,7 +758,7 @@ test_expect_success 'branch: do not drop the stash if the branch exists' '
758 git commit -m initial &&
759 echo bar >file &&
760 git stash &&
761 - test_must_fail git stash branch master stash@{0} &&
761 + test_must_fail git stash branch main stash@{0} &&
762 git rev-parse stash@{0} --
763 '
764
@@ -771,7 +771,7 @@ test_expect_success 'branch: should not drop the stash if the apply fails' '
771 echo bar >file &&
772 git stash &&
773 echo baz >file &&
774 - test_when_finished "git checkout master" &&
774 + test_when_finished "git checkout main" &&
775 test_must_fail git stash branch new_branch stash@{0} &&
776 git rev-parse stash@{0} --
777 '
@@ -905,7 +905,7 @@ test_expect_success 'push -m shows right message' '
905 >foo &&
906 git add foo &&
907 git stash push -m "test message" &&
908 - echo "stash@{0}: On master: test message" >expect &&
908 + echo "stash@{0}: On main: test message" >expect &&
909 git stash list -1 >actual &&
910 test_cmp expect actual
911 '
@@ -914,7 +914,7 @@ test_expect_success 'push -m also works without space' '
914 >foo &&
915 git add foo &&
916 git stash push -m"unspaced test message" &&
917 - echo "stash@{0}: On master: unspaced test message" >expect &&
917 + echo "stash@{0}: On main: unspaced test message" >expect &&
918 git stash list -1 >actual &&
919 test_cmp expect actual
920 '
@@ -971,7 +971,7 @@ test_expect_success 'push -mfoo uses right message' '
971 >foo &&
972 git add foo &&
973 git stash push -m"test mfoo" &&
974 - echo "stash@{0}: On master: test mfoo" >expect &&
974 + echo "stash@{0}: On main: test mfoo" >expect &&
975 git stash list -1 >actual &&
976 test_cmp expect actual
977 '
@@ -980,7 +980,7 @@ test_expect_success 'push --message foo is synonym for -mfoo' '
980 >foo &&
981 git add foo &&
982 git stash push --message "test message foo" &&
983 - echo "stash@{0}: On master: test message foo" >expect &&
983 + echo "stash@{0}: On main: test message foo" >expect &&
984 git stash list -1 >actual &&
985 test_cmp expect actual
986 '
@@ -989,7 +989,7 @@ test_expect_success 'push --message=foo is synonym for -mfoo' '
989 >foo &&
990 git add foo &&
991 git stash push --message="test message=foo" &&
992 - echo "stash@{0}: On master: test message=foo" >expect &&
992 + echo "stash@{0}: On main: test message=foo" >expect &&
993 git stash list -1 >actual &&
994 test_cmp expect actual
995 '
@@ -998,7 +998,7 @@ test_expect_success 'push -m shows right message' '
998 >foo &&
999 git add foo &&
1000 git stash push -m "test m foo" &&
1001 - echo "stash@{0}: On master: test m foo" >expect &&
1001 + echo "stash@{0}: On main: test m foo" >expect &&
1002 git stash list -1 >actual &&
1003 test_cmp expect actual
1004 '
@@ -1007,7 +1007,7 @@ test_expect_success 'create stores correct message' '
1007 >foo &&
1008 git add foo &&
1009 STASH_ID=$(git stash create "create test message") &&
1010 - echo "On master: create test message" >expect &&
1010 + echo "On main: create test message" >expect &&
1011 git show --pretty=%s -s ${STASH_ID} >actual &&
1012 test_cmp expect actual
1013 '
@@ -1016,13 +1016,13 @@ test_expect_success 'create with multiple arguments for the message' '
1016 >foo &&
1017 git add foo &&
1018 STASH_ID=$(git stash create test untracked) &&
1019 - echo "On master: test untracked" >expect &&
1019 + echo "On main: test untracked" >expect &&
1020 git show --pretty=%s -s ${STASH_ID} >actual &&
1021 test_cmp expect actual
1022 '
1023
1024 test_expect_success 'create in a detached state' '
1025 - test_when_finished "git checkout master" &&
1025 + test_when_finished "git checkout main" &&
1026 git checkout HEAD~1 &&
1027 >foo &&
1028 git add foo &&
t/t3910-mac-os-precompose.sh
+4 -4
@@ -5,7 +5,7 @@
5
6 test_description='utf-8 decomposed (nfd) converted to precomposed (nfc)'
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
@@ -154,7 +154,7 @@ test_expect_success "git checkout link nfd" '
154 git checkout l.$Odiarnfd
155 '
156 test_expect_success "setup case mac2" '
157 - git checkout master &&
157 + git checkout main &&
158 git reset --hard &&
159 git checkout -b mac_os_2
160 '
@@ -166,7 +166,7 @@ test_expect_success "commit file d2.Adiarnfd/f.Adiarnfd" '
166 git commit -m "add d2.$Adiarnfd/f.$Adiarnfd" -- d2.$Adiarnfd/f.$Adiarnfd
167 '
168 test_expect_success "setup for long decomposed filename" '
169 - git checkout master &&
169 + git checkout main &&
170 git reset --hard &&
171 git checkout -b mac_os_long_nfd_fn
172 '
@@ -176,7 +176,7 @@ test_expect_success "Add long decomposed filename" '
176 git commit -m "Long filename"
177 '
178 test_expect_success "setup for long precomposed filename" '
179 - git checkout master &&
179 + git checkout main &&
180 git reset --hard &&
181 git checkout -b mac_os_long_nfc_fn
182 '