@@ -10,51 +10,52 @@ test_expect_success setup '
10
10
git add file &&
11
11
test_tick &&
12
12
git commit -m initial &&
13
+ git branch -M main &&
13
14
git branch side &&
14
15
15
16
echo 1 >file &&
16
17
test_tick &&
17
- git commit -a -m "second on master " &&
18
+ git commit -a -m "second on main " &&
18
19
19
20
git checkout side &&
20
21
echo 1 >file &&
21
22
test_tick &&
22
23
git commit -a -m "second on side" &&
23
24
24
- git merge master
25
+ git merge main
25
26
26
27
'
27
28
28
- test_expect_success ' branch --contains=master ' '
29
+ test_expect_success ' branch --contains=main ' '
29
30
30
- git branch --contains=master >actual &&
31
+ git branch --contains=main >actual &&
31
32
{
32
- echo " master " && echo "* side"
33
+ echo " main " && echo "* side"
33
34
} >expect &&
34
35
test_cmp expect actual
35
36
36
37
'
37
38
38
- test_expect_success ' branch --contains master ' '
39
+ test_expect_success ' branch --contains main ' '
39
40
40
- git branch --contains master >actual &&
41
+ git branch --contains main >actual &&
41
42
{
42
- echo " master " && echo "* side"
43
+ echo " main " && echo "* side"
43
44
} >expect &&
44
45
test_cmp expect actual
45
46
46
47
'
47
48
48
- test_expect_success ' branch --no-contains=master ' '
49
+ test_expect_success ' branch --no-contains=main ' '
49
50
50
- git branch --no-contains=master >actual &&
51
+ git branch --no-contains=main >actual &&
51
52
test_must_be_empty actual
52
53
53
54
'
54
55
55
- test_expect_success ' branch --no-contains master ' '
56
+ test_expect_success ' branch --no-contains main ' '
56
57
57
- git branch --no-contains master >actual &&
58
+ git branch --no-contains main >actual &&
58
59
test_must_be_empty actual
59
60
60
61
'
@@ -73,25 +74,25 @@ test_expect_success 'branch --no-contains=side' '
73
74
74
75
git branch --no-contains=side >actual &&
75
76
{
76
- echo " master "
77
+ echo " main "
77
78
} >expect &&
78
79
test_cmp expect actual
79
80
80
81
'
81
82
82
83
test_expect_success ' branch --contains with pattern implies --list' '
83
84
84
- git branch --contains=master master >actual &&
85
+ git branch --contains=main main >actual &&
85
86
{
86
- echo " master "
87
+ echo " main "
87
88
} >expect &&
88
89
test_cmp expect actual
89
90
90
91
'
91
92
92
93
test_expect_success ' branch --no-contains with pattern implies --list' '
93
94
94
- git branch --no-contains=master master >actual &&
95
+ git branch --no-contains=main main >actual &&
95
96
test_must_be_empty actual
96
97
97
98
'
@@ -100,7 +101,7 @@ test_expect_success 'side: branch --merged' '
100
101
101
102
git branch --merged >actual &&
102
103
{
103
- echo " master " &&
104
+ echo " main " &&
104
105
echo "* side"
105
106
} >expect &&
106
107
test_cmp expect actual
@@ -109,9 +110,9 @@ test_expect_success 'side: branch --merged' '
109
110
110
111
test_expect_success ' branch --merged with pattern implies --list' '
111
112
112
- git branch --merged=side master >actual &&
113
+ git branch --merged=side main >actual &&
113
114
{
114
- echo " master "
115
+ echo " main "
115
116
} >expect &&
116
117
test_cmp expect actual
117
118
@@ -124,18 +125,18 @@ test_expect_success 'side: branch --no-merged' '
124
125
125
126
'
126
127
127
- test_expect_success ' master : branch --merged' '
128
+ test_expect_success ' main : branch --merged' '
128
129
129
- git checkout master &&
130
+ git checkout main &&
130
131
git branch --merged >actual &&
131
132
{
132
- echo "* master "
133
+ echo "* main "
133
134
} >expect &&
134
135
test_cmp expect actual
135
136
136
137
'
137
138
138
- test_expect_success ' master : branch --no-merged' '
139
+ test_expect_success ' main : branch --no-merged' '
139
140
140
141
git branch --no-merged >actual &&
141
142
{
@@ -147,22 +148,22 @@ test_expect_success 'master: branch --no-merged' '
147
148
148
149
test_expect_success ' branch --no-merged with pattern implies --list' '
149
150
150
- git branch --no-merged=master master >actual &&
151
+ git branch --no-merged=main main >actual &&
151
152
test_must_be_empty actual
152
153
153
154
'
154
155
155
156
test_expect_success ' implicit --list conflicts with modification options' '
156
157
157
- test_must_fail git branch --contains=master -d &&
158
- test_must_fail git branch --contains=master -m foo &&
159
- test_must_fail git branch --no-contains=master -d &&
160
- test_must_fail git branch --no-contains=master -m foo
158
+ test_must_fail git branch --contains=main -d &&
159
+ test_must_fail git branch --contains=main -m foo &&
160
+ test_must_fail git branch --no-contains=main -d &&
161
+ test_must_fail git branch --no-contains=main -m foo
161
162
162
163
'
163
164
164
165
test_expect_success ' Assert that --contains only works on commits, not trees & blobs' '
165
- test_must_fail git branch --contains master ^{tree} &&
166
+ test_must_fail git branch --contains main ^{tree} &&
166
167
blob=$(git hash-object -w --stdin <<-\EOF
167
168
Some blob
168
169
EOF
@@ -172,11 +173,11 @@ test_expect_success 'Assert that --contains only works on commits, not trees & b
172
173
'
173
174
174
175
test_expect_success ' multiple branch --contains' '
175
- git checkout -b side2 master &&
176
+ git checkout -b side2 main &&
176
177
>feature &&
177
178
git add feature &&
178
179
git commit -m "add feature" &&
179
- git checkout -b next master &&
180
+ git checkout -b next main &&
180
181
git merge side &&
181
182
git branch --contains side --contains side2 >actual &&
182
183
cat >expect <<-\EOF &&
@@ -188,9 +189,9 @@ test_expect_success 'multiple branch --contains' '
188
189
'
189
190
190
191
test_expect_success ' multiple branch --merged' '
191
- git branch --merged next --merged master >actual &&
192
+ git branch --merged next --merged main >actual &&
192
193
cat >expect <<-\EOF &&
193
- master
194
+ main
194
195
* next
195
196
side
196
197
EOF
@@ -200,21 +201,21 @@ test_expect_success 'multiple branch --merged' '
200
201
test_expect_success ' multiple branch --no-contains' '
201
202
git branch --no-contains side --no-contains side2 >actual &&
202
203
cat >expect <<-\EOF &&
203
- master
204
+ main
204
205
EOF
205
206
test_cmp expect actual
206
207
'
207
208
208
209
test_expect_success ' multiple branch --no-merged' '
209
- git branch --no-merged next --no-merged master >actual &&
210
+ git branch --no-merged next --no-merged main >actual &&
210
211
cat >expect <<-\EOF &&
211
212
side2
212
213
EOF
213
214
test_cmp expect actual
214
215
'
215
216
216
217
test_expect_success ' branch --contains combined with --no-contains' '
217
- git checkout -b seen master &&
218
+ git checkout -b seen main &&
218
219
git merge side &&
219
220
git merge side2 &&
220
221
git branch --contains side --no-contains side2 >actual &&
@@ -239,17 +240,17 @@ test_expect_success 'branch --merged combined with --no-merged' '
239
240
# that the latter walk does not mess up our flag to see if it was
240
241
# merged).
241
242
#
242
- # Here "topic" tracks "master " with one extra commit, and "zzz" points to the
243
- # same tip as master The name "zzz" must come alphabetically after "topic"
243
+ # Here "topic" tracks "main " with one extra commit, and "zzz" points to the
244
+ # same tip as main The name "zzz" must come alphabetically after "topic"
244
245
# as we process them in that order.
245
- test_expect_success PREPARE_FOR_MAIN_BRANCH ' branch --merged with --verbose' '
246
- git branch --track topic master &&
246
+ test_expect_success ' branch --merged with --verbose' '
247
+ git branch --track topic main &&
247
248
git branch zzz topic &&
248
249
git checkout topic &&
249
250
test_commit foo &&
250
251
git branch --merged topic >actual &&
251
252
cat >expect <<-\EOF &&
252
- master
253
+ main
253
254
* topic
254
255
zzz
255
256
EOF
0 commit comments