Skip to content

Commit d076224

Browse files
committed
Merge branch 'js/no-more-prepare-for-main-in-test'
Test coverage fix. * js/no-more-prepare-for-main-in-test: tests: drop the `PREPARE_FOR_MAIN_BRANCH` prereq t9902: use `main` as initial branch name t6302: use `main` as initial branch name t5703: use `main` as initial branch name t5510: use `main` as initial branch name t5505: finalize transitioning to using the branch name `main` t3205: finalize transitioning to using the branch name `main` t3203: complete the transition to using the branch name `main` t3201: finalize transitioning to using the branch name `main` t3200: finish transitioning to the initial branch name `main` t1400: use `main` as initial branch name
2 parents c46f849 + f17c9da commit d076224

11 files changed

+621
-619
lines changed

t/t1400-update-ref.sh

Lines changed: 38 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ test_description='Test git update-ref and basic ref logging'
88

99
Z=$ZERO_OID
1010

11-
m=refs/heads/master
11+
m=refs/heads/main
1212
n_dir=refs/heads/gu
1313
n=$n_dir/fixes
1414
outside=refs/foo
@@ -27,10 +27,11 @@ create_test_commits ()
2727
}
2828

2929
test_expect_success setup '
30+
git checkout --orphan main &&
3031
create_test_commits "" &&
3132
mkdir $bare &&
3233
cd $bare &&
33-
git init --bare &&
34+
git init --bare -b main &&
3435
create_test_commits "bare" &&
3536
cd -
3637
'
@@ -264,7 +265,7 @@ test_expect_success "(not) changed .git/$m" '
264265
! test $B = $(git show-ref -s --verify $m)
265266
'
266267

267-
rm -f .git/logs/refs/heads/master
268+
rm -f .git/logs/refs/heads/main
268269
test_expect_success "create $m (logged by touch)" '
269270
test_config core.logAllRefUpdates false &&
270271
GIT_COMMITTER_DATE="2005-05-26 23:30" \
@@ -300,7 +301,7 @@ test_expect_success 'symref empty directory removal' '
300301
git branch e1/e2/r1 HEAD &&
301302
git branch e1/r2 HEAD &&
302303
git checkout e1/e2/r1 &&
303-
test_when_finished "git checkout master" &&
304+
test_when_finished "git checkout main" &&
304305
test_path_is_file .git/refs/heads/e1/e2/r1 &&
305306
test_path_is_file .git/logs/refs/heads/e1/e2/r1 &&
306307
git update-ref -d HEAD &&
@@ -364,68 +365,68 @@ test_expect_success 'set up for querying the reflog' '
364365
ed="Thu, 26 May 2005 18:32:00 -0500"
365366
gd="Thu, 26 May 2005 18:33:00 -0500"
366367
ld="Thu, 26 May 2005 18:43:00 -0500"
367-
test_expect_success 'Query "master@{May 25 2005}" (before history)' '
368+
test_expect_success 'Query "main@{May 25 2005}" (before history)' '
368369
test_when_finished "rm -f o e" &&
369-
git rev-parse --verify "master@{May 25 2005}" >o 2>e &&
370+
git rev-parse --verify "main@{May 25 2005}" >o 2>e &&
370371
echo "$C" >expect &&
371372
test_cmp expect o &&
372-
echo "warning: log for '\''master'\'' only goes back to $ed" >expect &&
373+
echo "warning: log for '\''main'\'' only goes back to $ed" >expect &&
373374
test_i18ncmp expect e
374375
'
375-
test_expect_success 'Query master@{2005-05-25} (before history)' '
376+
test_expect_success 'Query main@{2005-05-25} (before history)' '
376377
test_when_finished "rm -f o e" &&
377-
git rev-parse --verify master@{2005-05-25} >o 2>e &&
378+
git rev-parse --verify main@{2005-05-25} >o 2>e &&
378379
echo "$C" >expect &&
379380
test_cmp expect o &&
380-
echo "warning: log for '\''master'\'' only goes back to $ed" >expect &&
381+
echo "warning: log for '\''main'\'' only goes back to $ed" >expect &&
381382
test_i18ncmp expect e
382383
'
383-
test_expect_success 'Query "master@{May 26 2005 23:31:59}" (1 second before history)' '
384+
test_expect_success 'Query "main@{May 26 2005 23:31:59}" (1 second before history)' '
384385
test_when_finished "rm -f o e" &&
385-
git rev-parse --verify "master@{May 26 2005 23:31:59}" >o 2>e &&
386+
git rev-parse --verify "main@{May 26 2005 23:31:59}" >o 2>e &&
386387
echo "$C" >expect &&
387388
test_cmp expect o &&
388-
echo "warning: log for '\''master'\'' only goes back to $ed" >expect &&
389+
echo "warning: log for '\''main'\'' only goes back to $ed" >expect &&
389390
test_i18ncmp expect e
390391
'
391-
test_expect_success 'Query "master@{May 26 2005 23:32:00}" (exactly history start)' '
392+
test_expect_success 'Query "main@{May 26 2005 23:32:00}" (exactly history start)' '
392393
test_when_finished "rm -f o e" &&
393-
git rev-parse --verify "master@{May 26 2005 23:32:00}" >o 2>e &&
394+
git rev-parse --verify "main@{May 26 2005 23:32:00}" >o 2>e &&
394395
echo "$C" >expect &&
395396
test_cmp expect o &&
396397
test_must_be_empty e
397398
'
398-
test_expect_success 'Query "master@{May 26 2005 23:32:30}" (first non-creation change)' '
399+
test_expect_success 'Query "main@{May 26 2005 23:32:30}" (first non-creation change)' '
399400
test_when_finished "rm -f o e" &&
400-
git rev-parse --verify "master@{May 26 2005 23:32:30}" >o 2>e &&
401+
git rev-parse --verify "main@{May 26 2005 23:32:30}" >o 2>e &&
401402
echo "$A" >expect &&
402403
test_cmp expect o &&
403404
test_must_be_empty e
404405
'
405-
test_expect_success 'Query "master@{2005-05-26 23:33:01}" (middle of history with gap)' '
406+
test_expect_success 'Query "main@{2005-05-26 23:33:01}" (middle of history with gap)' '
406407
test_when_finished "rm -f o e" &&
407-
git rev-parse --verify "master@{2005-05-26 23:33:01}" >o 2>e &&
408+
git rev-parse --verify "main@{2005-05-26 23:33:01}" >o 2>e &&
408409
echo "$B" >expect &&
409410
test_cmp expect o &&
410411
test_i18ngrep -F "warning: log for ref $m has gap after $gd" e
411412
'
412-
test_expect_success 'Query "master@{2005-05-26 23:38:00}" (middle of history)' '
413+
test_expect_success 'Query "main@{2005-05-26 23:38:00}" (middle of history)' '
413414
test_when_finished "rm -f o e" &&
414-
git rev-parse --verify "master@{2005-05-26 23:38:00}" >o 2>e &&
415+
git rev-parse --verify "main@{2005-05-26 23:38:00}" >o 2>e &&
415416
echo "$Z" >expect &&
416417
test_cmp expect o &&
417418
test_must_be_empty e
418419
'
419-
test_expect_success 'Query "master@{2005-05-26 23:43:00}" (exact end of history)' '
420+
test_expect_success 'Query "main@{2005-05-26 23:43:00}" (exact end of history)' '
420421
test_when_finished "rm -f o e" &&
421-
git rev-parse --verify "master@{2005-05-26 23:43:00}" >o 2>e &&
422+
git rev-parse --verify "main@{2005-05-26 23:43:00}" >o 2>e &&
422423
echo "$E" >expect &&
423424
test_cmp expect o &&
424425
test_must_be_empty e
425426
'
426-
test_expect_success 'Query "master@{2005-05-28}" (past end of history)' '
427+
test_expect_success 'Query "main@{2005-05-28}" (past end of history)' '
427428
test_when_finished "rm -f o e" &&
428-
git rev-parse --verify "master@{2005-05-28}" >o 2>e &&
429+
git rev-parse --verify "main@{2005-05-28}" >o 2>e &&
429430
echo "$D" >expect &&
430431
test_cmp expect o &&
431432
test_i18ngrep -F "warning: log for ref $m unexpectedly ended on $ld" e
@@ -467,14 +468,14 @@ test_expect_success 'git commit logged updates' '
467468
'
468469
unset h_TEST h_OTHER h_FIXED h_MERGED
469470

470-
test_expect_success 'git cat-file blob master:F (expect OTHER)' '
471-
test OTHER = $(git cat-file blob master:F)
471+
test_expect_success 'git cat-file blob main:F (expect OTHER)' '
472+
test OTHER = $(git cat-file blob main:F)
472473
'
473-
test_expect_success 'git cat-file blob master@{2005-05-26 23:30}:F (expect TEST)' '
474-
test TEST = $(git cat-file blob "master@{2005-05-26 23:30}:F")
474+
test_expect_success 'git cat-file blob main@{2005-05-26 23:30}:F (expect TEST)' '
475+
test TEST = $(git cat-file blob "main@{2005-05-26 23:30}:F")
475476
'
476-
test_expect_success 'git cat-file blob master@{2005-05-26 23:42}:F (expect OTHER)' '
477-
test OTHER = $(git cat-file blob "master@{2005-05-26 23:42}:F")
477+
test_expect_success 'git cat-file blob main@{2005-05-26 23:42}:F (expect OTHER)' '
478+
test OTHER = $(git cat-file blob "main@{2005-05-26 23:42}:F")
478479
'
479480

480481
# Test adding and deleting pseudorefs
@@ -586,21 +587,21 @@ test_expect_success 'stdin fails on unknown command' '
586587
'
587588

588589
test_expect_success 'stdin fails on unbalanced quotes' '
589-
echo "create $a \"master" >stdin &&
590+
echo "create $a \"main" >stdin &&
590591
test_must_fail git update-ref --stdin <stdin 2>err &&
591-
grep "fatal: badly quoted argument: \\\"master" err
592+
grep "fatal: badly quoted argument: \\\"main" err
592593
'
593594

594-
test_expect_success PREPARE_FOR_MAIN_BRANCH 'stdin fails on invalid escape' '
595+
test_expect_success 'stdin fails on invalid escape' '
595596
echo "create $a \"ma\zn\"" >stdin &&
596597
test_must_fail git update-ref --stdin <stdin 2>err &&
597598
grep "fatal: badly quoted argument: \\\"ma\\\\zn\\\"" err
598599
'
599600

600601
test_expect_success 'stdin fails on junk after quoted argument' '
601-
echo "create \"$a\"master" >stdin &&
602+
echo "create \"$a\"main" >stdin &&
602603
test_must_fail git update-ref --stdin <stdin 2>err &&
603-
grep "fatal: unexpected character after quoted argument: \\\"$a\\\"master" err
604+
grep "fatal: unexpected character after quoted argument: \\\"$a\\\"main" err
604605
'
605606

606607
test_expect_success 'stdin fails create with no ref' '
@@ -710,7 +711,7 @@ test_expect_success 'stdin succeeds with quoted argument' '
710711
test_cmp expect actual
711712
'
712713

713-
test_expect_success PREPARE_FOR_MAIN_BRANCH 'stdin succeeds with escaped character' '
714+
test_expect_success 'stdin succeeds with escaped character' '
714715
git update-ref -d $a &&
715716
echo "create $a \"ma\\151n\"" >stdin &&
716717
git update-ref --stdin <stdin &&

0 commit comments

Comments
 (0)