tests: drop prereq `PREPARE_FOR_MAIN_BRANCH` where no longer needed
We introduced the `PREPARE_FOR_MAIN_BRANCH` prereq for the sole purpose of allowing us to perform the non-trivial adjustments regarding the `master` -> `main` rename before the automatable ones. Now that the transition is almost complete, we can stop using it in most instances. The only two exceptions are t5526 and t9902: at the time of writing, there are other patches in flight that touch these test scripts, therefore their transition to `main` is postponed to a later date. This patch is the result of this command: sed -i 's/PREPARE_FOR_MAIN_BRANCH[ ,]//' t/t[0-9]*.sh && git checkout HEAD -- t/t5526\* t/t9902\* 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
8b70966aa90b52427e1a09329abde8d845f90398
9 files changed
+21
-21
t/t1400-update-ref.sh
+2
-2
@@ -588,7 +588,7 @@ test_expect_success 'stdin fails on unbalanced quotes' '
588
grep "fatal: badly quoted argument: \\\"main" err
589
'
590
591
-test_expect_success PREPARE_FOR_MAIN_BRANCH 'stdin fails on invalid escape' '
591
+test_expect_success 'stdin fails on invalid escape' '
592
echo "create $a \"ma\zn\"" >stdin &&
593
test_must_fail git update-ref --stdin <stdin 2>err &&
594
grep "fatal: badly quoted argument: \\\"ma\\\\zn\\\"" err
@@ -707,7 +707,7 @@ test_expect_success 'stdin succeeds with quoted argument' '
707
test_cmp expect actual
708
'
709
710
-test_expect_success PREPARE_FOR_MAIN_BRANCH 'stdin succeeds with escaped character' '
710
+test_expect_success 'stdin succeeds with escaped character' '
711
git update-ref -d $a &&
712
echo "create $a \"ma\\151n\"" >stdin &&
713
git update-ref --stdin <stdin &&
t/t3200-branch.sh
+3
-3
@@ -324,7 +324,7 @@ test_expect_success 'git branch --list -v with --abbrev' '
324
325
'
326
327
-test_expect_success PREPARE_FOR_MAIN_BRANCH 'git branch --column' '
327
+test_expect_success 'git branch --column' '
328
COLUMNS=81 git branch --column=column >actual &&
329
cat >expect <<\EOF &&
330
a/b/c bam foo l * main n o/p r
@@ -361,7 +361,7 @@ EOF
361
test_cmp expect actual
362
'
363
364
-test_expect_success PREPARE_FOR_MAIN_BRANCH 'git branch with column.*' '
364
+test_expect_success 'git branch with column.*' '
365
git config column.ui column &&
366
git config column.branch "dense" &&
367
COLUMNS=80 git branch >actual &&
@@ -378,7 +378,7 @@ test_expect_success 'git branch --column -v should fail' '
378
test_must_fail git branch --column -v
379
'
380
381
-test_expect_success PREPARE_FOR_MAIN_BRANCH 'git branch -v with column.ui ignored' '
381
+test_expect_success 'git branch -v with column.ui ignored' '
382
git config column.ui column &&
383
COLUMNS=80 git branch -v | cut -c -8 | sed "s/ *$//" >actual &&
384
git config --unset column.ui &&
t/t3201-branch-contains.sh
+1
-1
@@ -245,7 +245,7 @@ test_expect_success 'branch --merged combined with --no-merged' '
245
# Here "topic" tracks "main" with one extra commit, and "zzz" points to the
246
# same tip as main The name "zzz" must come alphabetically after "topic"
247
# as we process them in that order.
248
-test_expect_success PREPARE_FOR_MAIN_BRANCH 'branch --merged with --verbose' '
248
+test_expect_success 'branch --merged with --verbose' '
249
git branch --track topic main &&
250
git branch zzz topic &&
251
git checkout topic &&
t/t3203-branch-output.sh
+1
-1
@@ -332,7 +332,7 @@ test_expect_success '--color overrides auto-color' '
332
test_cmp expect.color actual
333
'
334
335
-test_expect_success PREPARE_FOR_MAIN_BRANCH 'verbose output lists worktree path' '
335
+test_expect_success 'verbose output lists worktree path' '
336
one=$(git rev-parse --short HEAD) &&
337
two=$(git rev-parse --short main) &&
338
cat >expect <<-EOF &&
t/t3205-branch-color.sh
+1
-1
@@ -31,7 +31,7 @@ test_expect_success 'regular output shows colors' '
31
test_cmp expect actual
32
'
33
34
-test_expect_success PREPARE_FOR_MAIN_BRANCH 'verbose output shows colors' '
34
+test_expect_success 'verbose output shows colors' '
35
oid=$(git rev-parse --short HEAD) &&
36
cat >expect <<-EOF &&
37
* <CYAN>main <RESET> $oid foo
t/t5505-remote.sh
+4
-4
@@ -237,7 +237,7 @@ cat >test/expect <<EOF
237
main pushes to another (up to date)
238
EOF
239
240
-test_expect_success PREPARE_FOR_MAIN_BRANCH 'show' '
240
+test_expect_success 'show' '
241
(
242
cd test &&
243
git config --add remote.origin.fetch refs/heads/main:refs/heads/upstream &&
@@ -288,7 +288,7 @@ cat >test/expect <<EOF
288
refs/tags/lastbackup forces to refs/tags/lastbackup
289
EOF
290
291
-test_expect_success PREPARE_FOR_MAIN_BRANCH 'show -n' '
291
+test_expect_success 'show -n' '
292
mv one one.unreachable &&
293
(
294
cd test &&
@@ -331,7 +331,7 @@ test_expect_success 'set-head --auto' '
331
)
332
'
333
334
-test_expect_success PREPARE_FOR_MAIN_BRANCH 'set-head --auto has no problem w/multiple HEADs' '
334
+test_expect_success 'set-head --auto has no problem w/multiple HEADs' '
335
(
336
cd test &&
337
git fetch two "refs/heads/*:refs/remotes/two/*" &&
@@ -1351,7 +1351,7 @@ test_expect_success 'unqualified <dst> refspec DWIM and advice' '
1351
)
1352
'
1353
1354
-test_expect_success PREPARE_FOR_MAIN_BRANCH 'refs/remotes/* <src> refspec and unqualified <dst> DWIM and advice' '
1354
+test_expect_success 'refs/remotes/* <src> refspec and unqualified <dst> DWIM and advice' '
1355
(
1356
cd two &&
1357
git tag -a -m "Some tag" my-tag main &&
t/t5510-fetch.sh
+2
-2
@@ -945,7 +945,7 @@ test_expect_success 'fetching with auto-gc does not lock up' '
945
)
946
'
947
948
-test_expect_success PREPARE_FOR_MAIN_BRANCH,C_LOCALE_OUTPUT 'fetch aligned output' '
948
+test_expect_success C_LOCALE_OUTPUT 'fetch aligned output' '
949
git clone . full-output &&
950
test_commit looooooooooooong-tag &&
951
(
@@ -960,7 +960,7 @@ test_expect_success PREPARE_FOR_MAIN_BRANCH,C_LOCALE_OUTPUT 'fetch aligned outpu
960
test_cmp expect actual
961
'
962
963
-test_expect_success PREPARE_FOR_MAIN_BRANCH,C_LOCALE_OUTPUT 'fetch compact output' '
963
+test_expect_success C_LOCALE_OUTPUT 'fetch compact output' '
964
git clone . compact &&
965
test_commit extraaa &&
966
(
t/t5703-upload-pack-ref-in-want.sh
+1
-1
@@ -386,7 +386,7 @@ test_expect_success 'server is initially behind - ref in want' '
386
test_cmp expected actual
387
'
388
389
-test_expect_success PREPARE_FOR_MAIN_BRANCH 'server loses a ref - ref in want' '
389
+test_expect_success 'server loses a ref - ref in want' '
390
git -C "$REPO" config uploadpack.allowRefInWant true &&
391
rm -rf local &&
392
cp -r "$LOCAL_PRISTINE" local &&
t/t6302-for-each-ref-filter.sh
+6
-6
@@ -116,7 +116,7 @@ test_expect_success '%(color) must fail' '
116
test_must_fail git for-each-ref --format="%(color)%(refname)"
117
'
118
119
-test_expect_success PREPARE_FOR_MAIN_BRANCH 'left alignment is default' '
119
+test_expect_success 'left alignment is default' '
120
cat >expect <<-\EOF &&
121
refname is refs/heads/main |refs/heads/main
122
refname is refs/heads/side |refs/heads/side
@@ -134,7 +134,7 @@ test_expect_success PREPARE_FOR_MAIN_BRANCH 'left alignment is default' '
134
test_cmp expect actual
135
'
136
137
-test_expect_success PREPARE_FOR_MAIN_BRANCH 'middle alignment' '
137
+test_expect_success 'middle alignment' '
138
cat >expect <<-\EOF &&
139
| refname is refs/heads/main |refs/heads/main
140
| refname is refs/heads/side |refs/heads/side
@@ -152,7 +152,7 @@ test_expect_success PREPARE_FOR_MAIN_BRANCH 'middle alignment' '
152
test_cmp expect actual
153
'
154
155
-test_expect_success PREPARE_FOR_MAIN_BRANCH 'right alignment' '
155
+test_expect_success 'right alignment' '
156
cat >expect <<-\EOF &&
157
| refname is refs/heads/main|refs/heads/main
158
| refname is refs/heads/side|refs/heads/side
@@ -187,7 +187,7 @@ EOF
187
test_align_permutations() {
188
while read -r option
189
do
190
- test_expect_success PREPARE_FOR_MAIN_BRANCH "align:$option" '
190
+ test_expect_success "align:$option" '
191
git for-each-ref --format="|%(align:$option)refname is %(refname)%(end)|%(refname)" >actual &&
192
test_cmp expect actual
193
'
@@ -216,7 +216,7 @@ EOF
216
217
# Individual atoms inside %(align:...) and %(end) must not be quoted.
218
219
-test_expect_success PREPARE_FOR_MAIN_BRANCH 'alignment with format quote' "
219
+test_expect_success 'alignment with format quote' "
220
cat >expect <<-\EOF &&
221
|' '\''main| A U Thor'\'' '|
222
|' '\''side| A U Thor'\'' '|
@@ -234,7 +234,7 @@ test_expect_success PREPARE_FOR_MAIN_BRANCH 'alignment with format quote' "
234
test_cmp expect actual
235
"
236
237
-test_expect_success PREPARE_FOR_MAIN_BRANCH 'nested alignment with quote formatting' "
237
+test_expect_success 'nested alignment with quote formatting' "
238
cat >expect <<-\EOF &&
239
|' main '|
240
|' side '|