git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 00/28] Use main as default branch name
@ 2020-11-12 22:43 Johannes Schindelin via GitGitGadget
  2020-11-12 22:43 ` [PATCH 01/28] t0060: preemptively adjust alignment Johannes Schindelin via GitGitGadget
                   ` (32 more replies)
  0 siblings, 33 replies; 163+ messages in thread
From: Johannes Schindelin via GitGitGadget @ 2020-11-12 22:43 UTC (permalink / raw)
  To: git; +Cc: Johannes Schindelin

This is the big one. This changes the default of init.defaultBranch to main,
reflecting what many open source projects already did (which was followed by
GitHub, Azure Repos and others).

Instead of one huge patch that reflects essentially a search-and-replace in
the test suite, this patch series splits the changes up into chunks that are
intended to be smaller than 100kB so that they are not rejected by the Git
mailing list. Interspersed between those changes are adjustments e.g. in
alignment, to make it easier to review (or recreate) the search-and-replace
patches.

Note that this branch is based on next, mostly because it would otherwise
conflict with en/merge-tests, jk/diff-release-filespec-fix and 
ds/maintenance-part-3.

The semantic conflict with pk/subsub-fetch-fix consists of just a single
line in t/t5526-fetch-submodules.sh needing s/master/main/g.

To avoid even more conflicts with topics that did not even make it to seen 
yet, this patch series specifically excludes t3404, t4013, t5310, t6300,
t7064, t7817, t9902: in those test scripts, we will still use master for the
time being. Once the topics in question have settled, I will send the
appropriate follow-up patches to adjust them to use main instead.

Don Goodman-Wilson (1):
  Change the default branch name to `main`

Johannes Schindelin (27):
  t0060: preemptively adjust alignment
  t[01]*: adjust the references to the default branch name "main"
  t2*: adjust the references to the default branch name "main"
  t3[0-3]*: adjust the references to the default branch name "main"
  t3416: preemptively adjust alignment in a comment
  t34*: adjust the references to the default branch name "main"
  t3[5-9]*: adjust the references to the default branch name "main"
  t4*: adjust the references to the default branch name "main"
  t5323: prepare centered comment for `master` -> `main`
  t5[0-4]*: adjust the references to the default branch name "main"
  t5503: prepare aligned comment for replacing `master` with `main`
  t550*: adjust the references to the default branch name "main"
  t551*: adjust the references to the default branch name "main"
  t55[23]*: adjust the references to the default branch name "main"
  t55[4-9]*: adjust the references to the default branch name "main"
  t5[6-9]*: adjust the references to the default branch name "main"
  t6[0-3]*: adjust the references to the default branch name "main"
  t64*: preemptively adjust alignment to prepare for `master` -> `main`
  t6[4-9]*: adjust the references to the default branch name "main"
  t7[0-4]*: adjust the references to the default branch name "main"
  t7[5-9]*: adjust the references to the default branch name "main"
  t8*: adjust the references to the default branch name "main"
  t9[0-4]*: adjust the references to the default branch name "main"
  t9[5-7]*: adjust the references to the default branch name "main"
  tests(git-p4): transition to the default branch name `main`
  t99*: adjust the references to the default branch name "main"
  tests: drop prereq `PREPARE_FOR_MAIN_BRANCH` where no longer needed

 refs.c                                        |   2 +-
 t/annotate-tests.sh                           |   8 +-
 t/lib-cvs.sh                                  |   2 +-
 t/lib-submodule-update.sh                     |   2 +-
 t/t0002-gitfile.sh                            |   6 +-
 t/t0020-crlf.sh                               |   8 +-
 t/t0021-conversion.sh                         |  40 +-
 t/t0027-auto-crlf.sh                          |   4 +-
 t/t0028-working-tree-encoding.sh              |   4 +-
 t/t0041-usage.sh                              |  10 +-
 t/t0050-filesystem.sh                         |   6 +-
 t/t0060-path-utils.sh                         |   4 +-
 t/t0100-previous.sh                           |  18 +-
 t/t1004-read-tree-m-u-wf.sh                   |  40 +-
 t/t1008-read-tree-overlay.sh                  |   2 +-
 t/t1009-read-tree-new-index.sh                |   4 +-
 t/t1011-read-tree-sparse-checkout.sh          |   2 +-
 t/t1021-rerere-in-workdir.sh                  |   2 +-
 t/t1090-sparse-checkout-scope.sh              |  10 +-
 t/t1091-sparse-checkout-builtin.sh            |   2 +-
 t/t1300-config.sh                             |   8 +-
 t/t1301-shared-repo.sh                        |   4 +-
 t/t1305-config-include.sh                     |   2 +-
 t/t1309-early-config.sh                       |   4 +-
 t/t1400-update-ref.sh                         |  72 +--
 t/t1402-check-ref-format.sh                   |  28 +-
 t/t1403-show-ref.sh                           |  18 +-
 t/t1405-main-ref-store.sh                     |  42 +-
 t/t1406-submodule-ref-store.sh                |  30 +-
 t/t1407-worktree-ref-store.sh                 |  32 +-
 t/t1408-packed-refs.sh                        |  12 +-
 t/t1410-reflog.sh                             |  56 +-
 t/t1411-reflog-show.sh                        |   2 +-
 t/t1413-reflog-detach.sh                      |  24 +-
 t/t1414-reflog-walk.sh                        |  12 +-
 t/t1416-ref-transaction-hooks.sh              |  10 +-
 t/t1430-bad-ref-name.sh                       |  52 +-
 t/t1450-fsck.sh                               |   2 +-
 t/t1500-rev-parse.sh                          |   4 +-
 t/t1503-rev-parse-verify.sh                   |  28 +-
 t/t1505-rev-parse-last.sh                     |   8 +-
 t/t1506-rev-parse-diagnosis.sh                |   4 +-
 t/t1507-rev-parse-upstream.sh                 |  40 +-
 t/t1508-at-combinations.sh                    |  10 +-
 t/t1511-rev-parse-caret.sh                    |  26 +-
 t/t1512-rev-parse-disambiguation.sh           |   2 +-
 t/t1513-rev-parse-prefix.sh                   |   4 +-
 t/t1514-rev-parse-push.sh                     |  16 +-
 t/t1700-split-index.sh                        |   2 +-
 t/t2007-checkout-symlink.sh                   |  10 +-
 t/t2009-checkout-statinfo.sh                  |   8 +-
 t/t2010-checkout-ambiguous.sh                 |   4 +-
 t/t2011-checkout-invalid-head.sh              |  16 +-
 t/t2012-checkout-last.sh                      |  48 +-
 t/t2015-checkout-unborn.sh                    |   2 +-
 t/t2017-checkout-orphan.sh                    |  44 +-
 t/t2020-checkout-detach.sh                    |  28 +-
 t/t2022-checkout-paths.sh                     |  22 +-
 t/t2023-checkout-m.sh                         |  10 +-
 t/t2024-checkout-dwim.sh                      |  70 +--
 t/t2027-checkout-track.sh                     |   6 +-
 t/t2030-unresolve-info.sh                     |   6 +-
 t/t2060-switch.sh                             |  30 +-
 t/t2070-restore.sh                            |   4 +-
 t/t2106-update-index-assume-unchanged.sh      |   2 +-
 t/t2400-worktree-add.sh                       |  66 +--
 t/t2401-worktree-prune.sh                     |   2 +-
 t/t2402-worktree-list.sh                      |  20 +-
 t/t2405-worktree-submodule.sh                 |   6 +-
 t/t3040-subprojects-basic.sh                  |   2 +-
 t/t3200-branch.sh                             | 248 ++++-----
 t/t3201-branch-contains.sh                    |  82 +--
 t/t3202-show-branch-octopus.sh                |   2 +-
 t/t3203-branch-output.sh                      |  40 +-
 t/t3204-branch-name-interpretation.sh         |   6 +-
 t/t3205-branch-color.sh                       |   8 +-
 t/t3206-range-diff.sh                         |  40 +-
 t/t3206/history.export                        |   2 +-
 t/t3210-pack-refs.sh                          |   4 +-
 t/t3211-peel-ref.sh                           |   4 +-
 t/t3301-notes.sh                              |   6 +-
 t/t3302-notes-index-expensive.sh              |   2 +-
 t/t3303-notes-subtrees.sh                     |   8 +-
 t/t3304-notes-mixed.sh                        |   8 +-
 t/t3308-notes-merge.sh                        |   2 +-
 t/t3320-notes-merge-worktrees.sh              |   4 +-
 t/t3400-rebase.sh                             |  60 +--
 t/t3402-rebase-merge.sh                       |  44 +-
 t/t3403-rebase-skip.sh                        |   6 +-
 t/t3405-rebase-malformed.sh                   |   8 +-
 t/t3406-rebase-message.sh                     |  24 +-
 t/t3407-rebase-abort.sh                       |  18 +-
 t/t3408-rebase-multi-line.sh                  |   2 +-
 t/t3409-rebase-preserve-merges.sh             |  10 +-
 t/t3412-rebase-root.sh                        |  28 +-
 t/t3413-rebase-hook.sh                        |  42 +-
 t/t3415-rebase-autosquash.sh                  |   2 +-
 t/t3416-rebase-onto-threedots.sh              |  54 +-
 t/t3418-rebase-continue.sh                    |  24 +-
 t/t3419-rebase-patch-id.sh                    |  12 +-
 t/t3420-rebase-autostash.sh                   |   8 +-
 t/t3423-rebase-reword.sh                      |   6 +-
 t/t3427-rebase-subtree.sh                     |  20 +-
 t/t3430-rebase-merges.sh                      |  16 +-
 t/t3431-rebase-fork-point.sh                  |  32 +-
 t/t3432-rebase-fast-forward.sh                |  34 +-
 t/t3434-rebase-i18n.sh                        |   8 +-
 t/t3435-rebase-gpg-sign.sh                    |   4 +-
 t/t3436-rebase-more-options.sh                |   2 +-
 t/t3500-cherry.sh                             |  12 +-
 t/t3501-revert-cherry-pick.sh                 |   4 +-
 t/t3502-cherry-pick-merge.sh                  |   2 +-
 t/t3503-cherry-pick-root.sh                   |  10 +-
 t/t3504-cherry-pick-rerere.sh                 |  24 +-
 t/t3505-cherry-pick-empty.sh                  |  24 +-
 t/t3506-cherry-pick-ff.sh                     |   8 +-
 t/t3507-cherry-pick-conflict.sh               |   2 +-
 t/t3508-cherry-pick-many-commits.sh           |  38 +-
 t/t3509-cherry-pick-merge-df.sh               |   2 +-
 t/t3512-cherry-pick-submodule.sh              |   2 +-
 t/t3600-rm.sh                                 |  10 +-
 t/t3701-add-interactive.sh                    |   4 +-
 t/t3901-i18n-patch.sh                         |  40 +-
 t/t3903-stash.sh                              |  32 +-
 t/t3910-mac-os-precompose.sh                  |   6 +-
 t/t4014-format-patch.sh                       | 176 +++---
 t/t4015-diff-whitespace.sh                    |   2 +-
 t/t4017-diff-retval.sh                        |   2 +-
 t/t4038-diff-combined.sh                      |  14 +-
 t/t4041-diff-submodule-option.sh              |   2 +-
 t/t4048-diff-combined-binary.sh               |  10 +-
 t/t4052-stat-output.sh                        |   4 +-
 t/t4056-diff-order.sh                         |   2 +-
 t/t4057-diff-combined-paths.sh                |  20 +-
 t/t4061-diff-indent.sh                        |  24 +-
 t/t4066-diff-emit-delay.sh                    |   2 +-
 t/t4068-diff-symmetric-merge-base.sh          |  48 +-
 t/t4103-apply-binary.sh                       |  36 +-
 t/t4108-apply-threeway.sh                     |  14 +-
 t/t4121-apply-diffs.sh                        |   2 +-
 t/t4122-apply-symlink-inside.sh               |   6 +-
 t/t4150-am.sh                                 |  26 +-
 t/t4200-rerere.sh                             |  20 +-
 t/t4201-shortlog.sh                           |   2 +-
 t/t4202-log.sh                                | 106 ++--
 t/t4203-mailmap.sh                            |   2 +-
 t/t4204-patch-id.sh                           |  26 +-
 t/t4207-log-decoration-colors.sh              |   6 +-
 t/t4208-log-magic-pathspec.sh                 |   4 +-
 t/t4211/history.export                        |   2 +-
 t/t4214-log-graph-octopus.sh                  |   2 +-
 t/t4216-log-bloom.sh                          |   4 +-
 t/t4253-am-keep-cr-dos.sh                     |  20 +-
 t/t4257-am-interactive.sh                     |   2 +-
 t/t5150-request-pull.sh                       |  34 +-
 t/t5304-prune.sh                              |   2 +-
 t/t5305-include-tag.sh                        |   2 +-
 t/t5312-prune-corruption.sh                   |  16 +-
 t/t5317-pack-objects-filter-objects.sh        |   2 +-
 t/t5322-pack-objects-sparse.sh                |   2 +-
 t/t5323-pack-redundant.sh                     |  66 +--
 t/t5400-send-pack.sh                          |  60 +--
 t/t5401-update-hooks.sh                       |  24 +-
 t/t5402-post-merge-hook.sh                    |   2 +-
 t/t5403-post-checkout-hook.sh                 |   6 +-
 t/t5404-tracking-branches.sh                  |   8 +-
 t/t5405-send-pack-rewind.sh                   |   6 +-
 t/t5407-post-rewrite-hook.sh                  |   2 +-
 t/t5410-receive-pack-alternates.sh            |   4 +-
 t/t5500-fetch-pack.sh                         |  28 +-
 t/t5501-fetch-push-alternates.sh              |   4 +-
 t/t5502-quickfetch.sh                         |   6 +-
 t/t5503-tagfollow.sh                          |  12 +-
 t/t5504-fetch-receive-strict.sh               |  20 +-
 t/t5505-remote.sh                             | 148 +++---
 t/t5506-remote-groups.sh                      |   4 +-
 t/t5509-fetch-push-namespaces.sh              |  30 +-
 t/t5510-fetch.sh                              | 162 +++---
 t/t5511-refspec.sh                            |  12 +-
 t/t5512-ls-remote.sh                          |  26 +-
 t/t5514-fetch-multiple.sh                     |  30 +-
 t/t5516-fetch-push.sh                         | 500 +++++++++---------
 t/t5517-push-mirror.sh                        | 124 ++---
 t/t5518-fetch-exit-status.sh                  |   6 +-
 t/t5519-push-alternates.sh                    |  12 +-
 t/t5520-pull.sh                               |  30 +-
 t/t5521-pull-options.sh                       |  16 +-
 t/t5523-push-upstream.sh                      |  30 +-
 t/t5526-fetch-submodules.sh                   |  48 +-
 t/t5527-fetch-odd-refs.sh                     |  14 +-
 t/t5528-push-default.sh                       |  98 ++--
 t/t5529-push-errors.sh                        |   2 +-
 t/t5530-upload-pack-error.sh                  |   2 +-
 t/t5531-deep-submodule-push.sh                | 188 +++----
 t/t5533-push-cas.sh                           | 142 ++---
 t/t5534-push-signed.sh                        |   4 +-
 t/t5537-fetch-shallow.sh                      |  30 +-
 t/t5538-push-shallow.sh                       |  22 +-
 t/t5539-fetch-http-shallow.sh                 |  14 +-
 t/t5540-http-push-webdav.sh                   |   8 +-
 t/t5541-http-push-smart.sh                    |  40 +-
 t/t5542-push-http-shallow.sh                  |   8 +-
 t/t5543-atomic-push.sh                        |  80 +--
 t/t5545-push-options.sh                       |  62 +--
 t/t5548-push-porcelain.sh                     |  64 +--
 t/t5550-http-fetch-dumb.sh                    |  20 +-
 t/t5551-http-fetch-smart.sh                   |  20 +-
 t/t5552-skipping-fetch-negotiator.sh          |   2 +-
 t/t5553-set-upstream.sh                       |  82 +--
 t/t5561-http-backend.sh                       |   4 +-
 t/t556x_common                                |   8 +-
 t/t5570-git-daemon.sh                         |  16 +-
 t/t5571-pre-push-hook.sh                      |   4 +-
 t/t5572-pull-submodule.sh                     |   4 +-
 t/t5580-unc-paths.sh                          |   2 +-
 t/t5581-http-curl-verbose.sh                  |   2 +-
 t/t5582-fetch-negative-refspec.sh             |  22 +-
 t/t5601-clone.sh                              |   4 +-
 t/t5604-clone-reference.sh                    |  12 +-
 t/t5605-clone-local.sh                        |  10 +-
 t/t5606-clone-options.sh                      |   8 +-
 t/t5607-clone-bundle.sh                       |  14 +-
 t/t5608-clone-2gb.sh                          |   2 +-
 t/t5609-clone-branch.sh                       |   6 +-
 t/t5610-clone-detached.sh                     |   4 +-
 t/t5611-clone-config.sh                       |  16 +-
 t/t5612-clone-refspec.sh                      |  42 +-
 t/t5614-clone-submodules-shallow.sh           |   2 +-
 t/t5616-partial-clone.sh                      |  50 +-
 t/t5617-clone-submodules-remote.sh            |   6 +-
 t/t5700-protocol-v1.sh                        |  16 +-
 t/t5701-git-serve.sh                          |  16 +-
 t/t5702-protocol-v2.sh                        |  50 +-
 t/t5703-upload-pack-ref-in-want.sh            |  60 +--
 t/t5801-remote-helpers.sh                     |  24 +-
 t/t6000-rev-list-misc.sh                      |   2 +-
 t/t6001-rev-list-graft.sh                     |   2 +-
 t/t6004-rev-list-path-optim.sh                |  14 +-
 t/t6006-rev-list-format.sh                    |  14 +-
 t/t6007-rev-list-cherry-pick-file.sh          |   4 +-
 t/t6008-rev-list-submodule.sh                 |   2 +-
 t/t6009-rev-list-parent.sh                    |   6 +-
 t/t6012-rev-list-simplify.sh                  |   8 +-
 t/t6013-rev-list-reverse-parents.sh           |  10 +-
 t/t6016-rev-list-graph-simplify-history.sh    |   2 +-
 t/t6017-rev-list-stdin.sh                     |   8 +-
 t/t6018-rev-list-glob.sh                      |  50 +-
 t/t6019-rev-list-ancestry-path.sh             |   6 +-
 t/t6030-bisect-porcelain.sh                   |  10 +-
 t/t6040-tracking-info.sh                      |  54 +-
 t/t6050-replace.sh                            |  10 +-
 t/t6101-rev-parse-parents.sh                  |   2 +-
 t/t6110-rev-list-sparse.sh                    |   2 +-
 t/t6111-rev-list-treesame.sh                  |   6 +-
 t/t6112-rev-list-filters-objects.sh           |  14 +-
 t/t6120-describe.sh                           |  20 +-
 t/t6200-fmt-merge-msg.sh                      |  50 +-
 t/t6302-for-each-ref-filter.sh                |  58 +-
 t/t6400-merge-df.sh                           |   6 +-
 t/t6402-merge-rename.sh                       |  46 +-
 t/t6404-recursive-merge.sh                    |   4 +-
 t/t6405-merge-symlinks.sh                     |  14 +-
 t/t6406-merge-attr.sh                         |  24 +-
 t/t6407-merge-binary.sh                       |   6 +-
 t/t6409-merge-subtree.sh                      |  16 +-
 t/t6411-merge-filemode.sh                     |  10 +-
 t/t6412-merge-large-rename.sh                 |   6 +-
 t/t6413-merge-crlf.sh                         |   2 +-
 t/t6414-merge-rename-nocruft.sh               |   2 +-
 t/t6415-merge-dir-to-symlink.sh               |  22 +-
 t/t6416-recursive-corner-cases.sh             |  28 +-
 t/t6417-merge-ours-theirs.sh                  |  28 +-
 t/t6418-merge-text-auto.sh                    |  12 +-
 t/t6419-merge-ignorecase.sh                   |  10 +-
 t/t6422-merge-rename-corner-cases.sh          |  12 +-
 t/t6425-merge-rename-delete.sh                |   2 +-
 t/t6427-diff3-conflict-markers.sh             |  14 +-
 t/t6430-merge-recursive.sh                    |  18 +-
 t/t6432-merge-recursive-space-options.sh      |   6 +-
 t/t6433-merge-toplevel.sh                     |   8 +-
 t/t6434-merge-recursive-rename-options.sh     |   6 +-
 t/t6436-merge-overwrite.sh                    |   2 +-
 t/t6437-submodule-merge.sh                    |  14 +-
 t/t6439-merge-co-error-msgs.sh                |   6 +-
 t/t6501-freshen-objects.sh                    |   2 +-
 t/t7003-filter-branch.sh                      |  40 +-
 t/t7004-tag.sh                                |   8 +-
 t/t7030-verify-tag.sh                         |   2 +-
 t/t7060-wtstatus.sh                           |  26 +-
 t/t7063-status-untracked-cache.sh             |  14 +-
 t/t7102-reset.sh                              |   6 +-
 t/t7113-post-index-change-hook.sh             |   2 +-
 t/t7201-co.sh                                 | 110 ++--
 t/t7400-submodule-basic.sh                    |  20 +-
 t/t7403-submodule-sync.sh                     |  10 +-
 t/t7406-submodule-update.sh                   |  38 +-
 t/t7407-submodule-foreach.sh                  |  24 +-
 t/t7409-submodule-detached-work-tree.sh       |   8 +-
 t/t7417-submodule-path-url.sh                 |   2 +-
 t/t7501-commit-basic-functionality.sh         |   2 +-
 t/t7502-commit-porcelain.sh                   |  12 +-
 ...3-pre-commit-and-pre-merge-commit-hooks.sh |  42 +-
 t/t7504-commit-msg-hook.sh                    |  24 +-
 t/t7505-prepare-commit-msg-hook.sh            |  20 +-
 t/t7508-status.sh                             |  58 +-
 t/t7510-signed-commit.sh                      |   2 +-
 t/t7512-status-help.sh                        |  40 +-
 t/t7517-per-repo-email.sh                     |  12 +-
 t/t7600-merge.sh                              |  44 +-
 t/t7606-merge-custom.sh                       |   2 +-
 t/t7608-merge-messages.sh                     |  36 +-
 t/t7610-mergetool.sh                          | 174 +++---
 t/t7611-merge-abort.sh                        |   4 +-
 t/t7612-merge-verify-signatures.sh            |   2 +-
 t/t7614-merge-signoff.sh                      |  24 +-
 t/t7701-repack-unpack-unreachable.sh          |   2 +-
 t/t7800-difftool.sh                           |  38 +-
 t/t7810-grep.sh                               |  28 +-
 t/t8001-annotate.sh                           |   2 +-
 t/t8003-blame-corner-cases.sh                 |   4 +-
 t/t8004-blame-with-conflicts.sh               |  14 +-
 t/t9001-send-email.sh                         |  28 +-
 t/t9100-git-svn-basic.sh                      |   2 +-
 t/t9145-git-svn-master-branch.sh              |   6 +-
 t/t9151-svn-mergeinfo.sh                      |   2 +-
 t/t9155-git-svn-fetch-deleted-tag.sh          |   2 +-
 t/t9156-git-svn-fetch-deleted-tag-2.sh        |   6 +-
 t/t9163-git-svn-reset-clears-caches.sh        |   2 +-
 t/t9169-git-svn-dcommit-crlf.sh               |   2 +-
 t/t9300-fast-import.sh                        |  82 +--
 t/t9301-fast-import-notes.sh                  |  14 +-
 t/t9302-fast-import-unpack-limit.sh           |  16 +-
 t/t9350-fast-export.sh                        |  86 +--
 t/t9351-fast-export-anonymize.sh              |   4 +-
 t/t9400-git-cvsserver-server.sh               |  32 +-
 t/t9401-git-cvsserver-crlf.sh                 |  16 +-
 t/t9402-git-cvsserver-refs.sh                 |   8 +-
 t/t9500-gitweb-standalone-no-errors.sh        |  20 +-
 t/t9501-gitweb-standalone-http-status.sh      |  14 +-
 t/t9502-gitweb-standalone-parse-output.sh     |  16 +-
 t/t9600-cvsimport.sh                          |   2 +-
 t/t9601-cvsimport-vendor-branch.sh            |  16 +-
 t/t9602-cvsimport-branches-tags.sh            |   4 +-
 t/t9603-cvsimport-patchsets.sh                |   8 +-
 t/t9800-git-p4-basic.sh                       |   2 +-
 t/t9801-git-p4-branch.sh                      |  16 +-
 t/t9806-git-p4-options.sh                     |  18 +-
 t/t9807-git-p4-submit.sh                      |   2 +-
 t/t9811-git-p4-label-import.sh                |   2 +-
 t/t9903-bash-prompt.sh                        | 114 ++--
 t/test-lib.sh                                 |  13 +
 351 files changed, 3903 insertions(+), 3890 deletions(-)


base-commit: aff20da3a209088e7f8f3632077fa11b86453d67
Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-762%2Fdscho%2Fuse-main-as-default-branch-name-v1
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-762/dscho/use-main-as-default-branch-name-v1
Pull-Request: https://github.com/gitgitgadget/git/pull/762
-- 
gitgitgadget

^ permalink raw reply	[flat|nested] 163+ messages in thread

* [PATCH 01/28] t0060: preemptively adjust alignment
  2020-11-12 22:43 [PATCH 00/28] Use main as default branch name Johannes Schindelin via GitGitGadget
@ 2020-11-12 22:43 ` Johannes Schindelin via GitGitGadget
  2020-11-12 22:43 ` [PATCH 02/28] t[01]*: adjust the references to the default branch name "main" Johannes Schindelin via GitGitGadget
                   ` (31 subsequent siblings)
  32 siblings, 0 replies; 163+ messages in thread
From: Johannes Schindelin via GitGitGadget @ 2020-11-12 22:43 UTC (permalink / raw)
  To: git; +Cc: Johannes Schindelin, Johannes Schindelin

From: Johannes Schindelin <johannes.schindelin@gmx.de>

We are about to adjust t0060 for the new default branch name `main`.
This name is two characters shorter and therefore needs two spaces more
padding to align correctly.

Adjusting the alignment before the big search-and-replace makes it
easier to verify that the final result does not leave any misaligned
lines behind.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
---
 t/t0060-path-utils.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/t/t0060-path-utils.sh b/t/t0060-path-utils.sh
index b2e3cf3f4c..928eebbdc0 100755
--- a/t/t0060-path-utils.sh
+++ b/t/t0060-path-utils.sh
@@ -312,8 +312,8 @@ test_git_path GIT_COMMON_DIR=bar info/sparse-checkout     .git/info/sparse-check
 test_git_path GIT_COMMON_DIR=bar info//sparse-checkout    .git/info//sparse-checkout
 test_git_path GIT_COMMON_DIR=bar remotes/bar              bar/remotes/bar
 test_git_path GIT_COMMON_DIR=bar branches/bar             bar/branches/bar
-test_git_path GIT_COMMON_DIR=bar logs/refs/heads/master   bar/logs/refs/heads/master
-test_git_path GIT_COMMON_DIR=bar refs/heads/master        bar/refs/heads/master
+test_git_path GIT_COMMON_DIR=bar logs/refs/heads/master     bar/logs/refs/heads/master
+test_git_path GIT_COMMON_DIR=bar refs/heads/master          bar/refs/heads/master
 test_git_path GIT_COMMON_DIR=bar refs/bisect/foo          .git/refs/bisect/foo
 test_git_path GIT_COMMON_DIR=bar hooks/me                 bar/hooks/me
 test_git_path GIT_COMMON_DIR=bar config                   bar/config
-- 
gitgitgadget


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH 02/28] t[01]*: adjust the references to the default branch name "main"
  2020-11-12 22:43 [PATCH 00/28] Use main as default branch name Johannes Schindelin via GitGitGadget
  2020-11-12 22:43 ` [PATCH 01/28] t0060: preemptively adjust alignment Johannes Schindelin via GitGitGadget
@ 2020-11-12 22:43 ` Johannes Schindelin via GitGitGadget
  2020-11-12 22:43 ` [PATCH 03/28] t2*: " Johannes Schindelin via GitGitGadget
                   ` (30 subsequent siblings)
  32 siblings, 0 replies; 163+ messages in thread
From: Johannes Schindelin via GitGitGadget @ 2020-11-12 22:43 UTC (permalink / raw)
  To: git; +Cc: Johannes Schindelin, Johannes Schindelin

From: Johannes Schindelin <johannes.schindelin@gmx.de>

This trick was performed via

	$ (cd t &&
	   sed -i -e 's/master/main/g' -e 's/MASTER/MAIN/g' \
		-e 's/Master/Main/g' -- t[01]*.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>
---
 t/t0002-gitfile.sh                   |  6 +--
 t/t0020-crlf.sh                      |  8 ++--
 t/t0021-conversion.sh                | 40 ++++++++--------
 t/t0027-auto-crlf.sh                 |  4 +-
 t/t0028-working-tree-encoding.sh     |  4 +-
 t/t0041-usage.sh                     | 10 ++--
 t/t0050-filesystem.sh                |  6 +--
 t/t0060-path-utils.sh                |  4 +-
 t/t0100-previous.sh                  | 18 ++++----
 t/t1004-read-tree-m-u-wf.sh          | 40 ++++++++--------
 t/t1008-read-tree-overlay.sh         |  2 +-
 t/t1009-read-tree-new-index.sh       |  4 +-
 t/t1011-read-tree-sparse-checkout.sh |  2 +-
 t/t1021-rerere-in-workdir.sh         |  2 +-
 t/t1090-sparse-checkout-scope.sh     | 10 ++--
 t/t1091-sparse-checkout-builtin.sh   |  2 +-
 t/t1300-config.sh                    |  8 ++--
 t/t1301-shared-repo.sh               |  4 +-
 t/t1305-config-include.sh            |  2 +-
 t/t1309-early-config.sh              |  4 +-
 t/t1400-update-ref.sh                | 68 ++++++++++++++--------------
 t/t1402-check-ref-format.sh          | 28 ++++++------
 t/t1403-show-ref.sh                  | 18 ++++----
 t/t1405-main-ref-store.sh            | 42 ++++++++---------
 t/t1406-submodule-ref-store.sh       | 30 ++++++------
 t/t1407-worktree-ref-store.sh        | 32 ++++++-------
 t/t1408-packed-refs.sh               | 12 ++---
 t/t1410-reflog.sh                    | 56 +++++++++++------------
 t/t1411-reflog-show.sh               |  2 +-
 t/t1413-reflog-detach.sh             | 24 +++++-----
 t/t1414-reflog-walk.sh               | 12 ++---
 t/t1416-ref-transaction-hooks.sh     | 10 ++--
 t/t1430-bad-ref-name.sh              | 52 ++++++++++-----------
 t/t1450-fsck.sh                      |  2 +-
 t/t1500-rev-parse.sh                 |  4 +-
 t/t1503-rev-parse-verify.sh          | 28 ++++++------
 t/t1505-rev-parse-last.sh            |  8 ++--
 t/t1506-rev-parse-diagnosis.sh       |  4 +-
 t/t1507-rev-parse-upstream.sh        | 40 ++++++++--------
 t/t1508-at-combinations.sh           | 10 ++--
 t/t1511-rev-parse-caret.sh           | 26 +++++------
 t/t1512-rev-parse-disambiguation.sh  |  2 +-
 t/t1513-rev-parse-prefix.sh          |  4 +-
 t/t1514-rev-parse-push.sh            | 16 +++----
 t/t1700-split-index.sh               |  2 +-
 t/test-lib.sh                        |  7 +++
 46 files changed, 363 insertions(+), 356 deletions(-)

diff --git a/t/t0002-gitfile.sh b/t/t0002-gitfile.sh
index 960ed150cb..bbcfc8a0b5 100755
--- a/t/t0002-gitfile.sh
+++ b/t/t0002-gitfile.sh
@@ -96,7 +96,7 @@ test_expect_success 'enter_repo non-strict mode' '
 	git ls-remote enter_repo >actual &&
 	cat >expected <<-EOF &&
 	$head	HEAD
-	$head	refs/heads/master
+	$head	refs/heads/main
 	$head	refs/tags/foo
 	EOF
 	test_cmp expected actual
@@ -111,7 +111,7 @@ test_expect_success 'enter_repo linked checkout' '
 	git ls-remote foo >actual &&
 	cat >expected <<-EOF &&
 	$head	HEAD
-	$head	refs/heads/master
+	$head	refs/heads/main
 	$head	refs/tags/foo
 	EOF
 	test_cmp expected actual
@@ -122,7 +122,7 @@ test_expect_success 'enter_repo strict mode' '
 	git ls-remote --upload-pack="git upload-pack --strict" foo/.git >actual &&
 	cat >expected <<-EOF &&
 	$head	HEAD
-	$head	refs/heads/master
+	$head	refs/heads/main
 	$head	refs/tags/foo
 	EOF
 	test_cmp expected actual
diff --git a/t/t0020-crlf.sh b/t/t0020-crlf.sh
index b63ba62e5d..04bf4b1e82 100755
--- a/t/t0020-crlf.sh
+++ b/t/t0020-crlf.sh
@@ -318,8 +318,8 @@ test_expect_success 'checkout with existing .gitattributes' '
 	git add .gitattributes .file &&
 	git commit -m second &&
 
-	git checkout master~1 &&
-	git checkout master &&
+	git checkout main~1 &&
+	git checkout main &&
 	test "$(git diff-files --raw)" = ""
 
 '
@@ -331,8 +331,8 @@ test_expect_success 'checkout when deleting .gitattributes' '
 	git add .file2 &&
 	git commit -m third &&
 
-	git checkout master~1 &&
-	git checkout master &&
+	git checkout main~1 &&
+	git checkout main &&
 	has_cr .file2
 
 '
diff --git a/t/t0021-conversion.sh b/t/t0021-conversion.sh
index f6deaf498b..d0eeca4556 100755
--- a/t/t0021-conversion.sh
+++ b/t/t0021-conversion.sh
@@ -378,8 +378,8 @@ test_expect_success PERL 'required process filter should filter data' '
 		test_cmp_count expected.log debug.log &&
 
 		git commit -m "test commit 2" &&
-		MASTER=$(git rev-parse --verify master) &&
-		META="ref=refs/heads/master treeish=$MASTER" &&
+		MAIN=$(git rev-parse --verify main) &&
+		META="ref=refs/heads/main treeish=$MAIN" &&
 		rm -f test2.r "testsubdir/test3 '\''sq'\'',\$x=.r" &&
 
 		filter_git checkout --quiet --no-progress . &&
@@ -404,7 +404,7 @@ test_expect_success PERL 'required process filter should filter data' '
 		EOF
 		test_cmp_exclude_clean expected.log debug.log &&
 
-		filter_git checkout --quiet --no-progress master &&
+		filter_git checkout --quiet --no-progress main &&
 		cat >expected.log <<-EOF &&
 			START
 			init handshake complete
@@ -436,15 +436,15 @@ test_expect_success PERL 'required process filter should filter data for various
 		M3=$(git hash-object "testsubdir/test3 '\''sq'\'',\$x=.r") &&
 		EMPTY=$(git hash-object /dev/null) &&
 
-		MASTER=$(git rev-parse --verify master) &&
+		MAIN=$(git rev-parse --verify main) &&
 
 		cp "$TEST_ROOT/test.o" test5.r &&
 		git add test5.r &&
 		git commit -m "test commit 3" &&
 		git checkout empty-branch &&
-		filter_git rebase --onto empty-branch master^^ master &&
-		MASTER2=$(git rev-parse --verify master) &&
-		META="ref=refs/heads/master treeish=$MASTER2" &&
+		filter_git rebase --onto empty-branch main^^ main &&
+		MAIN2=$(git rev-parse --verify main) &&
+		META="ref=refs/heads/main treeish=$MAIN2" &&
 		cat >expected.log <<-EOF &&
 			START
 			init handshake complete
@@ -458,8 +458,8 @@ test_expect_success PERL 'required process filter should filter data for various
 		test_cmp_exclude_clean expected.log debug.log &&
 
 		git reset --hard empty-branch &&
-		filter_git reset --hard $MASTER &&
-		META="treeish=$MASTER" &&
+		filter_git reset --hard $MAIN &&
+		META="treeish=$MAIN" &&
 		cat >expected.log <<-EOF &&
 			START
 			init handshake complete
@@ -471,10 +471,10 @@ test_expect_success PERL 'required process filter should filter data for various
 		EOF
 		test_cmp_exclude_clean expected.log debug.log &&
 
-		git branch old-master $MASTER &&
+		git branch old-main $MAIN &&
 		git reset --hard empty-branch &&
-		filter_git reset --hard old-master &&
-		META="ref=refs/heads/old-master treeish=$MASTER" &&
+		filter_git reset --hard old-main &&
+		META="ref=refs/heads/old-main treeish=$MAIN" &&
 		cat >expected.log <<-EOF &&
 			START
 			init handshake complete
@@ -487,9 +487,9 @@ test_expect_success PERL 'required process filter should filter data for various
 		test_cmp_exclude_clean expected.log debug.log &&
 
 		git checkout -b merge empty-branch &&
-		git branch -f master $MASTER2 &&
-		filter_git merge master &&
-		META="treeish=$MASTER2" &&
+		git branch -f main $MAIN2 &&
+		filter_git merge main &&
+		META="treeish=$MAIN2" &&
 		cat >expected.log <<-EOF &&
 			START
 			init handshake complete
@@ -502,8 +502,8 @@ test_expect_success PERL 'required process filter should filter data for various
 		EOF
 		test_cmp_exclude_clean expected.log debug.log &&
 
-		filter_git archive master >/dev/null &&
-		META="ref=refs/heads/master treeish=$MASTER2" &&
+		filter_git archive main >/dev/null &&
+		META="ref=refs/heads/main treeish=$MAIN2" &&
 		cat >expected.log <<-EOF &&
 			START
 			init handshake complete
@@ -516,7 +516,7 @@ test_expect_success PERL 'required process filter should filter data for various
 		EOF
 		test_cmp_exclude_clean expected.log debug.log &&
 
-		TREE="$(git rev-parse $MASTER2^{tree})" &&
+		TREE="$(git rev-parse $MAIN2^{tree})" &&
 		filter_git archive $TREE >/dev/null &&
 		META="treeish=$TREE" &&
 		cat >expected.log <<-EOF &&
@@ -856,8 +856,8 @@ test_expect_success PERL 'delayed checkout in process filter' '
 	) &&
 
 	S=$(test_file_size "$TEST_ROOT/test.o") &&
-	PM="ref=refs/heads/master treeish=$(git -C repo rev-parse --verify master) " &&
-	M="${PM}blob=$(git -C repo rev-parse --verify master:test.a)" &&
+	PM="ref=refs/heads/main treeish=$(git -C repo rev-parse --verify main) " &&
+	M="${PM}blob=$(git -C repo rev-parse --verify main:test.a)" &&
 	cat >a.exp <<-EOF &&
 		START
 		init handshake complete
diff --git a/t/t0027-auto-crlf.sh b/t/t0027-auto-crlf.sh
index 9fcd56fab3..51f74a3ddf 100755
--- a/t/t0027-auto-crlf.sh
+++ b/t/t0027-auto-crlf.sh
@@ -368,9 +368,9 @@ test_expect_success 'ls-files --eol -o Text/Binary' '
 	test_cmp expect actual
 '
 
-test_expect_success 'setup master' '
+test_expect_success 'setup main' '
 	echo >.gitattributes &&
-	git checkout -b master &&
+	git checkout -b main &&
 	git add .gitattributes &&
 	git commit -m "add .gitattributes" . &&
 	printf "\$Id: 0000000000000000000000000000000000000000 \$\nLINEONE\nLINETWO\nLINETHREE"     >LF &&
diff --git a/t/t0028-working-tree-encoding.sh b/t/t0028-working-tree-encoding.sh
index bfc4fb9af5..9c48037884 100755
--- a/t/t0028-working-tree-encoding.sh
+++ b/t/t0028-working-tree-encoding.sh
@@ -215,7 +215,7 @@ test_expect_success 'error if encoding round trip is not the same during refresh
 	TEST_HASH=$(git hash-object --no-filters -w nonsense.utf16le) &&
 	git update-index --add --cacheinfo 100644 $TEST_HASH nonsense.utf16le &&
 	COMMIT=$(git commit-tree -p $(git rev-parse HEAD) -m "plain commit" $(git write-tree)) &&
-	git update-ref refs/heads/master $COMMIT &&
+	git update-ref refs/heads/main $COMMIT &&
 
 	test_must_fail git checkout HEAD^ 2>err.out &&
 	test_i18ngrep "error: .* overwritten by checkout:" err.out
@@ -231,7 +231,7 @@ test_expect_success 'error if encoding garbage is already in Git' '
 	TEST_HASH=$(git hash-object --no-filters -w nonsense.utf16) &&
 	git update-index --add --cacheinfo 100644 $TEST_HASH nonsense.utf16 &&
 	COMMIT=$(git commit-tree -p $(git rev-parse HEAD) -m "plain commit" $(git write-tree)) &&
-	git update-ref refs/heads/master $COMMIT &&
+	git update-ref refs/heads/main $COMMIT &&
 
 	git diff 2>err.out &&
 	test_i18ngrep "error: BOM is required" err.out
diff --git a/t/t0041-usage.sh b/t/t0041-usage.sh
index 5b927b76fe..6f93450597 100755
--- a/t/t0041-usage.sh
+++ b/t/t0041-usage.sh
@@ -41,8 +41,8 @@ test_expect_success 'tag usage error' '
 '
 
 test_expect_success 'branch --contains <existent_commit>' '
-	git branch --contains "master" >actual 2>actual.err &&
-	test_i18ngrep "master" actual &&
+	git branch --contains "main" >actual 2>actual.err &&
+	test_i18ngrep "main" actual &&
 	test_line_count = 0 actual.err
 '
 
@@ -54,7 +54,7 @@ test_expect_success 'branch --contains <inexistent_commit>' '
 '
 
 test_expect_success 'branch --no-contains <existent_commit>' '
-	git branch --no-contains "master" >actual 2>actual.err &&
+	git branch --no-contains "main" >actual 2>actual.err &&
 	test_line_count = 0 actual &&
 	test_line_count = 0 actual.err
 '
@@ -73,7 +73,7 @@ test_expect_success 'branch usage error' '
 '
 
 test_expect_success 'for-each-ref --contains <existent_object>' '
-	git for-each-ref --contains "master" >actual 2>actual.err &&
+	git for-each-ref --contains "main" >actual 2>actual.err &&
 	test_line_count = 2 actual &&
 	test_line_count = 0 actual.err
 '
@@ -86,7 +86,7 @@ test_expect_success 'for-each-ref --contains <inexistent_object>' '
 '
 
 test_expect_success 'for-each-ref --no-contains <existent_object>' '
-	git for-each-ref --no-contains "master" >actual 2>actual.err &&
+	git for-each-ref --no-contains "main" >actual 2>actual.err &&
 	test_line_count = 0 actual &&
 	test_line_count = 0 actual.err
 '
diff --git a/t/t0050-filesystem.sh b/t/t0050-filesystem.sh
index 608673fb77..e3412b896b 100755
--- a/t/t0050-filesystem.sh
+++ b/t/t0050-filesystem.sh
@@ -65,7 +65,7 @@ test_expect_success "setup case tests" '
 	git mv camelcase tmp &&
 	git mv tmp CamelCase &&
 	git commit -m "rename" &&
-	git checkout -f master
+	git checkout -f main
 '
 
 test_expect_success 'rename (case change)' '
@@ -118,7 +118,7 @@ test_expect_success "setup unicode normalization tests" '
 	git mv $aumlcdiar tmp &&
 	git mv tmp "$auml" &&
 	git commit -m rename &&
-	git checkout -f master
+	git checkout -f main
 '
 
 $test_unicode 'rename (silent unicode normalization)' '
@@ -147,7 +147,7 @@ test_expect_success CASE_INSENSITIVE_FS 'checkout with no pathspec and a case in
 		git add gitweb &&
 		git commit -m "add gitweb/subdir/file" &&
 
-		git checkout master
+		git checkout main
 	)
 '
 
diff --git a/t/t0060-path-utils.sh b/t/t0060-path-utils.sh
index 928eebbdc0..fab077b6f7 100755
--- a/t/t0060-path-utils.sh
+++ b/t/t0060-path-utils.sh
@@ -312,8 +312,8 @@ test_git_path GIT_COMMON_DIR=bar info/sparse-checkout     .git/info/sparse-check
 test_git_path GIT_COMMON_DIR=bar info//sparse-checkout    .git/info//sparse-checkout
 test_git_path GIT_COMMON_DIR=bar remotes/bar              bar/remotes/bar
 test_git_path GIT_COMMON_DIR=bar branches/bar             bar/branches/bar
-test_git_path GIT_COMMON_DIR=bar logs/refs/heads/master     bar/logs/refs/heads/master
-test_git_path GIT_COMMON_DIR=bar refs/heads/master          bar/refs/heads/master
+test_git_path GIT_COMMON_DIR=bar logs/refs/heads/main     bar/logs/refs/heads/main
+test_git_path GIT_COMMON_DIR=bar refs/heads/main          bar/refs/heads/main
 test_git_path GIT_COMMON_DIR=bar refs/bisect/foo          .git/refs/bisect/foo
 test_git_path GIT_COMMON_DIR=bar hooks/me                 bar/hooks/me
 test_git_path GIT_COMMON_DIR=bar config                   bar/config
diff --git a/t/t0100-previous.sh b/t/t0100-previous.sh
index 58c0b7e9b6..dfb367b720 100755
--- a/t/t0100-previous.sh
+++ b/t/t0100-previous.sh
@@ -8,7 +8,7 @@ test_expect_success 'branch -d @{-1}' '
 	test_commit A &&
 	git checkout -b junk &&
 	git checkout - &&
-	test "$(git symbolic-ref HEAD)" = refs/heads/master &&
+	test "$(git symbolic-ref HEAD)" = refs/heads/main &&
 	git branch -d @{-1} &&
 	test_must_fail git rev-parse --verify refs/heads/junk
 '
@@ -17,9 +17,9 @@ test_expect_success 'branch -d @{-12} when there is not enough switches yet' '
 	git reflog expire --expire=now &&
 	git checkout -b junk2 &&
 	git checkout - &&
-	test "$(git symbolic-ref HEAD)" = refs/heads/master &&
+	test "$(git symbolic-ref HEAD)" = refs/heads/main &&
 	test_must_fail git branch -d @{-12} &&
-	git rev-parse --verify refs/heads/master
+	git rev-parse --verify refs/heads/main
 '
 
 test_expect_success 'merge @{-1}' '
@@ -28,19 +28,19 @@ test_expect_success 'merge @{-1}' '
 	git checkout A &&
 	test_commit C &&
 	test_commit D &&
-	git branch -f master B &&
+	git branch -f main B &&
 	git branch -f other &&
 	git checkout other &&
-	git checkout master &&
+	git checkout main &&
 	git merge @{-1} &&
 	git cat-file commit HEAD | grep "Merge branch '\''other'\''"
 '
 
 test_expect_success 'merge @{-1}~1' '
-	git checkout master &&
+	git checkout main &&
 	git reset --hard B &&
 	git checkout other &&
-	git checkout master &&
+	git checkout main &&
 	git merge @{-1}~1 &&
 	git cat-file commit HEAD >actual &&
 	grep "Merge branch '\''other'\''" actual
@@ -48,11 +48,11 @@ test_expect_success 'merge @{-1}~1' '
 
 test_expect_success 'merge @{-100} before checking out that many branches yet' '
 	git reflog expire --expire=now &&
-	git checkout -f master &&
+	git checkout -f main &&
 	git reset --hard B &&
 	git branch -f other C &&
 	git checkout other &&
-	git checkout master &&
+	git checkout main &&
 	test_must_fail git merge @{-100}
 '
 
diff --git a/t/t1004-read-tree-m-u-wf.sh b/t/t1004-read-tree-m-u-wf.sh
index 181956b241..c8a81f180f 100755
--- a/t/t1004-read-tree-m-u-wf.sh
+++ b/t/t1004-read-tree-m-u-wf.sh
@@ -20,17 +20,17 @@ test_expect_success 'two-way setup' '
 	git branch side &&
 	git tag -f branch-point &&
 
-	echo file2 is not tracked on the master branch anymore &&
+	echo file2 is not tracked on the main branch anymore &&
 	rm -f file2 subdir/file2 &&
 	git update-index --remove file2 subdir/file2 &&
-	git commit -a -m "master removes file2 and subdir/file2"
+	git commit -a -m "main removes file2 and subdir/file2"
 '
 
 test_expect_success 'two-way not clobbering' '
 
-	echo >file2 master creates untracked file2 &&
-	echo >subdir/file2 master creates untracked subdir/file2 &&
-	if err=$(read_tree_u_must_succeed -m -u master side 2>&1)
+	echo >file2 main creates untracked file2 &&
+	echo >subdir/file2 main creates untracked subdir/file2 &&
+	if err=$(read_tree_u_must_succeed -m -u main side 2>&1)
 	then
 		echo should have complained
 		false
@@ -43,7 +43,7 @@ echo file2 >.gitignore
 
 test_expect_success 'two-way with incorrect --exclude-per-directory (1)' '
 
-	if err=$(read_tree_u_must_succeed -m --exclude-per-directory=.gitignore master side 2>&1)
+	if err=$(read_tree_u_must_succeed -m --exclude-per-directory=.gitignore main side 2>&1)
 	then
 		echo should have complained
 		false
@@ -54,7 +54,7 @@ test_expect_success 'two-way with incorrect --exclude-per-directory (1)' '
 
 test_expect_success 'two-way with incorrect --exclude-per-directory (2)' '
 
-	if err=$(read_tree_u_must_succeed -m -u --exclude-per-directory=foo --exclude-per-directory=.gitignore master side 2>&1)
+	if err=$(read_tree_u_must_succeed -m -u --exclude-per-directory=foo --exclude-per-directory=.gitignore main side 2>&1)
 	then
 		echo should have complained
 		false
@@ -65,7 +65,7 @@ test_expect_success 'two-way with incorrect --exclude-per-directory (2)' '
 
 test_expect_success 'two-way clobbering a ignored file' '
 
-	read_tree_u_must_succeed -m -u --exclude-per-directory=.gitignore master side
+	read_tree_u_must_succeed -m -u --exclude-per-directory=.gitignore main side
 '
 
 rm -f .gitignore
@@ -81,21 +81,21 @@ test_expect_success 'three-way not complaining on an untracked path in both' '
 	git update-index --add file3 subdir/file3 &&
 	git commit -a -m "side adds file3 and removes file2" &&
 
-	git checkout master &&
-	echo >file2 file two is untracked on the master side &&
-	echo >subdir/file2 file two is untracked on the master side &&
+	git checkout main &&
+	echo >file2 file two is untracked on the main side &&
+	echo >subdir/file2 file two is untracked on the main side &&
 
-	read_tree_u_must_succeed -m -u branch-point master side
+	read_tree_u_must_succeed -m -u branch-point main side
 '
 
 test_expect_success 'three-way not clobbering a working tree file' '
 
 	git reset --hard &&
 	rm -f file2 subdir/file2 file3 subdir/file3 &&
-	git checkout master &&
-	echo >file3 file three created in master, untracked &&
-	echo >subdir/file3 file three created in master, untracked &&
-	if err=$(read_tree_u_must_succeed -m -u branch-point master side 2>&1)
+	git checkout main &&
+	echo >file3 file three created in main, untracked &&
+	echo >subdir/file3 file three created in main, untracked &&
+	if err=$(read_tree_u_must_succeed -m -u branch-point main side 2>&1)
 	then
 		echo should have complained
 		false
@@ -110,11 +110,11 @@ test_expect_success 'three-way not complaining on an untracked file' '
 
 	git reset --hard &&
 	rm -f file2 subdir/file2 file3 subdir/file3 &&
-	git checkout master &&
-	echo >file3 file three created in master, untracked &&
-	echo >subdir/file3 file three created in master, untracked &&
+	git checkout main &&
+	echo >file3 file three created in main, untracked &&
+	echo >subdir/file3 file three created in main, untracked &&
 
-	read_tree_u_must_succeed -m -u --exclude-per-directory=.gitignore branch-point master side
+	read_tree_u_must_succeed -m -u --exclude-per-directory=.gitignore branch-point main side
 '
 
 test_expect_success '3-way not overwriting local changes (setup)' '
diff --git a/t/t1008-read-tree-overlay.sh b/t/t1008-read-tree-overlay.sh
index cf96016844..2a757bd6d5 100755
--- a/t/t1008-read-tree-overlay.sh
+++ b/t/t1008-read-tree-overlay.sh
@@ -22,7 +22,7 @@ test_expect_success setup '
 '
 
 test_expect_success 'multi-read' '
-	read_tree_must_succeed initial master side &&
+	read_tree_must_succeed initial main side &&
 	test_write_lines a b/c >expect &&
 	git ls-files >actual &&
 	test_cmp expect actual
diff --git a/t/t1009-read-tree-new-index.sh b/t/t1009-read-tree-new-index.sh
index 59b3aa4bc4..7302adfb20 100755
--- a/t/t1009-read-tree-new-index.sh
+++ b/t/t1009-read-tree-new-index.sh
@@ -12,13 +12,13 @@ test_expect_success setup '
 
 test_expect_success 'non-existent index file' '
 	rm -f new-index &&
-	GIT_INDEX_FILE=new-index git read-tree master
+	GIT_INDEX_FILE=new-index git read-tree main
 '
 
 test_expect_success 'empty index file' '
 	rm -f new-index &&
 	> new-index &&
-	GIT_INDEX_FILE=new-index git read-tree master
+	GIT_INDEX_FILE=new-index git read-tree main
 '
 
 test_done
diff --git a/t/t1011-read-tree-sparse-checkout.sh b/t/t1011-read-tree-sparse-checkout.sh
index 140f459977..dfe9794a74 100755
--- a/t/t1011-read-tree-sparse-checkout.sh
+++ b/t/t1011-read-tree-sparse-checkout.sh
@@ -2,7 +2,7 @@
 
 test_description='sparse checkout tests
 
-* (tag: removed, master) removed
+* (tag: removed, main) removed
 | D	sub/added
 * (HEAD, tag: top) modified and added
 | M	init.t
diff --git a/t/t1021-rerere-in-workdir.sh b/t/t1021-rerere-in-workdir.sh
index 301e071ff7..a32b4a50e0 100755
--- a/t/t1021-rerere-in-workdir.sh
+++ b/t/t1021-rerere-in-workdir.sh
@@ -19,7 +19,7 @@ test_expect_success SYMLINKS setup '
 	test_tick &&
 	git commit -a -m goodbye &&
 
-	git checkout master
+	git checkout main
 '
 
 test_expect_success SYMLINKS 'rerere in workdir' '
diff --git a/t/t1090-sparse-checkout-scope.sh b/t/t1090-sparse-checkout-scope.sh
index f35a73dd20..6c253fd526 100755
--- a/t/t1090-sparse-checkout-scope.sh
+++ b/t/t1090-sparse-checkout-scope.sh
@@ -20,18 +20,18 @@ test_expect_success 'create feature branch' '
 	git commit -m "modification"
 '
 
-test_expect_success 'perform sparse checkout of master' '
+test_expect_success 'perform sparse checkout of main' '
 	git config --local --bool core.sparsecheckout true &&
 	echo "!/*" >.git/info/sparse-checkout &&
 	echo "/a" >>.git/info/sparse-checkout &&
 	echo "/c" >>.git/info/sparse-checkout &&
-	git checkout master &&
+	git checkout main &&
 	test_path_is_file a &&
 	test_path_is_missing b &&
 	test_path_is_file c
 '
 
-test_expect_success 'merge feature branch into sparse checkout of master' '
+test_expect_success 'merge feature branch into sparse checkout of main' '
 	git merge feature &&
 	test_path_is_file a &&
 	test_path_is_missing b &&
@@ -39,10 +39,10 @@ test_expect_success 'merge feature branch into sparse checkout of master' '
 	test "$(cat c)" = "modified"
 '
 
-test_expect_success 'return to full checkout of master' '
+test_expect_success 'return to full checkout of main' '
 	git checkout feature &&
 	echo "/*" >.git/info/sparse-checkout &&
-	git checkout master &&
+	git checkout main &&
 	test_path_is_file a &&
 	test_path_is_file b &&
 	test_path_is_file c &&
diff --git a/t/t1091-sparse-checkout-builtin.sh b/t/t1091-sparse-checkout-builtin.sh
index 84acfc48b6..4ee16805bb 100755
--- a/t/t1091-sparse-checkout-builtin.sh
+++ b/t/t1091-sparse-checkout-builtin.sh
@@ -117,7 +117,7 @@ test_expect_success 'interaction with clone --no-checkout (unborn index)' '
 	test_path_is_missing clone_no_checkout/.git/index &&
 
 	# No branch is checked out until we manually switch to one
-	git -C clone_no_checkout switch master &&
+	git -C clone_no_checkout switch main &&
 	test_path_is_file clone_no_checkout/.git/index &&
 	check_files clone_no_checkout a folder1
 '
diff --git a/t/t1300-config.sh b/t/t1300-config.sh
index 825d9a184f..11a8e641da 100755
--- a/t/t1300-config.sh
+++ b/t/t1300-config.sh
@@ -1054,8 +1054,8 @@ test_expect_success 'check split_cmdline return' "
 	echo foo > foo &&
 	git add foo &&
 	git commit -m 'initial commit' &&
-	git config branch.master.mergeoptions 'echo \"' &&
-	test_must_fail git merge master
+	git config branch.main.mergeoptions 'echo \"' &&
+	test_must_fail git merge main
 "
 
 test_expect_success 'git -c "key=value" support' '
@@ -1769,11 +1769,11 @@ test_expect_success '--show-origin blob' '
 
 test_expect_success '--show-origin blob ref' '
 	cat >expect <<-\EOF &&
-	blob:master:custom.conf	user.custom=true
+	blob:main:custom.conf	user.custom=true
 	EOF
 	git add "$CUSTOM_CONFIG_FILE" &&
 	git commit -m "new config file" &&
-	git config --blob=master:"$CUSTOM_CONFIG_FILE" --show-origin --list >output &&
+	git config --blob=main:"$CUSTOM_CONFIG_FILE" --show-origin --list >output &&
 	test_cmp expect output
 '
 
diff --git a/t/t1301-shared-repo.sh b/t/t1301-shared-repo.sh
index 2dc853d1be..b0236ffe4a 100755
--- a/t/t1301-shared-repo.sh
+++ b/t/t1301-shared-repo.sh
@@ -115,13 +115,13 @@ test_expect_success POSIXPERM 'git reflog expire honors core.sharedRepository' '
 	umask 077 &&
 	git config core.sharedRepository group &&
 	git reflog expire --all &&
-	actual="$(ls -l .git/logs/refs/heads/master)" &&
+	actual="$(ls -l .git/logs/refs/heads/main)" &&
 	case "$actual" in
 	-rw-rw-*)
 		: happy
 		;;
 	*)
-		echo Ooops, .git/logs/refs/heads/master is not 0662 [$actual]
+		echo Ooops, .git/logs/refs/heads/main is not 0662 [$actual]
 		false
 		;;
 	esac
diff --git a/t/t1305-config-include.sh b/t/t1305-config-include.sh
index f1e1b289f9..938ca17d78 100755
--- a/t/t1305-config-include.sh
+++ b/t/t1305-config-include.sh
@@ -312,7 +312,7 @@ test_expect_success SYMLINKS 'conditional include, gitdir matching symlink, icas
 test_expect_success 'conditional include, onbranch' '
 	echo "[includeIf \"onbranch:foo-branch\"]path=bar9" >>.git/config &&
 	echo "[test]nine=9" >.git/bar9 &&
-	git checkout -b master &&
+	git checkout -b main &&
 	test_must_fail git config test.nine &&
 	git checkout -b foo-branch &&
 	echo 9 >expect &&
diff --git a/t/t1309-early-config.sh b/t/t1309-early-config.sh
index ebb8e1aecb..598e62eb4c 100755
--- a/t/t1309-early-config.sh
+++ b/t/t1309-early-config.sh
@@ -91,11 +91,11 @@ test_expect_failure 'ignore .git/ with invalid config' '
 
 test_expect_success 'early config and onbranch' '
 	echo "[broken" >broken &&
-	test_with_config "[includeif \"onbranch:master\"]path=../broken"
+	test_with_config "[includeif \"onbranch:main\"]path=../broken"
 '
 
 test_expect_success 'onbranch config outside of git repo' '
-	test_config_global includeIf.onbranch:master.path non-existent &&
+	test_config_global includeIf.onbranch:main.path non-existent &&
 	nongit git help
 '
 
diff --git a/t/t1400-update-ref.sh b/t/t1400-update-ref.sh
index 4c01e08551..3265a8c58e 100755
--- a/t/t1400-update-ref.sh
+++ b/t/t1400-update-ref.sh
@@ -8,7 +8,7 @@ test_description='Test git update-ref and basic ref logging'
 
 Z=$ZERO_OID
 
-m=refs/heads/master
+m=refs/heads/main
 n_dir=refs/heads/gu
 n=$n_dir/fixes
 outside=refs/foo
@@ -258,7 +258,7 @@ test_expect_success "(not) changed .git/$m" '
 	! test $B = $(git show-ref -s --verify $m)
 '
 
-rm -f .git/logs/refs/heads/master
+rm -f .git/logs/refs/heads/main
 test_expect_success "create $m (logged by touch)" '
 	test_config core.logAllRefUpdates false &&
 	GIT_COMMITTER_DATE="2005-05-26 23:30" \
@@ -294,7 +294,7 @@ test_expect_success 'symref empty directory removal' '
 	git branch e1/e2/r1 HEAD &&
 	git branch e1/r2 HEAD &&
 	git checkout e1/e2/r1 &&
-	test_when_finished "git checkout master" &&
+	test_when_finished "git checkout main" &&
 	test_path_is_file .git/refs/heads/e1/e2/r1 &&
 	test_path_is_file .git/logs/refs/heads/e1/e2/r1 &&
 	git update-ref -d HEAD &&
@@ -358,68 +358,68 @@ test_expect_success 'set up for querying the reflog' '
 ed="Thu, 26 May 2005 18:32:00 -0500"
 gd="Thu, 26 May 2005 18:33:00 -0500"
 ld="Thu, 26 May 2005 18:43:00 -0500"
-test_expect_success 'Query "master@{May 25 2005}" (before history)' '
+test_expect_success 'Query "main@{May 25 2005}" (before history)' '
 	test_when_finished "rm -f o e" &&
-	git rev-parse --verify "master@{May 25 2005}" >o 2>e &&
+	git rev-parse --verify "main@{May 25 2005}" >o 2>e &&
 	echo "$C" >expect &&
 	test_cmp expect o &&
-	echo "warning: log for '\''master'\'' only goes back to $ed" >expect &&
+	echo "warning: log for '\''main'\'' only goes back to $ed" >expect &&
 	test_i18ncmp expect e
 '
-test_expect_success 'Query master@{2005-05-25} (before history)' '
+test_expect_success 'Query main@{2005-05-25} (before history)' '
 	test_when_finished "rm -f o e" &&
-	git rev-parse --verify master@{2005-05-25} >o 2>e &&
+	git rev-parse --verify main@{2005-05-25} >o 2>e &&
 	echo "$C" >expect &&
 	test_cmp expect o &&
-	echo "warning: log for '\''master'\'' only goes back to $ed" >expect &&
+	echo "warning: log for '\''main'\'' only goes back to $ed" >expect &&
 	test_i18ncmp expect e
 '
-test_expect_success 'Query "master@{May 26 2005 23:31:59}" (1 second before history)' '
+test_expect_success 'Query "main@{May 26 2005 23:31:59}" (1 second before history)' '
 	test_when_finished "rm -f o e" &&
-	git rev-parse --verify "master@{May 26 2005 23:31:59}" >o 2>e &&
+	git rev-parse --verify "main@{May 26 2005 23:31:59}" >o 2>e &&
 	echo "$C" >expect &&
 	test_cmp expect o &&
-	echo "warning: log for '\''master'\'' only goes back to $ed" >expect &&
+	echo "warning: log for '\''main'\'' only goes back to $ed" >expect &&
 	test_i18ncmp expect e
 '
-test_expect_success 'Query "master@{May 26 2005 23:32:00}" (exactly history start)' '
+test_expect_success 'Query "main@{May 26 2005 23:32:00}" (exactly history start)' '
 	test_when_finished "rm -f o e" &&
-	git rev-parse --verify "master@{May 26 2005 23:32:00}" >o 2>e &&
+	git rev-parse --verify "main@{May 26 2005 23:32:00}" >o 2>e &&
 	echo "$C" >expect &&
 	test_cmp expect o &&
 	test_must_be_empty e
 '
-test_expect_success 'Query "master@{May 26 2005 23:32:30}" (first non-creation change)' '
+test_expect_success 'Query "main@{May 26 2005 23:32:30}" (first non-creation change)' '
 	test_when_finished "rm -f o e" &&
-	git rev-parse --verify "master@{May 26 2005 23:32:30}" >o 2>e &&
+	git rev-parse --verify "main@{May 26 2005 23:32:30}" >o 2>e &&
 	echo "$A" >expect &&
 	test_cmp expect o &&
 	test_must_be_empty e
 '
-test_expect_success 'Query "master@{2005-05-26 23:33:01}" (middle of history with gap)' '
+test_expect_success 'Query "main@{2005-05-26 23:33:01}" (middle of history with gap)' '
 	test_when_finished "rm -f o e" &&
-	git rev-parse --verify "master@{2005-05-26 23:33:01}" >o 2>e &&
+	git rev-parse --verify "main@{2005-05-26 23:33:01}" >o 2>e &&
 	echo "$B" >expect &&
 	test_cmp expect o &&
 	test_i18ngrep -F "warning: log for ref $m has gap after $gd" e
 '
-test_expect_success 'Query "master@{2005-05-26 23:38:00}" (middle of history)' '
+test_expect_success 'Query "main@{2005-05-26 23:38:00}" (middle of history)' '
 	test_when_finished "rm -f o e" &&
-	git rev-parse --verify "master@{2005-05-26 23:38:00}" >o 2>e &&
+	git rev-parse --verify "main@{2005-05-26 23:38:00}" >o 2>e &&
 	echo "$Z" >expect &&
 	test_cmp expect o &&
 	test_must_be_empty e
 '
-test_expect_success 'Query "master@{2005-05-26 23:43:00}" (exact end of history)' '
+test_expect_success 'Query "main@{2005-05-26 23:43:00}" (exact end of history)' '
 	test_when_finished "rm -f o e" &&
-	git rev-parse --verify "master@{2005-05-26 23:43:00}" >o 2>e &&
+	git rev-parse --verify "main@{2005-05-26 23:43:00}" >o 2>e &&
 	echo "$E" >expect &&
 	test_cmp expect o &&
 	test_must_be_empty e
 '
-test_expect_success 'Query "master@{2005-05-28}" (past end of history)' '
+test_expect_success 'Query "main@{2005-05-28}" (past end of history)' '
 	test_when_finished "rm -f o e" &&
-	git rev-parse --verify "master@{2005-05-28}" >o 2>e &&
+	git rev-parse --verify "main@{2005-05-28}" >o 2>e &&
 	echo "$D" >expect &&
 	test_cmp expect o &&
 	test_i18ngrep -F "warning: log for ref $m unexpectedly ended on $ld" e
@@ -461,14 +461,14 @@ test_expect_success 'git commit logged updates' '
 '
 unset h_TEST h_OTHER h_FIXED h_MERGED
 
-test_expect_success 'git cat-file blob master:F (expect OTHER)' '
-	test OTHER = $(git cat-file blob master:F)
+test_expect_success 'git cat-file blob main:F (expect OTHER)' '
+	test OTHER = $(git cat-file blob main:F)
 '
-test_expect_success 'git cat-file blob master@{2005-05-26 23:30}:F (expect TEST)' '
-	test TEST = $(git cat-file blob "master@{2005-05-26 23:30}:F")
+test_expect_success 'git cat-file blob main@{2005-05-26 23:30}:F (expect TEST)' '
+	test TEST = $(git cat-file blob "main@{2005-05-26 23:30}:F")
 '
-test_expect_success 'git cat-file blob master@{2005-05-26 23:42}:F (expect OTHER)' '
-	test OTHER = $(git cat-file blob "master@{2005-05-26 23:42}:F")
+test_expect_success 'git cat-file blob main@{2005-05-26 23:42}:F (expect OTHER)' '
+	test OTHER = $(git cat-file blob "main@{2005-05-26 23:42}:F")
 '
 
 # Test adding and deleting pseudorefs
@@ -580,9 +580,9 @@ test_expect_success 'stdin fails on unknown command' '
 '
 
 test_expect_success 'stdin fails on unbalanced quotes' '
-	echo "create $a \"master" >stdin &&
+	echo "create $a \"main" >stdin &&
 	test_must_fail git update-ref --stdin <stdin 2>err &&
-	grep "fatal: badly quoted argument: \\\"master" err
+	grep "fatal: badly quoted argument: \\\"main" err
 '
 
 test_expect_success PREPARE_FOR_MAIN_BRANCH 'stdin fails on invalid escape' '
@@ -592,9 +592,9 @@ test_expect_success PREPARE_FOR_MAIN_BRANCH 'stdin fails on invalid escape' '
 '
 
 test_expect_success 'stdin fails on junk after quoted argument' '
-	echo "create \"$a\"master" >stdin &&
+	echo "create \"$a\"main" >stdin &&
 	test_must_fail git update-ref --stdin <stdin 2>err &&
-	grep "fatal: unexpected character after quoted argument: \\\"$a\\\"master" err
+	grep "fatal: unexpected character after quoted argument: \\\"$a\\\"main" err
 '
 
 test_expect_success 'stdin fails create with no ref' '
diff --git a/t/t1402-check-ref-format.sh b/t/t1402-check-ref-format.sh
index 98e4a8613b..c19fa344d1 100755
--- a/t/t1402-check-ref-format.sh
+++ b/t/t1402-check-ref-format.sh
@@ -134,15 +134,15 @@ valid_ref !MINGW "$ref" '--refspec-pattern --allow-onelevel --normalize'
 test_expect_success "check-ref-format --branch @{-1}" '
 	T=$(git write-tree) &&
 	sha1=$(echo A | git commit-tree $T) &&
-	git update-ref refs/heads/master $sha1 &&
-	git update-ref refs/remotes/origin/master $sha1 &&
-	git checkout master &&
-	git checkout origin/master &&
-	git checkout master &&
+	git update-ref refs/heads/main $sha1 &&
+	git update-ref refs/remotes/origin/main $sha1 &&
+	git checkout main &&
+	git checkout origin/main &&
+	git checkout main &&
 	refname=$(git check-ref-format --branch @{-1}) &&
 	test "$refname" = "$sha1" &&
 	refname2=$(git check-ref-format --branch @{-2}) &&
-	test "$refname2" = master'
+	test "$refname2" = main'
 
 test_expect_success 'check-ref-format --branch -naster' '
 	test_must_fail git check-ref-format --branch -naster >actual &&
@@ -154,11 +154,11 @@ test_expect_success 'check-ref-format --branch from subdir' '
 
 	T=$(git write-tree) &&
 	sha1=$(echo A | git commit-tree $T) &&
-	git update-ref refs/heads/master $sha1 &&
-	git update-ref refs/remotes/origin/master $sha1 &&
-	git checkout master &&
-	git checkout origin/master &&
-	git checkout master &&
+	git update-ref refs/heads/main $sha1 &&
+	git update-ref refs/remotes/origin/main $sha1 &&
+	git checkout main &&
+	git checkout origin/main &&
+	git checkout main &&
 	refname=$(
 		cd subdir &&
 		git check-ref-format --branch @{-1}
@@ -171,9 +171,9 @@ test_expect_success 'check-ref-format --branch @{-1} from non-repo' '
 	test_must_be_empty actual
 '
 
-test_expect_success 'check-ref-format --branch master from non-repo' '
-	echo master >expect &&
-	nongit git check-ref-format --branch master >actual &&
+test_expect_success 'check-ref-format --branch main from non-repo' '
+	echo main >expect &&
+	nongit git check-ref-format --branch main >actual &&
 	test_cmp expect actual
 '
 
diff --git a/t/t1403-show-ref.sh b/t/t1403-show-ref.sh
index 5d955c3bff..681b7022c3 100755
--- a/t/t1403-show-ref.sh
+++ b/t/t1403-show-ref.sh
@@ -9,7 +9,7 @@ test_expect_success setup '
 	git checkout -b side &&
 	test_commit B &&
 	git tag -f -a -m "annotated B" B &&
-	git checkout master &&
+	git checkout main &&
 	test_commit C &&
 	git branch B A^0
 '
@@ -92,23 +92,23 @@ test_expect_success 'show-ref -d' '
 	git show-ref --verify -d refs/tags/A refs/tags/C >actual &&
 	test_cmp expect actual &&
 
-	echo $(git rev-parse refs/heads/master) refs/heads/master >expect &&
-	git show-ref -d master >actual &&
+	echo $(git rev-parse refs/heads/main) refs/heads/main >expect &&
+	git show-ref -d main >actual &&
 	test_cmp expect actual &&
 
-	git show-ref -d heads/master >actual &&
+	git show-ref -d heads/main >actual &&
 	test_cmp expect actual &&
 
-	git show-ref -d refs/heads/master >actual &&
+	git show-ref -d refs/heads/main >actual &&
 	test_cmp expect actual &&
 
-	git show-ref -d --verify refs/heads/master >actual &&
+	git show-ref -d --verify refs/heads/main >actual &&
 	test_cmp expect actual &&
 
-	test_must_fail git show-ref -d --verify master >actual &&
+	test_must_fail git show-ref -d --verify main >actual &&
 	test_must_be_empty actual &&
 
-	test_must_fail git show-ref -d --verify heads/master >actual &&
+	test_must_fail git show-ref -d --verify heads/main >actual &&
 	test_must_be_empty actual &&
 
 	test_must_fail git show-ref --verify -d A C >actual &&
@@ -120,7 +120,7 @@ test_expect_success 'show-ref -d' '
 '
 
 test_expect_success 'show-ref --heads, --tags, --head, pattern' '
-	for branch in B master side
+	for branch in B main side
 	do
 		echo $(git rev-parse refs/heads/$branch) refs/heads/$branch
 	done >expect.heads &&
diff --git a/t/t1405-main-ref-store.sh b/t/t1405-main-ref-store.sh
index 74af927fba..5661df799b 100755
--- a/t/t1405-main-ref-store.sh
+++ b/t/t1405-main-ref-store.sh
@@ -21,9 +21,9 @@ test_expect_success 'peel_ref(new-tag)' '
 	test_cmp expected actual
 '
 
-test_expect_success 'create_symref(FOO, refs/heads/master)' '
-	$RUN create-symref FOO refs/heads/master nothing &&
-	echo refs/heads/master >expected &&
+test_expect_success 'create_symref(FOO, refs/heads/main)' '
+	$RUN create-symref FOO refs/heads/main nothing &&
+	echo refs/heads/main >expected &&
 	git symbolic-ref FOO >actual &&
 	test_cmp expected actual
 '
@@ -31,7 +31,7 @@ test_expect_success 'create_symref(FOO, refs/heads/master)' '
 test_expect_success 'delete_refs(FOO, refs/tags/new-tag)' '
 	git rev-parse FOO -- &&
 	git rev-parse refs/tags/new-tag -- &&
-	m=$(git rev-parse master) &&
+	m=$(git rev-parse main) &&
 	REF_NO_DEREF=1 &&
 	$RUN delete-refs $REF_NO_DEREF nothing FOO refs/tags/new-tag &&
 	test_must_fail git rev-parse --symbolic-full-name FOO &&
@@ -39,19 +39,19 @@ test_expect_success 'delete_refs(FOO, refs/tags/new-tag)' '
 	test_must_fail git rev-parse refs/tags/new-tag --
 '
 
-test_expect_success 'rename_refs(master, new-master)' '
-	git rev-parse master >expected &&
-	$RUN rename-ref refs/heads/master refs/heads/new-master &&
-	git rev-parse new-master >actual &&
+test_expect_success 'rename_refs(main, new-main)' '
+	git rev-parse main >expected &&
+	$RUN rename-ref refs/heads/main refs/heads/new-main &&
+	git rev-parse new-main >actual &&
 	test_cmp expected actual &&
-	test_commit recreate-master
+	test_commit recreate-main
 '
 
 test_expect_success 'for_each_ref(refs/heads/)' '
 	$RUN for-each-ref refs/heads/ | cut -d" " -f 2- >actual &&
 	cat >expected <<-\EOF &&
-	master 0x0
-	new-master 0x0
+	main 0x0
+	new-main 0x0
 	EOF
 	test_cmp expected actual
 '
@@ -62,23 +62,23 @@ test_expect_success 'for_each_ref() is sorted' '
 	test_cmp expected actual
 '
 
-test_expect_success 'resolve_ref(new-master)' '
-	SHA1=`git rev-parse new-master` &&
-	echo "$SHA1 refs/heads/new-master 0x0" >expected &&
-	$RUN resolve-ref refs/heads/new-master 0 >actual &&
+test_expect_success 'resolve_ref(new-main)' '
+	SHA1=`git rev-parse new-main` &&
+	echo "$SHA1 refs/heads/new-main 0x0" >expected &&
+	$RUN resolve-ref refs/heads/new-main 0 >actual &&
 	test_cmp expected actual
 '
 
-test_expect_success 'verify_ref(new-master)' '
-	$RUN verify-ref refs/heads/new-master
+test_expect_success 'verify_ref(new-main)' '
+	$RUN verify-ref refs/heads/new-main
 '
 
 test_expect_success 'for_each_reflog()' '
 	$RUN for-each-reflog | sort -k2 | cut -d" " -f 2- >actual &&
 	cat >expected <<-\EOF &&
 	HEAD 0x1
-	refs/heads/master 0x0
-	refs/heads/new-master 0x0
+	refs/heads/main 0x0
+	refs/heads/new-main 0x0
 	EOF
 	test_cmp expected actual
 '
@@ -86,12 +86,12 @@ test_expect_success 'for_each_reflog()' '
 test_expect_success 'for_each_reflog_ent()' '
 	$RUN for-each-reflog-ent HEAD >actual &&
 	head -n1 actual | grep one &&
-	tail -n2 actual | head -n1 | grep recreate-master
+	tail -n2 actual | head -n1 | grep recreate-main
 '
 
 test_expect_success 'for_each_reflog_ent_reverse()' '
 	$RUN for-each-reflog-ent-reverse HEAD >actual &&
-	head -n1 actual | grep recreate-master &&
+	head -n1 actual | grep recreate-main &&
 	tail -n2 actual | head -n1 | grep one
 '
 
diff --git a/t/t1406-submodule-ref-store.sh b/t/t1406-submodule-ref-store.sh
index 36b7ef5046..e3e3b9c84c 100755
--- a/t/t1406-submodule-ref-store.sh
+++ b/t/t1406-submodule-ref-store.sh
@@ -11,7 +11,7 @@ test_expect_success 'setup' '
 	(
 		cd sub &&
 		test_commit first &&
-		git checkout -b new-master
+		git checkout -b new-main
 	)
 '
 
@@ -27,7 +27,7 @@ test_expect_success 'peel_ref(new-tag)' '
 '
 
 test_expect_success 'create_symref() not allowed' '
-	test_must_fail $RUN create-symref FOO refs/heads/master nothing
+	test_must_fail $RUN create-symref FOO refs/heads/main nothing
 '
 
 test_expect_success 'delete_refs() not allowed' '
@@ -35,14 +35,14 @@ test_expect_success 'delete_refs() not allowed' '
 '
 
 test_expect_success 'rename_refs() not allowed' '
-	test_must_fail $RUN rename-ref refs/heads/master refs/heads/new-master
+	test_must_fail $RUN rename-ref refs/heads/main refs/heads/new-main
 '
 
 test_expect_success 'for_each_ref(refs/heads/)' '
 	$RUN for-each-ref refs/heads/ | cut -d" " -f 2- >actual &&
 	cat >expected <<-\EOF &&
-	master 0x0
-	new-master 0x0
+	main 0x0
+	new-main 0x0
 	EOF
 	test_cmp expected actual
 '
@@ -53,23 +53,23 @@ test_expect_success 'for_each_ref() is sorted' '
 	test_cmp expected actual
 '
 
-test_expect_success 'resolve_ref(master)' '
-	SHA1=`git -C sub rev-parse master` &&
-	echo "$SHA1 refs/heads/master 0x0" >expected &&
-	$RUN resolve-ref refs/heads/master 0 >actual &&
+test_expect_success 'resolve_ref(main)' '
+	SHA1=`git -C sub rev-parse main` &&
+	echo "$SHA1 refs/heads/main 0x0" >expected &&
+	$RUN resolve-ref refs/heads/main 0 >actual &&
 	test_cmp expected actual
 '
 
-test_expect_success 'verify_ref(new-master)' '
-	$RUN verify-ref refs/heads/new-master
+test_expect_success 'verify_ref(new-main)' '
+	$RUN verify-ref refs/heads/new-main
 '
 
 test_expect_success 'for_each_reflog()' '
 	$RUN for-each-reflog | sort | cut -d" " -f 2- >actual &&
 	cat >expected <<-\EOF &&
 	HEAD 0x1
-	refs/heads/master 0x0
-	refs/heads/new-master 0x0
+	refs/heads/main 0x0
+	refs/heads/new-main 0x0
 	EOF
 	test_cmp expected actual
 '
@@ -77,12 +77,12 @@ test_expect_success 'for_each_reflog()' '
 test_expect_success 'for_each_reflog_ent()' '
 	$RUN for-each-reflog-ent HEAD >actual &&
 	head -n1 actual | grep first &&
-	tail -n2 actual | head -n1 | grep master.to.new
+	tail -n2 actual | head -n1 | grep main.to.new
 '
 
 test_expect_success 'for_each_reflog_ent_reverse()' '
 	$RUN for-each-reflog-ent-reverse HEAD >actual &&
-	head -n1 actual | grep master.to.new &&
+	head -n1 actual | grep main.to.new &&
 	tail -n2 actual | head -n1 | grep first
 '
 
diff --git a/t/t1407-worktree-ref-store.sh b/t/t1407-worktree-ref-store.sh
index 9a84858118..71059cb254 100755
--- a/t/t1407-worktree-ref-store.sh
+++ b/t/t1407-worktree-ref-store.sh
@@ -9,7 +9,7 @@ RMAIN="test-tool ref-store worktree:main"
 
 test_expect_success 'setup' '
 	test_commit first &&
-	git worktree add -b wt-master wt &&
+	git worktree add -b wt-main wt &&
 	(
 		cd wt &&
 		test_commit second
@@ -17,34 +17,34 @@ test_expect_success 'setup' '
 '
 
 test_expect_success 'resolve_ref(<shared-ref>)' '
-	SHA1=`git rev-parse master` &&
-	echo "$SHA1 refs/heads/master 0x0" >expected &&
-	$RWT resolve-ref refs/heads/master 0 >actual &&
+	SHA1=`git rev-parse main` &&
+	echo "$SHA1 refs/heads/main 0x0" >expected &&
+	$RWT resolve-ref refs/heads/main 0 >actual &&
 	test_cmp expected actual &&
-	$RMAIN resolve-ref refs/heads/master 0 >actual &&
+	$RMAIN resolve-ref refs/heads/main 0 >actual &&
 	test_cmp expected actual
 '
 
 test_expect_success 'resolve_ref(<per-worktree-ref>)' '
 	SHA1=`git -C wt rev-parse HEAD` &&
-	echo "$SHA1 refs/heads/wt-master 0x1" >expected &&
+	echo "$SHA1 refs/heads/wt-main 0x1" >expected &&
 	$RWT resolve-ref HEAD 0 >actual &&
 	test_cmp expected actual &&
 
 	SHA1=`git rev-parse HEAD` &&
-	echo "$SHA1 refs/heads/master 0x1" >expected &&
+	echo "$SHA1 refs/heads/main 0x1" >expected &&
 	$RMAIN resolve-ref HEAD 0 >actual &&
 	test_cmp expected actual
 '
 
-test_expect_success 'create_symref(FOO, refs/heads/master)' '
-	$RWT create-symref FOO refs/heads/master nothing &&
-	echo refs/heads/master >expected &&
+test_expect_success 'create_symref(FOO, refs/heads/main)' '
+	$RWT create-symref FOO refs/heads/main nothing &&
+	echo refs/heads/main >expected &&
 	git -C wt symbolic-ref FOO >actual &&
 	test_cmp expected actual &&
 
-	$RMAIN create-symref FOO refs/heads/wt-master nothing &&
-	echo refs/heads/wt-master >expected &&
+	$RMAIN create-symref FOO refs/heads/wt-main nothing &&
+	echo refs/heads/wt-main >expected &&
 	git symbolic-ref FOO >actual &&
 	test_cmp expected actual
 '
@@ -63,8 +63,8 @@ test_expect_success 'for_each_reflog()' '
 	HEAD 0x1
 	PSEUDO-WT 0x0
 	refs/bisect/wt-random 0x0
-	refs/heads/master 0x0
-	refs/heads/wt-master 0x0
+	refs/heads/main 0x0
+	refs/heads/wt-main 0x0
 	EOF
 	test_cmp expected actual &&
 
@@ -73,8 +73,8 @@ test_expect_success 'for_each_reflog()' '
 	HEAD 0x1
 	PSEUDO-MAIN 0x0
 	refs/bisect/random 0x0
-	refs/heads/master 0x0
-	refs/heads/wt-master 0x0
+	refs/heads/main 0x0
+	refs/heads/wt-main 0x0
 	EOF
 	test_cmp expected actual
 '
diff --git a/t/t1408-packed-refs.sh b/t/t1408-packed-refs.sh
index 1e44a17eea..f40e7af8ce 100755
--- a/t/t1408-packed-refs.sh
+++ b/t/t1408-packed-refs.sh
@@ -9,32 +9,32 @@ test_expect_success setup '
 	git commit --allow-empty -m one &&
 	one=$(git rev-parse HEAD) &&
 	git for-each-ref >actual &&
-	echo "$one commit	refs/heads/master" >expect &&
+	echo "$one commit	refs/heads/main" >expect &&
 	test_cmp expect actual &&
 
 	git pack-refs --all &&
 	git for-each-ref >actual &&
-	echo "$one commit	refs/heads/master" >expect &&
+	echo "$one commit	refs/heads/main" >expect &&
 	test_cmp expect actual &&
 
 	git checkout --orphan another &&
 	test_tick &&
 	git commit --allow-empty -m two &&
 	two=$(git rev-parse HEAD) &&
-	git checkout -B master &&
+	git checkout -B main &&
 	git branch -D another &&
 
 	git for-each-ref >actual &&
-	echo "$two commit	refs/heads/master" >expect &&
+	echo "$two commit	refs/heads/main" >expect &&
 	test_cmp expect actual &&
 
 	git reflog expire --expire=now --all &&
 	git prune &&
-	git tag -m v1.0 v1.0 master
+	git tag -m v1.0 v1.0 main
 '
 
 test_expect_success 'no error from stale entry in packed-refs' '
-	git describe master >actual 2>&1 &&
+	git describe main >actual 2>&1 &&
 	echo "v1.0" >expect &&
 	test_cmp expect actual
 '
diff --git a/t/t1410-reflog.sh b/t/t1410-reflog.sh
index 730a43d9dd..8553141434 100755
--- a/t/t1410-reflog.sh
+++ b/t/t1410-reflog.sh
@@ -99,7 +99,7 @@ test_expect_success setup '
 
 	check_fsck &&
 
-	git reflog refs/heads/master >output &&
+	git reflog refs/heads/main >output &&
 	test_line_count = 4 output
 '
 
@@ -116,7 +116,7 @@ test_expect_success rewind '
 
 	check_have A B C D E F G H I J K L &&
 
-	git reflog refs/heads/master >output &&
+	git reflog refs/heads/main >output &&
 	test_line_count = 5 output
 '
 
@@ -135,7 +135,7 @@ test_expect_success 'reflog expire --dry-run should not touch reflog' '
 		--stale-fix \
 		--all &&
 
-	git reflog refs/heads/master >output &&
+	git reflog refs/heads/main >output &&
 	test_line_count = 5 output &&
 
 	check_fsck "missing blob $F"
@@ -149,7 +149,7 @@ test_expect_success 'reflog expire' '
 		--stale-fix \
 		--all &&
 
-	git reflog refs/heads/master >output &&
+	git reflog refs/heads/main >output &&
 	test_line_count = 2 output &&
 
 	check_fsck "dangling commit $K"
@@ -186,29 +186,29 @@ test_expect_success 'delete' '
 	git commit -m tiger C &&
 
 	HEAD_entry_count=$(git reflog | wc -l) &&
-	master_entry_count=$(git reflog show master | wc -l) &&
+	main_entry_count=$(git reflog show main | wc -l) &&
 
 	test $HEAD_entry_count = 5 &&
-	test $master_entry_count = 5 &&
+	test $main_entry_count = 5 &&
 
 
-	git reflog delete master@{1} &&
-	git reflog show master > output &&
-	test_line_count = $(($master_entry_count - 1)) output &&
+	git reflog delete main@{1} &&
+	git reflog show main > output &&
+	test_line_count = $(($main_entry_count - 1)) output &&
 	test $HEAD_entry_count = $(git reflog | wc -l) &&
 	! grep ox < output &&
 
-	master_entry_count=$(wc -l < output) &&
+	main_entry_count=$(wc -l < output) &&
 
 	git reflog delete HEAD@{1} &&
 	test $(($HEAD_entry_count -1)) = $(git reflog | wc -l) &&
-	test $master_entry_count = $(git reflog show master | wc -l) &&
+	test $main_entry_count = $(git reflog show main | wc -l) &&
 
 	HEAD_entry_count=$(git reflog | wc -l) &&
 
-	git reflog delete master@{07.04.2005.15:15:00.-0700} &&
-	git reflog show master > output &&
-	test_line_count = $(($master_entry_count - 1)) output &&
+	git reflog delete main@{07.04.2005.15:15:00.-0700} &&
+	git reflog show main > output &&
+	test_line_count = $(($main_entry_count - 1)) output &&
 	! grep dragon < output
 
 '
@@ -216,7 +216,7 @@ test_expect_success 'delete' '
 test_expect_success 'rewind2' '
 
 	test_tick && git reset --hard HEAD~2 &&
-	git reflog refs/heads/master >output &&
+	git reflog refs/heads/main >output &&
 	test_line_count = 4 output
 '
 
@@ -226,7 +226,7 @@ test_expect_success '--expire=never' '
 		--expire=never \
 		--expire-unreachable=never \
 		--all &&
-	git reflog refs/heads/master >output &&
+	git reflog refs/heads/main >output &&
 	test_line_count = 4 output
 '
 
@@ -237,7 +237,7 @@ test_expect_success 'gc.reflogexpire=never' '
 	git reflog expire --verbose --all >output &&
 	test_line_count = 9 output &&
 
-	git reflog refs/heads/master >output &&
+	git reflog refs/heads/main >output &&
 	test_line_count = 4 output
 '
 
@@ -246,7 +246,7 @@ test_expect_success 'gc.reflogexpire=false' '
 	test_config gc.reflogexpireunreachable false &&
 
 	git reflog expire --verbose --all &&
-	git reflog refs/heads/master >output &&
+	git reflog refs/heads/main >output &&
 	test_line_count = 4 output
 
 '
@@ -255,33 +255,33 @@ test_expect_success 'git reflog expire unknown reference' '
 	test_config gc.reflogexpire never &&
 	test_config gc.reflogexpireunreachable never &&
 
-	test_must_fail git reflog expire master@{123} 2>stderr &&
+	test_must_fail git reflog expire main@{123} 2>stderr &&
 	test_i18ngrep "points nowhere" stderr &&
 	test_must_fail git reflog expire does-not-exist 2>stderr &&
 	test_i18ngrep "points nowhere" stderr
 '
 
 test_expect_success 'checkout should not delete log for packed ref' '
-	test $(git reflog master | wc -l) = 4 &&
+	test $(git reflog main | wc -l) = 4 &&
 	git branch foo &&
 	git pack-refs --all &&
 	git checkout foo &&
-	test $(git reflog master | wc -l) = 4
+	test $(git reflog main | wc -l) = 4
 '
 
 test_expect_success 'stale dirs do not cause d/f conflicts (reflogs on)' '
 	test_when_finished "git branch -d one || git branch -d one/two" &&
 
-	git branch one/two master &&
-	echo "one/two@{0} branch: Created from master" >expect &&
+	git branch one/two main &&
+	echo "one/two@{0} branch: Created from main" >expect &&
 	git log -g --format="%gd %gs" one/two >actual &&
 	test_cmp expect actual &&
 	git branch -d one/two &&
 
 	# now logs/refs/heads/one is a stale directory, but
 	# we should move it out of the way to create "one" reflog
-	git branch one master &&
-	echo "one@{0} branch: Created from master" >expect &&
+	git branch one main &&
+	echo "one@{0} branch: Created from main" >expect &&
 	git log -g --format="%gd %gs" one >actual &&
 	test_cmp expect actual
 '
@@ -289,15 +289,15 @@ test_expect_success 'stale dirs do not cause d/f conflicts (reflogs on)' '
 test_expect_success 'stale dirs do not cause d/f conflicts (reflogs off)' '
 	test_when_finished "git branch -d one || git branch -d one/two" &&
 
-	git branch one/two master &&
-	echo "one/two@{0} branch: Created from master" >expect &&
+	git branch one/two main &&
+	echo "one/two@{0} branch: Created from main" >expect &&
 	git log -g --format="%gd %gs" one/two >actual &&
 	test_cmp expect actual &&
 	git branch -d one/two &&
 
 	# same as before, but we only create a reflog for "one" if
 	# it already exists, which it does not
-	git -c core.logallrefupdates=false branch one master &&
+	git -c core.logallrefupdates=false branch one main &&
 	git log -g --format="%gd %gs" one >actual &&
 	test_must_be_empty actual
 '
diff --git a/t/t1411-reflog-show.sh b/t/t1411-reflog-show.sh
index 985daf1def..333b35aebc 100755
--- a/t/t1411-reflog-show.sh
+++ b/t/t1411-reflog-show.sh
@@ -167,7 +167,7 @@ test_expect_success 'git log -g -p shows diffs vs. parents' '
 '
 
 test_expect_success 'reflog exists works' '
-	git reflog exists refs/heads/master &&
+	git reflog exists refs/heads/main &&
 	! git reflog exists refs/heads/nonexistent
 '
 
diff --git a/t/t1413-reflog-detach.sh b/t/t1413-reflog-detach.sh
index c730600d8a..b1f7f35fe9 100755
--- a/t/t1413-reflog-detach.sh
+++ b/t/t1413-reflog-detach.sh
@@ -4,7 +4,7 @@ test_description='Test reflog interaction with detached HEAD'
 . ./test-lib.sh
 
 reset_state () {
-	git checkout master &&
+	git checkout main &&
 	cp saved_reflog .git/logs/HEAD
 }
 
@@ -19,14 +19,14 @@ test_expect_success setup '
 
 test_expect_success baseline '
 	reset_state &&
-	git rev-parse master master^ >expect &&
+	git rev-parse main main^ >expect &&
 	git log -g --format=%H >actual &&
 	test_cmp expect actual
 '
 
 test_expect_success 'switch to branch' '
 	reset_state &&
-	git rev-parse side master master^ >expect &&
+	git rev-parse side main main^ >expect &&
 	git checkout side &&
 	git log -g --format=%H >actual &&
 	test_cmp expect actual
@@ -34,34 +34,34 @@ test_expect_success 'switch to branch' '
 
 test_expect_success 'detach to other' '
 	reset_state &&
-	git rev-parse master side master master^ >expect &&
+	git rev-parse main side main main^ >expect &&
 	git checkout side &&
-	git checkout master^0 &&
+	git checkout main^0 &&
 	git log -g --format=%H >actual &&
 	test_cmp expect actual
 '
 
 test_expect_success 'detach to self' '
 	reset_state &&
-	git rev-parse master master master^ >expect &&
-	git checkout master^0 &&
+	git rev-parse main main main^ >expect &&
+	git checkout main^0 &&
 	git log -g --format=%H >actual &&
 	test_cmp expect actual
 '
 
 test_expect_success 'attach to self' '
 	reset_state &&
-	git rev-parse master master master master^ >expect &&
-	git checkout master^0 &&
-	git checkout master &&
+	git rev-parse main main main main^ >expect &&
+	git checkout main^0 &&
+	git checkout main &&
 	git log -g --format=%H >actual &&
 	test_cmp expect actual
 '
 
 test_expect_success 'attach to other' '
 	reset_state &&
-	git rev-parse side master master master^ >expect &&
-	git checkout master^0 &&
+	git rev-parse side main main main^ >expect &&
+	git checkout main^0 &&
 	git checkout side &&
 	git log -g --format=%H >actual &&
 	test_cmp expect actual
diff --git a/t/t1414-reflog-walk.sh b/t/t1414-reflog-walk.sh
index 1181a9fb28..89458b7158 100755
--- a/t/t1414-reflog-walk.sh
+++ b/t/t1414-reflog-walk.sh
@@ -8,7 +8,7 @@ test_expect_success 'set up some reflog entries' '
 	test_commit two &&
 	git checkout -b side HEAD^ &&
 	test_commit three &&
-	git merge --no-commit master &&
+	git merge --no-commit main &&
 	echo evil-merge-content >>one.t &&
 	test_tick &&
 	git commit --no-edit -a
@@ -20,9 +20,9 @@ do_walk () {
 
 test_expect_success 'set up expected reflog' '
 	cat >expect.all <<-EOF
-	HEAD@{0} commit (merge): Merge branch ${SQ}master${SQ} into side
+	HEAD@{0} commit (merge): Merge branch ${SQ}main${SQ} into side
 	HEAD@{1} commit: three
-	HEAD@{2} checkout: moving from master to side
+	HEAD@{2} checkout: moving from main to side
 	HEAD@{3} commit: two
 	HEAD@{4} commit (initial): one
 	EOF
@@ -73,15 +73,15 @@ test_expect_success 'walking multiple reflogs shows all' '
 	#      sort ignores the bits after the timestamp.
 	#
 	#   2. POSIX leaves undefined whether this is a stable sort or not. So
-	#      we use "-k 1" to ensure that we see HEAD before master before
+	#      we use "-k 1" to ensure that we see HEAD before main before
 	#      side when breaking ties.
 	{
 		do_walk --date=unix HEAD &&
 		do_walk --date=unix side &&
-		do_walk --date=unix master
+		do_walk --date=unix main
 	} >expect.raw &&
 	sort -t "{" -k 2nr -k 1 <expect.raw >expect &&
-	do_walk --date=unix HEAD master side >actual &&
+	do_walk --date=unix HEAD main side >actual &&
 	test_cmp expect actual
 '
 
diff --git a/t/t1416-ref-transaction-hooks.sh b/t/t1416-ref-transaction-hooks.sh
index f6e741c6c0..4cabc07c86 100755
--- a/t/t1416-ref-transaction-hooks.sh
+++ b/t/t1416-ref-transaction-hooks.sh
@@ -53,11 +53,11 @@ test_expect_success 'hook gets all queued updates in prepared state' '
 	EOF
 	cat >expect <<-EOF &&
 		$ZERO_OID $POST_OID HEAD
-		$ZERO_OID $POST_OID refs/heads/master
+		$ZERO_OID $POST_OID refs/heads/main
 	EOF
 	git update-ref HEAD POST <<-EOF &&
 		update HEAD $ZERO_OID $POST_OID
-		update refs/heads/master $ZERO_OID $POST_OID
+		update refs/heads/main $ZERO_OID $POST_OID
 	EOF
 	test_cmp expect actual
 '
@@ -76,7 +76,7 @@ test_expect_success 'hook gets all queued updates in committed state' '
 	EOF
 	cat >expect <<-EOF &&
 		$ZERO_OID $POST_OID HEAD
-		$ZERO_OID $POST_OID refs/heads/master
+		$ZERO_OID $POST_OID refs/heads/main
 	EOF
 	git update-ref HEAD POST &&
 	test_cmp expect actual
@@ -96,12 +96,12 @@ test_expect_success 'hook gets all queued updates in aborted state' '
 	EOF
 	cat >expect <<-EOF &&
 		$ZERO_OID $POST_OID HEAD
-		$ZERO_OID $POST_OID refs/heads/master
+		$ZERO_OID $POST_OID refs/heads/main
 	EOF
 	git update-ref --stdin <<-EOF &&
 		start
 		update HEAD POST $ZERO_OID
-		update refs/heads/master POST $ZERO_OID
+		update refs/heads/main POST $ZERO_OID
 		abort
 	EOF
 	test_cmp expect actual
diff --git a/t/t1430-bad-ref-name.sh b/t/t1430-bad-ref-name.sh
index c7878a60ed..fcc0194d7e 100755
--- a/t/t1430-bad-ref-name.sh
+++ b/t/t1430-bad-ref-name.sh
@@ -17,7 +17,7 @@ test_expect_success 'fast-import: fail on invalid branch name ".badbranchname"'
 		corrupt
 		COMMIT
 
-		from refs/heads/master
+		from refs/heads/main
 
 	INPUT_END
 	test_must_fail git fast-import <input
@@ -32,14 +32,14 @@ test_expect_success 'fast-import: fail on invalid branch name "bad[branch]name"'
 		corrupt
 		COMMIT
 
-		from refs/heads/master
+		from refs/heads/main
 
 	INPUT_END
 	test_must_fail git fast-import <input
 '
 
 test_expect_success 'git branch shows badly named ref as warning' '
-	cp .git/refs/heads/master .git/refs/heads/broken...ref &&
+	cp .git/refs/heads/main .git/refs/heads/broken...ref &&
 	test_when_finished "rm -f .git/refs/heads/broken...ref" &&
 	git branch >output 2>error &&
 	test_i18ngrep -e "ignoring ref with broken name refs/heads/broken\.\.\.ref" error &&
@@ -47,7 +47,7 @@ test_expect_success 'git branch shows badly named ref as warning' '
 '
 
 test_expect_success 'branch -d can delete badly named ref' '
-	cp .git/refs/heads/master .git/refs/heads/broken...ref &&
+	cp .git/refs/heads/main .git/refs/heads/broken...ref &&
 	test_when_finished "rm -f .git/refs/heads/broken...ref" &&
 	git branch -d broken...ref &&
 	git branch >output 2>error &&
@@ -56,7 +56,7 @@ test_expect_success 'branch -d can delete badly named ref' '
 '
 
 test_expect_success 'branch -D can delete badly named ref' '
-	cp .git/refs/heads/master .git/refs/heads/broken...ref &&
+	cp .git/refs/heads/main .git/refs/heads/broken...ref &&
 	test_when_finished "rm -f .git/refs/heads/broken...ref" &&
 	git branch -D broken...ref &&
 	git branch >output 2>error &&
@@ -98,17 +98,17 @@ test_expect_success 'branch -m cannot rename to a bad ref name' '
 	test_might_fail git branch -D goodref &&
 	git branch goodref &&
 	test_must_fail git branch -m goodref broken...ref &&
-	test_cmp_rev master goodref &&
+	test_cmp_rev main goodref &&
 	git branch >output 2>error &&
 	! grep -e "broken\.\.\.ref" error &&
 	! grep -e "broken\.\.\.ref" output
 '
 
 test_expect_failure 'branch -m can rename from a bad ref name' '
-	cp .git/refs/heads/master .git/refs/heads/broken...ref &&
+	cp .git/refs/heads/main .git/refs/heads/broken...ref &&
 	test_when_finished "rm -f .git/refs/heads/broken...ref" &&
 	git branch -m broken...ref renamed &&
-	test_cmp_rev master renamed &&
+	test_cmp_rev main renamed &&
 	git branch >output 2>error &&
 	! grep -e "broken\.\.\.ref" error &&
 	! grep -e "broken\.\.\.ref" output
@@ -135,7 +135,7 @@ test_expect_failure C_LOCALE_OUTPUT 'push --mirror can delete badly named ref' '
 		cd dest &&
 		test_commit two &&
 		git checkout --detach &&
-		cp .git/refs/heads/master .git/refs/heads/broken...ref
+		cp .git/refs/heads/main .git/refs/heads/broken...ref
 	) &&
 	git -C src push --mirror "file://$top/dest" &&
 	git -C dest branch >output 2>error &&
@@ -146,7 +146,7 @@ test_expect_failure C_LOCALE_OUTPUT 'push --mirror can delete badly named ref' '
 test_expect_success 'rev-parse skips symref pointing to broken name' '
 	test_when_finished "rm -f .git/refs/heads/broken...ref" &&
 	git branch shadow one &&
-	cp .git/refs/heads/master .git/refs/heads/broken...ref &&
+	cp .git/refs/heads/main .git/refs/heads/broken...ref &&
 	printf "ref: refs/heads/broken...ref\n" >.git/refs/tags/shadow &&
 	test_when_finished "rm -f .git/refs/tags/shadow" &&
 	git rev-parse --verify one >expect &&
@@ -156,11 +156,11 @@ test_expect_success 'rev-parse skips symref pointing to broken name' '
 '
 
 test_expect_success 'for-each-ref emits warnings for broken names' '
-	cp .git/refs/heads/master .git/refs/heads/broken...ref &&
+	cp .git/refs/heads/main .git/refs/heads/broken...ref &&
 	test_when_finished "rm -f .git/refs/heads/broken...ref" &&
 	printf "ref: refs/heads/broken...ref\n" >.git/refs/heads/badname &&
 	test_when_finished "rm -f .git/refs/heads/badname" &&
-	printf "ref: refs/heads/master\n" >.git/refs/heads/broken...symref &&
+	printf "ref: refs/heads/main\n" >.git/refs/heads/broken...symref &&
 	test_when_finished "rm -f .git/refs/heads/broken...symref" &&
 	git for-each-ref >output 2>error &&
 	! grep -e "broken\.\.\.ref" output &&
@@ -172,7 +172,7 @@ test_expect_success 'for-each-ref emits warnings for broken names' '
 '
 
 test_expect_success 'update-ref -d can delete broken name' '
-	cp .git/refs/heads/master .git/refs/heads/broken...ref &&
+	cp .git/refs/heads/main .git/refs/heads/broken...ref &&
 	test_when_finished "rm -f .git/refs/heads/broken...ref" &&
 	git update-ref -d refs/heads/broken...ref >output 2>error &&
 	test_must_be_empty output &&
@@ -183,7 +183,7 @@ test_expect_success 'update-ref -d can delete broken name' '
 '
 
 test_expect_success 'branch -d can delete broken name' '
-	cp .git/refs/heads/master .git/refs/heads/broken...ref &&
+	cp .git/refs/heads/main .git/refs/heads/broken...ref &&
 	test_when_finished "rm -f .git/refs/heads/broken...ref" &&
 	git branch -d broken...ref >output 2>error &&
 	test_i18ngrep "Deleted branch broken...ref (was broken)" output &&
@@ -194,7 +194,7 @@ test_expect_success 'branch -d can delete broken name' '
 '
 
 test_expect_success 'update-ref --no-deref -d can delete symref to broken name' '
-	cp .git/refs/heads/master .git/refs/heads/broken...ref &&
+	cp .git/refs/heads/main .git/refs/heads/broken...ref &&
 	test_when_finished "rm -f .git/refs/heads/broken...ref" &&
 	printf "ref: refs/heads/broken...ref\n" >.git/refs/heads/badname &&
 	test_when_finished "rm -f .git/refs/heads/badname" &&
@@ -205,7 +205,7 @@ test_expect_success 'update-ref --no-deref -d can delete symref to broken name'
 '
 
 test_expect_success 'branch -d can delete symref to broken name' '
-	cp .git/refs/heads/master .git/refs/heads/broken...ref &&
+	cp .git/refs/heads/main .git/refs/heads/broken...ref &&
 	test_when_finished "rm -f .git/refs/heads/broken...ref" &&
 	printf "ref: refs/heads/broken...ref\n" >.git/refs/heads/badname &&
 	test_when_finished "rm -f .git/refs/heads/badname" &&
@@ -234,7 +234,7 @@ test_expect_success 'branch -d can delete dangling symref to broken name' '
 '
 
 test_expect_success 'update-ref -d can delete broken name through symref' '
-	cp .git/refs/heads/master .git/refs/heads/broken...ref &&
+	cp .git/refs/heads/main .git/refs/heads/broken...ref &&
 	test_when_finished "rm -f .git/refs/heads/broken...ref" &&
 	printf "ref: refs/heads/broken...ref\n" >.git/refs/heads/badname &&
 	test_when_finished "rm -f .git/refs/heads/badname" &&
@@ -245,7 +245,7 @@ test_expect_success 'update-ref -d can delete broken name through symref' '
 '
 
 test_expect_success 'update-ref --no-deref -d can delete symref with broken name' '
-	printf "ref: refs/heads/master\n" >.git/refs/heads/broken...symref &&
+	printf "ref: refs/heads/main\n" >.git/refs/heads/broken...symref &&
 	test_when_finished "rm -f .git/refs/heads/broken...symref" &&
 	git update-ref --no-deref -d refs/heads/broken...symref >output 2>error &&
 	test_path_is_missing .git/refs/heads/broken...symref &&
@@ -254,11 +254,11 @@ test_expect_success 'update-ref --no-deref -d can delete symref with broken name
 '
 
 test_expect_success 'branch -d can delete symref with broken name' '
-	printf "ref: refs/heads/master\n" >.git/refs/heads/broken...symref &&
+	printf "ref: refs/heads/main\n" >.git/refs/heads/broken...symref &&
 	test_when_finished "rm -f .git/refs/heads/broken...symref" &&
 	git branch -d broken...symref >output 2>error &&
 	test_path_is_missing .git/refs/heads/broken...symref &&
-	test_i18ngrep "Deleted branch broken...symref (was refs/heads/master)" output &&
+	test_i18ngrep "Deleted branch broken...symref (was refs/heads/main)" output &&
 	test_must_be_empty error
 '
 
@@ -296,37 +296,37 @@ test_expect_success 'update-ref -d cannot delete absolute path' '
 '
 
 test_expect_success 'update-ref --stdin fails create with bad ref name' '
-	echo "create ~a refs/heads/master" >stdin &&
+	echo "create ~a refs/heads/main" >stdin &&
 	test_must_fail git update-ref --stdin <stdin 2>err &&
 	grep "fatal: invalid ref format: ~a" err
 '
 
 test_expect_success 'update-ref --stdin fails update with bad ref name' '
-	echo "update ~a refs/heads/master" >stdin &&
+	echo "update ~a refs/heads/main" >stdin &&
 	test_must_fail git update-ref --stdin <stdin 2>err &&
 	grep "fatal: invalid ref format: ~a" err
 '
 
 test_expect_success 'update-ref --stdin fails delete with bad ref name' '
-	echo "delete ~a refs/heads/master" >stdin &&
+	echo "delete ~a refs/heads/main" >stdin &&
 	test_must_fail git update-ref --stdin <stdin 2>err &&
 	grep "fatal: invalid ref format: ~a" err
 '
 
 test_expect_success 'update-ref --stdin -z fails create with bad ref name' '
-	printf "%s\0" "create ~a " refs/heads/master >stdin &&
+	printf "%s\0" "create ~a " refs/heads/main >stdin &&
 	test_must_fail git update-ref -z --stdin <stdin 2>err &&
 	grep "fatal: invalid ref format: ~a " err
 '
 
 test_expect_success 'update-ref --stdin -z fails update with bad ref name' '
-	printf "%s\0" "update ~a" refs/heads/master "" >stdin &&
+	printf "%s\0" "update ~a" refs/heads/main "" >stdin &&
 	test_must_fail git update-ref -z --stdin <stdin 2>err &&
 	grep "fatal: invalid ref format: ~a" err
 '
 
 test_expect_success 'update-ref --stdin -z fails delete with bad ref name' '
-	printf "%s\0" "delete ~a" refs/heads/master >stdin &&
+	printf "%s\0" "delete ~a" refs/heads/main >stdin &&
 	test_must_fail git update-ref -z --stdin <stdin 2>err &&
 	grep "fatal: invalid ref format: ~a" err
 '
diff --git a/t/t1450-fsck.sh b/t/t1450-fsck.sh
index b17f5c21fb..a30fc5f74a 100755
--- a/t/t1450-fsck.sh
+++ b/t/t1450-fsck.sh
@@ -3,7 +3,7 @@
 test_description='git fsck random collection of tests
 
 * (HEAD) B
-* (master) A
+* (main) A
 '
 
 . ./test-lib.sh
diff --git a/t/t1500-rev-parse.sh b/t/t1500-rev-parse.sh
index 408b97d5af..a85692ffff 100755
--- a/t/t1500-rev-parse.sh
+++ b/t/t1500-rev-parse.sh
@@ -174,8 +174,8 @@ test_expect_success 'showing the superproject correctly' '
 	test_commit -C super/dir/sub branch1_commit &&
 	git -C super add dir/sub &&
 	test_commit -C super branch1_commit &&
-	git -C super checkout -b branch2 master &&
-	git -C super/dir/sub checkout -b branch2 master &&
+	git -C super checkout -b branch2 main &&
+	git -C super/dir/sub checkout -b branch2 main &&
 	test_commit -C super/dir/sub branch2_commit &&
 	git -C super add dir/sub &&
 	test_commit -C super branch2_commit &&
diff --git a/t/t1503-rev-parse-verify.sh b/t/t1503-rev-parse-verify.sh
index dc9fe3cbf1..de63186587 100755
--- a/t/t1503-rev-parse-verify.sh
+++ b/t/t1503-rev-parse-verify.sh
@@ -51,8 +51,8 @@ test_expect_success 'works with one good rev' '
 	test "$rev_hash3" = "$HASH3" &&
 	rev_hash4=$(git rev-parse --verify $HASH4) &&
 	test "$rev_hash4" = "$HASH4" &&
-	rev_master=$(git rev-parse --verify master) &&
-	test "$rev_master" = "$HASH4" &&
+	rev_main=$(git rev-parse --verify main) &&
+	test "$rev_main" = "$HASH4" &&
 	rev_head=$(git rev-parse --verify HEAD) &&
 	test "$rev_head" = "$HASH4"
 '
@@ -116,27 +116,27 @@ test_expect_success 'no stdout output on error' '
 '
 
 test_expect_success 'use --default' '
-	git rev-parse --verify --default master &&
-	git rev-parse --verify --default master HEAD &&
-	git rev-parse --default master --verify &&
-	git rev-parse --default master --verify HEAD &&
-	git rev-parse --verify HEAD --default master &&
-	test_must_fail git rev-parse --verify foo --default master &&
+	git rev-parse --verify --default main &&
+	git rev-parse --verify --default main HEAD &&
+	git rev-parse --default main --verify &&
+	git rev-parse --default main --verify HEAD &&
+	git rev-parse --verify HEAD --default main &&
+	test_must_fail git rev-parse --verify foo --default main &&
 	test_must_fail git rev-parse --default HEAD --verify bar &&
 	test_must_fail git rev-parse --verify --default HEAD baz &&
 	test_must_fail git rev-parse --default foo --verify &&
 	test_must_fail git rev-parse --verify --default bar
 '
 
-test_expect_success 'master@{n} for various n' '
+test_expect_success 'main@{n} for various n' '
 	N=$(git reflog | wc -l) &&
 	Nm1=$(($N-1)) &&
 	Np1=$(($N+1)) &&
-	git rev-parse --verify master@{0} &&
-	git rev-parse --verify master@{1} &&
-	git rev-parse --verify master@{$Nm1} &&
-	test_must_fail git rev-parse --verify master@{$N} &&
-	test_must_fail git rev-parse --verify master@{$Np1}
+	git rev-parse --verify main@{0} &&
+	git rev-parse --verify main@{1} &&
+	git rev-parse --verify main@{$Nm1} &&
+	test_must_fail git rev-parse --verify main@{$N} &&
+	test_must_fail git rev-parse --verify main@{$Np1}
 '
 
 test_expect_success SYMLINKS 'ref resolution not confused by broken symlinks' '
diff --git a/t/t1505-rev-parse-last.sh b/t/t1505-rev-parse-last.sh
index 4969edb314..a64cd4ce14 100755
--- a/t/t1505-rev-parse-last.sh
+++ b/t/t1505-rev-parse-last.sh
@@ -20,12 +20,12 @@ test_expect_success 'setup' '
 	make_commit 3 &&
 	git checkout side &&
 	make_commit 4 &&
-	git merge master &&
-	git checkout master
+	git merge main &&
+	git checkout main
 
 '
 
-# 1 -- 2 -- 3 master
+# 1 -- 2 -- 3 main
 #  \         \
 #   \         \
 #    --- 4 --- 5 side
@@ -49,7 +49,7 @@ test_expect_success '@{-1}@{1} works' '
 '
 
 test_expect_success '@{-2} works' '
-	test_cmp_rev master @{-2}
+	test_cmp_rev main @{-2}
 '
 
 test_expect_success '@{-3} fails' '
diff --git a/t/t1506-rev-parse-diagnosis.sh b/t/t1506-rev-parse-diagnosis.sh
index e2ae15a2cf..8b183f1de1 100755
--- a/t/t1506-rev-parse-diagnosis.sh
+++ b/t/t1506-rev-parse-diagnosis.sh
@@ -137,10 +137,10 @@ test_expect_success 'incorrect file in :path and :N:path' '
 '
 
 test_expect_success 'invalid @{n} reference' '
-	test_must_fail git rev-parse master@{99999} >output 2>error &&
+	test_must_fail git rev-parse main@{99999} >output 2>error &&
 	test_must_be_empty output &&
 	test_i18ngrep "log for [^ ]* only has [0-9][0-9]* entries" error  &&
-	test_must_fail git rev-parse --verify master@{99999} >output 2>error &&
+	test_must_fail git rev-parse --verify main@{99999} >output 2>error &&
 	test_must_be_empty output &&
 	test_i18ngrep "log for [^ ]* only has [0-9][0-9]* entries" error
 '
diff --git a/t/t1507-rev-parse-upstream.sh b/t/t1507-rev-parse-upstream.sh
index dfc0d96d8a..d49998ceb6 100755
--- a/t/t1507-rev-parse-upstream.sh
+++ b/t/t1507-rev-parse-upstream.sh
@@ -10,20 +10,20 @@ test_expect_success 'setup' '
 	test_commit 1 &&
 	git checkout -b side &&
 	test_commit 2 &&
-	git checkout master &&
+	git checkout main &&
 	git clone . clone &&
 	test_commit 3 &&
 	(cd clone &&
 	 test_commit 4 &&
 	 git branch --track my-side origin/side &&
-	 git branch --track local-master master &&
+	 git branch --track local-main main &&
 	 git branch --track fun@ny origin/side &&
 	 git branch --track @funny origin/side &&
 	 git branch --track funny@ origin/side &&
-	 git remote add -t master master-only .. &&
-	 git fetch master-only &&
+	 git remote add -t main main-only .. &&
+	 git fetch main-only &&
 	 git branch bad-upstream &&
-	 git config branch.bad-upstream.remote master-only &&
+	 git config branch.bad-upstream.remote main-only &&
 	 git config branch.bad-upstream.merge refs/heads/side
 	)
 '
@@ -39,7 +39,7 @@ error_message () {
 }
 
 test_expect_success '@{upstream} resolves to correct full name' '
-	echo refs/remotes/origin/master >expect &&
+	echo refs/remotes/origin/main >expect &&
 	git -C clone rev-parse --symbolic-full-name @{upstream} >actual &&
 	test_cmp expect actual &&
 	git -C clone rev-parse --symbolic-full-name @{UPSTREAM} >actual &&
@@ -49,7 +49,7 @@ test_expect_success '@{upstream} resolves to correct full name' '
 '
 
 test_expect_success '@{u} resolves to correct full name' '
-	echo refs/remotes/origin/master >expect &&
+	echo refs/remotes/origin/main >expect &&
 	git -C clone rev-parse --symbolic-full-name @{u} >actual &&
 	test_cmp expect actual &&
 	git -C clone rev-parse --symbolic-full-name @{U} >actual &&
@@ -132,7 +132,7 @@ test_expect_success 'checkout -b new my-side@{u} forks from the same' '
 test_expect_success 'merge my-side@{u} records the correct name' '
 (
 	cd clone &&
-	git checkout master &&
+	git checkout main &&
 	test_might_fail git branch -D new &&
 	git branch -t new my-side@{u} &&
 	git merge -s ours new@{u} &&
@@ -143,24 +143,24 @@ test_expect_success 'merge my-side@{u} records the correct name' '
 '
 
 test_expect_success 'branch -d other@{u}' '
-	git checkout -t -b other master &&
+	git checkout -t -b other main &&
 	git branch -d @{u} &&
-	git for-each-ref refs/heads/master >actual &&
+	git for-each-ref refs/heads/main >actual &&
 	test_must_be_empty actual
 '
 
 test_expect_success 'checkout other@{u}' '
-	git branch -f master HEAD &&
-	git checkout -t -b another master &&
+	git branch -f main HEAD &&
+	git checkout -t -b another main &&
 	git checkout @{u} &&
 	git symbolic-ref HEAD >actual &&
-	echo refs/heads/master >expect &&
+	echo refs/heads/main >expect &&
 	test_cmp expect actual
 '
 
 test_expect_success 'branch@{u} works when tracking a local branch' '
-	echo refs/heads/master >expect &&
-	git -C clone rev-parse --symbolic-full-name local-master@{u} >actual &&
+	echo refs/heads/main >expect &&
+	git -C clone rev-parse --symbolic-full-name local-main@{u} >actual &&
 	test_cmp expect actual
 '
 
@@ -174,7 +174,7 @@ test_expect_success 'branch@{u} error message when no upstream' '
 
 test_expect_success '@{u} error message when no upstream' '
 	cat >expect <<-EOF &&
-	fatal: no upstream configured for branch ${SQ}master${SQ}
+	fatal: no upstream configured for branch ${SQ}main${SQ}
 	EOF
 	test_must_fail git rev-parse --verify @{u} 2>actual &&
 	test_i18ncmp expect actual
@@ -208,14 +208,14 @@ test_expect_success 'branch@{u} error message if upstream branch not fetched' '
 test_expect_success 'pull works when tracking a local branch' '
 (
 	cd clone &&
-	git checkout local-master &&
+	git checkout local-main &&
 	git pull
 )
 '
 
 # makes sense if the previous one succeeded
 test_expect_success '@{u} works when tracking a local branch' '
-	echo refs/heads/master >expect &&
+	echo refs/heads/main >expect &&
 	git -C clone rev-parse --symbolic-full-name @{u} >actual &&
 	test_cmp expect actual
 '
@@ -224,7 +224,7 @@ test_expect_success 'log -g other@{u}' '
 	commit=$(git rev-parse HEAD) &&
 	cat >expect <<-EOF &&
 	commit $commit
-	Reflog: master@{0} (C O Mitter <committer@example.com>)
+	Reflog: main@{0} (C O Mitter <committer@example.com>)
 	Reflog message: branch: Created from HEAD
 	Author: A U Thor <author@example.com>
 	Date:   Thu Apr 7 15:15:13 2005 -0700
@@ -239,7 +239,7 @@ test_expect_success 'log -g other@{u}@{now}' '
 	commit=$(git rev-parse HEAD) &&
 	cat >expect <<-EOF &&
 	commit $commit
-	Reflog: master@{Thu Apr 7 15:17:13 2005 -0700} (C O Mitter <committer@example.com>)
+	Reflog: main@{Thu Apr 7 15:17:13 2005 -0700} (C O Mitter <committer@example.com>)
 	Reflog message: branch: Created from HEAD
 	Author: A U Thor <author@example.com>
 	Date:   Thu Apr 7 15:15:13 2005 -0700
diff --git a/t/t1508-at-combinations.sh b/t/t1508-at-combinations.sh
index 4a9964e9dc..bda6e7900c 100755
--- a/t/t1508-at-combinations.sh
+++ b/t/t1508-at-combinations.sh
@@ -30,8 +30,8 @@ fail() {
 }
 
 test_expect_success 'setup' '
-	test_commit master-one &&
-	test_commit master-two &&
+	test_commit main-one &&
+	test_commit main-two &&
 	git checkout -b upstream-branch &&
 	test_commit upstream-one &&
 	test_commit upstream-two &&
@@ -47,7 +47,7 @@ test_expect_success 'setup' '
 	git checkout -b new-branch &&
 	test_commit new-one &&
 	test_commit new-two &&
-	git branch -u master old-branch &&
+	git branch -u main old-branch &&
 	git branch -u upstream-branch new-branch
 '
 
@@ -62,8 +62,8 @@ check "@{-1}@{1}" commit old-one
 check "@{u}" ref refs/heads/upstream-branch
 check "HEAD@{u}" ref refs/heads/upstream-branch
 check "@{u}@{1}" commit upstream-one
-check "@{-1}@{u}" ref refs/heads/master
-check "@{-1}@{u}@{1}" commit master-one
+check "@{-1}@{u}" ref refs/heads/main
+check "@{-1}@{u}@{1}" commit main-one
 check "@" commit new-two
 check "@@{u}" ref refs/heads/upstream-branch
 check "@@/at-test" ref refs/heads/@@/at-test
diff --git a/t/t1511-rev-parse-caret.sh b/t/t1511-rev-parse-caret.sh
index e0a49a651f..cc324bea52 100755
--- a/t/t1511-rev-parse-caret.sh
+++ b/t/t1511-rev-parse-caret.sh
@@ -15,7 +15,7 @@ test_expect_success 'setup' '
 	git commit -m Initial &&
 	git tag -a -m commit commit-tag &&
 	git branch ref &&
-	git checkout master &&
+	git checkout main &&
 	echo modified >>a-blob &&
 	git add -u &&
 	git commit -m Modified &&
@@ -73,52 +73,52 @@ test_expect_success 'ref^{tag}' '
 '
 
 test_expect_success 'ref^{/.}' '
-	git rev-parse master >expected &&
-	git rev-parse master^{/.} >actual &&
+	git rev-parse main >expected &&
+	git rev-parse main^{/.} >actual &&
 	test_cmp expected actual
 '
 
 test_expect_success 'ref^{/non-existent}' '
-	test_must_fail git rev-parse master^{/non-existent}
+	test_must_fail git rev-parse main^{/non-existent}
 '
 
 test_expect_success 'ref^{/Initial}' '
 	git rev-parse ref >expected &&
-	git rev-parse master^{/Initial} >actual &&
+	git rev-parse main^{/Initial} >actual &&
 	test_cmp expected actual
 '
 
 test_expect_success 'ref^{/!Exp}' '
-	test_must_fail git rev-parse master^{/!Exp}
+	test_must_fail git rev-parse main^{/!Exp}
 '
 
 test_expect_success 'ref^{/!}' '
-	test_must_fail git rev-parse master^{/!}
+	test_must_fail git rev-parse main^{/!}
 '
 
 test_expect_success 'ref^{/!!Exp}' '
 	git rev-parse expref >expected &&
-	git rev-parse master^{/!!Exp} >actual &&
+	git rev-parse main^{/!!Exp} >actual &&
 	test_cmp expected actual
 '
 
 test_expect_success 'ref^{/!-}' '
-	test_must_fail git rev-parse master^{/!-}
+	test_must_fail git rev-parse main^{/!-}
 '
 
 test_expect_success 'ref^{/!-.}' '
-	test_must_fail git rev-parse master^{/!-.}
+	test_must_fail git rev-parse main^{/!-.}
 '
 
 test_expect_success 'ref^{/!-non-existent}' '
-	git rev-parse master >expected &&
-	git rev-parse master^{/!-non-existent} >actual &&
+	git rev-parse main >expected &&
+	git rev-parse main^{/!-non-existent} >actual &&
 	test_cmp expected actual
 '
 
 test_expect_success 'ref^{/!-Changed}' '
 	git rev-parse expref >expected &&
-	git rev-parse master^{/!-Changed} >actual &&
+	git rev-parse main^{/!-Changed} >actual &&
 	test_cmp expected actual
 '
 
diff --git a/t/t1512-rev-parse-disambiguation.sh b/t/t1512-rev-parse-disambiguation.sh
index 18fa6cf40d..6b4481d36b 100755
--- a/t/t1512-rev-parse-disambiguation.sh
+++ b/t/t1512-rev-parse-disambiguation.sh
@@ -212,7 +212,7 @@ test_expect_success 'more history' '
 	side=$(git rev-parse HEAD) &&
 
 	# commit 000000000066
-	git checkout master &&
+	git checkout main &&
 
 	# If you use recursive, merge will fail and you will need to
 	# clean up a0blgqsjc as well.  If you use resolve, merge will
diff --git a/t/t1513-rev-parse-prefix.sh b/t/t1513-rev-parse-prefix.sh
index 87ec3ae714..f77e59121c 100755
--- a/t/t1513-rev-parse-prefix.sh
+++ b/t/t1513-rev-parse-prefix.sh
@@ -76,9 +76,9 @@ test_expect_success 'disambiguate path with valid prefix' '
 '
 
 test_expect_success 'file and refs with prefix' '
-	git rev-parse --prefix sub1/ master file1 >actual &&
+	git rev-parse --prefix sub1/ main file1 >actual &&
 	cat <<-EOF >expected &&
-	$(git rev-parse master)
+	$(git rev-parse main)
 	sub1/file1
 	EOF
 	test_cmp expected actual
diff --git a/t/t1514-rev-parse-push.sh b/t/t1514-rev-parse-push.sh
index 788cc91e45..e85b222e99 100755
--- a/t/t1514-rev-parse-push.sh
+++ b/t/t1514-rev-parse-push.sh
@@ -16,24 +16,24 @@ test_expect_success 'setup' '
 	git remote add other other.git &&
 	test_commit base &&
 	git push origin HEAD &&
-	git branch --set-upstream-to=origin/master master &&
-	git branch --track topic origin/master &&
+	git branch --set-upstream-to=origin/main main &&
+	git branch --track topic origin/main &&
 	git push origin topic &&
 	git push other topic
 '
 
 test_expect_success '@{push} with default=nothing' '
 	test_config push.default nothing &&
-	test_must_fail git rev-parse master@{push} &&
-	test_must_fail git rev-parse master@{PUSH} &&
-	test_must_fail git rev-parse master@{PuSH}
+	test_must_fail git rev-parse main@{push} &&
+	test_must_fail git rev-parse main@{PUSH} &&
+	test_must_fail git rev-parse main@{PuSH}
 '
 
 test_expect_success '@{push} with default=simple' '
 	test_config push.default simple &&
-	resolve master@{push} refs/remotes/origin/master &&
-	resolve master@{PUSH} refs/remotes/origin/master &&
-	resolve master@{pUSh} refs/remotes/origin/master
+	resolve main@{push} refs/remotes/origin/main &&
+	resolve main@{PUSH} refs/remotes/origin/main &&
+	resolve main@{pUSh} refs/remotes/origin/main
 '
 
 test_expect_success 'triangular @{push} fails with default=simple' '
diff --git a/t/t1700-split-index.sh b/t/t1700-split-index.sh
index 12a5568844..f3309045fe 100755
--- a/t/t1700-split-index.sh
+++ b/t/t1700-split-index.sh
@@ -496,7 +496,7 @@ test_expect_success 'do not refresh null base index' '
 		test_commit initial &&
 		git checkout -b side-branch &&
 		test_commit extra &&
-		git checkout master &&
+		git checkout main &&
 		git update-index --split-index &&
 		test_commit more &&
 		# must not write a new shareindex, or we wont catch the problem
diff --git a/t/test-lib.sh b/t/test-lib.sh
index a863ccee7e..126004e342 100644
--- a/t/test-lib.sh
+++ b/t/test-lib.sh
@@ -256,6 +256,13 @@ case "$TRASH_DIRECTORY" in
  *) TRASH_DIRECTORY="$TEST_OUTPUT_DIRECTORY/$TRASH_DIRECTORY" ;;
 esac
 
+case "$TEST_NUMBER" in
+[01]*)
+	GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
+	export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+	;;
+esac
+
 # If --stress was passed, run this test repeatedly in several parallel loops.
 if test "$GIT_TEST_STRESS_STARTED" = "done"
 then
-- 
gitgitgadget


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH 03/28] t2*: adjust the references to the default branch name "main"
  2020-11-12 22:43 [PATCH 00/28] Use main as default branch name Johannes Schindelin via GitGitGadget
  2020-11-12 22:43 ` [PATCH 01/28] t0060: preemptively adjust alignment Johannes Schindelin via GitGitGadget
  2020-11-12 22:43 ` [PATCH 02/28] t[01]*: adjust the references to the default branch name "main" Johannes Schindelin via GitGitGadget
@ 2020-11-12 22:43 ` Johannes Schindelin via GitGitGadget
  2020-11-12 22:43 ` [PATCH 04/28] t3[0-3]*: " Johannes Schindelin via GitGitGadget
                   ` (29 subsequent siblings)
  32 siblings, 0 replies; 163+ messages in thread
From: Johannes Schindelin via GitGitGadget @ 2020-11-12 22:43 UTC (permalink / raw)
  To: git; +Cc: Johannes Schindelin, Johannes Schindelin

From: Johannes Schindelin <johannes.schindelin@gmx.de>

This trick was performed via

	$ (cd t &&
	   sed -i -e 's/master/main/g' -e 's/MASTER/MAIN/g' \
		-e 's/Master/Main/g' -- t2*.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>
---
 t/t2007-checkout-symlink.sh              | 10 ++--
 t/t2009-checkout-statinfo.sh             |  8 +--
 t/t2010-checkout-ambiguous.sh            |  4 +-
 t/t2011-checkout-invalid-head.sh         | 16 +++---
 t/t2012-checkout-last.sh                 | 48 ++++++++--------
 t/t2015-checkout-unborn.sh               |  2 +-
 t/t2017-checkout-orphan.sh               | 44 +++++++--------
 t/t2020-checkout-detach.sh               | 28 +++++-----
 t/t2022-checkout-paths.sh                | 22 ++++----
 t/t2023-checkout-m.sh                    | 10 ++--
 t/t2024-checkout-dwim.sh                 | 70 ++++++++++++------------
 t/t2027-checkout-track.sh                |  6 +-
 t/t2030-unresolve-info.sh                |  6 +-
 t/t2060-switch.sh                        | 30 +++++-----
 t/t2070-restore.sh                       |  4 +-
 t/t2106-update-index-assume-unchanged.sh |  2 +-
 t/t2400-worktree-add.sh                  | 66 +++++++++++-----------
 t/t2401-worktree-prune.sh                |  2 +-
 t/t2402-worktree-list.sh                 | 20 +++----
 t/t2405-worktree-submodule.sh            |  6 +-
 t/test-lib.sh                            |  2 +-
 21 files changed, 203 insertions(+), 203 deletions(-)

diff --git a/t/t2007-checkout-symlink.sh b/t/t2007-checkout-symlink.sh
index fc9aad530e..d6468ad8f3 100755
--- a/t/t2007-checkout-symlink.sh
+++ b/t/t2007-checkout-symlink.sh
@@ -12,14 +12,14 @@ test_expect_success setup '
 	echo hello >frotz/filfre &&
 	git add frotz/filfre &&
 	test_tick &&
-	git commit -m "master has file frotz/filfre" &&
+	git commit -m "main has file frotz/filfre" &&
 
 	git branch side &&
 
 	echo goodbye >nitfol &&
 	git add nitfol &&
 	test_tick &&
-	git commit -m "master adds file nitfol" &&
+	git commit -m "main adds file nitfol" &&
 
 	git checkout side &&
 
@@ -34,13 +34,13 @@ test_expect_success setup '
 
 test_expect_success 'switch from symlink to dir' '
 
-	git checkout master
+	git checkout main
 
 '
 
-test_expect_success 'Remove temporary directories & switch to master' '
+test_expect_success 'Remove temporary directories & switch to main' '
 	rm -fr frotz xyzzy nitfol &&
-	git checkout -f master
+	git checkout -f main
 '
 
 test_expect_success 'switch from dir to symlink' '
diff --git a/t/t2009-checkout-statinfo.sh b/t/t2009-checkout-statinfo.sh
index f3c2152087..91940f3c60 100755
--- a/t/t2009-checkout-statinfo.sh
+++ b/t/t2009-checkout-statinfo.sh
@@ -21,13 +21,13 @@ test_expect_success 'branch switching' '
 	git reset --hard &&
 	test "$(git diff-files --raw)" = "" &&
 
-	git checkout master &&
+	git checkout main &&
 	test "$(git diff-files --raw)" = "" &&
 
 	git checkout side &&
 	test "$(git diff-files --raw)" = "" &&
 
-	git checkout master &&
+	git checkout main &&
 	test "$(git diff-files --raw)" = ""
 
 '
@@ -37,13 +37,13 @@ test_expect_success 'path checkout' '
 	git reset --hard &&
 	test "$(git diff-files --raw)" = "" &&
 
-	git checkout master world &&
+	git checkout main world &&
 	test "$(git diff-files --raw)" = "" &&
 
 	git checkout side world &&
 	test "$(git diff-files --raw)" = "" &&
 
-	git checkout master world &&
+	git checkout main world &&
 	test "$(git diff-files --raw)" = ""
 
 '
diff --git a/t/t2010-checkout-ambiguous.sh b/t/t2010-checkout-ambiguous.sh
index 2e47fe01cf..64395479e8 100755
--- a/t/t2010-checkout-ambiguous.sh
+++ b/t/t2010-checkout-ambiguous.sh
@@ -17,7 +17,7 @@ test_expect_success 'reference must be a tree' '
 '
 
 test_expect_success 'branch switching' '
-	test "refs/heads/master" = "$(git symbolic-ref HEAD)" &&
+	test "refs/heads/main" = "$(git symbolic-ref HEAD)" &&
 	git checkout world -- &&
 	test "refs/heads/world" = "$(git symbolic-ref HEAD)"
 '
@@ -57,7 +57,7 @@ test_expect_success 'disambiguate checking out from a tree-ish' '
 '
 
 test_expect_success 'accurate error message with more than one ref' '
-	test_must_fail git checkout HEAD master -- 2>actual &&
+	test_must_fail git checkout HEAD main -- 2>actual &&
 	test_i18ngrep 2 actual &&
 	test_i18ngrep "one reference expected, 2 given" actual
 '
diff --git a/t/t2011-checkout-invalid-head.sh b/t/t2011-checkout-invalid-head.sh
index 0e8d56aa76..d92f8582ea 100755
--- a/t/t2011-checkout-invalid-head.sh
+++ b/t/t2011-checkout-invalid-head.sh
@@ -11,12 +11,12 @@ test_expect_success 'setup' '
 '
 
 test_expect_success 'checkout should not start branch from a tree' '
-	test_must_fail git checkout -b newbranch master^{tree}
+	test_must_fail git checkout -b newbranch main^{tree}
 '
 
-test_expect_success 'checkout master from invalid HEAD' '
+test_expect_success 'checkout main from invalid HEAD' '
 	echo $ZERO_OID >.git/HEAD &&
-	git checkout master --
+	git checkout main --
 '
 
 test_expect_success 'checkout notices failure to lock HEAD' '
@@ -26,7 +26,7 @@ test_expect_success 'checkout notices failure to lock HEAD' '
 '
 
 test_expect_success 'create ref directory/file conflict scenario' '
-	git update-ref refs/heads/outer/inner master &&
+	git update-ref refs/heads/outer/inner main &&
 
 	# do not rely on symbolic-ref to get a known state,
 	# as it may use the same code we are testing
@@ -37,12 +37,12 @@ test_expect_success 'create ref directory/file conflict scenario' '
 
 test_expect_success 'checkout away from d/f HEAD (unpacked, to branch)' '
 	reset_to_df &&
-	git checkout master
+	git checkout main
 '
 
 test_expect_success 'checkout away from d/f HEAD (unpacked, to detached)' '
 	reset_to_df &&
-	git checkout --detach master
+	git checkout --detach main
 '
 
 test_expect_success 'pack refs' '
@@ -51,11 +51,11 @@ test_expect_success 'pack refs' '
 
 test_expect_success 'checkout away from d/f HEAD (packed, to branch)' '
 	reset_to_df &&
-	git checkout master
+	git checkout main
 '
 
 test_expect_success 'checkout away from d/f HEAD (packed, to detached)' '
 	reset_to_df &&
-	git checkout --detach master
+	git checkout --detach main
 '
 test_done
diff --git a/t/t2012-checkout-last.sh b/t/t2012-checkout-last.sh
index e7ba8c505f..7a126337ca 100755
--- a/t/t2012-checkout-last.sh
+++ b/t/t2012-checkout-last.sh
@@ -24,7 +24,7 @@ test_expect_success 'first branch switch' '
 
 test_expect_success '"checkout -" switches back' '
 	git checkout - &&
-	test "z$(git symbolic-ref HEAD)" = "zrefs/heads/master"
+	test "z$(git symbolic-ref HEAD)" = "zrefs/heads/main"
 '
 
 test_expect_success '"checkout -" switches forth' '
@@ -98,56 +98,56 @@ test_expect_success 'merge base test setup' '
 	git commit -m third
 '
 
-test_expect_success 'another...master' '
+test_expect_success 'another...main' '
 	git checkout another &&
-	git checkout another...master &&
-	test "z$(git rev-parse --verify HEAD)" = "z$(git rev-parse --verify master^)"
+	git checkout another...main &&
+	test "z$(git rev-parse --verify HEAD)" = "z$(git rev-parse --verify main^)"
 '
 
-test_expect_success '...master' '
+test_expect_success '...main' '
 	git checkout another &&
-	git checkout ...master &&
-	test "z$(git rev-parse --verify HEAD)" = "z$(git rev-parse --verify master^)"
+	git checkout ...main &&
+	test "z$(git rev-parse --verify HEAD)" = "z$(git rev-parse --verify main^)"
 '
 
-test_expect_success 'master...' '
+test_expect_success 'main...' '
 	git checkout another &&
-	git checkout master... &&
-	test "z$(git rev-parse --verify HEAD)" = "z$(git rev-parse --verify master^)"
+	git checkout main... &&
+	test "z$(git rev-parse --verify HEAD)" = "z$(git rev-parse --verify main^)"
 '
 
 test_expect_success '"checkout -" works after a rebase A' '
-	git checkout master &&
+	git checkout main &&
 	git checkout other &&
-	git rebase master &&
+	git rebase main &&
 	git checkout - &&
-	test "z$(git symbolic-ref HEAD)" = "zrefs/heads/master"
+	test "z$(git symbolic-ref HEAD)" = "zrefs/heads/main"
 '
 
 test_expect_success '"checkout -" works after a rebase A B' '
-	git branch moodle master~1 &&
-	git checkout master &&
+	git branch moodle main~1 &&
+	git checkout main &&
 	git checkout other &&
-	git rebase master moodle &&
+	git rebase main moodle &&
 	git checkout - &&
-	test "z$(git symbolic-ref HEAD)" = "zrefs/heads/master"
+	test "z$(git symbolic-ref HEAD)" = "zrefs/heads/main"
 '
 
 test_expect_success '"checkout -" works after a rebase -i A' '
-	git checkout master &&
+	git checkout main &&
 	git checkout other &&
-	git rebase -i master &&
+	git rebase -i main &&
 	git checkout - &&
-	test "z$(git symbolic-ref HEAD)" = "zrefs/heads/master"
+	test "z$(git symbolic-ref HEAD)" = "zrefs/heads/main"
 '
 
 test_expect_success '"checkout -" works after a rebase -i A B' '
-	git branch foodle master~1 &&
-	git checkout master &&
+	git branch foodle main~1 &&
+	git checkout main &&
 	git checkout other &&
-	git rebase master foodle &&
+	git rebase main foodle &&
 	git checkout - &&
-	test "z$(git symbolic-ref HEAD)" = "zrefs/heads/master"
+	test "z$(git symbolic-ref HEAD)" = "zrefs/heads/main"
 '
 
 test_done
diff --git a/t/t2015-checkout-unborn.sh b/t/t2015-checkout-unborn.sh
index 37bdcedcc9..2b3e6dc27e 100755
--- a/t/t2015-checkout-unborn.sh
+++ b/t/t2015-checkout-unborn.sh
@@ -11,7 +11,7 @@ test_expect_success 'setup' '
 	 git add file &&
 	 git commit -m base
 	) &&
-	git fetch parent master:origin
+	git fetch parent main:origin
 '
 
 test_expect_success 'checkout from unborn preserves untracked files' '
diff --git a/t/t2017-checkout-orphan.sh b/t/t2017-checkout-orphan.sh
index 655f278c5f..e2ce29c8e7 100755
--- a/t/t2017-checkout-orphan.sh
+++ b/t/t2017-checkout-orphan.sh
@@ -29,34 +29,34 @@ test_expect_success '--orphan creates a new orphan branch from HEAD' '
 	test_tick &&
 	git commit -m "Third Commit" &&
 	test_must_fail git rev-parse --verify HEAD^ &&
-	git diff-tree --quiet master alpha
+	git diff-tree --quiet main alpha
 '
 
 test_expect_success '--orphan creates a new orphan branch from <start_point>' '
-	git checkout master &&
-	git checkout --orphan beta master^ &&
+	git checkout main &&
+	git checkout --orphan beta main^ &&
 	test_must_fail git rev-parse --verify HEAD &&
 	test "refs/heads/beta" = "$(git symbolic-ref HEAD)" &&
 	test_tick &&
 	git commit -m "Fourth Commit" &&
 	test_must_fail git rev-parse --verify HEAD^ &&
-	git diff-tree --quiet master^ beta
+	git diff-tree --quiet main^ beta
 '
 
 test_expect_success '--orphan must be rejected with -b' '
-	git checkout master &&
+	git checkout main &&
 	test_must_fail git checkout --orphan new -b newer &&
-	test refs/heads/master = "$(git symbolic-ref HEAD)"
+	test refs/heads/main = "$(git symbolic-ref HEAD)"
 '
 
 test_expect_success '--orphan must be rejected with -t' '
-	git checkout master &&
-	test_must_fail git checkout --orphan new -t master &&
-	test refs/heads/master = "$(git symbolic-ref HEAD)"
+	git checkout main &&
+	test_must_fail git checkout --orphan new -t main &&
+	test refs/heads/main = "$(git symbolic-ref HEAD)"
 '
 
 test_expect_success '--orphan ignores branch.autosetupmerge' '
-	git checkout master &&
+	git checkout main &&
 	git config branch.autosetupmerge always &&
 	git checkout --orphan gamma &&
 	test -z "$(git config branch.gamma.merge)" &&
@@ -65,7 +65,7 @@ test_expect_success '--orphan ignores branch.autosetupmerge' '
 '
 
 test_expect_success '--orphan makes reflog by default' '
-	git checkout master &&
+	git checkout main &&
 	git config --unset core.logAllRefUpdates &&
 	git checkout --orphan delta &&
 	test_must_fail git rev-parse --verify delta@{0} &&
@@ -74,7 +74,7 @@ test_expect_success '--orphan makes reflog by default' '
 '
 
 test_expect_success '--orphan does not make reflog when core.logAllRefUpdates = false' '
-	git checkout master &&
+	git checkout main &&
 	git config core.logAllRefUpdates false &&
 	git checkout --orphan epsilon &&
 	test_must_fail git rev-parse --verify epsilon@{0} &&
@@ -83,7 +83,7 @@ test_expect_success '--orphan does not make reflog when core.logAllRefUpdates =
 '
 
 test_expect_success '--orphan with -l makes reflog when core.logAllRefUpdates = false' '
-	git checkout master &&
+	git checkout main &&
 	git checkout -l --orphan zeta &&
 	test_must_fail git rev-parse --verify zeta@{0} &&
 	git commit -m Zeta &&
@@ -91,33 +91,33 @@ test_expect_success '--orphan with -l makes reflog when core.logAllRefUpdates =
 '
 
 test_expect_success 'giving up --orphan not committed when -l and core.logAllRefUpdates = false deletes reflog' '
-	git checkout master &&
+	git checkout main &&
 	git checkout -l --orphan eta &&
 	test_must_fail git rev-parse --verify eta@{0} &&
-	git checkout master &&
+	git checkout main &&
 	test_must_fail git rev-parse --verify eta@{0}
 '
 
 test_expect_success '--orphan is rejected with an existing name' '
-	git checkout master &&
-	test_must_fail git checkout --orphan master &&
-	test refs/heads/master = "$(git symbolic-ref HEAD)"
+	git checkout main &&
+	test_must_fail git checkout --orphan main &&
+	test refs/heads/main = "$(git symbolic-ref HEAD)"
 '
 
 test_expect_success '--orphan refuses to switch if a merge is needed' '
-	git checkout master &&
+	git checkout main &&
 	git reset --hard &&
 	echo local >>"$TEST_FILE" &&
 	cat "$TEST_FILE" >"$TEST_FILE.saved" &&
-	test_must_fail git checkout --orphan new master^ &&
-	test refs/heads/master = "$(git symbolic-ref HEAD)" &&
+	test_must_fail git checkout --orphan new main^ &&
+	test refs/heads/main = "$(git symbolic-ref HEAD)" &&
 	test_cmp "$TEST_FILE" "$TEST_FILE.saved" &&
 	git diff-index --quiet --cached HEAD &&
 	git reset --hard
 '
 
 test_expect_success 'cannot --detach on an unborn branch' '
-	git checkout master &&
+	git checkout main &&
 	git checkout --orphan new &&
 	test_must_fail git checkout --detach
 '
diff --git a/t/t2020-checkout-detach.sh b/t/t2020-checkout-detach.sh
index b748db9946..25885c3065 100755
--- a/t/t2020-checkout-detach.sh
+++ b/t/t2020-checkout-detach.sh
@@ -22,7 +22,7 @@ check_no_orphan_warning() {
 }
 
 reset () {
-	git checkout master &&
+	git checkout main &&
 	check_not_detached
 }
 
@@ -85,7 +85,7 @@ test_expect_success 'checkout --detach errors out for non-commit' '
 
 test_expect_success 'checkout --detach errors out for extra argument' '
 	reset &&
-	git checkout master &&
+	git checkout main &&
 	test_must_fail git checkout --detach tag one.t &&
 	check_not_detached
 '
@@ -113,7 +113,7 @@ test_expect_success 'checkout warns on orphan commits' '
 	echo new content >orphan &&
 	git commit -a -m orphan2 &&
 	orphan2=$(git rev-parse HEAD) &&
-	git checkout master 2>stderr
+	git checkout main 2>stderr
 '
 
 test_expect_success 'checkout warns on orphan commits: output' '
@@ -132,7 +132,7 @@ test_expect_success 'checkout warns orphaning 1 of 2 commits: output' '
 test_expect_success 'checkout does not warn leaving ref tip' '
 	reset &&
 	git checkout --detach two &&
-	git checkout master 2>stderr
+	git checkout main 2>stderr
 '
 
 test_expect_success 'checkout does not warn leaving ref tip' '
@@ -142,7 +142,7 @@ test_expect_success 'checkout does not warn leaving ref tip' '
 test_expect_success 'checkout does not warn leaving reachable commit' '
 	reset &&
 	git checkout --detach HEAD^ &&
-	git checkout master 2>stderr
+	git checkout main 2>stderr
 '
 
 test_expect_success 'checkout does not warn leaving reachable commit' '
@@ -150,14 +150,14 @@ test_expect_success 'checkout does not warn leaving reachable commit' '
 '
 
 cat >expect <<'EOF'
-Your branch is behind 'master' by 1 commit, and can be fast-forwarded.
+Your branch is behind 'main' by 1 commit, and can be fast-forwarded.
   (use "git pull" to update your local branch)
 EOF
 test_expect_success 'tracking count is accurate after orphan check' '
 	reset &&
-	git branch child master^ &&
+	git branch child main^ &&
 	git config branch.child.remote . &&
-	git config branch.child.merge refs/heads/master &&
+	git config branch.child.merge refs/heads/main &&
 	git checkout child^ &&
 	git checkout child >stdout &&
 	test_i18ncmp expect stdout
@@ -189,9 +189,9 @@ test_expect_success 'no advice given for explicit detached head state' '
 # Detached HEAD tests for GIT_PRINT_SHA1_ELLIPSIS (new format)
 test_expect_success 'describe_detached_head prints no SHA-1 ellipsis when not asked to' "
 
-	commit=$(git rev-parse --short=12 master^) &&
-	commit2=$(git rev-parse --short=12 master~2) &&
-	commit3=$(git rev-parse --short=12 master~3) &&
+	commit=$(git rev-parse --short=12 main^) &&
+	commit2=$(git rev-parse --short=12 main~2) &&
+	commit3=$(git rev-parse --short=12 main~3) &&
 
 	# The first detach operation is more chatty than the following ones.
 	cat >1st_detach <<-EOF &&
@@ -271,9 +271,9 @@ test_expect_success 'describe_detached_head prints no SHA-1 ellipsis when not as
 # Detached HEAD tests for GIT_PRINT_SHA1_ELLIPSIS (old format)
 test_expect_success 'describe_detached_head does print SHA-1 ellipsis when asked to' "
 
-	commit=$(git rev-parse --short=12 master^) &&
-	commit2=$(git rev-parse --short=12 master~2) &&
-	commit3=$(git rev-parse --short=12 master~3) &&
+	commit=$(git rev-parse --short=12 main^) &&
+	commit2=$(git rev-parse --short=12 main~2) &&
+	commit3=$(git rev-parse --short=12 main~3) &&
 
 	# The first detach operation is more chatty than the following ones.
 	cat >1st_detach <<-EOF &&
diff --git a/t/t2022-checkout-paths.sh b/t/t2022-checkout-paths.sh
index 6844afafc0..4174620cf4 100755
--- a/t/t2022-checkout-paths.sh
+++ b/t/t2022-checkout-paths.sh
@@ -5,15 +5,15 @@ test_description='checkout $tree -- $paths'
 
 test_expect_success setup '
 	mkdir dir &&
-	>dir/master &&
+	>dir/main &&
 	echo common >dir/common &&
-	git add dir/master dir/common &&
-	test_tick && git commit -m "master has dir/master" &&
+	git add dir/main dir/common &&
+	test_tick && git commit -m "main has dir/main" &&
 	git checkout -b next &&
-	git mv dir/master dir/next0 &&
+	git mv dir/main dir/next0 &&
 	echo next >dir/next1 &&
 	git add dir &&
-	test_tick && git commit -m "next has dir/next but not dir/master"
+	test_tick && git commit -m "next has dir/next but not dir/main"
 '
 
 test_expect_success 'checking out paths out of a tree does not clobber unrelated paths' '
@@ -26,11 +26,11 @@ test_expect_success 'checking out paths out of a tree does not clobber unrelated
 	echo untracked >expect.next2 &&
 	cat expect.next2 >dir/next2 &&
 
-	git checkout master dir &&
+	git checkout main dir &&
 
 	test_cmp expect.common dir/common &&
-	test_path_is_file dir/master &&
-	git diff --exit-code master dir/master &&
+	test_path_is_file dir/main &&
+	git diff --exit-code main dir/main &&
 
 	test_path_is_missing dir/next0 &&
 	test_cmp expect.next1 dir/next1 &&
@@ -52,11 +52,11 @@ test_expect_success 'do not touch unmerged entries matching $path but not in $tr
 	EOF
 	git update-index --index-info <expect.next0 &&
 
-	git checkout master dir &&
+	git checkout main dir &&
 
 	test_cmp expect.common dir/common &&
-	test_path_is_file dir/master &&
-	git diff --exit-code master dir/master &&
+	test_path_is_file dir/main &&
+	git diff --exit-code main dir/main &&
 	git ls-files -s dir/next0 >actual.next0 &&
 	test_cmp expect.next0 actual.next0
 '
diff --git a/t/t2023-checkout-m.sh b/t/t2023-checkout-m.sh
index fca3f85824..ddcfcc3e9b 100755
--- a/t/t2023-checkout-m.sh
+++ b/t/t2023-checkout-m.sh
@@ -10,15 +10,15 @@ test_expect_success setup '
 	test_tick &&
 	test_commit both.txt both.txt initial &&
 	git branch topic &&
-	test_commit modified_in_master both.txt in_master &&
-	test_commit added_in_master each.txt in_master &&
+	test_commit modified_in_main both.txt in_main &&
+	test_commit added_in_main each.txt in_main &&
 	git checkout topic &&
 	test_commit modified_in_topic both.txt in_topic &&
 	test_commit added_in_topic each.txt in_topic
 '
 
-test_expect_success 'git merge master' '
-    test_must_fail git merge master
+test_expect_success 'git merge main' '
+    test_must_fail git merge main
 '
 
 clean_branchnames () {
@@ -61,7 +61,7 @@ test_expect_success 'force checkout a conflict file creates stage zero entry' '
 		git checkout topic &&
 		echo c >a &&
 		C_OBJ=$(git hash-object a) &&
-		git checkout -m master &&
+		git checkout -m main &&
 		test_cmp_rev :1:a $A_OBJ &&
 		test_cmp_rev :2:a $B_OBJ &&
 		test_cmp_rev :3:a $C_OBJ &&
diff --git a/t/t2024-checkout-dwim.sh b/t/t2024-checkout-dwim.sh
index a4f8d3a67e..4a1c901456 100755
--- a/t/t2024-checkout-dwim.sh
+++ b/t/t2024-checkout-dwim.sh
@@ -29,11 +29,11 @@ status_uno_is_clean () {
 }
 
 test_expect_success 'setup' '
-	test_commit my_master &&
+	test_commit my_main &&
 	git init repo_a &&
 	(
 		cd repo_a &&
-		test_commit a_master &&
+		test_commit a_main &&
 		git checkout -b foo &&
 		test_commit a_foo &&
 		git checkout -b bar &&
@@ -44,7 +44,7 @@ test_expect_success 'setup' '
 	git init repo_b &&
 	(
 		cd repo_b &&
-		test_commit b_master &&
+		test_commit b_main &&
 		git checkout -b foo &&
 		test_commit b_foo &&
 		git checkout -b baz &&
@@ -60,23 +60,23 @@ test_expect_success 'setup' '
 '
 
 test_expect_success 'checkout of non-existing branch fails' '
-	git checkout -B master &&
+	git checkout -B main &&
 	test_might_fail git branch -D xyzzy &&
 
 	test_must_fail git checkout xyzzy &&
 	status_uno_is_clean &&
 	test_must_fail git rev-parse --verify refs/heads/xyzzy &&
-	test_branch master
+	test_branch main
 '
 
 test_expect_success 'checkout of branch from multiple remotes fails #1' '
-	git checkout -B master &&
+	git checkout -B main &&
 	test_might_fail git branch -D foo &&
 
 	test_must_fail git checkout foo &&
 	status_uno_is_clean &&
 	test_must_fail git rev-parse --verify refs/heads/foo &&
-	test_branch master
+	test_branch main
 '
 
 test_expect_success 'when arg matches multiple remotes, do not fallback to interpreting as pathspec' '
@@ -100,21 +100,21 @@ test_expect_success 'when arg matches multiple remotes, do not fallback to inter
 '
 
 test_expect_success 'checkout of branch from multiple remotes fails with advice' '
-	git checkout -B master &&
+	git checkout -B main &&
 	test_might_fail git branch -D foo &&
 	test_must_fail git checkout foo 2>stderr &&
-	test_branch master &&
+	test_branch main &&
 	status_uno_is_clean &&
 	test_i18ngrep "^hint: " stderr &&
 	test_must_fail git -c advice.checkoutAmbiguousRemoteBranchName=false \
 		checkout foo 2>stderr &&
-	test_branch master &&
+	test_branch main &&
 	status_uno_is_clean &&
 	test_i18ngrep ! "^hint: " stderr
 '
 
 test_expect_success PERL 'checkout -p with multiple remotes does not print advice' '
-	git checkout -B master &&
+	git checkout -B main &&
 	test_might_fail git branch -D foo &&
 
 	git checkout -p foo 2>stderr &&
@@ -123,7 +123,7 @@ test_expect_success PERL 'checkout -p with multiple remotes does not print advic
 '
 
 test_expect_success 'checkout of branch from multiple remotes succeeds with checkout.defaultRemote #1' '
-	git checkout -B master &&
+	git checkout -B main &&
 	status_uno_is_clean &&
 	test_might_fail git branch -D foo &&
 
@@ -135,7 +135,7 @@ test_expect_success 'checkout of branch from multiple remotes succeeds with chec
 '
 
 test_expect_success 'checkout of branch from a single remote succeeds #1' '
-	git checkout -B master &&
+	git checkout -B main &&
 	test_might_fail git branch -D bar &&
 
 	git checkout bar &&
@@ -146,7 +146,7 @@ test_expect_success 'checkout of branch from a single remote succeeds #1' '
 '
 
 test_expect_success 'checkout of branch from a single remote succeeds #2' '
-	git checkout -B master &&
+	git checkout -B main &&
 	test_might_fail git branch -D baz &&
 
 	git checkout baz &&
@@ -157,33 +157,33 @@ test_expect_success 'checkout of branch from a single remote succeeds #2' '
 '
 
 test_expect_success '--no-guess suppresses branch auto-vivification' '
-	git checkout -B master &&
+	git checkout -B main &&
 	status_uno_is_clean &&
 	test_might_fail git branch -D bar &&
 
 	test_must_fail git checkout --no-guess bar &&
 	test_must_fail git rev-parse --verify refs/heads/bar &&
-	test_branch master
+	test_branch main
 '
 
 test_expect_success 'checkout.guess = false suppresses branch auto-vivification' '
-	git checkout -B master &&
+	git checkout -B main &&
 	status_uno_is_clean &&
 	test_might_fail git branch -D bar &&
 
 	test_config checkout.guess false &&
 	test_must_fail git checkout bar &&
 	test_must_fail git rev-parse --verify refs/heads/bar &&
-	test_branch master
+	test_branch main
 '
 
 test_expect_success 'setup more remotes with unconventional refspecs' '
-	git checkout -B master &&
+	git checkout -B main &&
 	status_uno_is_clean &&
 	git init repo_c &&
 	(
 		cd repo_c &&
-		test_commit c_master &&
+		test_commit c_main &&
 		git checkout -b bar &&
 		test_commit c_bar &&
 		git checkout -b spam &&
@@ -192,7 +192,7 @@ test_expect_success 'setup more remotes with unconventional refspecs' '
 	git init repo_d &&
 	(
 		cd repo_d &&
-		test_commit d_master &&
+		test_commit d_main &&
 		git checkout -b baz &&
 		test_commit d_baz &&
 		git checkout -b eggs &&
@@ -208,29 +208,29 @@ test_expect_success 'setup more remotes with unconventional refspecs' '
 '
 
 test_expect_success 'checkout of branch from multiple remotes fails #2' '
-	git checkout -B master &&
+	git checkout -B main &&
 	status_uno_is_clean &&
 	test_might_fail git branch -D bar &&
 
 	test_must_fail git checkout bar &&
 	status_uno_is_clean &&
 	test_must_fail git rev-parse --verify refs/heads/bar &&
-	test_branch master
+	test_branch main
 '
 
 test_expect_success 'checkout of branch from multiple remotes fails #3' '
-	git checkout -B master &&
+	git checkout -B main &&
 	status_uno_is_clean &&
 	test_might_fail git branch -D baz &&
 
 	test_must_fail git checkout baz &&
 	status_uno_is_clean &&
 	test_must_fail git rev-parse --verify refs/heads/baz &&
-	test_branch master
+	test_branch main
 '
 
 test_expect_success 'checkout of branch from a single remote succeeds #3' '
-	git checkout -B master &&
+	git checkout -B main &&
 	status_uno_is_clean &&
 	test_might_fail git branch -D spam &&
 
@@ -242,7 +242,7 @@ test_expect_success 'checkout of branch from a single remote succeeds #3' '
 '
 
 test_expect_success 'checkout of branch from a single remote succeeds #4' '
-	git checkout -B master &&
+	git checkout -B main &&
 	status_uno_is_clean &&
 	test_might_fail git branch -D eggs &&
 
@@ -254,7 +254,7 @@ test_expect_success 'checkout of branch from a single remote succeeds #4' '
 '
 
 test_expect_success 'checkout of branch with a file having the same name fails' '
-	git checkout -B master &&
+	git checkout -B main &&
 	status_uno_is_clean &&
 	test_might_fail git branch -D spam &&
 
@@ -262,11 +262,11 @@ test_expect_success 'checkout of branch with a file having the same name fails'
 	test_must_fail git checkout spam &&
 	status_uno_is_clean &&
 	test_must_fail git rev-parse --verify refs/heads/spam &&
-	test_branch master
+	test_branch main
 '
 
 test_expect_success 'checkout of branch with a file in subdir having the same name fails' '
-	git checkout -B master &&
+	git checkout -B main &&
 	status_uno_is_clean &&
 	test_might_fail git branch -D spam &&
 
@@ -276,11 +276,11 @@ test_expect_success 'checkout of branch with a file in subdir having the same na
 	test_must_fail git -C sub checkout spam &&
 	status_uno_is_clean &&
 	test_must_fail git rev-parse --verify refs/heads/spam &&
-	test_branch master
+	test_branch main
 '
 
 test_expect_success 'checkout <branch> -- succeeds, even if a file with the same name exists' '
-	git checkout -B master &&
+	git checkout -B main &&
 	status_uno_is_clean &&
 	test_might_fail git branch -D spam &&
 
@@ -294,7 +294,7 @@ test_expect_success 'checkout <branch> -- succeeds, even if a file with the same
 
 test_expect_success 'loosely defined local base branch is reported correctly' '
 
-	git checkout master &&
+	git checkout main &&
 	status_uno_is_clean &&
 	git branch strict &&
 	git branch loose &&
@@ -302,8 +302,8 @@ test_expect_success 'loosely defined local base branch is reported correctly' '
 
 	test_config branch.strict.remote . &&
 	test_config branch.loose.remote . &&
-	test_config branch.strict.merge refs/heads/master &&
-	test_config branch.loose.merge master &&
+	test_config branch.strict.merge refs/heads/main &&
+	test_config branch.loose.merge main &&
 
 	git checkout strict | sed -e "s/strict/BRANCHNAME/g" >expect &&
 	status_uno_is_clean &&
diff --git a/t/t2027-checkout-track.sh b/t/t2027-checkout-track.sh
index bcba1bf90c..bc46c5a68e 100755
--- a/t/t2027-checkout-track.sh
+++ b/t/t2027-checkout-track.sh
@@ -10,14 +10,14 @@ test_expect_success 'setup' '
 '
 
 test_expect_success 'checkout --track -b creates a new tracking branch' '
-	git checkout --track -b branch1 master &&
+	git checkout --track -b branch1 main &&
 	test $(git rev-parse --abbrev-ref HEAD) = branch1 &&
 	test $(git config --get branch.branch1.remote) = . &&
-	test $(git config --get branch.branch1.merge) = refs/heads/master
+	test $(git config --get branch.branch1.merge) = refs/heads/main
 '
 
 test_expect_success 'checkout --track -b rejects an extra path argument' '
-	test_must_fail git checkout --track -b branch2 master one.t 2>err &&
+	test_must_fail git checkout --track -b branch2 main one.t 2>err &&
 	test_i18ngrep "cannot be used with updating paths" err
 '
 
diff --git a/t/t2030-unresolve-info.sh b/t/t2030-unresolve-info.sh
index 309199bca2..3cdd73c172 100755
--- a/t/t2030-unresolve-info.sh
+++ b/t/t2030-unresolve-info.sh
@@ -59,7 +59,7 @@ test_expect_success setup '
 	test_commit fourth fi/le fourth &&
 	git checkout add-add &&
 	test_commit fifth add-differently &&
-	git checkout master
+	git checkout main
 '
 
 test_expect_success 'add records switch clears' '
@@ -183,8 +183,8 @@ test_expect_success 'rerere forget (binary)' '
 '
 
 test_expect_success 'rerere forget (add-add conflict)' '
-	git checkout -f master &&
-	echo master >add-differently &&
+	git checkout -f main &&
+	echo main >add-differently &&
 	git add add-differently &&
 	git commit -m "add differently" &&
 	test_must_fail git merge fifth &&
diff --git a/t/t2060-switch.sh b/t/t2060-switch.sh
index 68c9101b02..11f85f8861 100755
--- a/t/t2060-switch.sh
+++ b/t/t2060-switch.sh
@@ -23,41 +23,41 @@ test_expect_success 'switch branch' '
 '
 
 test_expect_success 'switch and detach' '
-	test_when_finished git switch master &&
-	test_must_fail git switch master^{commit} &&
-	git switch --detach master^{commit} &&
+	test_when_finished git switch main &&
+	test_must_fail git switch main^{commit} &&
+	git switch --detach main^{commit} &&
 	test_must_fail git symbolic-ref HEAD
 '
 
 test_expect_success 'switch and detach current branch' '
-	test_when_finished git switch master &&
-	git switch master &&
+	test_when_finished git switch main &&
+	git switch main &&
 	git switch --detach &&
 	test_must_fail git symbolic-ref HEAD
 '
 
 test_expect_success 'switch and create branch' '
-	test_when_finished git switch master &&
-	git switch -c temp master^ &&
-	test_cmp_rev master^ refs/heads/temp &&
+	test_when_finished git switch main &&
+	git switch -c temp main^ &&
+	test_cmp_rev main^ refs/heads/temp &&
 	echo refs/heads/temp >expected-branch &&
 	git symbolic-ref HEAD >actual-branch &&
 	test_cmp expected-branch actual-branch
 '
 
 test_expect_success 'force create branch from HEAD' '
-	test_when_finished git switch master &&
-	git switch --detach master &&
+	test_when_finished git switch main &&
+	git switch --detach main &&
 	test_must_fail git switch -c temp &&
 	git switch -C temp &&
-	test_cmp_rev master refs/heads/temp &&
+	test_cmp_rev main refs/heads/temp &&
 	echo refs/heads/temp >expected-branch &&
 	git symbolic-ref HEAD >actual-branch &&
 	test_cmp expected-branch actual-branch
 '
 
 test_expect_success 'new orphan branch from empty' '
-	test_when_finished git switch master &&
+	test_when_finished git switch main &&
 	test_must_fail git switch --orphan new-orphan HEAD &&
 	git switch --orphan new-orphan &&
 	test_commit orphan &&
@@ -69,7 +69,7 @@ test_expect_success 'new orphan branch from empty' '
 '
 
 test_expect_success 'orphan branch works with --discard-changes' '
-	test_when_finished git switch master &&
+	test_when_finished git switch main &&
 	echo foo >foo.txt &&
 	git switch --discard-changes --orphan new-orphan2 &&
 	git ls-files >tracked-files &&
@@ -77,7 +77,7 @@ test_expect_success 'orphan branch works with --discard-changes' '
 '
 
 test_expect_success 'switching ignores file of same branch name' '
-	test_when_finished git switch master &&
+	test_when_finished git switch main &&
 	: >first-branch &&
 	git switch first-branch &&
 	echo refs/heads/first-branch >expected &&
@@ -86,7 +86,7 @@ test_expect_success 'switching ignores file of same branch name' '
 '
 
 test_expect_success 'guess and create branch' '
-	test_when_finished git switch master &&
+	test_when_finished git switch main &&
 	test_must_fail git switch --no-guess foo &&
 	test_config checkout.guess false &&
 	test_must_fail git switch foo &&
diff --git a/t/t2070-restore.sh b/t/t2070-restore.sh
index 89e5a142c9..46e27212d6 100755
--- a/t/t2070-restore.sh
+++ b/t/t2070-restore.sh
@@ -15,7 +15,7 @@ test_expect_success 'setup' '
 	echo ignored >ignored &&
 	echo /ignored >.gitignore &&
 	git add one two .gitignore &&
-	git update-ref refs/heads/one master
+	git update-ref refs/heads/one main
 '
 
 test_expect_success 'restore without pathspec is not ok' '
@@ -91,7 +91,7 @@ test_expect_success 'restore --ignore-unmerged ignores unmerged entries' '
 		git switch -c first &&
 		echo first >unmerged &&
 		git commit -am first &&
-		git switch -c second master &&
+		git switch -c second main &&
 		echo second >unmerged &&
 		git commit -am second &&
 		test_must_fail git merge first &&
diff --git a/t/t2106-update-index-assume-unchanged.sh b/t/t2106-update-index-assume-unchanged.sh
index 99d858c6b7..2b923824c9 100755
--- a/t/t2106-update-index-assume-unchanged.sh
+++ b/t/t2106-update-index-assume-unchanged.sh
@@ -19,6 +19,6 @@ test_expect_success 'do not switch branches with dirty file' \
 	 git checkout other &&
 	 echo dirt >file &&
 	 git update-index --assume-unchanged file &&
-	 test_must_fail git checkout master'
+	 test_must_fail git checkout main'
 
 test_done
diff --git a/t/t2400-worktree-add.sh b/t/t2400-worktree-add.sh
index 5a7495474a..deca7b0271 100755
--- a/t/t2400-worktree-add.sh
+++ b/t/t2400-worktree-add.sh
@@ -12,12 +12,12 @@ test_expect_success 'setup' '
 
 test_expect_success '"add" an existing worktree' '
 	mkdir -p existing/subtree &&
-	test_must_fail git worktree add --detach existing master
+	test_must_fail git worktree add --detach existing main
 '
 
 test_expect_success '"add" an existing empty worktree' '
 	mkdir existing_empty &&
-	git worktree add --detach existing_empty master
+	git worktree add --detach existing_empty main
 '
 
 test_expect_success '"add" using shorthand - fails when no previous branch' '
@@ -29,7 +29,7 @@ test_expect_success '"add" using - shorthand' '
 	echo hello >myworld &&
 	git add myworld &&
 	git commit -m myworld &&
-	git checkout master &&
+	git checkout main &&
 	git worktree add short-hand - &&
 	echo refs/heads/newbranch >expect &&
 	git -C short-hand rev-parse --symbolic-full-name HEAD >actual &&
@@ -37,7 +37,7 @@ test_expect_success '"add" using - shorthand' '
 '
 
 test_expect_success '"add" refuses to checkout locked branch' '
-	test_must_fail git worktree add zere master &&
+	test_must_fail git worktree add zere main &&
 	! test -d zere &&
 	! test -d .git/worktrees/zere
 '
@@ -46,13 +46,13 @@ test_expect_success 'checking out paths not complaining about linked checkouts'
 	(
 	cd existing_empty &&
 	echo dirty >>init.t &&
-	git checkout master -- init.t
+	git checkout main -- init.t
 	)
 '
 
 test_expect_success '"add" worktree' '
 	git rev-parse HEAD >expect &&
-	git worktree add --detach here master &&
+	git worktree add --detach here main &&
 	(
 		cd here &&
 		test_cmp ../init.t init.t &&
@@ -65,7 +65,7 @@ test_expect_success '"add" worktree' '
 
 test_expect_success '"add" worktree with lock' '
 	git rev-parse HEAD >expect &&
-	git worktree add --detach --lock here-with-lock master &&
+	git worktree add --detach --lock here-with-lock main &&
 	test -f .git/worktrees/here-with-lock/locked
 '
 
@@ -73,7 +73,7 @@ test_expect_success '"add" worktree from a subdir' '
 	(
 		mkdir sub &&
 		cd sub &&
-		git worktree add --detach here master &&
+		git worktree add --detach here main &&
 		cd here &&
 		test_cmp ../../init.t init.t
 	)
@@ -82,19 +82,19 @@ test_expect_success '"add" worktree from a subdir' '
 test_expect_success '"add" from a linked checkout' '
 	(
 		cd here &&
-		git worktree add --detach nested-here master &&
+		git worktree add --detach nested-here main &&
 		cd nested-here &&
 		git fsck
 	)
 '
 
 test_expect_success '"add" worktree creating new branch' '
-	git worktree add -b newmaster there master &&
+	git worktree add -b newmain there main &&
 	(
 		cd there &&
 		test_cmp ../init.t init.t &&
 		git symbolic-ref HEAD >actual &&
-		echo refs/heads/newmaster >expect &&
+		echo refs/heads/newmain >expect &&
 		test_cmp expect actual &&
 		git fsck
 	)
@@ -103,7 +103,7 @@ test_expect_success '"add" worktree creating new branch' '
 test_expect_success 'die the same branch is already checked out' '
 	(
 		cd here &&
-		test_must_fail git checkout newmaster
+		test_must_fail git checkout newmain
 	)
 '
 
@@ -112,20 +112,20 @@ test_expect_success SYMLINKS 'die the same branch is already checked out (symlin
 	ref=$(git -C there symbolic-ref HEAD) &&
 	rm "$head" &&
 	ln -s "$ref" "$head" &&
-	test_must_fail git -C here checkout newmaster
+	test_must_fail git -C here checkout newmain
 '
 
 test_expect_success 'not die the same branch is already checked out' '
 	(
 		cd here &&
-		git worktree add --force anothernewmaster newmaster
+		git worktree add --force anothernewmain newmain
 	)
 '
 
 test_expect_success 'not die on re-checking out current branch' '
 	(
 		cd there &&
-		git checkout newmaster
+		git checkout newmain
 	)
 '
 
@@ -133,14 +133,14 @@ test_expect_success '"add" from a bare repo' '
 	(
 		git clone --bare . bare &&
 		cd bare &&
-		git worktree add -b bare-master ../there2 master
+		git worktree add -b bare-main ../there2 main
 	)
 '
 
 test_expect_success 'checkout from a bare repo without "add"' '
 	(
 		cd bare &&
-		test_must_fail git checkout master
+		test_must_fail git checkout main
 	)
 '
 
@@ -148,7 +148,7 @@ test_expect_success '"add" default branch of a bare repo' '
 	(
 		git clone --bare . bare2 &&
 		cd bare2 &&
-		git worktree add ../there3 master
+		git worktree add ../there3 main
 	)
 '
 
@@ -165,7 +165,7 @@ test_expect_success 'checkout with grafts' '
 	EOF
 	git log --format=%s -2 >actual &&
 	test_cmp expected actual &&
-	git worktree add --detach grafted master &&
+	git worktree add --detach grafted main &&
 	git --git-dir=grafted/.git log --format=%s -2 >actual &&
 	test_cmp expected actual
 '
@@ -226,34 +226,34 @@ test_expect_success '"add" no auto-vivify with --detach and <branch> omitted' '
 '
 
 test_expect_success '"add" -b/-B mutually exclusive' '
-	test_must_fail git worktree add -b poodle -B poodle bamboo master
+	test_must_fail git worktree add -b poodle -B poodle bamboo main
 '
 
 test_expect_success '"add" -b/--detach mutually exclusive' '
-	test_must_fail git worktree add -b poodle --detach bamboo master
+	test_must_fail git worktree add -b poodle --detach bamboo main
 '
 
 test_expect_success '"add" -B/--detach mutually exclusive' '
-	test_must_fail git worktree add -B poodle --detach bamboo master
+	test_must_fail git worktree add -B poodle --detach bamboo main
 '
 
 test_expect_success '"add -B" fails if the branch is checked out' '
-	git rev-parse newmaster >before &&
-	test_must_fail git worktree add -B newmaster bamboo master &&
-	git rev-parse newmaster >after &&
+	git rev-parse newmain >before &&
+	test_must_fail git worktree add -B newmain bamboo main &&
+	git rev-parse newmain >after &&
 	test_cmp before after
 '
 
 test_expect_success 'add -B' '
-	git worktree add -B poodle bamboo2 master^ &&
+	git worktree add -B poodle bamboo2 main^ &&
 	git -C bamboo2 symbolic-ref HEAD >actual &&
 	echo refs/heads/poodle >expected &&
 	test_cmp expected actual &&
-	test_cmp_rev master^ poodle
+	test_cmp_rev main^ poodle
 '
 
 test_expect_success 'add --quiet' '
-	git worktree add --quiet another-worktree master 2>actual &&
+	git worktree add --quiet another-worktree main 2>actual &&
 	test_must_be_empty actual
 '
 
@@ -348,24 +348,24 @@ test_branch_upstream () {
 
 test_expect_success '--track sets up tracking' '
 	test_when_finished rm -rf track &&
-	git worktree add --track -b track track master &&
-	test_branch_upstream track . master
+	git worktree add --track -b track track main &&
+	test_branch_upstream track . main
 '
 
 # setup remote repository $1 and repository $2 with $1 set up as
-# remote.  The remote has two branches, master and foo.
+# remote.  The remote has two branches, main and foo.
 setup_remote_repo () {
 	git init $1 &&
 	(
 		cd $1 &&
-		test_commit $1_master &&
+		test_commit $1_main &&
 		git checkout -b foo &&
 		test_commit upstream_foo
 	) &&
 	git init $2 &&
 	(
 		cd $2 &&
-		test_commit $2_master &&
+		test_commit $2_main &&
 		git remote add $1 ../$1 &&
 		git config remote.$1.fetch \
 			"refs/heads/*:refs/remotes/$1/*" &&
diff --git a/t/t2401-worktree-prune.sh b/t/t2401-worktree-prune.sh
index a6ce7f590b..7a2ff04f44 100755
--- a/t/t2401-worktree-prune.sh
+++ b/t/t2401-worktree-prune.sh
@@ -87,7 +87,7 @@ test_expect_success 'not prune recent checkouts' '
 
 test_expect_success 'not prune proper checkouts' '
 	test_when_finished rm -r .git/worktrees &&
-	git worktree add --detach "$PWD/nop" master &&
+	git worktree add --detach "$PWD/nop" main &&
 	git worktree prune &&
 	test -d .git/worktrees/nop
 '
diff --git a/t/t2402-worktree-list.sh b/t/t2402-worktree-list.sh
index 795ddca2e4..03603d0dd0 100755
--- a/t/t2402-worktree-list.sh
+++ b/t/t2402-worktree-list.sh
@@ -21,7 +21,7 @@ test_expect_success 'rev-parse --git-common-dir on main worktree' '
 test_expect_success 'rev-parse --git-path objects linked worktree' '
 	echo "$(git rev-parse --show-toplevel)/.git/objects" >expect &&
 	test_when_finished "rm -rf linked-tree actual expect && git worktree prune" &&
-	git worktree add --detach linked-tree master &&
+	git worktree add --detach linked-tree main &&
 	git -C linked-tree rev-parse --git-path objects >actual &&
 	test_cmp expect actual
 '
@@ -29,7 +29,7 @@ test_expect_success 'rev-parse --git-path objects linked worktree' '
 test_expect_success '"list" all worktrees from main' '
 	echo "$(git rev-parse --show-toplevel) $(git rev-parse --short HEAD) [$(git symbolic-ref --short HEAD)]" >expect &&
 	test_when_finished "rm -rf here out actual expect && git worktree prune" &&
-	git worktree add --detach here master &&
+	git worktree add --detach here main &&
 	echo "$(git -C here rev-parse --show-toplevel) $(git rev-parse --short HEAD) (detached HEAD)" >>expect &&
 	git worktree list >out &&
 	sed "s/  */ /g" <out >actual &&
@@ -39,7 +39,7 @@ test_expect_success '"list" all worktrees from main' '
 test_expect_success '"list" all worktrees from linked' '
 	echo "$(git rev-parse --show-toplevel) $(git rev-parse --short HEAD) [$(git symbolic-ref --short HEAD)]" >expect &&
 	test_when_finished "rm -rf here out actual expect && git worktree prune" &&
-	git worktree add --detach here master &&
+	git worktree add --detach here main &&
 	echo "$(git -C here rev-parse --show-toplevel) $(git rev-parse --short HEAD) (detached HEAD)" >>expect &&
 	git -C here worktree list >out &&
 	sed "s/  */ /g" <out >actual &&
@@ -52,7 +52,7 @@ test_expect_success '"list" all worktrees --porcelain' '
 	echo "branch $(git symbolic-ref HEAD)" >>expect &&
 	echo >>expect &&
 	test_when_finished "rm -rf here actual expect && git worktree prune" &&
-	git worktree add --detach here master &&
+	git worktree add --detach here main &&
 	echo "worktree $(git -C here rev-parse --show-toplevel)" >>expect &&
 	echo "HEAD $(git rev-parse HEAD)" >>expect &&
 	echo "detached" >>expect &&
@@ -63,8 +63,8 @@ test_expect_success '"list" all worktrees --porcelain' '
 
 test_expect_success '"list" all worktrees with locked annotation' '
 	test_when_finished "rm -rf locked unlocked out && git worktree prune" &&
-	git worktree add --detach locked master &&
-	git worktree add --detach unlocked master &&
+	git worktree add --detach locked main &&
+	git worktree add --detach unlocked main &&
 	git worktree lock locked &&
 	git worktree list >out &&
 	grep "/locked  *[0-9a-f].* locked$" out &&
@@ -76,13 +76,13 @@ test_expect_success 'bare repo setup' '
 	echo "data" >file1 &&
 	git add file1 &&
 	git commit -m"File1: add data" &&
-	git push bare1 master &&
+	git push bare1 main &&
 	git reset --hard HEAD^
 '
 
 test_expect_success '"list" all worktrees from bare main' '
 	test_when_finished "rm -rf there out actual expect && git -C bare1 worktree prune" &&
-	git -C bare1 worktree add --detach ../there master &&
+	git -C bare1 worktree add --detach ../there main &&
 	echo "$(pwd)/bare1 (bare)" >expect &&
 	echo "$(git -C there rev-parse --show-toplevel) $(git -C there rev-parse --short HEAD) (detached HEAD)" >>expect &&
 	git -C bare1 worktree list >out &&
@@ -92,7 +92,7 @@ test_expect_success '"list" all worktrees from bare main' '
 
 test_expect_success '"list" all worktrees --porcelain from bare main' '
 	test_when_finished "rm -rf there actual expect && git -C bare1 worktree prune" &&
-	git -C bare1 worktree add --detach ../there master &&
+	git -C bare1 worktree add --detach ../there main &&
 	echo "worktree $(pwd)/bare1" >expect &&
 	echo "bare" >>expect &&
 	echo >>expect &&
@@ -106,7 +106,7 @@ test_expect_success '"list" all worktrees --porcelain from bare main' '
 
 test_expect_success '"list" all worktrees from linked with a bare main' '
 	test_when_finished "rm -rf there out actual expect && git -C bare1 worktree prune" &&
-	git -C bare1 worktree add --detach ../there master &&
+	git -C bare1 worktree add --detach ../there main &&
 	echo "$(pwd)/bare1 (bare)" >expect &&
 	echo "$(git -C there rev-parse --show-toplevel) $(git -C there rev-parse --short HEAD) (detached HEAD)" >>expect &&
 	git -C there worktree list >out &&
diff --git a/t/t2405-worktree-submodule.sh b/t/t2405-worktree-submodule.sh
index e1b2bfd87e..ccc47fae97 100755
--- a/t/t2405-worktree-submodule.sh
+++ b/t/t2405-worktree-submodule.sh
@@ -31,7 +31,7 @@ test_expect_success 'add superproject worktree' '
 '
 
 test_expect_failure 'submodule is checked out just after worktree add' '
-	git -C worktree diff --submodule master"^!" >out &&
+	git -C worktree diff --submodule main"^!" >out &&
 	grep "file1 updated" out
 '
 
@@ -41,7 +41,7 @@ test_expect_success 'add superproject worktree and initialize submodules' '
 '
 
 test_expect_success 'submodule is checked out just after submodule update in linked worktree' '
-	git -C worktree-submodule-update diff --submodule master"^!" >out &&
+	git -C worktree-submodule-update diff --submodule main"^!" >out &&
 	grep "file1 updated" out
 '
 
@@ -51,7 +51,7 @@ test_expect_success 'add superproject worktree and manually add submodule worktr
 '
 
 test_expect_success 'submodule is checked out after manually adding submodule worktree' '
-	git -C linked_submodule diff --submodule master"^!" >out &&
+	git -C linked_submodule diff --submodule main"^!" >out &&
 	grep "file1 updated" out
 '
 
diff --git a/t/test-lib.sh b/t/test-lib.sh
index 126004e342..3bb6675390 100644
--- a/t/test-lib.sh
+++ b/t/test-lib.sh
@@ -257,7 +257,7 @@ case "$TRASH_DIRECTORY" in
 esac
 
 case "$TEST_NUMBER" in
-[01]*)
+[0-2]*)
 	GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 	export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 	;;
-- 
gitgitgadget


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH 04/28] t3[0-3]*: adjust the references to the default branch name "main"
  2020-11-12 22:43 [PATCH 00/28] Use main as default branch name Johannes Schindelin via GitGitGadget
                   ` (2 preceding siblings ...)
  2020-11-12 22:43 ` [PATCH 03/28] t2*: " Johannes Schindelin via GitGitGadget
@ 2020-11-12 22:43 ` Johannes Schindelin via GitGitGadget
  2020-11-12 22:43 ` [PATCH 05/28] t3416: preemptively adjust alignment in a comment Johannes Schindelin via GitGitGadget
                   ` (28 subsequent siblings)
  32 siblings, 0 replies; 163+ messages in thread
From: Johannes Schindelin via GitGitGadget @ 2020-11-12 22:43 UTC (permalink / raw)
  To: git; +Cc: Johannes Schindelin, Johannes Schindelin

From: Johannes Schindelin <johannes.schindelin@gmx.de>

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[0-3]*.sh t3206/*)

This allows us to define `GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main`
for those tests.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
---
 t/t3040-subprojects-basic.sh          |   2 +-
 t/t3200-branch.sh                     | 242 +++++++++++++-------------
 t/t3201-branch-contains.sh            |  80 ++++-----
 t/t3202-show-branch-octopus.sh        |   2 +-
 t/t3203-branch-output.sh              |  38 ++--
 t/t3204-branch-name-interpretation.sh |   6 +-
 t/t3205-branch-color.sh               |   6 +-
 t/t3206-range-diff.sh                 |  40 ++---
 t/t3206/history.export                |   2 +-
 t/t3210-pack-refs.sh                  |   4 +-
 t/t3211-peel-ref.sh                   |   4 +-
 t/t3301-notes.sh                      |   6 +-
 t/t3302-notes-index-expensive.sh      |   2 +-
 t/t3303-notes-subtrees.sh             |   8 +-
 t/t3304-notes-mixed.sh                |   8 +-
 t/t3308-notes-merge.sh                |   2 +-
 t/t3320-notes-merge-worktrees.sh      |   4 +-
 t/test-lib.sh                         |   2 +-
 18 files changed, 229 insertions(+), 229 deletions(-)

diff --git a/t/t3040-subprojects-basic.sh b/t/t3040-subprojects-basic.sh
index b81eb5fd6f..f3ea8dcf58 100755
--- a/t/t3040-subprojects-basic.sh
+++ b/t/t3040-subprojects-basic.sh
@@ -80,6 +80,6 @@ test_expect_success 'checkout in superproject' '
 '
 
 # just interesting what happened...
-# git diff --name-status -M save master
+# git diff --name-status -M save main
 
 test_done
diff --git a/t/t3200-branch.sh b/t/t3200-branch.sh
index a0b832d59e..63036e0369 100755
--- a/t/t3200-branch.sh
+++ b/t/t3200-branch.sh
@@ -28,7 +28,7 @@ test_expect_success 'branch -h in broken repository' '
 	(
 		cd broken &&
 		git init &&
-		>.git/refs/heads/master &&
+		>.git/refs/heads/main &&
 		test_expect_code 129 git branch -h >usage 2>&1
 	) &&
 	test_i18ngrep "[Uu]sage" broken/usage
@@ -42,8 +42,8 @@ test_expect_success 'git branch a/b/c should create a branch' '
 	git branch a/b/c && test_path_is_file .git/refs/heads/a/b/c
 '
 
-test_expect_success 'git branch mb master... should create a branch' '
-	git branch mb master... && test_path_is_file .git/refs/heads/mb
+test_expect_success 'git branch mb main... should create a branch' '
+	git branch mb main... && test_path_is_file .git/refs/heads/mb
 '
 
 test_expect_success 'git branch HEAD should fail' '
@@ -51,7 +51,7 @@ test_expect_success 'git branch HEAD should fail' '
 '
 
 cat >expect <<EOF
-$ZERO_OID $HEAD $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> 1117150200 +0000	branch: Created from master
+$ZERO_OID $HEAD $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> 1117150200 +0000	branch: Created from main
 EOF
 test_expect_success 'git branch --create-reflog d/e/f should create a branch and a log' '
 	GIT_COMMITTER_DATE="2005-05-26 23:30" \
@@ -110,7 +110,7 @@ test_expect_success 'git branch -m n/n n should work' '
 
 test_expect_success 'git branch -m bbb should rename checked out branch' '
 	test_when_finished git branch -D bbb &&
-	test_when_finished git checkout master &&
+	test_when_finished git checkout main &&
 	git checkout -b aaa &&
 	git commit --allow-empty -m "a new commit" &&
 	git rev-parse aaa@{0} >expect &&
@@ -124,7 +124,7 @@ test_expect_success 'git branch -m bbb should rename checked out branch' '
 
 test_expect_success 'renaming checked out branch works with d/f conflict' '
 	test_when_finished "git branch -D foo/bar || git branch -D foo" &&
-	test_when_finished git checkout master &&
+	test_when_finished git checkout main &&
 	git checkout -b foo &&
 	git branch -m foo/bar &&
 	git symbolic-ref HEAD >actual &&
@@ -185,7 +185,7 @@ test_expect_success 'git branch -M should leave orphaned HEAD alone' '
 		git checkout --orphan lonely &&
 		grep lonely .git/HEAD &&
 		test_path_is_missing .git/refs/head/lonely &&
-		git branch -M master mistress &&
+		git branch -M main mistress &&
 		grep lonely .git/HEAD
 	)
 '
@@ -201,7 +201,7 @@ test_expect_success 'resulting reflog can be shown by log -g' '
 '
 
 test_expect_success 'git branch -M baz bam should succeed when baz is checked out as linked working tree' '
-	git checkout master &&
+	git checkout main &&
 	git worktree add -b baz bazdir &&
 	git worktree add -f bazdir2 baz &&
 	git branch -M baz bam &&
@@ -224,18 +224,18 @@ test_expect_success 'git branch -M baz bam should succeed within a worktree in w
 	git worktree prune
 '
 
-test_expect_success 'git branch -M master should work when master is checked out' '
-	git checkout master &&
-	git branch -M master
+test_expect_success 'git branch -M main should work when main is checked out' '
+	git checkout main &&
+	git branch -M main
 '
 
-test_expect_success 'git branch -M master master should work when master is checked out' '
-	git checkout master &&
-	git branch -M master master
+test_expect_success 'git branch -M main main should work when main is checked out' '
+	git checkout main &&
+	git branch -M main main
 '
 
-test_expect_success 'git branch -M topic topic should work when master is checked out' '
-	git checkout master &&
+test_expect_success 'git branch -M topic topic should work when main is checked out' '
+	git checkout main &&
 	git branch topic &&
 	git branch -M topic topic
 '
@@ -292,8 +292,8 @@ test_expect_success 'bare main worktree has HEAD at branch deleted by secondary
 	git init nonbare &&
 	test_commit -C nonbare x &&
 	git clone --bare nonbare bare &&
-	git -C bare worktree add --detach ../secondary master &&
-	git -C secondary branch -D master
+	git -C bare worktree add --detach ../secondary main &&
+	git -C secondary branch -D main
 '
 
 test_expect_success 'git branch --list -v with --abbrev' '
@@ -345,7 +345,7 @@ test_expect_success 'git branch --column with an extremely long branch name' '
   j/k
   l
   m/m
-* master
+* main
   mb
   n
   o/o
@@ -388,7 +388,7 @@ test_expect_success PREPARE_FOR_MAIN_BRANCH 'git branch -v with column.ui ignore
   j/k
   l
   m/m
-* master
+* main
   mb
   n
   o/o
@@ -427,8 +427,8 @@ test_expect_success 'config information was renamed, too' '
 '
 
 test_expect_success 'git branch -m correctly renames multiple config sections' '
-	test_when_finished "git checkout master" &&
-	git checkout -b source master &&
+	test_when_finished "git checkout main" &&
+	git checkout -b source main &&
 
 	# Assert that a config file with multiple config sections has
 	# those sections preserved...
@@ -587,18 +587,18 @@ test_expect_success 'git branch -C c1 c2 should never touch HEAD' '
 	! grep "$msg$" .git/logs/HEAD
 '
 
-test_expect_success 'git branch -C master should work when master is checked out' '
-	git checkout master &&
-	git branch -C master
+test_expect_success 'git branch -C main should work when main is checked out' '
+	git checkout main &&
+	git branch -C main
 '
 
-test_expect_success 'git branch -C master master should work when master is checked out' '
-	git checkout master &&
-	git branch -C master master
+test_expect_success 'git branch -C main main should work when main is checked out' '
+	git checkout main &&
+	git branch -C main main
 '
 
-test_expect_success 'git branch -C main5 main5 should work when master is checked out' '
-	git checkout master &&
+test_expect_success 'git branch -C main5 main5 should work when main is checked out' '
+	git checkout main &&
 	git branch main5 &&
 	git branch -C main5 main5
 '
@@ -620,8 +620,8 @@ test_expect_success 'git branch -C ab cd should overwrite existing config for cd
 test_expect_success 'git branch -c correctly copies multiple config sections' '
 	FOO=1 &&
 	export FOO &&
-	test_when_finished "git checkout master" &&
-	git checkout -b source2 master &&
+	test_when_finished "git checkout main" &&
+	git checkout -b source2 main &&
 
 	# Assert that a config file with multiple config sections has
 	# those sections preserved...
@@ -711,10 +711,10 @@ test_expect_success 'deleting a self-referential symref' '
 '
 
 test_expect_success 'renaming a symref is not allowed' '
-	git symbolic-ref refs/heads/topic refs/heads/master &&
+	git symbolic-ref refs/heads/topic refs/heads/main &&
 	test_must_fail git branch -m topic new-topic &&
 	git symbolic-ref refs/heads/topic &&
-	test_path_is_file .git/refs/heads/master &&
+	test_path_is_file .git/refs/heads/main &&
 	test_path_is_missing .git/refs/heads/new-topic
 '
 
@@ -728,27 +728,27 @@ test_expect_success SYMLINKS 'git branch -m u v should fail when the reflog for
 test_expect_success 'test tracking setup via --track' '
 	git config remote.local.url . &&
 	git config remote.local.fetch refs/heads/*:refs/remotes/local/* &&
-	(git show-ref -q refs/remotes/local/master || git fetch local) &&
-	git branch --track my1 local/master &&
+	(git show-ref -q refs/remotes/local/main || git fetch local) &&
+	git branch --track my1 local/main &&
 	test $(git config branch.my1.remote) = local &&
-	test $(git config branch.my1.merge) = refs/heads/master
+	test $(git config branch.my1.merge) = refs/heads/main
 '
 
 test_expect_success 'test tracking setup (non-wildcard, matching)' '
 	git config remote.local.url . &&
-	git config remote.local.fetch refs/heads/master:refs/remotes/local/master &&
-	(git show-ref -q refs/remotes/local/master || git fetch local) &&
-	git branch --track my4 local/master &&
+	git config remote.local.fetch refs/heads/main:refs/remotes/local/main &&
+	(git show-ref -q refs/remotes/local/main || git fetch local) &&
+	git branch --track my4 local/main &&
 	test $(git config branch.my4.remote) = local &&
-	test $(git config branch.my4.merge) = refs/heads/master
+	test $(git config branch.my4.merge) = refs/heads/main
 '
 
 test_expect_success 'tracking setup fails on non-matching refspec' '
 	git config remote.local.url . &&
 	git config remote.local.fetch refs/heads/*:refs/remotes/local/* &&
-	(git show-ref -q refs/remotes/local/master || git fetch local) &&
+	(git show-ref -q refs/remotes/local/main || git fetch local) &&
 	git config remote.local.fetch refs/heads/s:refs/remotes/local/s &&
-	test_must_fail git branch --track my5 local/master &&
+	test_must_fail git branch --track my5 local/main &&
 	test_must_fail git config branch.my5.remote &&
 	test_must_fail git config branch.my5.merge
 '
@@ -757,21 +757,21 @@ test_expect_success 'test tracking setup via config' '
 	git config branch.autosetupmerge true &&
 	git config remote.local.url . &&
 	git config remote.local.fetch refs/heads/*:refs/remotes/local/* &&
-	(git show-ref -q refs/remotes/local/master || git fetch local) &&
-	git branch my3 local/master &&
+	(git show-ref -q refs/remotes/local/main || git fetch local) &&
+	git branch my3 local/main &&
 	test $(git config branch.my3.remote) = local &&
-	test $(git config branch.my3.merge) = refs/heads/master
+	test $(git config branch.my3.merge) = refs/heads/main
 '
 
 test_expect_success 'test overriding tracking setup via --no-track' '
 	git config branch.autosetupmerge true &&
 	git config remote.local.url . &&
 	git config remote.local.fetch refs/heads/*:refs/remotes/local/* &&
-	(git show-ref -q refs/remotes/local/master || git fetch local) &&
-	git branch --no-track my2 local/master &&
+	(git show-ref -q refs/remotes/local/main || git fetch local) &&
+	git branch --no-track my2 local/main &&
 	git config branch.autosetupmerge false &&
 	! test "$(git config branch.my2.remote)" = local &&
-	! test "$(git config branch.my2.merge)" = refs/heads/master
+	! test "$(git config branch.my2.merge)" = refs/heads/main
 '
 
 test_expect_success 'no tracking without .fetch entries' '
@@ -836,26 +836,26 @@ test_expect_success 'branch from tag w/--track causes failure' '
 
 test_expect_success '--set-upstream-to fails on multiple branches' '
 	echo "fatal: too many arguments to set new upstream" >expect &&
-	test_must_fail git branch --set-upstream-to master a b c 2>err &&
+	test_must_fail git branch --set-upstream-to main a b c 2>err &&
 	test_i18ncmp expect err
 '
 
 test_expect_success '--set-upstream-to fails on detached HEAD' '
 	git checkout HEAD^{} &&
 	test_when_finished git checkout - &&
-	echo "fatal: could not set upstream of HEAD to master when it does not point to any branch." >expect &&
-	test_must_fail git branch --set-upstream-to master 2>err &&
+	echo "fatal: could not set upstream of HEAD to main when it does not point to any branch." >expect &&
+	test_must_fail git branch --set-upstream-to main 2>err &&
 	test_i18ncmp expect err
 '
 
 test_expect_success '--set-upstream-to fails on a missing dst branch' '
 	echo "fatal: branch '"'"'does-not-exist'"'"' does not exist" >expect &&
-	test_must_fail git branch --set-upstream-to master does-not-exist 2>err &&
+	test_must_fail git branch --set-upstream-to main does-not-exist 2>err &&
 	test_i18ncmp expect err
 '
 
 test_expect_success '--set-upstream-to fails on a missing src branch' '
-	test_must_fail git branch --set-upstream-to does-not-exist master 2>err &&
+	test_must_fail git branch --set-upstream-to does-not-exist main 2>err &&
 	test_i18ngrep "the requested upstream branch '"'"'does-not-exist'"'"' does not exist" err
 '
 
@@ -874,20 +874,20 @@ test_expect_success '--set-upstream-to fails on locked config' '
 '
 
 test_expect_success 'use --set-upstream-to modify HEAD' '
-	test_config branch.master.remote foo &&
-	test_config branch.master.merge foo &&
+	test_config branch.main.remote foo &&
+	test_config branch.main.merge foo &&
 	git branch my12 &&
 	git branch --set-upstream-to my12 &&
-	test "$(git config branch.master.remote)" = "." &&
-	test "$(git config branch.master.merge)" = "refs/heads/my12"
+	test "$(git config branch.main.remote)" = "." &&
+	test "$(git config branch.main.merge)" = "refs/heads/my12"
 '
 
 test_expect_success 'use --set-upstream-to modify a particular branch' '
 	git branch my13 &&
-	git branch --set-upstream-to master my13 &&
+	git branch --set-upstream-to main my13 &&
 	test_when_finished "git branch --unset-upstream my13" &&
 	test "$(git config branch.my13.remote)" = "." &&
-	test "$(git config branch.my13.merge)" = "refs/heads/master"
+	test "$(git config branch.my13.merge)" = "refs/heads/main"
 '
 
 test_expect_success '--unset-upstream should fail if given a non-existent branch' '
@@ -906,14 +906,14 @@ test_expect_success '--unset-upstream should fail if config is locked' '
 
 test_expect_success 'test --unset-upstream on HEAD' '
 	git branch my14 &&
-	test_config branch.master.remote foo &&
-	test_config branch.master.merge foo &&
+	test_config branch.main.remote foo &&
+	test_config branch.main.merge foo &&
 	git branch --set-upstream-to my14 &&
 	git branch --unset-upstream &&
-	test_must_fail git config branch.master.remote &&
-	test_must_fail git config branch.master.merge &&
+	test_must_fail git config branch.main.remote &&
+	test_must_fail git config branch.main.merge &&
 	# fail for a branch without upstream set
-	echo "fatal: Branch '"'"'master'"'"' has no upstream information" >expect &&
+	echo "fatal: Branch '"'"'main'"'"' has no upstream information" >expect &&
 	test_must_fail git branch --unset-upstream 2>err &&
 	test_i18ncmp expect err
 '
@@ -934,14 +934,14 @@ test_expect_success '--unset-upstream should fail on detached HEAD' '
 
 test_expect_success 'test --unset-upstream on a particular branch' '
 	git branch my15 &&
-	git branch --set-upstream-to master my14 &&
+	git branch --set-upstream-to main my14 &&
 	git branch --unset-upstream my14 &&
 	test_must_fail git config branch.my14.remote &&
 	test_must_fail git config branch.my14.merge
 '
 
 test_expect_success 'disabled option --set-upstream fails' '
-	test_must_fail git branch --set-upstream origin/master
+	test_must_fail git branch --set-upstream origin/main
 '
 
 test_expect_success '--set-upstream-to notices an error to set branch as own upstream' '
@@ -956,32 +956,32 @@ test_expect_success '--set-upstream-to notices an error to set branch as own ups
 
 # Keep this test last, as it changes the current branch
 cat >expect <<EOF
-$ZERO_OID $HEAD $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> 1117150200 +0000	branch: Created from master
+$ZERO_OID $HEAD $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> 1117150200 +0000	branch: Created from main
 EOF
 test_expect_success 'git checkout -b g/h/i -l should create a branch and a log' '
 	GIT_COMMITTER_DATE="2005-05-26 23:30" \
-	git checkout -b g/h/i -l master &&
+	git checkout -b g/h/i -l main &&
 	test_path_is_file .git/refs/heads/g/h/i &&
 	test_path_is_file .git/logs/refs/heads/g/h/i &&
 	test_cmp expect .git/logs/refs/heads/g/h/i
 '
 
 test_expect_success 'checkout -b makes reflog by default' '
-	git checkout master &&
+	git checkout main &&
 	git config --unset core.logAllRefUpdates &&
 	git checkout -b alpha &&
 	git rev-parse --verify alpha@{0}
 '
 
 test_expect_success 'checkout -b does not make reflog when core.logAllRefUpdates = false' '
-	git checkout master &&
+	git checkout main &&
 	git config core.logAllRefUpdates false &&
 	git checkout -b beta &&
 	test_must_fail git rev-parse --verify beta@{0}
 '
 
 test_expect_success 'checkout -b with -l makes reflog when core.logAllRefUpdates = false' '
-	git checkout master &&
+	git checkout main &&
 	git checkout -lb gamma &&
 	git config --unset core.logAllRefUpdates &&
 	git rev-parse --verify gamma@{0}
@@ -990,10 +990,10 @@ test_expect_success 'checkout -b with -l makes reflog when core.logAllRefUpdates
 test_expect_success 'avoid ambiguous track' '
 	git config branch.autosetupmerge true &&
 	git config remote.ambi1.url lalala &&
-	git config remote.ambi1.fetch refs/heads/lalala:refs/heads/master &&
+	git config remote.ambi1.fetch refs/heads/lalala:refs/heads/main &&
 	git config remote.ambi2.url lilili &&
-	git config remote.ambi2.fetch refs/heads/lilili:refs/heads/master &&
-	test_must_fail git branch all1 master &&
+	git config remote.ambi2.fetch refs/heads/lilili:refs/heads/main &&
+	test_must_fail git branch all1 main &&
 	test -z "$(git config branch.all1.merge)"
 '
 
@@ -1049,10 +1049,10 @@ test_expect_success 'autosetuprebase local on a tracked remote branch' '
 	git config remote.local.url . &&
 	git config remote.local.fetch refs/heads/*:refs/remotes/local/* &&
 	git config branch.autosetuprebase local &&
-	(git show-ref -q refs/remotes/local/master || git fetch local) &&
-	git branch --track myr5 local/master &&
+	(git show-ref -q refs/remotes/local/main || git fetch local) &&
+	git branch --track myr5 local/main &&
 	test "$(git config branch.myr5.remote)" = local &&
-	test "$(git config branch.myr5.merge)" = refs/heads/master &&
+	test "$(git config branch.myr5.merge)" = refs/heads/main &&
 	! test "$(git config branch.myr5.rebase)" = true
 '
 
@@ -1060,10 +1060,10 @@ test_expect_success 'autosetuprebase never on a tracked remote branch' '
 	git config remote.local.url . &&
 	git config remote.local.fetch refs/heads/*:refs/remotes/local/* &&
 	git config branch.autosetuprebase never &&
-	(git show-ref -q refs/remotes/local/master || git fetch local) &&
-	git branch --track myr6 local/master &&
+	(git show-ref -q refs/remotes/local/main || git fetch local) &&
+	git branch --track myr6 local/main &&
 	test "$(git config branch.myr6.remote)" = local &&
-	test "$(git config branch.myr6.merge)" = refs/heads/master &&
+	test "$(git config branch.myr6.merge)" = refs/heads/main &&
 	! test "$(git config branch.myr6.rebase)" = true
 '
 
@@ -1071,10 +1071,10 @@ test_expect_success 'autosetuprebase remote on a tracked remote branch' '
 	git config remote.local.url . &&
 	git config remote.local.fetch refs/heads/*:refs/remotes/local/* &&
 	git config branch.autosetuprebase remote &&
-	(git show-ref -q refs/remotes/local/master || git fetch local) &&
-	git branch --track myr7 local/master &&
+	(git show-ref -q refs/remotes/local/main || git fetch local) &&
+	git branch --track myr7 local/main &&
 	test "$(git config branch.myr7.remote)" = local &&
-	test "$(git config branch.myr7.merge)" = refs/heads/master &&
+	test "$(git config branch.myr7.merge)" = refs/heads/main &&
 	test "$(git config branch.myr7.rebase)" = true
 '
 
@@ -1082,10 +1082,10 @@ test_expect_success 'autosetuprebase always on a tracked remote branch' '
 	git config remote.local.url . &&
 	git config remote.local.fetch refs/heads/*:refs/remotes/local/* &&
 	git config branch.autosetuprebase remote &&
-	(git show-ref -q refs/remotes/local/master || git fetch local) &&
-	git branch --track myr8 local/master &&
+	(git show-ref -q refs/remotes/local/main || git fetch local) &&
+	git branch --track myr8 local/main &&
 	test "$(git config branch.myr8.remote)" = local &&
-	test "$(git config branch.myr8.merge)" = refs/heads/master &&
+	test "$(git config branch.myr8.merge)" = refs/heads/main &&
 	test "$(git config branch.myr8.rebase)" = true
 '
 
@@ -1093,10 +1093,10 @@ test_expect_success 'autosetuprebase unconfigured on a tracked remote branch' '
 	git config --unset branch.autosetuprebase &&
 	git config remote.local.url . &&
 	git config remote.local.fetch refs/heads/*:refs/remotes/local/* &&
-	(git show-ref -q refs/remotes/local/master || git fetch local) &&
-	git branch --track myr9 local/master &&
+	(git show-ref -q refs/remotes/local/main || git fetch local) &&
+	git branch --track myr9 local/main &&
 	test "$(git config branch.myr9.remote)" = local &&
-	test "$(git config branch.myr9.merge)" = refs/heads/master &&
+	test "$(git config branch.myr9.merge)" = refs/heads/main &&
 	test "z$(git config branch.myr9.rebase)" = z
 '
 
@@ -1114,7 +1114,7 @@ test_expect_success 'autosetuprebase unconfigured on a tracked local branch' '
 test_expect_success 'autosetuprebase unconfigured on untracked local branch' '
 	git config remote.local.url . &&
 	git config remote.local.fetch refs/heads/*:refs/remotes/local/* &&
-	(git show-ref -q refs/remotes/local/master || git fetch local) &&
+	(git show-ref -q refs/remotes/local/main || git fetch local) &&
 	git branch --no-track myr11 mybase2 &&
 	test "z$(git config branch.myr11.remote)" = z &&
 	test "z$(git config branch.myr11.merge)" = z &&
@@ -1124,8 +1124,8 @@ test_expect_success 'autosetuprebase unconfigured on untracked local branch' '
 test_expect_success 'autosetuprebase unconfigured on untracked remote branch' '
 	git config remote.local.url . &&
 	git config remote.local.fetch refs/heads/*:refs/remotes/local/* &&
-	(git show-ref -q refs/remotes/local/master || git fetch local) &&
-	git branch --no-track myr12 local/master &&
+	(git show-ref -q refs/remotes/local/main || git fetch local) &&
+	git branch --no-track myr12 local/main &&
 	test "z$(git config branch.myr12.remote)" = z &&
 	test "z$(git config branch.myr12.merge)" = z &&
 	test "z$(git config branch.myr12.rebase)" = z
@@ -1135,7 +1135,7 @@ test_expect_success 'autosetuprebase never on an untracked local branch' '
 	git config branch.autosetuprebase never &&
 	git config remote.local.url . &&
 	git config remote.local.fetch refs/heads/*:refs/remotes/local/* &&
-	(git show-ref -q refs/remotes/local/master || git fetch local) &&
+	(git show-ref -q refs/remotes/local/main || git fetch local) &&
 	git branch --no-track myr13 mybase2 &&
 	test "z$(git config branch.myr13.remote)" = z &&
 	test "z$(git config branch.myr13.merge)" = z &&
@@ -1146,7 +1146,7 @@ test_expect_success 'autosetuprebase local on an untracked local branch' '
 	git config branch.autosetuprebase local &&
 	git config remote.local.url . &&
 	git config remote.local.fetch refs/heads/*:refs/remotes/local/* &&
-	(git show-ref -q refs/remotes/local/master || git fetch local) &&
+	(git show-ref -q refs/remotes/local/main || git fetch local) &&
 	git branch --no-track myr14 mybase2 &&
 	test "z$(git config branch.myr14.remote)" = z &&
 	test "z$(git config branch.myr14.merge)" = z &&
@@ -1157,7 +1157,7 @@ test_expect_success 'autosetuprebase remote on an untracked local branch' '
 	git config branch.autosetuprebase remote &&
 	git config remote.local.url . &&
 	git config remote.local.fetch refs/heads/*:refs/remotes/local/* &&
-	(git show-ref -q refs/remotes/local/master || git fetch local) &&
+	(git show-ref -q refs/remotes/local/main || git fetch local) &&
 	git branch --no-track myr15 mybase2 &&
 	test "z$(git config branch.myr15.remote)" = z &&
 	test "z$(git config branch.myr15.merge)" = z &&
@@ -1168,7 +1168,7 @@ test_expect_success 'autosetuprebase always on an untracked local branch' '
 	git config branch.autosetuprebase always &&
 	git config remote.local.url . &&
 	git config remote.local.fetch refs/heads/*:refs/remotes/local/* &&
-	(git show-ref -q refs/remotes/local/master || git fetch local) &&
+	(git show-ref -q refs/remotes/local/main || git fetch local) &&
 	git branch --no-track myr16 mybase2 &&
 	test "z$(git config branch.myr16.remote)" = z &&
 	test "z$(git config branch.myr16.merge)" = z &&
@@ -1179,8 +1179,8 @@ test_expect_success 'autosetuprebase never on an untracked remote branch' '
 	git config branch.autosetuprebase never &&
 	git config remote.local.url . &&
 	git config remote.local.fetch refs/heads/*:refs/remotes/local/* &&
-	(git show-ref -q refs/remotes/local/master || git fetch local) &&
-	git branch --no-track myr17 local/master &&
+	(git show-ref -q refs/remotes/local/main || git fetch local) &&
+	git branch --no-track myr17 local/main &&
 	test "z$(git config branch.myr17.remote)" = z &&
 	test "z$(git config branch.myr17.merge)" = z &&
 	test "z$(git config branch.myr17.rebase)" = z
@@ -1190,8 +1190,8 @@ test_expect_success 'autosetuprebase local on an untracked remote branch' '
 	git config branch.autosetuprebase local &&
 	git config remote.local.url . &&
 	git config remote.local.fetch refs/heads/*:refs/remotes/local/* &&
-	(git show-ref -q refs/remotes/local/master || git fetch local) &&
-	git branch --no-track myr18 local/master &&
+	(git show-ref -q refs/remotes/local/main || git fetch local) &&
+	git branch --no-track myr18 local/main &&
 	test "z$(git config branch.myr18.remote)" = z &&
 	test "z$(git config branch.myr18.merge)" = z &&
 	test "z$(git config branch.myr18.rebase)" = z
@@ -1201,8 +1201,8 @@ test_expect_success 'autosetuprebase remote on an untracked remote branch' '
 	git config branch.autosetuprebase remote &&
 	git config remote.local.url . &&
 	git config remote.local.fetch refs/heads/*:refs/remotes/local/* &&
-	(git show-ref -q refs/remotes/local/master || git fetch local) &&
-	git branch --no-track myr19 local/master &&
+	(git show-ref -q refs/remotes/local/main || git fetch local) &&
+	git branch --no-track myr19 local/main &&
 	test "z$(git config branch.myr19.remote)" = z &&
 	test "z$(git config branch.myr19.merge)" = z &&
 	test "z$(git config branch.myr19.rebase)" = z
@@ -1212,8 +1212,8 @@ test_expect_success 'autosetuprebase always on an untracked remote branch' '
 	git config branch.autosetuprebase always &&
 	git config remote.local.url . &&
 	git config remote.local.fetch refs/heads/*:refs/remotes/local/* &&
-	(git show-ref -q refs/remotes/local/master || git fetch local) &&
-	git branch --no-track myr20 local/master &&
+	(git show-ref -q refs/remotes/local/main || git fetch local) &&
+	git branch --no-track myr20 local/main &&
 	test "z$(git config branch.myr20.remote)" = z &&
 	test "z$(git config branch.myr20.merge)" = z &&
 	test "z$(git config branch.myr20.rebase)" = z
@@ -1221,7 +1221,7 @@ test_expect_success 'autosetuprebase always on an untracked remote branch' '
 
 test_expect_success 'autosetuprebase always on detached HEAD' '
 	git config branch.autosetupmerge always &&
-	test_when_finished git checkout master &&
+	test_when_finished git checkout main &&
 	git checkout HEAD^0 &&
 	git branch my11 &&
 	test -z "$(git config branch.my11.remote)" &&
@@ -1249,18 +1249,18 @@ test_expect_success 'attempt to delete a branch without base and unmerged to HEA
 test_expect_success 'attempt to delete a branch merged to its base' '
 	# we are on my9 which is the initial commit; traditionally
 	# we would not have allowed deleting my8 that is not merged
-	# to my9, but it is set to track master that already has my8
-	git config branch.my8.merge refs/heads/master &&
+	# to my9, but it is set to track main that already has my8
+	git config branch.my8.merge refs/heads/main &&
 	git branch -d my8
 '
 
 test_expect_success 'attempt to delete a branch merged to its base' '
-	git checkout master &&
+	git checkout main &&
 	echo Third >>A &&
 	git commit -m "Third commit" A &&
 	git branch -t my10 my9 &&
 	git branch -f my10 HEAD^ &&
-	# we are on master which is at the third commit, and my10
+	# we are on main which is at the third commit, and my10
 	# is behind us, so traditionally we would have allowed deleting
 	# it; but my10 is set to track my9 that is further behind.
 	test_must_fail git branch -d my10
@@ -1287,7 +1287,7 @@ test_expect_success 'detect typo in branch name when using --edit-description' '
 '
 
 test_expect_success 'refuse --edit-description on unborn branch for now' '
-	test_when_finished "git checkout master" &&
+	test_when_finished "git checkout main" &&
 	write_script editor <<-\EOF &&
 		echo "New contents" >"$1"
 	EOF
@@ -1301,18 +1301,18 @@ test_expect_success '--merged catches invalid object names' '
 
 test_expect_success '--list during rebase' '
 	test_when_finished "reset_rebase" &&
-	git checkout master &&
+	git checkout main &&
 	FAKE_LINES="1 edit 2" &&
 	export FAKE_LINES &&
 	set_fake_editor &&
 	git rebase -i HEAD~2 &&
 	git branch --list >actual &&
-	test_i18ngrep "rebasing master" actual
+	test_i18ngrep "rebasing main" actual
 '
 
 test_expect_success '--list during rebase from detached HEAD' '
-	test_when_finished "reset_rebase && git checkout master" &&
-	git checkout master^0 &&
+	test_when_finished "reset_rebase && git checkout main" &&
+	git checkout main^0 &&
 	oid=$(git rev-parse --short HEAD) &&
 	FAKE_LINES="1 edit 2" &&
 	export FAKE_LINES &&
@@ -1348,11 +1348,11 @@ test_expect_success 'tracking with unexpected .fetch refspec' '
 		git remote add c ../c &&
 		git config remote.c.fetch "+refs/remotes/*:refs/remotes/*" &&
 		git fetch c &&
-		git branch --track local/a/master remotes/a/master &&
-		test "$(git config branch.local/a/master.remote)" = "c" &&
-		test "$(git config branch.local/a/master.merge)" = "refs/remotes/a/master" &&
+		git branch --track local/a/main remotes/a/main &&
+		test "$(git config branch.local/a/main.remote)" = "c" &&
+		test "$(git config branch.local/a/main.merge)" = "refs/remotes/a/main" &&
 		git rev-parse --verify a >expect &&
-		git rev-parse --verify local/a/master >actual &&
+		git rev-parse --verify local/a/main >actual &&
 		test_cmp expect actual
 	)
 '
@@ -1371,7 +1371,7 @@ test_expect_success 'configured committerdate sort' '
 		test_commit b &&
 		git branch >actual &&
 		cat >expect <<-\EOF &&
-		  master
+		  main
 		  a
 		  c
 		* b
@@ -1389,7 +1389,7 @@ test_expect_success 'option override configured sort' '
 		  a
 		* b
 		  c
-		  master
+		  main
 		EOF
 		test_cmp expect actual
 	)
diff --git a/t/t3201-branch-contains.sh b/t/t3201-branch-contains.sh
index 3733cd0091..110cfef820 100755
--- a/t/t3201-branch-contains.sh
+++ b/t/t3201-branch-contains.sh
@@ -14,47 +14,47 @@ test_expect_success setup '
 
 	echo 1 >file &&
 	test_tick &&
-	git commit -a -m "second on master" &&
+	git commit -a -m "second on main" &&
 
 	git checkout side &&
 	echo 1 >file &&
 	test_tick &&
 	git commit -a -m "second on side" &&
 
-	git merge master
+	git merge main
 
 '
 
-test_expect_success 'branch --contains=master' '
+test_expect_success 'branch --contains=main' '
 
-	git branch --contains=master >actual &&
+	git branch --contains=main >actual &&
 	{
-		echo "  master" && echo "* side"
+		echo "  main" && echo "* side"
 	} >expect &&
 	test_cmp expect actual
 
 '
 
-test_expect_success 'branch --contains master' '
+test_expect_success 'branch --contains main' '
 
-	git branch --contains master >actual &&
+	git branch --contains main >actual &&
 	{
-		echo "  master" && echo "* side"
+		echo "  main" && echo "* side"
 	} >expect &&
 	test_cmp expect actual
 
 '
 
-test_expect_success 'branch --no-contains=master' '
+test_expect_success 'branch --no-contains=main' '
 
-	git branch --no-contains=master >actual &&
+	git branch --no-contains=main >actual &&
 	test_must_be_empty actual
 
 '
 
-test_expect_success 'branch --no-contains master' '
+test_expect_success 'branch --no-contains main' '
 
-	git branch --no-contains master >actual &&
+	git branch --no-contains main >actual &&
 	test_must_be_empty actual
 
 '
@@ -73,7 +73,7 @@ test_expect_success 'branch --no-contains=side' '
 
 	git branch --no-contains=side >actual &&
 	{
-		echo "  master"
+		echo "  main"
 	} >expect &&
 	test_cmp expect actual
 
@@ -81,9 +81,9 @@ test_expect_success 'branch --no-contains=side' '
 
 test_expect_success 'branch --contains with pattern implies --list' '
 
-	git branch --contains=master master >actual &&
+	git branch --contains=main main >actual &&
 	{
-		echo "  master"
+		echo "  main"
 	} >expect &&
 	test_cmp expect actual
 
@@ -91,7 +91,7 @@ test_expect_success 'branch --contains with pattern implies --list' '
 
 test_expect_success 'branch --no-contains with pattern implies --list' '
 
-	git branch --no-contains=master master >actual &&
+	git branch --no-contains=main main >actual &&
 	test_must_be_empty actual
 
 '
@@ -100,7 +100,7 @@ test_expect_success 'side: branch --merged' '
 
 	git branch --merged >actual &&
 	{
-		echo "  master" &&
+		echo "  main" &&
 		echo "* side"
 	} >expect &&
 	test_cmp expect actual
@@ -109,9 +109,9 @@ test_expect_success 'side: branch --merged' '
 
 test_expect_success 'branch --merged with pattern implies --list' '
 
-	git branch --merged=side master >actual &&
+	git branch --merged=side main >actual &&
 	{
-		echo "  master"
+		echo "  main"
 	} >expect &&
 	test_cmp expect actual
 
@@ -124,18 +124,18 @@ test_expect_success 'side: branch --no-merged' '
 
 '
 
-test_expect_success 'master: branch --merged' '
+test_expect_success 'main: branch --merged' '
 
-	git checkout master &&
+	git checkout main &&
 	git branch --merged >actual &&
 	{
-		echo "* master"
+		echo "* main"
 	} >expect &&
 	test_cmp expect actual
 
 '
 
-test_expect_success 'master: branch --no-merged' '
+test_expect_success 'main: branch --no-merged' '
 
 	git branch --no-merged >actual &&
 	{
@@ -147,22 +147,22 @@ test_expect_success 'master: branch --no-merged' '
 
 test_expect_success 'branch --no-merged with pattern implies --list' '
 
-	git branch --no-merged=master master >actual &&
+	git branch --no-merged=main main >actual &&
 	test_must_be_empty actual
 
 '
 
 test_expect_success 'implicit --list conflicts with modification options' '
 
-	test_must_fail git branch --contains=master -d &&
-	test_must_fail git branch --contains=master -m foo &&
-	test_must_fail git branch --no-contains=master -d &&
-	test_must_fail git branch --no-contains=master -m foo
+	test_must_fail git branch --contains=main -d &&
+	test_must_fail git branch --contains=main -m foo &&
+	test_must_fail git branch --no-contains=main -d &&
+	test_must_fail git branch --no-contains=main -m foo
 
 '
 
 test_expect_success 'Assert that --contains only works on commits, not trees & blobs' '
-	test_must_fail git branch --contains master^{tree} &&
+	test_must_fail git branch --contains main^{tree} &&
 	blob=$(git hash-object -w --stdin <<-\EOF
 	Some blob
 	EOF
@@ -172,11 +172,11 @@ test_expect_success 'Assert that --contains only works on commits, not trees & b
 '
 
 test_expect_success 'multiple branch --contains' '
-	git checkout -b side2 master &&
+	git checkout -b side2 main &&
 	>feature &&
 	git add feature &&
 	git commit -m "add feature" &&
-	git checkout -b next master &&
+	git checkout -b next main &&
 	git merge side &&
 	git branch --contains side --contains side2 >actual &&
 	cat >expect <<-\EOF &&
@@ -188,9 +188,9 @@ test_expect_success 'multiple branch --contains' '
 '
 
 test_expect_success 'multiple branch --merged' '
-	git branch --merged next --merged master >actual &&
+	git branch --merged next --merged main >actual &&
 	cat >expect <<-\EOF &&
-	  master
+	  main
 	* next
 	  side
 	EOF
@@ -200,13 +200,13 @@ test_expect_success 'multiple branch --merged' '
 test_expect_success 'multiple branch --no-contains' '
 	git branch --no-contains side --no-contains side2 >actual &&
 	cat >expect <<-\EOF &&
-	  master
+	  main
 	EOF
 	test_cmp expect actual
 '
 
 test_expect_success 'multiple branch --no-merged' '
-	git branch --no-merged next --no-merged master >actual &&
+	git branch --no-merged next --no-merged main >actual &&
 	cat >expect <<-\EOF &&
 	  side2
 	EOF
@@ -214,7 +214,7 @@ test_expect_success 'multiple branch --no-merged' '
 '
 
 test_expect_success 'branch --contains combined with --no-contains' '
-	git checkout -b seen master &&
+	git checkout -b seen main &&
 	git merge side &&
 	git merge side2 &&
 	git branch --contains side --no-contains side2 >actual &&
@@ -239,17 +239,17 @@ test_expect_success 'branch --merged combined with --no-merged' '
 # that the latter walk does not mess up our flag to see if it was
 # merged).
 #
-# Here "topic" tracks "master" with one extra commit, and "zzz" points to the
-# same tip as master The name "zzz" must come alphabetically after "topic"
+# Here "topic" tracks "main" with one extra commit, and "zzz" points to the
+# same tip as main The name "zzz" must come alphabetically after "topic"
 # as we process them in that order.
 test_expect_success PREPARE_FOR_MAIN_BRANCH 'branch --merged with --verbose' '
-	git branch --track topic master &&
+	git branch --track topic main &&
 	git branch zzz topic &&
 	git checkout topic &&
 	test_commit foo &&
 	git branch --merged topic >actual &&
 	cat >expect <<-\EOF &&
-	  master
+	  main
 	* topic
 	  zzz
 	EOF
diff --git a/t/t3202-show-branch-octopus.sh b/t/t3202-show-branch-octopus.sh
index 6adf47869c..97551016ad 100755
--- a/t/t3202-show-branch-octopus.sh
+++ b/t/t3202-show-branch-octopus.sh
@@ -15,7 +15,7 @@ test_expect_success 'setup' '
 
 	for i in $numbers
 	do
-		git checkout -b branch$i master &&
+		git checkout -b branch$i main &&
 		> file$i &&
 		git add file$i &&
 		test_tick &&
diff --git a/t/t3203-branch-output.sh b/t/t3203-branch-output.sh
index d65586541d..727c9d9caa 100755
--- a/t/t3203-branch-output.sh
+++ b/t/t3203-branch-output.sh
@@ -26,7 +26,7 @@ test_expect_success 'make remote branches' '
 cat >expect <<'EOF'
   branch-one
   branch-two
-* master
+* main
 EOF
 test_expect_success 'git branch shows local branches' '
 	git branch >actual &&
@@ -60,7 +60,7 @@ test_expect_success 'git branch -r shows remote branches' '
 cat >expect <<'EOF'
   branch-one
   branch-two
-* master
+* main
   remotes/origin/HEAD -> origin/branch-one
   remotes/origin/branch-one
   remotes/origin/branch-two
@@ -152,7 +152,7 @@ test_expect_success 'git branch shows detached HEAD properly' '
 * (HEAD detached at $(git rev-parse --short HEAD^0))
   branch-one
   branch-two
-  master
+  main
 EOF
 	git checkout HEAD^0 &&
 	git branch >actual &&
@@ -160,12 +160,12 @@ EOF
 '
 
 test_expect_success 'git branch shows detached HEAD properly after checkout --detach' '
-	git checkout master &&
+	git checkout main &&
 	cat >expect <<EOF &&
 * (HEAD detached at $(git rev-parse --short HEAD^0))
   branch-one
   branch-two
-  master
+  main
 EOF
 	git checkout --detach &&
 	git branch >actual &&
@@ -177,7 +177,7 @@ test_expect_success 'git branch shows detached HEAD properly after moving' '
 * (HEAD detached from $(git rev-parse --short HEAD))
   branch-one
   branch-two
-  master
+  main
 EOF
 	git reset --hard HEAD^1 &&
 	git branch >actual &&
@@ -189,9 +189,9 @@ test_expect_success 'git branch shows detached HEAD properly from tag' '
 * (HEAD detached at fromtag)
   branch-one
   branch-two
-  master
+  main
 EOF
-	git tag fromtag master &&
+	git tag fromtag main &&
 	git checkout fromtag &&
 	git branch >actual &&
 	test_i18ncmp expect actual
@@ -202,7 +202,7 @@ test_expect_success 'git branch shows detached HEAD properly after moving from t
 * (HEAD detached from fromtag)
   branch-one
   branch-two
-  master
+  main
 EOF
 	git reset --hard HEAD^1 &&
 	git branch >actual &&
@@ -214,7 +214,7 @@ test_expect_success 'git branch `--sort` option' '
 	* (HEAD detached from fromtag)
 	  branch-two
 	  branch-one
-	  master
+	  main
 	EOF
 	git branch --sort=objectsize >actual &&
 	test_i18ncmp expect actual
@@ -223,7 +223,7 @@ test_expect_success 'git branch `--sort` option' '
 test_expect_success 'git branch --points-at option' '
 	cat >expect <<-\EOF &&
 	  branch-one
-	  master
+	  main
 	EOF
 	git branch --points-at=branch-one >actual &&
 	test_cmp expect actual
@@ -260,14 +260,14 @@ test_expect_success 'sort branches, ignore case' '
 		cat >expected <<-\EOF &&
 		BRANCH-two
 		branch-one
-		master
+		main
 		EOF
 		test_cmp expected actual &&
 		git branch --list -i | awk "{print \$NF}" >actual &&
 		cat >expected <<-\EOF &&
 		branch-one
 		BRANCH-two
-		master
+		main
 		EOF
 		test_cmp expected actual
 	)
@@ -279,7 +279,7 @@ test_expect_success 'git branch --format option' '
 	Refname is refs/heads/ambiguous
 	Refname is refs/heads/branch-one
 	Refname is refs/heads/branch-two
-	Refname is refs/heads/master
+	Refname is refs/heads/main
 	Refname is refs/heads/ref-to-branch
 	Refname is refs/heads/ref-to-remote
 	EOF
@@ -293,7 +293,7 @@ test_expect_success 'worktree colors correct' '
 	  ambiguous<RESET>
 	  branch-one<RESET>
 	+ <CYAN>branch-two<RESET>
-	  master<RESET>
+	  main<RESET>
 	  ref-to-branch<RESET> -> branch-one
 	  ref-to-remote<RESET> -> origin/branch-one
 	EOF
@@ -306,9 +306,9 @@ test_expect_success 'worktree colors correct' '
 '
 
 test_expect_success "set up color tests" '
-	echo "<RED>master<RESET>" >expect.color &&
-	echo "master" >expect.bare &&
-	color_args="--format=%(color:red)%(refname:short) --list master"
+	echo "<RED>main<RESET>" >expect.color &&
+	echo "main" >expect.bare &&
+	color_args="--format=%(color:red)%(refname:short) --list main"
 '
 
 test_expect_success '%(color) omitted without tty' '
@@ -331,7 +331,7 @@ test_expect_success '--color overrides auto-color' '
 
 test_expect_success PREPARE_FOR_MAIN_BRANCH 'verbose output lists worktree path' '
 	one=$(git rev-parse --short HEAD) &&
-	two=$(git rev-parse --short master) &&
+	two=$(git rev-parse --short main) &&
 	cat >expect <<-EOF &&
 	* (HEAD detached from fromtag) $one one
 	  ambiguous                    $one one
diff --git a/t/t3204-branch-name-interpretation.sh b/t/t3204-branch-name-interpretation.sh
index 698d9cc4f3..e527e0b0c9 100755
--- a/t/t3204-branch-name-interpretation.sh
+++ b/t/t3204-branch-name-interpretation.sh
@@ -28,7 +28,7 @@ test_expect_success 'update branch via @{-1}' '
 	git branch previous one &&
 
 	git checkout previous &&
-	git checkout master &&
+	git checkout main &&
 
 	git branch -f @{-1} two &&
 	expect_branch previous two
@@ -58,7 +58,7 @@ test_expect_success 'delete branch via @{-1}' '
 	git branch previous-del &&
 
 	git checkout previous-del &&
-	git checkout master &&
+	git checkout main &&
 
 	git branch -D @{-1} &&
 	expect_deleted previous-del
@@ -98,7 +98,7 @@ test_expect_success 'disallow deleting remote branch via @{-1}' '
 	git update-ref refs/remotes/origin/previous one &&
 
 	git checkout -b origin/previous two &&
-	git checkout master &&
+	git checkout main &&
 
 	test_must_fail git branch -r -D @{-1} &&
 	expect_branch refs/remotes/origin/previous one &&
diff --git a/t/t3205-branch-color.sh b/t/t3205-branch-color.sh
index 289625c464..9f2fb785d2 100755
--- a/t/t3205-branch-color.sh
+++ b/t/t3205-branch-color.sh
@@ -5,7 +5,7 @@ test_description='basic branch output coloring'
 
 test_expect_success 'set up some sample branches' '
 	test_commit foo &&
-	git update-ref refs/remotes/origin/master HEAD &&
+	git update-ref refs/remotes/origin/main HEAD &&
 	git update-ref refs/heads/other HEAD
 '
 
@@ -19,9 +19,9 @@ test_expect_success 'set up some color config' '
 
 test_expect_success 'regular output shows colors' '
 	cat >expect <<-\EOF &&
-	* <CYAN>master<RESET>
+	* <CYAN>main<RESET>
 	  <BLUE>other<RESET>
-	  <YELLOW>remotes/origin/master<RESET>
+	  <YELLOW>remotes/origin/main<RESET>
 	EOF
 	git branch --color -a >actual.raw &&
 	test_decode_color <actual.raw >actual &&
diff --git a/t/t3206-range-diff.sh b/t/t3206-range-diff.sh
index 6eb344be03..2813a362c7 100755
--- a/t/t3206-range-diff.sh
+++ b/t/t3206-range-diff.sh
@@ -127,7 +127,7 @@ test_expect_success 'setup' '
 '
 
 test_expect_success 'simple A..B A..C (unmodified)' '
-	git range-diff --no-color master..topic master..unmodified \
+	git range-diff --no-color main..topic main..unmodified \
 		>actual &&
 	cat >expect <<-EOF &&
 	1:  $(test_oid t1) = 1:  $(test_oid u1) s/5/A/
@@ -145,13 +145,13 @@ test_expect_success 'simple B...C (unmodified)' '
 '
 
 test_expect_success 'simple A B C (unmodified)' '
-	git range-diff --no-color master topic unmodified >actual &&
+	git range-diff --no-color main topic unmodified >actual &&
 	# same "expect" as above
 	test_cmp expect actual
 '
 
 test_expect_success 'trivial reordering' '
-	git range-diff --no-color master topic reordered >actual &&
+	git range-diff --no-color main topic reordered >actual &&
 	cat >expect <<-EOF &&
 	1:  $(test_oid t1) = 1:  $(test_oid r1) s/5/A/
 	3:  $(test_oid t3) = 2:  $(test_oid r2) s/11/B/
@@ -162,7 +162,7 @@ test_expect_success 'trivial reordering' '
 '
 
 test_expect_success 'removed a commit' '
-	git range-diff --no-color master topic removed >actual &&
+	git range-diff --no-color main topic removed >actual &&
 	cat >expect <<-EOF &&
 	1:  $(test_oid t1) = 1:  $(test_oid d1) s/5/A/
 	2:  $(test_oid t2) < -:  $(test_oid __) s/4/A/
@@ -173,7 +173,7 @@ test_expect_success 'removed a commit' '
 '
 
 test_expect_success 'added a commit' '
-	git range-diff --no-color master topic added >actual &&
+	git range-diff --no-color main topic added >actual &&
 	cat >expect <<-EOF &&
 	1:  $(test_oid t1) = 1:  $(test_oid a1) s/5/A/
 	2:  $(test_oid t2) = 2:  $(test_oid a2) s/4/A/
@@ -185,7 +185,7 @@ test_expect_success 'added a commit' '
 '
 
 test_expect_success 'new base, A B C' '
-	git range-diff --no-color master topic rebased >actual &&
+	git range-diff --no-color main topic rebased >actual &&
 	cat >expect <<-EOF &&
 	1:  $(test_oid t1) = 1:  $(test_oid b1) s/5/A/
 	2:  $(test_oid t2) = 2:  $(test_oid b2) s/4/A/
@@ -196,7 +196,7 @@ test_expect_success 'new base, A B C' '
 '
 
 test_expect_success 'new base, B...C' '
-	# this syntax includes the commits from master!
+	# this syntax includes the commits from main!
 	git range-diff --no-color topic...rebased >actual &&
 	cat >expect <<-EOF &&
 	-:  $(test_oid __) > 1:  $(test_oid b5) unrelated
@@ -420,7 +420,7 @@ test_expect_success 'file added and later removed' '
 
 test_expect_success 'no commits on one side' '
 	git commit --amend -m "new message" &&
-	git range-diff master HEAD@{1} HEAD
+	git range-diff main HEAD@{1} HEAD
 '
 
 test_expect_success 'changed message' '
@@ -482,11 +482,11 @@ test_expect_success 'dual-coloring' '
 	test_cmp expect actual
 '
 
-for prev in topic master..topic
+for prev in topic main..topic
 do
 	test_expect_success "format-patch --range-diff=$prev" '
 		git format-patch --cover-letter --range-diff=$prev \
-			master..unmodified >actual &&
+			main..unmodified >actual &&
 		test_when_finished "rm 000?-*" &&
 		test_line_count = 5 actual &&
 		test_i18ngrep "^Range-diff:$" 0000-* &&
@@ -511,19 +511,19 @@ test_expect_success 'range-diff overrides diff.noprefix internally' '
 
 test_expect_success 'basic with modified format.pretty with suffix' '
 	git -c format.pretty="format:commit %H%d%n" range-diff \
-		master..topic master..unmodified
+		main..topic main..unmodified
 '
 
 test_expect_success 'basic with modified format.pretty without "commit "' '
 	git -c format.pretty="format:%H%n" range-diff \
-		master..topic master..unmodified
+		main..topic main..unmodified
 '
 
 test_expect_success 'range-diff compares notes by default' '
 	git notes add -m "topic note" topic &&
 	git notes add -m "unmodified note" unmodified &&
 	test_when_finished git notes remove topic unmodified &&
-	git range-diff --no-color master..topic master..unmodified \
+	git range-diff --no-color main..topic main..unmodified \
 		>actual &&
 	sed s/Z/\ /g >expect <<-EOF &&
 	1:  $(test_oid t1) = 1:  $(test_oid u1) s/5/A/
@@ -547,7 +547,7 @@ test_expect_success 'range-diff with --no-notes' '
 	git notes add -m "topic note" topic &&
 	git notes add -m "unmodified note" unmodified &&
 	test_when_finished git notes remove topic unmodified &&
-	git range-diff --no-color --no-notes master..topic master..unmodified \
+	git range-diff --no-color --no-notes main..topic main..unmodified \
 		>actual &&
 	cat >expect <<-EOF &&
 	1:  $(test_oid t1) = 1:  $(test_oid u1) s/5/A/
@@ -565,7 +565,7 @@ test_expect_success 'range-diff with multiple --notes' '
 	git notes --ref=note2 add -m "topic note2" topic &&
 	git notes --ref=note2 add -m "unmodified note2" unmodified &&
 	test_when_finished git notes --ref=note2 remove topic unmodified &&
-	git range-diff --no-color --notes=note1 --notes=note2 master..topic master..unmodified \
+	git range-diff --no-color --notes=note1 --notes=note2 main..topic main..unmodified \
 		>actual &&
 	sed s/Z/\ /g >expect <<-EOF &&
 	1:  $(test_oid t1) = 1:  $(test_oid u1) s/5/A/
@@ -595,7 +595,7 @@ test_expect_success 'format-patch --range-diff does not compare notes by default
 	git notes add -m "unmodified note" unmodified &&
 	test_when_finished git notes remove topic unmodified &&
 	git format-patch --cover-letter --range-diff=$prev \
-		master..unmodified >actual &&
+		main..unmodified >actual &&
 	test_when_finished "rm 000?-*" &&
 	test_line_count = 5 actual &&
 	test_i18ngrep "^Range-diff:$" 0000-* &&
@@ -612,7 +612,7 @@ test_expect_success 'format-patch --range-diff with --no-notes' '
 	git notes add -m "unmodified note" unmodified &&
 	test_when_finished git notes remove topic unmodified &&
 	git format-patch --no-notes --cover-letter --range-diff=$prev \
-		master..unmodified >actual &&
+		main..unmodified >actual &&
 	test_when_finished "rm 000?-*" &&
 	test_line_count = 5 actual &&
 	test_i18ngrep "^Range-diff:$" 0000-* &&
@@ -629,7 +629,7 @@ test_expect_success 'format-patch --range-diff with --notes' '
 	git notes add -m "unmodified note" unmodified &&
 	test_when_finished git notes remove topic unmodified &&
 	git format-patch --notes --cover-letter --range-diff=$prev \
-		master..unmodified >actual &&
+		main..unmodified >actual &&
 	test_when_finished "rm 000?-*" &&
 	test_line_count = 5 actual &&
 	test_i18ngrep "^Range-diff:$" 0000-* &&
@@ -658,7 +658,7 @@ test_expect_success 'format-patch --range-diff with format.notes config' '
 	test_when_finished git notes remove topic unmodified &&
 	test_config format.notes true &&
 	git format-patch --cover-letter --range-diff=$prev \
-		master..unmodified >actual &&
+		main..unmodified >actual &&
 	test_when_finished "rm 000?-*" &&
 	test_line_count = 5 actual &&
 	test_i18ngrep "^Range-diff:$" 0000-* &&
@@ -689,7 +689,7 @@ test_expect_success 'format-patch --range-diff with multiple notes' '
 	git notes --ref=note2 add -m "unmodified note2" unmodified &&
 	test_when_finished git notes --ref=note2 remove topic unmodified &&
 	git format-patch --notes=note1 --notes=note2 --cover-letter --range-diff=$prev \
-		master..unmodified >actual &&
+		main..unmodified >actual &&
 	test_when_finished "rm 000?-*" &&
 	test_line_count = 5 actual &&
 	test_i18ngrep "^Range-diff:$" 0000-* &&
diff --git a/t/t3206/history.export b/t/t3206/history.export
index 4c808e5b3b..4485adc37b 100644
--- a/t/t3206/history.export
+++ b/t/t3206/history.export
@@ -168,7 +168,7 @@ mark :11
 data 10
 unrelated
 
-commit refs/heads/master
+commit refs/heads/main
 mark :12
 author Thomas Rast <trast@inf.ethz.ch> 1374485127 +0200
 committer Thomas Rast <trast@inf.ethz.ch> 1374485127 +0200
diff --git a/t/t3210-pack-refs.sh b/t/t3210-pack-refs.sh
index f41b2afb99..a0b188fa4d 100755
--- a/t/t3210-pack-refs.sh
+++ b/t/t3210-pack-refs.sh
@@ -135,7 +135,7 @@ test_expect_success 'delete ref with dangling packed version' '
 	git commit --allow-empty -m "future garbage" &&
 	git pack-refs --all &&
 	git reset --hard HEAD^ &&
-	git checkout master &&
+	git checkout main &&
 	git reflog expire --expire=all --all &&
 	git prune --expire=all &&
 	git branch -d lamb 2>result &&
@@ -240,7 +240,7 @@ test_expect_success 'retry acquiring packed-refs.lock' '
 
 test_expect_success SYMLINKS 'pack symlinked packed-refs' '
 	# First make sure that symlinking works when reading:
-	git update-ref refs/heads/lossy refs/heads/master &&
+	git update-ref refs/heads/lossy refs/heads/main &&
 	git for-each-ref >all-refs-before &&
 	mv .git/packed-refs .git/my-deviant-packed-refs &&
 	ln -s my-deviant-packed-refs .git/packed-refs &&
diff --git a/t/t3211-peel-ref.sh b/t/t3211-peel-ref.sh
index 3b7caca421..73a914d194 100755
--- a/t/t3211-peel-ref.sh
+++ b/t/t3211-peel-ref.sh
@@ -19,7 +19,7 @@ print_ref() {
 
 test_expect_success 'set up expected show-ref output' '
 	{
-		print_ref "refs/heads/master" &&
+		print_ref "refs/heads/main" &&
 		print_ref "refs/outside/foo" &&
 		print_ref "refs/outside/foo^{}" &&
 		print_ref "refs/tags/base" &&
@@ -47,7 +47,7 @@ test_expect_success 'create old-style pack-refs without fully-peeled' '
 	# know we are emulating exactly what an older git would have written.
 	{
 		echo "# pack-refs with: peeled " &&
-		print_ref "refs/heads/master" &&
+		print_ref "refs/heads/main" &&
 		print_ref "refs/outside/foo" &&
 		print_ref "refs/tags/base" &&
 		print_ref "refs/tags/foo" &&
diff --git a/t/t3301-notes.sh b/t/t3301-notes.sh
index 8f43303007..2b685580b6 100755
--- a/t/t3301-notes.sh
+++ b/t/t3301-notes.sh
@@ -1295,11 +1295,11 @@ test_expect_success 'git notes copy diagnoses too many or too few parameters' '
 	test_i18ngrep "too many parameters" error
 '
 
-test_expect_success 'git notes get-ref expands refs/heads/master to refs/notes/refs/heads/master' '
+test_expect_success 'git notes get-ref expands refs/heads/main to refs/notes/refs/heads/main' '
 	test_unconfig core.notesRef &&
 	sane_unset GIT_NOTES_REF &&
-	echo refs/notes/refs/heads/master >expect &&
-	git notes --ref=refs/heads/master get-ref >actual &&
+	echo refs/notes/refs/heads/main >expect &&
+	git notes --ref=refs/heads/main get-ref >actual &&
 	test_cmp expect actual
 '
 
diff --git a/t/t3302-notes-index-expensive.sh b/t/t3302-notes-index-expensive.sh
index 7217c5e222..1c1490ca68 100755
--- a/t/t3302-notes-index-expensive.sh
+++ b/t/t3302-notes-index-expensive.sh
@@ -20,7 +20,7 @@ create_repo () {
 			notemark=$(($mark+1))
 			test_tick &&
 			cat <<-INPUT_END &&
-			commit refs/heads/master
+			commit refs/heads/main
 			mark :$mark
 			committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
 			data <<COMMIT
diff --git a/t/t3303-notes-subtrees.sh b/t/t3303-notes-subtrees.sh
index 704aee81ef..d994492469 100755
--- a/t/t3303-notes-subtrees.sh
+++ b/t/t3303-notes-subtrees.sh
@@ -40,7 +40,7 @@ test_expect_success "setup: create $number_of_commits commits" '
 			nr=$(($nr+1)) &&
 			test_tick &&
 			cat <<INPUT_END
-commit refs/heads/master
+commit refs/heads/main
 committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
 data <<COMMIT
 commit #$nr
@@ -75,7 +75,7 @@ test_sha1_based () {
 	(
 		start_note_commit &&
 		nr=$number_of_commits &&
-		git rev-list refs/heads/master |
+		git rev-list refs/heads/main |
 		while read sha1; do
 			note_path=$(echo "$sha1" | sed "$1")
 			cat <<INPUT_END &&
@@ -105,7 +105,7 @@ test_same_notes () {
 	(
 		start_note_commit &&
 		nr=$number_of_commits &&
-		git rev-list refs/heads/master |
+		git rev-list refs/heads/main |
 		while read sha1; do
 			first_note_path=$(echo "$sha1" | sed "$1")
 			second_note_path=$(echo "$sha1" | sed "$2")
@@ -144,7 +144,7 @@ test_concatenated_notes () {
 	(
 		start_note_commit &&
 		nr=$number_of_commits &&
-		git rev-list refs/heads/master |
+		git rev-list refs/heads/main |
 		while read sha1; do
 			first_note_path=$(echo "$sha1" | sed "$1")
 			second_note_path=$(echo "$sha1" | sed "$2")
diff --git a/t/t3304-notes-mixed.sh b/t/t3304-notes-mixed.sh
index 1709e8c00b..802e004016 100755
--- a/t/t3304-notes-mixed.sh
+++ b/t/t3304-notes-mixed.sh
@@ -36,7 +36,7 @@ test_expect_success "setup: create a couple of commits" '
 
 	test_tick &&
 	cat <<INPUT_END >input &&
-commit refs/heads/master
+commit refs/heads/main
 committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
 data <<COMMIT
 commit #1
@@ -51,7 +51,7 @@ INPUT_END
 
 	test_tick &&
 	cat <<INPUT_END >>input &&
-commit refs/heads/master
+commit refs/heads/main
 committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
 data <<COMMIT
 commit #2
@@ -68,8 +68,8 @@ INPUT_END
 
 test_expect_success "create a notes tree with both notes and non-notes" '
 
-	commit1=$(git rev-parse refs/heads/master^) &&
-	commit2=$(git rev-parse refs/heads/master) &&
+	commit1=$(git rev-parse refs/heads/main^) &&
+	commit2=$(git rev-parse refs/heads/main) &&
 	test_tick &&
 	cat <<INPUT_END >input &&
 commit refs/notes/commits
diff --git a/t/t3308-notes-merge.sh b/t/t3308-notes-merge.sh
index d69c84c640..202702be1a 100755
--- a/t/t3308-notes-merge.sh
+++ b/t/t3308-notes-merge.sh
@@ -108,7 +108,7 @@ test_expect_success 'fail to merge into various non-notes refs' '
 	git update-ref refs/notes/dir/foo HEAD &&
 	test_must_fail git -c "core.notesRef=refs/notes/dir" notes merge x &&
 	test_must_fail git -c "core.notesRef=refs/notes/dir/" notes merge x &&
-	test_must_fail git -c "core.notesRef=refs/heads/master" notes merge x &&
+	test_must_fail git -c "core.notesRef=refs/heads/main" notes merge x &&
 	test_must_fail git -c "core.notesRef=refs/notes/y:" notes merge x &&
 	test_must_fail git -c "core.notesRef=refs/notes/y:foo" notes merge x &&
 	test_must_fail git -c "core.notesRef=refs/notes/foo^{bar" notes merge x
diff --git a/t/t3320-notes-merge-worktrees.sh b/t/t3320-notes-merge-worktrees.sh
index 823fdbda1f..465145c487 100755
--- a/t/t3320-notes-merge-worktrees.sh
+++ b/t/t3320-notes-merge-worktrees.sh
@@ -36,8 +36,8 @@ test_expect_success 'modify notes ref ourselves (x)' '
 '
 
 test_expect_success 'create some new worktrees' '
-	git worktree add -b newbranch worktree master &&
-	git worktree add -b newbranch2 worktree2 master
+	git worktree add -b newbranch worktree main &&
+	git worktree add -b newbranch2 worktree2 main
 '
 
 test_expect_success 'merge z into y fails and sets NOTES_MERGE_REF' '
diff --git a/t/test-lib.sh b/t/test-lib.sh
index 3bb6675390..c464f8dcc8 100644
--- a/t/test-lib.sh
+++ b/t/test-lib.sh
@@ -257,7 +257,7 @@ case "$TRASH_DIRECTORY" in
 esac
 
 case "$TEST_NUMBER" in
-[0-2]*)
+[0-2]*|3[0-3]*)
 	GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 	export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 	;;
-- 
gitgitgadget


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH 05/28] t3416: preemptively adjust alignment in a comment
  2020-11-12 22:43 [PATCH 00/28] Use main as default branch name Johannes Schindelin via GitGitGadget
                   ` (3 preceding siblings ...)
  2020-11-12 22:43 ` [PATCH 04/28] t3[0-3]*: " Johannes Schindelin via GitGitGadget
@ 2020-11-12 22:43 ` Johannes Schindelin via GitGitGadget
  2020-11-12 22:43 ` [PATCH 06/28] t34*: adjust the references to the default branch name "main" Johannes Schindelin via GitGitGadget
                   ` (27 subsequent siblings)
  32 siblings, 0 replies; 163+ messages in thread
From: Johannes Schindelin via GitGitGadget @ 2020-11-12 22:43 UTC (permalink / raw)
  To: git; +Cc: Johannes Schindelin, Johannes Schindelin

From: Johannes Schindelin <johannes.schindelin@gmx.de>

We are about to adjust t3416 for the new default branch name `main`.
This name is two characters shorter and therefore needs two spaces more
padding to align correctly.

Adjusting the alignment before the big search-and-replace makes it
easier to verify that the final result does not leave any misaligned
lines behind.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
---
 t/t3416-rebase-onto-threedots.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/t/t3416-rebase-onto-threedots.sh b/t/t3416-rebase-onto-threedots.sh
index 9c2548423b..1f37adf56b 100755
--- a/t/t3416-rebase-onto-threedots.sh
+++ b/t/t3416-rebase-onto-threedots.sh
@@ -12,7 +12,7 @@ test_description='git rebase --onto A...B'
 #
 #	    F---G topic                             G'
 #	   /                                       /
-# A---B---C---D---E master      -->       A---B---C---D---E
+# A---B---C---D---E master        -->       A---B---C---D---E
 #      \   \ /
 #	\   x
 #	 \ / \
-- 
gitgitgadget


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH 06/28] t34*: adjust the references to the default branch name "main"
  2020-11-12 22:43 [PATCH 00/28] Use main as default branch name Johannes Schindelin via GitGitGadget
                   ` (4 preceding siblings ...)
  2020-11-12 22:43 ` [PATCH 05/28] t3416: preemptively adjust alignment in a comment Johannes Schindelin via GitGitGadget
@ 2020-11-12 22:43 ` Johannes Schindelin via GitGitGadget
  2020-11-12 22:43 ` [PATCH 07/28] t3[5-9]*: " Johannes Schindelin via GitGitGadget
                   ` (26 subsequent siblings)
  32 siblings, 0 replies; 163+ messages in thread
From: Johannes Schindelin via GitGitGadget @ 2020-11-12 22:43 UTC (permalink / raw)
  To: git; +Cc: Johannes Schindelin, Johannes Schindelin

From: Johannes Schindelin <johannes.schindelin@gmx.de>

Carefully excluding t3404, which sees independent development elsewhere
at the time of writing, we use `main` as the default branch name in
t34*. This trick was performed via

	$ (cd t &&
	   sed -i -e 's/master/main/g' -e 's/MASTER/MAIN/g' \
		-e 's/Master/Main/g' -- t34*.sh &&
	   git checkout HEAD -- t34\*)

This allows us to define `GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main`
for those tests.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
---
 t/t3400-rebase.sh                 | 60 +++++++++++++++----------------
 t/t3402-rebase-merge.sh           | 44 +++++++++++------------
 t/t3403-rebase-skip.sh            |  6 ++--
 t/t3405-rebase-malformed.sh       |  8 ++---
 t/t3406-rebase-message.sh         | 24 ++++++-------
 t/t3407-rebase-abort.sh           | 18 +++++-----
 t/t3408-rebase-multi-line.sh      |  2 +-
 t/t3409-rebase-preserve-merges.sh | 10 +++---
 t/t3412-rebase-root.sh            | 28 +++++++--------
 t/t3413-rebase-hook.sh            | 42 +++++++++++-----------
 t/t3415-rebase-autosquash.sh      |  2 +-
 t/t3416-rebase-onto-threedots.sh  | 54 ++++++++++++++--------------
 t/t3418-rebase-continue.sh        | 24 ++++++-------
 t/t3419-rebase-patch-id.sh        | 12 +++----
 t/t3420-rebase-autostash.sh       |  8 ++---
 t/t3423-rebase-reword.sh          |  6 ++--
 t/t3427-rebase-subtree.sh         | 20 +++++------
 t/t3430-rebase-merges.sh          | 16 ++++-----
 t/t3431-rebase-fork-point.sh      | 32 ++++++++---------
 t/t3432-rebase-fast-forward.sh    | 34 +++++++++---------
 t/t3434-rebase-i18n.sh            |  8 ++---
 t/t3435-rebase-gpg-sign.sh        |  4 +--
 t/t3436-rebase-more-options.sh    |  2 +-
 t/test-lib.sh                     |  8 ++++-
 24 files changed, 239 insertions(+), 233 deletions(-)

diff --git a/t/t3400-rebase.sh b/t/t3400-rebase.sh
index 40d2975995..cdfc7e083a 100755
--- a/t/t3400-rebase.sh
+++ b/t/t3400-rebase.sh
@@ -24,15 +24,15 @@ test_expect_success 'prepare repository with topic branches' '
 	git update-index --add Y &&
 	git commit -m "Add Y." &&
 	git checkout -b filemove &&
-	git reset --soft master &&
+	git reset --soft main &&
 	mkdir D &&
 	git mv A D/A &&
 	git commit -m "Move A." &&
-	git checkout -b my-topic-branch master &&
+	git checkout -b my-topic-branch main &&
 	echo Second >B &&
 	git update-index --add B &&
 	git commit -m "Add B." &&
-	git checkout -f master &&
+	git checkout -f main &&
 	echo Third >>A &&
 	git update-index A &&
 	git commit -m "Modify A." &&
@@ -46,23 +46,23 @@ test_expect_success 'prepare repository with topic branches' '
 
 test_expect_success 'rebase on dirty worktree' '
 	echo dirty >>A &&
-	test_must_fail git rebase master
+	test_must_fail git rebase main
 '
 
 test_expect_success 'rebase on dirty cache' '
 	git add A &&
-	test_must_fail git rebase master
+	test_must_fail git rebase main
 '
 
-test_expect_success 'rebase against master' '
+test_expect_success 'rebase against main' '
 	git reset --hard HEAD &&
-	git rebase master
+	git rebase main
 '
 
 test_expect_success 'rebase sets ORIG_HEAD to pre-rebase state' '
 	git checkout -b orig-head topic &&
 	pre="$(git rev-parse --verify HEAD)" &&
-	git rebase master &&
+	git rebase main &&
 	test_cmp_rev "$pre" ORIG_HEAD &&
 	test_cmp_rev ! "$pre" HEAD
 '
@@ -93,19 +93,19 @@ test_expect_success 'HEAD was detached during rebase' '
 
 test_expect_success 'rebase from ambiguous branch name' '
 	git checkout -b topic side &&
-	git rebase master
+	git rebase main
 '
 
 test_expect_success 'rebase off of the previous branch using "-"' '
-	git checkout master &&
+	git checkout main &&
 	git checkout HEAD^ &&
 	git rebase @{-1} >expect.messages &&
-	git merge-base master HEAD >expect.forkpoint &&
+	git merge-base main HEAD >expect.forkpoint &&
 
-	git checkout master &&
+	git checkout main &&
 	git checkout HEAD^ &&
 	git rebase - >actual.messages &&
-	git merge-base master HEAD >actual.forkpoint &&
+	git merge-base main HEAD >actual.forkpoint &&
 
 	test_cmp expect.forkpoint actual.forkpoint &&
 	# the next one is dubious---we may want to say "-",
@@ -114,7 +114,7 @@ test_expect_success 'rebase off of the previous branch using "-"' '
 '
 
 test_expect_success 'rebase a single mode change' '
-	git checkout master &&
+	git checkout main &&
 	git branch -D topic &&
 	echo 1 >X &&
 	git add X &&
@@ -126,7 +126,7 @@ test_expect_success 'rebase a single mode change' '
 	test_chmod +x A &&
 	test_tick &&
 	git commit -m modechange &&
-	GIT_TRACE=1 git rebase master
+	GIT_TRACE=1 git rebase main
 '
 
 test_expect_success 'rebase is not broken by diff.renames' '
@@ -162,11 +162,11 @@ test_expect_success 'fail when upstream arg is missing and not configured' '
 test_expect_success 'rebase works with format.useAutoBase' '
 	test_config format.useAutoBase true &&
 	git checkout topic &&
-	git rebase master
+	git rebase main
 '
 
 test_expect_success 'default to common base in @{upstream}s reflog if no upstream arg (--merge)' '
-	git checkout -b default-base master &&
+	git checkout -b default-base main &&
 	git checkout -b default topic &&
 	git config branch.default.remote . &&
 	git config branch.default.merge refs/heads/default-base &&
@@ -184,7 +184,7 @@ test_expect_success 'default to common base in @{upstream}s reflog if no upstrea
 '
 
 test_expect_success 'default to common base in @{upstream}s reflog if no upstream arg (--apply)' '
-	git checkout -B default-base master &&
+	git checkout -B default-base main &&
 	git checkout -B default topic &&
 	git config branch.default.remote . &&
 	git config branch.default.merge refs/heads/default-base &&
@@ -226,13 +226,13 @@ test_expect_success 'cherry-picked commits and fork-point work together' '
 
 test_expect_success 'rebase --apply -q is quiet' '
 	git checkout -b quiet topic &&
-	git rebase --apply -q master >output.out 2>&1 &&
+	git rebase --apply -q main >output.out 2>&1 &&
 	test_must_be_empty output.out
 '
 
 test_expect_success 'rebase --merge -q is quiet' '
 	git checkout -B quiet topic &&
-	git rebase --merge -q master >output.out 2>&1 &&
+	git rebase --merge -q main >output.out 2>&1 &&
 	test_must_be_empty output.out
 '
 
@@ -294,7 +294,7 @@ test_expect_success 'rebase commit with an ancient timestamp' '
 '
 
 test_expect_success 'rebase with "From " line in commit message' '
-	git checkout -b preserve-from master~1 &&
+	git checkout -b preserve-from main~1 &&
 	cat >From_.msg <<EOF &&
 Somebody embedded an mbox in a commit message
 
@@ -310,7 +310,7 @@ EOF
 	>From_ &&
 	git add From_ &&
 	git commit -F From_.msg &&
-	git rebase master &&
+	git rebase main &&
 	git log -1 --pretty=format:%B >out &&
 	test_cmp From_.msg out
 '
@@ -357,12 +357,12 @@ test_expect_success 'rebase --apply and .gitattributes' '
 		git cherry-pick test &&
 
 		git checkout test &&
-		git rebase master &&
+		git rebase main &&
 		grep "smudged" a.txt &&
 
 		git checkout removal &&
 		git reset --hard &&
-		git rebase master &&
+		git rebase main &&
 		grep "clean" a.txt
 	)
 '
@@ -402,20 +402,20 @@ test_expect_success 'rebase -c rebase.useBuiltin=false warning' '
 '
 
 test_expect_success 'switch to branch checked out here' '
-	git checkout master &&
-	git rebase master master
+	git checkout main &&
+	git rebase main main
 '
 
 test_expect_success 'switch to branch not checked out' '
-	git checkout master &&
+	git checkout main &&
 	git branch other &&
-	git rebase master other
+	git rebase main other
 '
 
 test_expect_success 'refuse to switch to branch checked out elsewhere' '
-	git checkout master &&
+	git checkout main &&
 	git worktree add wt &&
-	test_must_fail git -C wt rebase master master 2>err &&
+	test_must_fail git -C wt rebase main main 2>err &&
 	test_i18ngrep "already checked out" err
 '
 
diff --git a/t/t3402-rebase-merge.sh b/t/t3402-rebase-merge.sh
index 6e032716a6..ed7fcb5a6c 100755
--- a/t/t3402-rebase-merge.sh
+++ b/t/t3402-rebase-merge.sh
@@ -19,10 +19,10 @@ test_expect_success setup '
 	git commit -m"initial" &&
 	git branch side &&
 	echo "11 $T" >>original &&
-	git commit -a -m"master updates a bit." &&
+	git commit -a -m"main updates a bit." &&
 
 	echo "12 $T" >>original &&
-	git commit -a -m"master updates a bit more." &&
+	git commit -a -m"main updates a bit more." &&
 
 	git checkout side &&
 	(echo "0 $T" && cat original) >renamed &&
@@ -47,13 +47,13 @@ test_expect_success setup '
 '
 
 test_expect_success 'reference merge' '
-	git merge -s recursive -m "reference merge" master
+	git merge -s recursive -m "reference merge" main
 '
 
 PRE_REBASE=$(git rev-parse test-rebase)
 test_expect_success rebase '
 	git checkout test-rebase &&
-	GIT_TRACE=1 git rebase --merge master
+	GIT_TRACE=1 git rebase --merge main
 '
 
 test_expect_success 'test-rebase@{1} is pre rebase' '
@@ -72,24 +72,24 @@ test_expect_success 'merge and rebase should match' '
 '
 
 test_expect_success 'rebase the other way' '
-	git reset --hard master &&
+	git reset --hard main &&
 	git rebase --merge side
 '
 
 test_expect_success 'rebase -Xtheirs' '
-	git checkout -b conflicting master~2 &&
+	git checkout -b conflicting main~2 &&
 	echo "AB $T" >> original &&
 	git commit -mconflicting original &&
-	git rebase -Xtheirs master &&
+	git rebase -Xtheirs main &&
 	grep AB original &&
 	! grep 11 original
 '
 
 test_expect_success 'rebase -Xtheirs from orphan' '
-	git checkout --orphan orphan-conflicting master~2 &&
+	git checkout --orphan orphan-conflicting main~2 &&
 	echo "AB $T" >> original &&
 	git commit -morphan-conflicting original &&
-	git rebase -Xtheirs master &&
+	git rebase -Xtheirs main &&
 	grep AB original &&
 	! grep 11 original
 '
@@ -107,9 +107,9 @@ test_expect_success 'merge and rebase should match' '
 
 test_expect_success 'picking rebase' '
 	git reset --hard side &&
-	git rebase --merge --onto master side^^ &&
-	mb=$(git merge-base master HEAD) &&
-	if test "$mb" = "$(git rev-parse master)"
+	git rebase --merge --onto main side^^ &&
+	mb=$(git merge-base main HEAD) &&
+	if test "$mb" = "$(git rev-parse main)"
 	then
 		echo happy
 	else
@@ -140,11 +140,11 @@ test_expect_success 'rebase -s funny -Xopt' '
 	EOF
 	chmod +x test-bin/git-merge-funny &&
 	git reset --hard &&
-	git checkout -b test-funny master^ &&
+	git checkout -b test-funny main^ &&
 	test_commit funny &&
 	(
 		PATH=./test-bin:$PATH &&
-		git rebase -s funny -Xopt master
+		git rebase -s funny -Xopt main
 	) &&
 	test -f funny.was.run
 '
@@ -165,7 +165,7 @@ test_expect_success 'rebase --skip works with two conflicts in a row' '
 test_expect_success '--reapply-cherry-picks' '
 	git init repo &&
 
-	# O(1-10) -- O(1-11) -- O(0-10) master
+	# O(1-10) -- O(1-11) -- O(0-10) main
 	#        \
 	#         -- O(1-11) -- O(1-12) otherbranch
 
@@ -187,18 +187,18 @@ test_expect_success '--reapply-cherry-picks' '
 	git -C repo commit -a -m "add 12 in another branch" &&
 
 	# Regular rebase fails, because the 1-11 commit is deduplicated
-	test_must_fail git -C repo rebase --merge master 2> err &&
+	test_must_fail git -C repo rebase --merge main 2> err &&
 	test_i18ngrep "error: could not apply.*add 12 in another branch" err &&
 	git -C repo rebase --abort &&
 
 	# With --reapply-cherry-picks, it works
-	git -C repo rebase --merge --reapply-cherry-picks master
+	git -C repo rebase --merge --reapply-cherry-picks main
 '
 
 test_expect_success '--reapply-cherry-picks refrains from reading unneeded blobs' '
 	git init server &&
 
-	# O(1-10) -- O(1-11) -- O(1-12) master
+	# O(1-10) -- O(1-11) -- O(1-12) main
 	#        \
 	#         -- O(0-10) otherbranch
 
@@ -220,18 +220,18 @@ test_expect_success '--reapply-cherry-picks refrains from reading unneeded blobs
 	test_config -C server uploadpack.allowanysha1inwant 1 &&
 
 	git clone --filter=blob:none "file://$(pwd)/server" client &&
-	git -C client checkout origin/master &&
+	git -C client checkout origin/main &&
 	git -C client checkout origin/otherbranch &&
 
 	# Sanity check to ensure that the blobs from the merge base and "add
 	# 11" are missing
 	git -C client rev-list --objects --all --missing=print >missing_list &&
-	MERGE_BASE_BLOB=$(git -C server rev-parse master^^:file.txt) &&
-	ADD_11_BLOB=$(git -C server rev-parse master^:file.txt) &&
+	MERGE_BASE_BLOB=$(git -C server rev-parse main^^:file.txt) &&
+	ADD_11_BLOB=$(git -C server rev-parse main^:file.txt) &&
 	grep "[?]$MERGE_BASE_BLOB" missing_list &&
 	grep "[?]$ADD_11_BLOB" missing_list &&
 
-	git -C client rebase --merge --reapply-cherry-picks origin/master &&
+	git -C client rebase --merge --reapply-cherry-picks origin/main &&
 
 	# The blob from the merge base had to be fetched, but not "add 11"
 	git -C client rev-list --objects --all --missing=print >missing_list &&
diff --git a/t/t3403-rebase-skip.sh b/t/t3403-rebase-skip.sh
index a927774910..360b46adef 100755
--- a/t/t3403-rebase-skip.sh
+++ b/t/t3403-rebase-skip.sh
@@ -48,7 +48,7 @@ test_expect_success setup '
 	'
 
 test_expect_success 'rebase with git am -3 (default)' '
-	test_must_fail git rebase master
+	test_must_fail git rebase main
 '
 
 test_expect_success 'rebase --skip can not be used with other options' '
@@ -64,7 +64,7 @@ test_expect_success 'rebase moves back to skip-reference' '
 	test refs/heads/skip-reference = $(git symbolic-ref HEAD) &&
 	git branch post-rebase &&
 	git reset --hard pre-rebase &&
-	test_must_fail git rebase master &&
+	test_must_fail git rebase main &&
 	echo "hello" > hello &&
 	git add hello &&
 	git rebase --continue &&
@@ -75,7 +75,7 @@ test_expect_success 'rebase moves back to skip-reference' '
 test_expect_success 'checkout skip-merge' 'git checkout -f skip-merge'
 
 test_expect_success 'rebase with --merge' '
-	test_must_fail git rebase --merge master
+	test_must_fail git rebase --merge main
 '
 
 test_expect_success 'rebase --skip with --merge' '
diff --git a/t/t3405-rebase-malformed.sh b/t/t3405-rebase-malformed.sh
index 860e63e444..7ef8bfa0ac 100755
--- a/t/t3405-rebase-malformed.sh
+++ b/t/t3405-rebase-malformed.sh
@@ -52,7 +52,7 @@ test_expect_success setup '
 	git add file3 &&
 	git commit --allow-empty-message -m "" &&
 
-	git checkout master &&
+	git checkout main &&
 
 	echo One >file1 &&
 	test_tick &&
@@ -62,7 +62,7 @@ test_expect_success setup '
 
 test_expect_success 'rebase commit with multi-line subject' '
 
-	git rebase master multi-line-subject &&
+	git rebase main multi-line-subject &&
 	git cat-file commit HEAD | sed -e "1,/^\$/d" >F1 &&
 
 	test_cmp F0 F1 &&
@@ -70,14 +70,14 @@ test_expect_success 'rebase commit with multi-line subject' '
 '
 
 test_expect_success 'rebase commit with diff in message' '
-	git rebase master diff-in-message &&
+	git rebase main diff-in-message &&
 	git cat-file commit HEAD | sed -e "1,/^$/d" >G1 &&
 	test_cmp G0 G1 &&
 	test_cmp G G0
 '
 
 test_expect_success 'rebase -m commit with empty message' '
-	git rebase -m master empty-message-merge
+	git rebase -m main empty-message-merge
 '
 
 test_expect_success 'rebase -i commit with empty message' '
diff --git a/t/t3406-rebase-message.sh b/t/t3406-rebase-message.sh
index 4afc528165..00e271fb36 100755
--- a/t/t3406-rebase-message.sh
+++ b/t/t3406-rebase-message.sh
@@ -18,27 +18,27 @@ test_expect_success 'setup' '
 '
 
 test_expect_success 'rebase -m' '
-	git rebase -m master >actual &&
+	git rebase -m main >actual &&
 	test_must_be_empty actual
 '
 
-test_expect_success 'rebase against master twice' '
-	git rebase --apply master >out &&
+test_expect_success 'rebase against main twice' '
+	git rebase --apply main >out &&
 	test_i18ngrep "Current branch topic is up to date" out
 '
 
-test_expect_success 'rebase against master twice with --force' '
-	git rebase --force-rebase --apply master >out &&
+test_expect_success 'rebase against main twice with --force' '
+	git rebase --force-rebase --apply main >out &&
 	test_i18ngrep "Current branch topic is up to date, rebase forced" out
 '
 
-test_expect_success 'rebase against master twice from another branch' '
+test_expect_success 'rebase against main twice from another branch' '
 	git checkout topic^ &&
-	git rebase --apply master topic >out &&
+	git rebase --apply main topic >out &&
 	test_i18ngrep "Current branch topic is up to date" out
 '
 
-test_expect_success 'rebase fast-forward to master' '
+test_expect_success 'rebase fast-forward to main' '
 	git checkout topic^ &&
 	git rebase --apply topic >out &&
 	test_i18ngrep "Fast-forwarded HEAD to topic" out
@@ -46,21 +46,21 @@ test_expect_success 'rebase fast-forward to master' '
 
 test_expect_success 'rebase --stat' '
 	git reset --hard start &&
-	git rebase --stat master >diffstat.txt &&
+	git rebase --stat main >diffstat.txt &&
 	grep "^ fileX |  *1 +$" diffstat.txt
 '
 
 test_expect_success 'rebase w/config rebase.stat' '
 	git reset --hard start &&
 	git config rebase.stat true &&
-	git rebase master >diffstat.txt &&
+	git rebase main >diffstat.txt &&
 	grep "^ fileX |  *1 +$" diffstat.txt
 '
 
 test_expect_success 'rebase -n overrides config rebase.stat config' '
 	git reset --hard start &&
 	git config rebase.stat true &&
-	git rebase -n master >diffstat.txt &&
+	git rebase -n main >diffstat.txt &&
 	! grep "^ fileX |  *1 +$" diffstat.txt
 '
 
@@ -113,7 +113,7 @@ test_expect_success 'rebase -i onto unrelated history' '
 	git init unrelated &&
 	test_commit -C unrelated 1 &&
 	git -C unrelated remote add -f origin "$PWD" &&
-	git -C unrelated branch --set-upstream-to=origin/master &&
+	git -C unrelated branch --set-upstream-to=origin/main &&
 	git -C unrelated -c core.editor=true rebase -i -v --stat >actual &&
 	test_i18ngrep "Changes to " actual &&
 	test_i18ngrep "5 files changed" actual
diff --git a/t/t3407-rebase-abort.sh b/t/t3407-rebase-abort.sh
index 97efea0f56..2c2a5b9c10 100755
--- a/t/t3407-rebase-abort.sh
+++ b/t/t3407-rebase-abort.sh
@@ -37,7 +37,7 @@ testrebase() {
 		cd "$work_dir" &&
 		# Clean up the state from the previous one
 		git reset --hard pre-rebase &&
-		test_must_fail git rebase$type master &&
+		test_must_fail git rebase$type main &&
 		test_path_is_dir "$dotest" &&
 		git rebase --abort &&
 		test $(git rev-parse to-rebase) = $(git rev-parse pre-rebase) &&
@@ -48,10 +48,10 @@ testrebase() {
 		cd "$work_dir" &&
 		# Clean up the state from the previous one
 		git reset --hard pre-rebase &&
-		test_must_fail git rebase$type master &&
+		test_must_fail git rebase$type main &&
 		test_path_is_dir "$dotest" &&
 		test_must_fail git rebase --skip &&
-		test $(git rev-parse HEAD) = $(git rev-parse master) &&
+		test $(git rev-parse HEAD) = $(git rev-parse main) &&
 		git rebase --abort &&
 		test $(git rev-parse to-rebase) = $(git rev-parse pre-rebase) &&
 		test ! -d "$dotest"
@@ -61,13 +61,13 @@ testrebase() {
 		cd "$work_dir" &&
 		# Clean up the state from the previous one
 		git reset --hard pre-rebase &&
-		test_must_fail git rebase$type master &&
+		test_must_fail git rebase$type main &&
 		test_path_is_dir "$dotest" &&
 		echo c > a &&
 		echo d >> a &&
 		git add a &&
 		test_must_fail git rebase --continue &&
-		test $(git rev-parse HEAD) != $(git rev-parse master) &&
+		test $(git rev-parse HEAD) != $(git rev-parse main) &&
 		git rebase --abort &&
 		test $(git rev-parse to-rebase) = $(git rev-parse pre-rebase) &&
 		test ! -d "$dotest"
@@ -78,7 +78,7 @@ testrebase() {
 		# Clean up the state from the previous one
 		git reset --hard pre-rebase &&
 		git reflog show to-rebase > reflog_before &&
-		test_must_fail git rebase$type master &&
+		test_must_fail git rebase$type main &&
 		git rebase --abort &&
 		git reflog show to-rebase > reflog_after &&
 		test_cmp reflog_before reflog_after &&
@@ -89,7 +89,7 @@ testrebase() {
 		cd "$work_dir" &&
 		# Clean up the state from the previous one
 		git reset --hard pre-rebase &&
-		test_must_fail git rebase$type master &&
+		test_must_fail git rebase$type main &&
 		test_must_fail git rebase -v --abort &&
 		test_must_fail git rebase --abort -v &&
 		git rebase --abort
@@ -103,7 +103,7 @@ test_expect_success 'rebase --apply --quit' '
 	cd "$work_dir" &&
 	# Clean up the state from the previous one
 	git reset --hard pre-rebase &&
-	test_must_fail git rebase --apply master &&
+	test_must_fail git rebase --apply main &&
 	test_path_is_dir .git/rebase-apply &&
 	head_before=$(git rev-parse HEAD) &&
 	git rebase --quit &&
@@ -115,7 +115,7 @@ test_expect_success 'rebase --merge --quit' '
 	cd "$work_dir" &&
 	# Clean up the state from the previous one
 	git reset --hard pre-rebase &&
-	test_must_fail git rebase --merge master &&
+	test_must_fail git rebase --merge main &&
 	test_path_is_dir .git/rebase-merge &&
 	head_before=$(git rev-parse HEAD) &&
 	git rebase --quit &&
diff --git a/t/t3408-rebase-multi-line.sh b/t/t3408-rebase-multi-line.sh
index d2bd7c17b0..1cba82f001 100755
--- a/t/t3408-rebase-multi-line.sh
+++ b/t/t3408-rebase-multi-line.sh
@@ -46,7 +46,7 @@ But otherwise with a sane description." side2 &&
 test_expect_success rebase '
 
 	git checkout side &&
-	git rebase master &&
+	git rebase main &&
 	git cat-file commit HEAD | sed -e "1,/^\$/d" >actual &&
 	git cat-file commit side@{1} | sed -e "1,/^\$/d" >expect &&
 	test_cmp expect actual
diff --git a/t/t3409-rebase-preserve-merges.sh b/t/t3409-rebase-preserve-merges.sh
index 3b340f1ece..b078985b95 100755
--- a/t/t3409-rebase-preserve-merges.sh
+++ b/t/t3409-rebase-preserve-merges.sh
@@ -18,7 +18,7 @@ export GIT_AUTHOR_EMAIL
 
 # Clone 2 (conflicting merge):
 #
-# A1--A2--B3   <-- origin/master
+# A1--A2--B3   <-- origin/main
 #  \       \
 #   B1------M  <-- topic
 #    \
@@ -26,7 +26,7 @@ export GIT_AUTHOR_EMAIL
 #
 # Clone 3 (no-ff merge):
 #
-# A1--A2--B3   <-- origin/master
+# A1--A2--B3   <-- origin/main
 #  \
 #   B1------M  <-- topic
 #    \     /
@@ -44,7 +44,7 @@ test_expect_success 'setup for merge-preserving rebase' \
 	echo Second > B &&
 	git add B &&
 	git commit -m "Add B1" &&
-	git checkout -f master &&
+	git checkout -f main &&
 	echo Third >> A &&
 	git commit -a -m "Modify A2" &&
 	echo Fifth > B &&
@@ -55,10 +55,10 @@ test_expect_success 'setup for merge-preserving rebase' \
 	(
 		cd clone2 &&
 		git checkout -b topic origin/topic &&
-		test_must_fail git merge origin/master &&
+		test_must_fail git merge origin/main &&
 		echo Resolved >B &&
 		git add B &&
-		git commit -m "Merge origin/master into topic"
+		git commit -m "Merge origin/main into topic"
 	) &&
 
 	git clone ./. clone3 &&
diff --git a/t/t3412-rebase-root.sh b/t/t3412-rebase-root.sh
index 21632a984e..120315ac0e 100755
--- a/t/t3412-rebase-root.sh
+++ b/t/t3412-rebase-root.sh
@@ -24,7 +24,7 @@ test_expect_success 'prepare repository' '
 
 test_expect_success 'rebase --root fails with too many args' '
 	git checkout -B fail other &&
-	test_must_fail git rebase --onto master --root fail fail
+	test_must_fail git rebase --onto main --root fail fail
 '
 
 test_expect_success 'setup pre-rebase hook' '
@@ -44,7 +44,7 @@ EOF
 
 test_expect_success 'rebase --root --onto <newbase>' '
 	git checkout -b work other &&
-	git rebase --root --onto master &&
+	git rebase --root --onto main &&
 	git log --pretty=tformat:"%s" > rebased &&
 	test_cmp expect rebased
 '
@@ -55,7 +55,7 @@ test_expect_success 'pre-rebase got correct input (1)' '
 
 test_expect_success 'rebase --root --onto <newbase> <branch>' '
 	git branch work2 other &&
-	git rebase --root --onto master work2 &&
+	git rebase --root --onto main work2 &&
 	git log --pretty=tformat:"%s" > rebased2 &&
 	test_cmp expect rebased2
 '
@@ -66,7 +66,7 @@ test_expect_success 'pre-rebase got correct input (2)' '
 
 test_expect_success 'rebase -i --root --onto <newbase>' '
 	git checkout -b work3 other &&
-	git rebase -i --root --onto master &&
+	git rebase -i --root --onto main &&
 	git log --pretty=tformat:"%s" > rebased3 &&
 	test_cmp expect rebased3
 '
@@ -77,7 +77,7 @@ test_expect_success 'pre-rebase got correct input (3)' '
 
 test_expect_success 'rebase -i --root --onto <newbase> <branch>' '
 	git branch work4 other &&
-	git rebase -i --root --onto master work4 &&
+	git rebase -i --root --onto main work4 &&
 	git log --pretty=tformat:"%s" > rebased4 &&
 	test_cmp expect rebased4
 '
@@ -88,7 +88,7 @@ test_expect_success 'pre-rebase got correct input (4)' '
 
 test_expect_success REBASE_P 'rebase -i -p with linear history' '
 	git checkout -b work5 other &&
-	git rebase -i -p --root --onto master &&
+	git rebase -i -p --root --onto main &&
 	git log --pretty=tformat:"%s" > rebased5 &&
 	test_cmp expect rebased5
 '
@@ -122,7 +122,7 @@ EOF
 
 test_expect_success REBASE_P 'rebase -i -p with merge' '
 	git checkout -b work6 other &&
-	git rebase -i -p --root --onto master &&
+	git rebase -i -p --root --onto main &&
 	log_with_names work6 > rebased6 &&
 	test_cmp expect-side rebased6
 '
@@ -157,7 +157,7 @@ EOF
 
 test_expect_success REBASE_P 'rebase -i -p with two roots' '
 	git checkout -b work7 other &&
-	git rebase -i -p --root --onto master &&
+	git rebase -i -p --root --onto main &&
 	log_with_names work7 > rebased7 &&
 	test_cmp expect-third rebased7
 '
@@ -173,14 +173,14 @@ EOF
 
 test_expect_success 'pre-rebase hook stops rebase' '
 	git checkout -b stops1 other &&
-	test_must_fail git rebase --root --onto master &&
+	test_must_fail git rebase --root --onto main &&
 	test "z$(git symbolic-ref HEAD)" = zrefs/heads/stops1 &&
 	test 0 = $(git rev-list other...stops1 | wc -l)
 '
 
 test_expect_success 'pre-rebase hook stops rebase -i' '
 	git checkout -b stops2 other &&
-	test_must_fail git rebase --root --onto master &&
+	test_must_fail git rebase --root --onto main &&
 	test "z$(git symbolic-ref HEAD)" = zrefs/heads/stops2 &&
 	test 0 = $(git rev-list other...stops2 | wc -l)
 '
@@ -190,7 +190,7 @@ test_expect_success 'remove pre-rebase hook' '
 '
 
 test_expect_success 'set up a conflict' '
-	git checkout master &&
+	git checkout main &&
 	echo conflict > B &&
 	git add B &&
 	git commit -m conflict
@@ -198,7 +198,7 @@ test_expect_success 'set up a conflict' '
 
 test_expect_success 'rebase --root with conflict (first part)' '
 	git checkout -b conflict1 other &&
-	test_must_fail git rebase --root --onto master &&
+	test_must_fail git rebase --root --onto main &&
 	git ls-files -u | grep "B$"
 '
 
@@ -225,7 +225,7 @@ test_expect_success 'rebase --root with conflict (second part)' '
 
 test_expect_success 'rebase -i --root with conflict (first part)' '
 	git checkout -b conflict2 other &&
-	test_must_fail git rebase -i --root --onto master &&
+	test_must_fail git rebase -i --root --onto main &&
 	git ls-files -u | grep "B$"
 '
 
@@ -263,7 +263,7 @@ EOF
 
 test_expect_success REBASE_P 'rebase -i -p --root with conflict (first part)' '
 	git checkout -b conflict3 other &&
-	test_must_fail git rebase -i -p --root --onto master &&
+	test_must_fail git rebase -i -p --root --onto main &&
 	git ls-files -u | grep "B$"
 '
 
diff --git a/t/t3413-rebase-hook.sh b/t/t3413-rebase-hook.sh
index b6833e9a5f..b5b8d3556e 100755
--- a/t/t3413-rebase-hook.sh
+++ b/t/t3413-rebase-hook.sh
@@ -18,7 +18,7 @@ test_expect_success setup '
 	git add git &&
 	test_tick &&
 	git commit -m side &&
-	git checkout master &&
+	git checkout main &&
 	git log --pretty=oneline --abbrev-commit --graph --all &&
 	git branch test side
 '
@@ -26,14 +26,14 @@ test_expect_success setup '
 test_expect_success 'rebase' '
 	git checkout test &&
 	git reset --hard side &&
-	git rebase master &&
+	git rebase main &&
 	test "z$(cat git)" = zworld
 '
 
 test_expect_success 'rebase -i' '
 	git checkout test &&
 	git reset --hard side &&
-	EDITOR=true git rebase -i master &&
+	EDITOR=true git rebase -i main &&
 	test "z$(cat git)" = zworld
 '
 
@@ -49,53 +49,53 @@ EOF
 test_expect_success 'pre-rebase hook gets correct input (1)' '
 	git checkout test &&
 	git reset --hard side &&
-	git rebase master &&
+	git rebase main &&
 	test "z$(cat git)" = zworld &&
-	test "z$(cat .git/PRE-REBASE-INPUT)" = zmaster,
+	test "z$(cat .git/PRE-REBASE-INPUT)" = zmain,
 
 '
 
 test_expect_success 'pre-rebase hook gets correct input (2)' '
 	git checkout test &&
 	git reset --hard side &&
-	git rebase master test &&
+	git rebase main test &&
 	test "z$(cat git)" = zworld &&
-	test "z$(cat .git/PRE-REBASE-INPUT)" = zmaster,test
+	test "z$(cat .git/PRE-REBASE-INPUT)" = zmain,test
 '
 
 test_expect_success 'pre-rebase hook gets correct input (3)' '
 	git checkout test &&
 	git reset --hard side &&
-	git checkout master &&
-	git rebase master test &&
+	git checkout main &&
+	git rebase main test &&
 	test "z$(cat git)" = zworld &&
-	test "z$(cat .git/PRE-REBASE-INPUT)" = zmaster,test
+	test "z$(cat .git/PRE-REBASE-INPUT)" = zmain,test
 '
 
 test_expect_success 'pre-rebase hook gets correct input (4)' '
 	git checkout test &&
 	git reset --hard side &&
-	EDITOR=true git rebase -i master &&
+	EDITOR=true git rebase -i main &&
 	test "z$(cat git)" = zworld &&
-	test "z$(cat .git/PRE-REBASE-INPUT)" = zmaster,
+	test "z$(cat .git/PRE-REBASE-INPUT)" = zmain,
 
 '
 
 test_expect_success 'pre-rebase hook gets correct input (5)' '
 	git checkout test &&
 	git reset --hard side &&
-	EDITOR=true git rebase -i master test &&
+	EDITOR=true git rebase -i main test &&
 	test "z$(cat git)" = zworld &&
-	test "z$(cat .git/PRE-REBASE-INPUT)" = zmaster,test
+	test "z$(cat .git/PRE-REBASE-INPUT)" = zmain,test
 '
 
 test_expect_success 'pre-rebase hook gets correct input (6)' '
 	git checkout test &&
 	git reset --hard side &&
-	git checkout master &&
-	EDITOR=true git rebase -i master test &&
+	git checkout main &&
+	EDITOR=true git rebase -i main test &&
 	test "z$(cat git)" = zworld &&
-	test "z$(cat .git/PRE-REBASE-INPUT)" = zmaster,test
+	test "z$(cat .git/PRE-REBASE-INPUT)" = zmain,test
 '
 
 test_expect_success 'setup pre-rebase hook that fails' '
@@ -110,7 +110,7 @@ EOF
 test_expect_success 'pre-rebase hook stops rebase (1)' '
 	git checkout test &&
 	git reset --hard side &&
-	test_must_fail git rebase master &&
+	test_must_fail git rebase main &&
 	test "z$(git symbolic-ref HEAD)" = zrefs/heads/test &&
 	test 0 = $(git rev-list HEAD...side | wc -l)
 '
@@ -118,7 +118,7 @@ test_expect_success 'pre-rebase hook stops rebase (1)' '
 test_expect_success 'pre-rebase hook stops rebase (2)' '
 	git checkout test &&
 	git reset --hard side &&
-	test_must_fail env EDITOR=: git rebase -i master &&
+	test_must_fail env EDITOR=: git rebase -i main &&
 	test "z$(git symbolic-ref HEAD)" = zrefs/heads/test &&
 	test 0 = $(git rev-list HEAD...side | wc -l)
 '
@@ -126,7 +126,7 @@ test_expect_success 'pre-rebase hook stops rebase (2)' '
 test_expect_success 'rebase --no-verify overrides pre-rebase (1)' '
 	git checkout test &&
 	git reset --hard side &&
-	git rebase --no-verify master &&
+	git rebase --no-verify main &&
 	test "z$(git symbolic-ref HEAD)" = zrefs/heads/test &&
 	test "z$(cat git)" = zworld
 '
@@ -134,7 +134,7 @@ test_expect_success 'rebase --no-verify overrides pre-rebase (1)' '
 test_expect_success 'rebase --no-verify overrides pre-rebase (2)' '
 	git checkout test &&
 	git reset --hard side &&
-	EDITOR=true git rebase --no-verify -i master &&
+	EDITOR=true git rebase --no-verify -i main &&
 	test "z$(git symbolic-ref HEAD)" = zrefs/heads/test &&
 	test "z$(cat git)" = zworld
 '
diff --git a/t/t3415-rebase-autosquash.sh b/t/t3415-rebase-autosquash.sh
index 7bab6000dc..40bb7ac649 100755
--- a/t/t3415-rebase-autosquash.sh
+++ b/t/t3415-rebase-autosquash.sh
@@ -407,7 +407,7 @@ test_expect_success 'wrapped original subject' '
 
 test_expect_success 'abort last squash' '
 	test_when_finished "test_might_fail git rebase --abort" &&
-	test_when_finished "git checkout master" &&
+	test_when_finished "git checkout main" &&
 
 	git checkout -b some-squashes &&
 	git commit --allow-empty -m first &&
diff --git a/t/t3416-rebase-onto-threedots.sh b/t/t3416-rebase-onto-threedots.sh
index 1f37adf56b..2360a1e37a 100755
--- a/t/t3416-rebase-onto-threedots.sh
+++ b/t/t3416-rebase-onto-threedots.sh
@@ -5,14 +5,14 @@ test_description='git rebase --onto A...B'
 . ./test-lib.sh
 . "$TEST_DIRECTORY/lib-rebase.sh"
 
-# Rebase only the tip commit of "topic" on merge base between "master"
-# and "topic".  Cannot do this for "side" with "master" because there
+# Rebase only the tip commit of "topic" on merge base between "main"
+# and "topic".  Cannot do this for "side" with "main" because there
 # is no single merge base.
 #
 #
 #	    F---G topic                             G'
 #	   /                                       /
-# A---B---C---D---E master        -->       A---B---C---D---E
+# A---B---C---D---E main        -->       A---B---C---D---E
 #      \   \ /
 #	\   x
 #	 \ / \
@@ -26,7 +26,7 @@ test_expect_success setup '
 	git branch topic &&
 	git checkout side &&
 	test_commit H &&
-	git checkout master &&
+	git checkout main &&
 	test_tick &&
 	git merge H &&
 	git tag D &&
@@ -42,83 +42,83 @@ test_expect_success setup '
 	test_commit K
 '
 
-test_expect_success 'rebase --onto master...topic' '
+test_expect_success 'rebase --onto main...topic' '
 	git reset --hard &&
 	git checkout topic &&
 	git reset --hard G &&
 
-	git rebase --onto master...topic F &&
+	git rebase --onto main...topic F &&
 	git rev-parse HEAD^1 >actual &&
 	git rev-parse C^0 >expect &&
 	test_cmp expect actual
 '
 
-test_expect_success 'rebase --onto master...' '
+test_expect_success 'rebase --onto main...' '
 	git reset --hard &&
 	git checkout topic &&
 	git reset --hard G &&
 
-	git rebase --onto master... F &&
+	git rebase --onto main... F &&
 	git rev-parse HEAD^1 >actual &&
 	git rev-parse C^0 >expect &&
 	test_cmp expect actual
 '
 
-test_expect_success 'rebase --onto master...side' '
+test_expect_success 'rebase --onto main...side' '
 	git reset --hard &&
 	git checkout side &&
 	git reset --hard K &&
 
-	test_must_fail git rebase --onto master...side J
+	test_must_fail git rebase --onto main...side J
 '
 
-test_expect_success 'rebase -i --onto master...topic' '
+test_expect_success 'rebase -i --onto main...topic' '
 	git reset --hard &&
 	git checkout topic &&
 	git reset --hard G &&
 	set_fake_editor &&
-	EXPECT_COUNT=1 git rebase -i --onto master...topic F &&
+	EXPECT_COUNT=1 git rebase -i --onto main...topic F &&
 	git rev-parse HEAD^1 >actual &&
 	git rev-parse C^0 >expect &&
 	test_cmp expect actual
 '
 
-test_expect_success 'rebase -i --onto master...' '
+test_expect_success 'rebase -i --onto main...' '
 	git reset --hard &&
 	git checkout topic &&
 	git reset --hard G &&
 	set_fake_editor &&
-	EXPECT_COUNT=1 git rebase -i --onto master... F &&
+	EXPECT_COUNT=1 git rebase -i --onto main... F &&
 	git rev-parse HEAD^1 >actual &&
 	git rev-parse C^0 >expect &&
 	test_cmp expect actual
 '
 
-test_expect_success 'rebase -i --onto master...side' '
+test_expect_success 'rebase -i --onto main...side' '
 	git reset --hard &&
 	git checkout side &&
 	git reset --hard K &&
 
 	set_fake_editor &&
-	test_must_fail git rebase -i --onto master...side J
+	test_must_fail git rebase -i --onto main...side J
 '
 
 test_expect_success 'rebase --keep-base --onto incompatible' '
-	test_must_fail git rebase --keep-base --onto master...
+	test_must_fail git rebase --keep-base --onto main...
 '
 
 test_expect_success 'rebase --keep-base --root incompatible' '
 	test_must_fail git rebase --keep-base --root
 '
 
-test_expect_success 'rebase --keep-base master from topic' '
+test_expect_success 'rebase --keep-base main from topic' '
 	git reset --hard &&
 	git checkout topic &&
 	git reset --hard G &&
 
-	git rebase --keep-base master &&
+	git rebase --keep-base main &&
 	git rev-parse C >base.expect &&
-	git merge-base master HEAD >base.actual &&
+	git merge-base main HEAD >base.actual &&
 	test_cmp base.expect base.actual &&
 
 	git rev-parse HEAD~2 >actual &&
@@ -126,23 +126,23 @@ test_expect_success 'rebase --keep-base master from topic' '
 	test_cmp expect actual
 '
 
-test_expect_success 'rebase --keep-base master from side' '
+test_expect_success 'rebase --keep-base main from side' '
 	git reset --hard &&
 	git checkout side &&
 	git reset --hard K &&
 
-	test_must_fail git rebase --keep-base master
+	test_must_fail git rebase --keep-base main
 '
 
-test_expect_success 'rebase -i --keep-base master from topic' '
+test_expect_success 'rebase -i --keep-base main from topic' '
 	git reset --hard &&
 	git checkout topic &&
 	git reset --hard G &&
 
 	set_fake_editor &&
-	EXPECT_COUNT=2 git rebase -i --keep-base master &&
+	EXPECT_COUNT=2 git rebase -i --keep-base main &&
 	git rev-parse C >base.expect &&
-	git merge-base master HEAD >base.actual &&
+	git merge-base main HEAD >base.actual &&
 	test_cmp base.expect base.actual &&
 
 	git rev-parse HEAD~2 >actual &&
@@ -150,13 +150,13 @@ test_expect_success 'rebase -i --keep-base master from topic' '
 	test_cmp expect actual
 '
 
-test_expect_success 'rebase -i --keep-base master from side' '
+test_expect_success 'rebase -i --keep-base main from side' '
 	git reset --hard &&
 	git checkout side &&
 	git reset --hard K &&
 
 	set_fake_editor &&
-	test_must_fail git rebase -i --keep-base master
+	test_must_fail git rebase -i --keep-base main
 '
 
 test_done
diff --git a/t/t3418-rebase-continue.sh b/t/t3418-rebase-continue.sh
index 7a2da972fd..b9e059e168 100755
--- a/t/t3418-rebase-continue.sh
+++ b/t/t3418-rebase-continue.sh
@@ -15,13 +15,13 @@ test_expect_success 'setup' '
 	git checkout -b topic HEAD^ &&
 	test_commit "commit-new-file-F2-on-topic-branch" F2 22 &&
 
-	git checkout master
+	git checkout main
 '
 
 test_expect_success 'interactive rebase --continue works with touched file' '
 	rm -fr .git/rebase-* &&
 	git reset --hard &&
-	git checkout master &&
+	git checkout main &&
 
 	FAKE_LINES="edit 1" git rebase -i HEAD^ &&
 	test-tool chmtime =-60 F1 &&
@@ -31,9 +31,9 @@ test_expect_success 'interactive rebase --continue works with touched file' '
 test_expect_success 'non-interactive rebase --continue works with touched file' '
 	rm -fr .git/rebase-* &&
 	git reset --hard &&
-	git checkout master &&
+	git checkout main &&
 
-	test_must_fail git rebase --onto master master topic &&
+	test_must_fail git rebase --onto main main topic &&
 	echo "Resolved" >F2 &&
 	git add F2 &&
 	test-tool chmtime =-60 F1 &&
@@ -61,7 +61,7 @@ test_expect_success 'rebase --continue remembers merge strategy and options' '
 	chmod +x test-bin/git-merge-funny &&
 	(
 		PATH=./test-bin:$PATH &&
-		test_must_fail git rebase -s funny -Xopt master topic
+		test_must_fail git rebase -s funny -Xopt main topic
 	) &&
 	test -f funny.was.run &&
 	rm funny.was.run &&
@@ -93,7 +93,7 @@ test_expect_success 'rebase -i --continue handles merge strategy and options' '
 	chmod +x test-bin/git-merge-funny &&
 	(
 		PATH=./test-bin:$PATH &&
-		test_must_fail git rebase -i -s funny -Xopt -Xfoo master topic
+		test_must_fail git rebase -i -s funny -Xopt -Xfoo main topic
 	) &&
 	test -f funny.was.run &&
 	rm funny.was.run &&
@@ -188,11 +188,11 @@ test_expect_success '--skip after failed fixup cleans commit message' '
 test_expect_success 'setup rerere database' '
 	rm -fr .git/rebase-* &&
 	git reset --hard commit-new-file-F3-on-topic-branch &&
-	git checkout master &&
+	git checkout main &&
 	test_commit "commit-new-file-F3" F3 3 &&
 	test_config rerere.enabled true &&
 	git update-ref refs/heads/topic commit-new-file-F3-on-topic-branch &&
-	test_must_fail git rebase -m master topic &&
+	test_must_fail git rebase -m main topic &&
 	echo "Resolved" >F2 &&
 	cp F2 expected-F2 &&
 	git add F2 &&
@@ -207,7 +207,7 @@ test_expect_success 'setup rerere database' '
 prepare () {
 	rm -fr .git/rebase-* &&
 	git reset --hard commit-new-file-F3-on-topic-branch &&
-	git checkout master &&
+	git checkout main &&
 	test_config rerere.enabled true
 }
 
@@ -215,7 +215,7 @@ test_rerere_autoupdate () {
 	action=$1 &&
 	test_expect_success "rebase $action --continue remembers --rerere-autoupdate" '
 		prepare &&
-		test_must_fail git rebase $action --rerere-autoupdate master topic &&
+		test_must_fail git rebase $action --rerere-autoupdate main topic &&
 		test_cmp expected-F2 F2 &&
 		git diff-files --quiet &&
 		test_must_fail git rebase --continue &&
@@ -227,7 +227,7 @@ test_rerere_autoupdate () {
 	test_expect_success "rebase $action --continue honors rerere.autoUpdate" '
 		prepare &&
 		test_config rerere.autoupdate true &&
-		test_must_fail git rebase $action master topic &&
+		test_must_fail git rebase $action main topic &&
 		test_cmp expected-F2 F2 &&
 		git diff-files --quiet &&
 		test_must_fail git rebase --continue &&
@@ -239,7 +239,7 @@ test_rerere_autoupdate () {
 	test_expect_success "rebase $action --continue remembers --no-rerere-autoupdate" '
 		prepare &&
 		test_config rerere.autoupdate true &&
-		test_must_fail git rebase $action --no-rerere-autoupdate master topic &&
+		test_must_fail git rebase $action --no-rerere-autoupdate main topic &&
 		test_cmp expected-F2 F2 &&
 		test_must_fail git diff-files --quiet &&
 		git add F2 &&
diff --git a/t/t3419-rebase-patch-id.sh b/t/t3419-rebase-patch-id.sh
index 1f32faa4a4..29fa76be4d 100755
--- a/t/t3419-rebase-patch-id.sh
+++ b/t/t3419-rebase-patch-id.sh
@@ -24,7 +24,7 @@ test_expect_success 'setup' '
 
 test_expect_success 'setup: 500 lines' '
 	rm -f .gitattributes &&
-	git checkout -q -f master &&
+	git checkout -q -f main &&
 	git reset --hard root &&
 	test_seq 500 >file &&
 	git add file &&
@@ -40,7 +40,7 @@ test_expect_success 'setup: 500 lines' '
 	git add newfile &&
 	git commit -q -m "add small file" &&
 
-	git cherry-pick master >/dev/null 2>&1
+	git cherry-pick main >/dev/null 2>&1
 '
 
 test_expect_success 'setup attributes' '
@@ -48,18 +48,18 @@ test_expect_success 'setup attributes' '
 '
 
 test_expect_success 'detect upstream patch' '
-	git checkout -q master &&
+	git checkout -q main &&
 	scramble file &&
 	git add file &&
 	git commit -q -m "change big file again" &&
 	git checkout -q other^{} &&
-	git rebase master &&
-	git rev-list master...HEAD~ >revs &&
+	git rebase main &&
+	git rev-list main...HEAD~ >revs &&
 	test_must_be_empty revs
 '
 
 test_expect_success 'do not drop patch' '
-	git branch -f squashed master &&
+	git branch -f squashed main &&
 	git checkout -q -f squashed &&
 	git reset -q --soft HEAD~2 &&
 	git commit -q -m squashed &&
diff --git a/t/t3420-rebase-autostash.sh b/t/t3420-rebase-autostash.sh
index ca331733fb..b1263e5a47 100755
--- a/t/t3420-rebase-autostash.sh
+++ b/t/t3420-rebase-autostash.sh
@@ -21,12 +21,12 @@ test_expect_success setup '
 	git add . &&
 	test_tick &&
 	git commit -m "third commit" &&
-	git checkout -b unrelated-onto-branch master &&
+	git checkout -b unrelated-onto-branch main &&
 	echo unrelated >file4 &&
 	git add . &&
 	test_tick &&
 	git commit -m "unrelated commit" &&
-	git checkout -b related-onto-branch master &&
+	git checkout -b related-onto-branch main &&
 	echo conflicting-change >file2 &&
 	git add . &&
 	test_tick &&
@@ -305,7 +305,7 @@ test_expect_success 'autostash is saved on editor failure with conflict' '
 '
 
 test_expect_success 'autostash with dirty submodules' '
-	test_when_finished "git reset --hard && git checkout master" &&
+	test_when_finished "git reset --hard && git checkout main" &&
 	git checkout -b with-submodule &&
 	git submodule add ./ sub &&
 	test_tick &&
@@ -324,7 +324,7 @@ test_expect_success 'branch is left alone when possible' '
 
 test_expect_success 'never change active branch' '
 	git checkout -b not-the-feature-branch unrelated-onto-branch &&
-	test_when_finished "git reset --hard && git checkout master" &&
+	test_when_finished "git reset --hard && git checkout main" &&
 	echo changed >file0 &&
 	git rebase --autostash not-the-feature-branch feature-branch &&
 	test_cmp_rev not-the-feature-branch unrelated-onto-branch
diff --git a/t/t3423-rebase-reword.sh b/t/t3423-rebase-reword.sh
index 6963750794..4859bb8f72 100755
--- a/t/t3423-rebase-reword.sh
+++ b/t/t3423-rebase-reword.sh
@@ -7,7 +7,7 @@ test_description='git rebase interactive with rewording'
 . "$TEST_DIRECTORY"/lib-rebase.sh
 
 test_expect_success 'setup' '
-	test_commit master file-1 test &&
+	test_commit main file-1 test &&
 
 	git checkout -b stuff &&
 
@@ -22,7 +22,7 @@ test_expect_success 'reword without issues functions as intended' '
 
 	set_fake_editor &&
 	FAKE_LINES="pick 1 reword 2" FAKE_COMMIT_MESSAGE="feature_b_reworded" \
-		git rebase -i -v master &&
+		git rebase -i -v main &&
 
 	test "$(git log -1 --format=%B)" = "feature_b_reworded" &&
 	test $(git rev-list --count HEAD) = 3
@@ -35,7 +35,7 @@ test_expect_success 'reword after a conflict preserves commit' '
 
 	set_fake_editor &&
 	test_must_fail env FAKE_LINES="reword 2" \
-		git rebase -i -v master &&
+		git rebase -i -v main &&
 
 	git checkout --theirs file-2 &&
 	git add file-2 &&
diff --git a/t/t3427-rebase-subtree.sh b/t/t3427-rebase-subtree.sh
index 5839719ba1..265856ece6 100755
--- a/t/t3427-rebase-subtree.sh
+++ b/t/t3427-rebase-subtree.sh
@@ -17,7 +17,7 @@ commit_message() {
 #
 # topic_1 - topic_2 - topic_3
 #                             \
-# README ---------------------- Add subproject master - topic_4 - files_subtree/topic_5
+# README ---------------------- Add subproject main - topic_4 - files_subtree/topic_5
 #
 # Where the merge moves the files topic_[123].t into the subdirectory
 # files_subtree/ and topic_4 as well as files_subtree/topic_5 add files to that
@@ -28,7 +28,7 @@ commit_message() {
 # an empty commit is added on top. The pre-rebase commit history looks like
 # this:
 #
-# Add subproject master - topic_4 - files_subtree/topic_5 - Empty commit
+# Add subproject main - topic_4 - files_subtree/topic_5 - Empty commit
 #
 # where the root commit adds three files: topic_1.t, topic_2.t and topic_3.t.
 #
@@ -48,11 +48,11 @@ test_expect_success 'setup' '
 	test_commit -C files topic_3 &&
 
 	: perform subtree merge into files_subtree/ &&
-	git fetch files refs/heads/master:refs/heads/files-master &&
+	git fetch files refs/heads/main:refs/heads/files-main &&
 	git merge -s ours --no-commit --allow-unrelated-histories \
-		files-master &&
-	git read-tree --prefix=files_subtree -u files-master &&
-	git commit -m "Add subproject master" &&
+		files-main &&
+	git read-tree --prefix=files_subtree -u files-main &&
+	git commit -m "Add subproject main" &&
 
 	: add two extra commits to rebase &&
 	test_commit -C files_subtree topic_4 &&
@@ -70,7 +70,7 @@ test_expect_success 'setup' '
 test_expect_failure REBASE_P 'Rebase -Xsubtree --preserve-merges --onto commit' '
 	reset_rebase &&
 	git checkout -b rebase-preserve-merges to-rebase &&
-	git rebase -Xsubtree=files_subtree --preserve-merges --onto files-master master &&
+	git rebase -Xsubtree=files_subtree --preserve-merges --onto files-main main &&
 	verbose test "$(commit_message HEAD~)" = "topic_4" &&
 	verbose test "$(commit_message HEAD)" = "files_subtree/topic_5"
 '
@@ -79,7 +79,7 @@ test_expect_failure REBASE_P 'Rebase -Xsubtree --preserve-merges --onto commit'
 test_expect_failure REBASE_P 'Rebase -Xsubtree --keep-empty --preserve-merges --onto commit' '
 	reset_rebase &&
 	git checkout -b rebase-keep-empty to-rebase &&
-	git rebase -Xsubtree=files_subtree --keep-empty --preserve-merges --onto files-master master &&
+	git rebase -Xsubtree=files_subtree --keep-empty --preserve-merges --onto files-main main &&
 	verbose test "$(commit_message HEAD~2)" = "topic_4" &&
 	verbose test "$(commit_message HEAD~)" = "files_subtree/topic_5" &&
 	verbose test "$(commit_message HEAD)" = "Empty commit"
@@ -88,7 +88,7 @@ test_expect_failure REBASE_P 'Rebase -Xsubtree --keep-empty --preserve-merges --
 test_expect_success 'Rebase -Xsubtree --empty=ask --onto commit' '
 	reset_rebase &&
 	git checkout -b rebase-onto to-rebase &&
-	test_must_fail git rebase -Xsubtree=files_subtree --empty=ask --onto files-master master &&
+	test_must_fail git rebase -Xsubtree=files_subtree --empty=ask --onto files-main main &&
 	: first pick results in no changes &&
 	git rebase --skip &&
 	verbose test "$(commit_message HEAD~2)" = "topic_4" &&
@@ -99,7 +99,7 @@ test_expect_success 'Rebase -Xsubtree --empty=ask --onto commit' '
 test_expect_success 'Rebase -Xsubtree --empty=ask --rebase-merges --onto commit' '
 	reset_rebase &&
 	git checkout -b rebase-merges-onto to-rebase &&
-	test_must_fail git rebase -Xsubtree=files_subtree --empty=ask --rebase-merges --onto files-master --root &&
+	test_must_fail git rebase -Xsubtree=files_subtree --empty=ask --rebase-merges --onto files-main --root &&
 	: first pick results in no changes &&
 	git rebase --skip &&
 	verbose test "$(commit_message HEAD~2)" = "topic_4" &&
diff --git a/t/t3430-rebase-merges.sh b/t/t3430-rebase-merges.sh
index b454f400eb..3cc99693af 100755
--- a/t/t3430-rebase-merges.sh
+++ b/t/t3430-rebase-merges.sh
@@ -12,7 +12,7 @@ Initial setup:
 
     -- B --                   (first)
    /       \
- A - C - D - E - H            (master)
+ A - C - D - E - H            (main)
    \    \       /
     \    F - G                (second)
      \
@@ -37,7 +37,7 @@ test_expect_success 'setup' '
 	git checkout -b first &&
 	test_commit B &&
 	b=$(git rev-parse --short HEAD) &&
-	git checkout master &&
+	git checkout main &&
 	test_commit C &&
 	c=$(git rev-parse --short HEAD) &&
 	test_commit D &&
@@ -52,7 +52,7 @@ test_expect_success 'setup' '
 	f=$(git rev-parse --short HEAD) &&
 	test_commit G &&
 	g=$(git rev-parse --short HEAD) &&
-	git checkout master &&
+	git checkout main &&
 	git merge --no-commit G &&
 	test_tick &&
 	git commit -m H &&
@@ -82,7 +82,7 @@ test_expect_success 'create completely different structure' '
 	EOF
 	test_config sequence.editor \""$PWD"/replace-editor.sh\" &&
 	test_tick &&
-	git rebase -i -r A master &&
+	git rebase -i -r A main &&
 	test_cmp_graph <<-\EOF
 	*   Merge the topic branch '\''onebranch'\''
 	|\
@@ -183,7 +183,7 @@ test_expect_success 'fast-forward merge -c still rewords' '
 '
 
 test_expect_success 'with a branch tip that was cherry-picked already' '
-	git checkout -b already-upstream master &&
+	git checkout -b already-upstream main &&
 	base="$(git rev-parse --verify HEAD)" &&
 
 	test_commit A1 &&
@@ -211,7 +211,7 @@ test_expect_success 'with a branch tip that was cherry-picked already' '
 '
 
 test_expect_success 'do not rebase cousins unless asked for' '
-	git checkout -b cousins master &&
+	git checkout -b cousins main &&
 	before="$(git rev-parse --verify HEAD)" &&
 	test_tick &&
 	git rebase -r HEAD^ &&
@@ -340,7 +340,7 @@ test_expect_success 'a "merge" into a root commit is a fast-forward' '
 test_expect_success 'A root commit can be a cousin, treat it that way' '
 	git checkout --orphan khnum &&
 	test_commit yama &&
-	git checkout -b asherah master &&
+	git checkout -b asherah main &&
 	test_commit shamkat &&
 	git merge --allow-unrelated-histories khnum &&
 	test_tick &&
@@ -367,7 +367,7 @@ test_expect_success 'labels that are object IDs are rewritten' '
 	git checkout -b third B &&
 	test_commit I &&
 	third=$(git rev-parse HEAD) &&
-	git checkout -b labels master &&
+	git checkout -b labels main &&
 	git merge --no-commit third &&
 	test_tick &&
 	git commit -m "Merge commit '\''$third'\'' into labels" &&
diff --git a/t/t3431-rebase-fork-point.sh b/t/t3431-rebase-fork-point.sh
index 172562789e..d5d9b2304d 100755
--- a/t/t3431-rebase-fork-point.sh
+++ b/t/t3431-rebase-fork-point.sh
@@ -7,11 +7,11 @@ test_description='git rebase --fork-point test'
 
 . ./test-lib.sh
 
-# A---B---D---E    (master)
+# A---B---D---E    (main)
 #      \
 #       C*---F---G (side)
 #
-# C was formerly part of master but master was rewound to remove C
+# C was formerly part of main but main was rewound to remove C
 #
 test_expect_success setup '
 	test_commit A &&
@@ -30,7 +30,7 @@ test_rebase () {
 	expected="$1" &&
 	shift &&
 	test_expect_success "git rebase $*" "
-		git checkout master &&
+		git checkout main &&
 		git reset --hard E &&
 		git checkout side &&
 		git reset --hard G &&
@@ -48,26 +48,26 @@ test_rebase 'G F C E D B A' --no-fork-point
 test_rebase 'G F C D B A' --no-fork-point --onto D
 test_rebase 'G F C B A' --no-fork-point --keep-base
 
-test_rebase 'G F E D B A' --fork-point refs/heads/master
-test_rebase 'G F E D B A' --fork-point master
+test_rebase 'G F E D B A' --fork-point refs/heads/main
+test_rebase 'G F E D B A' --fork-point main
 
-test_rebase 'G F D B A' --fork-point --onto D refs/heads/master
-test_rebase 'G F D B A' --fork-point --onto D master
+test_rebase 'G F D B A' --fork-point --onto D refs/heads/main
+test_rebase 'G F D B A' --fork-point --onto D main
 
-test_rebase 'G F B A' --fork-point --keep-base refs/heads/master
-test_rebase 'G F B A' --fork-point --keep-base master
+test_rebase 'G F B A' --fork-point --keep-base refs/heads/main
+test_rebase 'G F B A' --fork-point --keep-base main
 
-test_rebase 'G F C E D B A' refs/heads/master
-test_rebase 'G F C E D B A' master
+test_rebase 'G F C E D B A' refs/heads/main
+test_rebase 'G F C E D B A' main
 
-test_rebase 'G F C D B A' --onto D refs/heads/master
-test_rebase 'G F C D B A' --onto D master
+test_rebase 'G F C D B A' --onto D refs/heads/main
+test_rebase 'G F C D B A' --onto D main
 
-test_rebase 'G F C B A' --keep-base refs/heads/master
-test_rebase 'G F C B A' --keep-base master
+test_rebase 'G F C B A' --keep-base refs/heads/main
+test_rebase 'G F C B A' --keep-base main
 
 test_expect_success 'git rebase --fork-point with ambigous refname' '
-	git checkout master &&
+	git checkout main &&
 	git checkout -b one &&
 	git checkout side &&
 	git tag one &&
diff --git a/t/t3432-rebase-fast-forward.sh b/t/t3432-rebase-fast-forward.sh
index a29eda87e9..b87537ca7d 100755
--- a/t/t3432-rebase-fast-forward.sh
+++ b/t/t3432-rebase-fast-forward.sh
@@ -84,19 +84,19 @@ test_rebase_same_head_ () {
 
 changes='no changes'
 test_rebase_same_head success noop same success work same
-test_rebase_same_head success noop same success work same master
+test_rebase_same_head success noop same success work same main
 test_rebase_same_head success noop same success work diff --onto B B
 test_rebase_same_head success noop same success work diff --onto B... B
-test_rebase_same_head success noop same success work same --onto master... master
-test_rebase_same_head success noop same success work same --keep-base master
+test_rebase_same_head success noop same success work same --onto main... main
+test_rebase_same_head success noop same success work same --keep-base main
 test_rebase_same_head success noop same success work same --keep-base
 test_rebase_same_head success noop same success work same --no-fork-point
 test_rebase_same_head success noop same success work same --keep-base --no-fork-point
-test_rebase_same_head success noop same success work same --fork-point master
+test_rebase_same_head success noop same success work same --fork-point main
 test_rebase_same_head success noop same success work diff --fork-point --onto B B
 test_rebase_same_head success noop same success work diff --fork-point --onto B... B
-test_rebase_same_head success noop same success work same --fork-point --onto master... master
-test_rebase_same_head success noop same success work same --keep-base --keep-base master
+test_rebase_same_head success noop same success work same --fork-point --onto main... main
+test_rebase_same_head success noop same success work same --keep-base --keep-base main
 
 test_expect_success 'add work same to side' '
 	test_commit E
@@ -104,22 +104,22 @@ test_expect_success 'add work same to side' '
 
 changes='our changes'
 test_rebase_same_head success noop same success work same
-test_rebase_same_head success noop same success work same master
+test_rebase_same_head success noop same success work same main
 test_rebase_same_head success noop same success work diff --onto B B
 test_rebase_same_head success noop same success work diff --onto B... B
-test_rebase_same_head success noop same success work same --onto master... master
-test_rebase_same_head success noop same success work same --keep-base master
+test_rebase_same_head success noop same success work same --onto main... main
+test_rebase_same_head success noop same success work same --keep-base main
 test_rebase_same_head success noop same success work same --keep-base
 test_rebase_same_head success noop same success work same --no-fork-point
 test_rebase_same_head success noop same success work same --keep-base --no-fork-point
-test_rebase_same_head success noop same success work same --fork-point master
+test_rebase_same_head success noop same success work same --fork-point main
 test_rebase_same_head success noop same success work diff --fork-point --onto B B
 test_rebase_same_head success noop same success work diff --fork-point --onto B... B
-test_rebase_same_head success noop same success work same --fork-point --onto master... master
-test_rebase_same_head success noop same success work same --fork-point --keep-base master
+test_rebase_same_head success noop same success work same --fork-point --onto main... main
+test_rebase_same_head success noop same success work same --fork-point --keep-base main
 
 test_expect_success 'add work same to upstream' '
-	git checkout master &&
+	git checkout main &&
 	test_commit F &&
 	git checkout side
 '
@@ -127,12 +127,12 @@ test_expect_success 'add work same to upstream' '
 changes='our and their changes'
 test_rebase_same_head success noop same success work diff --onto B B
 test_rebase_same_head success noop same success work diff --onto B... B
-test_rebase_same_head success noop same success work diff --onto master... master
-test_rebase_same_head success noop same success work diff --keep-base master
+test_rebase_same_head success noop same success work diff --onto main... main
+test_rebase_same_head success noop same success work diff --keep-base main
 test_rebase_same_head success noop same success work diff --keep-base
 test_rebase_same_head failure work same success work diff --fork-point --onto B B
 test_rebase_same_head failure work same success work diff --fork-point --onto B... B
-test_rebase_same_head success noop same success work diff --fork-point --onto master... master
-test_rebase_same_head success noop same success work diff --fork-point --keep-base master
+test_rebase_same_head success noop same success work diff --fork-point --onto main... main
+test_rebase_same_head success noop same success work diff --fork-point --keep-base main
 
 test_done
diff --git a/t/t3434-rebase-i18n.sh b/t/t3434-rebase-i18n.sh
index c7c835cde9..a252908d02 100755
--- a/t/t3434-rebase-i18n.sh
+++ b/t/t3434-rebase-i18n.sh
@@ -7,7 +7,7 @@ test_description='rebase with changing encoding
 
 Initial setup:
 
-1 - 2              master
+1 - 2              main
  \
   3 - 4            first
    \
@@ -41,7 +41,7 @@ test_expect_success 'rebase --rebase-merges update encoding eucJP to UTF-8' '
 	git config i18n.commitencoding eucJP &&
 	git merge -F "$TEST_DIRECTORY/t3434/eucJP.txt" second &&
 	git config i18n.commitencoding UTF-8 &&
-	git rebase --rebase-merges master &&
+	git rebase --rebase-merges main &&
 	compare_msg eucJP.txt eucJP UTF-8
 '
 
@@ -50,7 +50,7 @@ test_expect_success 'rebase --rebase-merges update encoding eucJP to ISO-2022-JP
 	git config i18n.commitencoding eucJP &&
 	git merge -F "$TEST_DIRECTORY/t3434/eucJP.txt" second &&
 	git config i18n.commitencoding ISO-2022-JP &&
-	git rebase --rebase-merges master &&
+	git rebase --rebase-merges main &&
 	compare_msg eucJP.txt eucJP ISO-2022-JP
 '
 
@@ -66,7 +66,7 @@ test_rebase_continue_update_encode () {
 		git config i18n.commitencoding $old &&
 		git commit -F "$TEST_DIRECTORY/t3434/$msgfile" &&
 		git config i18n.commitencoding $new &&
-		test_must_fail git rebase -m master &&
+		test_must_fail git rebase -m main &&
 		test -f .git/rebase-merge/message &&
 		git stripspace <.git/rebase-merge/message >two.t &&
 		git add two.t &&
diff --git a/t/t3435-rebase-gpg-sign.sh b/t/t3435-rebase-gpg-sign.sh
index 54120b09d6..aab2b3aab8 100755
--- a/t/t3435-rebase-gpg-sign.sh
+++ b/t/t3435-rebase-gpg-sign.sh
@@ -46,7 +46,7 @@ test_expect_success 'setup: merge commit' '
 	test_commit fork-point &&
 	git switch -c side &&
 	test_commit three &&
-	git switch master &&
+	git switch main &&
 	git merge --no-ff side &&
 	git tag merged
 '
@@ -64,7 +64,7 @@ test_rebase_gpg_sign   false -i --no-gpg-sign --gpg-sign
 test_expect_failure 'rebase -p --no-gpg-sign override commit.gpgsign' '
 	git reset --hard merged &&
 	git config commit.gpgsign true &&
-	git rebase -p --no-gpg-sign --onto=one fork-point master &&
+	git rebase -p --no-gpg-sign --onto=one fork-point main &&
 	test_must_fail git verify-commit HEAD
 '
 
diff --git a/t/t3436-rebase-more-options.sh b/t/t3436-rebase-more-options.sh
index eaaf4c8d1d..4d106642ba 100755
--- a/t/t3436-rebase-more-options.sh
+++ b/t/t3436-rebase-more-options.sh
@@ -28,7 +28,7 @@ test_expect_success 'setup' '
 	test_commit commit2 foo foo2 &&
 	test_commit commit3 foo foo3 &&
 
-	git checkout --orphan master &&
+	git checkout --orphan main &&
 	rm foo &&
 	test_write_lines "line 1" "        line 2" "line 3" >file &&
 	git commit -am "add file" &&
diff --git a/t/test-lib.sh b/t/test-lib.sh
index c464f8dcc8..4ae87a5c4e 100644
--- a/t/test-lib.sh
+++ b/t/test-lib.sh
@@ -257,7 +257,13 @@ case "$TRASH_DIRECTORY" in
 esac
 
 case "$TEST_NUMBER" in
-[0-2]*|3[0-3]*)
+3404)
+	# Avoid conflicts with patch series that are cooking at the same time
+	# as the patch series changing the default of `init.defaultBranch`.
+	GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+	export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+	;;
+[0-2]*|3[0-4]*)
 	GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 	export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 	;;
-- 
gitgitgadget


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH 07/28] t3[5-9]*: adjust the references to the default branch name "main"
  2020-11-12 22:43 [PATCH 00/28] Use main as default branch name Johannes Schindelin via GitGitGadget
                   ` (5 preceding siblings ...)
  2020-11-12 22:43 ` [PATCH 06/28] t34*: adjust the references to the default branch name "main" Johannes Schindelin via GitGitGadget
@ 2020-11-12 22:43 ` Johannes Schindelin via GitGitGadget
  2020-11-12 22:43 ` [PATCH 08/28] t4*: " Johannes Schindelin via GitGitGadget
                   ` (25 subsequent siblings)
  32 siblings, 0 replies; 163+ messages in thread
From: Johannes Schindelin via GitGitGadget @ 2020-11-12 22:43 UTC (permalink / raw)
  To: git; +Cc: Johannes Schindelin, Johannes Schindelin

From: Johannes Schindelin <johannes.schindelin@gmx.de>

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>
---
 t/t3500-cherry.sh                   | 12 ++++-----
 t/t3501-revert-cherry-pick.sh       |  4 +--
 t/t3502-cherry-pick-merge.sh        |  2 +-
 t/t3503-cherry-pick-root.sh         | 10 ++++----
 t/t3504-cherry-pick-rerere.sh       | 24 ++++++++---------
 t/t3505-cherry-pick-empty.sh        | 24 ++++++++---------
 t/t3506-cherry-pick-ff.sh           |  8 +++---
 t/t3507-cherry-pick-conflict.sh     |  2 +-
 t/t3508-cherry-pick-many-commits.sh | 38 +++++++++++++--------------
 t/t3509-cherry-pick-merge-df.sh     |  2 +-
 t/t3512-cherry-pick-submodule.sh    |  2 +-
 t/t3600-rm.sh                       | 10 ++++----
 t/t3701-add-interactive.sh          |  4 +--
 t/t3901-i18n-patch.sh               | 40 ++++++++++++++---------------
 t/t3903-stash.sh                    | 32 +++++++++++------------
 t/t3910-mac-os-precompose.sh        |  6 ++---
 t/test-lib.sh                       |  2 +-
 17 files changed, 111 insertions(+), 111 deletions(-)

diff --git a/t/t3500-cherry.sh b/t/t3500-cherry.sh
index 2b8d9cb38e..2528e773a6 100755
--- a/t/t3500-cherry.sh
+++ b/t/t3500-cherry.sh
@@ -5,7 +5,7 @@
 
 test_description='git cherry should detect patches integrated upstream
 
-This test cherry-picks one local change of two into master branch, and
+This test cherry-picks one local change of two into main branch, and
 checks that git cherry only returns the second patch in the local branch
 '
 . ./test-lib.sh
@@ -32,7 +32,7 @@ test_expect_success \
      test_tick &&
      git commit -m "Add C." &&
 
-     git checkout -f master &&
+     git checkout -f main &&
      rm -f B C &&
 
      echo Third >> A &&
@@ -40,19 +40,19 @@ test_expect_success \
      test_tick &&
      git commit -m "Modify A." &&
 
-     expr "$(echo $(git cherry master my-topic-branch) )" : "+ [^ ]* + .*"
+     expr "$(echo $(git cherry main my-topic-branch) )" : "+ [^ ]* + .*"
 '
 
 test_expect_success \
     'check that cherry with limit returns only the top patch'\
-    'expr "$(echo $(git cherry master my-topic-branch my-topic-branch^1) )" : "+ [^ ]*"
+    'expr "$(echo $(git cherry main my-topic-branch my-topic-branch^1) )" : "+ [^ ]*"
 '
 
 test_expect_success \
     'cherry-pick one of the 2 patches, and check cherry recognized one and only one as new' \
     'git cherry-pick my-topic-branch^0 &&
-     echo $(git cherry master my-topic-branch) &&
-     expr "$(echo $(git cherry master my-topic-branch) )" : "+ [^ ]* - .*"
+     echo $(git cherry main my-topic-branch) &&
+     expr "$(echo $(git cherry main my-topic-branch) )" : "+ [^ ]* - .*"
 '
 
 test_expect_success 'cherry ignores whitespace' '
diff --git a/t/t3501-revert-cherry-pick.sh b/t/t3501-revert-cherry-pick.sh
index 3669dfb1be..0adfdb4b6c 100755
--- a/t/t3501-revert-cherry-pick.sh
+++ b/t/t3501-revert-cherry-pick.sh
@@ -112,7 +112,7 @@ test_expect_success 'cherry-pick on unborn branch' '
 test_expect_success 'cherry-pick "-" to pick from previous branch' '
 	git checkout unborn &&
 	test_commit to-pick actual content &&
-	git checkout master &&
+	git checkout main &&
 	git cherry-pick - &&
 	echo content >expect &&
 	test_cmp expect actual
@@ -132,7 +132,7 @@ test_expect_success 'cherry-pick "-" is meaningless without checkout' '
 test_expect_success 'cherry-pick "-" works with arguments' '
 	git checkout -b side-branch &&
 	test_commit change actual change &&
-	git checkout master &&
+	git checkout main &&
 	git cherry-pick -s - &&
 	echo "Signed-off-by: C O Mitter <committer@example.com>" >expect &&
 	git cat-file commit HEAD | grep ^Signed-off-by: >signoff &&
diff --git a/t/t3502-cherry-pick-merge.sh b/t/t3502-cherry-pick-merge.sh
index 8b635a196d..4d6ff14eb6 100755
--- a/t/t3502-cherry-pick-merge.sh
+++ b/t/t3502-cherry-pick-merge.sh
@@ -25,7 +25,7 @@ test_expect_success setup '
 	echo new line >B &&
 	git commit -m "add line to B" B &&
 	git tag b &&
-	git checkout master &&
+	git checkout main &&
 	git merge side &&
 	git tag c
 
diff --git a/t/t3503-cherry-pick-root.sh b/t/t3503-cherry-pick-root.sh
index e27f39d1e5..59496a56b7 100755
--- a/t/t3503-cherry-pick-root.sh
+++ b/t/t3503-cherry-pick-root.sh
@@ -30,7 +30,7 @@ test_expect_success setup '
 test_expect_success 'cherry-pick a root commit' '
 
 	git checkout second^0 &&
-	git cherry-pick master &&
+	git cherry-pick main &&
 	echo first >expect &&
 	test_cmp expect file1
 
@@ -38,14 +38,14 @@ test_expect_success 'cherry-pick a root commit' '
 
 test_expect_success 'revert a root commit' '
 
-	git revert master &&
+	git revert main &&
 	test_path_is_missing file1
 
 '
 
 test_expect_success 'cherry-pick a root commit with an external strategy' '
 
-	git cherry-pick --strategy=resolve master &&
+	git cherry-pick --strategy=resolve main &&
 	echo first >expect &&
 	test_cmp expect file1
 
@@ -53,7 +53,7 @@ test_expect_success 'cherry-pick a root commit with an external strategy' '
 
 test_expect_success 'revert a root commit with an external strategy' '
 
-	git revert --strategy=resolve master &&
+	git revert --strategy=resolve main &&
 	test_path_is_missing file1
 
 '
@@ -65,7 +65,7 @@ test_expect_success 'cherry-pick two root commits' '
 	echo third >expect.file3 &&
 
 	git checkout second^0 &&
-	git cherry-pick master third &&
+	git cherry-pick main third &&
 
 	test_cmp expect.file1 file1 &&
 	test_cmp expect.file2 file2 &&
diff --git a/t/t3504-cherry-pick-rerere.sh b/t/t3504-cherry-pick-rerere.sh
index 80a0d08706..3804527e2e 100755
--- a/t/t3504-cherry-pick-rerere.sh
+++ b/t/t3504-cherry-pick-rerere.sh
@@ -6,8 +6,8 @@ test_description='cherry-pick should rerere for conflicts'
 
 test_expect_success setup '
 	test_commit foo &&
-	test_commit foo-master foo &&
-	test_commit bar-master bar &&
+	test_commit foo-main foo &&
+	test_commit bar-main bar &&
 
 	git checkout -b dev foo &&
 	test_commit foo-dev foo &&
@@ -16,7 +16,7 @@ test_expect_success setup '
 '
 
 test_expect_success 'conflicting merge' '
-	test_must_fail git merge master
+	test_must_fail git merge main
 '
 
 test_expect_success 'fixup' '
@@ -29,7 +29,7 @@ test_expect_success 'fixup' '
 '
 
 test_expect_success 'cherry-pick conflict with --rerere-autoupdate' '
-	test_must_fail git cherry-pick --rerere-autoupdate foo..bar-master &&
+	test_must_fail git cherry-pick --rerere-autoupdate foo..bar-main &&
 	test_cmp foo-expect foo &&
 	git diff-files --quiet &&
 	test_must_fail git cherry-pick --continue &&
@@ -41,7 +41,7 @@ test_expect_success 'cherry-pick conflict with --rerere-autoupdate' '
 
 test_expect_success 'cherry-pick conflict repsects rerere.autoUpdate' '
 	test_config rerere.autoUpdate true &&
-	test_must_fail git cherry-pick foo..bar-master &&
+	test_must_fail git cherry-pick foo..bar-main &&
 	test_cmp foo-expect foo &&
 	git diff-files --quiet &&
 	test_must_fail git cherry-pick --continue &&
@@ -53,7 +53,7 @@ test_expect_success 'cherry-pick conflict repsects rerere.autoUpdate' '
 
 test_expect_success 'cherry-pick conflict with --no-rerere-autoupdate' '
 	test_config rerere.autoUpdate true &&
-	test_must_fail git cherry-pick --no-rerere-autoupdate foo..bar-master &&
+	test_must_fail git cherry-pick --no-rerere-autoupdate foo..bar-main &&
 	test_cmp foo-expect foo &&
 	test_must_fail git diff-files --quiet &&
 	git add foo &&
@@ -66,7 +66,7 @@ test_expect_success 'cherry-pick conflict with --no-rerere-autoupdate' '
 '
 
 test_expect_success 'cherry-pick --continue rejects --rerere-autoupdate' '
-	test_must_fail git cherry-pick --rerere-autoupdate foo..bar-master &&
+	test_must_fail git cherry-pick --rerere-autoupdate foo..bar-main &&
 	test_cmp foo-expect foo &&
 	git diff-files --quiet &&
 	test_must_fail git cherry-pick --continue --rerere-autoupdate >actual 2>&1 &&
@@ -79,25 +79,25 @@ test_expect_success 'cherry-pick --continue rejects --rerere-autoupdate' '
 '
 
 test_expect_success 'cherry-pick --rerere-autoupdate more than once' '
-	test_must_fail git cherry-pick --rerere-autoupdate --rerere-autoupdate foo..bar-master &&
+	test_must_fail git cherry-pick --rerere-autoupdate --rerere-autoupdate foo..bar-main &&
 	test_cmp foo-expect foo &&
 	git diff-files --quiet &&
 	git cherry-pick --abort &&
-	test_must_fail git cherry-pick --rerere-autoupdate --no-rerere-autoupdate --rerere-autoupdate foo..bar-master &&
+	test_must_fail git cherry-pick --rerere-autoupdate --no-rerere-autoupdate --rerere-autoupdate foo..bar-main &&
 	test_cmp foo-expect foo &&
 	git diff-files --quiet &&
 	git cherry-pick --abort &&
-	test_must_fail git cherry-pick --rerere-autoupdate --no-rerere-autoupdate foo..bar-master &&
+	test_must_fail git cherry-pick --rerere-autoupdate --no-rerere-autoupdate foo..bar-main &&
 	test_must_fail git diff-files --quiet &&
 	git cherry-pick --abort
 '
 
 test_expect_success 'cherry-pick conflict without rerere' '
 	test_config rerere.enabled false &&
-	test_must_fail git cherry-pick foo-master &&
+	test_must_fail git cherry-pick foo-main &&
 	grep ===== foo &&
 	grep foo-dev foo &&
-	grep foo-master foo
+	grep foo-main foo
 '
 
 test_done
diff --git a/t/t3505-cherry-pick-empty.sh b/t/t3505-cherry-pick-empty.sh
index 5f911bb529..07419a4e4a 100755
--- a/t/t3505-cherry-pick-empty.sh
+++ b/t/t3505-cherry-pick-empty.sh
@@ -17,7 +17,7 @@ test_expect_success setup '
 	test_tick &&
 	git commit --allow-empty-message -m "" &&
 
-	git checkout master &&
+	git checkout main &&
 	git checkout -b empty-change-branch &&
 	test_tick &&
 	git commit --allow-empty -m "empty"
@@ -25,7 +25,7 @@ test_expect_success setup '
 '
 
 test_expect_success 'cherry-pick an empty commit' '
-	git checkout master &&
+	git checkout main &&
 	test_expect_code 1 git cherry-pick empty-change-branch
 '
 
@@ -35,7 +35,7 @@ test_expect_success 'index lockfile was removed' '
 
 test_expect_success 'cherry-pick a commit with an empty message' '
 	test_when_finished "git reset --hard empty-message-branch~1" &&
-	git checkout master &&
+	git checkout main &&
 	git cherry-pick empty-message-branch
 '
 
@@ -44,12 +44,12 @@ test_expect_success 'index lockfile was removed' '
 '
 
 test_expect_success 'cherry-pick a commit with an empty message with --allow-empty-message' '
-	git checkout -f master &&
+	git checkout -f main &&
 	git cherry-pick --allow-empty-message empty-message-branch
 '
 
 test_expect_success 'cherry pick an empty non-ff commit without --allow-empty' '
-	git checkout master &&
+	git checkout main &&
 	echo fourth >>file2 &&
 	git add file2 &&
 	git commit -m "fourth" &&
@@ -57,22 +57,22 @@ test_expect_success 'cherry pick an empty non-ff commit without --allow-empty' '
 '
 
 test_expect_success 'cherry pick an empty non-ff commit with --allow-empty' '
-	git checkout master &&
+	git checkout main &&
 	git cherry-pick --allow-empty empty-change-branch
 '
 
 test_expect_success 'cherry pick with --keep-redundant-commits' '
-	git checkout master &&
+	git checkout main &&
 	git cherry-pick --keep-redundant-commits HEAD^
 '
 
 test_expect_success 'cherry-pick a commit that becomes no-op (prep)' '
-	git checkout master &&
+	git checkout main &&
 	git branch fork &&
 	echo foo >file2 &&
 	git add file2 &&
 	test_tick &&
-	git commit -m "add file2 on master" &&
+	git commit -m "add file2 on main" &&
 
 	git checkout fork &&
 	echo foo >file2 &&
@@ -84,15 +84,15 @@ test_expect_success 'cherry-pick a commit that becomes no-op (prep)' '
 test_expect_success 'cherry-pick a no-op without --keep-redundant' '
 	git reset --hard &&
 	git checkout fork^0 &&
-	test_must_fail git cherry-pick master
+	test_must_fail git cherry-pick main
 '
 
 test_expect_success 'cherry-pick a no-op with --keep-redundant' '
 	git reset --hard &&
 	git checkout fork^0 &&
-	git cherry-pick --keep-redundant-commits master &&
+	git cherry-pick --keep-redundant-commits main &&
 	git show -s --format=%s >actual &&
-	echo "add file2 on master" >expect &&
+	echo "add file2 on main" >expect &&
 	test_cmp expect actual
 '
 
diff --git a/t/t3506-cherry-pick-ff.sh b/t/t3506-cherry-pick-ff.sh
index 9d5adbc130..08b461dfcf 100755
--- a/t/t3506-cherry-pick-ff.sh
+++ b/t/t3506-cherry-pick-ff.sh
@@ -24,7 +24,7 @@ test_expect_success setup '
 '
 
 test_expect_success 'cherry-pick using --ff fast forwards' '
-	git checkout master &&
+	git checkout main &&
 	git reset --hard first &&
 	test_tick &&
 	git cherry-pick --ff second &&
@@ -32,7 +32,7 @@ test_expect_success 'cherry-pick using --ff fast forwards' '
 '
 
 test_expect_success 'cherry-pick not using --ff does not fast forwards' '
-	git checkout master &&
+	git checkout main &&
 	git reset --hard first &&
 	test_tick &&
 	git cherry-pick second &&
@@ -49,7 +49,7 @@ test_expect_success 'cherry-pick not using --ff does not fast forwards' '
 # (This has been taken from t3502-cherry-pick-merge.sh)
 #
 test_expect_success 'merge setup' '
-	git checkout master &&
+	git checkout main &&
 	git reset --hard first &&
 	echo new line >A &&
 	git add A &&
@@ -62,7 +62,7 @@ test_expect_success 'merge setup' '
 	test_tick &&
 	git commit -m "add line to B" B &&
 	git tag B &&
-	git checkout master &&
+	git checkout main &&
 	git merge side &&
 	git tag C &&
 	git checkout -b new A
diff --git a/t/t3507-cherry-pick-conflict.sh b/t/t3507-cherry-pick-conflict.sh
index a21adcf0e4..e0f77ba6ad 100755
--- a/t/t3507-cherry-pick-conflict.sh
+++ b/t/t3507-cherry-pick-conflict.sh
@@ -29,7 +29,7 @@ test_expect_success setup '
 	test_commit redundant-pick foo c redundant &&
 	git commit --allow-empty --allow-empty-message &&
 	git tag empty &&
-	git checkout master &&
+	git checkout main &&
 	git config advice.detachedhead false
 
 '
diff --git a/t/t3508-cherry-pick-many-commits.sh b/t/t3508-cherry-pick-many-commits.sh
index 23070a7b73..bdb995235f 100755
--- a/t/t3508-cherry-pick-many-commits.sh
+++ b/t/t3508-cherry-pick-many-commits.sh
@@ -31,7 +31,7 @@ test_expect_success setup '
 '
 
 test_expect_success 'cherry-pick first..fourth works' '
-	git checkout -f master &&
+	git checkout -f main &&
 	git reset --hard first &&
 	test_tick &&
 	git cherry-pick first..fourth &&
@@ -45,7 +45,7 @@ test_expect_success 'cherry-pick three one two works' '
 	test_commit one &&
 	test_commit two &&
 	test_commit three &&
-	git checkout -f master &&
+	git checkout -f main &&
 	git reset --hard first &&
 	git cherry-pick three one two &&
 	git diff --quiet three &&
@@ -56,28 +56,28 @@ two"
 '
 
 test_expect_success 'cherry-pick three one two: fails' '
-	git checkout -f master &&
+	git checkout -f main &&
 	git reset --hard first &&
 	test_must_fail git cherry-pick three one two:
 '
 
 test_expect_success 'output to keep user entertained during multi-pick' '
 	cat <<-\EOF >expected &&
-	[master OBJID] second
+	[main OBJID] second
 	 Author: A U Thor <author@example.com>
 	 Date: Thu Apr 7 15:14:13 2005 -0700
 	 1 file changed, 1 insertion(+)
-	[master OBJID] third
+	[main OBJID] third
 	 Author: A U Thor <author@example.com>
 	 Date: Thu Apr 7 15:15:13 2005 -0700
 	 1 file changed, 1 insertion(+)
-	[master OBJID] fourth
+	[main OBJID] fourth
 	 Author: A U Thor <author@example.com>
 	 Date: Thu Apr 7 15:16:13 2005 -0700
 	 1 file changed, 1 insertion(+)
 	EOF
 
-	git checkout -f master &&
+	git checkout -f main &&
 	git reset --hard first &&
 	test_tick &&
 	git cherry-pick first..fourth >actual &&
@@ -87,7 +87,7 @@ test_expect_success 'output to keep user entertained during multi-pick' '
 '
 
 test_expect_success 'cherry-pick --strategy resolve first..fourth works' '
-	git checkout -f master &&
+	git checkout -f main &&
 	git reset --hard first &&
 	test_tick &&
 	git cherry-pick --strategy resolve first..fourth &&
@@ -99,23 +99,23 @@ test_expect_success 'cherry-pick --strategy resolve first..fourth works' '
 test_expect_success 'output during multi-pick indicates merge strategy' '
 	cat <<-\EOF >expected &&
 	Trying simple merge.
-	[master OBJID] second
+	[main OBJID] second
 	 Author: A U Thor <author@example.com>
 	 Date: Thu Apr 7 15:14:13 2005 -0700
 	 1 file changed, 1 insertion(+)
 	Trying simple merge.
-	[master OBJID] third
+	[main OBJID] third
 	 Author: A U Thor <author@example.com>
 	 Date: Thu Apr 7 15:15:13 2005 -0700
 	 1 file changed, 1 insertion(+)
 	Trying simple merge.
-	[master OBJID] fourth
+	[main OBJID] fourth
 	 Author: A U Thor <author@example.com>
 	 Date: Thu Apr 7 15:16:13 2005 -0700
 	 1 file changed, 1 insertion(+)
 	EOF
 
-	git checkout -f master &&
+	git checkout -f main &&
 	git reset --hard first &&
 	test_tick &&
 	git cherry-pick --strategy resolve first..fourth >actual &&
@@ -124,7 +124,7 @@ test_expect_success 'output during multi-pick indicates merge strategy' '
 '
 
 test_expect_success 'cherry-pick --ff first..fourth works' '
-	git checkout -f master &&
+	git checkout -f main &&
 	git reset --hard first &&
 	test_tick &&
 	git cherry-pick --ff first..fourth &&
@@ -134,7 +134,7 @@ test_expect_success 'cherry-pick --ff first..fourth works' '
 '
 
 test_expect_success 'cherry-pick -n first..fourth works' '
-	git checkout -f master &&
+	git checkout -f main &&
 	git reset --hard first &&
 	test_tick &&
 	git cherry-pick -n first..fourth &&
@@ -144,7 +144,7 @@ test_expect_success 'cherry-pick -n first..fourth works' '
 '
 
 test_expect_success 'revert first..fourth works' '
-	git checkout -f master &&
+	git checkout -f main &&
 	git reset --hard fourth &&
 	test_tick &&
 	git revert first..fourth &&
@@ -154,7 +154,7 @@ test_expect_success 'revert first..fourth works' '
 '
 
 test_expect_success 'revert ^first fourth works' '
-	git checkout -f master &&
+	git checkout -f main &&
 	git reset --hard fourth &&
 	test_tick &&
 	git revert ^first fourth &&
@@ -164,7 +164,7 @@ test_expect_success 'revert ^first fourth works' '
 '
 
 test_expect_success 'revert fourth fourth~1 fourth~2 works' '
-	git checkout -f master &&
+	git checkout -f main &&
 	git reset --hard fourth &&
 	test_tick &&
 	git revert fourth fourth~1 fourth~2 &&
@@ -174,7 +174,7 @@ test_expect_success 'revert fourth fourth~1 fourth~2 works' '
 '
 
 test_expect_success 'cherry-pick -3 fourth works' '
-	git checkout -f master &&
+	git checkout -f main &&
 	git reset --hard first &&
 	test_tick &&
 	git cherry-pick -3 fourth &&
@@ -184,7 +184,7 @@ test_expect_success 'cherry-pick -3 fourth works' '
 '
 
 test_expect_success 'cherry-pick --stdin works' '
-	git checkout -f master &&
+	git checkout -f main &&
 	git reset --hard first &&
 	test_tick &&
 	git rev-list --reverse first..fourth | git cherry-pick --stdin &&
diff --git a/t/t3509-cherry-pick-merge-df.sh b/t/t3509-cherry-pick-merge-df.sh
index 1e5b3948df..dfc5e9f914 100755
--- a/t/t3509-cherry-pick-merge-df.sh
+++ b/t/t3509-cherry-pick-merge-df.sh
@@ -28,7 +28,7 @@ test_expect_success 'Setup rename across paths each below D/F conflicts' '
 
 test_expect_success 'Cherry-pick succeeds with rename across D/F conflicts' '
 	git reset --hard &&
-	git checkout master^0 &&
+	git checkout main^0 &&
 	git cherry-pick branch
 '
 
diff --git a/t/t3512-cherry-pick-submodule.sh b/t/t3512-cherry-pick-submodule.sh
index 6ece1d8573..ec09d7d8a8 100755
--- a/t/t3512-cherry-pick-submodule.sh
+++ b/t/t3512-cherry-pick-submodule.sh
@@ -35,7 +35,7 @@ test_expect_success 'unrelated submodule/file conflict is ignored' '
 		git add a_file &&
 		git commit -m "modify a file" &&
 
-		git checkout master &&
+		git checkout main &&
 
 		git submodule add ../sub sub &&
 		git submodule update sub &&
diff --git a/t/t3600-rm.sh b/t/t3600-rm.sh
index efec8d13b6..243087d9c6 100755
--- a/t/t3600-rm.sh
+++ b/t/t3600-rm.sh
@@ -483,16 +483,16 @@ test_expect_success 'setup submodule conflict' '
 	echo 1 >nitfol &&
 	git add nitfol &&
 	git commit -m "added nitfol 1" &&
-	git checkout -b branch2 master &&
+	git checkout -b branch2 main &&
 	echo 2 >nitfol &&
 	git add nitfol &&
 	git commit -m "added nitfol 2" &&
-	git checkout -b conflict1 master &&
+	git checkout -b conflict1 main &&
 	git -C submod fetch &&
 	git -C submod checkout branch1 &&
 	git add submod &&
 	git commit -m "submod 1" &&
-	git checkout -b conflict2 master &&
+	git checkout -b conflict2 main &&
 	git -C submod checkout branch2 &&
 	git add submod &&
 	git commit -m "submod 2"
@@ -604,7 +604,7 @@ test_expect_success 'rm of a conflicted unpopulated submodule succeeds' '
 '
 
 test_expect_success 'rm of a populated submodule with a .git directory migrates git dir' '
-	git checkout -f master &&
+	git checkout -f main &&
 	git reset --hard &&
 	git submodule update &&
 	(
@@ -717,7 +717,7 @@ test_expect_success 'checking out a commit after submodule removal needs manual
 	git checkout HEAD^ &&
 	git submodule update &&
 	git checkout -q HEAD^ &&
-	git checkout -q master 2>actual &&
+	git checkout -q main 2>actual &&
 	test_i18ngrep "^warning: unable to rmdir '\''submod'\'':" actual &&
 	git status -s submod >actual &&
 	echo "?? submod/" >expected &&
diff --git a/t/t3701-add-interactive.sh b/t/t3701-add-interactive.sh
index ca04fac417..4abaa9be02 100755
--- a/t/t3701-add-interactive.sh
+++ b/t/t3701-add-interactive.sh
@@ -549,8 +549,8 @@ test_expect_success 'patch mode ignores unmerged entries' '
 	test_commit non-conflict &&
 	git checkout -b side &&
 	test_commit side conflict.t &&
-	git checkout master &&
-	test_commit master conflict.t &&
+	git checkout main &&
+	test_commit main conflict.t &&
 	test_must_fail git merge side &&
 	echo changed >non-conflict.t &&
 	echo y | git add -p >output &&
diff --git a/t/t3901-i18n-patch.sh b/t/t3901-i18n-patch.sh
index 923eb01f0e..6a96959e06 100755
--- a/t/t3901-i18n-patch.sh
+++ b/t/t3901-i18n-patch.sh
@@ -45,7 +45,7 @@ test_expect_success setup '
 
 	# the first commit on the side branch is UTF-8
 	test_tick &&
-	git checkout -b side master^ &&
+	git checkout -b side main^ &&
 	echo Another file >yours &&
 	git add yours &&
 	git commit -s -m "Second on side" &&
@@ -69,7 +69,7 @@ test_expect_success setup '
 test_expect_success 'format-patch output (ISO-8859-1)' '
 	git config i18n.logoutputencoding ISO8859-1 &&
 
-	git format-patch --stdout master..HEAD^ >out-l1 &&
+	git format-patch --stdout main..HEAD^ >out-l1 &&
 	git format-patch --stdout HEAD^ >out-l2 &&
 	grep "^Content-Type: text/plain; charset=ISO8859-1" out-l1 &&
 	grep "^From: =?ISO8859-1?q?=C1=E9=ED=20=F3=FA?=" out-l1 &&
@@ -80,7 +80,7 @@ test_expect_success 'format-patch output (ISO-8859-1)' '
 test_expect_success 'format-patch output (UTF-8)' '
 	git config i18n.logoutputencoding UTF-8 &&
 
-	git format-patch --stdout master..HEAD^ >out-u1 &&
+	git format-patch --stdout main..HEAD^ >out-u1 &&
 	git format-patch --stdout HEAD^ >out-u2 &&
 	grep "^Content-Type: text/plain; charset=UTF-8" out-u1 &&
 	grep "^From: =?UTF-8?q?=C3=81=C3=A9=C3=AD=20=C3=B3=C3=BA?=" out-u1 &&
@@ -102,7 +102,7 @@ test_expect_success 'rebase (U/U)' '
 	# we want UTF-8 encoded name.
 	. "$TEST_DIRECTORY"/t3901/utf8.txt &&
 	git checkout -b test &&
-	git rebase master &&
+	git rebase main &&
 
 	check_encoding 2
 '
@@ -113,7 +113,7 @@ test_expect_success 'rebase (U/L)' '
 	. "$TEST_DIRECTORY"/t3901/utf8.txt &&
 
 	git reset --hard side &&
-	git rebase master &&
+	git rebase main &&
 
 	check_encoding 2
 '
@@ -125,7 +125,7 @@ test_expect_success !MINGW 'rebase (L/L)' '
 	. "$TEST_DIRECTORY"/t3901/8859-1.txt &&
 
 	git reset --hard side &&
-	git rebase master &&
+	git rebase main &&
 
 	check_encoding 2 8859
 '
@@ -138,7 +138,7 @@ test_expect_success !MINGW 'rebase (L/U)' '
 	. "$TEST_DIRECTORY"/t3901/8859-1.txt &&
 
 	git reset --hard side &&
-	git rebase master &&
+	git rebase main &&
 
 	check_encoding 2 8859
 '
@@ -150,7 +150,7 @@ test_expect_success 'cherry-pick(U/U)' '
 	git config i18n.logoutputencoding UTF-8 &&
 	. "$TEST_DIRECTORY"/t3901/utf8.txt &&
 
-	git reset --hard master &&
+	git reset --hard main &&
 	git cherry-pick side^ &&
 	git cherry-pick side &&
 	git revert HEAD &&
@@ -165,7 +165,7 @@ test_expect_success !MINGW 'cherry-pick(L/L)' '
 	git config i18n.logoutputencoding ISO8859-1 &&
 	. "$TEST_DIRECTORY"/t3901/8859-1.txt &&
 
-	git reset --hard master &&
+	git reset --hard main &&
 	git cherry-pick side^ &&
 	git cherry-pick side &&
 	git revert HEAD &&
@@ -180,7 +180,7 @@ test_expect_success 'cherry-pick(U/L)' '
 	git config i18n.logoutputencoding ISO8859-1 &&
 	. "$TEST_DIRECTORY"/t3901/utf8.txt &&
 
-	git reset --hard master &&
+	git reset --hard main &&
 	git cherry-pick side^ &&
 	git cherry-pick side &&
 	git revert HEAD &&
@@ -196,7 +196,7 @@ test_expect_success !MINGW 'cherry-pick(L/U)' '
 	git config i18n.logoutputencoding UTF-8 &&
 	. "$TEST_DIRECTORY"/t3901/8859-1.txt &&
 
-	git reset --hard master &&
+	git reset --hard main &&
 	git cherry-pick side^ &&
 	git cherry-pick side &&
 	git revert HEAD &&
@@ -210,7 +210,7 @@ test_expect_success 'rebase --merge (U/U)' '
 	. "$TEST_DIRECTORY"/t3901/utf8.txt &&
 
 	git reset --hard side &&
-	git rebase --merge master &&
+	git rebase --merge main &&
 
 	check_encoding 2
 '
@@ -221,7 +221,7 @@ test_expect_success 'rebase --merge (U/L)' '
 	. "$TEST_DIRECTORY"/t3901/utf8.txt &&
 
 	git reset --hard side &&
-	git rebase --merge master &&
+	git rebase --merge main &&
 
 	check_encoding 2
 '
@@ -233,7 +233,7 @@ test_expect_success 'rebase --merge (L/L)' '
 	. "$TEST_DIRECTORY"/t3901/8859-1.txt &&
 
 	git reset --hard side &&
-	git rebase --merge master &&
+	git rebase --merge main &&
 
 	check_encoding 2 8859
 '
@@ -246,7 +246,7 @@ test_expect_success 'rebase --merge (L/U)' '
 	. "$TEST_DIRECTORY"/t3901/8859-1.txt &&
 
 	git reset --hard side &&
-	git rebase --merge master &&
+	git rebase --merge main &&
 
 	check_encoding 2 8859
 '
@@ -256,7 +256,7 @@ test_expect_success 'am (U/U)' '
 	git config i18n.commitencoding UTF-8 &&
 	. "$TEST_DIRECTORY"/t3901/utf8.txt &&
 
-	git reset --hard master &&
+	git reset --hard main &&
 	git am out-u1 out-u2 &&
 
 	check_encoding 2
@@ -267,7 +267,7 @@ test_expect_success !MINGW 'am (L/L)' '
 	git config i18n.commitencoding ISO8859-1 &&
 	. "$TEST_DIRECTORY"/t3901/8859-1.txt &&
 
-	git reset --hard master &&
+	git reset --hard main &&
 	git am out-l1 out-l2 &&
 
 	check_encoding 2 8859
@@ -277,7 +277,7 @@ test_expect_success 'am (U/L)' '
 	# Apply ISO-8859-1 patches with UTF-8 commitencoding
 	git config i18n.commitencoding UTF-8 &&
 	. "$TEST_DIRECTORY"/t3901/utf8.txt &&
-	git reset --hard master &&
+	git reset --hard main &&
 
 	# am specifies --utf8 by default.
 	git am out-l1 out-l2 &&
@@ -290,7 +290,7 @@ test_expect_success 'am --no-utf8 (U/L)' '
 	git config i18n.commitencoding UTF-8 &&
 	. "$TEST_DIRECTORY"/t3901/utf8.txt &&
 
-	git reset --hard master &&
+	git reset --hard main &&
 	git am --no-utf8 out-l1 out-l2 2>err &&
 
 	# commit-tree will warn that the commit message does not contain valid UTF-8
@@ -305,7 +305,7 @@ test_expect_success !MINGW 'am (L/U)' '
 	git config i18n.commitencoding ISO8859-1 &&
 	. "$TEST_DIRECTORY"/t3901/8859-1.txt &&
 
-	git reset --hard master &&
+	git reset --hard main &&
 	# mailinfo will re-code the commit message to the charset specified by
 	# i18n.commitencoding
 	git am out-u1 out-u2 &&
diff --git a/t/t3903-stash.sh b/t/t3903-stash.sh
index 9f7ca98967..97374f393a 100755
--- a/t/t3903-stash.sh
+++ b/t/t3903-stash.sh
@@ -220,14 +220,14 @@ test_expect_success 'stash branch' '
 	git commit file -m second &&
 	git stash branch stashbranch &&
 	test refs/heads/stashbranch = $(git symbolic-ref HEAD) &&
-	test $(git rev-parse HEAD) = $(git rev-parse master^) &&
+	test $(git rev-parse HEAD) = $(git rev-parse main^) &&
 	git diff --cached >output &&
 	diff_cmp expect output &&
 	git diff >output &&
 	diff_cmp expect1 output &&
 	git add file &&
 	git commit -m alternate\ second &&
-	git diff master..stashbranch >output &&
+	git diff main..stashbranch >output &&
 	diff_cmp output expect2 &&
 	test 0 = $(git stash list | wc -l)
 '
@@ -520,7 +520,7 @@ test_expect_success 'stash branch - no stashes on stack, stash-like argument' '
 	STASH_ID=$(git stash create) &&
 	git reset --hard &&
 	git stash branch stash-branch ${STASH_ID} &&
-	test_when_finished "git reset --hard HEAD && git checkout master &&
+	test_when_finished "git reset --hard HEAD && git checkout main &&
 	git branch -D stash-branch" &&
 	test $(git ls-files --modified | wc -l) -eq 1
 '
@@ -536,7 +536,7 @@ test_expect_success 'stash branch - stashes on stack, stash-like argument' '
 	STASH_ID=$(git stash create) &&
 	git reset --hard &&
 	git stash branch stash-branch ${STASH_ID} &&
-	test_when_finished "git reset --hard HEAD && git checkout master &&
+	test_when_finished "git reset --hard HEAD && git checkout main &&
 	git branch -D stash-branch" &&
 	test $(git ls-files --modified | wc -l) -eq 1
 '
@@ -738,7 +738,7 @@ test_expect_success 'valid ref of the form "n", n < N' '
 	git stash &&
 	git stash show 0 &&
 	git stash branch tmp 0 &&
-	git checkout master &&
+	git checkout main &&
 	git stash &&
 	git stash apply 0 &&
 	git reset --hard &&
@@ -755,7 +755,7 @@ test_expect_success 'branch: do not drop the stash if the branch exists' '
 	git commit -m initial &&
 	echo bar >file &&
 	git stash &&
-	test_must_fail git stash branch master stash@{0} &&
+	test_must_fail git stash branch main stash@{0} &&
 	git rev-parse stash@{0} --
 '
 
@@ -768,7 +768,7 @@ test_expect_success 'branch: should not drop the stash if the apply fails' '
 	echo bar >file &&
 	git stash &&
 	echo baz >file &&
-	test_when_finished "git checkout master" &&
+	test_when_finished "git checkout main" &&
 	test_must_fail git stash branch new_branch stash@{0} &&
 	git rev-parse stash@{0} --
 '
@@ -902,7 +902,7 @@ test_expect_success 'push -m shows right message' '
 	>foo &&
 	git add foo &&
 	git stash push -m "test message" &&
-	echo "stash@{0}: On master: test message" >expect &&
+	echo "stash@{0}: On main: test message" >expect &&
 	git stash list -1 >actual &&
 	test_cmp expect actual
 '
@@ -911,7 +911,7 @@ test_expect_success 'push -m also works without space' '
 	>foo &&
 	git add foo &&
 	git stash push -m"unspaced test message" &&
-	echo "stash@{0}: On master: unspaced test message" >expect &&
+	echo "stash@{0}: On main: unspaced test message" >expect &&
 	git stash list -1 >actual &&
 	test_cmp expect actual
 '
@@ -968,7 +968,7 @@ test_expect_success 'push -mfoo uses right message' '
 	>foo &&
 	git add foo &&
 	git stash push -m"test mfoo" &&
-	echo "stash@{0}: On master: test mfoo" >expect &&
+	echo "stash@{0}: On main: test mfoo" >expect &&
 	git stash list -1 >actual &&
 	test_cmp expect actual
 '
@@ -977,7 +977,7 @@ test_expect_success 'push --message foo is synonym for -mfoo' '
 	>foo &&
 	git add foo &&
 	git stash push --message "test message foo" &&
-	echo "stash@{0}: On master: test message foo" >expect &&
+	echo "stash@{0}: On main: test message foo" >expect &&
 	git stash list -1 >actual &&
 	test_cmp expect actual
 '
@@ -986,7 +986,7 @@ test_expect_success 'push --message=foo is synonym for -mfoo' '
 	>foo &&
 	git add foo &&
 	git stash push --message="test message=foo" &&
-	echo "stash@{0}: On master: test message=foo" >expect &&
+	echo "stash@{0}: On main: test message=foo" >expect &&
 	git stash list -1 >actual &&
 	test_cmp expect actual
 '
@@ -995,7 +995,7 @@ test_expect_success 'push -m shows right message' '
 	>foo &&
 	git add foo &&
 	git stash push -m "test m foo" &&
-	echo "stash@{0}: On master: test m foo" >expect &&
+	echo "stash@{0}: On main: test m foo" >expect &&
 	git stash list -1 >actual &&
 	test_cmp expect actual
 '
@@ -1004,7 +1004,7 @@ test_expect_success 'create stores correct message' '
 	>foo &&
 	git add foo &&
 	STASH_ID=$(git stash create "create test message") &&
-	echo "On master: create test message" >expect &&
+	echo "On main: create test message" >expect &&
 	git show --pretty=%s -s ${STASH_ID} >actual &&
 	test_cmp expect actual
 '
@@ -1013,13 +1013,13 @@ test_expect_success 'create with multiple arguments for the message' '
 	>foo &&
 	git add foo &&
 	STASH_ID=$(git stash create test untracked) &&
-	echo "On master: test untracked" >expect &&
+	echo "On main: test untracked" >expect &&
 	git show --pretty=%s -s ${STASH_ID} >actual &&
 	test_cmp expect actual
 '
 
 test_expect_success 'create in a detached state' '
-	test_when_finished "git checkout master" &&
+	test_when_finished "git checkout main" &&
 	git checkout HEAD~1 &&
 	>foo &&
 	git add foo &&
diff --git a/t/t3910-mac-os-precompose.sh b/t/t3910-mac-os-precompose.sh
index 54ce19e353..7e03823537 100755
--- a/t/t3910-mac-os-precompose.sh
+++ b/t/t3910-mac-os-precompose.sh
@@ -151,7 +151,7 @@ test_expect_success "git checkout link nfd" '
 	git checkout l.$Odiarnfd
 '
 test_expect_success "setup case mac2" '
-	git checkout master &&
+	git checkout main &&
 	git reset --hard &&
 	git checkout -b mac_os_2
 '
@@ -163,7 +163,7 @@ test_expect_success "commit file d2.Adiarnfd/f.Adiarnfd" '
 	git commit -m "add d2.$Adiarnfd/f.$Adiarnfd" -- d2.$Adiarnfd/f.$Adiarnfd
 '
 test_expect_success "setup for long decomposed filename" '
-	git checkout master &&
+	git checkout main &&
 	git reset --hard &&
 	git checkout -b mac_os_long_nfd_fn
 '
@@ -173,7 +173,7 @@ test_expect_success "Add long decomposed filename" '
 	git commit -m "Long filename"
 '
 test_expect_success "setup for long precomposed filename" '
-	git checkout master &&
+	git checkout main &&
 	git reset --hard &&
 	git checkout -b mac_os_long_nfc_fn
 '
diff --git a/t/test-lib.sh b/t/test-lib.sh
index 4ae87a5c4e..76ab747b53 100644
--- a/t/test-lib.sh
+++ b/t/test-lib.sh
@@ -263,7 +263,7 @@ case "$TEST_NUMBER" in
 	GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
 	export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 	;;
-[0-2]*|3[0-4]*)
+[0-3]*)
 	GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 	export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 	;;
-- 
gitgitgadget


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH 08/28] t4*: adjust the references to the default branch name "main"
  2020-11-12 22:43 [PATCH 00/28] Use main as default branch name Johannes Schindelin via GitGitGadget
                   ` (6 preceding siblings ...)
  2020-11-12 22:43 ` [PATCH 07/28] t3[5-9]*: " Johannes Schindelin via GitGitGadget
@ 2020-11-12 22:43 ` Johannes Schindelin via GitGitGadget
  2020-11-12 22:43 ` [PATCH 09/28] t5323: prepare centered comment for `master` -> `main` Johannes Schindelin via GitGitGadget
                   ` (24 subsequent siblings)
  32 siblings, 0 replies; 163+ messages in thread
From: Johannes Schindelin via GitGitGadget @ 2020-11-12 22:43 UTC (permalink / raw)
  To: git; +Cc: Johannes Schindelin, Johannes Schindelin

From: Johannes Schindelin <johannes.schindelin@gmx.de>

Carefully excluding t4013, which sees independent development elsewhere
at the time of writing, we use `main` as the default branch name in t4*.
This trick was performed via

	$ (cd t &&
	   sed -i -e 's/master/main/g' -e 's/MASTER/MAIN/g' \
		-e 's/Master/Main/g' -- t4*.sh t4211/*.export &&
	   git checkout HEAD -- t4013\*)

This allows us to define `GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main`
for those tests.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
---
 t/t4014-format-patch.sh              | 176 +++++++++++++--------------
 t/t4015-diff-whitespace.sh           |   2 +-
 t/t4017-diff-retval.sh               |   2 +-
 t/t4038-diff-combined.sh             |  14 +--
 t/t4041-diff-submodule-option.sh     |   2 +-
 t/t4048-diff-combined-binary.sh      |  10 +-
 t/t4052-stat-output.sh               |   4 +-
 t/t4056-diff-order.sh                |   2 +-
 t/t4057-diff-combined-paths.sh       |  20 +--
 t/t4061-diff-indent.sh               |  24 ++--
 t/t4066-diff-emit-delay.sh           |   2 +-
 t/t4068-diff-symmetric-merge-base.sh |  48 ++++----
 t/t4103-apply-binary.sh              |  36 +++---
 t/t4108-apply-threeway.sh            |  14 +--
 t/t4121-apply-diffs.sh               |   2 +-
 t/t4122-apply-symlink-inside.sh      |   6 +-
 t/t4150-am.sh                        |  26 ++--
 t/t4200-rerere.sh                    |  20 +--
 t/t4201-shortlog.sh                  |   2 +-
 t/t4202-log.sh                       | 106 ++++++++--------
 t/t4203-mailmap.sh                   |   2 +-
 t/t4204-patch-id.sh                  |  26 ++--
 t/t4207-log-decoration-colors.sh     |   6 +-
 t/t4208-log-magic-pathspec.sh        |   4 +-
 t/t4211/history.export               |   2 +-
 t/t4214-log-graph-octopus.sh         |   2 +-
 t/t4216-log-bloom.sh                 |   4 +-
 t/t4253-am-keep-cr-dos.sh            |  20 +--
 t/t4257-am-interactive.sh            |   2 +-
 t/test-lib.sh                        |   4 +-
 30 files changed, 295 insertions(+), 295 deletions(-)

diff --git a/t/t4014-format-patch.sh b/t/t4014-format-patch.sh
index c5e5e0da3f..636d028b5d 100755
--- a/t/t4014-format-patch.sh
+++ b/t/t4014-format-patch.sh
@@ -32,11 +32,11 @@ test_expect_success setup '
 	test_tick &&
 	git commit -m "Side changes #3 with \\n backslash-n in it." &&
 
-	git checkout master &&
+	git checkout main &&
 	git diff-tree -p C2 >patch &&
 	git apply --index <patch &&
 	test_tick &&
-	git commit -m "Master accepts moral equivalent of #2" &&
+	git commit -m "Main accepts moral equivalent of #2" &&
 
 	git checkout side &&
 	git checkout -b patchid &&
@@ -56,39 +56,39 @@ test_expect_success setup '
 	test_tick &&
 	git commit -m "patchid 3" &&
 
-	git checkout master
+	git checkout main
 '
 
 test_expect_success 'format-patch --ignore-if-in-upstream' '
-	git format-patch --stdout master..side >patch0 &&
+	git format-patch --stdout main..side >patch0 &&
 	grep "^From " patch0 >from0 &&
 	test_line_count = 3 from0
 '
 
 test_expect_success 'format-patch --ignore-if-in-upstream' '
 	git format-patch --stdout \
-		--ignore-if-in-upstream master..side >patch1 &&
+		--ignore-if-in-upstream main..side >patch1 &&
 	grep "^From " patch1 >from1 &&
 	test_line_count = 2 from1
 '
 
 test_expect_success 'format-patch --ignore-if-in-upstream handles tags' '
 	git tag -a v1 -m tag side &&
-	git tag -a v2 -m tag master &&
+	git tag -a v2 -m tag main &&
 	git format-patch --stdout --ignore-if-in-upstream v2..v1 >patch1 &&
 	grep "^From " patch1 >from1 &&
 	test_line_count = 2 from1
 '
 
 test_expect_success "format-patch doesn't consider merge commits" '
-	git checkout -b feature master &&
+	git checkout -b feature main &&
 	echo "Another line" >>file &&
 	test_tick &&
 	git commit -am "Feature branch change #1" &&
 	echo "Yet another line" >>file &&
 	test_tick &&
 	git commit -am "Feature branch change #2" &&
-	git checkout -b merger master &&
+	git checkout -b merger main &&
 	test_tick &&
 	git merge --no-ff feature &&
 	git format-patch -3 --stdout >patch &&
@@ -97,16 +97,16 @@ test_expect_success "format-patch doesn't consider merge commits" '
 '
 
 test_expect_success 'format-patch result applies' '
-	git checkout -b rebuild-0 master &&
+	git checkout -b rebuild-0 main &&
 	git am -3 patch0 &&
-	git rev-list master.. >list &&
+	git rev-list main.. >list &&
 	test_line_count = 2 list
 '
 
 test_expect_success 'format-patch --ignore-if-in-upstream result applies' '
-	git checkout -b rebuild-1 master &&
+	git checkout -b rebuild-1 main &&
 	git am -3 patch1 &&
-	git rev-list master.. >list &&
+	git rev-list main.. >list &&
 	test_line_count = 2 list
 '
 
@@ -130,7 +130,7 @@ test_expect_success 'extra headers' '
 " &&
 	git config --add format.headers "Cc: S E Cipient <scipient@example.com>
 " &&
-	git format-patch --stdout master..side >patch2 &&
+	git format-patch --stdout main..side >patch2 &&
 	sed -e "/^\$/q" patch2 >hdrs2 &&
 	grep "^To: R E Cipient <rcipient@example.com>\$" hdrs2 &&
 	grep "^Cc: S E Cipient <scipient@example.com>\$" hdrs2
@@ -139,7 +139,7 @@ test_expect_success 'extra headers' '
 test_expect_success 'extra headers without newlines' '
 	git config --replace-all format.headers "To: R E Cipient <rcipient@example.com>" &&
 	git config --add format.headers "Cc: S E Cipient <scipient@example.com>" &&
-	git format-patch --stdout master..side >patch3 &&
+	git format-patch --stdout main..side >patch3 &&
 	sed -e "/^\$/q" patch3 >hdrs3 &&
 	grep "^To: R E Cipient <rcipient@example.com>\$" hdrs3 &&
 	grep "^Cc: S E Cipient <scipient@example.com>\$" hdrs3
@@ -148,7 +148,7 @@ test_expect_success 'extra headers without newlines' '
 test_expect_success 'extra headers with multiple To:s' '
 	git config --replace-all format.headers "To: R E Cipient <rcipient@example.com>" &&
 	git config --add format.headers "To: S E Cipient <scipient@example.com>" &&
-	git format-patch --stdout master..side >patch4 &&
+	git format-patch --stdout main..side >patch4 &&
 	sed -e "/^\$/q" patch4 >hdrs4 &&
 	grep "^To: R E Cipient <rcipient@example.com>,\$" hdrs4 &&
 	grep "^ *S E Cipient <scipient@example.com>\$" hdrs4
@@ -156,7 +156,7 @@ test_expect_success 'extra headers with multiple To:s' '
 
 test_expect_success 'additional command line cc (ascii)' '
 	git config --replace-all format.headers "Cc: R E Cipient <rcipient@example.com>" &&
-	git format-patch --cc="S E Cipient <scipient@example.com>" --stdout master..side >patch5 &&
+	git format-patch --cc="S E Cipient <scipient@example.com>" --stdout main..side >patch5 &&
 	sed -e "/^\$/q" patch5 >hdrs5 &&
 	grep "^Cc: R E Cipient <rcipient@example.com>,\$" hdrs5 &&
 	grep "^ *S E Cipient <scipient@example.com>\$" hdrs5
@@ -164,7 +164,7 @@ test_expect_success 'additional command line cc (ascii)' '
 
 test_expect_failure 'additional command line cc (rfc822)' '
 	git config --replace-all format.headers "Cc: R E Cipient <rcipient@example.com>" &&
-	git format-patch --cc="S. E. Cipient <scipient@example.com>" --stdout master..side >patch5 &&
+	git format-patch --cc="S. E. Cipient <scipient@example.com>" --stdout main..side >patch5 &&
 	sed -e "/^\$/q" patch5 >hdrs5 &&
 	grep "^Cc: R E Cipient <rcipient@example.com>,\$" hdrs5 &&
 	grep "^ *\"S. E. Cipient\" <scipient@example.com>\$" hdrs5
@@ -172,14 +172,14 @@ test_expect_failure 'additional command line cc (rfc822)' '
 
 test_expect_success 'command line headers' '
 	git config --unset-all format.headers &&
-	git format-patch --add-header="Cc: R E Cipient <rcipient@example.com>" --stdout master..side >patch6 &&
+	git format-patch --add-header="Cc: R E Cipient <rcipient@example.com>" --stdout main..side >patch6 &&
 	sed -e "/^\$/q" patch6 >hdrs6 &&
 	grep "^Cc: R E Cipient <rcipient@example.com>\$" hdrs6
 '
 
 test_expect_success 'configuration headers and command line headers' '
 	git config --replace-all format.headers "Cc: R E Cipient <rcipient@example.com>" &&
-	git format-patch --add-header="Cc: S E Cipient <scipient@example.com>" --stdout master..side >patch7 &&
+	git format-patch --add-header="Cc: S E Cipient <scipient@example.com>" --stdout main..side >patch7 &&
 	sed -e "/^\$/q" patch7 >hdrs7 &&
 	grep "^Cc: R E Cipient <rcipient@example.com>,\$" hdrs7 &&
 	grep "^ *S E Cipient <scipient@example.com>\$" hdrs7
@@ -187,40 +187,40 @@ test_expect_success 'configuration headers and command line headers' '
 
 test_expect_success 'command line To: header (ascii)' '
 	git config --unset-all format.headers &&
-	git format-patch --to="R E Cipient <rcipient@example.com>" --stdout master..side >patch8 &&
+	git format-patch --to="R E Cipient <rcipient@example.com>" --stdout main..side >patch8 &&
 	sed -e "/^\$/q" patch8 >hdrs8 &&
 	grep "^To: R E Cipient <rcipient@example.com>\$" hdrs8
 '
 
 test_expect_failure 'command line To: header (rfc822)' '
-	git format-patch --to="R. E. Cipient <rcipient@example.com>" --stdout master..side >patch8 &&
+	git format-patch --to="R. E. Cipient <rcipient@example.com>" --stdout main..side >patch8 &&
 	sed -e "/^\$/q" patch8 >hdrs8 &&
 	grep "^To: \"R. E. Cipient\" <rcipient@example.com>\$" hdrs8
 '
 
 test_expect_failure 'command line To: header (rfc2047)' '
-	git format-patch --to="R Ä Cipient <rcipient@example.com>" --stdout master..side >patch8 &&
+	git format-patch --to="R Ä Cipient <rcipient@example.com>" --stdout main..side >patch8 &&
 	sed -e "/^\$/q" patch8 >hdrs8 &&
 	grep "^To: =?UTF-8?q?R=20=C3=84=20Cipient?= <rcipient@example.com>\$" hdrs8
 '
 
 test_expect_success 'configuration To: header (ascii)' '
 	git config format.to "R E Cipient <rcipient@example.com>" &&
-	git format-patch --stdout master..side >patch9 &&
+	git format-patch --stdout main..side >patch9 &&
 	sed -e "/^\$/q" patch9 >hdrs9 &&
 	grep "^To: R E Cipient <rcipient@example.com>\$" hdrs9
 '
 
 test_expect_failure 'configuration To: header (rfc822)' '
 	git config format.to "R. E. Cipient <rcipient@example.com>" &&
-	git format-patch --stdout master..side >patch9 &&
+	git format-patch --stdout main..side >patch9 &&
 	sed -e "/^\$/q" patch9 >hdrs9 &&
 	grep "^To: \"R. E. Cipient\" <rcipient@example.com>\$" hdrs9
 '
 
 test_expect_failure 'configuration To: header (rfc2047)' '
 	git config format.to "R Ä Cipient <rcipient@example.com>" &&
-	git format-patch --stdout master..side >patch9 &&
+	git format-patch --stdout main..side >patch9 &&
 	sed -e "/^\$/q" patch9 >hdrs9 &&
 	grep "^To: =?UTF-8?q?R=20=C3=84=20Cipient?= <rcipient@example.com>\$" hdrs9
 '
@@ -234,35 +234,35 @@ check_patch () {
 }
 
 test_expect_success 'format.from=false' '
-	git -c format.from=false format-patch --stdout master..side >patch &&
+	git -c format.from=false format-patch --stdout main..side >patch &&
 	sed -e "/^\$/q" patch >hdrs &&
 	check_patch patch &&
 	! grep "^From: C O Mitter <committer@example.com>\$" hdrs
 '
 
 test_expect_success 'format.from=true' '
-	git -c format.from=true format-patch --stdout master..side >patch &&
+	git -c format.from=true format-patch --stdout main..side >patch &&
 	sed -e "/^\$/q" patch >hdrs &&
 	check_patch hdrs &&
 	grep "^From: C O Mitter <committer@example.com>\$" hdrs
 '
 
 test_expect_success 'format.from with address' '
-	git -c format.from="F R Om <from@example.com>" format-patch --stdout master..side >patch &&
+	git -c format.from="F R Om <from@example.com>" format-patch --stdout main..side >patch &&
 	sed -e "/^\$/q" patch >hdrs &&
 	check_patch hdrs &&
 	grep "^From: F R Om <from@example.com>\$" hdrs
 '
 
 test_expect_success '--no-from overrides format.from' '
-	git -c format.from="F R Om <from@example.com>" format-patch --no-from --stdout master..side >patch &&
+	git -c format.from="F R Om <from@example.com>" format-patch --no-from --stdout main..side >patch &&
 	sed -e "/^\$/q" patch >hdrs &&
 	check_patch hdrs &&
 	! grep "^From: F R Om <from@example.com>\$" hdrs
 '
 
 test_expect_success '--from overrides format.from' '
-	git -c format.from="F R Om <from@example.com>" format-patch --from --stdout master..side >patch &&
+	git -c format.from="F R Om <from@example.com>" format-patch --from --stdout main..side >patch &&
 	sed -e "/^\$/q" patch >hdrs &&
 	check_patch hdrs &&
 	! grep "^From: F R Om <from@example.com>\$" hdrs
@@ -271,7 +271,7 @@ test_expect_success '--from overrides format.from' '
 test_expect_success '--no-to overrides config.to' '
 	git config --replace-all format.to \
 		"R E Cipient <rcipient@example.com>" &&
-	git format-patch --no-to --stdout master..side >patch10 &&
+	git format-patch --no-to --stdout main..side >patch10 &&
 	sed -e "/^\$/q" patch10 >hdrs10 &&
 	check_patch hdrs10 &&
 	! grep "^To: R E Cipient <rcipient@example.com>\$" hdrs10
@@ -281,7 +281,7 @@ test_expect_success '--no-to and --to replaces config.to' '
 	git config --replace-all format.to \
 		"Someone <someone@out.there>" &&
 	git format-patch --no-to --to="Someone Else <else@out.there>" \
-		--stdout master..side >patch11 &&
+		--stdout main..side >patch11 &&
 	sed -e "/^\$/q" patch11 >hdrs11 &&
 	check_patch hdrs11 &&
 	! grep "^To: Someone <someone@out.there>\$" hdrs11 &&
@@ -291,7 +291,7 @@ test_expect_success '--no-to and --to replaces config.to' '
 test_expect_success '--no-cc overrides config.cc' '
 	git config --replace-all format.cc \
 		"C E Cipient <rcipient@example.com>" &&
-	git format-patch --no-cc --stdout master..side >patch12 &&
+	git format-patch --no-cc --stdout main..side >patch12 &&
 	sed -e "/^\$/q" patch12 >hdrs12 &&
 	check_patch hdrs12 &&
 	! grep "^Cc: C E Cipient <rcipient@example.com>\$" hdrs12
@@ -300,7 +300,7 @@ test_expect_success '--no-cc overrides config.cc' '
 test_expect_success '--no-add-header overrides config.headers' '
 	git config --replace-all format.headers \
 		"Header1: B E Cipient <rcipient@example.com>" &&
-	git format-patch --no-add-header --stdout master..side >patch13 &&
+	git format-patch --no-add-header --stdout main..side >patch13 &&
 	sed -e "/^\$/q" patch13 >hdrs13 &&
 	check_patch hdrs13 &&
 	! grep "^Header1: B E Cipient <rcipient@example.com>\$" hdrs13
@@ -309,7 +309,7 @@ test_expect_success '--no-add-header overrides config.headers' '
 test_expect_success 'multiple files' '
 	rm -rf patches/ &&
 	git checkout side &&
-	git format-patch -o patches/ master &&
+	git format-patch -o patches/ main &&
 	ls patches/0001-Side-changes-1.patch patches/0002-Side-changes-2.patch patches/0003-Side-changes-3-with-n-backslash-n-in-it.patch
 '
 
@@ -369,7 +369,7 @@ test_expect_success 'filename limit applies only to basename' '
 
 test_expect_success 'reroll count' '
 	rm -fr patches &&
-	git format-patch -o patches --cover-letter --reroll-count 4 master..side >list &&
+	git format-patch -o patches --cover-letter --reroll-count 4 main..side >list &&
 	! grep -v "^patches/v4-000[0-3]-" list &&
 	sed -n -e "/^Subject: /p" $(cat list) >subjects &&
 	! grep -v "^Subject: \[PATCH v4 [0-3]/3\] " subjects
@@ -377,7 +377,7 @@ test_expect_success 'reroll count' '
 
 test_expect_success 'reroll count (-v)' '
 	rm -fr patches &&
-	git format-patch -o patches --cover-letter -v4 master..side >list &&
+	git format-patch -o patches --cover-letter -v4 main..side >list &&
 	! grep -v "^patches/v4-000[0-3]-" list &&
 	sed -n -e "/^Subject: /p" $(cat list) >subjects &&
 	! grep -v "^Subject: \[PATCH v4 [0-3]/3\] " subjects
@@ -413,7 +413,7 @@ EOF
 
 test_expect_success 'no threading' '
 	git checkout side &&
-	check_threading expect.no-threading master
+	check_threading expect.no-threading main
 '
 
 cat >expect.thread <<EOF
@@ -430,7 +430,7 @@ References: <0>
 EOF
 
 test_expect_success 'thread' '
-	check_threading expect.thread --thread master
+	check_threading expect.thread --thread main
 '
 
 cat >expect.in-reply-to <<EOF
@@ -450,7 +450,7 @@ EOF
 
 test_expect_success 'thread in-reply-to' '
 	check_threading expect.in-reply-to --in-reply-to="<test.message>" \
-		--thread master
+		--thread main
 '
 
 cat >expect.cover-letter <<EOF
@@ -471,7 +471,7 @@ References: <0>
 EOF
 
 test_expect_success 'thread cover-letter' '
-	check_threading expect.cover-letter --cover-letter --thread master
+	check_threading expect.cover-letter --cover-letter --thread main
 '
 
 cat >expect.cl-irt <<EOF
@@ -498,12 +498,12 @@ EOF
 
 test_expect_success 'thread cover-letter in-reply-to' '
 	check_threading expect.cl-irt --cover-letter \
-		--in-reply-to="<test.message>" --thread master
+		--in-reply-to="<test.message>" --thread main
 '
 
 test_expect_success 'thread explicit shallow' '
 	check_threading expect.cl-irt --cover-letter \
-		--in-reply-to="<test.message>" --thread=shallow master
+		--in-reply-to="<test.message>" --thread=shallow main
 '
 
 cat >expect.deep <<EOF
@@ -521,7 +521,7 @@ References: <0>
 EOF
 
 test_expect_success 'thread deep' '
-	check_threading expect.deep --thread=deep master
+	check_threading expect.deep --thread=deep main
 '
 
 cat >expect.deep-irt <<EOF
@@ -544,7 +544,7 @@ EOF
 
 test_expect_success 'thread deep in-reply-to' '
 	check_threading expect.deep-irt  --thread=deep \
-		--in-reply-to="<test.message>" master
+		--in-reply-to="<test.message>" main
 '
 
 cat >expect.deep-cl <<EOF
@@ -568,7 +568,7 @@ References: <0>
 EOF
 
 test_expect_success 'thread deep cover-letter' '
-	check_threading expect.deep-cl --cover-letter --thread=deep master
+	check_threading expect.deep-cl --cover-letter --thread=deep main
 '
 
 cat >expect.deep-cl-irt <<EOF
@@ -598,27 +598,27 @@ EOF
 
 test_expect_success 'thread deep cover-letter in-reply-to' '
 	check_threading expect.deep-cl-irt --cover-letter \
-		--in-reply-to="<test.message>" --thread=deep master
+		--in-reply-to="<test.message>" --thread=deep main
 '
 
 test_expect_success 'thread via config' '
 	test_config format.thread true &&
-	check_threading expect.thread master
+	check_threading expect.thread main
 '
 
 test_expect_success 'thread deep via config' '
 	test_config format.thread deep &&
-	check_threading expect.deep master
+	check_threading expect.deep main
 '
 
 test_expect_success 'thread config + override' '
 	test_config format.thread deep &&
-	check_threading expect.thread --thread master
+	check_threading expect.thread --thread main
 '
 
 test_expect_success 'thread config + --no-thread' '
 	test_config format.thread deep &&
-	check_threading expect.no-threading --no-thread master
+	check_threading expect.no-threading --no-thread main
 '
 
 test_expect_success 'excessive subject' '
@@ -631,7 +631,7 @@ test_expect_success 'excessive subject' '
 	after=$(git rev-parse --short $after) &&
 	git update-index file &&
 	git commit -m "This is an excessively long subject line for a message due to the habit some projects have of not having a short, one-line subject at the start of the commit message, but rather sticking a whole paragraph right at the start as the only thing in the commit message. It had better not become the filename for the patch." &&
-	git format-patch -o patches/ master..side &&
+	git format-patch -o patches/ main..side &&
 	ls patches/0004-This-is-an-excessively-long-subject-line-for-a-messa.patch
 '
 
@@ -893,13 +893,13 @@ test_expect_success 'options no longer allowed for format-patch' '
 '
 
 test_expect_success 'format-patch --numstat should produce a patch' '
-	git format-patch --numstat --stdout master..side >output &&
+	git format-patch --numstat --stdout main..side >output &&
 	grep "^diff --git a/" output >diff &&
 	test_line_count = 5 diff
 '
 
 test_expect_success 'format-patch -- <path>' '
-	git format-patch master..side -- file 2>error &&
+	git format-patch main..side -- file 2>error &&
 	! grep "Use .--" error
 '
 
@@ -1673,9 +1673,9 @@ test_expect_success 'cover letter with invalid --cover-from-description and conf
 	test_config branch.rebuild-1.description "config subject
 
 body" &&
-	test_must_fail git format-patch --cover-letter --cover-from-description garbage master &&
+	test_must_fail git format-patch --cover-letter --cover-from-description garbage main &&
 	test_config format.coverFromDescription garbage &&
-	test_must_fail git format-patch --cover-letter master
+	test_must_fail git format-patch --cover-letter main
 '
 
 test_expect_success 'cover letter with format.coverFromDescription = default' '
@@ -1684,7 +1684,7 @@ test_expect_success 'cover letter with format.coverFromDescription = default' '
 body" &&
 	test_config format.coverFromDescription default &&
 	git checkout rebuild-1 &&
-	git format-patch --stdout --cover-letter master >actual &&
+	git format-patch --stdout --cover-letter main >actual &&
 	grep "^Subject: \[PATCH 0/2\] \*\*\* SUBJECT HERE \*\*\*$" actual &&
 	! grep "^\*\*\* BLURB HERE \*\*\*$" actual &&
 	grep "^config subject$" actual &&
@@ -1696,7 +1696,7 @@ test_expect_success 'cover letter with --cover-from-description default' '
 
 body" &&
 	git checkout rebuild-1 &&
-	git format-patch --stdout --cover-letter --cover-from-description default master >actual &&
+	git format-patch --stdout --cover-letter --cover-from-description default main >actual &&
 	grep "^Subject: \[PATCH 0/2\] \*\*\* SUBJECT HERE \*\*\*$" actual &&
 	! grep "^\*\*\* BLURB HERE \*\*\*$" actual &&
 	grep "^config subject$" actual &&
@@ -1709,7 +1709,7 @@ test_expect_success 'cover letter with format.coverFromDescription = none' '
 body" &&
 	test_config format.coverFromDescription none &&
 	git checkout rebuild-1 &&
-	git format-patch --stdout --cover-letter master >actual &&
+	git format-patch --stdout --cover-letter main >actual &&
 	grep "^Subject: \[PATCH 0/2\] \*\*\* SUBJECT HERE \*\*\*$" actual &&
 	grep "^\*\*\* BLURB HERE \*\*\*$" actual &&
 	! grep "^config subject$" actual &&
@@ -1721,7 +1721,7 @@ test_expect_success 'cover letter with --cover-from-description none' '
 
 body" &&
 	git checkout rebuild-1 &&
-	git format-patch --stdout --cover-letter --cover-from-description none master >actual &&
+	git format-patch --stdout --cover-letter --cover-from-description none main >actual &&
 	grep "^Subject: \[PATCH 0/2\] \*\*\* SUBJECT HERE \*\*\*$" actual &&
 	grep "^\*\*\* BLURB HERE \*\*\*$" actual &&
 	! grep "^config subject$" actual &&
@@ -1734,7 +1734,7 @@ test_expect_success 'cover letter with format.coverFromDescription = message' '
 body" &&
 	test_config format.coverFromDescription message &&
 	git checkout rebuild-1 &&
-	git format-patch --stdout --cover-letter master >actual &&
+	git format-patch --stdout --cover-letter main >actual &&
 	grep "^Subject: \[PATCH 0/2\] \*\*\* SUBJECT HERE \*\*\*$" actual &&
 	! grep "^\*\*\* BLURB HERE \*\*\*$" actual &&
 	grep "^config subject$" actual &&
@@ -1746,7 +1746,7 @@ test_expect_success 'cover letter with --cover-from-description message' '
 
 body" &&
 	git checkout rebuild-1 &&
-	git format-patch --stdout --cover-letter --cover-from-description message master >actual &&
+	git format-patch --stdout --cover-letter --cover-from-description message main >actual &&
 	grep "^Subject: \[PATCH 0/2\] \*\*\* SUBJECT HERE \*\*\*$" actual &&
 	! grep "^\*\*\* BLURB HERE \*\*\*$" actual &&
 	grep "^config subject$" actual &&
@@ -1759,7 +1759,7 @@ test_expect_success 'cover letter with format.coverFromDescription = subject' '
 body" &&
 	test_config format.coverFromDescription subject &&
 	git checkout rebuild-1 &&
-	git format-patch --stdout --cover-letter master >actual &&
+	git format-patch --stdout --cover-letter main >actual &&
 	grep "^Subject: \[PATCH 0/2\] config subject$" actual &&
 	! grep "^\*\*\* BLURB HERE \*\*\*$" actual &&
 	! grep "^config subject$" actual &&
@@ -1771,7 +1771,7 @@ test_expect_success 'cover letter with --cover-from-description subject' '
 
 body" &&
 	git checkout rebuild-1 &&
-	git format-patch --stdout --cover-letter --cover-from-description subject master >actual &&
+	git format-patch --stdout --cover-letter --cover-from-description subject main >actual &&
 	grep "^Subject: \[PATCH 0/2\] config subject$" actual &&
 	! grep "^\*\*\* BLURB HERE \*\*\*$" actual &&
 	! grep "^config subject$" actual &&
@@ -1784,7 +1784,7 @@ test_expect_success 'cover letter with format.coverFromDescription = auto (short
 body" &&
 	test_config format.coverFromDescription auto &&
 	git checkout rebuild-1 &&
-	git format-patch --stdout --cover-letter master >actual &&
+	git format-patch --stdout --cover-letter main >actual &&
 	grep "^Subject: \[PATCH 0/2\] config subject$" actual &&
 	! grep "^\*\*\* BLURB HERE \*\*\*$" actual &&
 	! grep "^config subject$" actual &&
@@ -1796,7 +1796,7 @@ test_expect_success 'cover letter with --cover-from-description auto (short subj
 
 body" &&
 	git checkout rebuild-1 &&
-	git format-patch --stdout --cover-letter --cover-from-description auto master >actual &&
+	git format-patch --stdout --cover-letter --cover-from-description auto main >actual &&
 	grep "^Subject: \[PATCH 0/2\] config subject$" actual &&
 	! grep "^\*\*\* BLURB HERE \*\*\*$" actual &&
 	! grep "^config subject$" actual &&
@@ -1809,7 +1809,7 @@ test_expect_success 'cover letter with format.coverFromDescription = auto (long
 body" &&
 	test_config format.coverFromDescription auto &&
 	git checkout rebuild-1 &&
-	git format-patch --stdout --cover-letter master >actual &&
+	git format-patch --stdout --cover-letter main >actual &&
 	grep "^Subject: \[PATCH 0/2\] \*\*\* SUBJECT HERE \*\*\*$" actual &&
 	! grep "^\*\*\* BLURB HERE \*\*\*$" actual &&
 	grep "^this is a really long first line and it is over 100 characters long which is the threshold for long subjects$" actual &&
@@ -1821,7 +1821,7 @@ test_expect_success 'cover letter with --cover-from-description auto (long subje
 
 body" &&
 	git checkout rebuild-1 &&
-	git format-patch --stdout --cover-letter --cover-from-description auto master >actual &&
+	git format-patch --stdout --cover-letter --cover-from-description auto main >actual &&
 	grep "^Subject: \[PATCH 0/2\] \*\*\* SUBJECT HERE \*\*\*$" actual &&
 	! grep "^\*\*\* BLURB HERE \*\*\*$" actual &&
 	grep "^this is a really long first line and it is over 100 characters long which is the threshold for long subjects$" actual &&
@@ -1834,7 +1834,7 @@ test_expect_success 'cover letter with command-line --cover-from-description ove
 body" &&
 	test_config format.coverFromDescription none &&
 	git checkout rebuild-1 &&
-	git format-patch --stdout --cover-letter --cover-from-description subject master >actual &&
+	git format-patch --stdout --cover-letter --cover-from-description subject main >actual &&
 	grep "^Subject: \[PATCH 0/2\] config subject$" actual &&
 	! grep "^\*\*\* BLURB HERE \*\*\*$" actual &&
 	! grep "^config subject$" actual &&
@@ -1844,7 +1844,7 @@ body" &&
 test_expect_success 'cover letter using branch description (1)' '
 	git checkout rebuild-1 &&
 	test_config branch.rebuild-1.description hello &&
-	git format-patch --stdout --cover-letter master >actual &&
+	git format-patch --stdout --cover-letter main >actual &&
 	grep hello actual
 '
 
@@ -1858,14 +1858,14 @@ test_expect_success 'cover letter using branch description (2)' '
 test_expect_success 'cover letter using branch description (3)' '
 	git checkout rebuild-1 &&
 	test_config branch.rebuild-1.description hello &&
-	git format-patch --stdout --cover-letter ^master rebuild-1 >actual &&
+	git format-patch --stdout --cover-letter ^main rebuild-1 >actual &&
 	grep hello actual
 '
 
 test_expect_success 'cover letter using branch description (4)' '
 	git checkout rebuild-1 &&
 	test_config branch.rebuild-1.description hello &&
-	git format-patch --stdout --cover-letter master.. >actual &&
+	git format-patch --stdout --cover-letter main.. >actual &&
 	grep hello actual
 '
 
@@ -1932,8 +1932,8 @@ test_expect_success 'From line has expected format' '
 
 test_expect_success 'format-patch -o with no leading directories' '
 	rm -fr patches &&
-	git format-patch -o patches master..side &&
-	count=$(git rev-list --count master..side) &&
+	git format-patch -o patches main..side &&
+	count=$(git rev-list --count main..side) &&
 	ls patches >list &&
 	test_line_count = $count list
 '
@@ -1941,16 +1941,16 @@ test_expect_success 'format-patch -o with no leading directories' '
 test_expect_success 'format-patch -o with leading existing directories' '
 	rm -rf existing-dir &&
 	mkdir existing-dir &&
-	git format-patch -o existing-dir/patches master..side &&
-	count=$(git rev-list --count master..side) &&
+	git format-patch -o existing-dir/patches main..side &&
+	count=$(git rev-list --count main..side) &&
 	ls existing-dir/patches >list &&
 	test_line_count = $count list
 '
 
 test_expect_success 'format-patch -o with leading non-existing directories' '
 	rm -rf non-existing-dir &&
-	git format-patch -o non-existing-dir/patches master..side &&
-	count=$(git rev-list --count master..side) &&
+	git format-patch -o non-existing-dir/patches main..side &&
+	count=$(git rev-list --count main..side) &&
 	test_path_is_dir non-existing-dir &&
 	ls non-existing-dir/patches >list &&
 	test_line_count = $count list
@@ -1959,8 +1959,8 @@ test_expect_success 'format-patch -o with leading non-existing directories' '
 test_expect_success 'format-patch format.outputDirectory option' '
 	test_config format.outputDirectory patches &&
 	rm -fr patches &&
-	git format-patch master..side &&
-	count=$(git rev-list --count master..side) &&
+	git format-patch main..side &&
+	count=$(git rev-list --count main..side) &&
 	ls patches >list &&
 	test_line_count = $count list
 '
@@ -1968,7 +1968,7 @@ test_expect_success 'format-patch format.outputDirectory option' '
 test_expect_success 'format-patch -o overrides format.outputDirectory' '
 	test_config format.outputDirectory patches &&
 	rm -fr patches patchset &&
-	git format-patch master..side -o patchset &&
+	git format-patch main..side -o patchset &&
 	test_path_is_missing patches &&
 	test_path_is_dir patchset
 '
@@ -2065,14 +2065,14 @@ test_expect_success 'format-patch --base errors out when base commit is not ance
 	#	  ------------W
 	#
 	# If "format-patch Z..X" is given, P and Z can not be specified as the base commit
-	git checkout -b topic1 master &&
+	git checkout -b topic1 main &&
 	git rev-parse HEAD >commit-id-base &&
 	test_commit P &&
 	git rev-parse HEAD >commit-id-P &&
 	test_commit Z &&
 	git rev-parse HEAD >commit-id-Z &&
 	test_commit Y &&
-	git checkout -b topic2 master &&
+	git checkout -b topic2 main &&
 	test_commit W &&
 	git merge topic1 &&
 	test_commit X &&
@@ -2085,7 +2085,7 @@ test_expect_success 'format-patch --base errors out when base commit is not ance
 '
 
 test_expect_success 'format-patch --base=auto' '
-	git checkout -b upstream master &&
+	git checkout -b upstream main &&
 	git checkout -b local upstream &&
 	git branch --set-upstream-to=upstream &&
 	test_commit N1 &&
@@ -2106,11 +2106,11 @@ test_expect_success 'format-patch errors out when history involves criss-cross'
 	#  \ / \
 	#   C---M2---E
 	#
-	git checkout master &&
+	git checkout main &&
 	test_commit A &&
-	git checkout -b xb master &&
+	git checkout -b xb main &&
 	test_commit B &&
-	git checkout -b xc master &&
+	git checkout -b xc main &&
 	test_commit C &&
 	git checkout -b xbc xb -- &&
 	git merge xc &&
@@ -2230,7 +2230,7 @@ test_expect_success 'format-patch --pretty=mboxrd' '
 '
 
 test_expect_success 'interdiff: setup' '
-	git checkout -b boop master &&
+	git checkout -b boop main &&
 	test_commit fnorp blorp &&
 	test_commit fleep blorp
 '
diff --git a/t/t4015-diff-whitespace.sh b/t/t4015-diff-whitespace.sh
index 8bdaa0a693..899fad379e 100755
--- a/t/t4015-diff-whitespace.sh
+++ b/t/t4015-diff-whitespace.sh
@@ -883,7 +883,7 @@ test_expect_success 'combined diff with autocrlf conversion' '
 	echo >x goodbye &&
 	git commit -m "the other side" x &&
 	git config core.autocrlf true &&
-	test_must_fail git merge master &&
+	test_must_fail git merge main &&
 
 	git diff >actual.raw &&
 	sed -e "1,/^@@@/d" actual.raw >actual &&
diff --git a/t/t4017-diff-retval.sh b/t/t4017-diff-retval.sh
index 95a7ca7070..484d847749 100755
--- a/t/t4017-diff-retval.sh
+++ b/t/t4017-diff-retval.sh
@@ -111,7 +111,7 @@ test_expect_success 'check detects leftover conflict markers' '
 	git checkout HEAD^ &&
 	echo binary >>b &&
 	git commit -m "side" b &&
-	test_must_fail git merge master &&
+	test_must_fail git merge main &&
 	git add b &&
 	test_expect_code 2 git --no-pager diff --cached --check >test.out &&
 	test 3 = $(grep "conflict marker" test.out | wc -l) &&
diff --git a/t/t4038-diff-combined.sh b/t/t4038-diff-combined.sh
index 94680836ce..5eb36907c1 100755
--- a/t/t4038-diff-combined.sh
+++ b/t/t4038-diff-combined.sh
@@ -115,7 +115,7 @@ test_expect_success 'check --cc --raw with forty trees' '
 '
 
 test_expect_success 'setup combined ignore spaces' '
-	git checkout master &&
+	git checkout main &&
 	>test &&
 	git add test &&
 	git commit -m initial &&
@@ -143,7 +143,7 @@ test_expect_success 'setup combined ignore spaces' '
 	EOF
 	git commit -m "test other space changes" -a &&
 
-	test_must_fail git merge master &&
+	test_must_fail git merge main &&
 	tr -d Q <<-\EOF >test &&
 	eol spaces Q
 	space  change
@@ -404,7 +404,7 @@ test_expect_success 'combine diff missing delete bug' '
 test_expect_success 'combine diff gets tree sorting right' '
 	# create a directory and a file that sort differently in trees
 	# versus byte-wise (implied "/" sorts after ".")
-	git checkout -f master &&
+	git checkout -f main &&
 	mkdir foo &&
 	echo base >foo/one &&
 	echo base >foo/two &&
@@ -414,9 +414,9 @@ test_expect_success 'combine diff gets tree sorting right' '
 
 	# one side modifies a file in the directory, along with the root
 	# file...
-	echo master >foo/one &&
-	echo master >foo.ext &&
-	git commit -a -m master &&
+	echo main >foo/one &&
+	echo main >foo.ext &&
+	git commit -a -m main &&
 
 	# the other side modifies the other file in the directory
 	git checkout -b other HEAD^ &&
@@ -426,7 +426,7 @@ test_expect_success 'combine diff gets tree sorting right' '
 	# And now we merge. The files in the subdirectory will resolve cleanly,
 	# meaning that a combined diff will not find them interesting. But it
 	# will find the tree itself interesting, because it had to be merged.
-	git checkout master &&
+	git checkout main &&
 	git merge other &&
 
 	printf "MM\tfoo\n" >expect &&
diff --git a/t/t4041-diff-submodule-option.sh b/t/t4041-diff-submodule-option.sh
index f852136585..23701e0e8a 100755
--- a/t/t4041-diff-submodule-option.sh
+++ b/t/t4041-diff-submodule-option.sh
@@ -538,7 +538,7 @@ test_expect_success 'diff --submodule with objects referenced by alternates' '
 	(cd super &&
 		(cd sub &&
 			git fetch &&
-			git checkout origin/master
+			git checkout origin/main
 		) &&
 		git diff --submodule > ../actual
 	) &&
diff --git a/t/t4048-diff-combined-binary.sh b/t/t4048-diff-combined-binary.sh
index 7f9ad9fa3d..f23824c2b6 100755
--- a/t/t4048-diff-combined-binary.sh
+++ b/t/t4048-diff-combined-binary.sh
@@ -14,7 +14,7 @@ test_expect_success 'setup binary merge conflict' '
 	echo threeQ3 | q_to_nul >binary &&
 	git commit -a -m three &&
 	three=$(git rev-parse --short HEAD:binary) &&
-	test_must_fail git merge master &&
+	test_must_fail git merge main &&
 	echo resolvedQhooray | q_to_nul >binary &&
 	git commit -a -m resolved &&
 	res=$(git rev-parse --short HEAD:binary)
@@ -62,14 +62,14 @@ test_expect_success 'diff --cc indicates binary-ness' '
 '
 
 test_expect_success 'setup non-binary with binary attribute' '
-	git checkout master &&
+	git checkout main &&
 	test_commit one text &&
 	test_commit two text &&
 	two=$(git rev-parse --short HEAD:text) &&
 	git checkout -b branch-text HEAD^ &&
 	test_commit three text &&
 	three=$(git rev-parse --short HEAD:text) &&
-	test_must_fail git merge master &&
+	test_must_fail git merge main &&
 	test_commit resolved text &&
 	res=$(git rev-parse --short HEAD:text) &&
 	echo text -diff >.gitattributes
@@ -206,11 +206,11 @@ index $three,$two..0000000
  +THREE
 ++=======
 + TWO
-++>>>>>>> MASTER
+++>>>>>>> MAIN
 EOF
 test_expect_success 'diff --cc respects textconv on worktree file' '
 	git reset --hard HEAD^ &&
-	test_must_fail git merge master &&
+	test_must_fail git merge main &&
 	git diff >actual &&
 	test_cmp expect actual
 '
diff --git a/t/t4052-stat-output.sh b/t/t4052-stat-output.sh
index 28c053849a..e747a26cbd 100755
--- a/t/t4052-stat-output.sh
+++ b/t/t4052-stat-output.sh
@@ -353,7 +353,7 @@ cat >expect <<'EOF'
 EOF
 test_expect_success 'merge --stat respects COLUMNS (big change)' '
 	git checkout -b branch HEAD^^ &&
-	COLUMNS=100 git merge --stat --no-ff master^ >output &&
+	COLUMNS=100 git merge --stat --no-ff main^ >output &&
 	grep " | " output >actual &&
 	test_cmp expect actual
 '
@@ -362,7 +362,7 @@ cat >expect <<'EOF'
  aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa | 1000 +++++++++++++++++++++++++++++++++++++++
 EOF
 test_expect_success 'merge --stat respects COLUMNS (long filename)' '
-	COLUMNS=100 git merge --stat --no-ff master >output &&
+	COLUMNS=100 git merge --stat --no-ff main >output &&
 	grep " | " output >actual &&
 	test_cmp expect actual
 '
diff --git a/t/t4056-diff-order.sh b/t/t4056-diff-order.sh
index 43dd474a12..07fcee31f4 100755
--- a/t/t4056-diff-order.sh
+++ b/t/t4056-diff-order.sh
@@ -106,7 +106,7 @@ done
 test_expect_success 'setup for testing combine-diff order' '
 	git checkout -b tmp HEAD~ &&
 	create_files 3 &&
-	git checkout master &&
+	git checkout main &&
 	git merge --no-commit -s ours tmp &&
 	create_files 5
 '
diff --git a/t/t4057-diff-combined-paths.sh b/t/t4057-diff-combined-paths.sh
index 0b78573733..918b86fb63 100755
--- a/t/t4057-diff-combined-paths.sh
+++ b/t/t4057-diff-combined-paths.sh
@@ -24,9 +24,9 @@ test_expect_success 'trivial merge - combine-diff empty' '
 		echo $i/2 >>$i.txt
 	done &&
 	git commit -a -m "side 2-9" &&
-	git checkout master &&
+	git checkout main &&
 	echo 1/2 >1.txt &&
-	git commit -a -m "master 1" &&
+	git commit -a -m "main 1" &&
 	git merge side &&
 	>diffc.expect &&
 	diffc_verify
@@ -41,19 +41,19 @@ test_expect_success 'only one truly conflicting path' '
 	done &&
 	echo "4side" >>4.txt &&
 	git commit -a -m "side 2-9 +4" &&
-	git checkout master &&
+	git checkout main &&
 	for i in $(test_seq 1 9)
 	do
 		echo $i/3 >>$i.txt
 	done &&
-	echo "4master" >>4.txt &&
-	git commit -a -m "master 1-9 +4" &&
+	echo "4main" >>4.txt &&
+	git commit -a -m "main 1-9 +4" &&
 	test_must_fail git merge side &&
 	cat <<-\EOF >4.txt &&
 	4
 	4/2
 	4/3
-	4master
+	4main
 	4side
 	EOF
 	git add 4.txt &&
@@ -69,12 +69,12 @@ test_expect_success 'merge introduces new file' '
 		echo $i/4 >>$i.txt
 	done &&
 	git commit -a -m "side 5-9" &&
-	git checkout master &&
+	git checkout main &&
 	for i in $(test_seq 1 3)
 	do
 		echo $i/4 >>$i.txt
 	done &&
-	git commit -a -m "master 1-3 +4hello" &&
+	git commit -a -m "main 1-3 +4hello" &&
 	git merge side &&
 	echo "Hello World" >4hello.txt &&
 	git add 4hello.txt &&
@@ -90,12 +90,12 @@ test_expect_success 'merge removed a file' '
 		echo $i/5 >>$i.txt
 	done &&
 	git commit -a -m "side 5-9" &&
-	git checkout master &&
+	git checkout main &&
 	for i in $(test_seq 1 3)
 	do
 		echo $i/4 >>$i.txt
 	done &&
-	git commit -a -m "master 1-3" &&
+	git commit -a -m "main 1-3" &&
 	git merge side &&
 	git rm 4.txt &&
 	git commit --amend &&
diff --git a/t/t4061-diff-indent.sh b/t/t4061-diff-indent.sh
index 0f7a6d97a8..5efdc34d51 100755
--- a/t/t4061-diff-indent.sh
+++ b/t/t4061-diff-indent.sh
@@ -266,7 +266,7 @@ test_expect_success 'diff-index: nice spaces with --indent-heuristic' '
 	git reset --soft HEAD~ &&
 	git diff-index --indent-heuristic -p old -- spaces.txt >out-diff-index-compacted &&
 	compare_diff spaces-compacted-expect out-diff-index-compacted &&
-	git checkout -f master
+	git checkout -f main
 '
 
 test_expect_success 'diff-index: nice spaces with diff.indentHeuristic=true' '
@@ -274,7 +274,7 @@ test_expect_success 'diff-index: nice spaces with diff.indentHeuristic=true' '
 	git reset --soft HEAD~ &&
 	git -c diff.indentHeuristic=true diff-index -p old -- spaces.txt >out-diff-index-compacted2 &&
 	compare_diff spaces-compacted-expect out-diff-index-compacted2 &&
-	git checkout -f master
+	git checkout -f main
 '
 
 test_expect_success 'diff-index: ugly spaces with --no-indent-heuristic' '
@@ -282,7 +282,7 @@ test_expect_success 'diff-index: ugly spaces with --no-indent-heuristic' '
 	git reset --soft HEAD~ &&
 	git diff-index --no-indent-heuristic -p old -- spaces.txt >out-diff-index &&
 	compare_diff spaces-expect out-diff-index &&
-	git checkout -f master
+	git checkout -f main
 '
 
 test_expect_success 'diff-index: ugly spaces with diff.indentHeuristic=false' '
@@ -290,7 +290,7 @@ test_expect_success 'diff-index: ugly spaces with diff.indentHeuristic=false' '
 	git reset --soft HEAD~ &&
 	git -c diff.indentHeuristic=false diff-index -p old -- spaces.txt >out-diff-index2 &&
 	compare_diff spaces-expect out-diff-index2 &&
-	git checkout -f master
+	git checkout -f main
 '
 
 test_expect_success 'diff-index: --indent-heuristic overrides config' '
@@ -298,7 +298,7 @@ test_expect_success 'diff-index: --indent-heuristic overrides config' '
 	git reset --soft HEAD~ &&
 	git -c diff.indentHeuristic=false diff-index --indent-heuristic -p old -- spaces.txt >out-diff-index-compacted3 &&
 	compare_diff spaces-compacted-expect out-diff-index-compacted3 &&
-	git checkout -f master
+	git checkout -f main
 '
 
 test_expect_success 'diff-index: --no-indent-heuristic overrides config' '
@@ -306,7 +306,7 @@ test_expect_success 'diff-index: --no-indent-heuristic overrides config' '
 	git reset --soft HEAD~ &&
 	git -c diff.indentHeuristic=true diff-index --no-indent-heuristic -p old -- spaces.txt >out-diff-index3 &&
 	compare_diff spaces-expect out-diff-index3 &&
-	git checkout -f master
+	git checkout -f main
 '
 
 # --- diff-files tests ----------------------------------------------------
@@ -317,7 +317,7 @@ test_expect_success 'diff-files: nice spaces with --indent-heuristic' '
 	git diff-files --indent-heuristic -p spaces.txt >out-diff-files-raw &&
 	grep -v index out-diff-files-raw >out-diff-files-compacted &&
 	compare_diff spaces-compacted-expect out-diff-files-compacted &&
-	git checkout -f master
+	git checkout -f main
 '
 
 test_expect_success 'diff-files: nice spaces with diff.indentHeuristic=true' '
@@ -326,7 +326,7 @@ test_expect_success 'diff-files: nice spaces with diff.indentHeuristic=true' '
 	git -c diff.indentHeuristic=true diff-files -p spaces.txt >out-diff-files-raw2 &&
 	grep -v index out-diff-files-raw2 >out-diff-files-compacted2 &&
 	compare_diff spaces-compacted-expect out-diff-files-compacted2 &&
-	git checkout -f master
+	git checkout -f main
 '
 
 test_expect_success 'diff-files: ugly spaces with --no-indent-heuristic' '
@@ -335,7 +335,7 @@ test_expect_success 'diff-files: ugly spaces with --no-indent-heuristic' '
 	git diff-files --no-indent-heuristic -p spaces.txt >out-diff-files-raw &&
 	grep -v index out-diff-files-raw >out-diff-files &&
 	compare_diff spaces-expect out-diff-files &&
-	git checkout -f master
+	git checkout -f main
 '
 
 test_expect_success 'diff-files: ugly spaces with diff.indentHeuristic=false' '
@@ -344,7 +344,7 @@ test_expect_success 'diff-files: ugly spaces with diff.indentHeuristic=false' '
 	git -c diff.indentHeuristic=false diff-files -p spaces.txt >out-diff-files-raw2 &&
 	grep -v index out-diff-files-raw2 >out-diff-files &&
 	compare_diff spaces-expect out-diff-files &&
-	git checkout -f master
+	git checkout -f main
 '
 
 test_expect_success 'diff-files: --indent-heuristic overrides config' '
@@ -353,7 +353,7 @@ test_expect_success 'diff-files: --indent-heuristic overrides config' '
 	git -c diff.indentHeuristic=false diff-files --indent-heuristic -p spaces.txt >out-diff-files-raw3 &&
 	grep -v index out-diff-files-raw3 >out-diff-files-compacted &&
 	compare_diff spaces-compacted-expect out-diff-files-compacted &&
-	git checkout -f master
+	git checkout -f main
 '
 
 test_expect_success 'diff-files: --no-indent-heuristic overrides config' '
@@ -362,7 +362,7 @@ test_expect_success 'diff-files: --no-indent-heuristic overrides config' '
 	git -c diff.indentHeuristic=true diff-files --no-indent-heuristic -p spaces.txt >out-diff-files-raw4 &&
 	grep -v index out-diff-files-raw4 >out-diff-files &&
 	compare_diff spaces-expect out-diff-files &&
-	git checkout -f master
+	git checkout -f main
 '
 
 test_done
diff --git a/t/t4066-diff-emit-delay.sh b/t/t4066-diff-emit-delay.sh
index 6331f63b12..fcd54fa3eb 100755
--- a/t/t4066-diff-emit-delay.sh
+++ b/t/t4066-diff-emit-delay.sh
@@ -13,7 +13,7 @@ test_expect_success 'set up history with a merge' '
 	test_commit B &&
 	git checkout -b side HEAD^ &&
 	test_commit C &&
-	git merge -m M master &&
+	git merge -m M main &&
 	test_commit D
 '
 
diff --git a/t/t4068-diff-symmetric-merge-base.sh b/t/t4068-diff-symmetric-merge-base.sh
index 03487cc945..ccd4da4fe9 100755
--- a/t/t4068-diff-symmetric-merge-base.sh
+++ b/t/t4068-diff-symmetric-merge-base.sh
@@ -6,10 +6,10 @@ test_description='behavior of diff with symmetric-diff setups and --merge-base'
 
 # build these situations:
 #  - normal merge with one merge base (br1...b2r);
-#  - criss-cross merge ie 2 merge bases (br1...master);
-#  - disjoint subgraph (orphan branch, br3...master).
+#  - criss-cross merge ie 2 merge bases (br1...main);
+#  - disjoint subgraph (orphan branch, br3...main).
 #
-#     B---E   <-- master
+#     B---E   <-- main
 #    / \ /
 #   A   X
 #    \ / \
@@ -32,9 +32,9 @@ test_expect_success setup '
 	git add c &&
 	git commit -m C &&
 	git tag commit-C &&
-	git merge -m D master &&
+	git merge -m D main &&
 	git tag commit-D &&
-	git checkout master &&
+	git checkout main &&
 	git merge -m E commit-C &&
 	git checkout -b br2 commit-C &&
 	echo f >f &&
@@ -58,7 +58,7 @@ test_expect_success 'diff with one merge base' '
 # It should have one of those two, which comes out
 # to seven lines.
 test_expect_success 'diff with two merge bases' '
-	git diff br1...master >tmp 2>err &&
+	git diff br1...main >tmp 2>err &&
 	test_line_count = 7 tmp &&
 	test_line_count = 1 err
 '
@@ -69,22 +69,22 @@ test_expect_success 'diff with no merge bases' '
 '
 
 test_expect_success 'diff with too many symmetric differences' '
-	test_must_fail git diff br1...master br2...br3 2>err &&
+	test_must_fail git diff br1...main br2...br3 2>err &&
 	test_i18ngrep "usage" err
 '
 
 test_expect_success 'diff with symmetric difference and extraneous arg' '
-	test_must_fail git diff master br1...master 2>err &&
+	test_must_fail git diff main br1...main 2>err &&
 	test_i18ngrep "usage" err
 '
 
 test_expect_success 'diff with two ranges' '
-	test_must_fail git diff master br1..master br2..br3 2>err &&
+	test_must_fail git diff main br1..main br2..br3 2>err &&
 	test_i18ngrep "usage" err
 '
 
 test_expect_success 'diff with ranges and extra arg' '
-	test_must_fail git diff master br1..master commit-D 2>err &&
+	test_must_fail git diff main br1..main commit-D 2>err &&
 	test_i18ngrep "usage" err
 '
 
@@ -93,21 +93,21 @@ test_expect_success 'diff --merge-base with no commits' '
 '
 
 test_expect_success 'diff --merge-base with three commits' '
-	test_must_fail git diff --merge-base br1 br2 master 2>err &&
+	test_must_fail git diff --merge-base br1 br2 main 2>err &&
 	test_i18ngrep "usage" err
 '
 
 for cmd in diff-index diff
 do
 	test_expect_success "$cmd --merge-base with one commit" '
-		git checkout master &&
+		git checkout main &&
 		git $cmd commit-C >expect &&
 		git $cmd --merge-base br2 >actual &&
 		test_cmp expect actual
 	'
 
 	test_expect_success "$cmd --merge-base with one commit and unstaged changes" '
-		git checkout master &&
+		git checkout main &&
 		test_when_finished git reset --hard &&
 		echo unstaged >>c &&
 		git $cmd commit-C >expect &&
@@ -116,7 +116,7 @@ do
 	'
 
 	test_expect_success "$cmd --merge-base with one commit and staged and unstaged changes" '
-		git checkout master &&
+		git checkout main &&
 		test_when_finished git reset --hard &&
 		echo staged >>c &&
 		git add c &&
@@ -127,7 +127,7 @@ do
 	'
 
 	test_expect_success "$cmd --merge-base --cached with one commit and staged and unstaged changes" '
-		git checkout master &&
+		git checkout main &&
 		test_when_finished git reset --hard &&
 		echo staged >>c &&
 		git add c &&
@@ -138,19 +138,19 @@ do
 	'
 
 	test_expect_success "$cmd --merge-base with non-commit" '
-		git checkout master &&
-		test_must_fail git $cmd --merge-base master^{tree} 2>err &&
+		git checkout main &&
+		test_must_fail git $cmd --merge-base main^{tree} 2>err &&
 		test_i18ngrep "fatal: --merge-base only works with commits" err
 	'
 
 	test_expect_success "$cmd --merge-base with no merge bases and one commit" '
-		git checkout master &&
+		git checkout main &&
 		test_must_fail git $cmd --merge-base br3 2>err &&
 		test_i18ngrep "fatal: no merge base found" err
 	'
 
 	test_expect_success "$cmd --merge-base with multiple merge bases and one commit" '
-		git checkout master &&
+		git checkout main &&
 		test_must_fail git $cmd --merge-base br1 2>err &&
 		test_i18ngrep "fatal: multiple merge bases found" err
 	'
@@ -159,13 +159,13 @@ done
 for cmd in diff-tree diff
 do
 	test_expect_success "$cmd --merge-base with two commits" '
-		git $cmd commit-C master >expect &&
-		git $cmd --merge-base br2 master >actual &&
+		git $cmd commit-C main >expect &&
+		git $cmd --merge-base br2 main >actual &&
 		test_cmp expect actual
 	'
 
 	test_expect_success "$cmd --merge-base commit and non-commit" '
-		test_must_fail git $cmd --merge-base br2 master^{tree} 2>err &&
+		test_must_fail git $cmd --merge-base br2 main^{tree} 2>err &&
 		test_i18ngrep "fatal: --merge-base only works with commits" err
 	'
 
@@ -175,13 +175,13 @@ do
 	'
 
 	test_expect_success "$cmd --merge-base with multiple merge bases and two commits" '
-		test_must_fail git $cmd --merge-base master br1 2>err &&
+		test_must_fail git $cmd --merge-base main br1 2>err &&
 		test_i18ngrep "fatal: multiple merge bases found" err
 	'
 done
 
 test_expect_success 'diff-tree --merge-base with one commit' '
-	test_must_fail git diff-tree --merge-base master 2>err &&
+	test_must_fail git diff-tree --merge-base main 2>err &&
 	test_i18ngrep "fatal: --merge-base only works with two commits" err
 '
 
diff --git a/t/t4103-apply-binary.sh b/t/t4103-apply-binary.sh
index 1b420e3b5f..b5a68cfe78 100755
--- a/t/t4103-apply-binary.sh
+++ b/t/t4103-apply-binary.sh
@@ -31,64 +31,64 @@ test_expect_success 'setup' '
 	git update-index --add --remove file1 file2 file3 file4 &&
 	git commit -m "Second Version" &&
 
-	git diff-tree -p master binary >B.diff &&
-	git diff-tree -p -C master binary >C.diff &&
+	git diff-tree -p main binary >B.diff &&
+	git diff-tree -p -C main binary >C.diff &&
 
-	git diff-tree -p --binary master binary >BF.diff &&
-	git diff-tree -p --binary -C master binary >CF.diff &&
+	git diff-tree -p --binary main binary >BF.diff &&
+	git diff-tree -p --binary -C main binary >CF.diff &&
 
-	git diff-tree -p --full-index master binary >B-index.diff &&
-	git diff-tree -p -C --full-index master binary >C-index.diff &&
+	git diff-tree -p --full-index main binary >B-index.diff &&
+	git diff-tree -p -C --full-index main binary >C-index.diff &&
 
-	git diff-tree -p --binary --no-prefix master binary -- file3 >B0.diff &&
+	git diff-tree -p --binary --no-prefix main binary -- file3 >B0.diff &&
 
 	git init other-repo &&
 	(
 		cd other-repo &&
-		git fetch .. master &&
+		git fetch .. main &&
 		git reset --hard FETCH_HEAD
 	)
 '
 
 test_expect_success 'stat binary diff -- should not fail.' \
-	'git checkout master &&
+	'git checkout main &&
 	 git apply --stat --summary B.diff'
 
 test_expect_success 'stat binary -p0 diff -- should not fail.' '
-	 git checkout master &&
+	 git checkout main &&
 	 git apply --stat -p0 B0.diff
 '
 
 test_expect_success 'stat binary diff (copy) -- should not fail.' \
-	'git checkout master &&
+	'git checkout main &&
 	 git apply --stat --summary C.diff'
 
 test_expect_success 'check binary diff -- should fail.' \
-	'git checkout master &&
+	'git checkout main &&
 	 test_must_fail git apply --check B.diff'
 
 test_expect_success 'check binary diff (copy) -- should fail.' \
-	'git checkout master &&
+	'git checkout main &&
 	 test_must_fail git apply --check C.diff'
 
 test_expect_success \
 	'check incomplete binary diff with replacement -- should fail.' '
-	git checkout master &&
+	git checkout main &&
 	test_must_fail git apply --check --allow-binary-replacement B.diff
 '
 
 test_expect_success \
     'check incomplete binary diff with replacement (copy) -- should fail.' '
-	 git checkout master &&
+	 git checkout main &&
 	 test_must_fail git apply --check --allow-binary-replacement C.diff
 '
 
 test_expect_success 'check binary diff with replacement.' \
-	'git checkout master &&
+	'git checkout main &&
 	 git apply --check --allow-binary-replacement BF.diff'
 
 test_expect_success 'check binary diff with replacement (copy).' \
-	'git checkout master &&
+	'git checkout main &&
 	 git apply --check --allow-binary-replacement CF.diff'
 
 # Now we start applying them.
@@ -96,7 +96,7 @@ test_expect_success 'check binary diff with replacement (copy).' \
 do_reset () {
 	rm -f file? &&
 	git reset --hard &&
-	git checkout -f master
+	git checkout -f main
 }
 
 test_expect_success 'apply binary diff -- should fail.' \
diff --git a/t/t4108-apply-threeway.sh b/t/t4108-apply-threeway.sh
index d7349ced6b..f073df1792 100755
--- a/t/t4108-apply-threeway.sh
+++ b/t/t4108-apply-threeway.sh
@@ -24,14 +24,14 @@ test_expect_success setup '
 	test_tick &&
 	test_write_lines 1 two 3 4 5 six 7 >one &&
 	test_write_lines 1 two 3 4 5 6 7 >two &&
-	git commit -a -m master &&
+	git commit -a -m main &&
 
 	git checkout side &&
 	test_write_lines 1 2 3 4 five 6 7 >one &&
 	test_write_lines 1 2 3 4 five 6 7 >two &&
 	git commit -a -m side &&
 
-	git checkout master
+	git checkout main
 '
 
 test_expect_success 'apply without --3way' '
@@ -39,7 +39,7 @@ test_expect_success 'apply without --3way' '
 
 	# should fail to apply
 	git reset --hard &&
-	git checkout master^0 &&
+	git checkout main^0 &&
 	test_must_fail git apply --index P.diff &&
 	# should leave things intact
 	git diff-files --exit-code &&
@@ -52,14 +52,14 @@ test_apply_with_3way () {
 
 	# The corresponding conflicted merge
 	git reset --hard &&
-	git checkout master^0 &&
+	git checkout main^0 &&
 	test_must_fail git merge --no-commit side &&
 	git ls-files -s >expect.ls &&
 	print_sanitized_conflicted_diff >expect.diff &&
 
 	# should fail to apply
 	git reset --hard &&
-	git checkout master^0 &&
+	git checkout main^0 &&
 	test_must_fail git apply --index --3way P.diff &&
 	git ls-files -s >actual.ls &&
 	print_sanitized_conflicted_diff >actual.diff &&
@@ -86,7 +86,7 @@ test_expect_success 'apply with --3way with rerere enabled' '
 
 	# The corresponding conflicted merge
 	git reset --hard &&
-	git checkout master^0 &&
+	git checkout main^0 &&
 	test_must_fail git merge --no-commit side &&
 
 	# Manually resolve and record the resolution
@@ -96,7 +96,7 @@ test_expect_success 'apply with --3way with rerere enabled' '
 
 	# should fail to apply
 	git reset --hard &&
-	git checkout master^0 &&
+	git checkout main^0 &&
 	test_must_fail git apply --index --3way P.diff &&
 
 	# but rerere should have replayed the recorded resolution
diff --git a/t/t4121-apply-diffs.sh b/t/t4121-apply-diffs.sh
index 66368effd5..ff2257fef1 100755
--- a/t/t4121-apply-diffs.sh
+++ b/t/t4121-apply-diffs.sh
@@ -23,7 +23,7 @@ test_expect_success 'setup' \
 	git commit -a -q -m 2 &&
 	echo 9 >>file &&
 	git commit -a -q -m 3 &&
-	git checkout master'
+	git checkout main'
 
 test_expect_success \
 	'check if contextually independent diffs for the same file apply' \
diff --git a/t/t4122-apply-symlink-inside.sh b/t/t4122-apply-symlink-inside.sh
index 4acb3f336e..36562677c4 100755
--- a/t/t4122-apply-symlink-inside.sh
+++ b/t/t4122-apply-symlink-inside.sh
@@ -35,11 +35,11 @@ test_expect_success apply '
 
 test_expect_success 'check result' '
 
-	git diff --exit-code master &&
-	git diff --exit-code --cached master &&
+	git diff --exit-code main &&
+	git diff --exit-code --cached main &&
 	test_tick &&
 	git commit -m replay &&
-	T1=$(git rev-parse "master^{tree}") &&
+	T1=$(git rev-parse "main^{tree}") &&
 	T2=$(git rev-parse "HEAD^{tree}") &&
 	test "z$T1" = "z$T2"
 
diff --git a/t/t4150-am.sh b/t/t4150-am.sh
index 3ecbef6f8e..2514341522 100755
--- a/t/t4150-am.sh
+++ b/t/t4150-am.sh
@@ -179,8 +179,8 @@ test_expect_success setup '
 	test_tick &&
 	git commit -m "added another file" &&
 
-	git format-patch --stdout master >lorem-move.patch &&
-	git format-patch --no-prefix --stdout master >lorem-zero.patch &&
+	git format-patch --stdout main >lorem-move.patch &&
+	git format-patch --no-prefix --stdout main >lorem-zero.patch &&
 
 	git checkout -b rename &&
 	git mv file renamed &&
@@ -453,11 +453,11 @@ test_expect_success 'am changes committer and keeps author' '
 	git checkout first &&
 	git am patch2 &&
 	test_path_is_missing .git/rebase-apply &&
-	test "$(git rev-parse master^^)" = "$(git rev-parse HEAD^^)" &&
-	git diff --exit-code master..HEAD &&
-	git diff --exit-code master^..HEAD^ &&
-	compare author master HEAD &&
-	compare author master^ HEAD^ &&
+	test "$(git rev-parse main^^)" = "$(git rev-parse HEAD^^)" &&
+	git diff --exit-code main..HEAD &&
+	git diff --exit-code main^..HEAD^ &&
+	compare author main HEAD &&
+	compare author main^ HEAD^ &&
 	test "$GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL>" = \
 	     "$(git log -1 --pretty=format:"%cn <%ce>" HEAD)"
 '
@@ -759,7 +759,7 @@ test_expect_success 'am takes patches from a Pine mailbox' '
 	git checkout first &&
 	cat pine patch1 | git am &&
 	test_path_is_missing .git/rebase-apply &&
-	git diff --exit-code master^..HEAD
+	git diff --exit-code main^..HEAD
 '
 
 test_expect_success 'am fails on mail without patch' '
@@ -1112,21 +1112,21 @@ test_expect_success 'am and .gitattibutes' '
 		test_commit sixth &&
 
 		git checkout test &&
-		git format-patch --stdout master..HEAD >patches &&
-		git reset --hard master &&
+		git format-patch --stdout main..HEAD >patches &&
+		git reset --hard main &&
 		git am patches &&
 		grep "smudged" a.txt &&
 
 		git checkout removal &&
 		git reset --hard &&
-		git format-patch --stdout master..HEAD >patches &&
-		git reset --hard master &&
+		git format-patch --stdout main..HEAD >patches &&
+		git reset --hard main &&
 		git am patches &&
 		grep "clean" a.txt &&
 
 		git checkout conflict &&
 		git reset --hard &&
-		git format-patch --stdout master..HEAD >patches &&
+		git format-patch --stdout main..HEAD >patches &&
 		git reset --hard fourth &&
 		test_must_fail git am -3 patches &&
 		grep "<<<<<<<<<<" a.txt
diff --git a/t/t4200-rerere.sh b/t/t4200-rerere.sh
index b12b43e9e9..a6222b84bb 100755
--- a/t/t4200-rerere.sh
+++ b/t/t4200-rerere.sh
@@ -8,7 +8,7 @@ test_description='git rerere
 ! [fifth] version1
  ! [first] first
   ! [fourth] version1
-   ! [master] initial
+   ! [main] initial
     ! [second] prefer first over second
      ! [third] version2
 ------
@@ -19,7 +19,7 @@ test_description='git rerere
     -  [second] prefer first over second
  +  +  [first] first
     +  [second^] second
-++++++ [master] initial
+++++++ [main] initial
 '
 
 . ./test-lib.sh
@@ -57,7 +57,7 @@ test_expect_success 'setup' '
 	test_tick &&
 	git commit -q -a -m first &&
 
-	git checkout -b second master &&
+	git checkout -b second main &&
 	git show first:a1 |
 	sed -e "s/To die, t/To die! T/" -e "s/Some title/Some Title/" >a1 &&
 	echo "* END *" >>a1 &&
@@ -168,7 +168,7 @@ test_expect_success 'first postimage wins' '
 
 	oldmtimepost=$(test-tool chmtime --get -60 $rr/postimage) &&
 
-	git checkout -b third master &&
+	git checkout -b third main &&
 	git show second^:a1 | sed "s/To die: t/To die! T/" >a1 &&
 	git commit -q -a -m third &&
 
@@ -580,13 +580,13 @@ test_expect_success 'multiple identical conflicts' '
 test_expect_success 'rerere with unexpected conflict markers does not crash' '
 	git reset --hard &&
 
-	git checkout -b branch-1 master &&
+	git checkout -b branch-1 main &&
 	echo "bar" >test &&
 	git add test &&
 	git commit -q -m two &&
 
 	git reset --hard &&
-	git checkout -b branch-2 master &&
+	git checkout -b branch-2 main &&
 	echo "foo" >test &&
 	git add test &&
 	git commit -q -a -m one &&
@@ -601,7 +601,7 @@ test_expect_success 'rerere with unexpected conflict markers does not crash' '
 test_expect_success 'rerere with inner conflict markers' '
 	git reset --hard &&
 
-	git checkout -b A master &&
+	git checkout -b A main &&
 	echo "bar" >test &&
 	git add test &&
 	git commit -q -m two &&
@@ -610,7 +610,7 @@ test_expect_success 'rerere with inner conflict markers' '
 	git commit -q -m three &&
 
 	git reset --hard &&
-	git checkout -b B master &&
+	git checkout -b B main &&
 	echo "foo" >test &&
 	git add test &&
 	git commit -q -a -m one &&
@@ -651,11 +651,11 @@ test_expect_success 'setup simple stage 1 handling' '
 		git add original &&
 		git commit -m original &&
 
-		git checkout -b A master &&
+		git checkout -b A main &&
 		git mv original A &&
 		git commit -m "rename to A" &&
 
-		git checkout -b B master &&
+		git checkout -b B main &&
 		git mv original B &&
 		git commit -m "rename to B"
 	)
diff --git a/t/t4201-shortlog.sh b/t/t4201-shortlog.sh
index 3d5c4a2086..005fff4c2c 100755
--- a/t/t4201-shortlog.sh
+++ b/t/t4201-shortlog.sh
@@ -191,7 +191,7 @@ test_expect_success 'shortlog with revision pseudo options' '
 '
 
 test_expect_success 'shortlog with --output=<file>' '
-	git shortlog --output=shortlog -1 master >output &&
+	git shortlog --output=shortlog -1 main >output &&
 	test_must_be_empty output &&
 	test_line_count = 3 shortlog
 '
diff --git a/t/t4202-log.sh b/t/t4202-log.sh
index 56d34ed465..93b72ad85e 100755
--- a/t/t4202-log.sh
+++ b/t/t4202-log.sh
@@ -478,7 +478,7 @@ test_expect_success 'set up merge history' '
 	git checkout -b side HEAD~4 &&
 	test_commit side-1 1 1 &&
 	test_commit side-2 2 2 &&
-	git checkout master &&
+	git checkout main &&
 	git merge side
 '
 
@@ -541,17 +541,17 @@ test_expect_success 'log --graph with merge with log.graphColors' '
 '
 
 test_expect_success 'log --raw --graph -m with merge' '
-	git log --raw --graph --oneline -m master | head -n 500 >actual &&
+	git log --raw --graph --oneline -m main | head -n 500 >actual &&
 	grep "initial" actual
 '
 
 test_expect_success 'diff-tree --graph' '
-	git diff-tree --graph master^ | head -n 500 >actual &&
+	git diff-tree --graph main^ | head -n 500 >actual &&
 	grep "one" actual
 '
 
 cat > expect <<\EOF
-*   commit master
+*   commit main
 |\  Merge: A B
 | | Author: A U Thor <author@example.com>
 | |
@@ -567,22 +567,22 @@ cat > expect <<\EOF
 | |
 | |     side-1
 | |
-* | commit master~1
+* | commit main~1
 | | Author: A U Thor <author@example.com>
 | |
 | |     Second
 | |
-* | commit master~2
+* | commit main~2
 | | Author: A U Thor <author@example.com>
 | |
 | |     sixth
 | |
-* | commit master~3
+* | commit main~3
 | | Author: A U Thor <author@example.com>
 | |
 | |     fifth
 | |
-* | commit master~4
+* | commit main~4
 |/  Author: A U Thor <author@example.com>
 |
 |       fourth
@@ -613,19 +613,19 @@ test_expect_success 'log --graph with full output' '
 test_expect_success 'set up more tangled history' '
 	git checkout -b tangle HEAD~6 &&
 	test_commit tangle-a tangle-a a &&
-	git merge master~3 &&
+	git merge main~3 &&
 	git merge side~1 &&
-	git checkout master &&
+	git checkout main &&
 	git merge tangle &&
 	git checkout -b reach &&
 	test_commit reach &&
-	git checkout master &&
+	git checkout main &&
 	git checkout -b octopus-a &&
 	test_commit octopus-a &&
-	git checkout master &&
+	git checkout main &&
 	git checkout -b octopus-b &&
 	test_commit octopus-b &&
-	git checkout master &&
+	git checkout main &&
 	test_commit seventh &&
 	git merge octopus-a octopus-b &&
 	git merge reach
@@ -650,7 +650,7 @@ cat > expect <<\EOF
 |\
 | *   Merge branch 'side' (early part) into tangle
 | |\
-| * \   Merge branch 'master' (early part) into tangle
+| * \   Merge branch 'main' (early part) into tangle
 | |\ \
 | * | | tangle-a
 * | | |   Merge branch 'side'
@@ -794,7 +794,7 @@ test_expect_success 'multiple decorate-refs' '
 
 test_expect_success 'decorate-refs-exclude with glob' '
 	cat >expect.decorate <<-\EOF &&
-	Merge-tag-reach (HEAD -> master)
+	Merge-tag-reach (HEAD -> main)
 	Merge-tags-octopus-a-and-octopus-b
 	seventh (tag: seventh)
 	octopus-b (tag: octopus-b)
@@ -811,7 +811,7 @@ test_expect_success 'decorate-refs-exclude with glob' '
 
 test_expect_success 'decorate-refs-exclude without globs' '
 	cat >expect.decorate <<-\EOF &&
-	Merge-tag-reach (HEAD -> master)
+	Merge-tag-reach (HEAD -> main)
 	Merge-tags-octopus-a-and-octopus-b
 	seventh (tag: seventh)
 	octopus-b (tag: octopus-b, octopus-b)
@@ -828,7 +828,7 @@ test_expect_success 'decorate-refs-exclude without globs' '
 
 test_expect_success 'multiple decorate-refs-exclude' '
 	cat >expect.decorate <<-\EOF &&
-	Merge-tag-reach (HEAD -> master)
+	Merge-tag-reach (HEAD -> main)
 	Merge-tags-octopus-a-and-octopus-b
 	seventh (tag: seventh)
 	octopus-b (tag: octopus-b)
@@ -851,7 +851,7 @@ test_expect_success 'multiple decorate-refs-exclude' '
 
 test_expect_success 'decorate-refs and decorate-refs-exclude' '
 	cat >expect.no-decorate <<-\EOF &&
-	Merge-tag-reach (master)
+	Merge-tag-reach (main)
 	Merge-tags-octopus-a-and-octopus-b
 	seventh
 	octopus-b
@@ -866,7 +866,7 @@ test_expect_success 'decorate-refs and decorate-refs-exclude' '
 
 test_expect_success 'deocrate-refs and log.excludeDecoration' '
 	cat >expect.decorate <<-\EOF &&
-	Merge-tag-reach (master)
+	Merge-tag-reach (main)
 	Merge-tags-octopus-a-and-octopus-b
 	seventh
 	octopus-b (octopus-b)
@@ -881,7 +881,7 @@ test_expect_success 'deocrate-refs and log.excludeDecoration' '
 
 test_expect_success 'decorate-refs-exclude and simplify-by-decoration' '
 	cat >expect.decorate <<-\EOF &&
-	Merge-tag-reach (HEAD -> master)
+	Merge-tag-reach (HEAD -> main)
 	reach (tag: reach, reach)
 	seventh (tag: seventh)
 	Merge-branch-tangle
@@ -1080,7 +1080,7 @@ cat >expect <<\EOF
 | |\ \  Merge: MERGE_PARENTS
 | | | | Author: A U Thor <author@example.com>
 | | | |
-| | | |     Merge branch 'master' (early part) into tangle
+| | | |     Merge branch 'main' (early part) into tangle
 | | | |
 | * | | commit COMMIT_OBJECT_NAME
 | | | | Author: A U Thor <author@example.com>
@@ -1355,7 +1355,7 @@ cat >expect <<\EOF
 *** | |\ \  Merge: MERGE_PARENTS
 *** | | | | Author: A U Thor <author@example.com>
 *** | | | |
-*** | | | |     Merge branch 'master' (early part) into tangle
+*** | | | |     Merge branch 'main' (early part) into tangle
 *** | | | |
 *** | * | | commit COMMIT_OBJECT_NAME
 *** | | | | Author: A U Thor <author@example.com>
@@ -1588,24 +1588,24 @@ test_expect_success 'dotdot is a parent directory' '
 '
 
 test_expect_success GPG 'setup signed branch' '
-	test_when_finished "git reset --hard && git checkout master" &&
-	git checkout -b signed master &&
+	test_when_finished "git reset --hard && git checkout main" &&
+	git checkout -b signed main &&
 	echo foo >foo &&
 	git add foo &&
 	git commit -S -m signed_commit
 '
 
 test_expect_success GPG 'setup signed branch with subkey' '
-	test_when_finished "git reset --hard && git checkout master" &&
-	git checkout -b signed-subkey master &&
+	test_when_finished "git reset --hard && git checkout main" &&
+	git checkout -b signed-subkey main &&
 	echo foo >foo &&
 	git add foo &&
 	git commit -SB7227189 -m signed_commit
 '
 
 test_expect_success GPGSM 'setup signed branch x509' '
-	test_when_finished "git reset --hard && git checkout master" &&
-	git checkout -b signed-x509 master &&
+	test_when_finished "git reset --hard && git checkout main" &&
+	git checkout -b signed-x509 main &&
 	echo foo >foo &&
 	git add foo &&
 	test_config gpg.format x509 &&
@@ -1638,12 +1638,12 @@ test_expect_success GPGSM 'log --graph --show-signature x509' '
 '
 
 test_expect_success GPG 'log --graph --show-signature for merged tag' '
-	test_when_finished "git reset --hard && git checkout master" &&
-	git checkout -b plain master &&
+	test_when_finished "git reset --hard && git checkout main" &&
+	git checkout -b plain main &&
 	echo aaa >bar &&
 	git add bar &&
 	git commit -m bar_commit &&
-	git checkout -b tagged master &&
+	git checkout -b tagged main &&
 	echo bbb >baz &&
 	git add baz &&
 	git commit -m baz_commit &&
@@ -1657,12 +1657,12 @@ test_expect_success GPG 'log --graph --show-signature for merged tag' '
 '
 
 test_expect_success GPG 'log --graph --show-signature for merged tag in shallow clone' '
-	test_when_finished "git reset --hard && git checkout master" &&
-	git checkout -b plain-shallow master &&
+	test_when_finished "git reset --hard && git checkout main" &&
+	git checkout -b plain-shallow main &&
 	echo aaa >bar &&
 	git add bar &&
 	git commit -m bar_commit &&
-	git checkout --detach master &&
+	git checkout --detach main &&
 	echo bbb >baz &&
 	git add baz &&
 	git commit -m baz_commit &&
@@ -1677,12 +1677,12 @@ test_expect_success GPG 'log --graph --show-signature for merged tag in shallow
 '
 
 test_expect_success GPG 'log --graph --show-signature for merged tag with missing key' '
-	test_when_finished "git reset --hard && git checkout master" &&
-	git checkout -b plain-nokey master &&
+	test_when_finished "git reset --hard && git checkout main" &&
+	git checkout -b plain-nokey main &&
 	echo aaa >bar &&
 	git add bar &&
 	git commit -m bar_commit &&
-	git checkout -b tagged-nokey master &&
+	git checkout -b tagged-nokey main &&
 	echo bbb >baz &&
 	git add baz &&
 	git commit -m baz_commit &&
@@ -1696,12 +1696,12 @@ test_expect_success GPG 'log --graph --show-signature for merged tag with missin
 '
 
 test_expect_success GPG 'log --graph --show-signature for merged tag with bad signature' '
-	test_when_finished "git reset --hard && git checkout master" &&
-	git checkout -b plain-bad master &&
+	test_when_finished "git reset --hard && git checkout main" &&
+	git checkout -b plain-bad main &&
 	echo aaa >bar &&
 	git add bar &&
 	git commit -m bar_commit &&
-	git checkout -b tagged-bad master &&
+	git checkout -b tagged-bad main &&
 	echo bbb >baz &&
 	git add baz &&
 	git commit -m baz_commit &&
@@ -1718,12 +1718,12 @@ test_expect_success GPG 'log --graph --show-signature for merged tag with bad si
 '
 
 test_expect_success GPG 'log --show-signature for merged tag with GPG failure' '
-	test_when_finished "git reset --hard && git checkout master" &&
-	git checkout -b plain-fail master &&
+	test_when_finished "git reset --hard && git checkout main" &&
+	git checkout -b plain-fail main &&
 	echo aaa >bar &&
 	git add bar &&
 	git commit -m bar_commit &&
-	git checkout -b tagged-fail master &&
+	git checkout -b tagged-fail main &&
 	echo bbb >baz &&
 	git add baz &&
 	git commit -m baz_commit &&
@@ -1737,14 +1737,14 @@ test_expect_success GPG 'log --show-signature for merged tag with GPG failure' '
 '
 
 test_expect_success GPGSM 'log --graph --show-signature for merged tag x509' '
-	test_when_finished "git reset --hard && git checkout master" &&
+	test_when_finished "git reset --hard && git checkout main" &&
 	test_config gpg.format x509 &&
 	test_config user.signingkey $GIT_COMMITTER_EMAIL &&
-	git checkout -b plain-x509 master &&
+	git checkout -b plain-x509 main &&
 	echo aaa >bar &&
 	git add bar &&
 	git commit -m bar_commit &&
-	git checkout -b tagged-x509 master &&
+	git checkout -b tagged-x509 main &&
 	echo bbb >baz &&
 	git add baz &&
 	git commit -m baz_commit &&
@@ -1758,14 +1758,14 @@ test_expect_success GPGSM 'log --graph --show-signature for merged tag x509' '
 '
 
 test_expect_success GPGSM 'log --graph --show-signature for merged tag x509 missing key' '
-	test_when_finished "git reset --hard && git checkout master" &&
+	test_when_finished "git reset --hard && git checkout main" &&
 	test_config gpg.format x509 &&
 	test_config user.signingkey $GIT_COMMITTER_EMAIL &&
-	git checkout -b plain-x509-nokey master &&
+	git checkout -b plain-x509-nokey main &&
 	echo aaa >bar &&
 	git add bar &&
 	git commit -m bar_commit &&
-	git checkout -b tagged-x509-nokey master &&
+	git checkout -b tagged-x509-nokey main &&
 	echo bbb >baz &&
 	git add baz &&
 	git commit -m baz_commit &&
@@ -1778,14 +1778,14 @@ test_expect_success GPGSM 'log --graph --show-signature for merged tag x509 miss
 '
 
 test_expect_success GPGSM 'log --graph --show-signature for merged tag x509 bad signature' '
-	test_when_finished "git reset --hard && git checkout master" &&
+	test_when_finished "git reset --hard && git checkout main" &&
 	test_config gpg.format x509 &&
 	test_config user.signingkey $GIT_COMMITTER_EMAIL &&
-	git checkout -b plain-x509-bad master &&
+	git checkout -b plain-x509-bad main &&
 	echo aaa >bar &&
 	git add bar &&
 	git commit -m bar_commit &&
-	git checkout -b tagged-x509-bad master &&
+	git checkout -b tagged-x509-bad main &&
 	echo bbb >baz &&
 	git add baz &&
 	git commit -m baz_commit &&
@@ -1835,7 +1835,7 @@ test_expect_success 'log diagnoses bogus HEAD' '
 	git init empty &&
 	test_must_fail git -C empty log 2>stderr &&
 	test_i18ngrep does.not.have.any.commits stderr &&
-	echo 1234abcd >empty/.git/refs/heads/master &&
+	echo 1234abcd >empty/.git/refs/heads/main &&
 	test_must_fail git -C empty log 2>stderr &&
 	test_i18ngrep broken stderr &&
 	echo "ref: refs/heads/invalid.lock" >empty/.git/HEAD &&
diff --git a/t/t4203-mailmap.sh b/t/t4203-mailmap.sh
index 586c3a86b1..2127b1652d 100755
--- a/t/t4203-mailmap.sh
+++ b/t/t4203-mailmap.sh
@@ -194,7 +194,7 @@ test_expect_success 'No mailmap files, but configured' '
 
 test_expect_success 'setup mailmap blob tests' '
 	git checkout -b map &&
-	test_when_finished "git checkout master" &&
+	test_when_finished "git checkout main" &&
 	cat >just-bugs <<- EOF &&
 	Blob Guy <bugs@company.xx>
 	EOF
diff --git a/t/t4204-patch-id.sh b/t/t4204-patch-id.sh
index 8ff8bd84c7..3808dce5c7 100755
--- a/t/t4204-patch-id.sh
+++ b/t/t4204-patch-id.sh
@@ -13,9 +13,9 @@ test_expect_success 'setup' '
 	test_write_lines $as b >foo &&
 	test_write_lines $as b >bar &&
 	git commit -a -m first &&
-	git checkout -b same master &&
+	git checkout -b same main &&
 	git commit --amend -m same-msg &&
-	git checkout -b notsame master &&
+	git checkout -b notsame main &&
 	echo c >foo &&
 	echo c >bar &&
 	git commit --amend -a -m notsame-msg &&
@@ -46,31 +46,31 @@ get_patch_id () {
 }
 
 test_expect_success 'patch-id detects equality' '
-	get_patch_id master &&
+	get_patch_id main &&
 	get_patch_id same &&
-	test_cmp patch-id_master patch-id_same
+	test_cmp patch-id_main patch-id_same
 '
 
 test_expect_success 'patch-id detects inequality' '
-	get_patch_id master &&
+	get_patch_id main &&
 	get_patch_id notsame &&
-	! test_cmp patch-id_master patch-id_notsame
+	! test_cmp patch-id_main patch-id_notsame
 '
 
 test_expect_success 'patch-id supports git-format-patch output' '
-	get_patch_id master &&
+	get_patch_id main &&
 	git checkout same &&
 	git format-patch -1 --stdout | calc_patch_id same &&
-	test_cmp patch-id_master patch-id_same &&
+	test_cmp patch-id_main patch-id_same &&
 	set $(git format-patch -1 --stdout | git patch-id) &&
 	test "$2" = $(git rev-parse HEAD)
 '
 
 test_expect_success 'whitespace is irrelevant in footer' '
-	get_patch_id master &&
+	get_patch_id main &&
 	git checkout same &&
 	git format-patch -1 --stdout | sed "s/ \$//" | calc_patch_id same &&
-	test_cmp patch-id_master patch-id_same
+	test_cmp patch-id_main patch-id_same
 '
 
 cmp_patch_id () {
@@ -88,7 +88,7 @@ test_patch_id_file_order () {
 	shift
 	name="order-${1}-$relevant"
 	shift
-	get_top_diff "master" | calc_patch_id "$name" "$@" &&
+	get_top_diff "main" | calc_patch_id "$name" "$@" &&
 	git checkout same &&
 	git format-patch -1 --stdout -O foo-then-bar |
 		calc_patch_id "ordered-$name" "$@" &&
@@ -137,10 +137,10 @@ test_expect_success '--stable overrides patchid.stable = false' '
 '
 
 test_expect_success 'patch-id supports git-format-patch MIME output' '
-	get_patch_id master &&
+	get_patch_id main &&
 	git checkout same &&
 	git format-patch -1 --attach --stdout | calc_patch_id same &&
-	test_cmp patch-id_master patch-id_same
+	test_cmp patch-id_main patch-id_same
 '
 
 test_expect_success 'patch-id respects config from subdir' '
diff --git a/t/t4207-log-decoration-colors.sh b/t/t4207-log-decoration-colors.sh
index 60f040cab8..b6793064dc 100755
--- a/t/t4207-log-decoration-colors.sh
+++ b/t/t4207-log-decoration-colors.sh
@@ -40,13 +40,13 @@ test_expect_success setup '
 
 cat >expected <<EOF
 ${c_commit}COMMIT_ID${c_reset}${c_commit} (${c_reset}${c_HEAD}HEAD ->\
- ${c_reset}${c_branch}master${c_reset}${c_commit},\
+ ${c_reset}${c_branch}main${c_reset}${c_commit},\
  ${c_reset}${c_tag}tag: v1.0${c_reset}${c_commit},\
  ${c_reset}${c_tag}tag: B${c_reset}${c_commit})${c_reset} B
 ${c_commit}COMMIT_ID${c_reset}${c_commit} (${c_reset}${c_tag}tag: A1${c_reset}${c_commit},\
- ${c_reset}${c_remoteBranch}other/master${c_reset}${c_commit})${c_reset} A1
+ ${c_reset}${c_remoteBranch}other/main${c_reset}${c_commit})${c_reset} A1
 ${c_commit}COMMIT_ID${c_reset}${c_commit} (${c_reset}${c_stash}refs/stash${c_reset}${c_commit})${c_reset}\
- On master: Changes to A.t
+ On main: Changes to A.t
 ${c_commit}COMMIT_ID${c_reset}${c_commit} (${c_reset}${c_tag}tag: A${c_reset}${c_commit})${c_reset} A
 EOF
 
diff --git a/t/t4208-log-magic-pathspec.sh b/t/t4208-log-magic-pathspec.sh
index 6cdbe4747a..58b928dbf3 100755
--- a/t/t4208-log-magic-pathspec.sh
+++ b/t/t4208-log-magic-pathspec.sh
@@ -26,7 +26,7 @@ test_expect_success '"git log :/a -- " should not be ambiguous' '
 '
 
 test_expect_success '"git log :/detached -- " should find a commit only in HEAD' '
-	test_when_finished "git checkout master" &&
+	test_when_finished "git checkout main" &&
 	git checkout --detach &&
 	# Must manually call `test_tick` instead of using `test_commit`,
 	# because the latter additionally creates a tag, which would make
@@ -119,7 +119,7 @@ test_expect_success 'command line pathspec parsing for "git log"' '
 	git checkout HEAD^ &&
 	echo 2 >a &&
 	git commit -a -m "update a to 2" &&
-	test_must_fail git merge master &&
+	test_must_fail git merge main &&
 	git add a &&
 	git log --merge -- a
 '
diff --git a/t/t4211/history.export b/t/t4211/history.export
index f9f41e211e..006972a1f2 100644
--- a/t/t4211/history.export
+++ b/t/t4211/history.export
@@ -316,7 +316,7 @@ long f(long x)
 	return s;
 }
 
-commit refs/heads/master
+commit refs/heads/main
 mark :19
 author Thomas Rast <trast@student.ethz.ch> 1362045024 +0100
 committer Thomas Rast <trast@student.ethz.ch> 1362045024 +0100
diff --git a/t/t4214-log-graph-octopus.sh b/t/t4214-log-graph-octopus.sh
index a080325098..d4e07cb0ba 100755
--- a/t/t4214-log-graph-octopus.sh
+++ b/t/t4214-log-graph-octopus.sh
@@ -17,7 +17,7 @@ test_cmp_colored_graph () {
 test_expect_success 'set up merge history' '
 	test_commit initial &&
 	for i in 1 2 3 4 ; do
-		git checkout master -b $i || return $?
+		git checkout main -b $i || return $?
 		# Make tag name different from branch name, to avoid
 		# ambiguity error when calling checkout.
 		test_commit $i $i $i tag$i || return $?
diff --git a/t/t4216-log-bloom.sh b/t/t4216-log-bloom.sh
index d11040ce41..95a9bae4de 100755
--- a/t/t4216-log-bloom.sh
+++ b/t/t4216-log-bloom.sh
@@ -21,7 +21,7 @@ test_expect_success 'setup test - repo, commits, commit graph, log outputs' '
 	test_commit c10 file_to_be_deleted &&
 	git checkout -b side HEAD~4 &&
 	test_commit side-1 file4 &&
-	git checkout master &&
+	git checkout main &&
 	git merge side &&
 	test_commit c11 file5 &&
 	mv file5 file5_renamed &&
@@ -94,7 +94,7 @@ do
 		      "--topo-order" \
 		      "--date-order" \
 		      "--author-date-order" \
-		      "--ancestry-path side..master"
+		      "--ancestry-path side..main"
 	do
 		test_expect_success "git log option: $option for path: $path" '
 			test_bloom_filters_used "$option -- $path" &&
diff --git a/t/t4253-am-keep-cr-dos.sh b/t/t4253-am-keep-cr-dos.sh
index 6e1b73ec3a..cf51efa2ee 100755
--- a/t/t4253-am-keep-cr-dos.sh
+++ b/t/t4253-am-keep-cr-dos.sh
@@ -43,7 +43,7 @@ test_expect_success 'setup repository with dos files' '
 
 test_expect_success 'am with dos files without --keep-cr' '
 	git checkout -b dosfiles initial &&
-	git format-patch -k initial..master &&
+	git format-patch -k initial..main &&
 	test_must_fail git am -k -3 000*.patch &&
 	git am --abort &&
 	rm -rf .git/rebase-apply 000*.patch
@@ -51,23 +51,23 @@ test_expect_success 'am with dos files without --keep-cr' '
 
 test_expect_success 'am with dos files with --keep-cr' '
 	git checkout -b dosfiles-keep-cr initial &&
-	git format-patch -k --stdout initial..master >output &&
+	git format-patch -k --stdout initial..main >output &&
 	git am --keep-cr -k -3 output &&
-	git diff --exit-code master
+	git diff --exit-code main
 '
 
 test_expect_success 'am with dos files config am.keepcr' '
 	git config am.keepcr 1 &&
 	git checkout -b dosfiles-conf-keepcr initial &&
-	git format-patch -k --stdout initial..master >output &&
+	git format-patch -k --stdout initial..main >output &&
 	git am -k -3 output &&
-	git diff --exit-code master
+	git diff --exit-code main
 '
 
 test_expect_success 'am with dos files config am.keepcr overridden by --no-keep-cr' '
 	git config am.keepcr 1 &&
 	git checkout -b dosfiles-conf-keepcr-override initial &&
-	git format-patch -k initial..master &&
+	git format-patch -k initial..main &&
 	test_must_fail git am -k -3 --no-keep-cr 000*.patch &&
 	git am --abort &&
 	rm -rf .git/rebase-apply 000*.patch
@@ -75,14 +75,14 @@ test_expect_success 'am with dos files config am.keepcr overridden by --no-keep-
 
 test_expect_success 'am with dos files with --keep-cr continue' '
 	git checkout -b dosfiles-keep-cr-continue initial &&
-	git format-patch -k initial..master &&
+	git format-patch -k initial..main &&
 	append_cr <file1a >file &&
 	git commit -m "different patch" file &&
 	test_must_fail git am --keep-cr -k -3 000*.patch &&
 	append_cr <file2 >file &&
 	git add file &&
 	git am -3 --resolved &&
-	git diff --exit-code master
+	git diff --exit-code main
 '
 
 test_expect_success 'am with unix files config am.keepcr overridden by --no-keep-cr' '
@@ -90,9 +90,9 @@ test_expect_success 'am with unix files config am.keepcr overridden by --no-keep
 	git checkout -b unixfiles-conf-keepcr-override initial &&
 	cp -f file1 file &&
 	git commit -m "line ending to unix" file &&
-	git format-patch -k initial..master &&
+	git format-patch -k initial..main &&
 	git am -k -3 --no-keep-cr 000*.patch &&
-	git diff --exit-code -w master
+	git diff --exit-code -w main
 '
 
 test_done
diff --git a/t/t4257-am-interactive.sh b/t/t4257-am-interactive.sh
index 5344bd248a..aed8f4de3d 100755
--- a/t/t4257-am-interactive.sh
+++ b/t/t4257-am-interactive.sh
@@ -10,7 +10,7 @@ test_expect_success 'set up patches to apply' '
 	git format-patch --stdout -2 >mbox &&
 
 	git reset --hard unrelated &&
-	test_commit conflict-master file master base
+	test_commit conflict-main file main base
 '
 
 # Sanity check our setup.
diff --git a/t/test-lib.sh b/t/test-lib.sh
index 76ab747b53..b783629348 100644
--- a/t/test-lib.sh
+++ b/t/test-lib.sh
@@ -257,13 +257,13 @@ case "$TRASH_DIRECTORY" in
 esac
 
 case "$TEST_NUMBER" in
-3404)
+3404|4013)
 	# Avoid conflicts with patch series that are cooking at the same time
 	# as the patch series changing the default of `init.defaultBranch`.
 	GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
 	export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 	;;
-[0-3]*)
+[0-4]*)
 	GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 	export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 	;;
-- 
gitgitgadget


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH 09/28] t5323: prepare centered comment for `master` -> `main`
  2020-11-12 22:43 [PATCH 00/28] Use main as default branch name Johannes Schindelin via GitGitGadget
                   ` (7 preceding siblings ...)
  2020-11-12 22:43 ` [PATCH 08/28] t4*: " Johannes Schindelin via GitGitGadget
@ 2020-11-12 22:43 ` Johannes Schindelin via GitGitGadget
  2020-11-12 22:43 ` [PATCH 10/28] t5[0-4]*: adjust the references to the default branch name "main" Johannes Schindelin via GitGitGadget
                   ` (23 subsequent siblings)
  32 siblings, 0 replies; 163+ messages in thread
From: Johannes Schindelin via GitGitGadget @ 2020-11-12 22:43 UTC (permalink / raw)
  To: git; +Cc: Johannes Schindelin, Johannes Schindelin

From: Johannes Schindelin <johannes.schindelin@gmx.de>

We are about to search-and-replace all mentions of `master` in t5323 by
`main`, which is two characters shorter. To prepare for that, let's add
padding to centered lines that will make them briefly uncentered, but
will be re-centered in the commit that performs that rename.

Doing it this way (instead of padding after replacing) makes it easier
to verify the validity of the patch that replaces `master` by `main`.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
---
 t/t5323-pack-redundant.sh | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/t/t5323-pack-redundant.sh b/t/t5323-pack-redundant.sh
index 6b4d1ca353..3903148926 100755
--- a/t/t5323-pack-redundant.sh
+++ b/t/t5323-pack-redundant.sh
@@ -312,7 +312,7 @@ test_expect_success 'shared: all packs are redundant, but no output without --al
 #############################################################################
 # Chart of packs and objects for this test case
 #
-#     ================ master.git ===============
+#     ================= master.git ================
 #         | T A B C D E F G H I J K L M N O P Q R  <----------+
 #     ----+--------------------------------------             |
 #     P1  | x x x x x x x                       x             |
@@ -394,7 +394,7 @@ test_expect_success 'shared: no redundant without --alt-odb' '
 #############################################################################
 # Chart of packs and objects for this test case
 #
-#     ================ master.git ===============
+#     ================= master.git ================
 #         | T A B C D E F G H I J K L M N O P Q R  <----------------+
 #     ----+--------------------------------------                   |
 #     P1  | x x x x x x x                       x                   |
@@ -426,7 +426,7 @@ test_expect_success 'shared: one pack is redundant with --alt-odb' '
 #############################################################################
 # Chart of packs and objects for this test case
 #
-#     ================ master.git ===============
+#     ================= master.git ================
 #         | T A B C D E F G H I J K L M N O P Q R  <----------------+
 #     ----+--------------------------------------                   |
 #     P1  | x x x x x x x                       x                   |
-- 
gitgitgadget


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH 10/28] t5[0-4]*: adjust the references to the default branch name "main"
  2020-11-12 22:43 [PATCH 00/28] Use main as default branch name Johannes Schindelin via GitGitGadget
                   ` (8 preceding siblings ...)
  2020-11-12 22:43 ` [PATCH 09/28] t5323: prepare centered comment for `master` -> `main` Johannes Schindelin via GitGitGadget
@ 2020-11-12 22:43 ` Johannes Schindelin via GitGitGadget
  2020-11-12 22:43 ` [PATCH 11/28] t5503: prepare aligned comment for replacing `master` with `main` Johannes Schindelin via GitGitGadget
                   ` (22 subsequent siblings)
  32 siblings, 0 replies; 163+ messages in thread
From: Johannes Schindelin via GitGitGadget @ 2020-11-12 22:43 UTC (permalink / raw)
  To: git; +Cc: Johannes Schindelin, Johannes Schindelin

From: Johannes Schindelin <johannes.schindelin@gmx.de>

Carefully excluding t5310, which is developed independently of the
current patch series at the time of writing, we now use `main` as
default branch in t5[0-4]*. 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[0-4]*.sh &&
	   git checkout HEAD -- t5310\*)

This allows us to define `GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main`
for those tests.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
---
 t/t5150-request-pull.sh                | 34 ++++++-------
 t/t5304-prune.sh                       |  2 +-
 t/t5305-include-tag.sh                 |  2 +-
 t/t5312-prune-corruption.sh            | 16 +++----
 t/t5317-pack-objects-filter-objects.sh |  2 +-
 t/t5322-pack-objects-sparse.sh         |  2 +-
 t/t5323-pack-redundant.sh              | 66 +++++++++++++-------------
 t/t5400-send-pack.sh                   | 60 +++++++++++------------
 t/t5401-update-hooks.sh                | 24 +++++-----
 t/t5402-post-merge-hook.sh             |  2 +-
 t/t5403-post-checkout-hook.sh          |  6 +--
 t/t5404-tracking-branches.sh           |  8 ++--
 t/t5405-send-pack-rewind.sh            |  6 +--
 t/t5407-post-rewrite-hook.sh           |  2 +-
 t/t5410-receive-pack-alternates.sh     |  4 +-
 t/test-lib.sh                          |  4 +-
 16 files changed, 120 insertions(+), 120 deletions(-)

diff --git a/t/t5150-request-pull.sh b/t/t5150-request-pull.sh
index c1811ea0f4..4fa71961a6 100755
--- a/t/t5150-request-pull.sh
+++ b/t/t5150-request-pull.sh
@@ -31,13 +31,13 @@ test_expect_success 'setup' '
 		test_tick &&
 		git commit -m "\"Thirty days\", a reminder of month lengths" &&
 		git tag -m "version 1" -a initial &&
-		git push --tags origin master
+		git push --tags origin main
 	) &&
 	(
 		cd local &&
 		git remote add upstream "$trash_url/upstream.git" &&
 		git fetch upstream &&
-		git pull upstream master &&
+		git pull upstream main &&
 		cat <<-\EOT >>mnemonic.txt &&
 		Of twyecescore-eightt is but eine,
 		And all the remnante be thrycescore-eine.
@@ -59,7 +59,7 @@ test_expect_success 'setup' '
 		git commit -a -m "Adapt to use modern, simpler English
 
 But keep the old version, too, in case some people prefer it." &&
-		git checkout master
+		git checkout main
 	)
 
 '
@@ -129,7 +129,7 @@ test_expect_success 'pull request when forgot to push' '
 	(
 		cd local &&
 		git checkout initial &&
-		git merge --ff-only master &&
+		git merge --ff-only main &&
 		test_must_fail git request-pull initial "$downstream_url" \
 			2>../err
 	) &&
@@ -145,9 +145,9 @@ test_expect_success 'pull request after push' '
 	(
 		cd local &&
 		git checkout initial &&
-		git merge --ff-only master &&
-		git push origin master:for-upstream &&
-		git request-pull initial origin master:for-upstream >../request
+		git merge --ff-only main &&
+		git push origin main:for-upstream &&
+		git request-pull initial origin main:for-upstream >../request
 	) &&
 	sed -nf read-request.sed <request >digest &&
 	{
@@ -172,9 +172,9 @@ test_expect_success 'request asks HEAD to be pulled' '
 	(
 		cd local &&
 		git checkout initial &&
-		git merge --ff-only master &&
-		git push --tags origin master simplify &&
-		git push origin master:for-upstream &&
+		git merge --ff-only main &&
+		git push --tags origin main simplify &&
+		git push origin main:for-upstream &&
 		git request-pull initial "$downstream_url" >../request
 	) &&
 	sed -nf read-request.sed <request >digest &&
@@ -215,7 +215,7 @@ test_expect_success 'pull request format' '
 	(
 		cd local &&
 		git checkout initial &&
-		git merge --ff-only master &&
+		git merge --ff-only main &&
 		git push origin tags/full &&
 		git request-pull initial "$downstream_url" tags/full >../request
 	) &&
@@ -243,9 +243,9 @@ test_expect_success 'request-pull ignores OPTIONS_KEEPDASHDASH poison' '
 		OPTIONS_KEEPDASHDASH=Yes &&
 		export OPTIONS_KEEPDASHDASH &&
 		git checkout initial &&
-		git merge --ff-only master &&
-		git push origin master:for-upstream &&
-		git request-pull -- initial "$downstream_url" master:for-upstream >../request
+		git merge --ff-only main &&
+		git push origin main:for-upstream &&
+		git request-pull -- initial "$downstream_url" main:for-upstream >../request
 	)
 
 '
@@ -257,7 +257,7 @@ test_expect_success 'request-pull quotes regex metacharacters properly' '
 	(
 		cd local &&
 		git checkout initial &&
-		git merge --ff-only master &&
+		git merge --ff-only main &&
 		git tag -mrelease v2.0 &&
 		git push origin refs/tags/v2.0:refs/tags/v2-0 &&
 		test_must_fail git request-pull initial "$downstream_url" tags/v2.0 \
@@ -275,7 +275,7 @@ test_expect_success 'pull request with mismatched object' '
 	(
 		cd local &&
 		git checkout initial &&
-		git merge --ff-only master &&
+		git merge --ff-only main &&
 		git push origin HEAD:refs/tags/full &&
 		test_must_fail git request-pull initial "$downstream_url" tags/full \
 			2>../err
@@ -292,7 +292,7 @@ test_expect_success 'pull request with stale object' '
 	(
 		cd local &&
 		git checkout initial &&
-		git merge --ff-only master &&
+		git merge --ff-only main &&
 		git push origin refs/tags/full &&
 		git tag -f -m"Thirty-one days" full &&
 		test_must_fail git request-pull initial "$downstream_url" tags/full \
diff --git a/t/t5304-prune.sh b/t/t5304-prune.sh
index df60f18fb8..7391f95c7e 100755
--- a/t/t5304-prune.sh
+++ b/t/t5304-prune.sh
@@ -119,7 +119,7 @@ test_expect_success 'prune: do not prune detached HEAD with no reflog' '
 test_expect_success 'prune: prune former HEAD after checking out branch' '
 
 	head_oid=$(git rev-parse HEAD) &&
-	git checkout --quiet master &&
+	git checkout --quiet main &&
 	git prune -v >prune_actual &&
 	grep "$head_oid" prune_actual
 
diff --git a/t/t5305-include-tag.sh b/t/t5305-include-tag.sh
index a5eca210b8..69233574b8 100755
--- a/t/t5305-include-tag.sh
+++ b/t/t5305-include-tag.sh
@@ -111,7 +111,7 @@ test_expect_success 'check unpacked result (have all objects)' '
 
 test_expect_success 'single-branch clone can transfer tag' '
 	rm -rf clone.git &&
-	git clone --no-local --single-branch -b master . clone.git &&
+	git clone --no-local --single-branch -b main . clone.git &&
 	git -C clone.git fsck
 '
 
diff --git a/t/t5312-prune-corruption.sh b/t/t5312-prune-corruption.sh
index da9d59940d..8ca3823f23 100755
--- a/t/t5312-prune-corruption.sh
+++ b/t/t5312-prune-corruption.sh
@@ -16,7 +16,7 @@ test_expect_success 'disable reflogs' '
 '
 
 test_expect_success 'create history reachable only from a bogus-named ref' '
-	test_tick && git commit --allow-empty -m master &&
+	test_tick && git commit --allow-empty -m main &&
 	base=$(git rev-parse HEAD) &&
 	test_tick && git commit --allow-empty -m bogus &&
 	bogus=$(git rev-parse HEAD) &&
@@ -51,7 +51,7 @@ test_expect_success 'clean up bogus ref' '
 '
 
 # We create two new objects here, "one" and "two". Our
-# master branch points to "two", which is deleted,
+# main branch points to "two", which is deleted,
 # corrupting the repository. But we'd like to make sure
 # that the otherwise unreachable "one" is not pruned
 # (since it is the user's best bet for recovering
@@ -81,7 +81,7 @@ test_expect_success 'pruning with a corrupted tip does not drop history' '
 test_expect_success 'pack-refs does not silently delete broken loose ref' '
 	git pack-refs --all --prune &&
 	echo $missing >expect &&
-	git rev-parse refs/heads/master >actual &&
+	git rev-parse refs/heads/main >actual &&
 	test_cmp expect actual
 '
 
@@ -89,25 +89,25 @@ test_expect_success 'pack-refs does not silently delete broken loose ref' '
 # actually pack it, as it is perfectly reasonable to
 # skip processing a broken ref
 test_expect_success 'create packed-refs file with broken ref' '
-	rm -f .git/refs/heads/master &&
+	rm -f .git/refs/heads/main &&
 	cat >.git/packed-refs <<-EOF &&
-	$missing refs/heads/master
+	$missing refs/heads/main
 	$recoverable refs/heads/other
 	EOF
 	echo $missing >expect &&
-	git rev-parse refs/heads/master >actual &&
+	git rev-parse refs/heads/main >actual &&
 	test_cmp expect actual
 '
 
 test_expect_success 'pack-refs does not silently delete broken packed ref' '
 	git pack-refs --all --prune &&
-	git rev-parse refs/heads/master >actual &&
+	git rev-parse refs/heads/main >actual &&
 	test_cmp expect actual
 '
 
 test_expect_success 'pack-refs does not drop broken refs during deletion' '
 	git update-ref -d refs/heads/other &&
-	git rev-parse refs/heads/master >actual &&
+	git rev-parse refs/heads/main >actual &&
 	test_cmp expect actual
 '
 
diff --git a/t/t5317-pack-objects-filter-objects.sh b/t/t5317-pack-objects-filter-objects.sh
index dc0446574b..6ee66d58ce 100755
--- a/t/t5317-pack-objects-filter-objects.sh
+++ b/t/t5317-pack-objects-filter-objects.sh
@@ -382,7 +382,7 @@ test_expect_success 'verify sparse:oid=oid-ish' '
 	awk -f print_2.awk ls_files_result |
 	sort >expected &&
 
-	git -C r4 pack-objects --revs --stdout --filter=sparse:oid=master:pattern >filter.pack <<-EOF &&
+	git -C r4 pack-objects --revs --stdout --filter=sparse:oid=main:pattern >filter.pack <<-EOF &&
 	HEAD
 	EOF
 	git -C r4 index-pack ../filter.pack &&
diff --git a/t/t5322-pack-objects-sparse.sh b/t/t5322-pack-objects-sparse.sh
index a581eaf529..99bdab0610 100755
--- a/t/t5322-pack-objects-sparse.sh
+++ b/t/t5322-pack-objects-sparse.sh
@@ -18,7 +18,7 @@ test_expect_success 'setup repo' '
 	git commit -m "Initialized trees" &&
 	for i in $(test_seq 1 3)
 	do
-		git checkout -b topic$i master &&
+		git checkout -b topic$i main &&
 		echo change-$i >f$i/f$i/data.txt &&
 		git commit -a -m "Changed f$i/f$i/data.txt"
 	done &&
diff --git a/t/t5323-pack-redundant.sh b/t/t5323-pack-redundant.sh
index 3903148926..89c8688647 100755
--- a/t/t5323-pack-redundant.sh
+++ b/t/t5323-pack-redundant.sh
@@ -6,7 +6,7 @@
 test_description='Test git pack-redundant
 
 In order to test git-pack-redundant, we will create a number of objects and
-packs in the repository `master.git`. The relationship between packs (P1-P8)
+packs in the repository `main.git`. The relationship between packs (P1-P8)
 and objects (T, A-R) is showed in the following chart. Objects of a pack will
 be marked with letter x, while objects of redundant packs will be marked with
 exclamation point, and redundant pack itself will be marked with asterisk.
@@ -25,7 +25,7 @@ exclamation point, and redundant pack itself will be marked with asterisk.
     ALL | x x x x x x x x x x x x x x x x x x x
 
 Another repository `shared.git` has unique objects (X-Z), while other objects
-(marked with letter s) are shared through alt-odb (of `master.git`). The
+(marked with letter s) are shared through alt-odb (of `main.git`). The
 relationship between packs and objects is as follows:
 
 	| T A B C D E F G H I J K L M N O P Q R   X Y Z
@@ -36,7 +36,7 @@ relationship between packs and objects is as follows:
 
 . ./test-lib.sh
 
-master_repo=master.git
+main_repo=main.git
 shared_repo=shared.git
 
 # Create commits in <repo> and assign each commit's oid to shell variables
@@ -69,7 +69,7 @@ create_commits_in () {
 		shift ||
 		return 1
 	done &&
-	git -C "$repo" update-ref refs/heads/master $oid
+	git -C "$repo" update-ref refs/heads/main $oid
 }
 
 # Create pack in <repo> and assign pack id to variable given in the 2nd argument
@@ -107,9 +107,9 @@ format_packfiles () {
 	sort
 }
 
-test_expect_success 'setup master repo' '
-	git init --bare "$master_repo" &&
-	create_commits_in "$master_repo" A B C D E F G H I J K L M N O P Q R
+test_expect_success 'setup main repo' '
+	git init --bare "$main_repo" &&
+	create_commits_in "$main_repo" A B C D E F G H I J K L M N O P Q R
 '
 
 #############################################################################
@@ -124,8 +124,8 @@ test_expect_success 'setup master repo' '
 #     ALL | x x x x x x x x x x x x x x         x
 #
 #############################################################################
-test_expect_success 'master: no redundant for pack 1, 2, 3' '
-	create_pack_in "$master_repo" P1 <<-EOF &&
+test_expect_success 'main: no redundant for pack 1, 2, 3' '
+	create_pack_in "$main_repo" P1 <<-EOF &&
 		$T
 		$A
 		$B
@@ -135,7 +135,7 @@ test_expect_success 'master: no redundant for pack 1, 2, 3' '
 		$F
 		$R
 		EOF
-	create_pack_in "$master_repo" P2 <<-EOF &&
+	create_pack_in "$main_repo" P2 <<-EOF &&
 		$B
 		$C
 		$D
@@ -144,7 +144,7 @@ test_expect_success 'master: no redundant for pack 1, 2, 3' '
 		$H
 		$I
 		EOF
-	create_pack_in "$master_repo" P3 <<-EOF &&
+	create_pack_in "$main_repo" P3 <<-EOF &&
 		$F
 		$I
 		$J
@@ -153,7 +153,7 @@ test_expect_success 'master: no redundant for pack 1, 2, 3' '
 		$M
 		EOF
 	(
-		cd "$master_repo" &&
+		cd "$main_repo" &&
 		git pack-redundant --all >out &&
 		test_must_be_empty out
 	)
@@ -173,22 +173,22 @@ test_expect_success 'master: no redundant for pack 1, 2, 3' '
 #     ALL | x x x x x x x x x x x x x x x x x   x
 #
 #############################################################################
-test_expect_success 'master: one of pack-2/pack-3 is redundant' '
-	create_pack_in "$master_repo" P4 <<-EOF &&
+test_expect_success 'main: one of pack-2/pack-3 is redundant' '
+	create_pack_in "$main_repo" P4 <<-EOF &&
 		$J
 		$K
 		$L
 		$M
 		$P
 		EOF
-	create_pack_in "$master_repo" P5 <<-EOF &&
+	create_pack_in "$main_repo" P5 <<-EOF &&
 		$G
 		$H
 		$N
 		$O
 		EOF
 	(
-		cd "$master_repo" &&
+		cd "$main_repo" &&
 		cat >expect <<-EOF &&
 			P3:$P3
 			EOF
@@ -214,18 +214,18 @@ test_expect_success 'master: one of pack-2/pack-3 is redundant' '
 #     ALL | x x x x x x x x x x x x x x x x x x x
 #
 #############################################################################
-test_expect_success 'master: pack 2, 4, and 6 are redundant' '
-	create_pack_in "$master_repo" P6 <<-EOF &&
+test_expect_success 'main: pack 2, 4, and 6 are redundant' '
+	create_pack_in "$main_repo" P6 <<-EOF &&
 		$N
 		$O
 		$Q
 		EOF
-	create_pack_in "$master_repo" P7 <<-EOF &&
+	create_pack_in "$main_repo" P7 <<-EOF &&
 		$P
 		$Q
 		EOF
 	(
-		cd "$master_repo" &&
+		cd "$main_repo" &&
 		cat >expect <<-EOF &&
 			P2:$P2
 			P4:$P4
@@ -254,12 +254,12 @@ test_expect_success 'master: pack 2, 4, and 6 are redundant' '
 #     ALL | x x x x x x x x x x x x x x x x x x x
 #
 #############################################################################
-test_expect_success 'master: pack-8 (subset of pack-1) is also redundant' '
-	create_pack_in "$master_repo" P8 <<-EOF &&
+test_expect_success 'main: pack-8 (subset of pack-1) is also redundant' '
+	create_pack_in "$main_repo" P8 <<-EOF &&
 		$A
 		EOF
 	(
-		cd "$master_repo" &&
+		cd "$main_repo" &&
 		cat >expect <<-EOF &&
 			P2:$P2
 			P4:$P4
@@ -272,18 +272,18 @@ test_expect_success 'master: pack-8 (subset of pack-1) is also redundant' '
 	)
 '
 
-test_expect_success 'master: clean loose objects' '
+test_expect_success 'main: clean loose objects' '
 	(
-		cd "$master_repo" &&
+		cd "$main_repo" &&
 		git prune-packed &&
 		find objects -type f | sed -e "/objects\/pack\//d" >out &&
 		test_must_be_empty out
 	)
 '
 
-test_expect_success 'master: remove redundant packs and pass fsck' '
+test_expect_success 'main: remove redundant packs and pass fsck' '
 	(
-		cd "$master_repo" &&
+		cd "$main_repo" &&
 		git pack-redundant --all | xargs rm &&
 		git fsck &&
 		git pack-redundant --all >out &&
@@ -292,12 +292,12 @@ test_expect_success 'master: remove redundant packs and pass fsck' '
 '
 
 # The following test cases will execute inside `shared.git`, instead of
-# inside `master.git`.
+# inside `main.git`.
 test_expect_success 'setup shared.git' '
-	git clone --mirror "$master_repo" "$shared_repo" &&
+	git clone --mirror "$main_repo" "$shared_repo" &&
 	(
 		cd "$shared_repo" &&
-		printf "../../$master_repo/objects\n" >objects/info/alternates
+		printf "../../$main_repo/objects\n" >objects/info/alternates
 	)
 '
 
@@ -312,7 +312,7 @@ test_expect_success 'shared: all packs are redundant, but no output without --al
 #############################################################################
 # Chart of packs and objects for this test case
 #
-#     ================= master.git ================
+#     ================= main.git ================
 #         | T A B C D E F G H I J K L M N O P Q R  <----------+
 #     ----+--------------------------------------             |
 #     P1  | x x x x x x x                       x             |
@@ -394,7 +394,7 @@ test_expect_success 'shared: no redundant without --alt-odb' '
 #############################################################################
 # Chart of packs and objects for this test case
 #
-#     ================= master.git ================
+#     ================= main.git ================
 #         | T A B C D E F G H I J K L M N O P Q R  <----------------+
 #     ----+--------------------------------------                   |
 #     P1  | x x x x x x x                       x                   |
@@ -426,7 +426,7 @@ test_expect_success 'shared: one pack is redundant with --alt-odb' '
 #############################################################################
 # Chart of packs and objects for this test case
 #
-#     ================= master.git ================
+#     ================= main.git ================
 #         | T A B C D E F G H I J K L M N O P Q R  <----------------+
 #     ----+--------------------------------------                   |
 #     P1  | x x x x x x x                       x                   |
diff --git a/t/t5400-send-pack.sh b/t/t5400-send-pack.sh
index cc86ef213e..e50ca0d8c6 100755
--- a/t/t5400-send-pack.sh
+++ b/t/t5400-send-pack.sh
@@ -66,20 +66,20 @@ test_expect_success 'pack the destination repository' '
 '
 
 test_expect_success 'refuse pushing rewound head without --force' '
-	pushed_head=$(git rev-parse --verify master) &&
-	victim_orig=$(cd victim && git rev-parse --verify master) &&
-	test_must_fail git send-pack ./victim master &&
-	victim_head=$(cd victim && git rev-parse --verify master) &&
+	pushed_head=$(git rev-parse --verify main) &&
+	victim_orig=$(cd victim && git rev-parse --verify main) &&
+	test_must_fail git send-pack ./victim main &&
+	victim_head=$(cd victim && git rev-parse --verify main) &&
 	test "$victim_head" = "$victim_orig" &&
 	# this should update
-	git send-pack --force ./victim master &&
-	victim_head=$(cd victim && git rev-parse --verify master) &&
+	git send-pack --force ./victim main &&
+	victim_head=$(cd victim && git rev-parse --verify main) &&
 	test "$victim_head" = "$pushed_head"
 '
 
 test_expect_success 'push can be used to delete a ref' '
-	( cd victim && git branch extra master ) &&
-	git send-pack ./victim :extra master &&
+	( cd victim && git branch extra main ) &&
+	git send-pack ./victim :extra main &&
 	( cd victim &&
 	  test_must_fail git rev-parse --verify extra )
 '
@@ -89,9 +89,9 @@ test_expect_success 'refuse deleting push with denyDeletes' '
 		cd victim &&
 		test_might_fail git branch -D extra &&
 		git config receive.denyDeletes true &&
-		git branch extra master
+		git branch extra main
 	) &&
-	test_must_fail git send-pack ./victim :extra master
+	test_must_fail git send-pack ./victim :extra main
 '
 
 test_expect_success 'cannot override denyDeletes with git -c send-pack' '
@@ -99,10 +99,10 @@ test_expect_success 'cannot override denyDeletes with git -c send-pack' '
 		cd victim &&
 		test_might_fail git branch -D extra &&
 		git config receive.denyDeletes true &&
-		git branch extra master
+		git branch extra main
 	) &&
 	test_must_fail git -c receive.denyDeletes=false \
-					send-pack ./victim :extra master
+					send-pack ./victim :extra main
 '
 
 test_expect_success 'override denyDeletes with git -c receive-pack' '
@@ -110,11 +110,11 @@ test_expect_success 'override denyDeletes with git -c receive-pack' '
 		cd victim &&
 		test_might_fail git branch -D extra &&
 		git config receive.denyDeletes true &&
-		git branch extra master
+		git branch extra main
 	) &&
 	git send-pack \
 		--receive-pack="git -c receive.denyDeletes=false receive-pack" \
-		./victim :extra master
+		./victim :extra main
 '
 
 test_expect_success 'denyNonFastforwards trumps --force' '
@@ -123,9 +123,9 @@ test_expect_success 'denyNonFastforwards trumps --force' '
 		test_might_fail git branch -D extra &&
 		git config receive.denyNonFastforwards true
 	) &&
-	victim_orig=$(cd victim && git rev-parse --verify master) &&
-	test_must_fail git send-pack --force ./victim master^:master &&
-	victim_head=$(cd victim && git rev-parse --verify master) &&
+	victim_orig=$(cd victim && git rev-parse --verify main) &&
+	test_must_fail git send-pack --force ./victim main^:main &&
+	victim_head=$(cd victim && git rev-parse --verify main) &&
 	test "$victim_orig" = "$victim_head"
 '
 
@@ -210,41 +210,41 @@ rewound_push_setup() {
 
 test_expect_success 'pushing explicit refspecs respects forcing' '
 	rewound_push_setup &&
-	parent_orig=$(cd parent && git rev-parse --verify master) &&
+	parent_orig=$(cd parent && git rev-parse --verify main) &&
 	(
 		cd child &&
 		test_must_fail git send-pack ../parent \
-			refs/heads/master:refs/heads/master
+			refs/heads/main:refs/heads/main
 	) &&
-	parent_head=$(cd parent && git rev-parse --verify master) &&
+	parent_head=$(cd parent && git rev-parse --verify main) &&
 	test "$parent_orig" = "$parent_head" &&
 	(
 		cd child &&
 		git send-pack ../parent \
-			+refs/heads/master:refs/heads/master
+			+refs/heads/main:refs/heads/main
 	) &&
-	parent_head=$(cd parent && git rev-parse --verify master) &&
-	child_head=$(cd child && git rev-parse --verify master) &&
+	parent_head=$(cd parent && git rev-parse --verify main) &&
+	child_head=$(cd child && git rev-parse --verify main) &&
 	test "$parent_head" = "$child_head"
 '
 
 test_expect_success 'pushing wildcard refspecs respects forcing' '
 	rewound_push_setup &&
-	parent_orig=$(cd parent && git rev-parse --verify master) &&
+	parent_orig=$(cd parent && git rev-parse --verify main) &&
 	(
 		cd child &&
 		test_must_fail git send-pack ../parent \
 			"refs/heads/*:refs/heads/*"
 	) &&
-	parent_head=$(cd parent && git rev-parse --verify master) &&
+	parent_head=$(cd parent && git rev-parse --verify main) &&
 	test "$parent_orig" = "$parent_head" &&
 	(
 		cd child &&
 		git send-pack ../parent \
 			"+refs/heads/*:refs/heads/*"
 	) &&
-	parent_head=$(cd parent && git rev-parse --verify master) &&
-	child_head=$(cd child && git rev-parse --verify master) &&
+	parent_head=$(cd parent && git rev-parse --verify main) &&
+	child_head=$(cd child && git rev-parse --verify main) &&
 	test "$parent_head" = "$child_head"
 '
 
@@ -252,7 +252,7 @@ test_expect_success 'deny pushing to delete current branch' '
 	rewound_push_setup &&
 	(
 		cd child &&
-		test_must_fail git send-pack ../parent :refs/heads/master 2>errs
+		test_must_fail git send-pack ../parent :refs/heads/main 2>errs
 	)
 '
 
@@ -283,9 +283,9 @@ test_expect_success 'receive-pack de-dupes .have lines' '
 	local=$(git -C fork rev-parse HEAD) &&
 	shared=$(git -C shared rev-parse only-shared) &&
 	cat >expect <<-EOF &&
-	$local refs/heads/master
+	$local refs/heads/main
 	$local refs/remotes/origin/HEAD
-	$local refs/remotes/origin/master
+	$local refs/remotes/origin/main
 	$shared .have
 	EOF
 
diff --git a/t/t5401-update-hooks.sh b/t/t5401-update-hooks.sh
index 956d69f5b1..6012cc8172 100755
--- a/t/t5401-update-hooks.sh
+++ b/t/t5401-update-hooks.sh
@@ -15,11 +15,11 @@ test_expect_success setup '
 	git update-index a &&
 	tree1=$(git write-tree) &&
 	commit1=$(echo modify | git commit-tree $tree1 -p $commit0) &&
-	git update-ref refs/heads/master $commit0 &&
+	git update-ref refs/heads/main $commit0 &&
 	git update-ref refs/heads/tofail $commit1 &&
 	git clone --bare ./. victim.git &&
 	GIT_DIR=victim.git git update-ref refs/heads/tofail $commit1 &&
-	git update-ref refs/heads/master $commit1 &&
+	git update-ref refs/heads/main $commit1 &&
 	git update-ref refs/heads/tofail $commit0
 '
 
@@ -38,7 +38,7 @@ echo "$@" >>$GIT_DIR/update.args
 read x; printf %s "$x" >$GIT_DIR/update.stdin
 echo STDOUT update $1
 echo STDERR update $1 >&2
-test "$1" = refs/heads/master || exit
+test "$1" = refs/heads/main || exit
 EOF
 chmod u+x victim.git/hooks/update
 
@@ -62,11 +62,11 @@ chmod u+x victim.git/hooks/post-update
 
 test_expect_success push '
 	test_must_fail git send-pack --force ./victim.git \
-		master tofail >send.out 2>send.err
+		main tofail >send.out 2>send.err
 '
 
 test_expect_success 'updated as expected' '
-	test $(GIT_DIR=victim.git git rev-parse master) = $commit1 &&
+	test $(GIT_DIR=victim.git git rev-parse main) = $commit1 &&
 	test $(GIT_DIR=victim.git git rev-parse tofail) = $commit1
 '
 
@@ -82,24 +82,24 @@ test_expect_success 'hooks ran' '
 '
 
 test_expect_success 'pre-receive hook input' '
-	(echo $commit0 $commit1 refs/heads/master &&
+	(echo $commit0 $commit1 refs/heads/main &&
 	 echo $commit1 $commit0 refs/heads/tofail
 	) | test_cmp - victim.git/pre-receive.stdin
 '
 
 test_expect_success 'update hook arguments' '
-	(echo refs/heads/master $commit0 $commit1 &&
+	(echo refs/heads/main $commit0 $commit1 &&
 	 echo refs/heads/tofail $commit1 $commit0
 	) | test_cmp - victim.git/update.args
 '
 
 test_expect_success 'post-receive hook input' '
-	echo $commit0 $commit1 refs/heads/master |
+	echo $commit0 $commit1 refs/heads/main |
 	test_cmp - victim.git/post-receive.stdin
 '
 
 test_expect_success 'post-update hook arguments' '
-	echo refs/heads/master |
+	echo refs/heads/main |
 	test_cmp - victim.git/post-update.args
 '
 
@@ -120,8 +120,8 @@ test_expect_success 'send-pack produced no output' '
 cat <<EOF >expect
 remote: STDOUT pre-receive
 remote: STDERR pre-receive
-remote: STDOUT update refs/heads/master
-remote: STDERR update refs/heads/master
+remote: STDOUT update refs/heads/main
+remote: STDERR update refs/heads/main
 remote: STDOUT update refs/heads/tofail
 remote: STDERR update refs/heads/tofail
 remote: error: hook declined to update refs/heads/tofail
@@ -143,7 +143,7 @@ test_expect_success 'pre-receive hook that forgets to read its input' '
 
 	for v in $(test_seq 100 999)
 	do
-		git branch branch_$v master || return
+		git branch branch_$v main || return
 	done &&
 	git push ./victim.git "+refs/heads/*:refs/heads/*"
 '
diff --git a/t/t5402-post-merge-hook.sh b/t/t5402-post-merge-hook.sh
index 4aeea8f5b7..26c800e60b 100755
--- a/t/t5402-post-merge-hook.sh
+++ b/t/t5402-post-merge-hook.sh
@@ -15,7 +15,7 @@ test_expect_success setup '
 	git update-index a &&
 	tree1=$(git write-tree) &&
 	commit1=$(echo modify | git commit-tree $tree1 -p $commit0) &&
-	git update-ref refs/heads/master $commit0 &&
+	git update-ref refs/heads/main $commit0 &&
 	git clone ./. clone1 &&
 	GIT_DIR=clone1/.git git update-index --add a &&
 	git clone ./. clone2 &&
diff --git a/t/t5403-post-checkout-hook.sh b/t/t5403-post-checkout-hook.sh
index a39b3b5c78..867dec8862 100755
--- a/t/t5403-post-checkout-hook.sh
+++ b/t/t5403-post-checkout-hook.sh
@@ -20,7 +20,7 @@ test_expect_success setup '
 
 test_expect_success 'post-checkout receives the right arguments with HEAD unchanged ' '
 	test_when_finished "rm -f .git/post-checkout.args" &&
-	git checkout master &&
+	git checkout main &&
 	read old new flag <.git/post-checkout.args &&
 	test $old = $new && test $flag = 1
 '
@@ -41,14 +41,14 @@ test_expect_success 'post-checkout receives the right args with HEAD changed ' '
 
 test_expect_success 'post-checkout receives the right args when not switching branches ' '
 	test_when_finished "rm -f .git/post-checkout.args" &&
-	git checkout master -- three.t &&
+	git checkout main -- three.t &&
 	read old new flag <.git/post-checkout.args &&
 	test $old = $new && test $flag = 0
 '
 
 test_expect_success 'post-checkout is triggered on rebase' '
 	test_when_finished "rm -f .git/post-checkout.args" &&
-	git checkout -b rebase-test master &&
+	git checkout -b rebase-test main &&
 	rm -f .git/post-checkout.args &&
 	git rebase rebase-on-me &&
 	read old new flag <.git/post-checkout.args &&
diff --git a/t/t5404-tracking-branches.sh b/t/t5404-tracking-branches.sh
index 2762f420bc..83751e68d0 100755
--- a/t/t5404-tracking-branches.sh
+++ b/t/t5404-tracking-branches.sh
@@ -30,9 +30,9 @@ test_expect_success 'prepare pushable branches' '
 	git checkout -b b2 origin/b2 &&
 	echo aa-b2 >>file &&
 	git commit -a -m aa-b2 &&
-	git checkout master &&
-	echo aa-master >>file &&
-	git commit -a -m aa-master
+	git checkout main &&
+	echo aa-main >>file &&
+	git commit -a -m aa-main
 '
 
 test_expect_success 'mixed-success push returns error' '
@@ -40,7 +40,7 @@ test_expect_success 'mixed-success push returns error' '
 '
 
 test_expect_success 'check tracking branches updated correctly after push' '
-	test "$(git rev-parse origin/master)" = "$(git rev-parse master)"
+	test "$(git rev-parse origin/main)" = "$(git rev-parse main)"
 '
 
 test_expect_success 'check tracking branches not updated for failed refs' '
diff --git a/t/t5405-send-pack-rewind.sh b/t/t5405-send-pack-rewind.sh
index 235fb7686a..8792e74682 100755
--- a/t/t5405-send-pack-rewind.sh
+++ b/t/t5405-send-pack-rewind.sh
@@ -13,7 +13,7 @@ test_expect_success setup '
 	mkdir another && (
 		cd another &&
 		git init &&
-		git fetch --update-head-ok .. master:master
+		git fetch --update-head-ok .. main:main
 	) &&
 
 	>file2 && git add file2 && test_tick &&
@@ -25,7 +25,7 @@ test_expect_success 'non forced push should die not segfault' '
 
 	(
 		cd another &&
-		test_must_fail git push .. master:master
+		test_must_fail git push .. main:main
 	)
 
 '
@@ -34,7 +34,7 @@ test_expect_success 'forced push should succeed' '
 
 	(
 		cd another &&
-		git push .. +master:master
+		git push .. +main:main
 	)
 
 '
diff --git a/t/t5407-post-rewrite-hook.sh b/t/t5407-post-rewrite-hook.sh
index 80750a817e..27bc159acf 100755
--- a/t/t5407-post-rewrite-hook.sh
+++ b/t/t5407-post-rewrite-hook.sh
@@ -14,7 +14,7 @@ test_expect_success 'setup' '
 	git checkout A^0 &&
 	test_commit E bar E &&
 	test_commit F foo F &&
-	git checkout master
+	git checkout main
 '
 
 mkdir .git/hooks
diff --git a/t/t5410-receive-pack-alternates.sh b/t/t5410-receive-pack-alternates.sh
index f00d0da860..cb6fffe611 100755
--- a/t/t5410-receive-pack-alternates.sh
+++ b/t/t5410-receive-pack-alternates.sh
@@ -7,9 +7,9 @@ test_description='git receive-pack with alternate ref filtering'
 test_expect_success 'setup' '
 	test_commit base &&
 	git clone -s --bare . fork &&
-	git checkout -b public/branch master &&
+	git checkout -b public/branch main &&
 	test_commit public &&
-	git checkout -b private/branch master &&
+	git checkout -b private/branch main &&
 	test_commit private
 '
 
diff --git a/t/test-lib.sh b/t/test-lib.sh
index b783629348..155bfad454 100644
--- a/t/test-lib.sh
+++ b/t/test-lib.sh
@@ -257,13 +257,13 @@ case "$TRASH_DIRECTORY" in
 esac
 
 case "$TEST_NUMBER" in
-3404|4013)
+3404|4013|5310)
 	# Avoid conflicts with patch series that are cooking at the same time
 	# as the patch series changing the default of `init.defaultBranch`.
 	GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
 	export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 	;;
-[0-4]*)
+[0-4]*|5[0-4]*)
 	GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 	export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 	;;
-- 
gitgitgadget


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH 11/28] t5503: prepare aligned comment for replacing `master` with `main`
  2020-11-12 22:43 [PATCH 00/28] Use main as default branch name Johannes Schindelin via GitGitGadget
                   ` (9 preceding siblings ...)
  2020-11-12 22:43 ` [PATCH 10/28] t5[0-4]*: adjust the references to the default branch name "main" Johannes Schindelin via GitGitGadget
@ 2020-11-12 22:43 ` Johannes Schindelin via GitGitGadget
  2020-11-12 22:43 ` [PATCH 12/28] t550*: adjust the references to the default branch name "main" Johannes Schindelin via GitGitGadget
                   ` (21 subsequent siblings)
  32 siblings, 0 replies; 163+ messages in thread
From: Johannes Schindelin via GitGitGadget @ 2020-11-12 22:43 UTC (permalink / raw)
  To: git; +Cc: Johannes Schindelin, Johannes Schindelin

From: Johannes Schindelin <johannes.schindelin@gmx.de>

In an upcoming commit, we will use `main` as the default branch name in
t5503 instead of `master`. This will require extra padding in ASCII-art
commit graphs, which we hereby add preemptively.

By doing this preemptively rather than after the commit applying the
search-and-replace, it is more obvious that we caught all aligned
comments that are affected by the latter commit.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
---
 t/t5503-tagfollow.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/t/t5503-tagfollow.sh b/t/t5503-tagfollow.sh
index 6041a4dd32..6dafbe4543 100755
--- a/t/t5503-tagfollow.sh
+++ b/t/t5503-tagfollow.sh
@@ -11,7 +11,7 @@ test_description='test automatic tag following'
 #   L - A ------ O ------ B
 #    \   \                 \
 #     \   C - origin/cat    \
-#      origin/master         master
+#      origin/master           master
 
 test_expect_success setup '
 	test_tick &&
-- 
gitgitgadget


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH 12/28] t550*: adjust the references to the default branch name "main"
  2020-11-12 22:43 [PATCH 00/28] Use main as default branch name Johannes Schindelin via GitGitGadget
                   ` (10 preceding siblings ...)
  2020-11-12 22:43 ` [PATCH 11/28] t5503: prepare aligned comment for replacing `master` with `main` Johannes Schindelin via GitGitGadget
@ 2020-11-12 22:43 ` Johannes Schindelin via GitGitGadget
  2020-11-12 22:43 ` [PATCH 13/28] t551*: " Johannes Schindelin via GitGitGadget
                   ` (20 subsequent siblings)
  32 siblings, 0 replies; 163+ messages in thread
From: Johannes Schindelin via GitGitGadget @ 2020-11-12 22:43 UTC (permalink / raw)
  To: git; +Cc: Johannes Schindelin, Johannes Schindelin

From: Johannes Schindelin <johannes.schindelin@gmx.de>

This trick was performed via

	$ (cd t &&
	   sed -i -e 's/master/main/g' -e 's/MASTER/MAIN/g' \
		-e 's/Master/Main/g' -- t550*.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>
---
 t/t5500-fetch-pack.sh            |  28 +++----
 t/t5501-fetch-push-alternates.sh |   4 +-
 t/t5502-quickfetch.sh            |   6 +-
 t/t5503-tagfollow.sh             |  12 +--
 t/t5504-fetch-receive-strict.sh  |  20 ++---
 t/t5505-remote.sh                | 140 +++++++++++++++----------------
 t/t5506-remote-groups.sh         |   4 +-
 t/t5509-fetch-push-namespaces.sh |  30 +++----
 t/test-lib.sh                    |   2 +-
 9 files changed, 123 insertions(+), 123 deletions(-)

diff --git a/t/t5500-fetch-pack.sh b/t/t5500-fetch-pack.sh
index 3557374312..70e41ada01 100755
--- a/t/t5500-fetch-pack.sh
+++ b/t/t5500-fetch-pack.sh
@@ -407,14 +407,14 @@ test_expect_success 'in_vain resetted upon ACK' '
 	rm -rf myserver myclient &&
 	git init myserver &&
 
-	# Linked list of commits on master. The first is common; the rest are
+	# Linked list of commits on main. The first is common; the rest are
 	# not.
-	test_commit -C myserver first_master_commit &&
+	test_commit -C myserver first_main_commit &&
 	git clone "file://$(pwd)/myserver" myclient &&
 	test_commit_bulk -C myclient 255 &&
 
 	# Another linked list of commits on anotherbranch with no connection to
-	# master. The first is common; the rest are not.
+	# main. The first is common; the rest are not.
 	git -C myserver checkout --orphan anotherbranch &&
 	test_commit -C myserver first_anotherbranch_commit &&
 	git -C myclient fetch origin anotherbranch:refs/heads/anotherbranch &&
@@ -422,14 +422,14 @@ test_expect_success 'in_vain resetted upon ACK' '
 	test_commit_bulk -C myclient 255 &&
 
 	# The new commit that the client wants to fetch.
-	git -C myserver checkout master &&
+	git -C myserver checkout main &&
 	test_commit -C myserver to_fetch &&
 
 	# The client will send (as "have"s) all 256 commits in anotherbranch
 	# first. The 256th commit is common between the client and the server,
 	# and should reset in_vain. This allows negotiation to continue until
 	# the client reports that first_anotherbranch_commit is common.
-	git -C myclient fetch --progress origin master 2>log &&
+	git -C myclient fetch --progress origin main 2>log &&
 	test_i18ngrep "Total 3 " log
 '
 
@@ -637,7 +637,7 @@ test_expect_success 'shallow fetch with tags does not break the repository' '
 		mkdir repo2 &&
 		cd repo2 &&
 		git init &&
-		git fetch --depth=2 ../.git master:branch &&
+		git fetch --depth=2 ../.git main:branch &&
 		git fsck
 	)
 '
@@ -662,7 +662,7 @@ test_expect_success 'fetch-pack can fetch a raw sha1 that is advertised as a ref
 
 	git init client &&
 	git -C client fetch-pack ../server \
-		$(git -C server rev-parse refs/heads/master)
+		$(git -C server rev-parse refs/heads/main)
 '
 
 test_expect_success 'fetch-pack can fetch a raw sha1 overlapping a named ref' '
@@ -688,7 +688,7 @@ test_expect_success 'fetch-pack cannot fetch a raw sha1 that is not advertised a
 	# Some protocol versions (e.g. 2) support fetching
 	# unadvertised objects, so restrict this test to v0.
 	test_must_fail env GIT_TEST_PROTOCOL_VERSION=0 git -C client fetch-pack ../server \
-		$(git -C server rev-parse refs/heads/master^) 2>err &&
+		$(git -C server rev-parse refs/heads/main^) 2>err &&
 	test_i18ngrep "Server does not allow request for unadvertised object" err
 '
 
@@ -822,7 +822,7 @@ test_expect_success 'clone shallow since ...' '
 
 test_expect_success 'fetch shallow since ...' '
 	git -C shallow11 fetch --shallow-since "200000000 +0700" origin &&
-	git -C shallow11 log --pretty=tformat:%s origin/master >actual &&
+	git -C shallow11 log --pretty=tformat:%s origin/main >actual &&
 	cat >expected <<-\EOF &&
 	three
 	two
@@ -863,7 +863,7 @@ test_expect_success 'shallow since with commit graph and already-seen commit' '
 	(
 	cd shallow-since-graph &&
 	test_commit base &&
-	test_commit master &&
+	test_commit main &&
 	git checkout -b other HEAD^ &&
 	test_commit other &&
 	git commit-graph write --reachable &&
@@ -874,7 +874,7 @@ test_expect_success 'shallow since with commit graph and already-seen commit' '
 	$(echo "object-format=$(test_oid algo)" | packetize)
 	00010013deepen-since 1
 	$(echo "want $(git rev-parse other)" | packetize)
-	$(echo "have $(git rev-parse master)" | packetize)
+	$(echo "have $(git rev-parse main)" | packetize)
 	0000
 	EOF
 	)
@@ -896,7 +896,7 @@ test_expect_success 'shallow clone exclude tag two' '
 
 test_expect_success 'fetch exclude tag one' '
 	git -C shallow12 fetch --shallow-exclude one origin &&
-	git -C shallow12 log --pretty=tformat:%s origin/master >actual &&
+	git -C shallow12 log --pretty=tformat:%s origin/main >actual &&
 	test_write_lines three two >expected &&
 	test_cmp expected actual
 '
@@ -910,11 +910,11 @@ test_expect_success 'fetching deepen' '
 	test_commit three &&
 	git clone --depth 1 "file://$(pwd)/." deepen &&
 	test_commit four &&
-	git -C deepen log --pretty=tformat:%s master >actual &&
+	git -C deepen log --pretty=tformat:%s main >actual &&
 	echo three >expected &&
 	test_cmp expected actual &&
 	git -C deepen fetch --deepen=1 &&
-	git -C deepen log --pretty=tformat:%s origin/master >actual &&
+	git -C deepen log --pretty=tformat:%s origin/main >actual &&
 	cat >expected <<-\EOF &&
 	four
 	three
diff --git a/t/t5501-fetch-push-alternates.sh b/t/t5501-fetch-push-alternates.sh
index 1bc57ac03f..0054163ce4 100755
--- a/t/t5501-fetch-push-alternates.sh
+++ b/t/t5501-fetch-push-alternates.sh
@@ -45,7 +45,7 @@ test_expect_success setup '
 test_expect_success 'pushing into a repository with the same alternate' '
 	(
 		cd one &&
-		git push ../receiver master:refs/heads/it
+		git push ../receiver main:refs/heads/it
 	) &&
 	(
 		cd receiver &&
@@ -57,7 +57,7 @@ test_expect_success 'pushing into a repository with the same alternate' '
 test_expect_success 'fetching from a repository with the same alternate' '
 	(
 		cd fetcher &&
-		git fetch ../one master:refs/heads/it &&
+		git fetch ../one main:refs/heads/it &&
 		count_objects >../fetcher.count
 	) &&
 	test_cmp one.count fetcher.count
diff --git a/t/t5502-quickfetch.sh b/t/t5502-quickfetch.sh
index 7a46cbdbe6..b163787a05 100755
--- a/t/t5502-quickfetch.sh
+++ b/t/t5502-quickfetch.sh
@@ -108,14 +108,14 @@ test_expect_success 'quickfetch should not copy from alternate' '
 				q
 			}"
 	) ) &&
-	origin_master=$( (
+	origin_main=$( (
 		cd quickclone &&
-		git rev-parse origin/master
+		git rev-parse origin/main
 	) ) &&
 	echo "loose objects: $obj_cnt, packfiles: $pck_cnt" &&
 	test $obj_cnt -eq 0 &&
 	test $pck_cnt -eq 0 &&
-	test z$origin_master = z$(git rev-parse master)
+	test z$origin_main = z$(git rev-parse main)
 
 '
 
diff --git a/t/t5503-tagfollow.sh b/t/t5503-tagfollow.sh
index 6dafbe4543..b3e5f810e0 100755
--- a/t/t5503-tagfollow.sh
+++ b/t/t5503-tagfollow.sh
@@ -11,7 +11,7 @@ test_description='test automatic tag following'
 #   L - A ------ O ------ B
 #    \   \                 \
 #     \   C - origin/cat    \
-#      origin/master           master
+#      origin/main           main
 
 test_expect_success setup '
 	test_tick &&
@@ -57,7 +57,7 @@ test_expect_success 'fetch A (new commit : 1 connection)' '
 	(
 		cd cloned &&
 		GIT_TRACE_PACKET=$UPATH git fetch &&
-		test $A = $(git rev-parse --verify origin/master)
+		test $A = $(git rev-parse --verify origin/main)
 	) &&
 	get_needs $U >actual &&
 	test_cmp expect actual
@@ -72,7 +72,7 @@ test_expect_success "create tag T on A, create C on branch cat" '
 	git add file &&
 	git commit -m C &&
 	C=$(git rev-parse --verify HEAD) &&
-	git checkout master
+	git checkout main
 '
 
 test_expect_success 'setup expect' '
@@ -123,7 +123,7 @@ test_expect_success 'fetch B, S (commit and tag : 1 connection)' '
 	(
 		cd cloned &&
 		GIT_TRACE_PACKET=$UPATH git fetch &&
-		test $B = $(git rev-parse --verify origin/master) &&
+		test $B = $(git rev-parse --verify origin/main) &&
 		test $B = $(git rev-parse --verify tag2^0) &&
 		test $S = $(git rev-parse --verify tag2)
 	) &&
@@ -138,7 +138,7 @@ want $S
 EOF
 '
 
-test_expect_success 'new clone fetch master and tags' '
+test_expect_success 'new clone fetch main and tags' '
 	test_might_fail git branch -D cat &&
 	rm -f $U &&
 	(
@@ -147,7 +147,7 @@ test_expect_success 'new clone fetch master and tags' '
 		git init &&
 		git remote add origin .. &&
 		GIT_TRACE_PACKET=$UPATH git fetch &&
-		test $B = $(git rev-parse --verify origin/master) &&
+		test $B = $(git rev-parse --verify origin/main) &&
 		test $S = $(git rev-parse --verify tag2) &&
 		test $B = $(git rev-parse --verify tag2^0) &&
 		test $T = $(git rev-parse --verify tag1) &&
diff --git a/t/t5504-fetch-receive-strict.sh b/t/t5504-fetch-receive-strict.sh
index 1a16ac4c0d..d2ba19ce68 100755
--- a/t/t5504-fetch-receive-strict.sh
+++ b/t/t5504-fetch-receive-strict.sh
@@ -25,7 +25,7 @@ test_expect_success 'fetch without strict' '
 		cd dst &&
 		git config fetch.fsckobjects false &&
 		git config transfer.fsckobjects false &&
-		test_must_fail git fetch ../.git master
+		test_must_fail git fetch ../.git main
 	)
 '
 
@@ -36,7 +36,7 @@ test_expect_success 'fetch with !fetch.fsckobjects' '
 		cd dst &&
 		git config fetch.fsckobjects false &&
 		git config transfer.fsckobjects true &&
-		test_must_fail git fetch ../.git master
+		test_must_fail git fetch ../.git main
 	)
 '
 
@@ -47,7 +47,7 @@ test_expect_success 'fetch with fetch.fsckobjects' '
 		cd dst &&
 		git config fetch.fsckobjects true &&
 		git config transfer.fsckobjects false &&
-		test_must_fail git fetch ../.git master
+		test_must_fail git fetch ../.git main
 	)
 '
 
@@ -57,13 +57,13 @@ test_expect_success 'fetch with transfer.fsckobjects' '
 	(
 		cd dst &&
 		git config transfer.fsckobjects true &&
-		test_must_fail git fetch ../.git master
+		test_must_fail git fetch ../.git main
 	)
 '
 
 cat >exp <<EOF
 To dst
-!	refs/heads/master:refs/heads/test	[remote rejected] (missing necessary objects)
+!	refs/heads/main:refs/heads/test	[remote rejected] (missing necessary objects)
 Done
 EOF
 
@@ -75,7 +75,7 @@ test_expect_success 'push without strict' '
 		git config fetch.fsckobjects false &&
 		git config transfer.fsckobjects false
 	) &&
-	test_must_fail git push --porcelain dst master:refs/heads/test >act &&
+	test_must_fail git push --porcelain dst main:refs/heads/test >act &&
 	test_cmp exp act
 '
 
@@ -87,13 +87,13 @@ test_expect_success 'push with !receive.fsckobjects' '
 		git config receive.fsckobjects false &&
 		git config transfer.fsckobjects true
 	) &&
-	test_must_fail git push --porcelain dst master:refs/heads/test >act &&
+	test_must_fail git push --porcelain dst main:refs/heads/test >act &&
 	test_cmp exp act
 '
 
 cat >exp <<EOF
 To dst
-!	refs/heads/master:refs/heads/test	[remote rejected] (unpacker error)
+!	refs/heads/main:refs/heads/test	[remote rejected] (unpacker error)
 EOF
 
 test_expect_success 'push with receive.fsckobjects' '
@@ -104,7 +104,7 @@ test_expect_success 'push with receive.fsckobjects' '
 		git config receive.fsckobjects true &&
 		git config transfer.fsckobjects false
 	) &&
-	test_must_fail git push --porcelain dst master:refs/heads/test >act &&
+	test_must_fail git push --porcelain dst main:refs/heads/test >act &&
 	test_cmp exp act
 '
 
@@ -115,7 +115,7 @@ test_expect_success 'push with transfer.fsckobjects' '
 		cd dst &&
 		git config transfer.fsckobjects true
 	) &&
-	test_must_fail git push --porcelain dst master:refs/heads/test >act &&
+	test_must_fail git push --porcelain dst main:refs/heads/test >act &&
 	test_cmp exp act
 '
 
diff --git a/t/t5505-remote.sh b/t/t5505-remote.sh
index eaa6e90220..540d65aa22 100755
--- a/t/t5505-remote.sh
+++ b/t/t5505-remote.sh
@@ -17,7 +17,7 @@ setup_repository () {
 	git add elif &&
 	test_tick &&
 	git commit -m "Second" &&
-	git checkout master
+	git checkout main
 	)
 }
 
@@ -60,8 +60,8 @@ test_expect_success C_LOCALE_OUTPUT 'remote information for the origin' '
 	(
 		cd test &&
 		tokens_match origin "$(git remote)" &&
-		check_remote_track origin master side &&
-		check_tracking_branch origin HEAD master side
+		check_remote_track origin main side &&
+		check_tracking_branch origin HEAD main side
 	)
 '
 
@@ -70,7 +70,7 @@ test_expect_success 'add another remote' '
 		cd test &&
 		git remote add -f second ../two &&
 		tokens_match "origin second" "$(git remote)" &&
-		check_tracking_branch second master side another &&
+		check_tracking_branch second main side another &&
 		git for-each-ref "--format=%(refname)" refs/remotes |
 		sed -e "/^refs\/remotes\/origin\//d" \
 		    -e "/^refs\/remotes\/second\//d" >actual &&
@@ -81,8 +81,8 @@ test_expect_success 'add another remote' '
 test_expect_success C_LOCALE_OUTPUT 'check remote-tracking' '
 	(
 		cd test &&
-		check_remote_track origin master side &&
-		check_remote_track second master side another
+		check_remote_track origin main side &&
+		check_remote_track second main side another
 	)
 '
 
@@ -99,7 +99,7 @@ test_expect_success 'remote forces tracking branches' '
 test_expect_success 'remove remote' '
 	(
 		cd test &&
-		git symbolic-ref refs/remotes/second/HEAD refs/remotes/second/master &&
+		git symbolic-ref refs/remotes/second/HEAD refs/remotes/second/main &&
 		git remote rm second
 	)
 '
@@ -108,7 +108,7 @@ test_expect_success C_LOCALE_OUTPUT 'remove remote' '
 	(
 		cd test &&
 		tokens_match origin "$(git remote)" &&
-		check_remote_track origin master side &&
+		check_remote_track origin main side &&
 		git for-each-ref "--format=%(refname)" refs/remotes |
 		sed -e "/^refs\/remotes\/origin\//d" >actual &&
 		test_must_be_empty actual
@@ -121,13 +121,13 @@ test_expect_success 'remove remote protects local branches' '
 		cat >expect1 <<-\EOF &&
 		Note: A branch outside the refs/remotes/ hierarchy was not removed;
 		to delete it, use:
-		  git branch -d master
+		  git branch -d main
 		EOF
 		cat >expect2 <<-\EOF &&
 		Note: Some branches outside the refs/remotes/ hierarchy were not removed;
 		to delete them, use:
 		  git branch -d foobranch
-		  git branch -d master
+		  git branch -d main
 		EOF
 		git tag footag &&
 		git config --add remote.oops.fetch "+refs/*:refs/*" &&
@@ -153,7 +153,7 @@ test_expect_success 'remove errors out early when deleting non-existent branch'
 
 test_expect_success 'remove remote with a branch without configured merge' '
 	test_when_finished "(
-		git -C test checkout master;
+		git -C test checkout main;
 		git -C test branch -D two;
 		git -C test config --remove-section remote.two;
 		git -C test config --remove-section branch.second;
@@ -163,9 +163,9 @@ test_expect_success 'remove remote with a branch without configured merge' '
 		cd test &&
 		git remote add two ../two &&
 		git fetch two &&
-		git checkout -b second two/master^0 &&
+		git checkout -b second two/main^0 &&
 		git config branch.second.remote two &&
-		git checkout master &&
+		git checkout main &&
 		git remote rm two
 	)
 '
@@ -211,7 +211,7 @@ cat >test/expect <<EOF
 * remote origin
   Fetch URL: $(pwd)/one
   Push  URL: $(pwd)/one
-  HEAD branch: master
+  HEAD branch: main
   Remote branches:
     main new (next fetch will store in remotes/origin)
     side tracked
@@ -221,14 +221,14 @@ cat >test/expect <<EOF
     octopus  merges with remote topic-a
                 and with remote topic-b
                 and with remote topic-c
-    rebase  rebases onto remote master
+    rebase  rebases onto remote main
   Local refs configured for 'git push':
     main pushes to main     (local out of date)
     main pushes to upstream (create)
 * remote two
   Fetch URL: ../two
   Push  URL: ../three
-  HEAD branch: master
+  HEAD branch: main
   Local refs configured for 'git push':
     ahead forces to main    (fast-forwardable)
     main  pushes to another (up to date)
@@ -237,16 +237,16 @@ EOF
 test_expect_success PREPARE_FOR_MAIN_BRANCH 'show' '
 	(
 		cd test &&
-		git config --add remote.origin.fetch refs/heads/master:refs/heads/upstream &&
+		git config --add remote.origin.fetch refs/heads/main:refs/heads/upstream &&
 		git fetch &&
-		git checkout -b ahead origin/master &&
+		git checkout -b ahead origin/main &&
 		echo 1 >>file &&
 		test_tick &&
 		git commit -m update file &&
-		git checkout master &&
-		git branch --track octopus origin/master &&
-		git branch --track rebase origin/master &&
-		git branch -d -r origin/master &&
+		git checkout main &&
+		git branch --track octopus origin/main &&
+		git branch --track rebase origin/main &&
+		git branch -d -r origin/main &&
 		git config --add remote.two.url ../two &&
 		git config --add remote.two.pushurl ../three &&
 		git config branch.rebase.rebase true &&
@@ -258,10 +258,10 @@ test_expect_success PREPARE_FOR_MAIN_BRANCH 'show' '
 			git commit -m update file
 		) &&
 		git config --add remote.origin.push : &&
-		git config --add remote.origin.push refs/heads/master:refs/heads/upstream &&
+		git config --add remote.origin.push refs/heads/main:refs/heads/upstream &&
 		git config --add remote.origin.push +refs/tags/lastbackup &&
-		git config --add remote.two.push +refs/heads/ahead:refs/heads/master &&
-		git config --add remote.two.push refs/heads/master:refs/heads/another &&
+		git config --add remote.two.push +refs/heads/ahead:refs/heads/main &&
+		git config --add remote.two.push refs/heads/main:refs/heads/another &&
 		git remote show origin two >output &&
 		git branch -d rebase octopus &&
 		test_i18ncmp expect output
@@ -274,7 +274,7 @@ cat >test/expect <<EOF
   Push  URL: $(pwd)/one
   HEAD branch: (not queried)
   Remote branches: (status not queried)
-    master
+    main
     side
   Local branches configured for 'git pull':
     ahead merges with remote main
@@ -322,7 +322,7 @@ test_expect_success 'set-head --auto' '
 	(
 		cd test &&
 		git remote set-head --auto origin &&
-		echo refs/remotes/origin/master >expect &&
+		echo refs/remotes/origin/main >expect &&
 		git symbolic-ref refs/remotes/origin/HEAD >output &&
 		test_cmp expect output
 	)
@@ -333,7 +333,7 @@ test_expect_success PREPARE_FOR_MAIN_BRANCH 'set-head --auto has no problem w/mu
 		cd test &&
 		git fetch two "refs/heads/*:refs/remotes/two/*" &&
 		git remote set-head --auto two >output 2>&1 &&
-		echo "two/HEAD set to master" >expect &&
+		echo "two/HEAD set to main" >expect &&
 		test_i18ncmp expect output
 	)
 '
@@ -347,7 +347,7 @@ test_expect_success 'set-head explicit' '
 		cd test &&
 		git remote set-head origin side2 &&
 		git symbolic-ref refs/remotes/origin/HEAD >output &&
-		git remote set-head origin master &&
+		git remote set-head origin main &&
 		test_cmp expect output
 	)
 '
@@ -410,7 +410,7 @@ test_expect_success 'fetch mirrors act as mirrors during fetch' '
 	(
 		cd mirror-fetch/parent &&
 		git branch new &&
-		git branch -m master renamed
+		git branch -m main renamed
 	) &&
 	(
 		cd mirror-fetch/child &&
@@ -424,7 +424,7 @@ test_expect_success 'fetch mirrors can prune' '
 	(
 		cd mirror-fetch/child &&
 		git remote prune parent &&
-		test_must_fail git rev-parse --verify refs/heads/master
+		test_must_fail git rev-parse --verify refs/heads/main
 	)
 '
 
@@ -477,14 +477,14 @@ test_expect_success 'push mirrors act as mirrors during push' '
 	(
 		cd mirror-push/private &&
 		git branch new &&
-		git branch -m master renamed &&
+		git branch -m main renamed &&
 		git push public
 	) &&
 	(
 		cd mirror-push/private &&
 		git rev-parse --verify refs/heads/new &&
 		git rev-parse --verify refs/heads/renamed &&
-		test_must_fail git rev-parse --verify refs/heads/master
+		test_must_fail git rev-parse --verify refs/heads/main
 	)
 '
 
@@ -610,10 +610,10 @@ test_expect_success 'reject --no-no-tags' '
 '
 
 cat >one/expect <<\EOF
-  apis/master
+  apis/main
   apis/side
   drosophila/another
-  drosophila/master
+  drosophila/main
   drosophila/side
 EOF
 
@@ -630,11 +630,11 @@ test_expect_success 'update' '
 
 cat >one/expect <<\EOF
   drosophila/another
-  drosophila/master
+  drosophila/main
   drosophila/side
-  manduca/master
+  manduca/main
   manduca/side
-  megaloprepus/master
+  megaloprepus/main
   megaloprepus/side
 EOF
 
@@ -673,11 +673,11 @@ test_expect_success 'update --prune' '
 '
 
 cat >one/expect <<-\EOF
-  apis/master
+  apis/main
   apis/side
-  manduca/master
+  manduca/main
   manduca/side
-  megaloprepus/master
+  megaloprepus/main
   megaloprepus/side
 EOF
 
@@ -697,7 +697,7 @@ test_expect_success 'update default' '
 
 cat >one/expect <<\EOF
   drosophila/another
-  drosophila/master
+  drosophila/main
   drosophila/side
 EOF
 
@@ -751,14 +751,14 @@ test_expect_success 'rename a remote' '
 	git clone one four &&
 	(
 		cd four &&
-		git config branch.master.pushRemote origin &&
+		git config branch.main.pushRemote origin &&
 		git remote rename origin upstream &&
 		test -z "$(git for-each-ref refs/remotes/origin)" &&
-		test "$(git symbolic-ref refs/remotes/upstream/HEAD)" = "refs/remotes/upstream/master" &&
-		test "$(git rev-parse upstream/master)" = "$(git rev-parse master)" &&
+		test "$(git symbolic-ref refs/remotes/upstream/HEAD)" = "refs/remotes/upstream/main" &&
+		test "$(git rev-parse upstream/main)" = "$(git rev-parse main)" &&
 		test "$(git config remote.upstream.fetch)" = "+refs/heads/*:refs/remotes/upstream/*" &&
-		test "$(git config branch.master.remote)" = "upstream" &&
-		test "$(git config branch.master.pushRemote)" = "upstream" &&
+		test "$(git config branch.main.remote)" = "upstream" &&
+		test "$(git config branch.main.pushRemote)" = "upstream" &&
 		test "$(git config --global remote.pushDefault)" = "origin"
 	)
 '
@@ -804,7 +804,7 @@ test_expect_success 'rename does not update a non-default fetch refspec' '
 		git config remote.origin.fetch +refs/heads/*:refs/heads/origin/* &&
 		git remote rename origin upstream &&
 		test "$(git config remote.upstream.fetch)" = "+refs/heads/*:refs/heads/origin/*" &&
-		git rev-parse -q origin/master
+		git rev-parse -q origin/main
 	)
 '
 
@@ -824,7 +824,7 @@ test_expect_success 'rename a remote with name prefix of other remote' '
 		cd four.three &&
 		git remote add o git://example.com/repo.git &&
 		git remote rename o upstream &&
-		test "$(git rev-parse origin/master)" = "$(git rev-parse master)"
+		test "$(git rev-parse origin/main)" = "$(git rev-parse main)"
 	)
 '
 
@@ -840,11 +840,11 @@ test_expect_success 'remove a remote' '
 	git clone one four.five &&
 	(
 		cd four.five &&
-		git config branch.master.pushRemote origin &&
+		git config branch.main.pushRemote origin &&
 		git remote remove origin &&
 		test -z "$(git for-each-ref refs/remotes/origin)" &&
-		test_must_fail git config branch.master.remote &&
-		test_must_fail git config branch.master.pushRemote &&
+		test_must_fail git config branch.main.remote &&
+		test_must_fail git config branch.main.pushRemote &&
 		test "$(git config --global remote.pushDefault)" = "origin"
 	)
 '
@@ -885,9 +885,9 @@ test_expect_success 'remove a remote removes repo remote.pushDefault but keeps g
 
 cat >remotes_origin <<EOF
 URL: $(pwd)/one
-Push: refs/heads/master:refs/heads/upstream
+Push: refs/heads/main:refs/heads/upstream
 Push: refs/heads/next:refs/heads/upstream2
-Pull: refs/heads/master:refs/heads/origin
+Pull: refs/heads/main:refs/heads/origin
 Pull: refs/heads/next:refs/heads/origin2
 EOF
 
@@ -903,11 +903,11 @@ test_expect_success 'migrate a remote from named file in $GIT_DIR/remotes' '
 		test_path_is_missing .git/remotes/origin &&
 		test "$(git config remote.origin.url)" = "$origin_url" &&
 		cat >push_expected <<-\EOF &&
-		refs/heads/master:refs/heads/upstream
+		refs/heads/main:refs/heads/upstream
 		refs/heads/next:refs/heads/upstream2
 		EOF
 		cat >fetch_expected <<-\EOF &&
-		refs/heads/master:refs/heads/origin
+		refs/heads/main:refs/heads/origin
 		refs/heads/next:refs/heads/origin2
 		EOF
 		git config --get-all remote.origin.push >push_actual &&
@@ -927,8 +927,8 @@ test_expect_success 'migrate a remote from named file in $GIT_DIR/branches' '
 		git remote rename origin origin &&
 		test_path_is_missing .git/branches/origin &&
 		test "$(git config remote.origin.url)" = "$origin_url" &&
-		test "$(git config remote.origin.fetch)" = "refs/heads/master:refs/heads/origin" &&
-		test "$(git config remote.origin.push)" = "HEAD:refs/heads/master"
+		test "$(git config remote.origin.fetch)" = "refs/heads/main:refs/heads/origin" &&
+		test "$(git config remote.origin.push)" = "HEAD:refs/heads/main"
 	)
 '
 
@@ -951,7 +951,7 @@ test_expect_success 'remote prune to cause a dangling symref' '
 	(
 		cd one &&
 		git checkout side2 &&
-		git branch -D master
+		git branch -D main
 	) &&
 	(
 		cd eight &&
@@ -994,22 +994,22 @@ test_expect_success 'remote set-branches' '
 	EOF
 	sort <<-\EOF >expect.replace &&
 	+refs/heads/maint:refs/remotes/scratch/maint
-	+refs/heads/master:refs/remotes/scratch/master
+	+refs/heads/main:refs/remotes/scratch/main
 	+refs/heads/next:refs/remotes/scratch/next
 	EOF
 	sort <<-\EOF >expect.add-two &&
 	+refs/heads/maint:refs/remotes/scratch/maint
-	+refs/heads/master:refs/remotes/scratch/master
+	+refs/heads/main:refs/remotes/scratch/main
 	+refs/heads/next:refs/remotes/scratch/next
 	+refs/heads/seen:refs/remotes/scratch/seen
 	+refs/heads/t/topic:refs/remotes/scratch/t/topic
 	EOF
 	sort <<-\EOF >expect.setup-ffonly &&
-	refs/heads/master:refs/remotes/scratch/master
+	refs/heads/main:refs/remotes/scratch/main
 	+refs/heads/next:refs/remotes/scratch/next
 	EOF
 	sort <<-\EOF >expect.respect-ffonly &&
-	refs/heads/master:refs/remotes/scratch/master
+	refs/heads/main:refs/remotes/scratch/main
 	+refs/heads/next:refs/remotes/scratch/next
 	+refs/heads/seen:refs/remotes/scratch/seen
 	EOF
@@ -1025,7 +1025,7 @@ test_expect_success 'remote set-branches' '
 		git config --get-all remote.scratch.fetch >config-result &&
 		sort <config-result >../actual.add &&
 
-		git remote set-branches scratch maint master next &&
+		git remote set-branches scratch maint main next &&
 		git config --get-all remote.scratch.fetch >config-result &&
 		sort <config-result >../actual.replace &&
 
@@ -1035,7 +1035,7 @@ test_expect_success 'remote set-branches' '
 
 		git config --unset-all remote.scratch.fetch &&
 		git config remote.scratch.fetch \
-			refs/heads/master:refs/remotes/scratch/master &&
+			refs/heads/main:refs/remotes/scratch/main &&
 		git config --add remote.scratch.fetch \
 			+refs/heads/next:refs/remotes/scratch/next &&
 		git config --get-all remote.scratch.fetch >config-result &&
@@ -1055,14 +1055,14 @@ test_expect_success 'remote set-branches' '
 
 test_expect_success 'remote set-branches with --mirror' '
 	echo "+refs/*:refs/*" >expect.initial &&
-	echo "+refs/heads/master:refs/heads/master" >expect.replace &&
+	echo "+refs/heads/main:refs/heads/main" >expect.replace &&
 	git clone --mirror .git/ setbranches-mirror &&
 	(
 		cd setbranches-mirror &&
 		git remote rename origin scratch &&
 		git config --get-all remote.scratch.fetch >../actual.initial &&
 
-		git remote set-branches scratch heads/master &&
+		git remote set-branches scratch heads/main &&
 		git config --get-all remote.scratch.fetch >../actual.replace
 	) &&
 	test_cmp expect.initial actual.initial &&
@@ -1308,7 +1308,7 @@ test_extra_arg () {
 test_extra_arg add nick url
 test_extra_arg rename origin newname
 test_extra_arg remove origin
-test_extra_arg set-head origin master
+test_extra_arg set-head origin main
 # set-branches takes any number of args
 test_extra_arg get-url origin newurl
 test_extra_arg set-url origin newurl oldurl
@@ -1325,7 +1325,7 @@ test_expect_success 'unqualified <dst> refspec DWIM and advice' '
 	test_when_finished "(cd test && git tag -d some-tag)" &&
 	(
 		cd test &&
-		git tag -a -m "Some tag" some-tag master &&
+		git tag -a -m "Some tag" some-tag main &&
 		exit_with=true &&
 		for type in commit tag tree blob
 		do
@@ -1351,7 +1351,7 @@ test_expect_success 'unqualified <dst> refspec DWIM and advice' '
 test_expect_success PREPARE_FOR_MAIN_BRANCH 'refs/remotes/* <src> refspec and unqualified <dst> DWIM and advice' '
 	(
 		cd two &&
-		git tag -a -m "Some tag" my-tag master &&
+		git tag -a -m "Some tag" my-tag main &&
 		git update-ref refs/trees/my-head-tree HEAD^{tree} &&
 		git update-ref refs/blobs/my-file-blob HEAD:file
 	) &&
diff --git a/t/t5506-remote-groups.sh b/t/t5506-remote-groups.sh
index 83d5558c0e..f2df3944e0 100755
--- a/t/t5506-remote-groups.sh
+++ b/t/t5506-remote-groups.sh
@@ -31,8 +31,8 @@ repo_fetched() {
 test_expect_success 'setup' '
 	mkdir one && (cd one && git init) &&
 	mkdir two && (cd two && git init) &&
-	git remote add -m master one one &&
-	git remote add -m master two two
+	git remote add -m main one one &&
+	git remote add -m main two two
 '
 
 test_expect_success 'no group updates all' '
diff --git a/t/t5509-fetch-push-namespaces.sh b/t/t5509-fetch-push-namespaces.sh
index a67f792adf..ad4a3f5c6e 100755
--- a/t/t5509-fetch-push-namespaces.sh
+++ b/t/t5509-fetch-push-namespaces.sh
@@ -27,9 +27,9 @@ test_expect_success setup '
 test_expect_success 'pushing into a repository using a ref namespace' '
 	(
 		cd original &&
-		git push pushee-namespaced master &&
+		git push pushee-namespaced main &&
 		git ls-remote pushee-namespaced >actual &&
-		printf "$commit1\trefs/heads/master\n" >expected &&
+		printf "$commit1\trefs/heads/main\n" >expected &&
 		test_cmp expected actual &&
 		git push pushee-namespaced --tags &&
 		git ls-remote pushee-namespaced >actual &&
@@ -56,7 +56,7 @@ test_expect_success 'pulling from a repository using a ref namespace' '
 		cd puller &&
 		git remote add -f pushee-namespaced "ext::git --namespace=namespace %s ../pushee" &&
 		git for-each-ref refs/ >actual &&
-		printf "$commit1 commit\trefs/remotes/pushee-namespaced/master\n" >expected &&
+		printf "$commit1 commit\trefs/remotes/pushee-namespaced/main\n" >expected &&
 		printf "$commit0 commit\trefs/tags/0\n" >>expected &&
 		printf "$commit1 commit\trefs/tags/1\n" >>expected &&
 		test_cmp expected actual
@@ -76,7 +76,7 @@ test_expect_success 'mirroring a repository using a ref namespace' '
 	(
 		cd mirror &&
 		git for-each-ref refs/ >actual &&
-		printf "$commit1 commit\trefs/namespaces/namespace/refs/heads/master\n" >expected &&
+		printf "$commit1 commit\trefs/namespaces/namespace/refs/heads/main\n" >expected &&
 		printf "$commit0 commit\trefs/namespaces/namespace/refs/tags/0\n" >>expected &&
 		printf "$commit1 commit\trefs/namespaces/namespace/refs/tags/1\n" >>expected &&
 		test_cmp expected actual
@@ -87,7 +87,7 @@ test_expect_success 'hide namespaced refs with transfer.hideRefs' '
 	GIT_NAMESPACE=namespace \
 		git -C pushee -c transfer.hideRefs=refs/tags \
 		ls-remote "ext::git %s ." >actual &&
-	printf "$commit1\trefs/heads/master\n" >expected &&
+	printf "$commit1\trefs/heads/main\n" >expected &&
 	test_cmp expected actual
 '
 
@@ -95,7 +95,7 @@ test_expect_success 'check that transfer.hideRefs does not match unstripped refs
 	GIT_NAMESPACE=namespace \
 		git -C pushee -c transfer.hideRefs=refs/namespaces/namespace/refs/tags \
 		ls-remote "ext::git %s ." >actual &&
-	printf "$commit1\trefs/heads/master\n" >expected &&
+	printf "$commit1\trefs/heads/main\n" >expected &&
 	printf "$commit0\trefs/tags/0\n" >>expected &&
 	printf "$commit1\trefs/tags/1\n" >>expected &&
 	test_cmp expected actual
@@ -105,23 +105,23 @@ test_expect_success 'hide full refs with transfer.hideRefs' '
 	GIT_NAMESPACE=namespace \
 		git -C pushee -c transfer.hideRefs="^refs/namespaces/namespace/refs/tags" \
 		ls-remote "ext::git %s ." >actual &&
-	printf "$commit1\trefs/heads/master\n" >expected &&
+	printf "$commit1\trefs/heads/main\n" >expected &&
 	test_cmp expected actual
 '
 
 test_expect_success 'try to update a hidden ref' '
-	test_config -C pushee transfer.hideRefs refs/heads/master &&
-	test_must_fail git -C original push pushee-namespaced master
+	test_config -C pushee transfer.hideRefs refs/heads/main &&
+	test_must_fail git -C original push pushee-namespaced main
 '
 
 test_expect_success 'try to update a ref that is not hidden' '
-	test_config -C pushee transfer.hideRefs refs/namespaces/namespace/refs/heads/master &&
-	git -C original push pushee-namespaced master
+	test_config -C pushee transfer.hideRefs refs/namespaces/namespace/refs/heads/main &&
+	git -C original push pushee-namespaced main
 '
 
 test_expect_success 'try to update a hidden full ref' '
-	test_config -C pushee transfer.hideRefs "^refs/namespaces/namespace/refs/heads/master" &&
-	test_must_fail git -C original push pushee-namespaced master
+	test_config -C pushee transfer.hideRefs "^refs/namespaces/namespace/refs/heads/main" &&
+	test_must_fail git -C original push pushee-namespaced main
 '
 
 test_expect_success 'set up ambiguous HEAD' '
@@ -157,9 +157,9 @@ test_expect_success 'denyCurrentBranch and unborn branch with ref namespace' '
 		cd original &&
 		git init unborn &&
 		git remote add unborn-namespaced "ext::git --namespace=namespace %s unborn" &&
-		test_must_fail git push unborn-namespaced HEAD:master &&
+		test_must_fail git push unborn-namespaced HEAD:main &&
 		git -C unborn config receive.denyCurrentBranch updateInstead &&
-		git push unborn-namespaced HEAD:master
+		git push unborn-namespaced HEAD:main
 	)
 '
 
diff --git a/t/test-lib.sh b/t/test-lib.sh
index 155bfad454..ca86f666e6 100644
--- a/t/test-lib.sh
+++ b/t/test-lib.sh
@@ -263,7 +263,7 @@ case "$TEST_NUMBER" in
 	GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
 	export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 	;;
-[0-4]*|5[0-4]*)
+[0-4]*|5[0-4]*|550*)
 	GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 	export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 	;;
-- 
gitgitgadget


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH 13/28] t551*: adjust the references to the default branch name "main"
  2020-11-12 22:43 [PATCH 00/28] Use main as default branch name Johannes Schindelin via GitGitGadget
                   ` (11 preceding siblings ...)
  2020-11-12 22:43 ` [PATCH 12/28] t550*: adjust the references to the default branch name "main" Johannes Schindelin via GitGitGadget
@ 2020-11-12 22:43 ` Johannes Schindelin via GitGitGadget
  2020-11-12 22:43 ` [PATCH 14/28] t55[23]*: " Johannes Schindelin via GitGitGadget
                   ` (19 subsequent siblings)
  32 siblings, 0 replies; 163+ messages in thread
From: Johannes Schindelin via GitGitGadget @ 2020-11-12 22:43 UTC (permalink / raw)
  To: git; +Cc: Johannes Schindelin, Johannes Schindelin

From: Johannes Schindelin <johannes.schindelin@gmx.de>

This trick was performed via

	$ (cd t &&
	   sed -i -e 's/master/main/g' -e 's/MASTER/MAIN/g' \
		-e 's/Master/Main/g' -- t551*.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>
---
 t/t5510-fetch.sh             | 158 +++++------
 t/t5511-refspec.sh           |  12 +-
 t/t5512-ls-remote.sh         |  26 +-
 t/t5514-fetch-multiple.sh    |  30 +--
 t/t5516-fetch-push.sh        | 500 +++++++++++++++++------------------
 t/t5517-push-mirror.sh       | 124 ++++-----
 t/t5518-fetch-exit-status.sh |   6 +-
 t/t5519-push-alternates.sh   |  12 +-
 t/test-lib.sh                |   2 +-
 9 files changed, 435 insertions(+), 435 deletions(-)

diff --git a/t/t5510-fetch.sh b/t/t5510-fetch.sh
index 5d673358f9..206e3be695 100755
--- a/t/t5510-fetch.sh
+++ b/t/t5510-fetch.sh
@@ -37,19 +37,19 @@ test_expect_success "clone and setup child repos" '
 	git clone . two &&
 	(
 		cd two &&
-		git config branch.master.remote one &&
+		git config branch.main.remote one &&
 		git config remote.one.url ../one/.git/ &&
-		git config remote.one.fetch refs/heads/master:refs/heads/one
+		git config remote.one.fetch refs/heads/main:refs/heads/one
 	) &&
 	git clone . three &&
 	(
 		cd three &&
-		git config branch.master.remote two &&
-		git config branch.master.merge refs/heads/one &&
+		git config branch.main.remote two &&
+		git config branch.main.merge refs/heads/one &&
 		mkdir -p .git/remotes &&
 		{
 			echo "URL: ../two/.git/"
-			echo "Pull: refs/heads/master:refs/heads/two"
+			echo "Pull: refs/heads/main:refs/heads/two"
 			echo "Pull: refs/heads/one:refs/heads/one"
 		} >.git/remotes/two
 	) &&
@@ -65,7 +65,7 @@ test_expect_success "fetch test" '
 	git fetch &&
 	git rev-parse --verify refs/heads/one &&
 	mine=$(git rev-parse refs/heads/one) &&
-	his=$(cd ../one && git rev-parse refs/heads/master) &&
+	his=$(cd ../one && git rev-parse refs/heads/main) &&
 	test "z$mine" = "z$his"
 '
 
@@ -75,11 +75,11 @@ test_expect_success "fetch test for-merge" '
 	git fetch &&
 	git rev-parse --verify refs/heads/two &&
 	git rev-parse --verify refs/heads/one &&
-	master_in_two=$(cd ../two && git rev-parse master) &&
+	main_in_two=$(cd ../two && git rev-parse main) &&
 	one_in_two=$(cd ../two && git rev-parse one) &&
 	{
 		echo "$one_in_two	"
-		echo "$master_in_two	not-for-merge"
+		echo "$main_in_two	not-for-merge"
 	} >expected &&
 	cut -f -2 .git/FETCH_HEAD >actual &&
 	test_cmp expected actual'
@@ -88,7 +88,7 @@ test_expect_success 'fetch --prune on its own works as expected' '
 	cd "$D" &&
 	git clone . prune &&
 	cd prune &&
-	git update-ref refs/remotes/origin/extrabranch master &&
+	git update-ref refs/remotes/origin/extrabranch main &&
 
 	git fetch --prune origin &&
 	test_must_fail git rev-parse origin/extrabranch
@@ -98,9 +98,9 @@ test_expect_success 'fetch --prune with a branch name keeps branches' '
 	cd "$D" &&
 	git clone . prune-branch &&
 	cd prune-branch &&
-	git update-ref refs/remotes/origin/extrabranch master &&
+	git update-ref refs/remotes/origin/extrabranch main &&
 
-	git fetch --prune origin master &&
+	git fetch --prune origin main &&
 	git rev-parse origin/extrabranch
 '
 
@@ -110,18 +110,18 @@ test_expect_success 'fetch --prune with a namespace keeps other namespaces' '
 	cd prune-namespace &&
 
 	git fetch --prune origin refs/heads/a/*:refs/remotes/origin/a/* &&
-	git rev-parse origin/master
+	git rev-parse origin/main
 '
 
 test_expect_success 'fetch --prune handles overlapping refspecs' '
 	cd "$D" &&
-	git update-ref refs/pull/42/head master &&
+	git update-ref refs/pull/42/head main &&
 	git clone . prune-overlapping &&
 	cd prune-overlapping &&
 	git config --add remote.origin.fetch refs/pull/*/head:refs/remotes/origin/pr/* &&
 
 	git fetch --prune origin &&
-	git rev-parse origin/master &&
+	git rev-parse origin/main &&
 	git rev-parse origin/pr/42 &&
 
 	git config --unset-all remote.origin.fetch &&
@@ -129,7 +129,7 @@ test_expect_success 'fetch --prune handles overlapping refspecs' '
 	git config --add remote.origin.fetch refs/heads/*:refs/remotes/origin/* &&
 
 	git fetch --prune origin &&
-	git rev-parse origin/master &&
+	git rev-parse origin/main &&
 	git rev-parse origin/pr/42
 '
 
@@ -137,13 +137,13 @@ test_expect_success 'fetch --prune --tags prunes branches but not tags' '
 	cd "$D" &&
 	git clone . prune-tags &&
 	cd prune-tags &&
-	git tag sometag master &&
+	git tag sometag main &&
 	# Create what looks like a remote-tracking branch from an earlier
 	# fetch that has since been deleted from the remote:
-	git update-ref refs/remotes/origin/fake-remote master &&
+	git update-ref refs/remotes/origin/fake-remote main &&
 
 	git fetch --prune --tags origin &&
-	git rev-parse origin/master &&
+	git rev-parse origin/main &&
 	test_must_fail git rev-parse origin/fake-remote &&
 	git rev-parse sometag
 '
@@ -152,10 +152,10 @@ test_expect_success 'fetch --prune --tags with branch does not prune other thing
 	cd "$D" &&
 	git clone . prune-tags-branch &&
 	cd prune-tags-branch &&
-	git tag sometag master &&
-	git update-ref refs/remotes/origin/extrabranch master &&
+	git tag sometag main &&
+	git update-ref refs/remotes/origin/extrabranch main &&
 
-	git fetch --prune --tags origin master &&
+	git fetch --prune --tags origin main &&
 	git rev-parse origin/extrabranch &&
 	git rev-parse sometag
 '
@@ -164,9 +164,9 @@ test_expect_success 'fetch --prune --tags with refspec prunes based on refspec'
 	cd "$D" &&
 	git clone . prune-tags-refspec &&
 	cd prune-tags-refspec &&
-	git tag sometag master &&
-	git update-ref refs/remotes/origin/foo/otherbranch master &&
-	git update-ref refs/remotes/origin/extrabranch master &&
+	git tag sometag main &&
+	git update-ref refs/remotes/origin/foo/otherbranch main &&
+	git update-ref refs/remotes/origin/extrabranch main &&
 
 	git fetch --prune --tags origin refs/heads/foo/*:refs/remotes/origin/foo/* &&
 	test_must_fail git rev-parse refs/remotes/origin/foo/otherbranch &&
@@ -177,20 +177,20 @@ test_expect_success 'fetch --prune --tags with refspec prunes based on refspec'
 test_expect_success '--refmap="" ignores configured refspec' '
 	cd "$TRASH_DIRECTORY" &&
 	git clone "$D" remote-refs &&
-	git -C remote-refs rev-parse remotes/origin/master >old &&
-	git -C remote-refs update-ref refs/remotes/origin/master master~1 &&
-	git -C remote-refs rev-parse remotes/origin/master >new &&
+	git -C remote-refs rev-parse remotes/origin/main >old &&
+	git -C remote-refs update-ref refs/remotes/origin/main main~1 &&
+	git -C remote-refs rev-parse remotes/origin/main >new &&
 	git -C remote-refs fetch --refmap= origin "+refs/heads/*:refs/hidden/origin/*" &&
-	git -C remote-refs rev-parse remotes/origin/master >actual &&
+	git -C remote-refs rev-parse remotes/origin/main >actual &&
 	test_cmp new actual &&
 	git -C remote-refs fetch origin &&
-	git -C remote-refs rev-parse remotes/origin/master >actual &&
+	git -C remote-refs rev-parse remotes/origin/main >actual &&
 	test_cmp old actual
 '
 
 test_expect_success '--refmap="" and --prune' '
-	git -C remote-refs update-ref refs/remotes/origin/foo/otherbranch master &&
-	git -C remote-refs update-ref refs/hidden/foo/otherbranch master &&
+	git -C remote-refs update-ref refs/remotes/origin/foo/otherbranch main &&
+	git -C remote-refs update-ref refs/hidden/foo/otherbranch main &&
 	git -C remote-refs fetch --prune --refmap="" origin +refs/heads/*:refs/hidden/* &&
 	git -C remote-refs rev-parse remotes/origin/foo/otherbranch &&
 	test_must_fail git -C remote-refs rev-parse refs/hidden/foo/otherbranch &&
@@ -250,7 +250,7 @@ test_expect_success 'fetch uses remote ref names to describe new refs' '
 		test_i18ngrep "new tag.* -> descriptive-tag$" actual &&
 		test_i18ngrep "new ref.* -> crazy$" actual
 	) &&
-	git checkout master
+	git checkout main
 '
 
 test_expect_success 'fetch must not resolve short tag name' '
@@ -281,7 +281,7 @@ test_expect_success 'create bundle 1' '
 	cd "$D" &&
 	echo >file updated again by origin &&
 	git commit -a -m "tip" &&
-	git bundle create --version=3 bundle1 master^..master
+	git bundle create --version=3 bundle1 main^..main
 '
 
 test_expect_success 'header of bundle looks right' '
@@ -289,7 +289,7 @@ test_expect_success 'header of bundle looks right' '
 	# v3 git bundle
 	@object-format=$(test_oid algo)
 	-OID updated by origin
-	OID refs/heads/master
+	OID refs/heads/main
 
 	EOF
 	sed -e "s/$OID_REGEX/OID/g" -e "5q" "$D"/bundle1 >actual &&
@@ -298,13 +298,13 @@ test_expect_success 'header of bundle looks right' '
 
 test_expect_success 'create bundle 2' '
 	cd "$D" &&
-	git bundle create bundle2 master~2..master
+	git bundle create bundle2 main~2..main
 '
 
 test_expect_success 'unbundle 1' '
 	cd "$D/bundle" &&
 	git checkout -b some-branch &&
-	test_must_fail git fetch "$D/bundle1" master:master
+	test_must_fail git fetch "$D/bundle1" main:main
 '
 
 
@@ -317,8 +317,8 @@ test_expect_success 'bundle 1 has only 3 files ' '
 
 test_expect_success 'unbundle 2' '
 	cd "$D/bundle" &&
-	git fetch ../bundle2 master:master &&
-	test "tip" = "$(git log -1 --pretty=oneline master | cut -d" " -f2)"
+	git fetch ../bundle2 main:main &&
+	test "tip" = "$(git log -1 --pretty=oneline main | cut -d" " -f2)"
 '
 
 test_expect_success 'bundle does not prerequisite objects' '
@@ -335,14 +335,14 @@ test_expect_success 'bundle does not prerequisite objects' '
 test_expect_success 'bundle should be able to create a full history' '
 
 	cd "$D" &&
-	git tag -a -m "1.0" v1.0 master &&
+	git tag -a -m "1.0" v1.0 main &&
 	git bundle create bundle4 v1.0
 
 '
 
 test_expect_success 'fetch with a non-applying branch.<name>.merge' '
-	git config branch.master.remote yeti &&
-	git config branch.master.merge refs/heads/bigfoot &&
+	git config branch.main.remote yeti &&
+	git config branch.main.merge refs/heads/bigfoot &&
 	git config remote.blub.url one &&
 	git config remote.blub.fetch "refs/heads/*:refs/remotes/one/*" &&
 	git fetch blub
@@ -362,8 +362,8 @@ test_expect_success 'fetch from GIT URL with a non-applying branch.<name>.merge
 # the merge spec matches the branch the remote HEAD points to
 test_expect_success 'fetch from GIT URL with a non-applying branch.<name>.merge [2]' '
 	one_ref=$(cd one && git symbolic-ref HEAD) &&
-	git config branch.master.remote blub &&
-	git config branch.master.merge "$one_ref" &&
+	git config branch.main.remote blub &&
+	git config branch.main.merge "$one_ref" &&
 	git update-ref -d FETCH_HEAD &&
 	git fetch one &&
 	test $one_head = "$(git rev-parse --verify FETCH_HEAD)" &&
@@ -373,7 +373,7 @@ test_expect_success 'fetch from GIT URL with a non-applying branch.<name>.merge
 # URL supplied to fetch matches the url of the configured branch's remote, but
 # the merge spec does not match the branch the remote HEAD points to
 test_expect_success 'fetch from GIT URL with a non-applying branch.<name>.merge [3]' '
-	git config branch.master.merge "${one_ref}_not" &&
+	git config branch.main.merge "${one_ref}_not" &&
 	git update-ref -d FETCH_HEAD &&
 	git fetch one &&
 	test $one_head = "$(git rev-parse --verify FETCH_HEAD)" &&
@@ -389,9 +389,9 @@ test_expect_success 'quoting of a strangely named repo' '
 test_expect_success 'bundle should record HEAD correctly' '
 
 	cd "$D" &&
-	git bundle create bundle5 HEAD master &&
+	git bundle create bundle5 HEAD main &&
 	git bundle list-heads bundle5 >actual &&
-	for h in HEAD refs/heads/master
+	for h in HEAD refs/heads/main
 	do
 		echo "$(git rev-parse --verify $h) $h"
 	done >expect &&
@@ -399,10 +399,10 @@ test_expect_success 'bundle should record HEAD correctly' '
 
 '
 
-test_expect_success 'mark initial state of origin/master' '
+test_expect_success 'mark initial state of origin/main' '
 	(
 		cd three &&
-		git tag base-origin-master refs/remotes/origin/master
+		git tag base-origin-main refs/remotes/origin/main
 	)
 '
 
@@ -412,10 +412,10 @@ test_expect_success 'explicit fetch should update tracking' '
 	git branch -f side &&
 	(
 		cd three &&
-		git update-ref refs/remotes/origin/master base-origin-master &&
-		o=$(git rev-parse --verify refs/remotes/origin/master) &&
-		git fetch origin master &&
-		n=$(git rev-parse --verify refs/remotes/origin/master) &&
+		git update-ref refs/remotes/origin/main base-origin-main &&
+		o=$(git rev-parse --verify refs/remotes/origin/main) &&
+		git fetch origin main &&
+		n=$(git rev-parse --verify refs/remotes/origin/main) &&
 		test "$o" != "$n" &&
 		test_must_fail git rev-parse --verify refs/remotes/origin/side
 	)
@@ -427,10 +427,10 @@ test_expect_success 'explicit pull should update tracking' '
 	git branch -f side &&
 	(
 		cd three &&
-		git update-ref refs/remotes/origin/master base-origin-master &&
-		o=$(git rev-parse --verify refs/remotes/origin/master) &&
-		git pull origin master &&
-		n=$(git rev-parse --verify refs/remotes/origin/master) &&
+		git update-ref refs/remotes/origin/main base-origin-main &&
+		o=$(git rev-parse --verify refs/remotes/origin/main) &&
+		git pull origin main &&
+		n=$(git rev-parse --verify refs/remotes/origin/main) &&
 		test "$o" != "$n" &&
 		test_must_fail git rev-parse --verify refs/remotes/origin/side
 	)
@@ -449,13 +449,13 @@ test_expect_success 'explicit --refmap option overrides remote.*.fetch' '
 	git branch -f side &&
 	(
 		cd three &&
-		git update-ref refs/remotes/origin/master base-origin-master &&
-		o=$(git rev-parse --verify refs/remotes/origin/master) &&
-		git fetch --refmap="refs/heads/*:refs/remotes/other/*" origin master &&
-		n=$(git rev-parse --verify refs/remotes/origin/master) &&
+		git update-ref refs/remotes/origin/main base-origin-main &&
+		o=$(git rev-parse --verify refs/remotes/origin/main) &&
+		git fetch --refmap="refs/heads/*:refs/remotes/other/*" origin main &&
+		n=$(git rev-parse --verify refs/remotes/origin/main) &&
 		test "$o" = "$n" &&
 		test_must_fail git rev-parse --verify refs/remotes/origin/side &&
-		git rev-parse --verify refs/remotes/other/master
+		git rev-parse --verify refs/remotes/other/main
 	)
 '
 
@@ -464,10 +464,10 @@ test_expect_success 'explicitly empty --refmap option disables remote.*.fetch' '
 	git branch -f side &&
 	(
 		cd three &&
-		git update-ref refs/remotes/origin/master base-origin-master &&
-		o=$(git rev-parse --verify refs/remotes/origin/master) &&
-		git fetch --refmap="" origin master &&
-		n=$(git rev-parse --verify refs/remotes/origin/master) &&
+		git update-ref refs/remotes/origin/main base-origin-main &&
+		o=$(git rev-parse --verify refs/remotes/origin/main) &&
+		git fetch --refmap="" origin main &&
+		n=$(git rev-parse --verify refs/remotes/origin/main) &&
 		test "$o" = "$n" &&
 		test_must_fail git rev-parse --verify refs/remotes/origin/side
 	)
@@ -479,10 +479,10 @@ test_expect_success 'configured fetch updates tracking' '
 	git branch -f side &&
 	(
 		cd three &&
-		git update-ref refs/remotes/origin/master base-origin-master &&
-		o=$(git rev-parse --verify refs/remotes/origin/master) &&
+		git update-ref refs/remotes/origin/main base-origin-main &&
+		o=$(git rev-parse --verify refs/remotes/origin/main) &&
 		git fetch origin &&
-		n=$(git rev-parse --verify refs/remotes/origin/master) &&
+		n=$(git rev-parse --verify refs/remotes/origin/main) &&
 		test "$o" != "$n" &&
 		git rev-parse --verify refs/remotes/origin/side
 	)
@@ -493,12 +493,12 @@ test_expect_success 'non-matching refspecs do not confuse tracking update' '
 	git update-ref refs/odd/location HEAD &&
 	(
 		cd three &&
-		git update-ref refs/remotes/origin/master base-origin-master &&
+		git update-ref refs/remotes/origin/main base-origin-main &&
 		git config --add remote.origin.fetch \
 			refs/odd/location:refs/remotes/origin/odd &&
-		o=$(git rev-parse --verify refs/remotes/origin/master) &&
-		git fetch origin master &&
-		n=$(git rev-parse --verify refs/remotes/origin/master) &&
+		o=$(git rev-parse --verify refs/remotes/origin/main) &&
+		git fetch origin main &&
+		n=$(git rev-parse --verify refs/remotes/origin/main) &&
 		test "$o" != "$n" &&
 		test_must_fail git rev-parse --verify refs/remotes/origin/odd
 	)
@@ -524,7 +524,7 @@ test_expect_success 'auto tag following fetches minimum' '
 			git tag -a -m $i excess-$i || exit 1
 		done
 	) &&
-	git checkout master &&
+	git checkout main &&
 	(
 		cd follow &&
 		git fetch
@@ -533,13 +533,13 @@ test_expect_success 'auto tag following fetches minimum' '
 
 test_expect_success 'refuse to fetch into the current branch' '
 
-	test_must_fail git fetch . side:master
+	test_must_fail git fetch . side:main
 
 '
 
 test_expect_success 'fetch into the current branch with --update-head-ok' '
 
-	git fetch --update-head-ok . side:master
+	git fetch --update-head-ok . side:main
 
 '
 
@@ -568,7 +568,7 @@ test_expect_success "should be able to fetch with duplicate refspecs" '
 	(
 		cd dups &&
 		git init &&
-		git config branch.master.remote three &&
+		git config branch.main.remote three &&
 		git config remote.three.url ../three/.git &&
 		git config remote.three.fetch +refs/heads/*:refs/remotes/origin/* &&
 		git config --add remote.three.fetch +refs/heads/*:refs/remotes/origin/* &&
@@ -877,11 +877,11 @@ test_expect_success 'all boundary commits are excluded' '
 	test_commit oneside &&
 	git checkout HEAD^ &&
 	test_commit otherside &&
-	git checkout master &&
+	git checkout main &&
 	test_tick &&
 	git merge otherside &&
 	ad=$(git log --no-walk --format=%ad HEAD) &&
-	git bundle create twoside-boundary.bdl master --since="$ad" &&
+	git bundle create twoside-boundary.bdl main --since="$ad" &&
 	convert_bundle_to_pack <twoside-boundary.bdl >twoside-boundary.pack &&
 	pack=$(git index-pack --fix-thin --stdin <twoside-boundary.pack) &&
 	test_bundle_object_count .git/objects/pack/pack-${pack##pack	}.pack 3
@@ -1017,7 +1017,7 @@ setup_negotiation_tip () {
 	fi &&
 
 	test_commit -C "$SERVER" beta_s &&
-	git -C "$SERVER" checkout master &&
+	git -C "$SERVER" checkout main &&
 	test_commit -C "$SERVER" alpha_s &&
 	git -C "$SERVER" tag -d alpha_1 alpha_2 beta_1 beta_2
 }
diff --git a/t/t5511-refspec.sh b/t/t5511-refspec.sh
index f541f30bc2..847a9d4c27 100755
--- a/t/t5511-refspec.sh
+++ b/t/t5511-refspec.sh
@@ -33,7 +33,7 @@ test_refspec fetch '::'						invalid
 test_refspec push 'refs/heads/*:refs/remotes/frotz/*'
 test_refspec push 'refs/heads/*:refs/remotes/frotz'		invalid
 test_refspec push 'refs/heads:refs/remotes/frotz/*'		invalid
-test_refspec push 'refs/heads/master:refs/remotes/frotz/xyzzy'
+test_refspec push 'refs/heads/main:refs/remotes/frotz/xyzzy'
 
 
 # These have invalid LHS, but we do not have a formal "valid sha-1
@@ -41,18 +41,18 @@ test_refspec push 'refs/heads/master:refs/remotes/frotz/xyzzy'
 # code.  They will be caught downstream anyway, but we may want to
 # have tighter check later...
 
-: test_refspec push 'refs/heads/master::refs/remotes/frotz/xyzzy'	invalid
+: test_refspec push 'refs/heads/main::refs/remotes/frotz/xyzzy'	invalid
 : test_refspec push 'refs/heads/maste :refs/remotes/frotz/xyzzy'	invalid
 
 test_refspec fetch 'refs/heads/*:refs/remotes/frotz/*'
 test_refspec fetch 'refs/heads/*:refs/remotes/frotz'		invalid
 test_refspec fetch 'refs/heads:refs/remotes/frotz/*'		invalid
-test_refspec fetch 'refs/heads/master:refs/remotes/frotz/xyzzy'
-test_refspec fetch 'refs/heads/master::refs/remotes/frotz/xyzzy'	invalid
+test_refspec fetch 'refs/heads/main:refs/remotes/frotz/xyzzy'
+test_refspec fetch 'refs/heads/main::refs/remotes/frotz/xyzzy'	invalid
 test_refspec fetch 'refs/heads/maste :refs/remotes/frotz/xyzzy'	invalid
 
-test_refspec push 'master~1:refs/remotes/frotz/backup'
-test_refspec fetch 'master~1:refs/remotes/frotz/backup'		invalid
+test_refspec push 'main~1:refs/remotes/frotz/backup'
+test_refspec fetch 'main~1:refs/remotes/frotz/backup'		invalid
 test_refspec push 'HEAD~4:refs/remotes/frotz/new'
 test_refspec fetch 'HEAD~4:refs/remotes/frotz/new'		invalid
 
diff --git a/t/t5512-ls-remote.sh b/t/t5512-ls-remote.sh
index e98c3a0174..fb122fb7b8 100755
--- a/t/t5512-ls-remote.sh
+++ b/t/t5512-ls-remote.sh
@@ -118,7 +118,7 @@ test_expect_success 'use branch.<name>.remote if possible' '
 	echo "From $URL" >exp_err &&
 
 	git remote add other $URL &&
-	git config branch.master.remote other &&
+	git config branch.main.remote other &&
 
 	git ls-remote 2>actual_err >actual &&
 	test_cmp exp_err actual_err &&
@@ -129,9 +129,9 @@ test_expect_success 'confuses pattern as remote when no remote specified' '
 	if test_have_prereq MINGW
 	then
 		# Windows does not like asterisks in pathname
-		does_not_exist=master
+		does_not_exist=main
 	else
-		does_not_exist="refs*master"
+		does_not_exist="refs*main"
 	fi &&
 	cat >exp <<-EOF &&
 	fatal: '\''$does_not_exist'\'' does not appear to be a git repository
@@ -144,7 +144,7 @@ test_expect_success 'confuses pattern as remote when no remote specified' '
 	# Do not expect "git ls-remote <pattern>" to work; ls-remote needs
 	# <remote> if you want to feed <pattern>, just like you cannot say
 	# fetch <branch>.
-	# We could just as easily have used "master"; the "*" emphasizes its
+	# We could just as easily have used "main"; the "*" emphasizes its
 	# role as a pattern.
 	test_must_fail git ls-remote "$does_not_exist" >actual 2>&1 &&
 	test_i18ncmp exp actual
@@ -217,14 +217,14 @@ test_expect_success 'protocol v2 supports hiderefs' '
 
 test_expect_success 'ls-remote --symref' '
 	git fetch origin &&
-	echo "ref: refs/heads/master	HEAD" >expect &&
+	echo "ref: refs/heads/main	HEAD" >expect &&
 	generate_references \
 		HEAD \
-		refs/heads/master >>expect &&
+		refs/heads/main >>expect &&
 	oid=$(git rev-parse HEAD) &&
 	echo "$oid	refs/remotes/origin/HEAD" >>expect &&
 	generate_references \
-		refs/remotes/origin/master \
+		refs/remotes/origin/main \
 		refs/tags/mark \
 		refs/tags/mark1.1 \
 		refs/tags/mark1.10 \
@@ -238,7 +238,7 @@ test_expect_success 'ls-remote --symref' '
 test_expect_success 'ls-remote with filtered symref (refname)' '
 	rev=$(git rev-parse HEAD) &&
 	cat >expect <<-EOF &&
-	ref: refs/heads/master	HEAD
+	ref: refs/heads/main	HEAD
 	$rev	HEAD
 	EOF
 	# Protocol v2 supports sending symrefs for refs other than HEAD, so use
@@ -252,7 +252,7 @@ test_expect_failure 'ls-remote with filtered symref (--heads)' '
 	cat >expect <<-EOF &&
 	ref: refs/tags/mark	refs/heads/foo
 	$rev	refs/heads/foo
-	$rev	refs/heads/master
+	$rev	refs/heads/main
 	EOF
 	# Protocol v2 supports sending symrefs for refs other than HEAD, so use
 	# protocol v0 here.
@@ -263,7 +263,7 @@ test_expect_failure 'ls-remote with filtered symref (--heads)' '
 test_expect_success 'ls-remote --symref omits filtered-out matches' '
 	cat >expect <<-EOF &&
 	$rev	refs/heads/foo
-	$rev	refs/heads/master
+	$rev	refs/heads/main
 	EOF
 	# Protocol v2 supports sending symrefs for refs other than HEAD, so use
 	# protocol v0 here.
@@ -330,10 +330,10 @@ test_expect_success 'ls-remote --sort fails gracefully outside repository' '
 
 test_expect_success 'ls-remote patterns work with all protocol versions' '
 	git for-each-ref --format="%(objectname)	%(refname)" \
-		refs/heads/master refs/remotes/origin/master >expect &&
-	git -c protocol.version=1 ls-remote . master >actual.v1 &&
+		refs/heads/main refs/remotes/origin/main >expect &&
+	git -c protocol.version=1 ls-remote . main >actual.v1 &&
 	test_cmp expect actual.v1 &&
-	git -c protocol.version=2 ls-remote . master >actual.v2 &&
+	git -c protocol.version=2 ls-remote . main >actual.v2 &&
 	test_cmp expect actual.v2
 '
 
diff --git a/t/t5514-fetch-multiple.sh b/t/t5514-fetch-multiple.sh
index bd202ec6f3..1b0560f901 100755
--- a/t/t5514-fetch-multiple.sh
+++ b/t/t5514-fetch-multiple.sh
@@ -17,7 +17,7 @@ setup_repository () {
 	git add elif &&
 	test_tick &&
 	git commit -m "Second" &&
-	git checkout master
+	git checkout main
 	)
 }
 
@@ -32,16 +32,16 @@ test_expect_success setup '
 '
 
 cat > test/expect << EOF
-  one/master
+  one/main
   one/side
-  origin/HEAD -> origin/master
-  origin/master
+  origin/HEAD -> origin/main
+  origin/main
   origin/side
   three/another
-  three/master
+  three/main
   three/side
   two/another
-  two/master
+  two/main
   two/side
 EOF
 
@@ -70,15 +70,15 @@ test_expect_success 'git fetch --all should continue if a remote has errors' '
 test_expect_success 'git fetch --all does not allow non-option arguments' '
 	(cd test &&
 	 test_must_fail git fetch --all origin &&
-	 test_must_fail git fetch --all origin master)
+	 test_must_fail git fetch --all origin main)
 '
 
 cat > expect << EOF
-  origin/HEAD -> origin/master
-  origin/master
+  origin/HEAD -> origin/main
+  origin/main
   origin/side
   three/another
-  three/master
+  three/main
   three/side
 EOF
 
@@ -92,10 +92,10 @@ test_expect_success 'git fetch --multiple (but only one remote)' '
 '
 
 cat > expect << EOF
-  one/master
+  one/main
   one/side
   two/another
-  two/master
+  two/main
   two/side
 EOF
 
@@ -133,13 +133,13 @@ test_expect_success 'git fetch --all (skipFetchAll)' '
 '
 
 cat > expect << EOF
-  one/master
+  one/main
   one/side
   three/another
-  three/master
+  three/main
   three/side
   two/another
-  two/master
+  two/main
   two/side
 EOF
 
diff --git a/t/t5516-fetch-push.sh b/t/t5516-fetch-push.sh
index d11382f769..522cee7aa6 100755
--- a/t/t5516-fetch-push.sh
+++ b/t/t5516-fetch-push.sh
@@ -120,13 +120,13 @@ test_expect_success setup '
 	git add path1 &&
 	test_tick &&
 	git commit -a -m repo &&
-	the_first_commit=$(git show-ref -s --verify refs/heads/master) &&
+	the_first_commit=$(git show-ref -s --verify refs/heads/main) &&
 
 	>path2 &&
 	git add path2 &&
 	test_tick &&
 	git commit -a -m second &&
-	the_commit=$(git show-ref -s --verify refs/heads/master)
+	the_commit=$(git show-ref -s --verify refs/heads/main)
 
 '
 
@@ -134,9 +134,9 @@ test_expect_success 'fetch without wildcard' '
 	mk_empty testrepo &&
 	(
 		cd testrepo &&
-		git fetch .. refs/heads/master:refs/remotes/origin/master &&
+		git fetch .. refs/heads/main:refs/remotes/origin/main &&
 
-		echo "$the_commit commit	refs/remotes/origin/master" >expect &&
+		echo "$the_commit commit	refs/remotes/origin/main" >expect &&
 		git for-each-ref refs/remotes/origin >actual &&
 		test_cmp expect actual
 	)
@@ -150,7 +150,7 @@ test_expect_success 'fetch with wildcard' '
 		git config remote.up.fetch "refs/heads/*:refs/remotes/origin/*" &&
 		git fetch up &&
 
-		echo "$the_commit commit	refs/remotes/origin/master" >expect &&
+		echo "$the_commit commit	refs/remotes/origin/main" >expect &&
 		git for-each-ref refs/remotes/origin >actual &&
 		test_cmp expect actual
 	)
@@ -166,7 +166,7 @@ test_expect_success 'fetch with insteadOf' '
 		git config remote.up.fetch "refs/heads/*:refs/remotes/origin/*" &&
 		git fetch up &&
 
-		echo "$the_commit commit	refs/remotes/origin/master" >expect &&
+		echo "$the_commit commit	refs/remotes/origin/main" >expect &&
 		git for-each-ref refs/remotes/origin >actual &&
 		test_cmp expect actual
 	)
@@ -182,7 +182,7 @@ test_expect_success 'fetch with pushInsteadOf (should not rewrite)' '
 		git config remote.up.fetch "refs/heads/*:refs/remotes/origin/*" &&
 		git fetch up &&
 
-		echo "$the_commit commit	refs/remotes/origin/master" >expect &&
+		echo "$the_commit commit	refs/remotes/origin/main" >expect &&
 		git for-each-ref refs/remotes/origin >actual &&
 		test_cmp expect actual
 	)
@@ -191,10 +191,10 @@ test_expect_success 'fetch with pushInsteadOf (should not rewrite)' '
 test_expect_success 'push without wildcard' '
 	mk_empty testrepo &&
 
-	git push testrepo refs/heads/master:refs/remotes/origin/master &&
+	git push testrepo refs/heads/main:refs/remotes/origin/main &&
 	(
 		cd testrepo &&
-		echo "$the_commit commit	refs/remotes/origin/master" >expect &&
+		echo "$the_commit commit	refs/remotes/origin/main" >expect &&
 		git for-each-ref refs/remotes/origin >actual &&
 		test_cmp expect actual
 	)
@@ -206,7 +206,7 @@ test_expect_success 'push with wildcard' '
 	git push testrepo "refs/heads/*:refs/remotes/origin/*" &&
 	(
 		cd testrepo &&
-		echo "$the_commit commit	refs/remotes/origin/master" >expect &&
+		echo "$the_commit commit	refs/remotes/origin/main" >expect &&
 		git for-each-ref refs/remotes/origin >actual &&
 		test_cmp expect actual
 	)
@@ -216,10 +216,10 @@ test_expect_success 'push with insteadOf' '
 	mk_empty testrepo &&
 	TRASH="$(pwd)/" &&
 	test_config "url.$TRASH.insteadOf" trash/ &&
-	git push trash/testrepo refs/heads/master:refs/remotes/origin/master &&
+	git push trash/testrepo refs/heads/main:refs/remotes/origin/main &&
 	(
 		cd testrepo &&
-		echo "$the_commit commit	refs/remotes/origin/master" >expect &&
+		echo "$the_commit commit	refs/remotes/origin/main" >expect &&
 		git for-each-ref refs/remotes/origin >actual &&
 		test_cmp expect actual
 	)
@@ -229,10 +229,10 @@ test_expect_success 'push with pushInsteadOf' '
 	mk_empty testrepo &&
 	TRASH="$(pwd)/" &&
 	test_config "url.$TRASH.pushInsteadOf" trash/ &&
-	git push trash/testrepo refs/heads/master:refs/remotes/origin/master &&
+	git push trash/testrepo refs/heads/main:refs/remotes/origin/main &&
 	(
 		cd testrepo &&
-		echo "$the_commit commit	refs/remotes/origin/master" >expect &&
+		echo "$the_commit commit	refs/remotes/origin/main" >expect &&
 		git for-each-ref refs/remotes/origin >actual &&
 		test_cmp expect actual
 	)
@@ -244,10 +244,10 @@ test_expect_success 'push with pushInsteadOf and explicit pushurl (pushInsteadOf
 	test_config "url.trash3/.pushInsteadOf" trash/wrong &&
 	test_config remote.r.url trash/wrong &&
 	test_config remote.r.pushurl "testrepo/" &&
-	git push r refs/heads/master:refs/remotes/origin/master &&
+	git push r refs/heads/main:refs/remotes/origin/main &&
 	(
 		cd testrepo &&
-		echo "$the_commit commit	refs/remotes/origin/master" >expect &&
+		echo "$the_commit commit	refs/remotes/origin/main" >expect &&
 		git for-each-ref refs/remotes/origin >actual &&
 		test_cmp expect actual
 	)
@@ -255,101 +255,101 @@ test_expect_success 'push with pushInsteadOf and explicit pushurl (pushInsteadOf
 
 test_expect_success 'push with matching heads' '
 
-	mk_test testrepo heads/master &&
+	mk_test testrepo heads/main &&
 	git push testrepo : &&
-	check_push_result testrepo $the_commit heads/master
+	check_push_result testrepo $the_commit heads/main
 
 '
 
 test_expect_success 'push with matching heads on the command line' '
 
-	mk_test testrepo heads/master &&
+	mk_test testrepo heads/main &&
 	git push testrepo : &&
-	check_push_result testrepo $the_commit heads/master
+	check_push_result testrepo $the_commit heads/main
 
 '
 
 test_expect_success 'failed (non-fast-forward) push with matching heads' '
 
-	mk_test testrepo heads/master &&
+	mk_test testrepo heads/main &&
 	git push testrepo : &&
 	git commit --amend -massaged &&
 	test_must_fail git push testrepo &&
-	check_push_result testrepo $the_commit heads/master &&
+	check_push_result testrepo $the_commit heads/main &&
 	git reset --hard $the_commit
 
 '
 
 test_expect_success 'push --force with matching heads' '
 
-	mk_test testrepo heads/master &&
+	mk_test testrepo heads/main &&
 	git push testrepo : &&
 	git commit --amend -massaged &&
 	git push --force testrepo : &&
-	! check_push_result testrepo $the_commit heads/master &&
+	! check_push_result testrepo $the_commit heads/main &&
 	git reset --hard $the_commit
 
 '
 
 test_expect_success 'push with matching heads and forced update' '
 
-	mk_test testrepo heads/master &&
+	mk_test testrepo heads/main &&
 	git push testrepo : &&
 	git commit --amend -massaged &&
 	git push testrepo +: &&
-	! check_push_result testrepo $the_commit heads/master &&
+	! check_push_result testrepo $the_commit heads/main &&
 	git reset --hard $the_commit
 
 '
 
 test_expect_success 'push with no ambiguity (1)' '
 
-	mk_test testrepo heads/master &&
-	git push testrepo master:master &&
-	check_push_result testrepo $the_commit heads/master
+	mk_test testrepo heads/main &&
+	git push testrepo main:main &&
+	check_push_result testrepo $the_commit heads/main
 
 '
 
 test_expect_success 'push with no ambiguity (2)' '
 
-	mk_test testrepo remotes/origin/master &&
-	git push testrepo master:origin/master &&
-	check_push_result testrepo $the_commit remotes/origin/master
+	mk_test testrepo remotes/origin/main &&
+	git push testrepo main:origin/main &&
+	check_push_result testrepo $the_commit remotes/origin/main
 
 '
 
 test_expect_success 'push with colon-less refspec, no ambiguity' '
 
-	mk_test testrepo heads/master heads/t/master &&
-	git branch -f t/master master &&
-	git push testrepo master &&
-	check_push_result testrepo $the_commit heads/master &&
-	check_push_result testrepo $the_first_commit heads/t/master
+	mk_test testrepo heads/main heads/t/main &&
+	git branch -f t/main main &&
+	git push testrepo main &&
+	check_push_result testrepo $the_commit heads/main &&
+	check_push_result testrepo $the_first_commit heads/t/main
 
 '
 
 test_expect_success 'push with weak ambiguity (1)' '
 
-	mk_test testrepo heads/master remotes/origin/master &&
-	git push testrepo master:master &&
-	check_push_result testrepo $the_commit heads/master &&
-	check_push_result testrepo $the_first_commit remotes/origin/master
+	mk_test testrepo heads/main remotes/origin/main &&
+	git push testrepo main:main &&
+	check_push_result testrepo $the_commit heads/main &&
+	check_push_result testrepo $the_first_commit remotes/origin/main
 
 '
 
 test_expect_success 'push with weak ambiguity (2)' '
 
-	mk_test testrepo heads/master remotes/origin/master remotes/another/master &&
-	git push testrepo master:master &&
-	check_push_result testrepo $the_commit heads/master &&
-	check_push_result testrepo $the_first_commit remotes/origin/master remotes/another/master
+	mk_test testrepo heads/main remotes/origin/main remotes/another/main &&
+	git push testrepo main:main &&
+	check_push_result testrepo $the_commit heads/main &&
+	check_push_result testrepo $the_first_commit remotes/origin/main remotes/another/main
 
 '
 
 test_expect_success 'push with ambiguity' '
 
 	mk_test testrepo heads/frotz tags/frotz &&
-	test_must_fail git push testrepo master:frotz &&
+	test_must_fail git push testrepo main:frotz &&
 	check_push_result testrepo $the_first_commit heads/frotz tags/frotz
 
 '
@@ -357,7 +357,7 @@ test_expect_success 'push with ambiguity' '
 test_expect_success 'push with colon-less refspec (1)' '
 
 	mk_test testrepo heads/frotz tags/frotz &&
-	git branch -f frotz master &&
+	git branch -f frotz main &&
 	git push testrepo frotz &&
 	check_push_result testrepo $the_commit heads/frotz &&
 	check_push_result testrepo $the_first_commit tags/frotz
@@ -385,7 +385,7 @@ test_expect_success 'push with colon-less refspec (3)' '
 	then
 		git tag -d frotz
 	fi &&
-	git branch -f frotz master &&
+	git branch -f frotz main &&
 	git push testrepo frotz &&
 	check_push_result testrepo $the_commit heads/frotz &&
 	test 1 = $( cd testrepo && git show-ref | wc -l )
@@ -408,7 +408,7 @@ test_expect_success 'push with colon-less refspec (4)' '
 test_expect_success 'push head with non-existent, incomplete dest' '
 
 	mk_test testrepo &&
-	git push testrepo master:branch &&
+	git push testrepo main:branch &&
 	check_push_result testrepo $the_commit heads/branch
 
 '
@@ -425,42 +425,42 @@ test_expect_success 'push tag with non-existent, incomplete dest' '
 test_expect_success 'push sha1 with non-existent, incomplete dest' '
 
 	mk_test testrepo &&
-	test_must_fail git push testrepo $(git rev-parse master):foo
+	test_must_fail git push testrepo $(git rev-parse main):foo
 
 '
 
 test_expect_success 'push ref expression with non-existent, incomplete dest' '
 
 	mk_test testrepo &&
-	test_must_fail git push testrepo master^:branch
+	test_must_fail git push testrepo main^:branch
 
 '
 
 test_expect_success 'push with HEAD' '
 
-	mk_test testrepo heads/master &&
-	git checkout master &&
+	mk_test testrepo heads/main &&
+	git checkout main &&
 	git push testrepo HEAD &&
-	check_push_result testrepo $the_commit heads/master
+	check_push_result testrepo $the_commit heads/main
 
 '
 
 test_expect_success 'push with HEAD nonexisting at remote' '
 
-	mk_test testrepo heads/master &&
-	git checkout -b local master &&
+	mk_test testrepo heads/main &&
+	git checkout -b local main &&
 	git push testrepo HEAD &&
 	check_push_result testrepo $the_commit heads/local
 '
 
 test_expect_success 'push with +HEAD' '
 
-	mk_test testrepo heads/master &&
-	git checkout master &&
+	mk_test testrepo heads/main &&
+	git checkout main &&
 	git branch -D local &&
 	git checkout -b local &&
-	git push testrepo master local &&
-	check_push_result testrepo $the_commit heads/master &&
+	git push testrepo main local &&
+	check_push_result testrepo $the_commit heads/main &&
 	check_push_result testrepo $the_commit heads/local &&
 
 	# Without force rewinding should fail
@@ -477,7 +477,7 @@ test_expect_success 'push with +HEAD' '
 test_expect_success 'push HEAD with non-existent, incomplete dest' '
 
 	mk_test testrepo &&
-	git checkout master &&
+	git checkout main &&
 	git push testrepo HEAD:branch &&
 	check_push_result testrepo $the_commit heads/branch
 
@@ -486,7 +486,7 @@ test_expect_success 'push HEAD with non-existent, incomplete dest' '
 test_expect_success 'push with config remote.*.push = HEAD' '
 
 	mk_test testrepo heads/local &&
-	git checkout master &&
+	git checkout main &&
 	git branch -f local $the_commit &&
 	(
 		cd testrepo &&
@@ -495,166 +495,166 @@ test_expect_success 'push with config remote.*.push = HEAD' '
 	) &&
 	test_config remote.there.url testrepo &&
 	test_config remote.there.push HEAD &&
-	test_config branch.master.remote there &&
+	test_config branch.main.remote there &&
 	git push &&
-	check_push_result testrepo $the_commit heads/master &&
+	check_push_result testrepo $the_commit heads/main &&
 	check_push_result testrepo $the_first_commit heads/local
 '
 
 test_expect_success 'push with remote.pushdefault' '
-	mk_test up_repo heads/master &&
-	mk_test down_repo heads/master &&
+	mk_test up_repo heads/main &&
+	mk_test down_repo heads/main &&
 	test_config remote.up.url up_repo &&
 	test_config remote.down.url down_repo &&
-	test_config branch.master.remote up &&
+	test_config branch.main.remote up &&
 	test_config remote.pushdefault down &&
 	test_config push.default matching &&
 	git push &&
-	check_push_result up_repo $the_first_commit heads/master &&
-	check_push_result down_repo $the_commit heads/master
+	check_push_result up_repo $the_first_commit heads/main &&
+	check_push_result down_repo $the_commit heads/main
 '
 
 test_expect_success 'push with config remote.*.pushurl' '
 
-	mk_test testrepo heads/master &&
-	git checkout master &&
+	mk_test testrepo heads/main &&
+	git checkout main &&
 	test_config remote.there.url test2repo &&
 	test_config remote.there.pushurl testrepo &&
 	git push there : &&
-	check_push_result testrepo $the_commit heads/master
+	check_push_result testrepo $the_commit heads/main
 '
 
 test_expect_success 'push with config branch.*.pushremote' '
-	mk_test up_repo heads/master &&
-	mk_test side_repo heads/master &&
-	mk_test down_repo heads/master &&
+	mk_test up_repo heads/main &&
+	mk_test side_repo heads/main &&
+	mk_test down_repo heads/main &&
 	test_config remote.up.url up_repo &&
 	test_config remote.pushdefault side_repo &&
 	test_config remote.down.url down_repo &&
-	test_config branch.master.remote up &&
-	test_config branch.master.pushremote down &&
+	test_config branch.main.remote up &&
+	test_config branch.main.pushremote down &&
 	test_config push.default matching &&
 	git push &&
-	check_push_result up_repo $the_first_commit heads/master &&
-	check_push_result side_repo $the_first_commit heads/master &&
-	check_push_result down_repo $the_commit heads/master
+	check_push_result up_repo $the_first_commit heads/main &&
+	check_push_result side_repo $the_first_commit heads/main &&
+	check_push_result down_repo $the_commit heads/main
 '
 
 test_expect_success 'branch.*.pushremote config order is irrelevant' '
-	mk_test one_repo heads/master &&
-	mk_test two_repo heads/master &&
+	mk_test one_repo heads/main &&
+	mk_test two_repo heads/main &&
 	test_config remote.one.url one_repo &&
 	test_config remote.two.url two_repo &&
-	test_config branch.master.pushremote two_repo &&
+	test_config branch.main.pushremote two_repo &&
 	test_config remote.pushdefault one_repo &&
 	test_config push.default matching &&
 	git push &&
-	check_push_result one_repo $the_first_commit heads/master &&
-	check_push_result two_repo $the_commit heads/master
+	check_push_result one_repo $the_first_commit heads/main &&
+	check_push_result two_repo $the_commit heads/main
 '
 
 test_expect_success 'push with dry-run' '
 
-	mk_test testrepo heads/master &&
-	old_commit=$(git -C testrepo show-ref -s --verify refs/heads/master) &&
+	mk_test testrepo heads/main &&
+	old_commit=$(git -C testrepo show-ref -s --verify refs/heads/main) &&
 	git push --dry-run testrepo : &&
-	check_push_result testrepo $old_commit heads/master
+	check_push_result testrepo $old_commit heads/main
 '
 
 test_expect_success 'push updates local refs' '
 
-	mk_test testrepo heads/master &&
+	mk_test testrepo heads/main &&
 	mk_child testrepo child &&
 	(
 		cd child &&
-		git pull .. master &&
+		git pull .. main &&
 		git push &&
-		test $(git rev-parse master) = \
-			$(git rev-parse remotes/origin/master)
+		test $(git rev-parse main) = \
+			$(git rev-parse remotes/origin/main)
 	)
 
 '
 
 test_expect_success 'push updates up-to-date local refs' '
 
-	mk_test testrepo heads/master &&
+	mk_test testrepo heads/main &&
 	mk_child testrepo child1 &&
 	mk_child testrepo child2 &&
-	(cd child1 && git pull .. master && git push) &&
+	(cd child1 && git pull .. main && git push) &&
 	(
 		cd child2 &&
-		git pull ../child1 master &&
+		git pull ../child1 main &&
 		git push &&
-		test $(git rev-parse master) = \
-			$(git rev-parse remotes/origin/master)
+		test $(git rev-parse main) = \
+			$(git rev-parse remotes/origin/main)
 	)
 
 '
 
 test_expect_success 'push preserves up-to-date packed refs' '
 
-	mk_test testrepo heads/master &&
+	mk_test testrepo heads/main &&
 	mk_child testrepo child &&
 	(
 		cd child &&
 		git push &&
-		! test -f .git/refs/remotes/origin/master
+		! test -f .git/refs/remotes/origin/main
 	)
 
 '
 
 test_expect_success 'push does not update local refs on failure' '
 
-	mk_test testrepo heads/master &&
+	mk_test testrepo heads/main &&
 	mk_child testrepo child &&
 	mkdir testrepo/.git/hooks &&
 	echo "#!/no/frobnication/today" >testrepo/.git/hooks/pre-receive &&
 	chmod +x testrepo/.git/hooks/pre-receive &&
 	(
 		cd child &&
-		git pull .. master &&
+		git pull .. main &&
 		test_must_fail git push &&
-		test $(git rev-parse master) != \
-			$(git rev-parse remotes/origin/master)
+		test $(git rev-parse main) != \
+			$(git rev-parse remotes/origin/main)
 	)
 
 '
 
 test_expect_success 'allow deleting an invalid remote ref' '
 
-	mk_test testrepo heads/master &&
+	mk_test testrepo heads/main &&
 	rm -f testrepo/.git/objects/??/* &&
-	git push testrepo :refs/heads/master &&
-	(cd testrepo && test_must_fail git rev-parse --verify refs/heads/master)
+	git push testrepo :refs/heads/main &&
+	(cd testrepo && test_must_fail git rev-parse --verify refs/heads/main)
 
 '
 
 test_expect_success 'pushing valid refs triggers post-receive and post-update hooks' '
-	mk_test_with_hooks testrepo heads/master heads/next &&
-	orgmaster=$(cd testrepo && git show-ref -s --verify refs/heads/master) &&
-	newmaster=$(git show-ref -s --verify refs/heads/master) &&
+	mk_test_with_hooks testrepo heads/main heads/next &&
+	orgmain=$(cd testrepo && git show-ref -s --verify refs/heads/main) &&
+	newmain=$(git show-ref -s --verify refs/heads/main) &&
 	orgnext=$(cd testrepo && git show-ref -s --verify refs/heads/next) &&
 	newnext=$ZERO_OID &&
-	git push testrepo refs/heads/master:refs/heads/master :refs/heads/next &&
+	git push testrepo refs/heads/main:refs/heads/main :refs/heads/next &&
 	(
 		cd testrepo/.git &&
 		cat >pre-receive.expect <<-EOF &&
-		$orgmaster $newmaster refs/heads/master
+		$orgmain $newmain refs/heads/main
 		$orgnext $newnext refs/heads/next
 		EOF
 
 		cat >update.expect <<-EOF &&
-		refs/heads/master $orgmaster $newmaster
+		refs/heads/main $orgmain $newmain
 		refs/heads/next $orgnext $newnext
 		EOF
 
 		cat >post-receive.expect <<-EOF &&
-		$orgmaster $newmaster refs/heads/master
+		$orgmain $newmain refs/heads/main
 		$orgnext $newnext refs/heads/next
 		EOF
 
 		cat >post-update.expect <<-EOF &&
-		refs/heads/master
+		refs/heads/main
 		refs/heads/next
 		EOF
 
@@ -666,25 +666,25 @@ test_expect_success 'pushing valid refs triggers post-receive and post-update ho
 '
 
 test_expect_success 'deleting dangling ref triggers hooks with correct args' '
-	mk_test_with_hooks testrepo heads/master &&
+	mk_test_with_hooks testrepo heads/main &&
 	rm -f testrepo/.git/objects/??/* &&
-	git push testrepo :refs/heads/master &&
+	git push testrepo :refs/heads/main &&
 	(
 		cd testrepo/.git &&
 		cat >pre-receive.expect <<-EOF &&
-		$ZERO_OID $ZERO_OID refs/heads/master
+		$ZERO_OID $ZERO_OID refs/heads/main
 		EOF
 
 		cat >update.expect <<-EOF &&
-		refs/heads/master $ZERO_OID $ZERO_OID
+		refs/heads/main $ZERO_OID $ZERO_OID
 		EOF
 
 		cat >post-receive.expect <<-EOF &&
-		$ZERO_OID $ZERO_OID refs/heads/master
+		$ZERO_OID $ZERO_OID refs/heads/main
 		EOF
 
 		cat >post-update.expect <<-EOF &&
-		refs/heads/master
+		refs/heads/main
 		EOF
 
 		test_cmp pre-receive.expect pre-receive.actual &&
@@ -695,28 +695,28 @@ test_expect_success 'deleting dangling ref triggers hooks with correct args' '
 '
 
 test_expect_success 'deletion of a non-existent ref is not fed to post-receive and post-update hooks' '
-	mk_test_with_hooks testrepo heads/master &&
-	orgmaster=$(cd testrepo && git show-ref -s --verify refs/heads/master) &&
-	newmaster=$(git show-ref -s --verify refs/heads/master) &&
-	git push testrepo master :refs/heads/nonexistent &&
+	mk_test_with_hooks testrepo heads/main &&
+	orgmain=$(cd testrepo && git show-ref -s --verify refs/heads/main) &&
+	newmain=$(git show-ref -s --verify refs/heads/main) &&
+	git push testrepo main :refs/heads/nonexistent &&
 	(
 		cd testrepo/.git &&
 		cat >pre-receive.expect <<-EOF &&
-		$orgmaster $newmaster refs/heads/master
+		$orgmain $newmain refs/heads/main
 		$ZERO_OID $ZERO_OID refs/heads/nonexistent
 		EOF
 
 		cat >update.expect <<-EOF &&
-		refs/heads/master $orgmaster $newmaster
+		refs/heads/main $orgmain $newmain
 		refs/heads/nonexistent $ZERO_OID $ZERO_OID
 		EOF
 
 		cat >post-receive.expect <<-EOF &&
-		$orgmaster $newmaster refs/heads/master
+		$orgmain $newmain refs/heads/main
 		EOF
 
 		cat >post-update.expect <<-EOF &&
-		refs/heads/master
+		refs/heads/main
 		EOF
 
 		test_cmp pre-receive.expect pre-receive.actual &&
@@ -727,7 +727,7 @@ test_expect_success 'deletion of a non-existent ref is not fed to post-receive a
 '
 
 test_expect_success 'deletion of a non-existent ref alone does trigger post-receive and post-update hooks' '
-	mk_test_with_hooks testrepo heads/master &&
+	mk_test_with_hooks testrepo heads/main &&
 	git push testrepo :refs/heads/nonexistent &&
 	(
 		cd testrepo/.git &&
@@ -747,40 +747,40 @@ test_expect_success 'deletion of a non-existent ref alone does trigger post-rece
 '
 
 test_expect_success 'mixed ref updates, deletes, invalid deletes trigger hooks with correct input' '
-	mk_test_with_hooks testrepo heads/master heads/next heads/seen &&
-	orgmaster=$(cd testrepo && git show-ref -s --verify refs/heads/master) &&
-	newmaster=$(git show-ref -s --verify refs/heads/master) &&
+	mk_test_with_hooks testrepo heads/main heads/next heads/seen &&
+	orgmain=$(cd testrepo && git show-ref -s --verify refs/heads/main) &&
+	newmain=$(git show-ref -s --verify refs/heads/main) &&
 	orgnext=$(cd testrepo && git show-ref -s --verify refs/heads/next) &&
 	newnext=$ZERO_OID &&
 	orgseen=$(cd testrepo && git show-ref -s --verify refs/heads/seen) &&
-	newseen=$(git show-ref -s --verify refs/heads/master) &&
-	git push testrepo refs/heads/master:refs/heads/master \
-	    refs/heads/master:refs/heads/seen :refs/heads/next \
+	newseen=$(git show-ref -s --verify refs/heads/main) &&
+	git push testrepo refs/heads/main:refs/heads/main \
+	    refs/heads/main:refs/heads/seen :refs/heads/next \
 	    :refs/heads/nonexistent &&
 	(
 		cd testrepo/.git &&
 		cat >pre-receive.expect <<-EOF &&
-		$orgmaster $newmaster refs/heads/master
+		$orgmain $newmain refs/heads/main
 		$orgnext $newnext refs/heads/next
 		$orgseen $newseen refs/heads/seen
 		$ZERO_OID $ZERO_OID refs/heads/nonexistent
 		EOF
 
 		cat >update.expect <<-EOF &&
-		refs/heads/master $orgmaster $newmaster
+		refs/heads/main $orgmain $newmain
 		refs/heads/next $orgnext $newnext
 		refs/heads/seen $orgseen $newseen
 		refs/heads/nonexistent $ZERO_OID $ZERO_OID
 		EOF
 
 		cat >post-receive.expect <<-EOF &&
-		$orgmaster $newmaster refs/heads/master
+		$orgmain $newmain refs/heads/main
 		$orgnext $newnext refs/heads/next
 		$orgseen $newseen refs/heads/seen
 		EOF
 
 		cat >post-update.expect <<-EOF &&
-		refs/heads/master
+		refs/heads/main
 		refs/heads/next
 		refs/heads/seen
 		EOF
@@ -793,15 +793,15 @@ test_expect_success 'mixed ref updates, deletes, invalid deletes trigger hooks w
 '
 
 test_expect_success 'allow deleting a ref using --delete' '
-	mk_test testrepo heads/master &&
+	mk_test testrepo heads/main &&
 	(cd testrepo && git config receive.denyDeleteCurrent warn) &&
-	git push testrepo --delete master &&
-	(cd testrepo && test_must_fail git rev-parse --verify refs/heads/master)
+	git push testrepo --delete main &&
+	(cd testrepo && test_must_fail git rev-parse --verify refs/heads/main)
 '
 
 test_expect_success 'allow deleting a tag using --delete' '
-	mk_test testrepo heads/master &&
-	git tag -a -m dummy_message deltag heads/master &&
+	mk_test testrepo heads/main &&
+	git tag -a -m dummy_message deltag heads/main &&
 	git push testrepo --tags &&
 	(cd testrepo && git rev-parse --verify -q refs/tags/deltag) &&
 	git push testrepo --delete tag deltag &&
@@ -809,56 +809,56 @@ test_expect_success 'allow deleting a tag using --delete' '
 '
 
 test_expect_success 'push --delete without args aborts' '
-	mk_test testrepo heads/master &&
+	mk_test testrepo heads/main &&
 	test_must_fail git push testrepo --delete
 '
 
 test_expect_success 'push --delete refuses src:dest refspecs' '
-	mk_test testrepo heads/master &&
-	test_must_fail git push testrepo --delete master:foo
+	mk_test testrepo heads/main &&
+	test_must_fail git push testrepo --delete main:foo
 '
 
 test_expect_success 'warn on push to HEAD of non-bare repository' '
-	mk_test testrepo heads/master &&
+	mk_test testrepo heads/main &&
 	(
 		cd testrepo &&
-		git checkout master &&
+		git checkout main &&
 		git config receive.denyCurrentBranch warn
 	) &&
-	git push testrepo master 2>stderr &&
+	git push testrepo main 2>stderr &&
 	grep "warning: updating the current branch" stderr
 '
 
 test_expect_success 'deny push to HEAD of non-bare repository' '
-	mk_test testrepo heads/master &&
+	mk_test testrepo heads/main &&
 	(
 		cd testrepo &&
-		git checkout master &&
+		git checkout main &&
 		git config receive.denyCurrentBranch true
 	) &&
-	test_must_fail git push testrepo master
+	test_must_fail git push testrepo main
 '
 
 test_expect_success 'allow push to HEAD of bare repository (bare)' '
-	mk_test testrepo heads/master &&
+	mk_test testrepo heads/main &&
 	(
 		cd testrepo &&
-		git checkout master &&
+		git checkout main &&
 		git config receive.denyCurrentBranch true &&
 		git config core.bare true
 	) &&
-	git push testrepo master 2>stderr &&
+	git push testrepo main 2>stderr &&
 	! grep "warning: updating the current branch" stderr
 '
 
 test_expect_success 'allow push to HEAD of non-bare repository (config)' '
-	mk_test testrepo heads/master &&
+	mk_test testrepo heads/main &&
 	(
 		cd testrepo &&
-		git checkout master &&
+		git checkout main &&
 		git config receive.denyCurrentBranch false
 	) &&
-	git push testrepo master 2>stderr &&
+	git push testrepo main 2>stderr &&
 	! grep "warning: updating the current branch" stderr
 '
 
@@ -874,7 +874,7 @@ test_expect_success 'fetch with branches' '
 		git for-each-ref refs/heads >actual &&
 		test_cmp expect actual
 	) &&
-	git checkout master
+	git checkout main
 '
 
 test_expect_success 'fetch with branches containing #' '
@@ -887,7 +887,7 @@ test_expect_success 'fetch with branches containing #' '
 		git for-each-ref refs/heads >actual &&
 		test_cmp expect actual
 	) &&
-	git checkout master
+	git checkout main
 '
 
 test_expect_success 'push with branches' '
@@ -897,7 +897,7 @@ test_expect_success 'push with branches' '
 	git push branch1 &&
 	(
 		cd testrepo &&
-		echo "$the_first_commit commit	refs/heads/master" >expect &&
+		echo "$the_first_commit commit	refs/heads/main" >expect &&
 		git for-each-ref refs/heads >actual &&
 		test_cmp expect actual
 	)
@@ -913,11 +913,11 @@ test_expect_success 'push with branches containing #' '
 		git for-each-ref refs/heads >actual &&
 		test_cmp expect actual
 	) &&
-	git checkout master
+	git checkout main
 '
 
 test_expect_success 'push into aliased refs (consistent)' '
-	mk_test testrepo heads/master &&
+	mk_test testrepo heads/main &&
 	mk_child testrepo child1 &&
 	mk_child testrepo child2 &&
 	(
@@ -939,7 +939,7 @@ test_expect_success 'push into aliased refs (consistent)' '
 '
 
 test_expect_success 'push into aliased refs (inconsistent)' '
-	mk_test testrepo heads/master &&
+	mk_test testrepo heads/main &&
 	mk_child testrepo child1 &&
 	mk_child testrepo child2 &&
 	(
@@ -970,7 +970,7 @@ test_force_push_tag () {
 	tag_args=$2
 
 	test_expect_success "force pushing required to update $tag_type_description" "
-		mk_test testrepo heads/master &&
+		mk_test testrepo heads/main &&
 		mk_child testrepo child1 &&
 		mk_child testrepo child2 &&
 		(
@@ -1016,7 +1016,7 @@ test_force_fetch_tag () {
 	tag_args=$2
 
 	test_expect_success "fetch will not clobber an existing $tag_type_description without --force" "
-		mk_test testrepo heads/master &&
+		mk_test testrepo heads/main &&
 		mk_child testrepo child1 &&
 		mk_child testrepo child2 &&
 		(
@@ -1039,12 +1039,12 @@ test_force_fetch_tag "annotated tag" "-f -a -m'tag message'"
 test_expect_success 'push --porcelain' '
 	mk_empty testrepo &&
 	echo >.git/foo  "To testrepo" &&
-	echo >>.git/foo "*	refs/heads/master:refs/remotes/origin/master	[new reference]"  &&
+	echo >>.git/foo "*	refs/heads/main:refs/remotes/origin/main	[new reference]"  &&
 	echo >>.git/foo "Done" &&
-	git push >.git/bar --porcelain  testrepo refs/heads/master:refs/remotes/origin/master &&
+	git push >.git/bar --porcelain  testrepo refs/heads/main:refs/remotes/origin/main &&
 	(
 		cd testrepo &&
-		echo "$the_commit commit	refs/remotes/origin/master" >expect &&
+		echo "$the_commit commit	refs/remotes/origin/main" >expect &&
 		git for-each-ref refs/remotes/origin >actual &&
 		test_cmp expect actual
 	) &&
@@ -1053,52 +1053,52 @@ test_expect_success 'push --porcelain' '
 
 test_expect_success 'push --porcelain bad url' '
 	mk_empty testrepo &&
-	test_must_fail git push >.git/bar --porcelain asdfasdfasd refs/heads/master:refs/remotes/origin/master &&
+	test_must_fail git push >.git/bar --porcelain asdfasdfasd refs/heads/main:refs/remotes/origin/main &&
 	! grep -q Done .git/bar
 '
 
 test_expect_success 'push --porcelain rejected' '
 	mk_empty testrepo &&
-	git push testrepo refs/heads/master:refs/remotes/origin/master &&
+	git push testrepo refs/heads/main:refs/remotes/origin/main &&
 	(cd testrepo &&
-		git reset --hard origin/master^ &&
+		git reset --hard origin/main^ &&
 		git config receive.denyCurrentBranch true) &&
 
 	echo >.git/foo  "To testrepo"  &&
-	echo >>.git/foo "!	refs/heads/master:refs/heads/master	[remote rejected] (branch is currently checked out)" &&
+	echo >>.git/foo "!	refs/heads/main:refs/heads/main	[remote rejected] (branch is currently checked out)" &&
 	echo >>.git/foo "Done" &&
 
-	test_must_fail git push >.git/bar --porcelain  testrepo refs/heads/master:refs/heads/master &&
+	test_must_fail git push >.git/bar --porcelain  testrepo refs/heads/main:refs/heads/main &&
 	test_cmp .git/foo .git/bar
 '
 
 test_expect_success 'push --porcelain --dry-run rejected' '
 	mk_empty testrepo &&
-	git push testrepo refs/heads/master:refs/remotes/origin/master &&
+	git push testrepo refs/heads/main:refs/remotes/origin/main &&
 	(cd testrepo &&
-		git reset --hard origin/master &&
+		git reset --hard origin/main &&
 		git config receive.denyCurrentBranch true) &&
 
 	echo >.git/foo  "To testrepo"  &&
-	echo >>.git/foo "!	refs/heads/master^:refs/heads/master	[rejected] (non-fast-forward)" &&
+	echo >>.git/foo "!	refs/heads/main^:refs/heads/main	[rejected] (non-fast-forward)" &&
 	echo >>.git/foo "Done" &&
 
-	test_must_fail git push >.git/bar --porcelain  --dry-run testrepo refs/heads/master^:refs/heads/master &&
+	test_must_fail git push >.git/bar --porcelain  --dry-run testrepo refs/heads/main^:refs/heads/main &&
 	test_cmp .git/foo .git/bar
 '
 
 test_expect_success 'push --prune' '
-	mk_test testrepo heads/master heads/second heads/foo heads/bar &&
+	mk_test testrepo heads/main heads/second heads/foo heads/bar &&
 	git push --prune testrepo : &&
-	check_push_result testrepo $the_commit heads/master &&
+	check_push_result testrepo $the_commit heads/main &&
 	check_push_result testrepo $the_first_commit heads/second &&
 	! check_push_result testrepo $the_first_commit heads/foo heads/bar
 '
 
 test_expect_success 'push --prune refspec' '
-	mk_test testrepo tmp/master tmp/second tmp/foo tmp/bar &&
+	mk_test testrepo tmp/main tmp/second tmp/foo tmp/bar &&
 	git push --prune testrepo "refs/heads/*:refs/tmp/*" &&
-	check_push_result testrepo $the_commit tmp/master &&
+	check_push_result testrepo $the_commit tmp/main &&
 	check_push_result testrepo $the_first_commit tmp/second &&
 	! check_push_result testrepo $the_first_commit tmp/foo tmp/bar
 '
@@ -1106,18 +1106,18 @@ test_expect_success 'push --prune refspec' '
 for configsection in transfer receive
 do
 	test_expect_success "push to update a ref hidden by $configsection.hiderefs" '
-		mk_test testrepo heads/master hidden/one hidden/two hidden/three &&
+		mk_test testrepo heads/main hidden/one hidden/two hidden/three &&
 		(
 			cd testrepo &&
 			git config $configsection.hiderefs refs/hidden
 		) &&
 
 		# push to unhidden ref succeeds normally
-		git push testrepo master:refs/heads/master &&
-		check_push_result testrepo $the_commit heads/master &&
+		git push testrepo main:refs/heads/main &&
+		check_push_result testrepo $the_commit heads/main &&
 
 		# push to update a hidden ref should fail
-		test_must_fail git push testrepo master:refs/hidden/one &&
+		test_must_fail git push testrepo main:refs/hidden/one &&
 		check_push_result testrepo $the_first_commit hidden/one &&
 
 		# push to delete a hidden ref should fail
@@ -1131,8 +1131,8 @@ do
 done
 
 test_expect_success 'fetch exact SHA1' '
-	mk_test testrepo heads/master hidden/one &&
-	git push testrepo master:refs/hidden/one &&
+	mk_test testrepo heads/main hidden/one &&
+	git push testrepo main:refs/hidden/one &&
 	(
 		cd testrepo &&
 		git config transfer.hiderefs refs/hidden
@@ -1163,7 +1163,7 @@ test_expect_success 'fetch exact SHA1' '
 			git config uploadpack.allowtipsha1inwant true
 		) &&
 
-		git fetch -v ../testrepo $the_commit:refs/heads/copy master:refs/heads/extra &&
+		git fetch -v ../testrepo $the_commit:refs/heads/copy main:refs/heads/extra &&
 		cat >expect <<-EOF &&
 		$the_commit
 		$the_first_commit
@@ -1177,8 +1177,8 @@ test_expect_success 'fetch exact SHA1' '
 '
 
 test_expect_success 'fetch exact SHA1 in protocol v2' '
-	mk_test testrepo heads/master hidden/one &&
-	git push testrepo master:refs/hidden/one &&
+	mk_test testrepo heads/main hidden/one &&
+	git push testrepo main:refs/hidden/one &&
 	git -C testrepo config transfer.hiderefs refs/hidden &&
 	check_push_result testrepo $the_commit hidden/one &&
 
@@ -1260,17 +1260,17 @@ do
 done
 
 test_expect_success 'fetch follows tags by default' '
-	mk_test testrepo heads/master &&
+	mk_test testrepo heads/main &&
 	rm -fr src dst &&
 	git init src &&
 	(
 		cd src &&
-		git pull ../testrepo master &&
+		git pull ../testrepo main &&
 		git tag -m "annotated" tag &&
 		git for-each-ref >tmp1 &&
 		(
 			cat tmp1
-			sed -n "s|refs/heads/master$|refs/remotes/origin/master|p" tmp1
+			sed -n "s|refs/heads/main$|refs/remotes/origin/main|p" tmp1
 		) |
 		sort -k 3 >../expect
 	) &&
@@ -1278,8 +1278,8 @@ test_expect_success 'fetch follows tags by default' '
 	(
 		cd dst &&
 		git remote add origin ../src &&
-		git config branch.master.remote origin &&
-		git config branch.master.merge refs/heads/master &&
+		git config branch.main.remote origin &&
+		git config branch.main.merge refs/heads/main &&
 		git pull &&
 		git for-each-ref >../actual
 	) &&
@@ -1298,74 +1298,74 @@ test_expect_success 'peeled advertisements are not considered ref tips' '
 '
 
 test_expect_success 'pushing a specific ref applies remote.$name.push as refmap' '
-	mk_test testrepo heads/master &&
+	mk_test testrepo heads/main &&
 	rm -fr src dst &&
 	git init src &&
 	git init --bare dst &&
 	(
 		cd src &&
-		git pull ../testrepo master &&
+		git pull ../testrepo main &&
 		git branch next &&
 		git config remote.dst.url ../dst &&
 		git config remote.dst.push "+refs/heads/*:refs/remotes/src/*" &&
-		git push dst master &&
-		git show-ref refs/heads/master |
+		git push dst main &&
+		git show-ref refs/heads/main |
 		sed -e "s|refs/heads/|refs/remotes/src/|" >../dst/expect
 	) &&
 	(
 		cd dst &&
 		test_must_fail git show-ref refs/heads/next &&
-		test_must_fail git show-ref refs/heads/master &&
-		git show-ref refs/remotes/src/master >actual
+		test_must_fail git show-ref refs/heads/main &&
+		git show-ref refs/remotes/src/main >actual
 	) &&
 	test_cmp dst/expect dst/actual
 '
 
 test_expect_success 'with no remote.$name.push, it is not used as refmap' '
-	mk_test testrepo heads/master &&
+	mk_test testrepo heads/main &&
 	rm -fr src dst &&
 	git init src &&
 	git init --bare dst &&
 	(
 		cd src &&
-		git pull ../testrepo master &&
+		git pull ../testrepo main &&
 		git branch next &&
 		git config remote.dst.url ../dst &&
 		git config push.default matching &&
-		git push dst master &&
-		git show-ref refs/heads/master >../dst/expect
+		git push dst main &&
+		git show-ref refs/heads/main >../dst/expect
 	) &&
 	(
 		cd dst &&
 		test_must_fail git show-ref refs/heads/next &&
-		git show-ref refs/heads/master >actual
+		git show-ref refs/heads/main >actual
 	) &&
 	test_cmp dst/expect dst/actual
 '
 
 test_expect_success 'with no remote.$name.push, upstream mapping is used' '
-	mk_test testrepo heads/master &&
+	mk_test testrepo heads/main &&
 	rm -fr src dst &&
 	git init src &&
 	git init --bare dst &&
 	(
 		cd src &&
-		git pull ../testrepo master &&
+		git pull ../testrepo main &&
 		git branch next &&
 		git config remote.dst.url ../dst &&
 		git config remote.dst.fetch "+refs/heads/*:refs/remotes/dst/*" &&
 		git config push.default upstream &&
 
-		git config branch.master.merge refs/heads/trunk &&
-		git config branch.master.remote dst &&
+		git config branch.main.merge refs/heads/trunk &&
+		git config branch.main.remote dst &&
 
-		git push dst master &&
-		git show-ref refs/heads/master |
-		sed -e "s|refs/heads/master|refs/heads/trunk|" >../dst/expect
+		git push dst main &&
+		git show-ref refs/heads/main |
+		sed -e "s|refs/heads/main|refs/heads/trunk|" >../dst/expect
 	) &&
 	(
 		cd dst &&
-		test_must_fail git show-ref refs/heads/master &&
+		test_must_fail git show-ref refs/heads/main &&
 		test_must_fail git show-ref refs/heads/next &&
 		git show-ref refs/heads/trunk >actual
 	) &&
@@ -1373,20 +1373,20 @@ test_expect_success 'with no remote.$name.push, upstream mapping is used' '
 '
 
 test_expect_success 'push does not follow tags by default' '
-	mk_test testrepo heads/master &&
+	mk_test testrepo heads/main &&
 	rm -fr src dst &&
 	git init src &&
 	git init --bare dst &&
 	(
 		cd src &&
-		git pull ../testrepo master &&
+		git pull ../testrepo main &&
 		git tag -m "annotated" tag &&
 		git checkout -b another &&
 		git commit --allow-empty -m "future commit" &&
 		git tag -m "future" future &&
-		git checkout master &&
-		git for-each-ref refs/heads/master >../expect &&
-		git push ../dst master
+		git checkout main &&
+		git for-each-ref refs/heads/main >../expect &&
+		git push ../dst main
 	) &&
 	(
 		cd dst &&
@@ -1396,20 +1396,20 @@ test_expect_success 'push does not follow tags by default' '
 '
 
 test_expect_success 'push --follow-tags only pushes relevant tags' '
-	mk_test testrepo heads/master &&
+	mk_test testrepo heads/main &&
 	rm -fr src dst &&
 	git init src &&
 	git init --bare dst &&
 	(
 		cd src &&
-		git pull ../testrepo master &&
+		git pull ../testrepo main &&
 		git tag -m "annotated" tag &&
 		git checkout -b another &&
 		git commit --allow-empty -m "future commit" &&
 		git tag -m "future" future &&
-		git checkout master &&
-		git for-each-ref refs/heads/master refs/tags/tag >../expect &&
-		git push --follow-tags ../dst master
+		git checkout main &&
+		git for-each-ref refs/heads/main refs/tags/tag >../expect &&
+		git push --follow-tags ../dst main
 	) &&
 	(
 		cd dst &&
@@ -1427,12 +1427,12 @@ EOF
 	git commit -am initial &&
 	git init no-thin &&
 	git --git-dir=no-thin/.git config receive.unpacklimit 0 &&
-	git push no-thin/.git refs/heads/master:refs/heads/foo &&
+	git push no-thin/.git refs/heads/main:refs/heads/foo &&
 	echo modified >> path1 &&
 	git commit -am modified &&
 	git repack -adf &&
 	rcvpck="git receive-pack --reject-thin-pack-for-testing" &&
-	git push --no-thin --receive-pack="$rcvpck" no-thin/.git refs/heads/master:refs/heads/foo
+	git push --no-thin --receive-pack="$rcvpck" no-thin/.git refs/heads/main:refs/heads/foo
 '
 
 test_expect_success 'pushing a tag pushes the tagged object' '
@@ -1455,12 +1455,12 @@ test_expect_success 'push into bare respects core.logallrefupdates' '
 
 	# double push to test both with and without
 	# the actual pack transfer
-	git push dst.git master:one &&
+	git push dst.git main:one &&
 	echo "one@{0} push" >expect &&
 	git -C dst.git log -g --format="%gd %gs" one >actual &&
 	test_cmp expect actual &&
 
-	git push dst.git master:two &&
+	git push dst.git main:two &&
 	echo "two@{0} push" >expect &&
 	git -C dst.git log -g --format="%gd %gs" two >actual &&
 	test_cmp expect actual
@@ -1475,20 +1475,20 @@ test_expect_success 'fetch into bare respects core.logallrefupdates' '
 
 		# as above, we double-fetch to test both
 		# with and without pack transfer
-		git fetch .. master:one &&
-		echo "one@{0} fetch .. master:one: storing head" >expect &&
+		git fetch .. main:one &&
+		echo "one@{0} fetch .. main:one: storing head" >expect &&
 		git log -g --format="%gd %gs" one >actual &&
 		test_cmp expect actual &&
 
-		git fetch .. master:two &&
-		echo "two@{0} fetch .. master:two: storing head" >expect &&
+		git fetch .. main:two &&
+		echo "two@{0} fetch .. main:two: storing head" >expect &&
 		git log -g --format="%gd %gs" two >actual &&
 		test_cmp expect actual
 	)
 '
 
 test_expect_success 'receive.denyCurrentBranch = updateInstead' '
-	git push testrepo master &&
+	git push testrepo main &&
 	(
 		cd testrepo &&
 		git reset --hard &&
@@ -1497,7 +1497,7 @@ test_expect_success 'receive.denyCurrentBranch = updateInstead' '
 	test_commit third path2 &&
 
 	# Try pushing into a repository with pristine working tree
-	git push testrepo master &&
+	git push testrepo main &&
 	(
 		cd testrepo &&
 		git update-index -q --refresh &&
@@ -1514,7 +1514,7 @@ test_expect_success 'receive.denyCurrentBranch = updateInstead' '
 		test $(git -C .. rev-parse HEAD^) = $(git rev-parse HEAD) &&
 		test-tool chmtime +100 path1
 	) &&
-	git push testrepo master &&
+	git push testrepo main &&
 	(
 		cd testrepo &&
 		git update-index -q --refresh &&
@@ -1534,7 +1534,7 @@ test_expect_success 'receive.denyCurrentBranch = updateInstead' '
 		cd testrepo &&
 		echo changed >path1
 	) &&
-	test_must_fail git push testrepo master &&
+	test_must_fail git push testrepo main &&
 	(
 		cd testrepo &&
 		test $(git -C .. rev-parse HEAD^) = $(git rev-parse HEAD) &&
@@ -1548,7 +1548,7 @@ test_expect_success 'receive.denyCurrentBranch = updateInstead' '
 		echo changed >path1 &&
 		git add path1
 	) &&
-	test_must_fail git push testrepo master &&
+	test_must_fail git push testrepo main &&
 	(
 		cd testrepo &&
 		test $(git -C .. rev-parse HEAD^) = $(git rev-parse HEAD) &&
@@ -1565,7 +1565,7 @@ test_expect_success 'receive.denyCurrentBranch = updateInstead' '
 		git reset --hard &&
 		echo changed >path3
 	) &&
-	test_must_fail git push testrepo master &&
+	test_must_fail git push testrepo main &&
 	(
 		cd testrepo &&
 		test $(git -C .. rev-parse HEAD^^) = $(git rev-parse HEAD) &&
@@ -1581,7 +1581,7 @@ test_expect_success 'receive.denyCurrentBranch = updateInstead' '
 		echo fifth >path3 &&
 		git add path3
 	) &&
-	test_must_fail git push testrepo master &&
+	test_must_fail git push testrepo main &&
 	(
 		cd testrepo &&
 		test $(git -C .. rev-parse HEAD^^) = $(git rev-parse HEAD) &&
@@ -1596,17 +1596,17 @@ test_expect_success 'receive.denyCurrentBranch = updateInstead' '
 		cd void &&
 		git config receive.denyCurrentBranch updateInstead
 	) &&
-	git push void master &&
+	git push void main &&
 	(
 		cd void &&
-		test $(git -C .. rev-parse master) = $(git rev-parse HEAD) &&
+		test $(git -C .. rev-parse main) = $(git rev-parse HEAD) &&
 		git diff --quiet &&
 		git diff --cached --quiet
 	) &&
 
 	# (6) updateInstead intervened by fast-forward check
-	test_must_fail git push void master^:master &&
-	test $(git -C void rev-parse HEAD) = $(git rev-parse master) &&
+	test_must_fail git push void main^:main &&
+	test $(git -C void rev-parse HEAD) = $(git rev-parse main) &&
 	git -C void diff --quiet &&
 	git -C void diff --cached --quiet
 '
@@ -1616,7 +1616,7 @@ test_expect_success 'updateInstead with push-to-checkout hook' '
 	git init testrepo &&
 	(
 		cd testrepo &&
-		git pull .. master &&
+		git pull .. main &&
 		git reset --hard HEAD^^ &&
 		git tag initial &&
 		git config receive.denyCurrentBranch updateInstead &&
@@ -1634,7 +1634,7 @@ test_expect_success 'updateInstead with push-to-checkout hook' '
 	) &&
 
 	# Try pushing into a pristine
-	git push testrepo master &&
+	git push testrepo main &&
 	(
 		cd testrepo &&
 		git diff --quiet &&
@@ -1648,7 +1648,7 @@ test_expect_success 'updateInstead with push-to-checkout hook' '
 		git reset --hard initial &&
 		echo conflicting >path2
 	) &&
-	test_must_fail git push testrepo master &&
+	test_must_fail git push testrepo main &&
 	(
 		cd testrepo &&
 		test $(git rev-parse initial) = $(git rev-parse HEAD) &&
@@ -1664,7 +1664,7 @@ test_expect_success 'updateInstead with push-to-checkout hook' '
 		echo irrelevant >path5 &&
 		git add path5
 	) &&
-	git push testrepo master &&
+	git push testrepo main &&
 	(
 		cd testrepo &&
 		test "$(cat path1)" = unrelated &&
@@ -1704,7 +1704,7 @@ test_expect_success 'updateInstead with push-to-checkout hook' '
 		EOF
 	) &&
 
-	git push void master &&
+	git push void main &&
 	(
 		cd void &&
 		git diff --quiet &&
diff --git a/t/t5517-push-mirror.sh b/t/t5517-push-mirror.sh
index e4edd56404..a4b11495c6 100755
--- a/t/t5517-push-mirror.sh
+++ b/t/t5517-push-mirror.sh
@@ -15,16 +15,16 @@ invert () {
 }
 
 mk_repo_pair () {
-	rm -rf master mirror &&
+	rm -rf main mirror &&
 	mkdir mirror &&
 	(
 		cd mirror &&
 		git init &&
 		git config receive.denyCurrentBranch warn
 	) &&
-	mkdir master &&
+	mkdir main &&
 	(
-		cd master &&
+		cd main &&
 		git init &&
 		git remote add $1 up ../mirror
 	)
@@ -36,13 +36,13 @@ test_expect_success 'push mirror creates new branches' '
 
 	mk_repo_pair &&
 	(
-		cd master &&
+		cd main &&
 		echo one >foo && git add foo && git commit -m one &&
 		git push --mirror up
 	) &&
-	master_master=$(cd master && git show-ref -s --verify refs/heads/master) &&
-	mirror_master=$(cd mirror && git show-ref -s --verify refs/heads/master) &&
-	test "$master_master" = "$mirror_master"
+	main_main=$(cd main && git show-ref -s --verify refs/heads/main) &&
+	mirror_main=$(cd mirror && git show-ref -s --verify refs/heads/main) &&
+	test "$main_main" = "$mirror_main"
 
 '
 
@@ -50,15 +50,15 @@ test_expect_success 'push mirror updates existing branches' '
 
 	mk_repo_pair &&
 	(
-		cd master &&
+		cd main &&
 		echo one >foo && git add foo && git commit -m one &&
 		git push --mirror up &&
 		echo two >foo && git add foo && git commit -m two &&
 		git push --mirror up
 	) &&
-	master_master=$(cd master && git show-ref -s --verify refs/heads/master) &&
-	mirror_master=$(cd mirror && git show-ref -s --verify refs/heads/master) &&
-	test "$master_master" = "$mirror_master"
+	main_main=$(cd main && git show-ref -s --verify refs/heads/main) &&
+	mirror_main=$(cd mirror && git show-ref -s --verify refs/heads/main) &&
+	test "$main_main" = "$mirror_main"
 
 '
 
@@ -66,7 +66,7 @@ test_expect_success 'push mirror force updates existing branches' '
 
 	mk_repo_pair &&
 	(
-		cd master &&
+		cd main &&
 		echo one >foo && git add foo && git commit -m one &&
 		git push --mirror up &&
 		echo two >foo && git add foo && git commit -m two &&
@@ -74,9 +74,9 @@ test_expect_success 'push mirror force updates existing branches' '
 		git reset --hard HEAD^ &&
 		git push --mirror up
 	) &&
-	master_master=$(cd master && git show-ref -s --verify refs/heads/master) &&
-	mirror_master=$(cd mirror && git show-ref -s --verify refs/heads/master) &&
-	test "$master_master" = "$mirror_master"
+	main_main=$(cd main && git show-ref -s --verify refs/heads/main) &&
+	mirror_main=$(cd mirror && git show-ref -s --verify refs/heads/main) &&
+	test "$main_main" = "$mirror_main"
 
 '
 
@@ -84,9 +84,9 @@ test_expect_success 'push mirror removes branches' '
 
 	mk_repo_pair &&
 	(
-		cd master &&
+		cd main &&
 		echo one >foo && git add foo && git commit -m one &&
-		git branch remove master &&
+		git branch remove main &&
 		git push --mirror up &&
 		git branch -D remove &&
 		git push --mirror up
@@ -102,21 +102,21 @@ test_expect_success 'push mirror adds, updates and removes branches together' '
 
 	mk_repo_pair &&
 	(
-		cd master &&
+		cd main &&
 		echo one >foo && git add foo && git commit -m one &&
-		git branch remove master &&
+		git branch remove main &&
 		git push --mirror up &&
 		git branch -D remove &&
-		git branch add master &&
+		git branch add main &&
 		echo two >foo && git add foo && git commit -m two &&
 		git push --mirror up
 	) &&
-	master_master=$(cd master && git show-ref -s --verify refs/heads/master) &&
-	master_add=$(cd master && git show-ref -s --verify refs/heads/add) &&
-	mirror_master=$(cd mirror && git show-ref -s --verify refs/heads/master) &&
+	main_main=$(cd main && git show-ref -s --verify refs/heads/main) &&
+	main_add=$(cd main && git show-ref -s --verify refs/heads/add) &&
+	mirror_main=$(cd mirror && git show-ref -s --verify refs/heads/main) &&
 	mirror_add=$(cd mirror && git show-ref -s --verify refs/heads/add) &&
-	test "$master_master" = "$mirror_master" &&
-	test "$master_add" = "$mirror_add" &&
+	test "$main_main" = "$mirror_main" &&
+	test "$main_add" = "$mirror_add" &&
 	(
 		cd mirror &&
 		invert git show-ref -s --verify refs/heads/remove
@@ -130,14 +130,14 @@ test_expect_success 'push mirror creates new tags' '
 
 	mk_repo_pair &&
 	(
-		cd master &&
+		cd main &&
 		echo one >foo && git add foo && git commit -m one &&
-		git tag -f tmaster master &&
+		git tag -f tmain main &&
 		git push --mirror up
 	) &&
-	master_master=$(cd master && git show-ref -s --verify refs/tags/tmaster) &&
-	mirror_master=$(cd mirror && git show-ref -s --verify refs/tags/tmaster) &&
-	test "$master_master" = "$mirror_master"
+	main_main=$(cd main && git show-ref -s --verify refs/tags/tmain) &&
+	mirror_main=$(cd mirror && git show-ref -s --verify refs/tags/tmain) &&
+	test "$main_main" = "$mirror_main"
 
 '
 
@@ -145,17 +145,17 @@ test_expect_success 'push mirror updates existing tags' '
 
 	mk_repo_pair &&
 	(
-		cd master &&
+		cd main &&
 		echo one >foo && git add foo && git commit -m one &&
-		git tag -f tmaster master &&
+		git tag -f tmain main &&
 		git push --mirror up &&
 		echo two >foo && git add foo && git commit -m two &&
-		git tag -f tmaster master &&
+		git tag -f tmain main &&
 		git push --mirror up
 	) &&
-	master_master=$(cd master && git show-ref -s --verify refs/tags/tmaster) &&
-	mirror_master=$(cd mirror && git show-ref -s --verify refs/tags/tmaster) &&
-	test "$master_master" = "$mirror_master"
+	main_main=$(cd main && git show-ref -s --verify refs/tags/tmain) &&
+	mirror_main=$(cd mirror && git show-ref -s --verify refs/tags/tmain) &&
+	test "$main_main" = "$mirror_main"
 
 '
 
@@ -163,20 +163,20 @@ test_expect_success 'push mirror force updates existing tags' '
 
 	mk_repo_pair &&
 	(
-		cd master &&
+		cd main &&
 		echo one >foo && git add foo && git commit -m one &&
-		git tag -f tmaster master &&
+		git tag -f tmain main &&
 		git push --mirror up &&
 		echo two >foo && git add foo && git commit -m two &&
-		git tag -f tmaster master &&
+		git tag -f tmain main &&
 		git push --mirror up &&
 		git reset --hard HEAD^ &&
-		git tag -f tmaster master &&
+		git tag -f tmain main &&
 		git push --mirror up
 	) &&
-	master_master=$(cd master && git show-ref -s --verify refs/tags/tmaster) &&
-	mirror_master=$(cd mirror && git show-ref -s --verify refs/tags/tmaster) &&
-	test "$master_master" = "$mirror_master"
+	main_main=$(cd main && git show-ref -s --verify refs/tags/tmain) &&
+	mirror_main=$(cd mirror && git show-ref -s --verify refs/tags/tmain) &&
+	test "$main_main" = "$mirror_main"
 
 '
 
@@ -184,9 +184,9 @@ test_expect_success 'push mirror removes tags' '
 
 	mk_repo_pair &&
 	(
-		cd master &&
+		cd main &&
 		echo one >foo && git add foo && git commit -m one &&
-		git tag -f tremove master &&
+		git tag -f tremove main &&
 		git push --mirror up &&
 		git tag -d tremove &&
 		git push --mirror up
@@ -202,23 +202,23 @@ test_expect_success 'push mirror adds, updates and removes tags together' '
 
 	mk_repo_pair &&
 	(
-		cd master &&
+		cd main &&
 		echo one >foo && git add foo && git commit -m one &&
-		git tag -f tmaster master &&
-		git tag -f tremove master &&
+		git tag -f tmain main &&
+		git tag -f tremove main &&
 		git push --mirror up &&
 		git tag -d tremove &&
-		git tag tadd master &&
+		git tag tadd main &&
 		echo two >foo && git add foo && git commit -m two &&
-		git tag -f tmaster master &&
+		git tag -f tmain main &&
 		git push --mirror up
 	) &&
-	master_master=$(cd master && git show-ref -s --verify refs/tags/tmaster) &&
-	master_add=$(cd master && git show-ref -s --verify refs/tags/tadd) &&
-	mirror_master=$(cd mirror && git show-ref -s --verify refs/tags/tmaster) &&
+	main_main=$(cd main && git show-ref -s --verify refs/tags/tmain) &&
+	main_add=$(cd main && git show-ref -s --verify refs/tags/tadd) &&
+	mirror_main=$(cd mirror && git show-ref -s --verify refs/tags/tmain) &&
 	mirror_add=$(cd mirror && git show-ref -s --verify refs/tags/tadd) &&
-	test "$master_master" = "$mirror_master" &&
-	test "$master_add" = "$mirror_add" &&
+	test "$main_main" = "$mirror_main" &&
+	test "$main_add" = "$mirror_add" &&
 	(
 		cd mirror &&
 		invert git show-ref -s --verify refs/tags/tremove
@@ -230,10 +230,10 @@ test_expect_success 'remote.foo.mirror adds and removes branches' '
 
 	mk_repo_pair --mirror &&
 	(
-		cd master &&
+		cd main &&
 		echo one >foo && git add foo && git commit -m one &&
-		git branch keep master &&
-		git branch remove master &&
+		git branch keep main &&
+		git branch remove main &&
 		git push up &&
 		git branch -D remove &&
 		git push up
@@ -250,10 +250,10 @@ test_expect_success 'remote.foo.mirror=no has no effect' '
 
 	mk_repo_pair &&
 	(
-		cd master &&
+		cd main &&
 		echo one >foo && git add foo && git commit -m one &&
 		git config --add remote.up.mirror no &&
-		git branch keep master &&
+		git branch keep main &&
 		git push --mirror up &&
 		git branch -D keep &&
 		git push up :
@@ -268,10 +268,10 @@ test_expect_success 'remote.foo.mirror=no has no effect' '
 test_expect_success 'push to mirrored repository with refspec fails' '
 	mk_repo_pair &&
 	(
-		cd master &&
+		cd main &&
 		echo one >foo && git add foo && git commit -m one &&
 		git config --add remote.up.mirror true &&
-		test_must_fail git push up master
+		test_must_fail git push up main
 	)
 '
 
diff --git a/t/t5518-fetch-exit-status.sh b/t/t5518-fetch-exit-status.sh
index c2060bb870..78ba5c290a 100755
--- a/t/t5518-fetch-exit-status.sh
+++ b/t/t5518-fetch-exit-status.sh
@@ -17,20 +17,20 @@ test_expect_success setup '
 	echo side >file &&
 	git commit -a -m side &&
 
-	git checkout master &&
+	git checkout main &&
 	echo next >file &&
 	git commit -a -m next
 '
 
 test_expect_success 'non-fast-forward fetch' '
 
-	test_must_fail git fetch . master:side
+	test_must_fail git fetch . main:side
 
 '
 
 test_expect_success 'forced update' '
 
-	git fetch . +master:side
+	git fetch . +main:side
 
 '
 
diff --git a/t/t5519-push-alternates.sh b/t/t5519-push-alternates.sh
index 11fcd37700..1696eb5125 100755
--- a/t/t5519-push-alternates.sh
+++ b/t/t5519-push-alternates.sh
@@ -17,7 +17,7 @@ test_expect_success setup '
 		>file &&
 		git add . &&
 		git commit -m initial &&
-		git push ../alice-pub master
+		git push ../alice-pub main
 	) &&
 
 	# Project Bob is a fork of project Alice
@@ -31,7 +31,7 @@ test_expect_success setup '
 	git clone alice-pub bob-work &&
 	(
 		cd bob-work &&
-		git push ../bob-pub master
+		git push ../bob-pub main
 	)
 '
 
@@ -54,7 +54,7 @@ test_expect_success 'bob fetches from alice, works and pushes' '
 		# has at her public repository are available to it
 		# via its alternates.
 		cd bob-work &&
-		git pull ../alice-pub master &&
+		git pull ../alice-pub main &&
 		echo more bob >file &&
 		git commit -a -m third &&
 		git push ../bob-pub :
@@ -93,7 +93,7 @@ test_expect_success 'alice works and pushes again' '
 test_expect_success 'bob works and pushes' '
 	(
 		# This time Bob does not pull from Alice, and
-		# the master branch at her public repository points
+		# the main branch at her public repository points
 		# at a commit Bob does not know about.  This should
 		# not prevent the push by Bob from succeeding.
 		cd bob-work &&
@@ -122,11 +122,11 @@ test_expect_success 'alice works and pushes yet again' '
 test_expect_success 'bob works and pushes again' '
 	(
 		cd alice-pub &&
-		git cat-file commit master >../bob-work/commit
+		git cat-file commit main >../bob-work/commit
 	) &&
 	(
 		# This time Bob does not pull from Alice, and
-		# the master branch at her public repository points
+		# the main branch at her public repository points
 		# at a commit Bob does not fully know about, but
 		# he happens to have the commit object (but not the
 		# necessary tree) in his repository from Alice.
diff --git a/t/test-lib.sh b/t/test-lib.sh
index ca86f666e6..a12a1993d0 100644
--- a/t/test-lib.sh
+++ b/t/test-lib.sh
@@ -263,7 +263,7 @@ case "$TEST_NUMBER" in
 	GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
 	export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 	;;
-[0-4]*|5[0-4]*|550*)
+[0-4]*|5[0-4]*|55[01]*)
 	GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 	export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 	;;
-- 
gitgitgadget


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH 14/28] t55[23]*: adjust the references to the default branch name "main"
  2020-11-12 22:43 [PATCH 00/28] Use main as default branch name Johannes Schindelin via GitGitGadget
                   ` (12 preceding siblings ...)
  2020-11-12 22:43 ` [PATCH 13/28] t551*: " Johannes Schindelin via GitGitGadget
@ 2020-11-12 22:43 ` Johannes Schindelin via GitGitGadget
  2020-11-13 10:02   ` Ævar Arnfjörð Bjarmason
  2020-11-12 22:43 ` [PATCH 15/28] t55[4-9]*: " Johannes Schindelin via GitGitGadget
                   ` (18 subsequent siblings)
  32 siblings, 1 reply; 163+ messages in thread
From: Johannes Schindelin via GitGitGadget @ 2020-11-12 22:43 UTC (permalink / raw)
  To: git; +Cc: Johannes Schindelin, Johannes Schindelin

From: Johannes Schindelin <johannes.schindelin@gmx.de>

This trick was performed via

	$ (cd t &&
	   sed -i -e 's/master/main/g' -e 's/MASTER/MAIN/g' \
		-e 's/Master/Main/g' -e 's/naster/nain/g' -- t55[23]*.sh)

Note that t5533 contains a variation of the name `master` (`naster`)
that we rename here, too.

This commit allows us to define
`GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main` for that range of tests.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
---
 t/t5520-pull.sh                |  30 +++---
 t/t5521-pull-options.sh        |  16 +--
 t/t5523-push-upstream.sh       |  30 +++---
 t/t5526-fetch-submodules.sh    |   6 +-
 t/t5527-fetch-odd-refs.sh      |  14 +--
 t/t5528-push-default.sh        |  98 ++++++++---------
 t/t5529-push-errors.sh         |   2 +-
 t/t5530-upload-pack-error.sh   |   2 +-
 t/t5531-deep-submodule-push.sh | 188 ++++++++++++++++-----------------
 t/t5533-push-cas.sh            | 142 ++++++++++++-------------
 t/t5534-push-signed.sh         |   4 +-
 t/t5537-fetch-shallow.sh       |  30 +++---
 t/t5538-push-shallow.sh        |  22 ++--
 t/t5539-fetch-http-shallow.sh  |  14 +--
 t/test-lib.sh                  |   2 +-
 15 files changed, 300 insertions(+), 300 deletions(-)

diff --git a/t/t5520-pull.sh b/t/t5520-pull.sh
index 9fae07cdfa..3be99df66d 100755
--- a/t/t5520-pull.sh
+++ b/t/t5520-pull.sh
@@ -48,11 +48,11 @@ test_expect_success 'pulling into void' '
 	test_cmp file cloned/file
 '
 
-test_expect_success 'pulling into void using master:master' '
+test_expect_success 'pulling into void using main:main' '
 	git init cloned-uho &&
 	(
 		cd cloned-uho &&
-		git pull .. master:master
+		git pull .. main:main
 	) &&
 	test_path_is_file file &&
 	test_path_is_file cloned-uho/file &&
@@ -64,7 +64,7 @@ test_expect_success 'pulling into void does not overwrite untracked files' '
 	(
 		cd cloned-untracked &&
 		echo untracked >file &&
-		test_must_fail git pull .. master &&
+		test_must_fail git pull .. main &&
 		echo untracked >expect &&
 		test_cmp expect file
 	)
@@ -76,7 +76,7 @@ test_expect_success 'pulling into void does not overwrite staged files' '
 		cd cloned-staged-colliding &&
 		echo "alternate content" >file &&
 		git add file &&
-		test_must_fail git pull .. master &&
+		test_must_fail git pull .. main &&
 		echo "alternate content" >expect &&
 		test_cmp expect file &&
 		git cat-file blob :file >file.index &&
@@ -90,7 +90,7 @@ test_expect_success 'pulling into void does not remove new staged files' '
 		cd cloned-staged-new &&
 		echo "new tracked file" >newfile &&
 		git add newfile &&
-		git pull .. master &&
+		git pull .. main &&
 		echo "new tracked file" >expect &&
 		test_cmp expect newfile &&
 		git cat-file blob :newfile >newfile.index &&
@@ -102,15 +102,15 @@ test_expect_success 'pulling into void must not create an octopus' '
 	git init cloned-octopus &&
 	(
 		cd cloned-octopus &&
-		test_must_fail git pull .. master master &&
+		test_must_fail git pull .. main main &&
 		test_path_is_missing file
 	)
 '
 
 test_expect_success 'test . as a remote' '
-	git branch copy master &&
+	git branch copy main &&
 	git config branch.copy.remote . &&
-	git config branch.copy.merge refs/heads/master &&
+	git config branch.copy.merge refs/heads/main &&
 	echo updated >file &&
 	git commit -a -m updated &&
 	git checkout copy &&
@@ -126,7 +126,7 @@ test_expect_success 'test . as a remote' '
 '
 
 test_expect_success 'the default remote . should not break explicit pull' '
-	git checkout -b second master^ &&
+	git checkout -b second main^ &&
 	echo modified >file &&
 	git commit -a -m modified &&
 	git checkout copy &&
@@ -361,7 +361,7 @@ test_expect_success 'failed --rebase shows advice' '
 
 test_expect_success '--rebase fails with multiple branches' '
 	git reset --hard before-rebase &&
-	test_must_fail git pull --rebase . copy master 2>err &&
+	test_must_fail git pull --rebase . copy main 2>err &&
 	test_cmp_rev HEAD before-rebase &&
 	test_i18ngrep "Cannot rebase onto multiple branches" err &&
 	echo modified >expect &&
@@ -500,7 +500,7 @@ test_expect_success 'pull --rebase does not warn on --no-verify-signatures' '
 	test_i18ngrep ! "verify-signatures" err
 '
 
-# add a feature branch, keep-merge, that is merged into master, so the
+# add a feature branch, keep-merge, that is merged into main, so the
 # test can try preserving the merge commit (or not) with various
 # --rebase flags/pull.rebase settings.
 test_expect_success 'preserve merge setup' '
@@ -699,12 +699,12 @@ test_expect_success 'pull --rebase dies early with dirty working directory' '
 '
 
 test_expect_success 'pull --rebase works on branch yet to be born' '
-	git rev-parse master >expect &&
+	git rev-parse main >expect &&
 	mkdir empty_repo &&
 	(
 		cd empty_repo &&
 		git init &&
-		git pull --rebase .. master &&
+		git pull --rebase .. main &&
 		git rev-parse HEAD >../actual
 	) &&
 	test_cmp expect actual
@@ -720,7 +720,7 @@ test_expect_success 'pull --rebase fails on unborn branch with staged changes' '
 		echo staged-file >expect &&
 		git ls-files >actual &&
 		test_cmp expect actual &&
-		test_must_fail git pull --rebase .. master 2>err &&
+		test_must_fail git pull --rebase .. main 2>err &&
 		git ls-files >actual &&
 		test_cmp expect actual &&
 		git show :staged-file >actual &&
@@ -779,7 +779,7 @@ test_expect_success 'setup for avoiding reapplying old patches' '
 	(
 		cd dst &&
 		test_might_fail git rebase --abort &&
-		git reset --hard origin/master
+		git reset --hard origin/main
 	) &&
 	git clone --bare src src-replace.git &&
 	rm -rf src &&
diff --git a/t/t5521-pull-options.sh b/t/t5521-pull-options.sh
index db1a381cd9..ae80aaa480 100755
--- a/t/t5521-pull-options.sh
+++ b/t/t5521-pull-options.sh
@@ -99,13 +99,13 @@ test_expect_success 'git pull --force' '
 	cat >>.git/config <<-\EOF &&
 	[remote "one"]
 		url = ../parent
-		fetch = refs/heads/master:refs/heads/mirror
+		fetch = refs/heads/main:refs/heads/mirror
 	[remote "two"]
 		url = ../parent
-		fetch = refs/heads/master:refs/heads/origin
-	[branch "master"]
+		fetch = refs/heads/main:refs/heads/origin
+	[branch "main"]
 		remote = two
-		merge = refs/heads/master
+		merge = refs/heads/main
 	EOF
 	git pull two &&
 	test_commit A &&
@@ -124,9 +124,9 @@ test_expect_success 'git pull --all' '
 	[remote "two"]
 		url = ../parent
 		fetch = refs/heads/*:refs/remotes/two/*
-	[branch "master"]
+	[branch "main"]
 		remote = one
-		merge = refs/heads/master
+		merge = refs/heads/main
 	EOF
 	git pull --all
 	)
@@ -139,7 +139,7 @@ test_expect_success 'git pull --dry-run' '
 		cd clonedry &&
 		git pull --dry-run ../parent &&
 		test_path_is_missing .git/FETCH_HEAD &&
-		test_path_is_missing .git/refs/heads/master &&
+		test_path_is_missing .git/refs/heads/main &&
 		test_path_is_missing .git/index &&
 		test_path_is_missing file
 	)
@@ -153,7 +153,7 @@ test_expect_success 'git pull --all --dry-run' '
 		git remote add origin ../parent &&
 		git pull --all --dry-run &&
 		test_path_is_missing .git/FETCH_HEAD &&
-		test_path_is_missing .git/refs/remotes/origin/master &&
+		test_path_is_missing .git/refs/remotes/origin/main &&
 		test_path_is_missing .git/index &&
 		test_path_is_missing file
 	)
diff --git a/t/t5523-push-upstream.sh b/t/t5523-push-upstream.sh
index e47b5db5d6..a2eaa877a2 100755
--- a/t/t5523-push-upstream.sh
+++ b/t/t5523-push-upstream.sh
@@ -26,19 +26,19 @@ check_config() {
 	test_cmp expect.$1 actual.$1
 }
 
-test_expect_success 'push -u master:master' '
-	git push -u upstream master:master &&
-	check_config master upstream refs/heads/master
+test_expect_success 'push -u main:main' '
+	git push -u upstream main:main &&
+	check_config main upstream refs/heads/main
 '
 
-test_expect_success 'push -u master:other' '
-	git push -u upstream master:other &&
-	check_config master upstream refs/heads/other
+test_expect_success 'push -u main:other' '
+	git push -u upstream main:other &&
+	check_config main upstream refs/heads/other
 '
 
-test_expect_success 'push -u --dry-run master:otherX' '
-	git push -u --dry-run upstream master:otherX &&
-	check_config master upstream refs/heads/other
+test_expect_success 'push -u --dry-run main:otherX' '
+	git push -u --dry-run upstream main:otherX &&
+	check_config main upstream refs/heads/other
 '
 
 test_expect_success 'push -u topic_2:topic_2' '
@@ -74,7 +74,7 @@ test_expect_success 'push -u HEAD' '
 test_expect_success TTY 'progress messages go to tty' '
 	ensure_fresh_upstream &&
 
-	test_terminal git push -u upstream master >out 2>err &&
+	test_terminal git push -u upstream main >out 2>err &&
 	test_i18ngrep "Writing objects" err
 '
 
@@ -82,7 +82,7 @@ test_expect_success 'progress messages do not go to non-tty' '
 	ensure_fresh_upstream &&
 
 	# skip progress messages, since stderr is non-tty
-	git push -u upstream master >out 2>err &&
+	git push -u upstream main >out 2>err &&
 	test_i18ngrep ! "Writing objects" err
 '
 
@@ -90,21 +90,21 @@ test_expect_success 'progress messages go to non-tty (forced)' '
 	ensure_fresh_upstream &&
 
 	# force progress messages to stderr, even though it is non-tty
-	git push -u --progress upstream master >out 2>err &&
+	git push -u --progress upstream main >out 2>err &&
 	test_i18ngrep "Writing objects" err
 '
 
 test_expect_success TTY 'push -q suppresses progress' '
 	ensure_fresh_upstream &&
 
-	test_terminal git push -u -q upstream master >out 2>err &&
+	test_terminal git push -u -q upstream main >out 2>err &&
 	test_i18ngrep ! "Writing objects" err
 '
 
 test_expect_success TTY 'push --no-progress suppresses progress' '
 	ensure_fresh_upstream &&
 
-	test_terminal git push -u --no-progress upstream master >out 2>err &&
+	test_terminal git push -u --no-progress upstream main >out 2>err &&
 	test_i18ngrep ! "Unpacking objects" err &&
 	test_i18ngrep ! "Writing objects" err
 '
@@ -112,7 +112,7 @@ test_expect_success TTY 'push --no-progress suppresses progress' '
 test_expect_success TTY 'quiet push' '
 	ensure_fresh_upstream &&
 
-	test_terminal git push --quiet --no-progress upstream master 2>&1 | tee output &&
+	test_terminal git push --quiet --no-progress upstream main 2>&1 | tee output &&
 	test_must_be_empty output
 '
 
diff --git a/t/t5526-fetch-submodules.sh b/t/t5526-fetch-submodules.sh
index dd8e423d25..f45ba02b8a 100755
--- a/t/t5526-fetch-submodules.sh
+++ b/t/t5526-fetch-submodules.sh
@@ -481,7 +481,7 @@ test_expect_success PREPARE_FOR_MAIN_BRANCH "don't fetch submodule when newly re
 	test_i18ncmp expect.err actual.err &&
 	(
 		cd submodule &&
-		git checkout -q master
+		git checkout -q main
 	)
 '
 
@@ -663,9 +663,9 @@ test_expect_success 'fetch new submodule commits on-demand without .gitmodules e
 	git config -f .gitmodules --remove-section submodule.sub1 &&
 	git add .gitmodules &&
 	git commit -m "delete gitmodules file" &&
-	git checkout -B master &&
+	git checkout -B main &&
 	git -C downstream fetch &&
-	git -C downstream checkout origin/master &&
+	git -C downstream checkout origin/main &&
 
 	C=$(git -C submodule commit-tree -m "yet another change outside refs/heads" HEAD^{tree}) &&
 	git -C submodule update-ref refs/changes/7 $C &&
diff --git a/t/t5527-fetch-odd-refs.sh b/t/t5527-fetch-odd-refs.sh
index 3b0cb98422..c6a4db4c59 100755
--- a/t/t5527-fetch-odd-refs.sh
+++ b/t/t5527-fetch-odd-refs.sh
@@ -5,13 +5,13 @@ test_description='test fetching of oddly-named refs'
 
 # afterwards we will have:
 #  HEAD - two
-#  refs/for/refs/heads/master - one
-#  refs/heads/master - three
+#  refs/for/refs/heads/main - one
+#  refs/heads/main - three
 test_expect_success 'setup repo with odd suffix ref' '
 	echo content >file &&
 	git add . &&
 	git commit -m one &&
-	git update-ref refs/for/refs/heads/master HEAD &&
+	git update-ref refs/for/refs/heads/main HEAD &&
 	echo content >>file &&
 	git commit -a -m two &&
 	echo content >>file &&
@@ -22,7 +22,7 @@ test_expect_success 'setup repo with odd suffix ref' '
 test_expect_success 'suffix ref is ignored during fetch' '
 	git clone --bare file://"$PWD" suffix &&
 	echo three >expect &&
-	git --git-dir=suffix log -1 --format=%s refs/heads/master >actual &&
+	git --git-dir=suffix log -1 --format=%s refs/heads/main >actual &&
 	test_cmp expect actual
 '
 
@@ -33,7 +33,7 @@ test_expect_success 'try to create repo with absurdly long refname' '
 	(
 		cd long &&
 		test_commit long &&
-		test_commit master
+		test_commit main
 	) &&
 	if git -C long update-ref refs/heads/$ref1440 long; then
 		test_set_prereq LONG_REF
@@ -46,7 +46,7 @@ test_expect_success LONG_REF 'fetch handles extremely long refname' '
 	git fetch long refs/heads/*:refs/remotes/long/* &&
 	cat >expect <<-\EOF &&
 	long
-	master
+	main
 	EOF
 	git for-each-ref --format="%(subject)" refs/remotes/long >actual &&
 	test_cmp expect actual
@@ -55,7 +55,7 @@ test_expect_success LONG_REF 'fetch handles extremely long refname' '
 test_expect_success LONG_REF 'push handles extremely long refname' '
 	git push long :refs/heads/$ref1440 &&
 	git -C long for-each-ref --format="%(subject)" refs/heads >actual &&
-	echo master >expect &&
+	echo main >expect &&
 	test_cmp expect actual
 '
 
diff --git a/t/t5528-push-default.sh b/t/t5528-push-default.sh
index f0a287d97d..b6d1776c98 100755
--- a/t/t5528-push-default.sh
+++ b/t/t5528-push-default.sh
@@ -41,7 +41,7 @@ test_push_failure () {
 
 # $1 = success or failure
 # $2 = push.default value
-# $3 = branch to check for actual output (master or foo)
+# $3 = branch to check for actual output (main or foo)
 # $4 = [optional] switch to triangular workflow
 test_pushdefault_workflow () {
 	workflow=central
@@ -51,8 +51,8 @@ test_pushdefault_workflow () {
 		pushdefault=parent2
 	fi
 	test_expect_success "push.default = $2 $1 in $workflow workflows" "
-		test_config branch.master.remote parent1 &&
-		test_config branch.master.merge refs/heads/foo &&
+		test_config branch.main.remote parent1 &&
+		test_config branch.main.merge refs/heads/foo &&
 		test_config remote.pushdefault $pushdefault &&
 		test_commit commit-for-$2${4+-triangular} &&
 		test_push_$1 $2 $3 ${4+repo2}
@@ -60,32 +60,32 @@ test_pushdefault_workflow () {
 }
 
 test_expect_success '"upstream" pushes to configured upstream' '
-	git checkout master &&
-	test_config branch.master.remote parent1 &&
-	test_config branch.master.merge refs/heads/foo &&
+	git checkout main &&
+	test_config branch.main.remote parent1 &&
+	test_config branch.main.merge refs/heads/foo &&
 	test_commit two &&
 	test_push_success upstream foo
 '
 
 test_expect_success '"upstream" does not push on unconfigured remote' '
-	git checkout master &&
-	test_unconfig branch.master.remote &&
+	git checkout main &&
+	test_unconfig branch.main.remote &&
 	test_commit three &&
 	test_push_failure upstream
 '
 
 test_expect_success '"upstream" does not push on unconfigured branch' '
-	git checkout master &&
-	test_config branch.master.remote parent1 &&
-	test_unconfig branch.master.merge &&
+	git checkout main &&
+	test_config branch.main.remote parent1 &&
+	test_unconfig branch.main.merge &&
 	test_commit four &&
 	test_push_failure upstream
 '
 
 test_expect_success '"upstream" does not push when remotes do not match' '
-	git checkout master &&
-	test_config branch.master.remote parent1 &&
-	test_config branch.master.merge refs/heads/foo &&
+	git checkout main &&
+	test_config branch.main.remote parent1 &&
+	test_config branch.main.merge refs/heads/foo &&
 	test_config push.default upstream &&
 	test_commit five &&
 	test_must_fail git push parent2
@@ -121,99 +121,99 @@ test_expect_success 'push from/to new branch with current creates remote branch'
 '
 
 test_expect_success 'push to existing branch, with no upstream configured' '
-	test_config branch.master.remote repo1 &&
-	git checkout master &&
+	test_config branch.main.remote repo1 &&
+	git checkout main &&
 	test_push_failure simple &&
 	test_push_failure upstream
 '
 
 test_expect_success 'push to existing branch, upstream configured with same name' '
-	test_config branch.master.remote repo1 &&
-	test_config branch.master.merge refs/heads/master &&
-	git checkout master &&
+	test_config branch.main.remote repo1 &&
+	test_config branch.main.merge refs/heads/main &&
+	git checkout main &&
 	test_commit six &&
-	test_push_success upstream master &&
+	test_push_success upstream main &&
 	test_commit seven &&
-	test_push_success simple master
+	test_push_success simple main
 '
 
 test_expect_success 'push to existing branch, upstream configured with different name' '
-	test_config branch.master.remote repo1 &&
-	test_config branch.master.merge refs/heads/other-name &&
-	git checkout master &&
+	test_config branch.main.remote repo1 &&
+	test_config branch.main.merge refs/heads/other-name &&
+	git checkout main &&
 	test_commit eight &&
 	test_push_success upstream other-name &&
 	test_commit nine &&
 	test_push_failure simple &&
 	git --git-dir=repo1 log -1 --format="%h %s" "other-name" >expect-other-name &&
-	test_push_success current master &&
+	test_push_success current main &&
 	git --git-dir=repo1 log -1 --format="%h %s" "other-name" >actual-other-name &&
 	test_cmp expect-other-name actual-other-name
 '
 
-# We are on 'master', which integrates with 'foo' from parent1
+# We are on 'main', which integrates with 'foo' from parent1
 # remote (set in test_pushdefault_workflow helper).  Push to
 # parent1 in centralized, and push to parent2 in triangular workflow.
-# The parent1 repository has 'master' and 'foo' branches, while
-# the parent2 repository has only 'master' branch.
+# The parent1 repository has 'main' and 'foo' branches, while
+# the parent2 repository has only 'main' branch.
 #
 # test_pushdefault_workflow() arguments:
 # $1 = success or failure
 # $2 = push.default value
-# $3 = branch to check for actual output (master or foo)
+# $3 = branch to check for actual output (main or foo)
 # $4 = [optional] switch to triangular workflow
 
-# update parent1's master (which is not our upstream)
-test_pushdefault_workflow success current master
+# update parent1's main (which is not our upstream)
+test_pushdefault_workflow success current main
 
 # update parent1's foo (which is our upstream)
 test_pushdefault_workflow success upstream foo
 
 # upstream is foo which is not the name of the current branch
-test_pushdefault_workflow failure simple master
+test_pushdefault_workflow failure simple main
 
-# master and foo are updated
-test_pushdefault_workflow success matching master
+# main and foo are updated
+test_pushdefault_workflow success matching main
 
-# master is updated
-test_pushdefault_workflow success current master triangular
+# main is updated
+test_pushdefault_workflow success current main triangular
 
 # upstream mode cannot be used in triangular
 test_pushdefault_workflow failure upstream foo triangular
 
 # in triangular, 'simple' works as 'current' and update the branch
 # with the same name.
-test_pushdefault_workflow success simple master triangular
+test_pushdefault_workflow success simple main triangular
 
-# master is updated (parent2 does not have foo)
-test_pushdefault_workflow success matching master triangular
+# main is updated (parent2 does not have foo)
+test_pushdefault_workflow success matching main triangular
 
 # default tests, when no push-default is specified. This
 # should behave the same as "simple" in non-triangular
 # settings, and as "current" otherwise.
 
 test_expect_success 'default behavior allows "simple" push' '
-	test_config branch.master.remote parent1 &&
-	test_config branch.master.merge refs/heads/master &&
+	test_config branch.main.remote parent1 &&
+	test_config branch.main.merge refs/heads/main &&
 	test_config remote.pushdefault parent1 &&
-	test_commit default-master-master &&
-	test_push_success "" master
+	test_commit default-main-main &&
+	test_push_success "" main
 '
 
 test_expect_success 'default behavior rejects non-simple push' '
-	test_config branch.master.remote parent1 &&
-	test_config branch.master.merge refs/heads/foo &&
+	test_config branch.main.remote parent1 &&
+	test_config branch.main.merge refs/heads/foo &&
 	test_config remote.pushdefault parent1 &&
-	test_commit default-master-foo &&
+	test_commit default-main-foo &&
 	test_push_failure ""
 '
 
 test_expect_success 'default triangular behavior acts like "current"' '
-	test_config branch.master.remote parent1 &&
-	test_config branch.master.merge refs/heads/foo &&
+	test_config branch.main.remote parent1 &&
+	test_config branch.main.merge refs/heads/foo &&
 	test_config remote.pushdefault parent2 &&
 	test_commit default-triangular &&
-	test_push_success "" master repo2
+	test_push_success "" main repo2
 '
 
 test_done
diff --git a/t/t5529-push-errors.sh b/t/t5529-push-errors.sh
index 9871307fd4..ce85fd30ad 100755
--- a/t/t5529-push-errors.sh
+++ b/t/t5529-push-errors.sh
@@ -32,7 +32,7 @@ test_expect_success 'detect missing branches early' '
 test_expect_success 'detect missing sha1 expressions early' '
 	echo no >rp-ran &&
 	echo no >expect &&
-	test_must_fail git push origin master~2:master &&
+	test_must_fail git push origin main~2:main &&
 	test_cmp expect rp-ran
 '
 
diff --git a/t/t5530-upload-pack-error.sh b/t/t5530-upload-pack-error.sh
index 9dd2d2457a..7c1460eaa9 100755
--- a/t/t5530-upload-pack-error.sh
+++ b/t/t5530-upload-pack-error.sh
@@ -115,7 +115,7 @@ test_expect_success 'create empty repository' '
 
 test_expect_success 'fetch fails' '
 
-	test_must_fail git fetch .. master
+	test_must_fail git fetch .. main
 
 '
 
diff --git a/t/t5531-deep-submodule-push.sh b/t/t5531-deep-submodule-push.sh
index 4ad059e6be..afc0cd79f6 100755
--- a/t/t5531-deep-submodule-push.sh
+++ b/t/t5531-deep-submodule-push.sh
@@ -30,7 +30,7 @@ test_expect_success setup '
 test_expect_success 'push works with recorded gitlink' '
 	(
 		cd work &&
-		git push ../pub.git master
+		git push ../pub.git main
 	)
 '
 
@@ -45,7 +45,7 @@ test_expect_success 'push if submodule has no remote' '
 		cd work &&
 		git add gar/bage &&
 		git commit -m "Second commit for gar/bage" &&
-		git push --recurse-submodules=check ../pub.git master
+		git push --recurse-submodules=check ../pub.git main
 	)
 '
 
@@ -66,21 +66,21 @@ test_expect_success 'push fails if submodule commit not on remote' '
 		git commit -m "Third commit for gar/bage" &&
 		# the push should fail with --recurse-submodules=check
 		# on the command line...
-		test_must_fail git push --recurse-submodules=check ../pub.git master &&
+		test_must_fail git push --recurse-submodules=check ../pub.git main &&
 
 		# ...or if specified in the configuration..
-		test_must_fail git -c push.recurseSubmodules=check push ../pub.git master
+		test_must_fail git -c push.recurseSubmodules=check push ../pub.git main
 	)
 '
 
 test_expect_success 'push succeeds after commit was pushed to remote' '
 	(
 		cd work/gar/bage &&
-		git push origin master
+		git push origin main
 	) &&
 	(
 		cd work &&
-		git push --recurse-submodules=check ../pub.git master
+		git push --recurse-submodules=check ../pub.git main
 	)
 '
 
@@ -95,13 +95,13 @@ test_expect_success 'push succeeds if submodule commit not on remote but using o
 		cd work &&
 		git add gar/bage &&
 		git commit -m "Recurse on-demand on command line for gar/bage" &&
-		git push --recurse-submodules=on-demand ../pub.git master &&
+		git push --recurse-submodules=on-demand ../pub.git main &&
 		# Check that the supermodule commit got there
 		git fetch ../pub.git &&
-		git diff --quiet FETCH_HEAD master &&
+		git diff --quiet FETCH_HEAD main &&
 		# Check that the submodule commit got there too
 		cd gar/bage &&
-		git diff --quiet origin/master master
+		git diff --quiet origin/main main
 	)
 '
 
@@ -116,13 +116,13 @@ test_expect_success 'push succeeds if submodule commit not on remote but using o
 		cd work &&
 		git add gar/bage &&
 		git commit -m "Recurse on-demand from config for gar/bage" &&
-		git -c push.recurseSubmodules=on-demand push ../pub.git master &&
+		git -c push.recurseSubmodules=on-demand push ../pub.git main &&
 		# Check that the supermodule commit got there
 		git fetch ../pub.git &&
-		git diff --quiet FETCH_HEAD master &&
+		git diff --quiet FETCH_HEAD main &&
 		# Check that the submodule commit got there too
 		cd gar/bage &&
-		git diff --quiet origin/master master
+		git diff --quiet origin/main main
 	)
 '
 
@@ -137,13 +137,13 @@ test_expect_success 'push succeeds if submodule commit not on remote but using a
 		cd work &&
 		git add gar/bage &&
 		git commit -m "Recurse submodule.recurse from config for gar/bage" &&
-		git -c submodule.recurse push ../pub.git master &&
+		git -c submodule.recurse push ../pub.git main &&
 		# Check that the supermodule commit got there
 		git fetch ../pub.git &&
-		git diff --quiet FETCH_HEAD master &&
+		git diff --quiet FETCH_HEAD main &&
 		# Check that the submodule commit got there too
 		cd gar/bage &&
-		git diff --quiet origin/master master
+		git diff --quiet origin/main main
 	)
 '
 
@@ -161,34 +161,34 @@ test_expect_success 'push recurse-submodules on command line overrides config' '
 
 		# Ensure that we can override on-demand in the config
 		# to just check submodules
-		test_must_fail git -c push.recurseSubmodules=on-demand push --recurse-submodules=check ../pub.git master &&
+		test_must_fail git -c push.recurseSubmodules=on-demand push --recurse-submodules=check ../pub.git main &&
 		# Check that the supermodule commit did not get there
 		git fetch ../pub.git &&
-		git diff --quiet FETCH_HEAD master^ &&
+		git diff --quiet FETCH_HEAD main^ &&
 		# Check that the submodule commit did not get there
-		(cd gar/bage && git diff --quiet origin/master master^) &&
+		(cd gar/bage && git diff --quiet origin/main main^) &&
 
 		# Ensure that we can override check in the config to
 		# disable submodule recursion entirely
-		(cd gar/bage && git diff --quiet origin/master master^) &&
-		git -c push.recurseSubmodules=on-demand push --recurse-submodules=no ../pub.git master &&
+		(cd gar/bage && git diff --quiet origin/main main^) &&
+		git -c push.recurseSubmodules=on-demand push --recurse-submodules=no ../pub.git main &&
 		git fetch ../pub.git &&
-		git diff --quiet FETCH_HEAD master &&
-		(cd gar/bage && git diff --quiet origin/master master^) &&
+		git diff --quiet FETCH_HEAD main &&
+		(cd gar/bage && git diff --quiet origin/main main^) &&
 
 		# Ensure that we can override check in the config to
 		# disable submodule recursion entirely (alternative form)
-		git -c push.recurseSubmodules=on-demand push --no-recurse-submodules ../pub.git master &&
+		git -c push.recurseSubmodules=on-demand push --no-recurse-submodules ../pub.git main &&
 		git fetch ../pub.git &&
-		git diff --quiet FETCH_HEAD master &&
-		(cd gar/bage && git diff --quiet origin/master master^) &&
+		git diff --quiet FETCH_HEAD main &&
+		(cd gar/bage && git diff --quiet origin/main main^) &&
 
 		# Ensure that we can override check in the config to
 		# push the submodule too
-		git -c push.recurseSubmodules=check push --recurse-submodules=on-demand ../pub.git master &&
+		git -c push.recurseSubmodules=check push --recurse-submodules=on-demand ../pub.git main &&
 		git fetch ../pub.git &&
-		git diff --quiet FETCH_HEAD master &&
-		(cd gar/bage && git diff --quiet origin/master master)
+		git diff --quiet FETCH_HEAD main &&
+		(cd gar/bage && git diff --quiet origin/main main)
 	)
 '
 
@@ -205,31 +205,31 @@ test_expect_success 'push recurse-submodules last one wins on command line' '
 		git commit -m "Recurse on command-line overriding earlier command-line for gar/bage" &&
 
 		# should result in "check"
-		test_must_fail git push --recurse-submodules=on-demand --recurse-submodules=check ../pub.git master &&
+		test_must_fail git push --recurse-submodules=on-demand --recurse-submodules=check ../pub.git main &&
 		# Check that the supermodule commit did not get there
 		git fetch ../pub.git &&
-		git diff --quiet FETCH_HEAD master^ &&
+		git diff --quiet FETCH_HEAD main^ &&
 		# Check that the submodule commit did not get there
-		(cd gar/bage && git diff --quiet origin/master master^) &&
+		(cd gar/bage && git diff --quiet origin/main main^) &&
 
 		# should result in "no"
-		git push --recurse-submodules=on-demand --recurse-submodules=no ../pub.git master &&
+		git push --recurse-submodules=on-demand --recurse-submodules=no ../pub.git main &&
 		# Check that the supermodule commit did get there
 		git fetch ../pub.git &&
-		git diff --quiet FETCH_HEAD master &&
+		git diff --quiet FETCH_HEAD main &&
 		# Check that the submodule commit did not get there
-		(cd gar/bage && git diff --quiet origin/master master^) &&
+		(cd gar/bage && git diff --quiet origin/main main^) &&
 
 		# should result in "no"
-		git push --recurse-submodules=on-demand --no-recurse-submodules ../pub.git master &&
+		git push --recurse-submodules=on-demand --no-recurse-submodules ../pub.git main &&
 		# Check that the submodule commit did not get there
-		(cd gar/bage && git diff --quiet origin/master master^) &&
+		(cd gar/bage && git diff --quiet origin/main main^) &&
 
 		# But the options in the other order should push the submodule
-		git push --recurse-submodules=check --recurse-submodules=on-demand ../pub.git master &&
+		git push --recurse-submodules=check --recurse-submodules=on-demand ../pub.git main &&
 		# Check that the submodule commit did get there
 		git fetch ../pub.git &&
-		(cd gar/bage && git diff --quiet origin/master master)
+		(cd gar/bage && git diff --quiet origin/main main)
 	)
 '
 
@@ -244,13 +244,13 @@ test_expect_success 'push succeeds if submodule commit not on remote using on-de
 		cd work &&
 		git add gar/bage &&
 		git commit -m "Recurse on-demand on command-line overriding config for gar/bage" &&
-		git -c push.recurseSubmodules=check push --recurse-submodules=on-demand ../pub.git master &&
+		git -c push.recurseSubmodules=check push --recurse-submodules=on-demand ../pub.git main &&
 		# Check that the supermodule commit got there
 		git fetch ../pub.git &&
-		git diff --quiet FETCH_HEAD master &&
+		git diff --quiet FETCH_HEAD main &&
 		# Check that the submodule commit got there
 		cd gar/bage &&
-		git diff --quiet origin/master master
+		git diff --quiet origin/main main
 	)
 '
 
@@ -265,14 +265,14 @@ test_expect_success 'push succeeds if submodule commit disabling recursion from
 		cd work &&
 		git add gar/bage &&
 		git commit -m "Recurse disable on command-line overriding config for gar/bage" &&
-		git -c push.recurseSubmodules=check push --recurse-submodules=no ../pub.git master &&
+		git -c push.recurseSubmodules=check push --recurse-submodules=no ../pub.git main &&
 		# Check that the supermodule commit got there
 		git fetch ../pub.git &&
-		git diff --quiet FETCH_HEAD master &&
+		git diff --quiet FETCH_HEAD main &&
 		# But that the submodule commit did not
-		( cd gar/bage && git diff --quiet origin/master master^ ) &&
+		( cd gar/bage && git diff --quiet origin/main main^ ) &&
 		# Now push it to avoid confusing future tests
-		git push --recurse-submodules=on-demand ../pub.git master
+		git push --recurse-submodules=on-demand ../pub.git main
 	)
 '
 
@@ -287,14 +287,14 @@ test_expect_success 'push succeeds if submodule commit disabling recursion from
 		cd work &&
 		git add gar/bage &&
 		git commit -m "Recurse disable on command-line alternative overriding config for gar/bage" &&
-		git -c push.recurseSubmodules=check push --no-recurse-submodules ../pub.git master &&
+		git -c push.recurseSubmodules=check push --no-recurse-submodules ../pub.git main &&
 		# Check that the supermodule commit got there
 		git fetch ../pub.git &&
-		git diff --quiet FETCH_HEAD master &&
+		git diff --quiet FETCH_HEAD main &&
 		# But that the submodule commit did not
-		( cd gar/bage && git diff --quiet origin/master master^ ) &&
+		( cd gar/bage && git diff --quiet origin/main main^ ) &&
 		# Now push it to avoid confusing future tests
-		git push --recurse-submodules=on-demand ../pub.git master
+		git push --recurse-submodules=on-demand ../pub.git main
 	)
 '
 
@@ -304,7 +304,7 @@ test_expect_success 'submodule entry pointing at a tag is error' '
 	git -C work update-index --cacheinfo 160000 "$tag" gar/bage &&
 	git -C work commit -m "bad commit" &&
 	test_when_finished "git -C work reset --hard HEAD^" &&
-	test_must_fail git -C work push --recurse-submodules=on-demand ../pub.git master 2>err &&
+	test_must_fail git -C work push --recurse-submodules=on-demand ../pub.git main 2>err &&
 	test_i18ngrep "is a tag, not a commit" err
 '
 
@@ -319,9 +319,9 @@ test_expect_success 'push fails if recurse submodules option passed as yes' '
 		cd work &&
 		git add gar/bage &&
 		git commit -m "Recurse push fails if recurse submodules option passed as yes for gar/bage" &&
-		test_must_fail git push --recurse-submodules=yes ../pub.git master &&
-		test_must_fail git -c push.recurseSubmodules=yes push ../pub.git master &&
-		git push --recurse-submodules=on-demand ../pub.git master
+		test_must_fail git push --recurse-submodules=yes ../pub.git main &&
+		test_must_fail git -c push.recurseSubmodules=yes push ../pub.git main &&
+		git push --recurse-submodules=on-demand ../pub.git main
 	)
 '
 
@@ -363,7 +363,7 @@ test_expect_success 'push succeeds if submodule has no remote and is on the firs
 		) &&
 		git add b &&
 		git commit -m "added submodule" &&
-		git push --recurse-submodules=check origin master
+		git push --recurse-submodules=check origin main
 	)
 '
 
@@ -372,21 +372,21 @@ test_expect_success 'push unpushed submodules when not needed' '
 		cd work &&
 		(
 			cd gar/bage &&
-			git checkout master &&
+			git checkout main &&
 			>junk5 &&
 			git add junk5 &&
 			git commit -m "Fifth junk" &&
 			git push &&
-			git rev-parse origin/master >../../../expected
+			git rev-parse origin/main >../../../expected
 		) &&
-		git checkout master &&
+		git checkout main &&
 		git add gar/bage &&
 		git commit -m "Fifth commit for gar/bage" &&
-		git push --recurse-submodules=on-demand ../pub.git master
+		git push --recurse-submodules=on-demand ../pub.git main
 	) &&
 	(
 		cd submodule.git &&
-		git rev-parse master >../actual
+		git rev-parse main >../actual
 	) &&
 	test_cmp expected actual
 '
@@ -394,7 +394,7 @@ test_expect_success 'push unpushed submodules when not needed' '
 test_expect_success 'push unpushed submodules when not needed 2' '
 	(
 		cd submodule.git &&
-		git rev-parse master >../expected
+		git rev-parse main >../expected
 	) &&
 	(
 		cd work &&
@@ -407,11 +407,11 @@ test_expect_success 'push unpushed submodules when not needed 2' '
 		>junk2 &&
 		git add junk2 &&
 		git commit -m "Second junk for work" &&
-		git push --recurse-submodules=on-demand ../pub.git master
+		git push --recurse-submodules=on-demand ../pub.git main
 	) &&
 	(
 		cd submodule.git &&
-		git rev-parse master >../actual
+		git rev-parse main >../actual
 	) &&
 	test_cmp expected actual
 '
@@ -421,20 +421,20 @@ test_expect_success 'push unpushed submodules recursively' '
 		cd work &&
 		(
 			cd gar/bage &&
-			git checkout master &&
+			git checkout main &&
 			> junk7 &&
 			git add junk7 &&
 			git commit -m "Seventh junk" &&
-			git rev-parse master >../../../expected
+			git rev-parse main >../../../expected
 		) &&
-		git checkout master &&
+		git checkout main &&
 		git add gar/bage &&
 		git commit -m "Seventh commit for gar/bage" &&
-		git push --recurse-submodules=on-demand ../pub.git master
+		git push --recurse-submodules=on-demand ../pub.git main
 	) &&
 	(
 		cd submodule.git &&
-		git rev-parse master >../actual
+		git rev-parse main >../actual
 	) &&
 	test_cmp expected actual
 '
@@ -444,64 +444,64 @@ test_expect_success 'push unpushable submodule recursively fails' '
 		cd work &&
 		(
 			cd gar/bage &&
-			git rev-parse origin/master >../../../expected &&
-			git checkout master~0 &&
+			git rev-parse origin/main >../../../expected &&
+			git checkout main~0 &&
 			> junk8 &&
 			git add junk8 &&
 			git commit -m "Eighth junk"
 		) &&
 		git add gar/bage &&
 		git commit -m "Eighth commit for gar/bage" &&
-		test_must_fail git push --recurse-submodules=on-demand ../pub.git master
+		test_must_fail git push --recurse-submodules=on-demand ../pub.git main
 	) &&
 	(
 		cd submodule.git &&
-		git rev-parse master >../actual
+		git rev-parse main >../actual
 	) &&
-	test_when_finished git -C work reset --hard master^ &&
+	test_when_finished git -C work reset --hard main^ &&
 	test_cmp expected actual
 '
 
 test_expect_success 'push --dry-run does not recursively update submodules' '
 	(
 		cd work/gar/bage &&
-		git checkout master &&
-		git rev-parse master >../../../expected_submodule &&
+		git checkout main &&
+		git rev-parse main >../../../expected_submodule &&
 		> junk9 &&
 		git add junk9 &&
 		git commit -m "Ninth junk" &&
 
 		# Go up to 'work' directory
 		cd ../.. &&
-		git checkout master &&
-		git rev-parse master >../expected_pub &&
+		git checkout main &&
+		git rev-parse main >../expected_pub &&
 		git add gar/bage &&
 		git commit -m "Ninth commit for gar/bage" &&
-		git push --dry-run --recurse-submodules=on-demand ../pub.git master
+		git push --dry-run --recurse-submodules=on-demand ../pub.git main
 	) &&
-	git -C submodule.git rev-parse master >actual_submodule &&
-	git -C pub.git rev-parse master >actual_pub &&
+	git -C submodule.git rev-parse main >actual_submodule &&
+	git -C pub.git rev-parse main >actual_pub &&
 	test_cmp expected_pub actual_pub &&
 	test_cmp expected_submodule actual_submodule
 '
 
 test_expect_success 'push --dry-run does not recursively update submodules' '
-	git -C work push --dry-run --recurse-submodules=only ../pub.git master &&
+	git -C work push --dry-run --recurse-submodules=only ../pub.git main &&
 
-	git -C submodule.git rev-parse master >actual_submodule &&
-	git -C pub.git rev-parse master >actual_pub &&
+	git -C submodule.git rev-parse main >actual_submodule &&
+	git -C pub.git rev-parse main >actual_pub &&
 	test_cmp expected_pub actual_pub &&
 	test_cmp expected_submodule actual_submodule
 '
 
 test_expect_success 'push only unpushed submodules recursively' '
-	git -C work/gar/bage rev-parse master >expected_submodule &&
-	git -C pub.git rev-parse master >expected_pub &&
+	git -C work/gar/bage rev-parse main >expected_submodule &&
+	git -C pub.git rev-parse main >expected_pub &&
 
-	git -C work push --recurse-submodules=only ../pub.git master &&
+	git -C work push --recurse-submodules=only ../pub.git main &&
 
-	git -C submodule.git rev-parse master >actual_submodule &&
-	git -C pub.git rev-parse master >actual_pub &&
+	git -C submodule.git rev-parse main >actual_submodule &&
+	git -C pub.git rev-parse main >actual_pub &&
 	test_cmp expected_submodule actual_submodule &&
 	test_cmp expected_pub actual_pub
 '
@@ -517,14 +517,14 @@ test_expect_success 'push propagating the remotes name to a submodule' '
 	git -C work commit -m "Tenth junk added to gar/bage" &&
 
 	# Fails when submodule does not have a matching remote
-	test_must_fail git -C work push --recurse-submodules=on-demand pub master &&
+	test_must_fail git -C work push --recurse-submodules=on-demand pub main &&
 	# Succeeds when submodules has matching remote and refspec
-	git -C work push --recurse-submodules=on-demand origin master &&
+	git -C work push --recurse-submodules=on-demand origin main &&
 
-	git -C submodule.git rev-parse master >actual_submodule &&
-	git -C pub.git rev-parse master >actual_pub &&
-	git -C work/gar/bage rev-parse master >expected_submodule &&
-	git -C work rev-parse master >expected_pub &&
+	git -C submodule.git rev-parse main >actual_submodule &&
+	git -C pub.git rev-parse main >actual_pub &&
+	git -C work/gar/bage rev-parse main >expected_submodule &&
+	git -C work rev-parse main >expected_pub &&
 	test_cmp expected_submodule actual_submodule &&
 	test_cmp expected_pub actual_pub
 '
@@ -548,7 +548,7 @@ test_expect_success 'push propagating refspec to a submodule' '
 	test_must_fail git -C work push --recurse-submodules=on-demand origin \
 		HEAD:refs/heads/branch2 &&
 
-	git -C work/gar/bage branch branch2 master &&
+	git -C work/gar/bage branch branch2 main &&
 	git -C work push --recurse-submodules=on-demand origin branch2 &&
 
 	git -C submodule.git rev-parse branch2 >actual_submodule &&
diff --git a/t/t5533-push-cas.sh b/t/t5533-push-cas.sh
index 7813e8470e..9fcec604c3 100755
--- a/t/t5533-push-cas.sh
+++ b/t/t5533-push-cas.sh
@@ -29,22 +29,22 @@ setup_src_dup_dst () {
 	(
 		cd dup &&
 		git fetch &&
-		git merge origin/master &&
-		git switch -c branch master~2 &&
+		git merge origin/main &&
+		git switch -c branch main~2 &&
 		test_commit D &&
 		test_commit E &&
 		git push origin --all
 	) &&
 	(
 		cd src &&
-		git switch master &&
+		git switch main &&
 		git fetch --all &&
 		git branch branch --track origin/branch &&
-		git rebase origin/master
+		git rebase origin/main
 	) &&
 	(
 		cd dup &&
-		git switch master &&
+		git switch main &&
 		test_commit F &&
 		test_commit G &&
 		git switch branch &&
@@ -65,11 +65,11 @@ test_expect_success 'push to update (protected)' '
 	(
 		cd dst &&
 		test_commit D &&
-		test_must_fail git push --force-with-lease=master:master origin master 2>err &&
+		test_must_fail git push --force-with-lease=main:main origin main 2>err &&
 		grep "stale info" err
 	) &&
-	git ls-remote . refs/heads/master >expect &&
-	git ls-remote src refs/heads/master >actual &&
+	git ls-remote . refs/heads/main >expect &&
+	git ls-remote src refs/heads/main >actual &&
 	test_cmp expect actual
 '
 
@@ -78,11 +78,11 @@ test_expect_success 'push to update (protected, forced)' '
 	(
 		cd dst &&
 		test_commit D &&
-		git push --force --force-with-lease=master:master origin master 2>err &&
+		git push --force --force-with-lease=main:main origin main 2>err &&
 		grep "forced update" err
 	) &&
-	git ls-remote dst refs/heads/master >expect &&
-	git ls-remote src refs/heads/master >actual &&
+	git ls-remote dst refs/heads/main >expect &&
+	git ls-remote src refs/heads/main >actual &&
 	test_cmp expect actual
 '
 
@@ -90,20 +90,20 @@ test_expect_success 'push to update (protected, tracking)' '
 	setup_srcdst_basic &&
 	(
 		cd src &&
-		git checkout master &&
+		git checkout main &&
 		test_commit D &&
 		git checkout HEAD^0
 	) &&
-	git ls-remote src refs/heads/master >expect &&
+	git ls-remote src refs/heads/main >expect &&
 	(
 		cd dst &&
 		test_commit E &&
-		git ls-remote . refs/remotes/origin/master >expect &&
-		test_must_fail git push --force-with-lease=master origin master &&
-		git ls-remote . refs/remotes/origin/master >actual &&
+		git ls-remote . refs/remotes/origin/main >expect &&
+		test_must_fail git push --force-with-lease=main origin main &&
+		git ls-remote . refs/remotes/origin/main >actual &&
 		test_cmp expect actual
 	) &&
-	git ls-remote src refs/heads/master >actual &&
+	git ls-remote src refs/heads/main >actual &&
 	test_cmp expect actual
 '
 
@@ -111,18 +111,18 @@ test_expect_success 'push to update (protected, tracking, forced)' '
 	setup_srcdst_basic &&
 	(
 		cd src &&
-		git checkout master &&
+		git checkout main &&
 		test_commit D &&
 		git checkout HEAD^0
 	) &&
 	(
 		cd dst &&
 		test_commit E &&
-		git ls-remote . refs/remotes/origin/master >expect &&
-		git push --force --force-with-lease=master origin master
+		git ls-remote . refs/remotes/origin/main >expect &&
+		git push --force --force-with-lease=main origin main
 	) &&
-	git ls-remote dst refs/heads/master >expect &&
-	git ls-remote src refs/heads/master >actual &&
+	git ls-remote dst refs/heads/main >expect &&
+	git ls-remote src refs/heads/main >actual &&
 	test_cmp expect actual
 '
 
@@ -131,10 +131,10 @@ test_expect_success 'push to update (allowed)' '
 	(
 		cd dst &&
 		test_commit D &&
-		git push --force-with-lease=master:master^ origin master
+		git push --force-with-lease=main:main^ origin main
 	) &&
-	git ls-remote dst refs/heads/master >expect &&
-	git ls-remote src refs/heads/master >actual &&
+	git ls-remote dst refs/heads/main >expect &&
+	git ls-remote src refs/heads/main >actual &&
 	test_cmp expect actual
 '
 
@@ -143,11 +143,11 @@ test_expect_success 'push to update (allowed, tracking)' '
 	(
 		cd dst &&
 		test_commit D &&
-		git push --force-with-lease=master origin master 2>err &&
+		git push --force-with-lease=main origin main 2>err &&
 		! grep "forced update" err
 	) &&
-	git ls-remote dst refs/heads/master >expect &&
-	git ls-remote src refs/heads/master >actual &&
+	git ls-remote dst refs/heads/main >expect &&
+	git ls-remote src refs/heads/main >actual &&
 	test_cmp expect actual
 '
 
@@ -157,22 +157,22 @@ test_expect_success 'push to update (allowed even though no-ff)' '
 		cd dst &&
 		git reset --hard HEAD^ &&
 		test_commit D &&
-		git push --force-with-lease=master origin master 2>err &&
+		git push --force-with-lease=main origin main 2>err &&
 		grep "forced update" err
 	) &&
-	git ls-remote dst refs/heads/master >expect &&
-	git ls-remote src refs/heads/master >actual &&
+	git ls-remote dst refs/heads/main >expect &&
+	git ls-remote src refs/heads/main >actual &&
 	test_cmp expect actual
 '
 
 test_expect_success 'push to delete (protected)' '
 	setup_srcdst_basic &&
-	git ls-remote src refs/heads/master >expect &&
+	git ls-remote src refs/heads/main >expect &&
 	(
 		cd dst &&
-		test_must_fail git push --force-with-lease=master:master^ origin :master
+		test_must_fail git push --force-with-lease=main:main^ origin :main
 	) &&
-	git ls-remote src refs/heads/master >actual &&
+	git ls-remote src refs/heads/main >actual &&
 	test_cmp expect actual
 '
 
@@ -180,9 +180,9 @@ test_expect_success 'push to delete (protected, forced)' '
 	setup_srcdst_basic &&
 	(
 		cd dst &&
-		git push --force --force-with-lease=master:master^ origin :master
+		git push --force --force-with-lease=main:main^ origin :main
 	) &&
-	git ls-remote src refs/heads/master >actual &&
+	git ls-remote src refs/heads/main >actual &&
 	test_must_be_empty actual
 '
 
@@ -190,10 +190,10 @@ test_expect_success 'push to delete (allowed)' '
 	setup_srcdst_basic &&
 	(
 		cd dst &&
-		git push --force-with-lease=master origin :master 2>err &&
+		git push --force-with-lease=main origin :main 2>err &&
 		grep deleted err
 	) &&
-	git ls-remote src refs/heads/master >actual &&
+	git ls-remote src refs/heads/main >actual &&
 	test_must_be_empty actual
 '
 
@@ -201,12 +201,12 @@ test_expect_success 'cover everything with default force-with-lease (protected)'
 	setup_srcdst_basic &&
 	(
 		cd src &&
-		git branch naster master^
+		git branch nain main^
 	) &&
 	git ls-remote src refs/heads/\* >expect &&
 	(
 		cd dst &&
-		test_must_fail git push --force-with-lease origin master master:naster
+		test_must_fail git push --force-with-lease origin main main:nain
 	) &&
 	git ls-remote src refs/heads/\* >actual &&
 	test_cmp expect actual
@@ -216,16 +216,16 @@ test_expect_success 'cover everything with default force-with-lease (allowed)' '
 	setup_srcdst_basic &&
 	(
 		cd src &&
-		git branch naster master^
+		git branch nain main^
 	) &&
 	(
 		cd dst &&
 		git fetch &&
-		git push --force-with-lease origin master master:naster
+		git push --force-with-lease origin main main:nain
 	) &&
-	git ls-remote dst refs/heads/master |
-	sed -e "s/master/naster/" >expect &&
-	git ls-remote src refs/heads/naster >actual &&
+	git ls-remote dst refs/heads/main |
+	sed -e "s/main/nain/" >expect &&
+	git ls-remote src refs/heads/nain >actual &&
 	test_cmp expect actual
 '
 
@@ -233,7 +233,7 @@ test_expect_success 'new branch covered by force-with-lease' '
 	setup_srcdst_basic &&
 	(
 		cd dst &&
-		git branch branch master &&
+		git branch branch main &&
 		git push --force-with-lease=branch origin branch
 	) &&
 	git ls-remote dst refs/heads/branch >expect &&
@@ -245,7 +245,7 @@ test_expect_success 'new branch covered by force-with-lease (explicit)' '
 	setup_srcdst_basic &&
 	(
 		cd dst &&
-		git branch branch master &&
+		git branch branch main &&
 		git push --force-with-lease=branch: origin branch
 	) &&
 	git ls-remote dst refs/heads/branch >expect &&
@@ -257,12 +257,12 @@ test_expect_success 'new branch already exists' '
 	setup_srcdst_basic &&
 	(
 		cd src &&
-		git checkout -b branch master &&
+		git checkout -b branch main &&
 		test_commit F
 	) &&
 	(
 		cd dst &&
-		git branch branch master &&
+		git branch branch main &&
 		test_must_fail git push --force-with-lease=branch: origin branch
 	)
 '
@@ -277,7 +277,7 @@ test_expect_success 'background updates of REMOTE can be mitigated with a non-up
 		cd dst &&
 		test_commit G &&
 		git remote add origin-push ../src.bare &&
-		git push origin-push master:master
+		git push origin-push main:main
 	) &&
 	git clone --no-local src.bare dst2 &&
 	test_when_finished "rm -rf dst2" &&
@@ -299,58 +299,58 @@ test_expect_success 'background updates of REMOTE can be mitigated with a non-up
 test_expect_success 'background updates to remote can be mitigated with "--force-if-includes"' '
 	setup_src_dup_dst &&
 	test_when_finished "rm -fr dst src dup" &&
-	git ls-remote dst refs/heads/master >expect.master &&
+	git ls-remote dst refs/heads/main >expect.main &&
 	git ls-remote dst refs/heads/branch >expect.branch &&
 	(
 		cd src &&
 		git switch branch &&
 		test_commit I &&
-		git switch master &&
+		git switch main &&
 		test_commit J &&
 		git fetch --all &&
 		test_must_fail git push --force-with-lease --force-if-includes --all
 	) &&
-	git ls-remote dst refs/heads/master >actual.master &&
+	git ls-remote dst refs/heads/main >actual.main &&
 	git ls-remote dst refs/heads/branch >actual.branch &&
-	test_cmp expect.master actual.master &&
+	test_cmp expect.main actual.main &&
 	test_cmp expect.branch actual.branch
 '
 
 test_expect_success 'background updates to remote can be mitigated with "push.useForceIfIncludes"' '
 	setup_src_dup_dst &&
 	test_when_finished "rm -fr dst src dup" &&
-	git ls-remote dst refs/heads/master >expect.master &&
+	git ls-remote dst refs/heads/main >expect.main &&
 	(
 		cd src &&
 		git switch branch &&
 		test_commit I &&
-		git switch master &&
+		git switch main &&
 		test_commit J &&
 		git fetch --all &&
 		git config --local push.useForceIfIncludes true &&
-		test_must_fail git push --force-with-lease=master origin master
+		test_must_fail git push --force-with-lease=main origin main
 	) &&
-	git ls-remote dst refs/heads/master >actual.master &&
-	test_cmp expect.master actual.master
+	git ls-remote dst refs/heads/main >actual.main &&
+	test_cmp expect.main actual.main
 '
 
 test_expect_success '"--force-if-includes" should be disabled for --force-with-lease="<refname>:<expect>"' '
 	setup_src_dup_dst &&
 	test_when_finished "rm -fr dst src dup" &&
-	git ls-remote dst refs/heads/master >expect.master &&
+	git ls-remote dst refs/heads/main >expect.main &&
 	(
 		cd src &&
 		git switch branch &&
 		test_commit I &&
-		git switch master &&
+		git switch main &&
 		test_commit J &&
-		remote_head="$(git rev-parse refs/remotes/origin/master)" &&
+		remote_head="$(git rev-parse refs/remotes/origin/main)" &&
 		git fetch --all &&
-		test_must_fail git push --force-if-includes --force-with-lease="master:$remote_head" 2>err &&
+		test_must_fail git push --force-if-includes --force-with-lease="main:$remote_head" 2>err &&
 		grep "stale info" err
 	) &&
-	git ls-remote dst refs/heads/master >actual.master &&
-	test_cmp expect.master actual.master
+	git ls-remote dst refs/heads/main >actual.main &&
+	test_cmp expect.main actual.main
 '
 
 test_expect_success '"--force-if-includes" should allow forced update after a rebase ("pull --rebase")' '
@@ -360,10 +360,10 @@ test_expect_success '"--force-if-includes" should allow forced update after a re
 		cd src &&
 		git switch branch &&
 		test_commit I &&
-		git switch master &&
+		git switch main &&
 		test_commit J &&
-		git pull --rebase origin master &&
-		git push --force-if-includes --force-with-lease="master"
+		git pull --rebase origin main &&
+		git push --force-if-includes --force-with-lease="main"
 	)
 '
 
@@ -374,11 +374,11 @@ test_expect_success '"--force-if-includes" should allow forced update after a re
 		cd src &&
 		git switch branch &&
 		test_commit I &&
-		git switch master &&
+		git switch main &&
 		test_commit J &&
-		git pull --rebase origin master &&
+		git pull --rebase origin main &&
 		git rebase --onto HEAD~4 HEAD~1 &&
-		git push --force-if-includes --force-with-lease="master"
+		git push --force-if-includes --force-with-lease="main"
 	)
 '
 
diff --git a/t/t5534-push-signed.sh b/t/t5534-push-signed.sh
index af0385fb89..0e850a76de 100755
--- a/t/t5534-push-signed.sh
+++ b/t/t5534-push-signed.sh
@@ -9,11 +9,11 @@ prepare_dst () {
 	rm -fr dst &&
 	test_create_repo dst &&
 
-	git push dst master:noop master:ff master:noff
+	git push dst main:noop main:ff main:noff
 }
 
 test_expect_success setup '
-	# master, ff and noff branches pointing at the same commit
+	# main, ff and noff branches pointing at the same commit
 	test_tick &&
 	git commit --allow-empty -m initial &&
 
diff --git a/t/t5537-fetch-shallow.sh b/t/t5537-fetch-shallow.sh
index a55202d2d3..01071f2306 100755
--- a/t/t5537-fetch-shallow.sh
+++ b/t/t5537-fetch-shallow.sh
@@ -49,7 +49,7 @@ test_expect_success 'fetch from shallow clone' '
 	cd shallow2 &&
 	git fetch &&
 	git fsck &&
-	git log --format=%s origin/master >actual &&
+	git log --format=%s origin/main >actual &&
 	test_write_lines 5 4 3 >expect &&
 	test_cmp expect actual
 	)
@@ -64,7 +64,7 @@ test_expect_success 'fetch --depth from shallow clone' '
 	cd shallow2 &&
 	git fetch --depth=2 &&
 	git fsck &&
-	git log --format=%s origin/master >actual &&
+	git log --format=%s origin/main >actual &&
 	test_write_lines 6 5 >expect &&
 	test_cmp expect actual
 	)
@@ -75,7 +75,7 @@ test_expect_success 'fetch --unshallow from shallow clone' '
 	cd shallow2 &&
 	git fetch --unshallow &&
 	git fsck &&
-	git log --format=%s origin/master >actual &&
+	git log --format=%s origin/main >actual &&
 	test_write_lines 6 5 4 3 >expect &&
 	test_cmp expect actual
 	)
@@ -89,7 +89,7 @@ test_expect_success 'fetch --unshallow from a full clone' '
 	test_write_lines 4 3 >expect &&
 	test_cmp expect actual &&
 	git -c fetch.writeCommitGraph fetch --unshallow &&
-	git log origin/master --format=%s >actual &&
+	git log origin/main --format=%s >actual &&
 	test_write_lines 4 3 2 1 >expect &&
 	test_cmp expect actual
 	)
@@ -104,9 +104,9 @@ test_expect_success 'fetch something upstream has but hidden by clients shallow
 	git commit -m add-1-back &&
 	(
 	cd shallow2 &&
-	git fetch ../.git +refs/heads/master:refs/remotes/top/master &&
+	git fetch ../.git +refs/heads/main:refs/remotes/top/main &&
 	git fsck &&
-	git log --format=%s top/master >actual &&
+	git log --format=%s top/main >actual &&
 	test_write_lines add-1-back 4 3 >expect &&
 	test_cmp expect actual
 	) &&
@@ -135,7 +135,7 @@ test_expect_success 'fetch that requires changes in .git/shallow is filtered' '
 test_expect_success 'fetch --update-shallow' '
 	(
 	cd shallow &&
-	git checkout master &&
+	git checkout main &&
 	commit 7 &&
 	git tag -m foo heavy-tag HEAD^ &&
 	git tag light-tag HEAD^:tracked
@@ -146,13 +146,13 @@ test_expect_success 'fetch --update-shallow' '
 	git fsck &&
 	git for-each-ref --sort=refname --format="%(refname)" >actual.refs &&
 	cat <<-\EOF >expect.refs &&
-	refs/remotes/shallow/master
+	refs/remotes/shallow/main
 	refs/remotes/shallow/no-shallow
 	refs/tags/heavy-tag
 	refs/tags/light-tag
 	EOF
 	test_cmp expect.refs actual.refs &&
-	git log --format=%s shallow/master >actual &&
+	git log --format=%s shallow/main >actual &&
 	test_write_lines 7 6 5 4 3 >expect &&
 	test_cmp expect actual
 	)
@@ -161,7 +161,7 @@ test_expect_success 'fetch --update-shallow' '
 test_expect_success 'fetch --update-shallow (with fetch.writeCommitGraph)' '
 	(
 	cd shallow &&
-	git checkout master &&
+	git checkout main &&
 	commit 8 &&
 	git tag -m foo heavy-tag-for-graph HEAD^ &&
 	git tag light-tag-for-graph HEAD^:tracked
@@ -173,7 +173,7 @@ test_expect_success 'fetch --update-shallow (with fetch.writeCommitGraph)' '
 	git fsck &&
 	git for-each-ref --sort=refname --format="%(refname)" >actual.refs &&
 	cat <<-EOF >expect.refs &&
-	refs/remotes/shallow/master
+	refs/remotes/shallow/main
 	refs/remotes/shallow/no-shallow
 	refs/tags/heavy-tag
 	refs/tags/heavy-tag-for-graph
@@ -181,7 +181,7 @@ test_expect_success 'fetch --update-shallow (with fetch.writeCommitGraph)' '
 	refs/tags/light-tag-for-graph
 	EOF
 	test_cmp expect.refs actual.refs &&
-	git log --format=%s shallow/master >actual &&
+	git log --format=%s shallow/main >actual &&
 	test_write_lines 8 7 6 5 4 3 >expect &&
 	test_cmp expect actual
 	)
@@ -206,7 +206,7 @@ test_expect_success '.git/shallow is edited by repack' '
 	test_commit -C shallow-server E &&
 	test_commit -C shallow-server D &&
 	d="$(git -C shallow-server rev-parse --verify D^0)" &&
-	git -C shallow-server checkout master &&
+	git -C shallow-server checkout main &&
 
 	git clone --depth=1 --no-tags --no-single-branch \
 		"file://$PWD/shallow-server" shallow-client &&
@@ -244,7 +244,7 @@ test_expect_success 'shallow fetches check connectivity before writing shallow f
 	git -C "$REPO" config protocol.version 2 &&
 	git -C client config protocol.version 2 &&
 
-	git -C client fetch --depth=2 "$HTTPD_URL/one_time_perl/repo" master:a_branch &&
+	git -C client fetch --depth=2 "$HTTPD_URL/one_time_perl/repo" main:a_branch &&
 
 	# Craft a situation in which the server sends back an unshallow request
 	# with an empty packfile. This is done by refetching with a shorter
@@ -256,7 +256,7 @@ test_expect_success 'shallow fetches check connectivity before writing shallow f
 	       >"$HTTPD_ROOT_PATH/one-time-perl" &&
 	test_must_fail env GIT_TEST_SIDEBAND_ALL=0 git -C client \
 		fetch --depth=1 "$HTTPD_URL/one_time_perl/repo" \
-		master:a_branch &&
+		main:a_branch &&
 
 	# Ensure that the one-time-perl script was used.
 	! test -e "$HTTPD_ROOT_PATH/one-time-perl" &&
diff --git a/t/t5538-push-shallow.sh b/t/t5538-push-shallow.sh
index ecbf84d21c..9d3e946bf1 100755
--- a/t/t5538-push-shallow.sh
+++ b/t/t5538-push-shallow.sh
@@ -44,9 +44,9 @@ test_expect_success 'push from shallow clone' '
 	(
 	cd shallow &&
 	commit 5 &&
-	git push ../.git +master:refs/remotes/shallow/master
+	git push ../.git +main:refs/remotes/shallow/main
 	) &&
-	git log --format=%s shallow/master >actual &&
+	git log --format=%s shallow/main >actual &&
 	git fsck &&
 	cat <<EOF >expect &&
 5
@@ -61,10 +61,10 @@ EOF
 test_expect_success 'push from shallow clone, with grafted roots' '
 	(
 	cd shallow2 &&
-	test_must_fail git push ../.git +master:refs/remotes/shallow2/master 2>err &&
-	grep "shallow2/master.*shallow update not allowed" err
+	test_must_fail git push ../.git +main:refs/remotes/shallow2/main 2>err &&
+	grep "shallow2/main.*shallow update not allowed" err
 	) &&
-	test_must_fail git rev-parse shallow2/master &&
+	test_must_fail git rev-parse shallow2/main &&
 	git fsck
 '
 
@@ -72,9 +72,9 @@ test_expect_success 'add new shallow root with receive.updateshallow on' '
 	test_config receive.shallowupdate true &&
 	(
 	cd shallow2 &&
-	git push ../.git +master:refs/remotes/shallow2/master
+	git push ../.git +main:refs/remotes/shallow2/main
 	) &&
-	git log --format=%s shallow2/master >actual &&
+	git log --format=%s shallow2/main >actual &&
 	git fsck &&
 	cat <<EOF >expect &&
 c
@@ -87,12 +87,12 @@ test_expect_success 'push from shallow to shallow' '
 	(
 	cd shallow &&
 	git --git-dir=../shallow2/.git config receive.shallowupdate true &&
-	git push ../shallow2/.git +master:refs/remotes/shallow/master &&
+	git push ../shallow2/.git +main:refs/remotes/shallow/main &&
 	git --git-dir=../shallow2/.git config receive.shallowupdate false
 	) &&
 	(
 	cd shallow2 &&
-	git log --format=%s shallow/master >actual &&
+	git log --format=%s shallow/main >actual &&
 	git fsck &&
 	cat <<EOF >expect &&
 5
@@ -106,10 +106,10 @@ EOF
 test_expect_success 'push from full to shallow' '
 	! git --git-dir=shallow2/.git cat-file blob $(echo 1|git hash-object --stdin) &&
 	commit 1 &&
-	git push shallow2/.git +master:refs/remotes/top/master &&
+	git push shallow2/.git +main:refs/remotes/top/main &&
 	(
 	cd shallow2 &&
-	git log --format=%s top/master >actual &&
+	git log --format=%s top/main >actual &&
 	git fsck &&
 	cat <<EOF >expect &&
 1
diff --git a/t/t5539-fetch-http-shallow.sh b/t/t5539-fetch-http-shallow.sh
index 82aa99ae87..4397197829 100755
--- a/t/t5539-fetch-http-shallow.sh
+++ b/t/t5539-fetch-http-shallow.sh
@@ -32,7 +32,7 @@ test_expect_success 'clone http repository' '
 	(
 	cd clone &&
 	git fsck &&
-	git log --format=%s origin/master >actual &&
+	git log --format=%s origin/main >actual &&
 	cat <<EOF >expect &&
 7
 6
@@ -60,9 +60,9 @@ test_expect_success 'no shallow lines after receiving ACK ready' '
 				refs/heads/unrelated$i:refs/heads/unrelated$i ||
 			exit 1
 		done &&
-		git checkout master &&
+		git checkout main &&
 		test_commit new &&
-		git push  "$HTTPD_DOCUMENT_ROOT_PATH/repo.git" master
+		git push  "$HTTPD_DOCUMENT_ROOT_PATH/repo.git" main
 	) &&
 	(
 		cd clone &&
@@ -95,7 +95,7 @@ test_expect_success 'clone shallow since ...' '
 
 test_expect_success 'fetch shallow since ...' '
 	git -C shallow11 fetch --shallow-since "200000000 +0700" origin &&
-	git -C shallow11 log --pretty=tformat:%s origin/master >actual &&
+	git -C shallow11 log --pretty=tformat:%s origin/main >actual &&
 	cat >expected <<-\EOF &&
 	three
 	two
@@ -120,7 +120,7 @@ test_expect_success 'shallow clone exclude tag two' '
 
 test_expect_success 'fetch exclude tag one' '
 	git -C shallow12 fetch --shallow-exclude one origin &&
-	git -C shallow12 log --pretty=tformat:%s origin/master >actual &&
+	git -C shallow12 log --pretty=tformat:%s origin/main >actual &&
 	test_write_lines three two >expected &&
 	test_cmp expected actual
 '
@@ -136,12 +136,12 @@ test_expect_success 'fetching deepen' '
 	git clone --depth 1 $HTTPD_URL/smart/shallow-deepen.git deepen &&
 	mv "$HTTPD_DOCUMENT_ROOT_PATH/shallow-deepen.git" .git &&
 	test_commit four &&
-	git -C deepen log --pretty=tformat:%s master >actual &&
+	git -C deepen log --pretty=tformat:%s main >actual &&
 	echo three >expected &&
 	test_cmp expected actual &&
 	mv .git "$HTTPD_DOCUMENT_ROOT_PATH/shallow-deepen.git" &&
 	git -C deepen fetch --deepen=1 &&
-	git -C deepen log --pretty=tformat:%s origin/master >actual &&
+	git -C deepen log --pretty=tformat:%s origin/main >actual &&
 	cat >expected <<-\EOF &&
 	four
 	three
diff --git a/t/test-lib.sh b/t/test-lib.sh
index a12a1993d0..ecaa0f36f3 100644
--- a/t/test-lib.sh
+++ b/t/test-lib.sh
@@ -263,7 +263,7 @@ case "$TEST_NUMBER" in
 	GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
 	export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 	;;
-[0-4]*|5[0-4]*|55[01]*)
+[0-4]*|5[0-4]*|55[0-3]*)
 	GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 	export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 	;;
-- 
gitgitgadget


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH 15/28] t55[4-9]*: adjust the references to the default branch name "main"
  2020-11-12 22:43 [PATCH 00/28] Use main as default branch name Johannes Schindelin via GitGitGadget
                   ` (13 preceding siblings ...)
  2020-11-12 22:43 ` [PATCH 14/28] t55[23]*: " Johannes Schindelin via GitGitGadget
@ 2020-11-12 22:43 ` Johannes Schindelin via GitGitGadget
  2020-11-12 22:43 ` [PATCH 16/28] t5[6-9]*: " Johannes Schindelin via GitGitGadget
                   ` (17 subsequent siblings)
  32 siblings, 0 replies; 163+ messages in thread
From: Johannes Schindelin via GitGitGadget @ 2020-11-12 22:43 UTC (permalink / raw)
  To: git; +Cc: Johannes Schindelin, Johannes Schindelin

From: Johannes Schindelin <johannes.schindelin@gmx.de>

This trick was performed via

	$ (cd t &&
	   sed -i -e 's/master/main/g' -e 's/MASTER/MAIN/g' \
		-e 's/Master/Main/g' -e 's/retsam/niam/g' \
		-- t55[4-9]*.sh t556x*)

This allows us to define `GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main`
for those tests.

Note that t5541 uses the reversed `master` name: `retsam`. We replace it
by the equivalent for `main`: `niam`.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
---
 t/t5540-http-push-webdav.sh          |  8 +--
 t/t5541-http-push-smart.sh           | 40 +++++++-------
 t/t5542-push-http-shallow.sh         |  8 +--
 t/t5543-atomic-push.sh               | 80 +++++++++++++--------------
 t/t5545-push-options.sh              | 62 ++++++++++-----------
 t/t5548-push-porcelain.sh            | 64 +++++++++++-----------
 t/t5550-http-fetch-dumb.sh           | 20 +++----
 t/t5551-http-fetch-smart.sh          | 20 +++----
 t/t5552-skipping-fetch-negotiator.sh |  2 +-
 t/t5553-set-upstream.sh              | 82 ++++++++++++++--------------
 t/t5561-http-backend.sh              |  4 +-
 t/t556x_common                       |  8 +--
 t/t5570-git-daemon.sh                | 16 +++---
 t/t5571-pre-push-hook.sh             |  4 +-
 t/t5572-pull-submodule.sh            |  4 +-
 t/t5580-unc-paths.sh                 |  2 +-
 t/t5581-http-curl-verbose.sh         |  2 +-
 t/t5582-fetch-negative-refspec.sh    | 22 ++++----
 t/test-lib.sh                        |  2 +-
 19 files changed, 225 insertions(+), 225 deletions(-)

diff --git a/t/t5540-http-push-webdav.sh b/t/t5540-http-push-webdav.sh
index 450321fddb..1973d8bb32 100755
--- a/t/t5540-http-push-webdav.sh
+++ b/t/t5540-http-push-webdav.sh
@@ -71,7 +71,7 @@ test_expect_success 'push already up-to-date' '
 test_expect_success 'push to remote repository with unpacked refs' '
 	(cd "$HTTPD_DOCUMENT_ROOT_PATH"/test_repo.git &&
 	 rm packed-refs &&
-	 git update-ref refs/heads/master $ORIG_HEAD &&
+	 git update-ref refs/heads/main $ORIG_HEAD &&
 	 git --bare update-server-info) &&
 	git push &&
 	(cd "$HTTPD_DOCUMENT_ROOT_PATH"/test_repo.git &&
@@ -91,7 +91,7 @@ test_expect_success 'http-push fetches unpacked objects' '
 	 git remote rm origin &&
 	 git reflog expire --expire=0 --all &&
 	 git prune &&
-	 git push -f -v $HTTPD_URL/dumb/test_repo_unpacked.git master)
+	 git push -f -v $HTTPD_URL/dumb/test_repo_unpacked.git main)
 '
 
 test_expect_success 'http-push fetches packed objects' '
@@ -111,7 +111,7 @@ test_expect_success 'http-push fetches packed objects' '
 	 git remote remove origin &&
 	 git reflog expire --expire=0 --all &&
 	 git prune &&
-	 git push -f -v $HTTPD_URL/dumb/test_repo_packed.git master)
+	 git push -f -v $HTTPD_URL/dumb/test_repo_packed.git main)
 '
 
 test_expect_success 'create and delete remote branch' '
@@ -163,7 +163,7 @@ test_expect_success 'PUT and MOVE sends object to URLs with SHA-1 hash suffix' '
 '
 
 test_http_push_nonff "$HTTPD_DOCUMENT_ROOT_PATH"/test_repo.git \
-	"$ROOT_PATH"/test_repo_clone master
+	"$ROOT_PATH"/test_repo_clone main
 
 test_expect_success 'push to password-protected repository (user in URL)' '
 	test_commit pw-user &&
diff --git a/t/t5541-http-push-smart.sh b/t/t5541-http-push-smart.sh
index 187454f5dd..ae90ed230b 100755
--- a/t/t5541-http-push-smart.sh
+++ b/t/t5541-http-push-smart.sh
@@ -142,23 +142,23 @@ test_expect_success 'used receive-pack service' '
 '
 
 test_http_push_nonff "$HTTPD_DOCUMENT_ROOT_PATH"/test_repo.git \
-	"$ROOT_PATH"/test_repo_clone master 		success
+	"$ROOT_PATH"/test_repo_clone main 		success
 
 test_expect_success 'push fails for non-fast-forward refs unmatched by remote helper' '
 	# create a dissimilarly-named remote ref so that git is unable to match the
 	# two refs (viz. local, remote) unless an explicit refspec is provided.
-	git push origin master:retsam &&
+	git push origin main:niam &&
 
 	echo "change changed" > path2 &&
 	git commit -a -m path2 --amend &&
 
-	# push master too; this ensures there is at least one '"'push'"' command to
+	# push main too; this ensures there is at least one '"'push'"' command to
 	# the remote helper and triggers interaction with the helper.
-	test_must_fail git push -v origin +master master:retsam >output 2>&1'
+	test_must_fail git push -v origin +main main:niam >output 2>&1'
 
 test_expect_success 'push fails for non-fast-forward refs unmatched by remote helper: remote output' '
-	grep "^ + [a-f0-9]*\.\.\.[a-f0-9]* *master -> master (forced update)$" output &&
-	grep "^ ! \[rejected\] *master -> retsam (non-fast-forward)$" output
+	grep "^ + [a-f0-9]*\.\.\.[a-f0-9]* *main -> main (forced update)$" output &&
+	grep "^ ! \[rejected\] *main -> niam (non-fast-forward)$" output
 '
 
 test_expect_success 'push fails for non-fast-forward refs unmatched by remote helper: our output' '
@@ -167,7 +167,7 @@ test_expect_success 'push fails for non-fast-forward refs unmatched by remote he
 '
 
 test_expect_success 'push (chunked)' '
-	git checkout master &&
+	git checkout main &&
 	test_commit commit path3 &&
 	HEAD=$(git rev-parse --verify HEAD) &&
 	test_config http.postbuffer 4 &&
@@ -177,9 +177,9 @@ test_expect_success 'push (chunked)' '
 	 test $HEAD = $(git rev-parse --verify HEAD))
 '
 
-## References of remote: atomic1(1)            master(2) collateral(2) other(2)
-## References of local :            atomic2(2) master(1) collateral(3) other(2) collateral1(3) atomic(1)
-## Atomic push         :                       master(1) collateral(3)                         atomic(1)
+## References of remote: atomic1(1)            main(2) collateral(2) other(2)
+## References of local :            atomic2(2) main(1) collateral(3) other(2) collateral1(3) atomic(1)
+## Atomic push         :                       main(1) collateral(3)                         atomic(1)
 test_expect_success 'push --atomic also prevents branch creation, reports collateral' '
 	# Setup upstream repo - empty for now
 	d=$HTTPD_DOCUMENT_ROOT_PATH/atomic-branches.git &&
@@ -192,15 +192,15 @@ test_expect_success 'push --atomic also prevents branch creation, reports collat
 	test_commit atomic2 &&
 	git branch collateral &&
 	git branch other &&
-	git push "$up" atomic1 master collateral other &&
+	git push "$up" atomic1 main collateral other &&
 	git tag -d atomic1 &&
 
 	# collateral is a valid push, but should be failed by atomic push
 	git checkout collateral &&
 	test_commit collateral1 &&
 
-	# Make master incompatible with upstream to provoke atomic
-	git checkout master &&
+	# Make main incompatible with upstream to provoke atomic
+	git checkout main &&
 	git reset --hard HEAD^ &&
 
 	# Add a new branch which should be failed by atomic push. This is a
@@ -208,7 +208,7 @@ test_expect_success 'push --atomic also prevents branch creation, reports collat
 	git branch atomic &&
 
 	# --atomic should cause entire push to be rejected
-	test_must_fail git push --atomic "$up" master atomic collateral 2>output &&
+	test_must_fail git push --atomic "$up" main atomic collateral 2>output &&
 
 	# the new branch should not have been created upstream
 	test_must_fail git -C "$d" show-ref --verify refs/heads/atomic &&
@@ -216,15 +216,15 @@ test_expect_success 'push --atomic also prevents branch creation, reports collat
 	# upstream should still reflect atomic2, the last thing we pushed
 	# successfully
 	git rev-parse atomic2 >expected &&
-	# on master...
-	git -C "$d" rev-parse refs/heads/master >actual &&
+	# on main...
+	git -C "$d" rev-parse refs/heads/main >actual &&
 	test_cmp expected actual &&
 	# ...and collateral.
 	git -C "$d" rev-parse refs/heads/collateral >actual &&
 	test_cmp expected actual &&
 
 	# the failed refs should be indicated to the user
-	grep "^ ! .*rejected.* master -> master" output &&
+	grep "^ ! .*rejected.* main -> main" output &&
 
 	# the collateral failure refs should be indicated to the user
 	grep "^ ! .*rejected.* atomic -> atomic .*atomic push failed" output &&
@@ -472,9 +472,9 @@ test_expect_success 'clone/fetch scrubs password from reflogs' '
 	test_commit prepare-for-force-fetch &&
 	git switch -c away &&
 	git fetch "$HTTPD_URL_USER_PASS/smart/test_repo.git" \
-		+master:master &&
+		+main:main &&
 	# should have been scrubbed down to vanilla URL
-	git log -g master >reflog &&
+	git log -g main >reflog &&
 	grep "$HTTPD_URL" reflog &&
 	! grep "$HTTPD_URL_USER_PASS" reflog
 '
@@ -498,7 +498,7 @@ test_expect_success 'colorize errors/hints' '
 	cd "$ROOT_PATH"/test_repo_clone &&
 	test_must_fail git -c color.transport=always -c color.advice=always \
 		-c color.push=always \
-		push origin origin/master^:master 2>act &&
+		push origin origin/main^:main 2>act &&
 	test_decode_color <act >decoded &&
 	test_i18ngrep "<RED>.*rejected.*<RESET>" decoded &&
 	test_i18ngrep "<RED>error: failed to push some refs" decoded &&
diff --git a/t/t5542-push-http-shallow.sh b/t/t5542-push-http-shallow.sh
index ddc1db722d..0d8f5219da 100755
--- a/t/t5542-push-http-shallow.sh
+++ b/t/t5542-push-http-shallow.sh
@@ -51,12 +51,12 @@ test_expect_success 'push to shallow repo via http' '
 	(
 	cd full &&
 	commit 9 &&
-	git push $HTTPD_URL/smart/repo.git +master:refs/remotes/top/master
+	git push $HTTPD_URL/smart/repo.git +main:refs/remotes/top/main
 	) &&
 	(
 	cd "$HTTPD_DOCUMENT_ROOT_PATH/repo.git" &&
 	git fsck &&
-	git log --format=%s top/master >actual &&
+	git log --format=%s top/main >actual &&
 	cat <<EOF >expect &&
 9
 4
@@ -74,11 +74,11 @@ test_expect_success 'push from shallow repo via http' '
 	git config http.receivepack true
 	) &&
 	commit 10 &&
-	git push $HTTPD_URL/smart/repo.git +master:refs/remotes/top/master &&
+	git push $HTTPD_URL/smart/repo.git +main:refs/remotes/top/main &&
 	(
 	cd "$HTTPD_DOCUMENT_ROOT_PATH/repo.git" &&
 	git fsck &&
-	git log --format=%s top/master >actual &&
+	git log --format=%s top/main >actual &&
 	cat <<EOF >expect &&
 10
 4
diff --git a/t/t5543-atomic-push.sh b/t/t5543-atomic-push.sh
index 620c30d58f..01a9a6e9e0 100755
--- a/t/t5543-atomic-push.sh
+++ b/t/t5543-atomic-push.sh
@@ -40,9 +40,9 @@ test_expect_success 'atomic push works for a single branch' '
 		test_commit one &&
 		git push --mirror up &&
 		test_commit two &&
-		git push --atomic up master
+		git push --atomic up main
 	) &&
-	test_refs master master
+	test_refs main main
 '
 
 test_expect_success 'atomic push works for two branches' '
@@ -55,9 +55,9 @@ test_expect_success 'atomic push works for two branches' '
 		test_commit two &&
 		git checkout second &&
 		test_commit three &&
-		git push --atomic up master second
+		git push --atomic up main second
 	) &&
-	test_refs master master &&
+	test_refs main main &&
 	test_refs second second
 '
 
@@ -70,7 +70,7 @@ test_expect_success 'atomic push works in combination with --mirror' '
 		test_commit two &&
 		git push --atomic --mirror up
 	) &&
-	test_refs master master &&
+	test_refs main main &&
 	test_refs second second
 '
 
@@ -79,7 +79,7 @@ test_expect_success 'atomic push works in combination with --force' '
 	(
 		cd workbench &&
 		test_commit one &&
-		git branch second master &&
+		git branch second main &&
 		test_commit two_a &&
 		git checkout second &&
 		test_commit two_b &&
@@ -87,36 +87,36 @@ test_expect_success 'atomic push works in combination with --force' '
 		test_commit four &&
 		git push --mirror up &&
 		# The actual test is below
-		git checkout master &&
+		git checkout main &&
 		test_commit three_a &&
 		git checkout second &&
 		git reset --hard HEAD^ &&
-		git push --force --atomic up master second
+		git push --force --atomic up main second
 	) &&
-	test_refs master master &&
+	test_refs main main &&
 	test_refs second second
 '
 
-# set up two branches where master can be pushed but second can not
+# set up two branches where main can be pushed but second can not
 # (non-fast-forward). Since second can not be pushed the whole operation
-# will fail and leave master untouched.
+# will fail and leave main untouched.
 test_expect_success 'atomic push fails if one branch fails' '
 	mk_repo_pair &&
 	(
 		cd workbench &&
 		test_commit one &&
-		git checkout -b second master &&
+		git checkout -b second main &&
 		test_commit two &&
 		test_commit three &&
 		test_commit four &&
 		git push --mirror up &&
 		git reset --hard HEAD~2 &&
 		test_commit five &&
-		git checkout master &&
+		git checkout main &&
 		test_commit six &&
 		test_must_fail git push --atomic --all up
 	) &&
-	test_refs master HEAD@{7} &&
+	test_refs main HEAD@{7} &&
 	test_refs second HEAD@{4}
 '
 
@@ -126,7 +126,7 @@ test_expect_success 'atomic push fails if one tag fails remotely' '
 	(
 		cd workbench &&
 		test_commit one &&
-		git checkout -b second master &&
+		git checkout -b second main &&
 		test_commit two &&
 		git push --mirror up
 	) &&
@@ -139,14 +139,14 @@ test_expect_success 'atomic push fails if one tag fails remotely' '
 	# see if we can now push both branches.
 	(
 		cd workbench &&
-		git checkout master &&
+		git checkout main &&
 		test_commit three &&
 		git checkout second &&
 		test_commit four &&
 		git tag test_tag &&
-		test_must_fail git push --tags --atomic up master second
+		test_must_fail git push --tags --atomic up main second
 	) &&
-	test_refs master HEAD@{3} &&
+	test_refs main HEAD@{3} &&
 	test_refs second HEAD@{1}
 '
 
@@ -155,7 +155,7 @@ test_expect_success 'atomic push obeys update hook preventing a branch to be pus
 	(
 		cd workbench &&
 		test_commit one &&
-		git checkout -b second master &&
+		git checkout -b second main &&
 		test_commit two &&
 		git push --mirror up
 	) &&
@@ -165,19 +165,19 @@ test_expect_success 'atomic push obeys update hook preventing a branch to be pus
 		HOOK="$HOOKDIR/update" &&
 		mkdir -p "$HOOKDIR" &&
 		write_script "$HOOK" <<-\EOF
-			# only allow update to master from now on
-			test "$1" = "refs/heads/master"
+			# only allow update to main from now on
+			test "$1" = "refs/heads/main"
 		EOF
 	) &&
 	(
 		cd workbench &&
-		git checkout master &&
+		git checkout main &&
 		test_commit three &&
 		git checkout second &&
 		test_commit four &&
-		test_must_fail git push --atomic up master second
+		test_must_fail git push --atomic up main second
 	) &&
-	test_refs master HEAD@{3} &&
+	test_refs main HEAD@{3} &&
 	test_refs second HEAD@{1}
 '
 
@@ -192,21 +192,21 @@ test_expect_success 'atomic push is not advertised if configured' '
 		test_commit one &&
 		git push --mirror up &&
 		test_commit two &&
-		test_must_fail git push --atomic up master
+		test_must_fail git push --atomic up main
 	) &&
-	test_refs master HEAD@{1}
+	test_refs main HEAD@{1}
 '
 
-# References in upstream : master(1) one(1) foo(1)
-# References in workbench: master(2)        foo(1) two(2) bar(2)
-# Atomic push            : master(2)               two(2) bar(2)
+# References in upstream : main(1) one(1) foo(1)
+# References in workbench: main(2)        foo(1) two(2) bar(2)
+# Atomic push            : main(2)               two(2) bar(2)
 test_expect_success 'atomic push reports (reject by update hook)' '
 	mk_repo_pair &&
 	(
 		cd workbench &&
 		test_commit one &&
 		git branch foo &&
-		git push up master one foo &&
+		git push up main one foo &&
 		git tag -d one
 	) &&
 	(
@@ -228,19 +228,19 @@ test_expect_success 'atomic push reports (reject by update hook)' '
 		git branch bar
 	) &&
 	test_must_fail git -C workbench \
-		push --atomic up master two bar >out 2>&1 &&
+		push --atomic up main two bar >out 2>&1 &&
 	fmt_status_report <out >actual &&
 	cat >expect <<-EOF &&
 	To ../upstream
-	 ! [remote rejected] master -> master (atomic push failure)
+	 ! [remote rejected] main -> main (atomic push failure)
 	 ! [remote rejected] two -> two (atomic push failure)
 	 ! [remote rejected] bar -> bar (hook declined)
 	EOF
 	test_cmp expect actual
 '
 
-# References in upstream : master(1) one(1) foo(1)
-# References in workbench: master(2)        foo(1) two(2) bar(2)
+# References in upstream : main(1) one(1) foo(1)
+# References in workbench: main(2)        foo(1) two(2) bar(2)
 test_expect_success 'atomic push reports (mirror, but reject by update hook)' '
 	(
 		cd workbench &&
@@ -252,7 +252,7 @@ test_expect_success 'atomic push reports (mirror, but reject by update hook)' '
 	fmt_status_report <out >actual &&
 	cat >expect <<-EOF &&
 	To ../upstream
-	 ! [remote rejected] master -> master (atomic push failure)
+	 ! [remote rejected] main -> main (atomic push failure)
 	 ! [remote rejected] one (atomic push failure)
 	 ! [remote rejected] bar -> bar (hook declined)
 	 ! [remote rejected] two -> two (atomic push failure)
@@ -260,21 +260,21 @@ test_expect_success 'atomic push reports (mirror, but reject by update hook)' '
 	test_cmp expect actual
 '
 
-# References in upstream : master(2) one(1) foo(1)
-# References in workbench: master(1)        foo(1) two(2) bar(2)
+# References in upstream : main(2) one(1) foo(1)
+# References in workbench: main(1)        foo(1) two(2) bar(2)
 test_expect_success 'atomic push reports (reject by non-ff)' '
 	rm upstream/.git/hooks/update &&
 	(
 		cd workbench &&
-		git push up master &&
+		git push up main &&
 		git reset --hard HEAD^
 	) &&
 	test_must_fail git -C workbench \
-		push --atomic up master foo bar >out 2>&1 &&
+		push --atomic up main foo bar >out 2>&1 &&
 	fmt_status_report <out >actual &&
 	cat >expect <<-EOF &&
 	To ../upstream
-	 ! [rejected] master -> master (non-fast-forward)
+	 ! [rejected] main -> main (non-fast-forward)
 	 ! [rejected] bar -> bar (atomic push failed)
 	EOF
 	test_cmp expect actual
diff --git a/t/t5545-push-options.sh b/t/t5545-push-options.sh
index 38e6f7340e..a1276bbc33 100755
--- a/t/t5545-push-options.sh
+++ b/t/t5545-push-options.sh
@@ -63,9 +63,9 @@ test_expect_success 'one push option works for a single branch' '
 		test_commit one &&
 		git push --mirror up &&
 		test_commit two &&
-		git push --push-option=asdf up master
+		git push --push-option=asdf up main
 	) &&
-	test_refs master master &&
+	test_refs main main &&
 	echo "asdf" >expect &&
 	test_cmp expect upstream/.git/hooks/pre-receive.push_options &&
 	test_cmp expect upstream/.git/hooks/post-receive.push_options
@@ -79,9 +79,9 @@ test_expect_success 'push option denied by remote' '
 		test_commit one &&
 		git push --mirror up &&
 		test_commit two &&
-		test_must_fail git push --push-option=asdf up master
+		test_must_fail git push --push-option=asdf up main
 	) &&
-	test_refs master HEAD@{1}
+	test_refs main HEAD@{1}
 '
 
 test_expect_success 'two push options work' '
@@ -92,9 +92,9 @@ test_expect_success 'two push options work' '
 		test_commit one &&
 		git push --mirror up &&
 		test_commit two &&
-		git push --push-option=asdf --push-option="more structured text" up master
+		git push --push-option=asdf --push-option="more structured text" up main
 	) &&
-	test_refs master master &&
+	test_refs main main &&
 	printf "asdf\nmore structured text\n" >expect &&
 	test_cmp expect upstream/.git/hooks/pre-receive.push_options &&
 	test_cmp expect upstream/.git/hooks/post-receive.push_options
@@ -123,14 +123,14 @@ test_expect_success 'push options and submodules' '
 
 	git -C parent push \
 		--push-option=asdf --push-option="more structured text" \
-		--recurse-submodules=on-demand up master &&
+		--recurse-submodules=on-demand up main &&
 
-	git -C upstream rev-parse --verify master >expect &&
-	git -C parent/workbench rev-parse --verify master >actual &&
+	git -C upstream rev-parse --verify main >expect &&
+	git -C parent/workbench rev-parse --verify main >actual &&
 	test_cmp expect actual &&
 
-	git -C parent_upstream rev-parse --verify master >expect &&
-	git -C parent rev-parse --verify master >actual &&
+	git -C parent_upstream rev-parse --verify main >expect &&
+	git -C parent rev-parse --verify main >actual &&
 	test_cmp expect actual &&
 
 	printf "asdf\nmore structured text\n" >expect &&
@@ -148,9 +148,9 @@ test_expect_success 'default push option' '
 		test_commit one &&
 		git push --mirror up &&
 		test_commit two &&
-		git -c push.pushOption=default push up master
+		git -c push.pushOption=default push up main
 	) &&
-	test_refs master master &&
+	test_refs main main &&
 	echo "default" >expect &&
 	test_cmp expect upstream/.git/hooks/pre-receive.push_options &&
 	test_cmp expect upstream/.git/hooks/post-receive.push_options
@@ -164,9 +164,9 @@ test_expect_success 'two default push options' '
 		test_commit one &&
 		git push --mirror up &&
 		test_commit two &&
-		git -c push.pushOption=default1 -c push.pushOption=default2 push up master
+		git -c push.pushOption=default1 -c push.pushOption=default2 push up main
 	) &&
-	test_refs master master &&
+	test_refs main main &&
 	printf "default1\ndefault2\n" >expect &&
 	test_cmp expect upstream/.git/hooks/pre-receive.push_options &&
 	test_cmp expect upstream/.git/hooks/post-receive.push_options
@@ -180,9 +180,9 @@ test_expect_success 'push option from command line overrides from-config push op
 		test_commit one &&
 		git push --mirror up &&
 		test_commit two &&
-		git -c push.pushOption=default push --push-option=manual up master
+		git -c push.pushOption=default push --push-option=manual up main
 	) &&
-	test_refs master master &&
+	test_refs main main &&
 	echo "manual" >expect &&
 	test_cmp expect upstream/.git/hooks/pre-receive.push_options &&
 	test_cmp expect upstream/.git/hooks/post-receive.push_options
@@ -196,9 +196,9 @@ test_expect_success 'empty value of push.pushOption in config clears the list' '
 		test_commit one &&
 		git push --mirror up &&
 		test_commit two &&
-		git -c push.pushOption=default1 -c push.pushOption= -c push.pushOption=default2 push up master
+		git -c push.pushOption=default1 -c push.pushOption= -c push.pushOption=default2 push up main
 	) &&
-	test_refs master master &&
+	test_refs main main &&
 	echo "default2" >expect &&
 	test_cmp expect upstream/.git/hooks/pre-receive.push_options &&
 	test_cmp expect upstream/.git/hooks/post-receive.push_options
@@ -212,16 +212,16 @@ test_expect_success 'invalid push option in config' '
 		test_commit one &&
 		git push --mirror up &&
 		test_commit two &&
-		test_must_fail git -c push.pushOption push up master
+		test_must_fail git -c push.pushOption push up main
 	) &&
-	test_refs master HEAD@{1}
+	test_refs main HEAD@{1}
 '
 
 test_expect_success 'push options keep quoted characters intact (direct)' '
 	mk_repo_pair &&
 	git -C upstream config receive.advertisePushOptions true &&
 	test_commit -C workbench one &&
-	git -C workbench push --push-option="\"embedded quotes\"" up master &&
+	git -C workbench push --push-option="\"embedded quotes\"" up main &&
 	echo "\"embedded quotes\"" >expect &&
 	test_cmp expect upstream/.git/hooks/pre-receive.push_options
 '
@@ -244,28 +244,28 @@ mk_http_pair () {
 test_expect_success 'push option denied properly by http server' '
 	mk_http_pair false &&
 	test_commit -C test_http_clone one &&
-	test_must_fail git -C test_http_clone push --push-option=asdf origin master 2>actual &&
+	test_must_fail git -C test_http_clone push --push-option=asdf origin main 2>actual &&
 	test_i18ngrep "the receiving end does not support push options" actual &&
-	git -C test_http_clone push origin master
+	git -C test_http_clone push origin main
 '
 
 test_expect_success 'push options work properly across http' '
 	mk_http_pair true &&
 
 	test_commit -C test_http_clone one &&
-	git -C test_http_clone push origin master &&
-	git -C "$HTTPD_DOCUMENT_ROOT_PATH"/upstream.git rev-parse --verify master >expect &&
-	git -C test_http_clone rev-parse --verify master >actual &&
+	git -C test_http_clone push origin main &&
+	git -C "$HTTPD_DOCUMENT_ROOT_PATH"/upstream.git rev-parse --verify main >expect &&
+	git -C test_http_clone rev-parse --verify main >actual &&
 	test_cmp expect actual &&
 
 	test_commit -C test_http_clone two &&
-	git -C test_http_clone push --push-option=asdf --push-option="more structured text" origin master &&
+	git -C test_http_clone push --push-option=asdf --push-option="more structured text" origin main &&
 	printf "asdf\nmore structured text\n" >expect &&
 	test_cmp expect "$HTTPD_DOCUMENT_ROOT_PATH"/upstream.git/hooks/pre-receive.push_options &&
 	test_cmp expect "$HTTPD_DOCUMENT_ROOT_PATH"/upstream.git/hooks/post-receive.push_options &&
 
-	git -C "$HTTPD_DOCUMENT_ROOT_PATH"/upstream.git rev-parse --verify master >expect &&
-	git -C test_http_clone rev-parse --verify master >actual &&
+	git -C "$HTTPD_DOCUMENT_ROOT_PATH"/upstream.git rev-parse --verify main >expect &&
+	git -C test_http_clone rev-parse --verify main >actual &&
 	test_cmp expect actual
 '
 
@@ -273,7 +273,7 @@ test_expect_success 'push options keep quoted characters intact (http)' '
 	mk_http_pair true &&
 
 	test_commit -C test_http_clone one &&
-	git -C test_http_clone push --push-option="\"embedded quotes\"" origin master &&
+	git -C test_http_clone push --push-option="\"embedded quotes\"" origin main &&
 	echo "\"embedded quotes\"" >expect &&
 	test_cmp expect "$HTTPD_DOCUMENT_ROOT_PATH"/upstream.git/hooks/pre-receive.push_options
 '
diff --git a/t/t5548-push-porcelain.sh b/t/t5548-push-porcelain.sh
index 1b19b3ef55..5a761f3642 100755
--- a/t/t5548-push-porcelain.sh
+++ b/t/t5548-push-porcelain.sh
@@ -36,7 +36,7 @@ create_commits_in () {
 		shift ||
 		return 1
 	done &&
-	git -C "$repo" update-ref refs/heads/master $oid
+	git -C "$repo" update-ref refs/heads/main $oid
 }
 
 # Format the output of git-push, git-show-ref and other commands to make a
@@ -57,8 +57,8 @@ make_user_friendly_and_stable_output () {
 }
 
 setup_upstream_and_workbench () {
-	# Upstream  after setup : master(B)  foo(A)  bar(A)  baz(A)
-	# Workbench after setup : master(A)
+	# Upstream  after setup : main(B)  foo(A)  bar(A)  baz(A)
+	# Workbench after setup : main(A)
 	test_expect_success "setup upstream repository and workbench" '
 		rm -rf upstream.git workbench &&
 		git init --bare upstream.git &&
@@ -70,9 +70,9 @@ setup_upstream_and_workbench () {
 			# this fixed-width oid will be replaced with "<OID>".
 			git config core.abbrev 7 &&
 			git remote add origin ../upstream.git &&
-			git update-ref refs/heads/master $A &&
+			git update-ref refs/heads/main $A &&
 			git push origin \
-				$B:refs/heads/master \
+				$B:refs/heads/main \
 				$A:refs/heads/foo \
 				$A:refs/heads/bar \
 				$A:refs/heads/baz
@@ -94,17 +94,17 @@ run_git_push_porcelain_output_test() {
 		;;
 	esac
 
-	# Refs of upstream : master(B)  foo(A)  bar(A)  baz(A)
-	# Refs of workbench: master(A)                  baz(A)  next(A)
-	# git-push         : master(A)  NULL    (B)     baz(A)  next(A)
+	# Refs of upstream : main(B)  foo(A)  bar(A)  baz(A)
+	# Refs of workbench: main(A)                  baz(A)  next(A)
+	# git-push         : main(A)  NULL    (B)     baz(A)  next(A)
 	test_expect_success "porcelain output of successful git-push ($PROTOCOL)" '
 		(
 			cd workbench &&
-			git update-ref refs/heads/master $A &&
+			git update-ref refs/heads/main $A &&
 			git update-ref refs/heads/baz $A &&
 			git update-ref refs/heads/next $A &&
 			git push --porcelain --force origin \
-				master \
+				main \
 				:refs/heads/foo \
 				$B:bar \
 				baz \
@@ -116,7 +116,7 @@ run_git_push_porcelain_output_test() {
 		=    refs/heads/baz:refs/heads/baz    [up to date]
 		     <COMMIT-B>:refs/heads/bar    <OID-A>..<OID-B>
 		-    :refs/heads/foo    [deleted]
-		+    refs/heads/master:refs/heads/master    <OID-B>...<OID-A> (forced update)
+		+    refs/heads/main:refs/heads/main    <OID-B>...<OID-A> (forced update)
 		*    refs/heads/next:refs/heads/next    [new branch]
 		Done
 		EOF
@@ -127,22 +127,22 @@ run_git_push_porcelain_output_test() {
 		cat >expect <<-EOF &&
 		<COMMIT-B> refs/heads/bar
 		<COMMIT-A> refs/heads/baz
-		<COMMIT-A> refs/heads/master
+		<COMMIT-A> refs/heads/main
 		<COMMIT-A> refs/heads/next
 		EOF
 		test_cmp expect actual
 	'
 
-	# Refs of upstream : master(A)  bar(B)  baz(A)  next(A)
-	# Refs of workbench: master(B)  bar(A)  baz(A)  next(A)
-	# git-push         : master(B)  bar(A)  NULL    next(A)
+	# Refs of upstream : main(A)  bar(B)  baz(A)  next(A)
+	# Refs of workbench: main(B)  bar(A)  baz(A)  next(A)
+	# git-push         : main(B)  bar(A)  NULL    next(A)
 	test_expect_success "atomic push failed ($PROTOCOL)" '
 		(
 			cd workbench &&
-			git update-ref refs/heads/master $B &&
+			git update-ref refs/heads/main $B &&
 			git update-ref refs/heads/bar $A &&
 			test_must_fail git push --atomic --porcelain origin \
-				master \
+				main \
 				bar \
 				:baz \
 				next
@@ -153,7 +153,7 @@ run_git_push_porcelain_output_test() {
 		=    refs/heads/next:refs/heads/next    [up to date]
 		!    refs/heads/bar:refs/heads/bar    [rejected] (non-fast-forward)
 		!    (delete):refs/heads/baz    [rejected] (atomic push failed)
-		!    refs/heads/master:refs/heads/master    [rejected] (atomic push failed)
+		!    refs/heads/main:refs/heads/main    [rejected] (atomic push failed)
 		Done
 		EOF
 		test_cmp expect actual &&
@@ -163,7 +163,7 @@ run_git_push_porcelain_output_test() {
 		cat >expect <<-EOF &&
 		<COMMIT-B> refs/heads/bar
 		<COMMIT-A> refs/heads/baz
-		<COMMIT-A> refs/heads/master
+		<COMMIT-A> refs/heads/main
 		<COMMIT-A> refs/heads/next
 		EOF
 		test_cmp expect actual
@@ -174,16 +174,16 @@ run_git_push_porcelain_output_test() {
 		EOF
 	'
 
-	# Refs of upstream : master(A)  bar(B)  baz(A)  next(A)
-	# Refs of workbench: master(B)  bar(A)  baz(A)  next(A)
-	# git-push         : master(B)  bar(A)  NULL    next(A)
+	# Refs of upstream : main(A)  bar(B)  baz(A)  next(A)
+	# Refs of workbench: main(B)  bar(A)  baz(A)  next(A)
+	# git-push         : main(B)  bar(A)  NULL    next(A)
 	test_expect_success "pre-receive hook declined ($PROTOCOL)" '
 		(
 			cd workbench &&
-			git update-ref refs/heads/master $B &&
+			git update-ref refs/heads/main $B &&
 			git update-ref refs/heads/bar $A &&
 			test_must_fail git push --porcelain --force origin \
-				master \
+				main \
 				bar \
 				:baz \
 				next
@@ -194,7 +194,7 @@ run_git_push_porcelain_output_test() {
 		=    refs/heads/next:refs/heads/next    [up to date]
 		!    refs/heads/bar:refs/heads/bar    [remote rejected] (pre-receive hook declined)
 		!    :refs/heads/baz    [remote rejected] (pre-receive hook declined)
-		!    refs/heads/master:refs/heads/master    [remote rejected] (pre-receive hook declined)
+		!    refs/heads/main:refs/heads/main    [remote rejected] (pre-receive hook declined)
 		Done
 		EOF
 		test_cmp expect actual &&
@@ -204,7 +204,7 @@ run_git_push_porcelain_output_test() {
 		cat >expect <<-EOF &&
 		<COMMIT-B> refs/heads/bar
 		<COMMIT-A> refs/heads/baz
-		<COMMIT-A> refs/heads/master
+		<COMMIT-A> refs/heads/main
 		<COMMIT-A> refs/heads/next
 		EOF
 		test_cmp expect actual
@@ -214,14 +214,14 @@ run_git_push_porcelain_output_test() {
 		rm "$upstream/hooks/pre-receive"
 	'
 
-	# Refs of upstream : master(A)  bar(B)  baz(A)  next(A)
-	# Refs of workbench: master(B)  bar(A)  baz(A)  next(A)
-	# git-push         : master(B)  bar(A)  NULL    next(A)
+	# Refs of upstream : main(A)  bar(B)  baz(A)  next(A)
+	# Refs of workbench: main(B)  bar(A)  baz(A)  next(A)
+	# git-push         : main(B)  bar(A)  NULL    next(A)
 	test_expect_success "non-fastforward push ($PROTOCOL)" '
 		(
 			cd workbench &&
 			test_must_fail git push --porcelain origin \
-				master \
+				main \
 				bar \
 				:baz \
 				next
@@ -231,7 +231,7 @@ run_git_push_porcelain_output_test() {
 		To <URL/of/upstream.git>
 		=    refs/heads/next:refs/heads/next    [up to date]
 		-    :refs/heads/baz    [deleted]
-		     refs/heads/master:refs/heads/master    <OID-A>..<OID-B>
+		     refs/heads/main:refs/heads/main    <OID-A>..<OID-B>
 		!    refs/heads/bar:refs/heads/bar    [rejected] (non-fast-forward)
 		Done
 		EOF
@@ -241,7 +241,7 @@ run_git_push_porcelain_output_test() {
 		make_user_friendly_and_stable_output <out >actual &&
 		cat >expect <<-EOF &&
 		<COMMIT-B> refs/heads/bar
-		<COMMIT-B> refs/heads/master
+		<COMMIT-B> refs/heads/main
 		<COMMIT-A> refs/heads/next
 		EOF
 		test_cmp expect actual
diff --git a/t/t5550-http-fetch-dumb.sh b/t/t5550-http-fetch-dumb.sh
index 483578b2d7..6fdcd0c036 100755
--- a/t/t5550-http-fetch-dumb.sh
+++ b/t/t5550-http-fetch-dumb.sh
@@ -26,7 +26,7 @@ test_expect_success 'create http-accessible bare repository with loose objects'
 	 hooks/post-update
 	) &&
 	git remote add public "$HTTPD_DOCUMENT_ROOT_PATH/repo.git" &&
-	git push public master:master
+	git push public main:main
 '
 
 test_expect_success 'clone http repository' '
@@ -37,8 +37,8 @@ test_expect_success 'clone http repository' '
 
 test_expect_success 'list refs from outside any repository' '
 	cat >expect <<-EOF &&
-	$(git rev-parse master)	HEAD
-	$(git rev-parse master)	refs/heads/master
+	$(git rev-parse main)	HEAD
+	$(git rev-parse main)	refs/heads/main
 	EOF
 	nongit git ls-remote "$HTTPD_URL/dumb/repo.git" >actual &&
 	test_cmp expect actual
@@ -181,8 +181,8 @@ test_expect_success 'fetch changes via manual http-fetch' '
 
 	HEAD=$(git rev-parse --verify HEAD) &&
 	(cd clone2 &&
-	 git http-fetch -a -w heads/master-new $HEAD $(git config remote.origin.url) &&
-	 git checkout master-new &&
+	 git http-fetch -a -w heads/main-new $HEAD $(git config remote.origin.url) &&
+	 git checkout main-new &&
 	 test $HEAD = $(git rev-parse --verify HEAD)) &&
 	test_cmp file clone2/file
 '
@@ -192,19 +192,19 @@ test_expect_success 'manual http-fetch without -a works just as well' '
 
 	HEAD=$(git rev-parse --verify HEAD) &&
 	(cd clone3 &&
-	 git http-fetch -w heads/master-new $HEAD $(git config remote.origin.url) &&
-	 git checkout master-new &&
+	 git http-fetch -w heads/main-new $HEAD $(git config remote.origin.url) &&
+	 git checkout main-new &&
 	 test $HEAD = $(git rev-parse --verify HEAD)) &&
 	test_cmp file clone3/file
 '
 
 test_expect_success 'http remote detects correct HEAD' '
-	git push public master:other &&
+	git push public main:other &&
 	(cd clone &&
 	 git remote set-head origin -d &&
 	 git remote set-head origin -a &&
 	 git symbolic-ref refs/remotes/origin/HEAD > output &&
-	 echo refs/remotes/origin/master > expect &&
+	 echo refs/remotes/origin/main > expect &&
 	 test_cmp expect output
 	)
 '
@@ -416,7 +416,7 @@ test_expect_success 'set up evil alternates scheme' '
 	evil=$HTTPD_DOCUMENT_ROOT_PATH/evil.git &&
 	git init --bare "$evil" &&
 	# do this by hand to avoid object existence check
-	printf "%s\\t%s\\n" $sha1 refs/heads/master >"$evil/info/refs"
+	printf "%s\\t%s\\n" $sha1 refs/heads/main >"$evil/info/refs"
 '
 
 # Here we'll just redirect via HTTP. In a real-world attack these would be on
diff --git a/t/t5551-http-fetch-smart.sh b/t/t5551-http-fetch-smart.sh
index e40e9ed52f..2215bbcce7 100755
--- a/t/t5551-http-fetch-smart.sh
+++ b/t/t5551-http-fetch-smart.sh
@@ -18,7 +18,7 @@ test_expect_success 'create http-accessible bare repository' '
 	 git --bare init
 	) &&
 	git remote add public "$HTTPD_DOCUMENT_ROOT_PATH/repo.git" &&
-	git push public master:master
+	git push public main:main
 '
 
 setup_askpass_helper
@@ -238,9 +238,9 @@ test_expect_success 'invalid Content-Type rejected' '
 
 test_expect_success 'create namespaced refs' '
 	test_commit namespaced &&
-	git push public HEAD:refs/namespaces/ns/refs/heads/master &&
+	git push public HEAD:refs/namespaces/ns/refs/heads/main &&
 	git --git-dir="$HTTPD_DOCUMENT_ROOT_PATH/repo.git" \
-		symbolic-ref refs/namespaces/ns/HEAD refs/namespaces/ns/refs/heads/master
+		symbolic-ref refs/namespaces/ns/HEAD refs/namespaces/ns/refs/heads/main
 '
 
 test_expect_success 'smart clone respects namespace' '
@@ -271,7 +271,7 @@ test_expect_success 'cookies stored in http.cookiefile when http.savecookies set
 	EOF
 	git config http.cookiefile cookies.txt &&
 	git config http.savecookies true &&
-	git ls-remote $HTTPD_URL/smart_cookies/repo.git master &&
+	git ls-remote $HTTPD_URL/smart_cookies/repo.git main &&
 
 	# NEEDSWORK: If the overspecification of the expected result is reduced, we
 	# might be able to run this test in all protocol versions.
@@ -344,12 +344,12 @@ test_expect_success 'large fetch-pack requests can be sent using chunked encodin
 test_expect_success 'test allowreachablesha1inwant' '
 	test_when_finished "rm -rf test_reachable.git" &&
 	server="$HTTPD_DOCUMENT_ROOT_PATH/repo.git" &&
-	master_sha=$(git -C "$server" rev-parse refs/heads/master) &&
+	main_sha=$(git -C "$server" rev-parse refs/heads/main) &&
 	git -C "$server" config uploadpack.allowreachablesha1inwant 1 &&
 
 	git init --bare test_reachable.git &&
 	git -C test_reachable.git remote add origin "$HTTPD_URL/smart/repo.git" &&
-	git -C test_reachable.git fetch origin "$master_sha"
+	git -C test_reachable.git fetch origin "$main_sha"
 '
 
 test_expect_success 'test allowreachablesha1inwant with unreachable' '
@@ -363,7 +363,7 @@ test_expect_success 'test allowreachablesha1inwant with unreachable' '
 	git push public :refs/heads/doomed &&
 
 	server="$HTTPD_DOCUMENT_ROOT_PATH/repo.git" &&
-	master_sha=$(git -C "$server" rev-parse refs/heads/master) &&
+	main_sha=$(git -C "$server" rev-parse refs/heads/main) &&
 	git -C "$server" config uploadpack.allowreachablesha1inwant 1 &&
 
 	git init --bare test_reachable.git &&
@@ -385,7 +385,7 @@ test_expect_success 'test allowanysha1inwant with unreachable' '
 	git push public :refs/heads/doomed &&
 
 	server="$HTTPD_DOCUMENT_ROOT_PATH/repo.git" &&
-	master_sha=$(git -C "$server" rev-parse refs/heads/master) &&
+	main_sha=$(git -C "$server" rev-parse refs/heads/main) &&
 	git -C "$server" config uploadpack.allowreachablesha1inwant 1 &&
 
 	git init --bare test_reachable.git &&
@@ -444,8 +444,8 @@ test_expect_success 'using fetch command in remote-curl updates refs' '
 	test_commit -C "$SERVER" bar &&
 	git -C client -c protocol.version=0 fetch &&
 
-	git -C "$SERVER" rev-parse master >expect &&
-	git -C client rev-parse origin/master >actual &&
+	git -C "$SERVER" rev-parse main >expect &&
+	git -C client rev-parse origin/main >actual &&
 	test_cmp expect actual
 '
 
diff --git a/t/t5552-skipping-fetch-negotiator.sh b/t/t5552-skipping-fetch-negotiator.sh
index 156c704040..7b9fb4ff02 100755
--- a/t/t5552-skipping-fetch-negotiator.sh
+++ b/t/t5552-skipping-fetch-negotiator.sh
@@ -100,7 +100,7 @@ test_expect_success 'use ref advertisement to filter out commits' '
 	git -C server checkout --orphan anotherbranch &&
 	test_commit -C server to_fetch &&
 
-	# The server advertising "c3" (as "refs/heads/master") means that we do
+	# The server advertising "c3" (as "refs/heads/main") means that we do
 	# not need to send any ancestors of "c3", but we still need to send "c3"
 	# itself.
 	test_config -C client fetch.negotiationalgorithm skipping &&
diff --git a/t/t5553-set-upstream.sh b/t/t5553-set-upstream.sh
index 7622981cbf..0e6574f526 100755
--- a/t/t5553-set-upstream.sh
+++ b/t/t5553-set-upstream.sh
@@ -32,9 +32,9 @@ test_expect_success 'setup bare parent fetch' '
 	git remote add upstream parent
 '
 
-test_expect_success 'setup commit on master and other fetch' '
+test_expect_success 'setup commit on main and other fetch' '
 	test_commit one &&
-	git push upstream master &&
+	git push upstream main &&
 	git checkout -b other &&
 	test_commit two &&
 	git push upstream other
@@ -43,38 +43,38 @@ test_expect_success 'setup commit on master and other fetch' '
 # tests for fetch --set-upstream
 
 test_expect_success 'fetch --set-upstream does not set upstream w/o branch' '
-	clear_config master other &&
-	git checkout master &&
+	clear_config main other &&
+	git checkout main &&
 	git fetch --set-upstream upstream &&
-	check_config_missing master &&
+	check_config_missing main &&
 	check_config_missing other
 '
 
-test_expect_success 'fetch --set-upstream upstream master sets branch master but not other' '
-	clear_config master other &&
-	git fetch --set-upstream upstream master &&
-	check_config master upstream refs/heads/master &&
+test_expect_success 'fetch --set-upstream upstream main sets branch main but not other' '
+	clear_config main other &&
+	git fetch --set-upstream upstream main &&
+	check_config main upstream refs/heads/main &&
 	check_config_missing other
 '
 
 test_expect_success 'fetch --set-upstream upstream other sets branch other' '
-	clear_config master other &&
+	clear_config main other &&
 	git fetch --set-upstream upstream other &&
-	check_config master upstream refs/heads/other &&
+	check_config main upstream refs/heads/other &&
 	check_config_missing other
 '
 
-test_expect_success 'fetch --set-upstream master:other does not set the branch other2' '
+test_expect_success 'fetch --set-upstream main:other does not set the branch other2' '
 	clear_config other2 &&
-	git fetch --set-upstream upstream master:other2 &&
+	git fetch --set-upstream upstream main:other2 &&
 	check_config_missing other2
 '
 
 test_expect_success 'fetch --set-upstream http://nosuchdomain.example.com fails with invalid url' '
-	# master explicitly not cleared, we check that it is not touched from previous value
+	# main explicitly not cleared, we check that it is not touched from previous value
 	clear_config other other2 &&
 	test_must_fail git fetch --set-upstream http://nosuchdomain.example.com &&
-	check_config master upstream refs/heads/other &&
+	check_config main upstream refs/heads/other &&
 	check_config_missing other &&
 	check_config_missing other2
 '
@@ -83,7 +83,7 @@ test_expect_success 'fetch --set-upstream with valid URL sets upstream to URL' '
 	clear_config other other2 &&
 	url="file://$PWD" &&
 	git fetch --set-upstream "$url" &&
-	check_config master "$url" HEAD &&
+	check_config main "$url" HEAD &&
 	check_config_missing other &&
 	check_config_missing other2
 '
@@ -96,30 +96,30 @@ test_expect_success 'setup bare parent pull' '
 	git remote add upstream parent
 '
 
-test_expect_success 'setup commit on master and other pull' '
+test_expect_success 'setup commit on main and other pull' '
 	test_commit three &&
-	git push --tags upstream master &&
+	git push --tags upstream main &&
 	test_commit four &&
 	git push upstream other
 '
 
-test_expect_success 'pull --set-upstream upstream master sets branch master but not other' '
-	clear_config master other &&
-	git pull --set-upstream upstream master &&
-	check_config master upstream refs/heads/master &&
+test_expect_success 'pull --set-upstream upstream main sets branch main but not other' '
+	clear_config main other &&
+	git pull --set-upstream upstream main &&
+	check_config main upstream refs/heads/main &&
 	check_config_missing other
 '
 
-test_expect_success 'pull --set-upstream master:other2 does not set the branch other2' '
+test_expect_success 'pull --set-upstream main:other2 does not set the branch other2' '
 	clear_config other2 &&
-	git pull --set-upstream upstream master:other2 &&
+	git pull --set-upstream upstream main:other2 &&
 	check_config_missing other2
 '
 
-test_expect_success 'pull --set-upstream upstream other sets branch master' '
-	clear_config master other &&
+test_expect_success 'pull --set-upstream upstream other sets branch main' '
+	clear_config main other &&
 	git pull --set-upstream upstream other &&
-	check_config master upstream refs/heads/other &&
+	check_config main upstream refs/heads/other &&
 	check_config_missing other
 '
 
@@ -130,47 +130,47 @@ test_expect_success 'pull --set-upstream upstream tag does not set the tag' '
 '
 
 test_expect_success 'pull --set-upstream http://nosuchdomain.example.com fails with invalid url' '
-	# master explicitly not cleared, we check that it is not touched from previous value
+	# main explicitly not cleared, we check that it is not touched from previous value
 	clear_config other other2 three &&
 	test_must_fail git pull --set-upstream http://nosuchdomain.example.com &&
-	check_config master upstream refs/heads/other &&
+	check_config main upstream refs/heads/other &&
 	check_config_missing other &&
 	check_config_missing other2 &&
 	check_config_missing three
 '
 
 test_expect_success 'pull --set-upstream upstream HEAD sets branch HEAD' '
-	clear_config master other &&
+	clear_config main other &&
 	git pull --set-upstream upstream HEAD &&
-	check_config master upstream HEAD &&
+	check_config main upstream HEAD &&
 	git checkout other &&
 	git pull --set-upstream upstream HEAD &&
 	check_config other upstream HEAD
 '
 
 test_expect_success 'pull --set-upstream upstream with more than one branch does nothing' '
-	clear_config master three &&
-	git pull --set-upstream upstream master three &&
-	check_config_missing master &&
+	clear_config main three &&
+	git pull --set-upstream upstream main three &&
+	check_config_missing main &&
 	check_config_missing three
 '
 
 test_expect_success 'pull --set-upstream with valid URL sets upstream to URL' '
-	clear_config master other other2 &&
-	git checkout master &&
+	clear_config main other other2 &&
+	git checkout main &&
 	url="file://$PWD" &&
 	git pull --set-upstream "$url" &&
-	check_config master "$url" HEAD &&
+	check_config main "$url" HEAD &&
 	check_config_missing other &&
 	check_config_missing other2
 '
 
 test_expect_success 'pull --set-upstream with valid URL and branch sets branch' '
-	clear_config master other other2 &&
-	git checkout master &&
+	clear_config main other other2 &&
+	git checkout main &&
 	url="file://$PWD" &&
-	git pull --set-upstream "$url" master &&
-	check_config master "$url" refs/heads/master &&
+	git pull --set-upstream "$url" main &&
+	check_config main "$url" refs/heads/main &&
 	check_config_missing other &&
 	check_config_missing other2
 '
diff --git a/t/t5561-http-backend.sh b/t/t5561-http-backend.sh
index 6eb0294978..c8a9f7f9bb 100755
--- a/t/t5561-http-backend.sh
+++ b/t/t5561-http-backend.sh
@@ -39,9 +39,9 @@ POST() {
 
 grep '^[^#]' >exp <<EOF
 
-###  refs/heads/master
+###  refs/heads/main
 ###
-GET  /smart/repo.git/refs/heads/master HTTP/1.1 404 -
+GET  /smart/repo.git/refs/heads/main HTTP/1.1 404 -
 
 ###  getanyfile default
 ###
diff --git a/t/t556x_common b/t/t556x_common
index 359fcfe32b..670fb89477 100755
--- a/t/t556x_common
+++ b/t/t556x_common
@@ -22,7 +22,7 @@ test_expect_success 'setup repository' '
 	 : >objects/info/http-alternates
 	) &&
 	git remote add public "$HTTPD_DOCUMENT_ROOT_PATH/repo.git" &&
-	git push public master:master &&
+	git push public main:main &&
 
 	(cd "$HTTPD_DOCUMENT_ROOT_PATH/repo.git" &&
 	 git repack -a -d
@@ -31,7 +31,7 @@ test_expect_success 'setup repository' '
 	echo other >file &&
 	git add file &&
 	git commit -m two &&
-	git push public master:master &&
+	git push public main:main &&
 
 	LOOSE_URL=$(find_file objects/??) &&
 	PACK_URL=$(find_file objects/pack/*.pack) &&
@@ -51,8 +51,8 @@ get_static_files() {
 
 SMART=smart
 GIT_HTTP_EXPORT_ALL=1 && export GIT_HTTP_EXPORT_ALL
-test_expect_success 'direct refs/heads/master not found' '
-	GET refs/heads/master "404 Not Found"
+test_expect_success 'direct refs/heads/main not found' '
+	GET refs/heads/main "404 Not Found"
 '
 test_expect_success 'static file is ok' '
 	get_static_files "200 OK"
diff --git a/t/t5570-git-daemon.sh b/t/t5570-git-daemon.sh
index 8f69a7854f..864d5c985c 100755
--- a/t/t5570-git-daemon.sh
+++ b/t/t5570-git-daemon.sh
@@ -26,7 +26,7 @@ test_expect_success 'create git-accessible bare repository' '
 	 : >git-daemon-export-ok
 	) &&
 	git remote add public "$GIT_DAEMON_DOCUMENT_ROOT_PATH/repo.git" &&
-	git push public master:master
+	git push public main:main
 '
 
 test_expect_success 'clone git repository' '
@@ -55,12 +55,12 @@ test_expect_success 'no-op fetch without "-v" is quiet' '
 '
 
 test_expect_success 'remote detects correct HEAD' '
-	git push public master:other &&
+	git push public main:other &&
 	(cd clone &&
 	 git remote set-head -d origin &&
 	 git remote set-head -a origin &&
 	 git symbolic-ref refs/remotes/origin/HEAD > output &&
-	 echo refs/remotes/origin/master > expect &&
+	 echo refs/remotes/origin/main > expect &&
 	 test_cmp expect output
 	)
 '
@@ -148,7 +148,7 @@ test_remote_error()
 
 msg="access denied or repository not exported"
 test_expect_success 'clone non-existent' "test_remote_error    '$msg' clone nowhere.git"
-test_expect_success 'push disabled'      "test_remote_error    '$msg' push  repo.git master"
+test_expect_success 'push disabled'      "test_remote_error    '$msg' push  repo.git main"
 test_expect_success 'read access denied' "test_remote_error -x '$msg' fetch repo.git"
 test_expect_success 'not exported'       "test_remote_error -n '$msg' fetch repo.git"
 
@@ -156,7 +156,7 @@ stop_git_daemon
 start_git_daemon --informative-errors
 
 test_expect_success 'clone non-existent' "test_remote_error    'no such repository'      clone nowhere.git"
-test_expect_success 'push disabled'      "test_remote_error    'service not enabled'     push  repo.git master"
+test_expect_success 'push disabled'      "test_remote_error    'service not enabled'     push  repo.git main"
 test_expect_success 'read access denied' "test_remote_error -x 'no such repository'      fetch repo.git"
 test_expect_success 'not exported'       "test_remote_error -n 'repository not exported' fetch repo.git"
 
@@ -192,10 +192,10 @@ test_expect_success FAKENC 'hostname interpolation works after LF-stripping' '
 	fake_nc "$GIT_DAEMON_HOST_PORT" <input >output &&
 	depacketize <output >output.raw &&
 
-	# just pick out the value of master, which avoids any protocol
+	# just pick out the value of main, which avoids any protocol
 	# particulars
-	perl -lne "print \$1 if m{^(\\S+) refs/heads/master}" <output.raw >actual &&
-	git -C "$repo" rev-parse master >expect &&
+	perl -lne "print \$1 if m{^(\\S+) refs/heads/main}" <output.raw >actual &&
+	git -C "$repo" rev-parse main >expect &&
 	test_cmp expect actual
 '
 
diff --git a/t/t5571-pre-push-hook.sh b/t/t5571-pre-push-hook.sh
index ac53d63869..891f03cd59 100755
--- a/t/t5571-pre-push-hook.sh
+++ b/t/t5571-pre-push-hook.sh
@@ -48,11 +48,11 @@ EOF
 cat >expected <<EOF
 parent1
 repo1
-refs/heads/master $COMMIT2 refs/heads/foreign $COMMIT1
+refs/heads/main $COMMIT2 refs/heads/foreign $COMMIT1
 EOF
 
 test_expect_success 'push with hook' '
-	git push parent1 master:foreign &&
+	git push parent1 main:foreign &&
 	diff expected actual
 '
 
diff --git a/t/t5572-pull-submodule.sh b/t/t5572-pull-submodule.sh
index 1d75e3b12b..d6a75964d8 100755
--- a/t/t5572-pull-submodule.sh
+++ b/t/t5572-pull-submodule.sh
@@ -148,8 +148,8 @@ test_expect_success 'branch has no merge base with remote-tracking counterpart'
 
 	git clone parent child &&
 
-	# Reset master so that it has no merge base with
-	# refs/remotes/origin/master.
+	# Reset main so that it has no merge base with
+	# refs/remotes/origin/main.
 	OTHER=$(git -C child commit-tree -m bar \
 		$(git -C child rev-parse HEAD^{tree})) &&
 	git -C child reset --hard "$OTHER" &&
diff --git a/t/t5580-unc-paths.sh b/t/t5580-unc-paths.sh
index cf768b3a27..511c1ba51d 100755
--- a/t/t5580-unc-paths.sh
+++ b/t/t5580-unc-paths.sh
@@ -53,7 +53,7 @@ test_expect_success fetch '
 	git init to-fetch &&
 	(
 		cd to-fetch &&
-		git fetch "$UNCPATH" master
+		git fetch "$UNCPATH" main
 	)
 '
 
diff --git a/t/t5581-http-curl-verbose.sh b/t/t5581-http-curl-verbose.sh
index 927aad0820..0c6e3b7665 100755
--- a/t/t5581-http-curl-verbose.sh
+++ b/t/t5581-http-curl-verbose.sh
@@ -13,7 +13,7 @@ test_expect_success 'setup repository' '
 	git add file &&
 	git commit -m one &&
 	git remote add public "$HTTPD_DOCUMENT_ROOT_PATH/repo.git" &&
-	git push public master:master
+	git push public main:main
 '
 
 test_expect_success 'failure in git-upload-pack is shown' '
diff --git a/t/t5582-fetch-negative-refspec.sh b/t/t5582-fetch-negative-refspec.sh
index 8c61e28fec..9c2b19cae2 100755
--- a/t/t5582-fetch-negative-refspec.sh
+++ b/t/t5582-fetch-negative-refspec.sh
@@ -22,12 +22,12 @@ test_expect_success "clone and setup child repos" '
 		git switch -c alternate &&
 		echo >file updated again by one &&
 		git commit -a -m "updated by one again" &&
-		git switch master
+		git switch main
 	) &&
 	git clone . two &&
 	(
 		cd two &&
-		git config branch.master.remote one &&
+		git config branch.main.remote one &&
 		git config remote.one.url ../one/.git/ &&
 		git config remote.one.fetch +refs/heads/*:refs/remotes/one/* &&
 		git config --add remote.one.fetch ^refs/heads/alternate
@@ -43,9 +43,9 @@ test_expect_success "fetch one" '
 		test_must_fail git rev-parse --verify refs/remotes/one/alternate &&
 		git fetch one &&
 		test_must_fail git rev-parse --verify refs/remotes/one/alternate &&
-		git rev-parse --verify refs/remotes/one/master &&
-		mine=$(git rev-parse refs/remotes/one/master) &&
-		his=$(cd ../one && git rev-parse refs/heads/master) &&
+		git rev-parse --verify refs/remotes/one/main &&
+		mine=$(git rev-parse refs/remotes/one/main) &&
+		his=$(cd ../one && git rev-parse refs/heads/main) &&
 		test "z$mine" = "z$his"
 	)
 '
@@ -57,7 +57,7 @@ test_expect_success "fetch with negative refspec on commandline" '
 		cd three &&
 		alternate_in_one=$(cd ../one && git rev-parse refs/heads/alternate) &&
 		echo $alternate_in_one >expect &&
-		git fetch ../one/.git refs/heads/*:refs/remotes/one/* ^refs/heads/master &&
+		git fetch ../one/.git refs/heads/*:refs/remotes/one/* ^refs/heads/main &&
 		cut -f -1 .git/FETCH_HEAD >actual &&
 		test_cmp expect actual
 	)
@@ -68,8 +68,8 @@ test_expect_success "fetch with negative sha1 refspec fails" '
 	git commit -a -m "updated by origin yet again" &&
 	(
 		cd three &&
-		master_in_one=$(cd ../one && git rev-parse refs/heads/master) &&
-		test_must_fail git fetch ../one/.git refs/heads/*:refs/remotes/one/* ^$master_in_one
+		main_in_one=$(cd ../one && git rev-parse refs/heads/main) &&
+		test_must_fail git fetch ../one/.git refs/heads/*:refs/remotes/one/* ^$main_in_one
 	)
 '
 
@@ -92,10 +92,10 @@ test_expect_success "fetch with negative pattern refspec does not expand prefix"
 	(
 		cd three &&
 		alternate_in_one=$(cd ../one && git rev-parse refs/heads/alternate) &&
-		master_in_one=$(cd ../one && git rev-parse refs/heads/master) &&
+		main_in_one=$(cd ../one && git rev-parse refs/heads/main) &&
 		echo $alternate_in_one >expect &&
-		echo $master_in_one >>expect &&
-		git fetch ../one/.git refs/heads/*:refs/remotes/one/* ^master &&
+		echo $main_in_one >>expect &&
+		git fetch ../one/.git refs/heads/*:refs/remotes/one/* ^main &&
 		cut -f -1 .git/FETCH_HEAD >actual &&
 		test_cmp expect actual
 	)
diff --git a/t/test-lib.sh b/t/test-lib.sh
index ecaa0f36f3..f919021063 100644
--- a/t/test-lib.sh
+++ b/t/test-lib.sh
@@ -263,7 +263,7 @@ case "$TEST_NUMBER" in
 	GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
 	export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 	;;
-[0-4]*|5[0-4]*|55[0-3]*)
+[0-4]*|5[0-5]*)
 	GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 	export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 	;;
-- 
gitgitgadget


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH 16/28] t5[6-9]*: adjust the references to the default branch name "main"
  2020-11-12 22:43 [PATCH 00/28] Use main as default branch name Johannes Schindelin via GitGitGadget
                   ` (14 preceding siblings ...)
  2020-11-12 22:43 ` [PATCH 15/28] t55[4-9]*: " Johannes Schindelin via GitGitGadget
@ 2020-11-12 22:43 ` Johannes Schindelin via GitGitGadget
  2020-11-12 22:43 ` [PATCH 17/28] t6[0-3]*: " Johannes Schindelin via GitGitGadget
                   ` (16 subsequent siblings)
  32 siblings, 0 replies; 163+ messages in thread
From: Johannes Schindelin via GitGitGadget @ 2020-11-12 22:43 UTC (permalink / raw)
  To: git; +Cc: Johannes Schindelin, Johannes Schindelin

From: Johannes Schindelin <johannes.schindelin@gmx.de>

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>
---
 t/t5601-clone.sh                    |  4 +-
 t/t5604-clone-reference.sh          | 12 +++---
 t/t5605-clone-local.sh              | 10 ++---
 t/t5606-clone-options.sh            |  8 ++--
 t/t5607-clone-bundle.sh             | 14 +++----
 t/t5608-clone-2gb.sh                |  2 +-
 t/t5609-clone-branch.sh             |  6 +--
 t/t5610-clone-detached.sh           |  4 +-
 t/t5611-clone-config.sh             | 16 ++++----
 t/t5612-clone-refspec.sh            | 42 ++++++++++-----------
 t/t5614-clone-submodules-shallow.sh |  2 +-
 t/t5616-partial-clone.sh            | 50 ++++++++++++-------------
 t/t5617-clone-submodules-remote.sh  |  6 +--
 t/t5700-protocol-v1.sh              | 16 ++++----
 t/t5701-git-serve.sh                | 16 ++++----
 t/t5702-protocol-v2.sh              | 50 ++++++++++++-------------
 t/t5703-upload-pack-ref-in-want.sh  | 58 ++++++++++++++---------------
 t/t5801-remote-helpers.sh           | 24 ++++++------
 t/test-lib.sh                       |  2 +-
 19 files changed, 171 insertions(+), 171 deletions(-)

diff --git a/t/t5601-clone.sh b/t/t5601-clone.sh
index 7df3c5373a..f5058be718 100755
--- a/t/t5601-clone.sh
+++ b/t/t5601-clone.sh
@@ -217,7 +217,7 @@ test_expect_success 'clone respects global branch.autosetuprebase' '
 		rm -fr dst &&
 		git clone src dst &&
 		cd dst &&
-		actual="z$(git config branch.master.rebase)" &&
+		actual="z$(git config branch.main.rebase)" &&
 		test ztrue = $actual
 	)
 '
@@ -591,7 +591,7 @@ test_expect_success 'clone from a repository with two identical branches' '
 
 	(
 		cd src &&
-		git checkout -b another master
+		git checkout -b another main
 	) &&
 	git clone src target-11 &&
 	test "z$( cd target-11 && git symbolic-ref HEAD )" = zrefs/heads/another
diff --git a/t/t5604-clone-reference.sh b/t/t5604-clone-reference.sh
index 2f7be23044..db86a84af9 100755
--- a/t/t5604-clone-reference.sh
+++ b/t/t5604-clone-reference.sh
@@ -49,7 +49,7 @@ test_expect_success 'existence of info/alternates' '
 '
 
 test_expect_success 'pulling from reference' '
-	git -C C pull ../B master
+	git -C C pull ../B main
 '
 
 test_expect_success 'that reference gets used' '
@@ -70,7 +70,7 @@ test_expect_success 'existence of info/alternates' '
 '
 
 test_expect_success 'pulling from reference' '
-	git -C D pull ../B master
+	git -C D pull ../B main
 '
 
 test_expect_success 'that reference gets used' '
@@ -136,11 +136,11 @@ test_expect_success 'prepare branched repository' '
 	git clone A J &&
 	(
 		cd J &&
-		git checkout -b other master^ &&
+		git checkout -b other main^ &&
 		echo other >otherfile &&
 		git add otherfile &&
 		git commit -m other &&
-		git checkout master
+		git checkout main
 	)
 '
 
@@ -152,9 +152,9 @@ test_expect_success 'fetch with incomplete alternates' '
 		git remote add J "file://$base_dir/J" &&
 		GIT_TRACE_PACKET=$U.K git fetch J
 	) &&
-	master_object=$(cd A && git for-each-ref --format="%(objectname)" refs/heads/master) &&
+	main_object=$(cd A && git for-each-ref --format="%(objectname)" refs/heads/main) &&
 	test -s "$U.K" &&
-	! grep " want $master_object" "$U.K" &&
+	! grep " want $main_object" "$U.K" &&
 	tag_object=$(cd A && git for-each-ref --format="%(objectname)" refs/tags/HEAD) &&
 	! grep " want $tag_object" "$U.K"
 '
diff --git a/t/t5605-clone-local.sh b/t/t5605-clone-local.sh
index af23419ebf..a7756e9622 100755
--- a/t/t5605-clone-local.sh
+++ b/t/t5605-clone-local.sh
@@ -15,7 +15,7 @@ test_expect_success 'preparing origin repository' '
 	test "$(cd a.git && git config --bool core.bare)" = true &&
 	test "$(cd x && git config --bool core.bare)" = true &&
 	git bundle create b1.bundle --all &&
-	git bundle create b2.bundle master &&
+	git bundle create b2.bundle main &&
 	mkdir dir &&
 	cp b1.bundle dir/b3 &&
 	cp b1.bundle b4
@@ -84,7 +84,7 @@ test_expect_success 'bundle clone with nonexistent HEAD' '
 	git clone b2.bundle b2 &&
 	(cd b2 &&
 	git fetch &&
-	test_must_fail git rev-parse --verify refs/heads/master)
+	test_must_fail git rev-parse --verify refs/heads/main)
 '
 
 test_expect_success 'clone empty repository' '
@@ -98,9 +98,9 @@ test_expect_success 'clone empty repository' '
 	 echo "content" >> foo &&
 	 git add foo &&
 	 git commit -m "Initial commit" &&
-	 git push origin master &&
-	 expected=$(git rev-parse master) &&
-	 actual=$(git --git-dir=../empty/.git rev-parse master) &&
+	 git push origin main &&
+	 expected=$(git rev-parse main) &&
+	 actual=$(git --git-dir=../empty/.git rev-parse main) &&
 	 test $actual = $expected)
 '
 
diff --git a/t/t5606-clone-options.sh b/t/t5606-clone-options.sh
index 7f082fb23b..80caff9266 100755
--- a/t/t5606-clone-options.sh
+++ b/t/t5606-clone-options.sh
@@ -15,7 +15,7 @@ test_expect_success 'setup' '
 test_expect_success 'clone -o' '
 
 	git clone -o foo parent clone-o &&
-	git -C clone-o rev-parse --verify refs/remotes/foo/master
+	git -C clone-o rev-parse --verify refs/remotes/foo/main
 
 '
 
@@ -45,7 +45,7 @@ test_expect_success 'disallows --bare with --separate-git-dir' '
 test_expect_success 'uses "origin" for default remote name' '
 
 	git clone parent clone-default-origin &&
-	git -C clone-default-origin rev-parse --verify refs/remotes/origin/master
+	git -C clone-default-origin rev-parse --verify refs/remotes/origin/main
 
 '
 
@@ -74,14 +74,14 @@ test_expect_success 'prefers config "clone.defaultRemoteName" over default' '
 
 	test_config_global clone.defaultRemoteName from_config &&
 	git clone parent clone-config-origin &&
-	git -C clone-config-origin rev-parse --verify refs/remotes/from_config/master
+	git -C clone-config-origin rev-parse --verify refs/remotes/from_config/main
 
 '
 
 test_expect_success 'prefers --origin over -c config' '
 
 	git clone -c clone.defaultRemoteName=inline --origin from_option parent clone-o-and-inline-config &&
-	git -C clone-o-and-inline-config rev-parse --verify refs/remotes/from_option/master
+	git -C clone-o-and-inline-config rev-parse --verify refs/remotes/from_option/main
 
 '
 
diff --git a/t/t5607-clone-bundle.sh b/t/t5607-clone-bundle.sh
index 26985f4b44..4f2db37981 100755
--- a/t/t5607-clone-bundle.sh
+++ b/t/t5607-clone-bundle.sh
@@ -19,7 +19,7 @@ test_expect_success 'setup' '
 '
 
 test_expect_success '"verify" needs a worktree' '
-	git bundle create tip.bundle -1 master &&
+	git bundle create tip.bundle -1 main &&
 	nongit test_must_fail git bundle verify ../tip.bundle 2>err &&
 	test_i18ngrep "need a repository" err
 '
@@ -39,15 +39,15 @@ test_expect_success 'die if bundle file cannot be created' '
 '
 
 test_expect_failure 'bundle --stdin' '
-	echo master | git bundle create stdin-bundle.bdl --stdin &&
+	echo main | git bundle create stdin-bundle.bdl --stdin &&
 	git ls-remote stdin-bundle.bdl >output &&
-	grep master output
+	grep main output
 '
 
 test_expect_failure 'bundle --stdin <rev-list options>' '
-	echo master | git bundle create hybrid-bundle.bdl --stdin tag &&
+	echo main | git bundle create hybrid-bundle.bdl --stdin tag &&
 	git ls-remote hybrid-bundle.bdl >output &&
-	grep master output
+	grep main output
 '
 
 test_expect_success 'empty bundle file is rejected' '
@@ -83,14 +83,14 @@ test_expect_success 'prerequisites with an empty commit message' '
 
 test_expect_success 'failed bundle creation does not leave cruft' '
 	# This fails because the bundle would be empty.
-	test_must_fail git bundle create fail.bundle master..master &&
+	test_must_fail git bundle create fail.bundle main..main &&
 	test_path_is_missing fail.bundle.lock
 '
 
 test_expect_success 'fetch SHA-1 from bundle' '
 	test_create_repo foo &&
 	test_commit -C foo x &&
-	git -C foo bundle create tip.bundle -1 master &&
+	git -C foo bundle create tip.bundle -1 main &&
 	git -C foo rev-parse HEAD >hash &&
 
 	# Exercise to ensure that fetching a SHA-1 from a bundle works with no
diff --git a/t/t5608-clone-2gb.sh b/t/t5608-clone-2gb.sh
index 4c476d2fa1..87a8cd9f98 100755
--- a/t/t5608-clone-2gb.sh
+++ b/t/t5608-clone-2gb.sh
@@ -26,7 +26,7 @@ test_expect_success 'setup' '
 		i=$(($i+1)) ||
 		echo $? > exit-status
 	 done &&
-	 echo "commit refs/heads/master" &&
+	 echo "commit refs/heads/main" &&
 	 echo "author A U Thor <author@email.com> 123456789 +0000" &&
 	 echo "committer C O Mitter <committer@email.com> 123456789 +0000" &&
 	 echo "data 5" &&
diff --git a/t/t5609-clone-branch.sh b/t/t5609-clone-branch.sh
index 6e7a7be052..2652dbe4e4 100755
--- a/t/t5609-clone-branch.sh
+++ b/t/t5609-clone-branch.sh
@@ -20,7 +20,7 @@ test_expect_success 'setup' '
 	 echo one >file && git add file && git commit -m one &&
 	 git checkout -b two &&
 	 echo two >file && git add file && git commit -m two &&
-	 git checkout master) &&
+	 git checkout main) &&
 	mkdir empty &&
 	(cd empty && git init)
 '
@@ -28,7 +28,7 @@ test_expect_success 'setup' '
 test_expect_success 'vanilla clone chooses HEAD' '
 	git clone parent clone &&
 	(cd clone &&
-	 check_HEAD master &&
+	 check_HEAD main &&
 	 check_file one
 	)
 '
@@ -53,7 +53,7 @@ test_expect_success 'clone -b sets up tracking' '
 
 test_expect_success 'clone -b does not munge remotes/origin/HEAD' '
 	(cd clone-two &&
-	 echo refs/remotes/origin/master >expect &&
+	 echo refs/remotes/origin/main >expect &&
 	 git symbolic-ref refs/remotes/origin/HEAD >actual &&
 	 test_cmp expect actual
 	)
diff --git a/t/t5610-clone-detached.sh b/t/t5610-clone-detached.sh
index 8b0d607df1..985f0d7303 100755
--- a/t/t5610-clone-detached.sh
+++ b/t/t5610-clone-detached.sh
@@ -20,7 +20,7 @@ test_expect_success 'setup' '
 '
 
 test_expect_success 'clone repo (detached HEAD points to branch)' '
-	git checkout master^0 &&
+	git checkout main^0 &&
 	git clone "file://$PWD" detached-branch
 '
 test_expect_success 'cloned HEAD matches' '
@@ -59,7 +59,7 @@ test_expect_success 'cloned HEAD is detached' '
 '
 
 test_expect_success 'clone repo (orphan detached HEAD)' '
-	git checkout master^0 &&
+	git checkout main^0 &&
 	echo four >file &&
 	git commit -a -m four &&
 	git clone "file://$PWD" detached-orphan
diff --git a/t/t5611-clone-config.sh b/t/t5611-clone-config.sh
index 8e0fd39823..6e10ac9a9f 100755
--- a/t/t5611-clone-config.sh
+++ b/t/t5611-clone-config.sh
@@ -47,16 +47,16 @@ test_expect_success 'clone -c config is available during clone' '
 
 test_expect_success 'clone -c remote.origin.fetch=<refspec> works' '
 	rm -rf child &&
-	git update-ref refs/grab/it refs/heads/master &&
-	git update-ref refs/leave/out refs/heads/master &&
+	git update-ref refs/grab/it refs/heads/main &&
+	git update-ref refs/leave/out refs/heads/main &&
 	git clone -c "remote.origin.fetch=+refs/grab/*:refs/grab/*" . child &&
 	git -C child for-each-ref --format="%(refname)" >actual &&
 
 	cat >expect <<-\EOF &&
 	refs/grab/it
-	refs/heads/master
+	refs/heads/main
 	refs/remotes/origin/HEAD
-	refs/remotes/origin/master
+	refs/remotes/origin/main
 	EOF
 	test_cmp expect actual
 '
@@ -68,9 +68,9 @@ test_expect_success 'git -c remote.origin.fetch=<refspec> clone works' '
 
 	cat >expect <<-\EOF &&
 	refs/grab/it
-	refs/heads/master
+	refs/heads/main
 	refs/remotes/origin/HEAD
-	refs/remotes/origin/master
+	refs/remotes/origin/main
 	EOF
 	test_cmp expect actual
 '
@@ -85,9 +85,9 @@ test_expect_success 'clone -c remote.<remote>.fetch=<refspec> --origin=<name>' '
 
 	cat >expect <<-\EOF &&
 	refs/grab/it
-	refs/heads/master
+	refs/heads/main
 	refs/remotes/upstream/HEAD
-	refs/remotes/upstream/master
+	refs/remotes/upstream/main
 	EOF
 	test_cmp expect actual
 '
diff --git a/t/t5612-clone-refspec.sh b/t/t5612-clone-refspec.sh
index e3b436d8ae..c045aba0fd 100755
--- a/t/t5612-clone-refspec.sh
+++ b/t/t5612-clone-refspec.sh
@@ -4,7 +4,7 @@ test_description='test refspec written by clone-command'
 . ./test-lib.sh
 
 test_expect_success 'setup' '
-	# Make two branches, "master" and "side"
+	# Make two branches, "main" and "side"
 	echo one >file &&
 	git add file &&
 	git commit -m one &&
@@ -16,7 +16,7 @@ test_expect_success 'setup' '
 	git checkout -b side &&
 	echo four >file &&
 	git commit -a -m four &&
-	git checkout master &&
+	git checkout main &&
 	git tag five &&
 
 	# default clone
@@ -25,18 +25,18 @@ test_expect_success 'setup' '
 	# default clone --no-tags
 	git clone --no-tags . dir_all_no_tags &&
 
-	# default --single that follows HEAD=master
-	git clone --single-branch . dir_master &&
+	# default --single that follows HEAD=main
+	git clone --single-branch . dir_main &&
 
-	# default --single that follows HEAD=master with no tags
-	git clone --single-branch --no-tags . dir_master_no_tags &&
+	# default --single that follows HEAD=main with no tags
+	git clone --single-branch --no-tags . dir_main_no_tags &&
 
 	# default --single that follows HEAD=side
 	git checkout side &&
 	git clone --single-branch . dir_side &&
 
 	# explicit --single that follows side
-	git checkout master &&
+	git checkout main &&
 	git clone --single-branch --branch side . dir_side2 &&
 
 	# default --single with --mirror
@@ -55,11 +55,11 @@ test_expect_success 'setup' '
 	# explicit --single with tag and --no-tags
 	git clone --single-branch --no-tags --branch two . dir_tag_no_tags &&
 
-	# advance both "master" and "side" branches
+	# advance both "main" and "side" branches
 	git checkout side &&
 	echo five >file &&
 	git commit -a -m five &&
-	git checkout master &&
+	git checkout main &&
 	echo six >file &&
 	git commit -a -m six &&
 
@@ -75,7 +75,7 @@ test_expect_success 'by default all branches will be kept updated' '
 		sed -e "/HEAD$/d" \
 		    -e "s|/remotes/origin/|/heads/|" refs >../actual
 	) &&
-	# follow both master and side
+	# follow both main and side
 	git for-each-ref refs/heads >expect &&
 	test_cmp expect actual
 '
@@ -100,20 +100,20 @@ test_expect_success 'clone with --no-tags' '
 	test_must_be_empty actual
 '
 
-test_expect_success '--single-branch while HEAD pointing at master' '
+test_expect_success '--single-branch while HEAD pointing at main' '
 	(
-		cd dir_master &&
+		cd dir_main &&
 		git fetch --force &&
 		git for-each-ref refs/remotes/origin >refs &&
 		sed -e "/HEAD$/d" \
 		    -e "s|/remotes/origin/|/heads/|" refs >../actual
 	) &&
-	# only follow master
-	git for-each-ref refs/heads/master >expect &&
+	# only follow main
+	git for-each-ref refs/heads/main >expect &&
 	# get & check latest tags
 	test_cmp expect actual &&
 	(
-		cd dir_master &&
+		cd dir_main &&
 		git fetch --tags --force &&
 		git for-each-ref refs/tags >../actual
 	) &&
@@ -122,20 +122,20 @@ test_expect_success '--single-branch while HEAD pointing at master' '
 	test_line_count = 2 actual
 '
 
-test_expect_success '--single-branch while HEAD pointing at master and --no-tags' '
+test_expect_success '--single-branch while HEAD pointing at main and --no-tags' '
 	(
-		cd dir_master_no_tags &&
+		cd dir_main_no_tags &&
 		git fetch &&
 		git for-each-ref refs/remotes/origin >refs &&
 		sed -e "/HEAD$/d" \
 		    -e "s|/remotes/origin/|/heads/|" refs >../actual
 	) &&
-	# only follow master
-	git for-each-ref refs/heads/master >expect &&
+	# only follow main
+	git for-each-ref refs/heads/main >expect &&
 	test_cmp expect actual &&
 	# get tags (noop)
 	(
-		cd dir_master_no_tags &&
+		cd dir_main_no_tags &&
 		git fetch &&
 		git for-each-ref refs/tags >../actual
 	) &&
@@ -143,7 +143,7 @@ test_expect_success '--single-branch while HEAD pointing at master and --no-tags
 	test_line_count = 0 actual &&
 	# get tags with --tags overrides tagOpt
 	(
-		cd dir_master_no_tags &&
+		cd dir_main_no_tags &&
 		git fetch --tags &&
 		git for-each-ref refs/tags >../actual
 	) &&
diff --git a/t/t5614-clone-submodules-shallow.sh b/t/t5614-clone-submodules-shallow.sh
index e4e6ea4d52..5504b519c7 100755
--- a/t/t5614-clone-submodules-shallow.sh
+++ b/t/t5614-clone-submodules-shallow.sh
@@ -7,7 +7,7 @@ test_description='Test shallow cloning of repos with submodules'
 pwd=$(pwd)
 
 test_expect_success 'setup' '
-	git checkout -b master &&
+	git checkout -b main &&
 	test_commit commit1 &&
 	test_commit commit2 &&
 	mkdir sub &&
diff --git a/t/t5616-partial-clone.sh b/t/t5616-partial-clone.sh
index f4d49d8335..273c0183e2 100755
--- a/t/t5616-partial-clone.sh
+++ b/t/t5616-partial-clone.sh
@@ -51,14 +51,14 @@ test_expect_success 'verify that .promisor file contains refs fetched' '
 	test_line_count = 1 promisorlist &&
 	git -C srv.bare rev-parse --verify HEAD >headhash &&
 	grep "$(cat headhash) HEAD" $(cat promisorlist) &&
-	grep "$(cat headhash) refs/heads/master" $(cat promisorlist)
+	grep "$(cat headhash) refs/heads/main" $(cat promisorlist)
 '
 
-# checkout master to force dynamic object fetch of blobs at HEAD.
+# checkout main to force dynamic object fetch of blobs at HEAD.
 test_expect_success 'verify checkout with dynamic object fetch' '
 	git -C pc1 rev-list --quiet --objects --missing=print HEAD >observed &&
 	test_line_count = 4 observed &&
-	git -C pc1 checkout master &&
+	git -C pc1 checkout main &&
 	git -C pc1 rev-list --quiet --objects --missing=print HEAD >observed &&
 	test_line_count = 0 observed
 '
@@ -73,8 +73,8 @@ test_expect_success 'push new commits to server' '
 		git -C src add file.1.txt
 		git -C src commit -m "mod $x"
 	done &&
-	git -C src blame master -- file.1.txt >expect.blame &&
-	git -C src push -u srv master
+	git -C src blame main -- file.1.txt >expect.blame &&
+	git -C src push -u srv main
 '
 
 # (partial) fetch in the partial clone repo from the promisor remote.
@@ -83,26 +83,26 @@ test_expect_success 'push new commits to server' '
 test_expect_success 'partial fetch inherits filter settings' '
 	git -C pc1 fetch origin &&
 	git -C pc1 rev-list --quiet --objects --missing=print \
-		master..origin/master >observed &&
+		main..origin/main >observed &&
 	test_line_count = 5 observed
 '
 
 # force dynamic object fetch using diff.
-# we should only get 1 new blob (for the file in origin/master).
+# we should only get 1 new blob (for the file in origin/main).
 test_expect_success 'verify diff causes dynamic object fetch' '
-	git -C pc1 diff master..origin/master -- file.1.txt &&
+	git -C pc1 diff main..origin/main -- file.1.txt &&
 	git -C pc1 rev-list --quiet --objects --missing=print \
-		 master..origin/master >observed &&
+		 main..origin/main >observed &&
 	test_line_count = 4 observed
 '
 
 # force full dynamic object fetch of the file's history using blame.
 # we should get the intermediate blobs for the file.
 test_expect_success 'verify blame causes dynamic object fetch' '
-	git -C pc1 blame origin/master -- file.1.txt >observed.blame &&
+	git -C pc1 blame origin/main -- file.1.txt >observed.blame &&
 	test_cmp expect.blame observed.blame &&
 	git -C pc1 rev-list --quiet --objects --missing=print \
-		master..origin/master >observed &&
+		main..origin/main >observed &&
 	test_line_count = 0 observed
 '
 
@@ -115,7 +115,7 @@ test_expect_success 'push new commits to server for file.2.txt' '
 		git -C src add file.2.txt
 		git -C src commit -m "mod $x"
 	done &&
-	git -C src push -u srv master
+	git -C src push -u srv main
 '
 
 # Do FULL fetch by disabling inherited filter-spec using --no-filter.
@@ -123,7 +123,7 @@ test_expect_success 'push new commits to server for file.2.txt' '
 test_expect_success 'override inherited filter-spec using --no-filter' '
 	git -C pc1 fetch --no-filter origin &&
 	git -C pc1 rev-list --quiet --objects --missing=print \
-		master..origin/master >observed &&
+		main..origin/main >observed &&
 	test_line_count = 0 observed
 '
 
@@ -136,7 +136,7 @@ test_expect_success 'push new commits to server for file.3.txt' '
 		git -C src add file.3.txt
 		git -C src commit -m "mod $x"
 	done &&
-	git -C src push -u srv master
+	git -C src push -u srv main
 '
 
 # Do a partial fetch and then try to manually fetch the missing objects.
@@ -146,7 +146,7 @@ test_expect_success 'manual prefetch of missing objects' '
 	git -C pc1 fetch --filter=blob:none origin &&
 
 	git -C pc1 rev-list --quiet --objects --missing=print \
-		 master..origin/master >revs &&
+		 main..origin/main >revs &&
 	awk -f print_1.awk revs |
 	sed "s/?//" |
 	sort >observed.oids &&
@@ -155,7 +155,7 @@ test_expect_success 'manual prefetch of missing objects' '
 	git -C pc1 fetch-pack --stdin "file://$(pwd)/srv.bare" <observed.oids &&
 
 	git -C pc1 rev-list --quiet --objects --missing=print \
-		master..origin/master >revs &&
+		main..origin/main >revs &&
 	awk -f print_1.awk revs |
 	sed "s/?//" |
 	sort >observed.oids &&
@@ -196,7 +196,7 @@ test_expect_success 'use fsck before and after manually fetching a missing subtr
 	echo "in dir" >src/dir/file.txt &&
 	git -C src add dir/file.txt &&
 	git -C src commit -m "file in dir" &&
-	git -C src push -u srv master &&
+	git -C src push -u srv main &&
 	SUBTREE=$(git -C src rev-parse HEAD:dir) &&
 
 	rm -rf dst &&
@@ -204,7 +204,7 @@ test_expect_success 'use fsck before and after manually fetching a missing subtr
 	git -C dst fsck &&
 
 	# Make sure we only have commits, and all trees and blobs are missing.
-	git -C dst rev-list --missing=allow-any --objects master \
+	git -C dst rev-list --missing=allow-any --objects main \
 		>fetched_objects &&
 	awk -f print_1.awk fetched_objects |
 	xargs -n1 git -C dst cat-file -t >fetched_types &&
@@ -221,7 +221,7 @@ test_expect_success 'use fsck before and after manually fetching a missing subtr
 	git -C dst fsck &&
 
 	# Auto-fetch all remaining trees and blobs with --missing=error
-	git -C dst rev-list --missing=error --objects master >fetched_objects &&
+	git -C dst rev-list --missing=error --objects main >fetched_objects &&
 	test_line_count = 70 fetched_objects &&
 
 	awk -f print_1.awk fetched_objects |
@@ -331,7 +331,7 @@ test_expect_success 'setup src repo for sparse filter' '
 test_expect_success 'partial clone with sparse filter succeeds' '
 	rm -rf dst.git &&
 	git clone --no-local --bare \
-		  --filter=sparse:oid=master:only-one \
+		  --filter=sparse:oid=main:only-one \
 		  sparse-src dst.git &&
 	(
 		cd dst.git &&
@@ -344,11 +344,11 @@ test_expect_success 'partial clone with sparse filter succeeds' '
 test_expect_success 'partial clone with unresolvable sparse filter fails cleanly' '
 	rm -rf dst.git &&
 	test_must_fail git clone --no-local --bare \
-				 --filter=sparse:oid=master:no-such-name \
+				 --filter=sparse:oid=main:no-such-name \
 				 sparse-src dst.git 2>err &&
-	test_i18ngrep "unable to access sparse blob in .master:no-such-name" err &&
+	test_i18ngrep "unable to access sparse blob in .main:no-such-name" err &&
 	test_must_fail git clone --no-local --bare \
-				 --filter=sparse:oid=master \
+				 --filter=sparse:oid=main \
 				 sparse-src dst.git 2>err &&
 	test_i18ngrep "unable to parse sparse filter data in" err
 '
@@ -403,7 +403,7 @@ test_expect_success 'fetch lazy-fetches only to resolve deltas' '
 	# promisor remote other than for the big tree (because it needs to
 	# resolve the delta).
 	GIT_TRACE_PACKET="$(pwd)/trace" git -C client \
-		fetch "file://$(pwd)/server" master &&
+		fetch "file://$(pwd)/server" main &&
 
 	# Verify the assumption that the client needed to fetch the delta base
 	# to resolve the delta.
@@ -422,7 +422,7 @@ test_expect_success 'fetch lazy-fetches only to resolve deltas, protocol v2' '
 	# promisor remote other than for the big blob (because it needs to
 	# resolve the delta).
 	GIT_TRACE_PACKET="$(pwd)/trace" git -C client \
-		fetch "file://$(pwd)/server" master &&
+		fetch "file://$(pwd)/server" main &&
 
 	# Verify that protocol version 2 was used.
 	grep "fetch< version 2" trace &&
diff --git a/t/t5617-clone-submodules-remote.sh b/t/t5617-clone-submodules-remote.sh
index 1a041df10b..abab358119 100755
--- a/t/t5617-clone-submodules-remote.sh
+++ b/t/t5617-clone-submodules-remote.sh
@@ -7,7 +7,7 @@ test_description='Test cloning repos with submodules using remote-tracking branc
 pwd=$(pwd)
 
 test_expect_success 'setup' '
-	git checkout -b master &&
+	git checkout -b main &&
 	test_commit commit1 &&
 	mkdir sub &&
 	(
@@ -39,7 +39,7 @@ test_expect_success 'clone with --remote-submodules' '
 	git clone --recurse-submodules --remote-submodules "file://$pwd/." super_clone &&
 	(
 		cd super_clone/sub &&
-		git diff --exit-code remotes/origin/master
+		git diff --exit-code remotes/origin/main
 	)
 '
 
@@ -57,7 +57,7 @@ test_expect_success 'clone with --single-branch' '
 	git clone --recurse-submodules --single-branch "file://$pwd/." super_clone &&
 	(
 		cd super_clone/sub &&
-		git rev-parse --verify origin/master &&
+		git rev-parse --verify origin/main &&
 		test_must_fail git rev-parse --verify origin/other
 	)
 '
diff --git a/t/t5700-protocol-v1.sh b/t/t5700-protocol-v1.sh
index 022901b9eb..bfa7e3379a 100755
--- a/t/t5700-protocol-v1.sh
+++ b/t/t5700-protocol-v1.sh
@@ -41,7 +41,7 @@ test_expect_success 'fetch with git:// using protocol v1' '
 	GIT_TRACE_PACKET=1 git -C daemon_child -c protocol.version=1 \
 		fetch 2>log &&
 
-	git -C daemon_child log -1 --format=%s origin/master >actual &&
+	git -C daemon_child log -1 --format=%s origin/main >actual &&
 	git -C "$daemon_parent" log -1 --format=%s >expect &&
 	test_cmp expect actual &&
 
@@ -69,7 +69,7 @@ test_expect_success 'push with git:// using protocol v1' '
 	test_commit -C daemon_child three &&
 
 	# Push to another branch, as the target repository has the
-	# master branch checked out and we cannot push into it.
+	# main branch checked out and we cannot push into it.
 	GIT_TRACE_PACKET=1 git -C daemon_child -c protocol.version=1 \
 		push origin HEAD:client_branch 2>log &&
 
@@ -110,7 +110,7 @@ test_expect_success 'fetch with file:// using protocol v1' '
 	GIT_TRACE_PACKET=1 git -C file_child -c protocol.version=1 \
 		fetch 2>log &&
 
-	git -C file_child log -1 --format=%s origin/master >actual &&
+	git -C file_child log -1 --format=%s origin/main >actual &&
 	git -C file_parent log -1 --format=%s >expect &&
 	test_cmp expect actual &&
 
@@ -134,7 +134,7 @@ test_expect_success 'push with file:// using protocol v1' '
 	test_commit -C file_child three &&
 
 	# Push to another branch, as the target repository has the
-	# master branch checked out and we cannot push into it.
+	# main branch checked out and we cannot push into it.
 	GIT_TRACE_PACKET=1 git -C file_child -c protocol.version=1 \
 		push origin HEAD:client_branch 2>log &&
 
@@ -188,7 +188,7 @@ test_expect_success 'fetch with ssh:// using protocol v1' '
 		fetch 2>log &&
 	expect_ssh git-upload-pack &&
 
-	git -C ssh_child log -1 --format=%s origin/master >actual &&
+	git -C ssh_child log -1 --format=%s origin/main >actual &&
 	git -C ssh_parent log -1 --format=%s >expect &&
 	test_cmp expect actual &&
 
@@ -213,7 +213,7 @@ test_expect_success 'push with ssh:// using protocol v1' '
 	test_commit -C ssh_child three &&
 
 	# Push to another branch, as the target repository has the
-	# master branch checked out and we cannot push into it.
+	# main branch checked out and we cannot push into it.
 	GIT_TRACE_PACKET=1 git -C ssh_child -c protocol.version=1 \
 		push origin HEAD:client_branch 2>log &&
 	expect_ssh git-receive-pack &&
@@ -257,7 +257,7 @@ test_expect_success 'fetch with http:// using protocol v1' '
 	GIT_TRACE_PACKET=1 git -C http_child -c protocol.version=1 \
 		fetch 2>log &&
 
-	git -C http_child log -1 --format=%s origin/master >actual &&
+	git -C http_child log -1 --format=%s origin/main >actual &&
 	git -C "$HTTPD_DOCUMENT_ROOT_PATH/http_parent" log -1 --format=%s >expect &&
 	test_cmp expect actual &&
 
@@ -281,7 +281,7 @@ test_expect_success 'push with http:// using protocol v1' '
 	test_commit -C http_child three &&
 
 	# Push to another branch, as the target repository has the
-	# master branch checked out and we cannot push into it.
+	# main branch checked out and we cannot push into it.
 	GIT_TRACE_PACKET=1 git -C http_child -c protocol.version=1 \
 		push origin HEAD:client_branch && #2>log &&
 
diff --git a/t/t5701-git-serve.sh b/t/t5701-git-serve.sh
index a1f5fdc9fd..3a04a56c2c 100755
--- a/t/t5701-git-serve.sh
+++ b/t/t5701-git-serve.sh
@@ -83,9 +83,9 @@ test_expect_success 'wrong object-format' '
 #
 test_expect_success 'setup some refs and tags' '
 	test_commit one &&
-	git branch dev master &&
+	git branch dev main &&
 	test_commit two &&
-	git symbolic-ref refs/heads/release refs/heads/master &&
+	git symbolic-ref refs/heads/release refs/heads/main &&
 	git tag -a -m "annotated tag" annotated-tag
 '
 
@@ -99,7 +99,7 @@ test_expect_success 'basics of ls-refs' '
 	cat >expect <<-EOF &&
 	$(git rev-parse HEAD) HEAD
 	$(git rev-parse refs/heads/dev) refs/heads/dev
-	$(git rev-parse refs/heads/master) refs/heads/master
+	$(git rev-parse refs/heads/main) refs/heads/main
 	$(git rev-parse refs/heads/release) refs/heads/release
 	$(git rev-parse refs/tags/annotated-tag) refs/tags/annotated-tag
 	$(git rev-parse refs/tags/one) refs/tags/one
@@ -117,13 +117,13 @@ test_expect_success 'basic ref-prefixes' '
 	command=ls-refs
 	object-format=$(test_oid algo)
 	0001
-	ref-prefix refs/heads/master
+	ref-prefix refs/heads/main
 	ref-prefix refs/tags/one
 	0000
 	EOF
 
 	cat >expect <<-EOF &&
-	$(git rev-parse refs/heads/master) refs/heads/master
+	$(git rev-parse refs/heads/main) refs/heads/main
 	$(git rev-parse refs/tags/one) refs/tags/one
 	0000
 	EOF
@@ -144,7 +144,7 @@ test_expect_success 'refs/heads prefix' '
 
 	cat >expect <<-EOF &&
 	$(git rev-parse refs/heads/dev) refs/heads/dev
-	$(git rev-parse refs/heads/master) refs/heads/master
+	$(git rev-parse refs/heads/main) refs/heads/main
 	$(git rev-parse refs/heads/release) refs/heads/release
 	0000
 	EOF
@@ -188,8 +188,8 @@ test_expect_success 'symrefs parameter' '
 
 	cat >expect <<-EOF &&
 	$(git rev-parse refs/heads/dev) refs/heads/dev
-	$(git rev-parse refs/heads/master) refs/heads/master
-	$(git rev-parse refs/heads/release) refs/heads/release symref-target:refs/heads/master
+	$(git rev-parse refs/heads/main) refs/heads/main
+	$(git rev-parse refs/heads/release) refs/heads/release symref-target:refs/heads/main
 	0000
 	EOF
 
diff --git a/t/t5702-protocol-v2.sh b/t/t5702-protocol-v2.sh
index 7d5b17909b..1aeb6b6dd7 100755
--- a/t/t5702-protocol-v2.sh
+++ b/t/t5702-protocol-v2.sh
@@ -36,10 +36,10 @@ test_expect_success 'ref advertisement is filtered with ls-remote using protocol
 	test_when_finished "rm -f log" &&
 
 	GIT_TRACE_PACKET="$(pwd)/log" git -c protocol.version=2 \
-		ls-remote "$GIT_DAEMON_URL/parent" master >actual &&
+		ls-remote "$GIT_DAEMON_URL/parent" main >actual &&
 
 	cat >expect <<-EOF &&
-	$(git -C "$daemon_parent" rev-parse refs/heads/master)$(printf "\t")refs/heads/master
+	$(git -C "$daemon_parent" rev-parse refs/heads/main)$(printf "\t")refs/heads/main
 	EOF
 
 	test_cmp expect actual
@@ -69,7 +69,7 @@ test_expect_success 'fetch with git:// using protocol v2' '
 	GIT_TRACE_PACKET="$(pwd)/log" git -C daemon_child -c protocol.version=2 \
 		fetch &&
 
-	git -C daemon_child log -1 --format=%s origin/master >actual &&
+	git -C daemon_child log -1 --format=%s origin/main >actual &&
 	git -C "$daemon_parent" log -1 --format=%s >expect &&
 	test_cmp expect actual &&
 
@@ -118,7 +118,7 @@ test_expect_success 'push with git:// and a config of v2 does not request v2' '
 	test_commit -C daemon_child three &&
 
 	# Push to another branch, as the target repository has the
-	# master branch checked out and we cannot push into it.
+	# main branch checked out and we cannot push into it.
 	GIT_TRACE_PACKET="$(pwd)/log" git -C daemon_child -c protocol.version=2 \
 		push origin HEAD:client_branch &&
 
@@ -158,10 +158,10 @@ test_expect_success 'ref advertisement is filtered with ls-remote using protocol
 	test_when_finished "rm -f log" &&
 
 	GIT_TRACE_PACKET="$(pwd)/log" git -c protocol.version=2 \
-		ls-remote "file://$(pwd)/file_parent" master >actual &&
+		ls-remote "file://$(pwd)/file_parent" main >actual &&
 
 	cat >expect <<-EOF &&
-	$(git -C file_parent rev-parse refs/heads/master)$(printf "\t")refs/heads/master
+	$(git -C file_parent rev-parse refs/heads/main)$(printf "\t")refs/heads/main
 	EOF
 
 	test_cmp expect actual
@@ -171,10 +171,10 @@ test_expect_success 'server-options are sent when using ls-remote' '
 	test_when_finished "rm -f log" &&
 
 	GIT_TRACE_PACKET="$(pwd)/log" git -c protocol.version=2 \
-		ls-remote -o hello -o world "file://$(pwd)/file_parent" master >actual &&
+		ls-remote -o hello -o world "file://$(pwd)/file_parent" main >actual &&
 
 	cat >expect <<-EOF &&
-	$(git -C file_parent rev-parse refs/heads/master)$(printf "\t")refs/heads/master
+	$(git -C file_parent rev-parse refs/heads/main)$(printf "\t")refs/heads/main
 	EOF
 
 	test_cmp expect actual &&
@@ -184,7 +184,7 @@ test_expect_success 'server-options are sent when using ls-remote' '
 
 test_expect_success 'warn if using server-option with ls-remote with legacy protocol' '
 	test_must_fail env GIT_TEST_PROTOCOL_VERSION=0 git -c protocol.version=0 \
-		ls-remote -o hello -o world "file://$(pwd)/file_parent" master 2>err &&
+		ls-remote -o hello -o world "file://$(pwd)/file_parent" main 2>err &&
 
 	test_i18ngrep "see protocol.version in" err &&
 	test_i18ngrep "server options require protocol version 2 or later" err
@@ -217,7 +217,7 @@ test_expect_success 'fetch with file:// using protocol v2' '
 	GIT_TRACE_PACKET="$(pwd)/log" git -C file_child -c protocol.version=2 \
 		fetch origin &&
 
-	git -C file_child log -1 --format=%s origin/master >actual &&
+	git -C file_child log -1 --format=%s origin/main >actual &&
 	git -C file_parent log -1 --format=%s >expect &&
 	test_cmp expect actual &&
 
@@ -232,13 +232,13 @@ test_expect_success 'ref advertisement is filtered during fetch using protocol v
 	git -C file_parent branch unwanted-branch three &&
 
 	GIT_TRACE_PACKET="$(pwd)/log" git -C file_child -c protocol.version=2 \
-		fetch origin master &&
+		fetch origin main &&
 
-	git -C file_child log -1 --format=%s origin/master >actual &&
+	git -C file_child log -1 --format=%s origin/main >actual &&
 	git -C file_parent log -1 --format=%s >expect &&
 	test_cmp expect actual &&
 
-	grep "refs/heads/master" log &&
+	grep "refs/heads/main" log &&
 	! grep "refs/heads/unwanted-branch" log
 '
 
@@ -248,9 +248,9 @@ test_expect_success 'server-options are sent when fetching' '
 	test_commit -C file_parent four &&
 
 	GIT_TRACE_PACKET="$(pwd)/log" git -C file_child -c protocol.version=2 \
-		fetch -o hello -o world origin master &&
+		fetch -o hello -o world origin main &&
 
-	git -C file_child log -1 --format=%s origin/master >actual &&
+	git -C file_child log -1 --format=%s origin/main >actual &&
 	git -C file_parent log -1 --format=%s >expect &&
 	test_cmp expect actual &&
 
@@ -264,7 +264,7 @@ test_expect_success 'warn if using server-option with fetch with legacy protocol
 	git init temp_child &&
 
 	test_must_fail env GIT_TEST_PROTOCOL_VERSION=0 git -C temp_child -c protocol.version=0 \
-		fetch -o hello -o world "file://$(pwd)/file_parent" master 2>err &&
+		fetch -o hello -o world "file://$(pwd)/file_parent" main 2>err &&
 
 	test_i18ngrep "see protocol.version in" err &&
 	test_i18ngrep "server options require protocol version 2 or later" err
@@ -325,7 +325,7 @@ test_expect_success 'partial clone' '
 	grep "version 2" trace &&
 
 	# Ensure that the old version of the file is missing
-	git -C client rev-list --quiet --objects --missing=print master \
+	git -C client rev-list --quiet --objects --missing=print main \
 		>observed.oids &&
 	grep "$(git -C server rev-parse message1:a.txt)" observed.oids &&
 
@@ -350,7 +350,7 @@ test_expect_success 'partial fetch' '
 	SERVER="file://$(pwd)/server" &&
 
 	GIT_TRACE_PACKET="$(pwd)/trace" git -C client -c protocol.version=2 \
-		fetch --filter=blob:none "$SERVER" master:refs/heads/other &&
+		fetch --filter=blob:none "$SERVER" main:refs/heads/other &&
 	grep "version 2" trace &&
 
 	# Ensure that the old version of the file is missing
@@ -395,7 +395,7 @@ test_expect_success 'even with handcrafted request, filter does not work if not
 	command=fetch
 	object-format=$(test_oid algo)
 	0001
-	want $(git -C server rev-parse master)
+	want $(git -C server rev-parse main)
 	filter blob:none
 	0000
 	EOF
@@ -539,7 +539,7 @@ test_expect_success 'deepen-relative' '
 	test_commit -C server four &&
 
 	# Sanity check that only "three" is downloaded
-	git -C client log --pretty=tformat:%s master >actual &&
+	git -C client log --pretty=tformat:%s main >actual &&
 	echo three >expected &&
 	test_cmp expected actual &&
 
@@ -548,7 +548,7 @@ test_expect_success 'deepen-relative' '
 	# Ensure that protocol v2 is used
 	grep "fetch< version 2" trace &&
 
-	git -C client log --pretty=tformat:%s origin/master >actual &&
+	git -C client log --pretty=tformat:%s origin/main >actual &&
 	cat >expected <<-\EOF &&
 	four
 	three
@@ -670,7 +670,7 @@ test_expect_success 'fetch with http:// using protocol v2' '
 	GIT_TRACE_PACKET="$(pwd)/log" git -C http_child -c protocol.version=2 \
 		fetch &&
 
-	git -C http_child log -1 --format=%s origin/master >actual &&
+	git -C http_child log -1 --format=%s origin/main >actual &&
 	git -C "$HTTPD_DOCUMENT_ROOT_PATH/http_parent" log -1 --format=%s >expect &&
 	test_cmp expect actual &&
 
@@ -698,11 +698,11 @@ test_expect_success 'fetch from namespaced repo respects namespaces' '
 	test_commit -C "$HTTPD_DOCUMENT_ROOT_PATH/nsrepo" one &&
 	test_commit -C "$HTTPD_DOCUMENT_ROOT_PATH/nsrepo" two &&
 	git -C "$HTTPD_DOCUMENT_ROOT_PATH/nsrepo" \
-		update-ref refs/namespaces/ns/refs/heads/master one &&
+		update-ref refs/namespaces/ns/refs/heads/main one &&
 
 	GIT_TRACE_PACKET="$(pwd)/log" git -C http_child -c protocol.version=2 \
 		fetch "$HTTPD_URL/smart_namespace/nsrepo" \
-		refs/heads/master:refs/heads/theirs &&
+		refs/heads/main:refs/heads/theirs &&
 
 	# Server responded using protocol v2
 	grep "fetch< version 2" log &&
@@ -733,7 +733,7 @@ test_expect_success 'push with http:// and a config of v2 does not request v2' '
 	test_commit -C http_child three &&
 
 	# Push to another branch, as the target repository has the
-	# master branch checked out and we cannot push into it.
+	# main branch checked out and we cannot push into it.
 	GIT_TRACE_PACKET="$(pwd)/log" git -C http_child -c protocol.version=2 \
 		push origin HEAD:client_branch &&
 
diff --git a/t/t5703-upload-pack-ref-in-want.sh b/t/t5703-upload-pack-ref-in-want.sh
index b46940b725..bbf03a8f66 100755
--- a/t/t5703-upload-pack-ref-in-want.sh
+++ b/t/t5703-upload-pack-ref-in-want.sh
@@ -38,7 +38,7 @@ write_command () {
 
 # c(o/foo) d(o/bar)
 #        \ /
-#         b   e(baz)  f(master)
+#         b   e(baz)  f(main)
 #          \__  |  __/
 #             \ | /
 #               a
@@ -51,7 +51,7 @@ test_expect_success 'setup repository' '
 	test_commit d &&
 	git checkout -b baz a &&
 	test_commit e &&
-	git checkout master &&
+	git checkout main &&
 	test_commit f
 '
 
@@ -88,7 +88,7 @@ test_expect_success 'invalid want-ref line' '
 test_expect_success 'basic want-ref' '
 	oid=$(git rev-parse f) &&
 	cat >expected_refs <<-EOF &&
-	$oid refs/heads/master
+	$oid refs/heads/main
 	EOF
 	git rev-parse f >expected_commits &&
 
@@ -97,7 +97,7 @@ test_expect_success 'basic want-ref' '
 	$(write_command fetch)
 	0001
 	no-progress
-	want-ref refs/heads/master
+	want-ref refs/heads/main
 	have $oid
 	done
 	0000
@@ -135,7 +135,7 @@ test_expect_success 'multiple want-ref lines' '
 test_expect_success 'mix want and want-ref' '
 	oid=$(git rev-parse f) &&
 	cat >expected_refs <<-EOF &&
-	$oid refs/heads/master
+	$oid refs/heads/main
 	EOF
 	git rev-parse e f >expected_commits &&
 
@@ -143,7 +143,7 @@ test_expect_success 'mix want and want-ref' '
 	$(write_command fetch)
 	0001
 	no-progress
-	want-ref refs/heads/master
+	want-ref refs/heads/main
 	want $(git rev-parse e)
 	have $(git rev-parse a)
 	done
@@ -182,7 +182,7 @@ LOCAL_PRISTINE="$(pwd)/local_pristine"
 # $REPO
 # c(o/foo) d(o/bar)
 #        \ /
-#         b   e(baz)  f(master)
+#         b   e(baz)  f(main)
 #          \__  |  __/
 #             \ | /
 #               a
@@ -193,7 +193,7 @@ LOCAL_PRISTINE="$(pwd)/local_pristine"
 #		.
 #		.
 #		|
-#		a(master)
+#		a(main)
 test_expect_success 'setup repos for fetching with ref-in-want tests' '
 	(
 		git init "$REPO" &&
@@ -209,7 +209,7 @@ test_expect_success 'setup repos for fetching with ref-in-want tests' '
 		test_commit_bulk --id=s 33 &&
 
 		# Add novel commits to upstream
-		git checkout master &&
+		git checkout main &&
 		cd "$REPO" &&
 		git checkout -b o/foo &&
 		test_commit b &&
@@ -218,7 +218,7 @@ test_expect_success 'setup repos for fetching with ref-in-want tests' '
 		test_commit d &&
 		git checkout -b baz a &&
 		test_commit e &&
-		git checkout master &&
+		git checkout main &&
 		test_commit f
 	) &&
 	git -C "$REPO" config uploadpack.allowRefInWant true &&
@@ -245,12 +245,12 @@ test_expect_success 'fetching multiple refs' '
 
 	rm -rf local &&
 	cp -r "$LOCAL_PRISTINE" local &&
-	GIT_TRACE_PACKET="$(pwd)/log" git -C local fetch origin master baz &&
+	GIT_TRACE_PACKET="$(pwd)/log" git -C local fetch origin main baz &&
 
-	git -C "$REPO" rev-parse "master" "baz" >expected &&
-	git -C local rev-parse refs/remotes/origin/master refs/remotes/origin/baz >actual &&
+	git -C "$REPO" rev-parse "main" "baz" >expected &&
+	git -C local rev-parse refs/remotes/origin/main refs/remotes/origin/baz >actual &&
 	test_cmp expected actual &&
-	grep "want-ref refs/heads/master" log &&
+	grep "want-ref refs/heads/main" log &&
 	grep "want-ref refs/heads/baz" log
 '
 
@@ -261,13 +261,13 @@ test_expect_success 'fetching ref and exact OID' '
 	cp -r "$LOCAL_PRISTINE" local &&
 	oid=$(git -C "$REPO" rev-parse b) &&
 	GIT_TRACE_PACKET="$(pwd)/log" git -C local fetch origin \
-		master "$oid":refs/heads/actual &&
+		main "$oid":refs/heads/actual &&
 
-	git -C "$REPO" rev-parse "master" "b" >expected &&
-	git -C local rev-parse refs/remotes/origin/master refs/heads/actual >actual &&
+	git -C "$REPO" rev-parse "main" "b" >expected &&
+	git -C local rev-parse refs/remotes/origin/main refs/heads/actual >actual &&
 	test_cmp expected actual &&
 	grep "want $oid" log &&
-	grep "want-ref refs/heads/master" log
+	grep "want-ref refs/heads/main" log
 '
 
 test_expect_success 'fetching with wildcard that does not match any refs' '
@@ -316,7 +316,7 @@ test_expect_success 'setup repos for change-while-negotiating test' '
 		test_commit_bulk --id=s 33 &&
 
 		# Add novel commits to upstream
-		git checkout master &&
+		git checkout main &&
 		cd "$REPO" &&
 		test_commit m2 &&
 		test_commit m3 &&
@@ -342,7 +342,7 @@ test_expect_success 'server is initially ahead - no ref in want' '
 	git -C "$REPO" config uploadpack.allowRefInWant false &&
 	rm -rf local &&
 	cp -r "$LOCAL_PRISTINE" local &&
-	inconsistency master $(test_oid numeric) &&
+	inconsistency main $(test_oid numeric) &&
 	test_must_fail git -C local fetch 2>err &&
 	test_i18ngrep "fatal: remote error: upload-pack: not our ref" err
 '
@@ -351,11 +351,11 @@ test_expect_success 'server is initially ahead - ref in want' '
 	git -C "$REPO" config uploadpack.allowRefInWant true &&
 	rm -rf local &&
 	cp -r "$LOCAL_PRISTINE" local &&
-	inconsistency master $(test_oid numeric) &&
+	inconsistency main $(test_oid numeric) &&
 	git -C local fetch &&
 
-	git -C "$REPO" rev-parse --verify master >expected &&
-	git -C local rev-parse --verify refs/remotes/origin/master >actual &&
+	git -C "$REPO" rev-parse --verify main >expected &&
+	git -C local rev-parse --verify refs/remotes/origin/main >actual &&
 	test_cmp expected actual
 '
 
@@ -363,11 +363,11 @@ test_expect_success 'server is initially behind - no ref in want' '
 	git -C "$REPO" config uploadpack.allowRefInWant false &&
 	rm -rf local &&
 	cp -r "$LOCAL_PRISTINE" local &&
-	inconsistency master "master^" &&
+	inconsistency main "main^" &&
 	git -C local fetch &&
 
-	git -C "$REPO" rev-parse --verify "master^" >expected &&
-	git -C local rev-parse --verify refs/remotes/origin/master >actual &&
+	git -C "$REPO" rev-parse --verify "main^" >expected &&
+	git -C local rev-parse --verify refs/remotes/origin/main >actual &&
 	test_cmp expected actual
 '
 
@@ -375,11 +375,11 @@ test_expect_success 'server is initially behind - ref in want' '
 	git -C "$REPO" config uploadpack.allowRefInWant true &&
 	rm -rf local &&
 	cp -r "$LOCAL_PRISTINE" local &&
-	inconsistency master "master^" &&
+	inconsistency main "main^" &&
 	git -C local fetch &&
 
-	git -C "$REPO" rev-parse --verify "master" >expected &&
-	git -C local rev-parse --verify refs/remotes/origin/master >actual &&
+	git -C "$REPO" rev-parse --verify "main" >expected &&
+	git -C local rev-parse --verify refs/remotes/origin/main >actual &&
 	test_cmp expected actual
 '
 
diff --git a/t/t5801-remote-helpers.sh b/t/t5801-remote-helpers.sh
index 0f04b6cddb..306fe9e5e1 100755
--- a/t/t5801-remote-helpers.sh
+++ b/t/t5801-remote-helpers.sh
@@ -71,18 +71,18 @@ test_expect_success 'fetch multiple branches' '
 	(cd local &&
 	 git fetch
 	) &&
-	compare_refs server master local refs/remotes/origin/master &&
+	compare_refs server main local refs/remotes/origin/main &&
 	compare_refs server new local refs/remotes/origin/new
 '
 
 test_expect_success 'push when remote has extra refs' '
 	(cd local &&
-	 git reset --hard origin/master &&
+	 git reset --hard origin/main &&
 	 echo content >>file &&
 	 git commit -a -m six &&
 	 git push
 	) &&
-	compare_refs local master server master
+	compare_refs local main server main
 '
 
 test_expect_success 'push new branch by name' '
@@ -174,7 +174,7 @@ test_expect_failure 'pushing without marks' '
 
 test_expect_success 'push all with existing object' '
 	(cd local &&
-	git branch dup2 master &&
+	git branch dup2 main &&
 	git push origin --all
 	) &&
 	compare_refs local dup2 server dup2
@@ -182,7 +182,7 @@ test_expect_success 'push all with existing object' '
 
 test_expect_success 'push ref with existing object' '
 	(cd local &&
-	git branch dup master &&
+	git branch dup main &&
 	git push origin dup
 	) &&
 	compare_refs local dup server dup
@@ -190,7 +190,7 @@ test_expect_success 'push ref with existing object' '
 
 test_expect_success GPG 'push signed tag' '
 	(cd local &&
-	git checkout master &&
+	git checkout main &&
 	git tag -s -m signed-tag signed-tag &&
 	git push origin signed-tag
 	) &&
@@ -200,7 +200,7 @@ test_expect_success GPG 'push signed tag' '
 
 test_expect_success GPG 'push signed tag with signed-tags capability' '
 	(cd local &&
-	git checkout master &&
+	git checkout main &&
 	git tag -s -m signed-tag signed-tag-2 &&
 	GIT_REMOTE_TESTGIT_SIGNED_TAGS=1 git push origin signed-tag-2
 	) &&
@@ -209,7 +209,7 @@ test_expect_success GPG 'push signed tag with signed-tags capability' '
 
 test_expect_success 'push update refs' '
 	(cd local &&
-	git checkout -b update master &&
+	git checkout -b update main &&
 	echo update >>file &&
 	git commit -a -m update &&
 	git push origin update &&
@@ -260,7 +260,7 @@ test_expect_success 'proper failure checks for fetching' '
 test_expect_success 'proper failure checks for pushing' '
 	test_when_finished "rm -rf local/git.marks local/testgit.marks" &&
 	(cd local &&
-	git checkout -b crash master &&
+	git checkout -b crash main &&
 	echo crash >>file &&
 	git commit -a -m crash &&
 	test_must_fail env GIT_REMOTE_TESTGIT_FAILURE=1 git push --all &&
@@ -272,7 +272,7 @@ test_expect_success 'proper failure checks for pushing' '
 
 test_expect_success 'push messages' '
 	(cd local &&
-	git checkout -b new_branch master &&
+	git checkout -b new_branch main &&
 	echo new >>file &&
 	git commit -a -m new &&
 	git push origin new_branch &&
@@ -286,7 +286,7 @@ test_expect_success 'push messages' '
 
 test_expect_success 'fetch HEAD' '
 	(cd server &&
-	git checkout master &&
+	git checkout main &&
 	echo more >>file &&
 	git commit -a -m more
 	) &&
@@ -298,7 +298,7 @@ test_expect_success 'fetch HEAD' '
 
 test_expect_success 'fetch url' '
 	(cd server &&
-	git checkout master &&
+	git checkout main &&
 	echo more >>file &&
 	git commit -a -m more
 	) &&
diff --git a/t/test-lib.sh b/t/test-lib.sh
index f919021063..a78ff1e57e 100644
--- a/t/test-lib.sh
+++ b/t/test-lib.sh
@@ -263,7 +263,7 @@ case "$TEST_NUMBER" in
 	GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
 	export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 	;;
-[0-4]*|5[0-5]*)
+[0-5]*)
 	GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 	export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 	;;
-- 
gitgitgadget


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH 17/28] t6[0-3]*: adjust the references to the default branch name "main"
  2020-11-12 22:43 [PATCH 00/28] Use main as default branch name Johannes Schindelin via GitGitGadget
                   ` (15 preceding siblings ...)
  2020-11-12 22:43 ` [PATCH 16/28] t5[6-9]*: " Johannes Schindelin via GitGitGadget
@ 2020-11-12 22:43 ` Johannes Schindelin via GitGitGadget
  2020-11-12 22:43 ` [PATCH 18/28] t64*: preemptively adjust alignment to prepare for `master` -> `main` Johannes Schindelin via GitGitGadget
                   ` (15 subsequent siblings)
  32 siblings, 0 replies; 163+ messages in thread
From: Johannes Schindelin via GitGitGadget @ 2020-11-12 22:43 UTC (permalink / raw)
  To: git; +Cc: Johannes Schindelin, Johannes Schindelin

From: Johannes Schindelin <johannes.schindelin@gmx.de>

Carefully excluding t6300, which sees independent development elsewhere
at the time of writing, we use `main` as the default branch name in
t6[0-3]*. This trick was performed via

	$ (cd t &&
	   sed -i -e 's/master/main/g' -e 's/MASTER/MAIN/g' \
		-e 's/Master/Main/g' -- t6[0-3]*.sh &&
	   git checkout HEAD -- t6300\*)

This allows us to define `GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main`
for those tests.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
---
 t/t6000-rev-list-misc.sh                   |  2 +-
 t/t6001-rev-list-graft.sh                  |  2 +-
 t/t6004-rev-list-path-optim.sh             | 14 +++---
 t/t6006-rev-list-format.sh                 | 14 +++---
 t/t6007-rev-list-cherry-pick-file.sh       |  4 +-
 t/t6008-rev-list-submodule.sh              |  2 +-
 t/t6009-rev-list-parent.sh                 |  6 +--
 t/t6012-rev-list-simplify.sh               |  8 ++--
 t/t6013-rev-list-reverse-parents.sh        | 10 ++--
 t/t6016-rev-list-graph-simplify-history.sh |  2 +-
 t/t6017-rev-list-stdin.sh                  |  8 ++--
 t/t6018-rev-list-glob.sh                   | 50 ++++++++++----------
 t/t6019-rev-list-ancestry-path.sh          |  6 +--
 t/t6030-bisect-porcelain.sh                | 10 ++--
 t/t6040-tracking-info.sh                   | 54 +++++++++++-----------
 t/t6050-replace.sh                         | 10 ++--
 t/t6101-rev-parse-parents.sh               |  2 +-
 t/t6110-rev-list-sparse.sh                 |  2 +-
 t/t6111-rev-list-treesame.sh               |  6 +--
 t/t6112-rev-list-filters-objects.sh        | 14 +++---
 t/t6120-describe.sh                        | 20 ++++----
 t/t6200-fmt-merge-msg.sh                   | 50 ++++++++++----------
 t/t6302-for-each-ref-filter.sh             | 46 +++++++++---------
 t/test-lib.sh                              |  4 +-
 24 files changed, 173 insertions(+), 173 deletions(-)

diff --git a/t/t6000-rev-list-misc.sh b/t/t6000-rev-list-misc.sh
index fc4d55dcb2..dc40a39fce 100755
--- a/t/t6000-rev-list-misc.sh
+++ b/t/t6000-rev-list-misc.sh
@@ -85,7 +85,7 @@ test_expect_success 'propagate uninteresting flag down correctly' '
 '
 
 test_expect_success 'symleft flag bit is propagated down from tag' '
-	git log --format="%m %s" --left-right v1.0...master >actual &&
+	git log --format="%m %s" --left-right v1.0...main >actual &&
 	cat >expect <<-\EOF &&
 	< another
 	< that
diff --git a/t/t6001-rev-list-graft.sh b/t/t6001-rev-list-graft.sh
index 7504ba4751..4490981352 100755
--- a/t/t6001-rev-list-graft.sh
+++ b/t/t6001-rev-list-graft.sh
@@ -20,7 +20,7 @@ test_expect_success setup '
 	git commit -a -m "Third in one history." &&
 	A2=$(git rev-parse --verify HEAD) &&
 
-	rm -f .git/refs/heads/master .git/index &&
+	rm -f .git/refs/heads/main .git/index &&
 
 	echo >fileA fileA again &&
 	echo >subdir/fileB fileB again &&
diff --git a/t/t6004-rev-list-path-optim.sh b/t/t6004-rev-list-path-optim.sh
index 3e8c42ee0b..81d1b57ced 100755
--- a/t/t6004-rev-list-path-optim.sh
+++ b/t/t6004-rev-list-path-optim.sh
@@ -4,7 +4,7 @@ test_description='git rev-list trivial path optimization test
 
    d/z1
    b0                             b1
-   o------------------------*----o master
+   o------------------------*----o main
   /                        /
  o---------o----o----o----o side
  a0        c0   c1   a1   c2
@@ -55,18 +55,18 @@ test_expect_success 'further setup' '
 	git add c &&
 	test_tick &&
 	git commit -m "Side makes yet another irrelevant commit" &&
-	git checkout master &&
+	git checkout main &&
 	echo Another >b &&
 	echo Munged >d/z &&
 	git add b d/z &&
 	test_tick &&
-	git commit -m "Master touches b" &&
-	git tag master_b0 &&
+	git commit -m "Main touches b" &&
+	git tag main_b0 &&
 	git merge side &&
 	echo Touched >b &&
 	git add b &&
 	test_tick &&
-	git commit -m "Master touches b again"
+	git commit -m "Main touches b again"
 '
 
 test_expect_success 'path optimization 2' '
@@ -76,13 +76,13 @@ test_expect_success 'path optimization 2' '
 '
 
 test_expect_success 'pathspec with leading path' '
-	git rev-parse master^ master_b0 side_c0 initial >expected &&
+	git rev-parse main^ main_b0 side_c0 initial >expected &&
 	git rev-list HEAD -- d >actual &&
 	test_cmp expected actual
 '
 
 test_expect_success 'pathspec with glob (1)' '
-	git rev-parse master^ master_b0 side_c0 initial >expected &&
+	git rev-parse main^ main_b0 side_c0 initial >expected &&
 	git rev-list HEAD -- "d/*" >actual &&
 	test_cmp expected actual
 '
diff --git a/t/t6006-rev-list-format.sh b/t/t6006-rev-list-format.sh
index 99a1eaf332..8cc54a5a50 100755
--- a/t/t6006-rev-list-format.sh
+++ b/t/t6006-rev-list-format.sh
@@ -53,7 +53,7 @@ test_expect_success 'setup' '
 test_format () {
 	cat >expect.$1
 	test_expect_${3:-success} "format $1" "
-		git rev-list --pretty=format:'$2' master >output.$1 &&
+		git rev-list --pretty=format:'$2' main >output.$1 &&
 		test_cmp expect.$1 output.$1
 	"
 }
@@ -184,13 +184,13 @@ test_expect_success 'basic colors' '
 	<RED>foo<GREEN>bar<BLUE>baz<RESET>xyzzy
 	EOF
 	format="%Credfoo%Cgreenbar%Cbluebaz%Cresetxyzzy" &&
-	git rev-list --color --format="$format" -1 master >actual.raw &&
+	git rev-list --color --format="$format" -1 main >actual.raw &&
 	test_decode_color <actual.raw >actual &&
 	test_cmp expect actual
 '
 
 test_expect_success '%S is not a placeholder for rev-list yet' '
-	git rev-list --format="%S" -1 master | grep "%S"
+	git rev-list --format="%S" -1 main | grep "%S"
 '
 
 test_expect_success 'advanced colors' '
@@ -199,7 +199,7 @@ test_expect_success 'advanced colors' '
 	<BOLD;RED;BYELLOW>foo<RESET>
 	EOF
 	format="%C(red yellow bold)foo%C(reset)" &&
-	git rev-list --color --format="$format" -1 master >actual.raw &&
+	git rev-list --color --format="$format" -1 main >actual.raw &&
 	test_decode_color <actual.raw >actual &&
 	test_cmp expect actual
 '
@@ -406,7 +406,7 @@ test_expect_success '%x00 shows NUL' '
 
 test_expect_success '%ad respects --date=' '
 	echo 2005-04-07 >expect.ad-short &&
-	git log -1 --date=short --pretty=tformat:%ad >output.ad-short master &&
+	git log -1 --date=short --pretty=tformat:%ad >output.ad-short main &&
 	test_cmp expect.ad-short output.ad-short
 '
 
@@ -494,8 +494,8 @@ test_expect_success '"%h %gD: %gs" is same as git-reflog (with --abbrev)' '
 '
 
 test_expect_success '%gd shortens ref name' '
-	echo "master@{0}" >expect.gd-short &&
-	git log -g -1 --format=%gd refs/heads/master >actual.gd-short &&
+	echo "main@{0}" >expect.gd-short &&
+	git log -g -1 --format=%gd refs/heads/main >actual.gd-short &&
 	test_cmp expect.gd-short actual.gd-short
 '
 
diff --git a/t/t6007-rev-list-cherry-pick-file.sh b/t/t6007-rev-list-cherry-pick-file.sh
index f0268372d2..e689959593 100755
--- a/t/t6007-rev-list-cherry-pick-file.sh
+++ b/t/t6007-rev-list-cherry-pick-file.sh
@@ -31,7 +31,7 @@ test_expect_success setup '
 	test_tick &&
 	git commit -m "E" &&
 	git tag E &&
-	git checkout master &&
+	git checkout main &&
 	git checkout branch foo &&
 	test_tick &&
 	git commit -m "B" &&
@@ -233,7 +233,7 @@ test_expect_success '--cherry-pick with independent, but identical branches' '
 	test_tick &&
 	git commit -m "independent, too" foo &&
 	test -z "$(git rev-list --left-right --cherry-pick \
-		HEAD...master -- foo)"
+		HEAD...main -- foo)"
 '
 
 cat >expect <<EOF
diff --git a/t/t6008-rev-list-submodule.sh b/t/t6008-rev-list-submodule.sh
index c4af9ca0a7..39762aa6ff 100755
--- a/t/t6008-rev-list-submodule.sh
+++ b/t/t6008-rev-list-submodule.sh
@@ -36,7 +36,7 @@ test_expect_success 'setup' '
 '
 
 test_expect_success "Ilari's test" '
-	git rev-list --objects super master ^super^
+	git rev-list --objects super main ^super^
 '
 
 test_done
diff --git a/t/t6009-rev-list-parent.sh b/t/t6009-rev-list-parent.sh
index 916d9692bc..7dedceb472 100755
--- a/t/t6009-rev-list-parent.sh
+++ b/t/t6009-rev-list-parent.sh
@@ -45,7 +45,7 @@ test_expect_success 'setup roots, merges and octopuses' '
 	test_commit seven &&
 	git checkout -b yetanotherbranch four &&
 	test_commit eight &&
-	git checkout master &&
+	git checkout main &&
 	test_tick &&
 	git merge --allow-unrelated-histories -m normalmerge newroot &&
 	git tag normalmerge &&
@@ -56,7 +56,7 @@ test_expect_success 'setup roots, merges and octopuses' '
 	test_tick &&
 	git merge -m tetrapus sidebranch anotherbranch yetanotherbranch &&
 	git tag tetrapus &&
-	git checkout master
+	git checkout main
 '
 
 test_expect_success 'rev-list roots' '
@@ -123,7 +123,7 @@ test_expect_success 'dodecapus' '
 		roots="$roots root$i" ||
 		return
 	done &&
-	git checkout master &&
+	git checkout main &&
 	test_tick &&
 	git merge -m dodecapus $roots &&
 	git tag dodecapus &&
diff --git a/t/t6012-rev-list-simplify.sh b/t/t6012-rev-list-simplify.sh
index fd202fcb94..1b5f54a3f5 100755
--- a/t/t6012-rev-list-simplify.sh
+++ b/t/t6012-rev-list-simplify.sh
@@ -43,7 +43,7 @@ test_expect_success setup '
 	git add side &&
 	test_tick && git commit -m "Side root" &&
 	note J &&
-	git checkout master &&
+	git checkout main &&
 
 	echo "Hello" >file &&
 	echo "second" >lost &&
@@ -65,7 +65,7 @@ test_expect_success setup '
 	note D &&
 
 	test_tick &&
-	test_must_fail git merge -m "merge" master &&
+	test_must_fail git merge -m "merge" main &&
 	>lost && git commit -a -m "merge" &&
 	note E &&
 
@@ -74,7 +74,7 @@ test_expect_success setup '
 	test_tick && git commit -m "Irrelevant change" &&
 	note F &&
 
-	git checkout master &&
+	git checkout main &&
 	echo "Yet another" >elif &&
 	git add elif &&
 	test_tick && git commit -m "Another irrelevant change" &&
@@ -87,7 +87,7 @@ test_expect_success setup '
 	test_tick && git commit -a -m "Final change" &&
 	note I &&
 
-	git checkout master &&
+	git checkout main &&
 	test_tick && git merge --allow-unrelated-histories -m "Coolest" unrelated &&
 	note K &&
 
diff --git a/t/t6013-rev-list-reverse-parents.sh b/t/t6013-rev-list-reverse-parents.sh
index 89458d370f..e6caf80d7e 100755
--- a/t/t6013-rev-list-reverse-parents.sh
+++ b/t/t6013-rev-list-reverse-parents.sh
@@ -18,24 +18,24 @@ test_expect_success 'set up --reverse example' '
 	commit two &&
 	git checkout -b side HEAD^ &&
 	commit three &&
-	git checkout master &&
+	git checkout main &&
 	git merge -s ours side &&
 	commit five
 	'
 
 test_expect_success '--reverse --parents --full-history combines correctly' '
-	git rev-list --parents --full-history master -- foo |
+	git rev-list --parents --full-history main -- foo |
 		perl -e "print reverse <>" > expected &&
-	git rev-list --reverse --parents --full-history master -- foo \
+	git rev-list --reverse --parents --full-history main -- foo \
 		> actual &&
 	test_cmp expected actual
 	'
 
 test_expect_success '--boundary does too' '
-	git rev-list --boundary --parents --full-history master ^root -- foo |
+	git rev-list --boundary --parents --full-history main ^root -- foo |
 		perl -e "print reverse <>" > expected &&
 	git rev-list --boundary --reverse --parents --full-history \
-		master ^root -- foo > actual &&
+		main ^root -- foo > actual &&
 	test_cmp expected actual
 	'
 
diff --git a/t/t6016-rev-list-graph-simplify-history.sh b/t/t6016-rev-list-graph-simplify-history.sh
index f5e6e92f5b..c341e6ecb4 100755
--- a/t/t6016-rev-list-graph-simplify-history.sh
+++ b/t/t6016-rev-list-graph-simplify-history.sh
@@ -14,7 +14,7 @@ test_expect_success 'set up rev-list --graph test' '
 	test_commit A1 foo.txt &&
 	test_commit A2 bar.txt &&
 	test_commit A3 bar.txt &&
-	git branch -m master A &&
+	git branch -m main A &&
 
 	# 2 commits on branch B, started from A1
 	git checkout -b B A1 &&
diff --git a/t/t6017-rev-list-stdin.sh b/t/t6017-rev-list-stdin.sh
index 667b37564e..6b72f100cb 100755
--- a/t/t6017-rev-list-stdin.sh
+++ b/t/t6017-rev-list-stdin.sh
@@ -40,7 +40,7 @@ test_expect_success setup '
 		done &&
 		for i in $them
 		do
-			git checkout -b side-$i master~$i &&
+			git checkout -b side-$i main~$i &&
 			echo updated $i >file-$i &&
 			git add file-$i &&
 			test_tick &&
@@ -49,7 +49,7 @@ test_expect_success setup '
 	)
 '
 
-check master
+check main
 check side-1 ^side-4
 check side-1 ^side-7 --
 check side-1 ^side-7 -- file-1
@@ -66,11 +66,11 @@ test_expect_success 'not only --stdin' '
 	file-2
 	EOF
 	cat >input <<-EOF &&
-	^master^
+	^main^
 	--
 	file-2
 	EOF
-	git log --pretty=tformat:%s --name-only --stdin master -- file-1 \
+	git log --pretty=tformat:%s --name-only --stdin main -- file-1 \
 		<input >actual &&
 	test_cmp expect actual
 '
diff --git a/t/t6018-rev-list-glob.sh b/t/t6018-rev-list-glob.sh
index fe2f3cec3d..ac030b9a7c 100755
--- a/t/t6018-rev-list-glob.sh
+++ b/t/t6018-rev-list-glob.sh
@@ -20,22 +20,22 @@ compare () {
 
 test_expect_success 'setup' '
 
-	commit master &&
-	git checkout -b subspace/one master &&
+	commit main &&
+	git checkout -b subspace/one main &&
 	commit one &&
-	git checkout -b subspace/two master &&
+	git checkout -b subspace/two main &&
 	commit two &&
-	git checkout -b subspace-x master &&
+	git checkout -b subspace-x main &&
 	commit subspace-x &&
-	git checkout -b other/three master &&
+	git checkout -b other/three main &&
 	commit three &&
-	git checkout -b someref master &&
+	git checkout -b someref main &&
 	commit some &&
-	git checkout master &&
+	git checkout main &&
 	commit topic_2 &&
-	git tag foo/bar master &&
+	git tag foo/bar main &&
 	commit topic_3 &&
-	git update-ref refs/remotes/foo/baz master &&
+	git update-ref refs/remotes/foo/baz main &&
 	commit topic_4 &&
 	git update-ref refs/remotes/upstream/one subspace/one &&
 	git update-ref refs/remotes/upstream/two subspace/two &&
@@ -83,7 +83,7 @@ test_expect_failure 'rev-parse accepts --glob as detached option' '
 
 test_expect_failure 'rev-parse is not confused by option-like glob' '
 
-	compare rev-parse "master" "--glob --symbolic master"
+	compare rev-parse "main" "--glob --symbolic main"
 
 '
 
@@ -111,15 +111,15 @@ test_expect_success 'rev-parse --glob=heads/subspace/* --glob=heads/other/*' '
 
 '
 
-test_expect_success 'rev-parse --glob=heads/someref/* master' '
+test_expect_success 'rev-parse --glob=heads/someref/* main' '
 
-	compare rev-parse "master" "--glob=heads/someref/* master"
+	compare rev-parse "main" "--glob=heads/someref/* main"
 
 '
 
 test_expect_success 'rev-parse --glob=heads/*' '
 
-	compare rev-parse "master other/three someref subspace-x subspace/one subspace/two" "--glob=heads/*"
+	compare rev-parse "main other/three someref subspace-x subspace/one subspace/two" "--glob=heads/*"
 
 '
 
@@ -136,7 +136,7 @@ test_expect_success 'rev-parse --remotes=foo' '
 '
 
 test_expect_success 'rev-parse --exclude with --branches' '
-	compare rev-parse "--exclude=*/* --branches" "master someref subspace-x"
+	compare rev-parse "--exclude=*/* --branches" "main someref subspace-x"
 '
 
 test_expect_success 'rev-parse --exclude with --all' '
@@ -221,7 +221,7 @@ test_expect_success 'rev-list --glob refs/heads/subspace/*' '
 
 test_expect_success 'rev-list not confused by option-like --glob arg' '
 
-	compare rev-list "master" "--glob -0 master"
+	compare rev-list "main" "--glob -0 main"
 
 '
 
@@ -269,13 +269,13 @@ test_expect_success 'rev-list --branches=subspace' '
 
 test_expect_success 'rev-list --branches' '
 
-	compare rev-list "master subspace-x someref other/three subspace/one subspace/two" "--branches"
+	compare rev-list "main subspace-x someref other/three subspace/one subspace/two" "--branches"
 
 '
 
-test_expect_success 'rev-list --glob=heads/someref/* master' '
+test_expect_success 'rev-list --glob=heads/someref/* main' '
 
-	compare rev-list "master" "--glob=heads/someref/* master"
+	compare rev-list "main" "--glob=heads/someref/* main"
 
 '
 
@@ -287,7 +287,7 @@ test_expect_success 'rev-list --glob=heads/subspace/* --glob=heads/other/*' '
 
 test_expect_success 'rev-list --glob=heads/*' '
 
-	compare rev-list "master other/three someref subspace-x subspace/one subspace/two" "--glob=heads/*"
+	compare rev-list "main other/three someref subspace-x subspace/one subspace/two" "--glob=heads/*"
 
 '
 
@@ -310,7 +310,7 @@ test_expect_success 'rev-list --remotes=foo' '
 '
 
 test_expect_success 'rev-list --exclude with --branches' '
-	compare rev-list "--exclude=*/* --branches" "master someref subspace-x"
+	compare rev-list "--exclude=*/* --branches" "main someref subspace-x"
 '
 
 test_expect_success 'rev-list --exclude with --all' '
@@ -354,13 +354,13 @@ test_expect_success 'shortlog accepts --glob/--tags/--remotes' '
 
 	compare shortlog "subspace/one subspace/two" --branches=subspace &&
 	compare shortlog \
-	  "master subspace-x someref other/three subspace/one subspace/two" \
+	  "main subspace-x someref other/three subspace/one subspace/two" \
 	  --branches &&
-	compare shortlog master "--glob=heads/someref/* master" &&
+	compare shortlog main "--glob=heads/someref/* main" &&
 	compare shortlog "subspace/one subspace/two other/three" \
 	  "--glob=heads/subspace/* --glob=heads/other/*" &&
 	compare shortlog \
-	  "master other/three someref subspace-x subspace/one subspace/two" \
+	  "main other/three someref subspace-x subspace/one subspace/two" \
 	  "--glob=heads/*" &&
 	compare shortlog foo/bar --tags=foo &&
 	compare shortlog "foo/bar qux/one qux/two qux/x" --tags &&
@@ -371,14 +371,14 @@ test_expect_success 'shortlog accepts --glob/--tags/--remotes' '
 test_expect_failure 'shortlog accepts --glob as detached option' '
 
 	compare shortlog \
-	  "master other/three someref subspace-x subspace/one subspace/two" \
+	  "main other/three someref subspace-x subspace/one subspace/two" \
 	  "--glob heads/*"
 
 '
 
 test_expect_failure 'shortlog --glob is not confused by option-like argument' '
 
-	compare shortlog master "--glob -e master"
+	compare shortlog main "--glob -e main"
 
 '
 
diff --git a/t/t6019-rev-list-ancestry-path.sh b/t/t6019-rev-list-ancestry-path.sh
index 353f84313f..c664d66773 100755
--- a/t/t6019-rev-list-ancestry-path.sh
+++ b/t/t6019-rev-list-ancestry-path.sh
@@ -128,15 +128,15 @@ test_expect_success 'setup criss-cross' '
 	(cd criss-cross &&
 	 git init &&
 	 test_commit A &&
-	 git checkout -b xb master &&
+	 git checkout -b xb main &&
 	 test_commit B &&
-	 git checkout -b xc master &&
+	 git checkout -b xc main &&
 	 test_commit C &&
 	 git checkout -b xbc xb -- &&
 	 git merge xc &&
 	 git checkout -b xcb xc -- &&
 	 git merge xb &&
-	 git checkout master)
+	 git checkout main)
 '
 
 # no commits in bc descend from cb
diff --git a/t/t6030-bisect-porcelain.sh b/t/t6030-bisect-porcelain.sh
index aa226381be..386841f7b7 100755
--- a/t/t6030-bisect-porcelain.sh
+++ b/t/t6030-bisect-porcelain.sh
@@ -89,9 +89,9 @@ test_expect_success 'bisect start without -- takes unknown arg as pathspec' '
 	grep bar ".git/BISECT_NAMES"
 '
 
-test_expect_success 'bisect reset: back in the master branch' '
+test_expect_success 'bisect reset: back in the main branch' '
 	git bisect reset &&
-	echo "* master" > branch.expect &&
+	echo "* main" > branch.expect &&
 	git branch > branch.output &&
 	cmp branch.expect branch.output
 '
@@ -102,7 +102,7 @@ test_expect_success 'bisect reset: back in another branch' '
 	git bisect good $HASH1 &&
 	git bisect bad $HASH3 &&
 	git bisect reset &&
-	echo "  master" > branch.expect &&
+	echo "  main" > branch.expect &&
 	echo "* other" >> branch.expect &&
 	git branch > branch.output &&
 	cmp branch.expect branch.output
@@ -348,7 +348,7 @@ test_expect_success 'bisect skip many ranges' '
 
 test_expect_success 'bisect starting with a detached HEAD' '
 	git bisect reset &&
-	git checkout master^ &&
+	git checkout main^ &&
 	HEAD=$(git rev-parse --verify HEAD) &&
 	git bisect start &&
 	test $HEAD = $(cat .git/BISECT_START) &&
@@ -716,7 +716,7 @@ test_expect_success 'bisect: --no-checkout - target after breakage' '
 test_expect_success 'bisect: demonstrate identification of damage boundary' "
 	git bisect reset &&
 	git checkout broken &&
-	git bisect start broken master --no-checkout &&
+	git bisect start broken main --no-checkout &&
 	test_must_fail git bisect run \"\$SHELL_PATH\" -c '
 		GOOD=\$(git for-each-ref \"--format=%(objectname)\" refs/bisect/good-*) &&
 		git rev-list --objects BISECT_HEAD --not \$GOOD >tmp.\$\$ &&
diff --git a/t/t6040-tracking-info.sh b/t/t6040-tracking-info.sh
index 50a934e1b2..8ad1390511 100755
--- a/t/t6040-tracking-info.sh
+++ b/t/t6040-tracking-info.sh
@@ -34,7 +34,7 @@ test_expect_success setup '
 		git branch -d brokenbase &&
 		git checkout -b b6 origin
 	) &&
-	git checkout -b follower --track master &&
+	git checkout -b follower --track main &&
 	advance h
 '
 
@@ -58,12 +58,12 @@ test_expect_success 'branch -v' '
 '
 
 cat >expect <<\EOF
-b1 [origin/master: ahead 1, behind 1] d
-b2 [origin/master: ahead 1, behind 1] d
-b3 [origin/master: behind 1] b
-b4 [origin/master: ahead 2] f
+b1 [origin/main: ahead 1, behind 1] d
+b2 [origin/main: ahead 1, behind 1] d
+b3 [origin/main: behind 1] b
+b4 [origin/main: ahead 2] f
 b5 [brokenbase: gone] g
-b6 [origin/master] c
+b6 [origin/main] c
 EOF
 
 test_expect_success 'branch -vv' '
@@ -83,7 +83,7 @@ test_expect_success 'checkout (diverged from upstream)' '
 '
 
 test_expect_success 'checkout with local tracked branch' '
-	git checkout master &&
+	git checkout main &&
 	git checkout follower >actual &&
 	test_i18ngrep "is ahead of" actual
 '
@@ -100,7 +100,7 @@ test_expect_success 'checkout (up-to-date with upstream)' '
 	(
 		cd test && git checkout b6
 	) >actual &&
-	test_i18ngrep "Your branch is up to date with .origin/master" actual
+	test_i18ngrep "Your branch is up to date with .origin/main" actual
 '
 
 test_expect_success 'status (diverged from upstream)' '
@@ -130,11 +130,11 @@ test_expect_success 'status (up-to-date with upstream)' '
 		# reports nothing to commit
 		test_must_fail git commit --dry-run
 	) >actual &&
-	test_i18ngrep "Your branch is up to date with .origin/master" actual
+	test_i18ngrep "Your branch is up to date with .origin/main" actual
 '
 
 cat >expect <<\EOF
-## b1...origin/master [ahead 1, behind 1]
+## b1...origin/main [ahead 1, behind 1]
 EOF
 
 test_expect_success 'status -s -b (diverged from upstream)' '
@@ -147,7 +147,7 @@ test_expect_success 'status -s -b (diverged from upstream)' '
 '
 
 cat >expect <<\EOF
-## b1...origin/master [different]
+## b1...origin/main [different]
 EOF
 
 test_expect_success 'status -s -b --no-ahead-behind (diverged from upstream)' '
@@ -160,7 +160,7 @@ test_expect_success 'status -s -b --no-ahead-behind (diverged from upstream)' '
 '
 
 cat >expect <<\EOF
-## b1...origin/master [different]
+## b1...origin/main [different]
 EOF
 
 test_expect_success 'status.aheadbehind=false status -s -b (diverged from upstream)' '
@@ -174,7 +174,7 @@ test_expect_success 'status.aheadbehind=false status -s -b (diverged from upstre
 
 cat >expect <<\EOF
 On branch b1
-Your branch and 'origin/master' have diverged,
+Your branch and 'origin/main' have diverged,
 and have 1 and 1 different commits each, respectively.
 EOF
 
@@ -198,7 +198,7 @@ test_expect_success 'status --long --branch' '
 
 cat >expect <<\EOF
 On branch b1
-Your branch and 'origin/master' refer to different commits.
+Your branch and 'origin/main' refer to different commits.
 EOF
 
 test_expect_success 'status --long --branch --no-ahead-behind' '
@@ -233,7 +233,7 @@ test_expect_success 'status -s -b (upstream is gone)' '
 '
 
 cat >expect <<\EOF
-## b6...origin/master
+## b6...origin/main
 EOF
 
 test_expect_success 'status -s -b (up-to-date with upstream)' '
@@ -246,7 +246,7 @@ test_expect_success 'status -s -b (up-to-date with upstream)' '
 '
 
 test_expect_success 'fail to track lightweight tags' '
-	git checkout master &&
+	git checkout main &&
 	git tag light &&
 	test_must_fail git branch --track lighttrack light >actual &&
 	test_i18ngrep ! "set up to track" actual &&
@@ -254,7 +254,7 @@ test_expect_success 'fail to track lightweight tags' '
 '
 
 test_expect_success 'fail to track annotated tags' '
-	git checkout master &&
+	git checkout main &&
 	git tag -m heavy heavy &&
 	test_must_fail git branch --track heavytrack heavy >actual &&
 	test_i18ngrep ! "set up to track" actual &&
@@ -262,17 +262,17 @@ test_expect_success 'fail to track annotated tags' '
 '
 
 test_expect_success '--set-upstream-to does not change branch' '
-	git branch from-master master &&
-	git branch --set-upstream-to master from-master &&
-	git branch from-topic_2 master &&
+	git branch from-main main &&
+	git branch --set-upstream-to main from-main &&
+	git branch from-topic_2 main &&
 	test_must_fail git config branch.from-topic_2.merge > actual &&
 	git rev-list from-topic_2 &&
 	git update-ref refs/heads/from-topic_2 from-topic_2^ &&
 	git rev-parse from-topic_2 >expect2 &&
-	git branch --set-upstream-to master from-topic_2 &&
-	git config branch.from-master.merge > actual &&
+	git branch --set-upstream-to main from-topic_2 &&
+	git config branch.from-main.merge > actual &&
 	git rev-parse from-topic_2 >actual2 &&
-	grep -q "^refs/heads/master$" actual &&
+	grep -q "^refs/heads/main$" actual &&
 	cmp expect2 actual2
 '
 
@@ -280,11 +280,11 @@ test_expect_success '--set-upstream-to @{-1}' '
 	git checkout follower &&
 	git checkout from-topic_2 &&
 	git config branch.from-topic_2.merge > expect2 &&
-	git branch --set-upstream-to @{-1} from-master &&
-	git config branch.from-master.merge > actual &&
+	git branch --set-upstream-to @{-1} from-main &&
+	git config branch.from-main.merge > actual &&
 	git config branch.from-topic_2.merge > actual2 &&
-	git branch --set-upstream-to follower from-master &&
-	git config branch.from-master.merge > expect &&
+	git branch --set-upstream-to follower from-main &&
+	git config branch.from-main.merge > expect &&
 	test_cmp expect2 actual2 &&
 	test_cmp expect actual
 '
diff --git a/t/t6050-replace.sh b/t/t6050-replace.sh
index c80dc10b8f..56cf4ceb90 100755
--- a/t/t6050-replace.sh
+++ b/t/t6050-replace.sh
@@ -133,9 +133,9 @@ test_expect_success 'tag replaced commit' '
 '
 
 test_expect_success '"git fsck" works' '
-     git fsck master >fsck_master.out &&
-     test_i18ngrep "dangling commit $R" fsck_master.out &&
-     test_i18ngrep "dangling tag $(git show-ref -s refs/tags/mytag)" fsck_master.out &&
+     git fsck main >fsck_main.out &&
+     test_i18ngrep "dangling commit $R" fsck_main.out &&
+     test_i18ngrep "dangling tag $(git show-ref -s refs/tags/mytag)" fsck_main.out &&
      test -z "$(git fsck)"
 '
 
@@ -218,7 +218,7 @@ test_expect_success 'create parallel branch without the bug' '
      git cherry-pick $HASH6 &&
      PARA6=$(git rev-parse --verify HEAD) &&
      git replace $HASH6 $PARA6 &&
-     git checkout master &&
+     git checkout main &&
      cur=$(git rev-parse --verify HEAD) &&
      test "$cur" = "$HASH7" &&
      git log --pretty=oneline | grep $PARA2 &&
@@ -461,7 +461,7 @@ test_expect_success GPG 'set up a merge commit with a mergetag' '
 	git commit -m "hello: 2 more lines from a test branch" &&
 	HASH9=$(git rev-parse --verify HEAD) &&
 	git tag -s -m "tag for testing with a mergetag" test_tag HEAD &&
-	git checkout master &&
+	git checkout main &&
 	git merge -s ours test_tag &&
 	HASH10=$(git rev-parse --verify HEAD) &&
 	git cat-file commit $HASH10 | grep "^mergetag object"
diff --git a/t/t6101-rev-parse-parents.sh b/t/t6101-rev-parse-parents.sh
index 7531262a5e..288a75c02b 100755
--- a/t/t6101-rev-parse-parents.sh
+++ b/t/t6101-rev-parse-parents.sh
@@ -18,7 +18,7 @@ test_expect_success 'setup' '
 	test_commit second &&
 	git checkout --orphan tmp &&
 	test_commit start2 &&
-	git checkout master &&
+	git checkout main &&
 	git merge -m next --allow-unrelated-histories start2 &&
 	test_commit final &&
 
diff --git a/t/t6110-rev-list-sparse.sh b/t/t6110-rev-list-sparse.sh
index 656ac7fe9d..093536fd85 100755
--- a/t/t6110-rev-list-sparse.sh
+++ b/t/t6110-rev-list-sparse.sh
@@ -10,7 +10,7 @@ test_expect_success setup '
 	git checkout -b side HEAD^ &&
 	test_commit D &&
 	test_commit E &&
-	git merge master
+	git merge main
 '
 
 test_expect_success 'rev-list --first-parent --boundary' '
diff --git a/t/t6111-rev-list-treesame.sh b/t/t6111-rev-list-treesame.sh
index 4244638285..90c8630e34 100755
--- a/t/t6111-rev-list-treesame.sh
+++ b/t/t6111-rev-list-treesame.sh
@@ -33,13 +33,13 @@ test_expect_success setup '
 	git checkout other-branch &&
 	test_commit "Added other" other "Hello" C &&
 
-	git checkout master &&
+	git checkout main &&
 	test_merge D other-branch &&
 
 	git checkout third-branch &&
 	test_commit "Third file" third "Nothing" E &&
 
-	git checkout master &&
+	git checkout main &&
 	test_commit "file=Blah" file "Blah" F &&
 
 	test_tick && git merge --no-commit third-branch &&
@@ -56,7 +56,7 @@ test_expect_success setup '
 
 	test_tick && git revert I && note J &&
 
-	git checkout master &&
+	git checkout main &&
 	test_tick && git merge --no-ff fiddler-branch &&
 	note K &&
 
diff --git a/t/t6112-rev-list-filters-objects.sh b/t/t6112-rev-list-filters-objects.sh
index de0e5a5d36..c6729320ea 100755
--- a/t/t6112-rev-list-filters-objects.sh
+++ b/t/t6112-rev-list-filters-objects.sh
@@ -223,7 +223,7 @@ test_expect_success 'verify sparse:oid=oid-ish omits top-level files' '
 	sort >expected &&
 
 	git -C r3 rev-list --quiet --objects --filter-print-omitted \
-		--filter=sparse:oid=master:pattern HEAD >revs &&
+		--filter=sparse:oid=main:pattern HEAD >revs &&
 	awk -f print_1.awk revs |
 	sed "s/~//" |
 	sort >observed &&
@@ -436,7 +436,7 @@ test_expect_success 'add sparse pattern blobs whose paths have reserved chars' '
 
 test_expect_success 'combine:... with more than two sub-filters' '
 	git -C r3 rev-list --objects \
-		--filter=combine:tree:3+blob:limit=40+sparse:oid=master:pattern \
+		--filter=combine:tree:3+blob:limit=40+sparse:oid=main:pattern \
 		HEAD >actual &&
 
 	expect_has HEAD "" &&
@@ -454,7 +454,7 @@ test_expect_success 'combine:... with more than two sub-filters' '
 	cp actual expect &&
 
 	git -C r3 rev-list --objects \
-		--filter=combine:tree:3+blob:limit=40+sparse:oid=master:pattern1%2brenamed%25 \
+		--filter=combine:tree:3+blob:limit=40+sparse:oid=main:pattern1%2brenamed%25 \
 		HEAD >actual &&
 	test_cmp expect actual &&
 
@@ -464,23 +464,23 @@ test_expect_success 'combine:... with more than two sub-filters' '
 	test_when_finished "rm -f trace1" &&
 	GIT_TRACE=$(pwd)/trace1 git -C r3 rev-list --objects \
 		--filter=tree:3 --filter=blob:limit=40 \
-		--filter=sparse:oid="master:p;at%ter+n" \
+		--filter=sparse:oid="main:p;at%ter+n" \
 		HEAD >actual &&
 
 	test_cmp expect actual &&
-	grep "Add to combine filter-spec: sparse:oid=master:p%3bat%25ter%2bn" \
+	grep "Add to combine filter-spec: sparse:oid=main:p%3bat%25ter%2bn" \
 		trace1 &&
 
 	# Repeat the above test, but this time, the characters to encode are in
 	# the LHS of the combined filter.
 	test_when_finished "rm -f trace2" &&
 	GIT_TRACE=$(pwd)/trace2 git -C r3 rev-list --objects \
-		--filter=sparse:oid=master:^~pattern \
+		--filter=sparse:oid=main:^~pattern \
 		--filter=tree:3 --filter=blob:limit=40 \
 		HEAD >actual &&
 
 	test_cmp expect actual &&
-	grep "Add to combine filter-spec: sparse:oid=master:%5e%7epattern" \
+	grep "Add to combine filter-spec: sparse:oid=main:%5e%7epattern" \
 		trace2
 '
 
diff --git a/t/t6120-describe.sh b/t/t6120-describe.sh
index f822d5d328..53617c9da9 100755
--- a/t/t6120-describe.sh
+++ b/t/t6120-describe.sh
@@ -102,7 +102,7 @@ check_describe c-* --tags HEAD^^2
 check_describe B --tags HEAD^^2^
 check_describe e --tags HEAD^^^
 
-check_describe heads/master --all HEAD
+check_describe heads/main --all HEAD
 check_describe tags/c-* --all HEAD^
 check_describe tags/e --all HEAD^^^
 
@@ -403,15 +403,15 @@ test_expect_success ULIMIT_STACK_SIZE 'name-rev works in a deep repo' '
 	i=1 &&
 	while test $i -lt 8000
 	do
-		echo "commit refs/heads/master
+		echo "commit refs/heads/main
 committer A U Thor <author@example.com> $((1000000000 + $i * 100)) +0200
 data <<EOF
 commit #$i
 EOF"
-		test $i = 1 && echo "from refs/heads/master^0"
+		test $i = 1 && echo "from refs/heads/main^0"
 		i=$(($i + 1))
 	done | git fast-import &&
-	git checkout master &&
+	git checkout main &&
 	git tag far-far-away HEAD^ &&
 	echo "HEAD~4000 tags/far-far-away~3999" >expect &&
 	git name-rev HEAD~4000 >actual &&
@@ -442,7 +442,7 @@ test_expect_success 'describe complains about missing object' '
 '
 
 test_expect_success 'name-rev a rev shortly after epoch' '
-	test_when_finished "git checkout master" &&
+	test_when_finished "git checkout main" &&
 
 	git checkout --orphan no-timestamp-underflow &&
 	# Any date closer to epoch than the CUTOFF_DATE_SLOP constant
@@ -456,7 +456,7 @@ test_expect_success 'name-rev a rev shortly after epoch' '
 	test_cmp expect actual
 '
 
-# A--------------master
+# A--------------main
 #  \            /
 #   \----------M2
 #    \        /
@@ -487,10 +487,10 @@ test_expect_success 'name-rev covers all conditions while looking at parents' '
 		git checkout $A &&
 		git merge --no-ff HEAD@{1} && # M2
 
-		git checkout master &&
+		git checkout main &&
 		git merge --no-ff HEAD@{1} &&
 
-		echo "$B master^2^2~1^2" >expect &&
+		echo "$B main^2^2~1^2" >expect &&
 		git name-rev $B >actual &&
 
 		test_cmp expect actual
@@ -516,7 +516,7 @@ test_expect_success 'describe commits with disjoint bases' '
 		git checkout --orphan branch && rm file &&
 		echo B > file2 && git add file2 && git commit -m B &&
 		git tag B -a -m B &&
-		git merge --no-ff --allow-unrelated-histories master -m x &&
+		git merge --no-ff --allow-unrelated-histories main -m x &&
 
 		check_describe "A-3-*" HEAD
 	)
@@ -542,7 +542,7 @@ test_expect_success 'describe commits with disjoint bases 2' '
 		echo o >> file2 && git add file2 && GIT_COMMITTER_DATE="2020-01-01 15:01" git commit -m o &&
 		echo B >> file2 && git add file2 && GIT_COMMITTER_DATE="2020-01-01 15:02" git commit -m B &&
 		git tag B -a -m B &&
-		git merge --no-ff --allow-unrelated-histories master -m x &&
+		git merge --no-ff --allow-unrelated-histories main -m x &&
 
 		check_describe "B-3-*" HEAD
 	)
diff --git a/t/t6200-fmt-merge-msg.sh b/t/t6200-fmt-merge-msg.sh
index f3e66eaf9b..8be07ce902 100755
--- a/t/t6200-fmt-merge-msg.sh
+++ b/t/t6200-fmt-merge-msg.sh
@@ -81,7 +81,7 @@ test_expect_success GPG 'set up a signed tag' '
 test_expect_success 'message for merging local branch' '
 	echo "Merge branch ${apos}left${apos}" >expected &&
 
-	git checkout master &&
+	git checkout main &&
 	git fetch . left &&
 
 	git fmt-merge-msg <.git/FETCH_HEAD >actual &&
@@ -89,7 +89,7 @@ test_expect_success 'message for merging local branch' '
 '
 
 test_expect_success GPG 'message for merging local tag signed by good key' '
-	git checkout master &&
+	git checkout main &&
 	git fetch . signed-good-tag &&
 	git fmt-merge-msg <.git/FETCH_HEAD >actual 2>&1 &&
 	grep "^Merge tag ${apos}signed-good-tag${apos}" actual &&
@@ -98,7 +98,7 @@ test_expect_success GPG 'message for merging local tag signed by good key' '
 '
 
 test_expect_success GPG 'message for merging local tag signed by unknown key' '
-	git checkout master &&
+	git checkout main &&
 	git fetch . signed-good-tag &&
 	GNUPGHOME=. git fmt-merge-msg <.git/FETCH_HEAD >actual 2>&1 &&
 	grep "^Merge tag ${apos}signed-good-tag${apos}" actual &&
@@ -109,7 +109,7 @@ test_expect_success GPG 'message for merging local tag signed by unknown key' '
 test_expect_success 'message for merging external branch' '
 	echo "Merge branch ${apos}left${apos} of $(pwd)" >expected &&
 
-	git checkout master &&
+	git checkout main &&
 	git fetch "$(pwd)" left &&
 
 	git fmt-merge-msg <.git/FETCH_HEAD >actual &&
@@ -133,7 +133,7 @@ test_expect_success '[merge] summary/log configuration' '
 	test_config merge.log true &&
 	test_unconfig merge.summary &&
 
-	git checkout master &&
+	git checkout main &&
 	test_tick &&
 	git fetch . left &&
 
@@ -142,7 +142,7 @@ test_expect_success '[merge] summary/log configuration' '
 	test_unconfig merge.log &&
 	test_config merge.summary true &&
 
-	git checkout master &&
+	git checkout main &&
 	test_tick &&
 	git fetch . left &&
 
@@ -153,7 +153,7 @@ test_expect_success '[merge] summary/log configuration' '
 '
 
 test_expect_success 'setup FETCH_HEAD' '
-	git checkout master &&
+	git checkout main &&
 	test_tick &&
 	git fetch . left
 '
@@ -281,7 +281,7 @@ test_expect_success 'fmt-merge-msg -m' '
 
 	test_unconfig merge.log &&
 	test_unconfig merge.summary &&
-	git checkout master &&
+	git checkout main &&
 	git fetch "$(pwd)" left &&
 	git fmt-merge-msg -m "Sync with left" <.git/FETCH_HEAD >actual &&
 	git fmt-merge-msg --log -m "Sync with left" \
@@ -323,28 +323,28 @@ test_expect_success 'setup: expected shortlog for two branches' '
 test_expect_success 'shortlog for two branches' '
 	test_config merge.log true &&
 	test_unconfig merge.summary &&
-	git checkout master &&
+	git checkout main &&
 	test_tick &&
 	git fetch . left right &&
 	git fmt-merge-msg <.git/FETCH_HEAD >actual1 &&
 
 	test_unconfig merge.log &&
 	test_config merge.summary true &&
-	git checkout master &&
+	git checkout main &&
 	test_tick &&
 	git fetch . left right &&
 	git fmt-merge-msg <.git/FETCH_HEAD >actual2 &&
 
 	test_config merge.log yes &&
 	test_unconfig merge.summary &&
-	git checkout master &&
+	git checkout main &&
 	test_tick &&
 	git fetch . left right &&
 	git fmt-merge-msg <.git/FETCH_HEAD >actual3 &&
 
 	test_unconfig merge.log &&
 	test_config merge.summary yes &&
-	git checkout master &&
+	git checkout main &&
 	test_tick &&
 	git fetch . left right &&
 	git fmt-merge-msg <.git/FETCH_HEAD >actual4 &&
@@ -358,7 +358,7 @@ test_expect_success 'shortlog for two branches' '
 test_expect_success 'merge-msg -F' '
 	test_unconfig merge.log &&
 	test_config merge.summary yes &&
-	git checkout master &&
+	git checkout main &&
 	test_tick &&
 	git fetch . left right &&
 	git fmt-merge-msg -F .git/FETCH_HEAD >actual &&
@@ -368,7 +368,7 @@ test_expect_success 'merge-msg -F' '
 test_expect_success 'merge-msg -F in subdirectory' '
 	test_unconfig merge.log &&
 	test_config merge.summary yes &&
-	git checkout master &&
+	git checkout main &&
 	test_tick &&
 	git fetch . left right &&
 	mkdir sub &&
@@ -408,7 +408,7 @@ test_expect_success 'merge-msg tag' '
 	test_unconfig merge.log &&
 	test_config merge.summary yes &&
 
-	git checkout master &&
+	git checkout main &&
 	test_tick &&
 	git fetch . tag tag-r3 &&
 
@@ -438,7 +438,7 @@ test_expect_success 'merge-msg two tags' '
 	test_unconfig merge.log &&
 	test_config merge.summary yes &&
 
-	git checkout master &&
+	git checkout main &&
 	test_tick &&
 	git fetch . tag tag-r3 tag tag-l5 &&
 
@@ -468,7 +468,7 @@ test_expect_success 'merge-msg tag and branch' '
 	test_unconfig merge.log &&
 	test_config merge.summary yes &&
 
-	git checkout master &&
+	git checkout main &&
 	test_tick &&
 	git fetch . tag tag-r3 left &&
 
@@ -495,7 +495,7 @@ test_expect_success 'merge-msg lots of commits' '
 
 	test_config merge.summary yes &&
 
-	git checkout master &&
+	git checkout main &&
 	test_tick &&
 	git fetch . long &&
 
@@ -506,11 +506,11 @@ test_expect_success 'merge-msg lots of commits' '
 test_expect_success 'merge-msg with "merging" an annotated tag' '
 	test_config merge.log true &&
 
-	git checkout master^0 &&
+	git checkout main^0 &&
 	git commit --allow-empty -m "One step ahead" &&
 	git tag -a -m "An annotated one" annote HEAD &&
 
-	git checkout master &&
+	git checkout main &&
 	git fetch . annote &&
 
 	git fmt-merge-msg <.git/FETCH_HEAD >actual &&
@@ -543,23 +543,23 @@ test_expect_success 'merge-msg with "merging" an annotated tag' '
 '
 
 test_expect_success 'merge.suppressDest configuration' '
-	git checkout -B side master &&
+	git checkout -B side main &&
 	git commit --allow-empty -m "One step ahead" &&
-	git checkout master &&
+	git checkout main &&
 	git fetch . side &&
 
 	git -c merge.suppressDest="" fmt-merge-msg <.git/FETCH_HEAD >full.1 &&
 	head -n1 full.1 >actual &&
-	grep -e "Merge branch .side. into master" actual &&
+	grep -e "Merge branch .side. into main" actual &&
 
 	git -c merge.suppressDest="mast" fmt-merge-msg <.git/FETCH_HEAD >full.2 &&
 	head -n1 full.2 >actual &&
-	grep -e "Merge branch .side. into master$" actual &&
+	grep -e "Merge branch .side. into main$" actual &&
 
 	git -c merge.suppressDest="ma?*[rn]" fmt-merge-msg <.git/FETCH_HEAD >full.3 &&
 	head -n1 full.3 >actual &&
 	grep -e "Merge branch .side." actual &&
-	! grep -e " into master$" actual
+	! grep -e " into main$" actual
 '
 
 test_done
diff --git a/t/t6302-for-each-ref-filter.sh b/t/t6302-for-each-ref-filter.sh
index 0a21669f56..f5a55c1991 100755
--- a/t/t6302-for-each-ref-filter.sh
+++ b/t/t6302-for-each-ref-filter.sh
@@ -26,17 +26,17 @@ test_expect_success 'setup some history and refs' '
 	git tag $sign -m "A signed tag" signed-tag &&
 	git tag $sign -m "Signed doubly" doubly-signed-tag signed-tag &&
 
-	git checkout master &&
-	git update-ref refs/odd/spot master
+	git checkout main &&
+	git update-ref refs/odd/spot main
 '
 
 test_expect_success 'filtering with --points-at' '
 	cat >expect <<-\EOF &&
-	refs/heads/master
+	refs/heads/main
 	refs/odd/spot
 	refs/tags/three
 	EOF
-	git for-each-ref --format="%(refname)" --points-at=master >actual &&
+	git for-each-ref --format="%(refname)" --points-at=main >actual &&
 	test_cmp expect actual
 '
 
@@ -53,13 +53,13 @@ test_expect_success 'check signed tags with --points-at' '
 
 test_expect_success 'filtering with --merged' '
 	cat >expect <<-\EOF &&
-	refs/heads/master
+	refs/heads/main
 	refs/odd/spot
 	refs/tags/one
 	refs/tags/three
 	refs/tags/two
 	EOF
-	git for-each-ref --format="%(refname)" --merged=master >actual &&
+	git for-each-ref --format="%(refname)" --merged=main >actual &&
 	test_cmp expect actual
 '
 
@@ -72,13 +72,13 @@ test_expect_success 'filtering with --no-merged' '
 	refs/tags/four
 	refs/tags/signed-tag
 	EOF
-	git for-each-ref --format="%(refname)" --no-merged=master >actual &&
+	git for-each-ref --format="%(refname)" --no-merged=main >actual &&
 	test_cmp expect actual
 '
 
 test_expect_success 'filtering with --contains' '
 	cat >expect <<-\EOF &&
-	refs/heads/master
+	refs/heads/main
 	refs/heads/side
 	refs/odd/spot
 	refs/tags/annotated-tag
@@ -251,7 +251,7 @@ test_expect_success PREPARE_FOR_MAIN_BRANCH 'nested alignment with quote formatt
 
 test_expect_success 'check `%(contents:lines=1)`' '
 	cat >expect <<-\EOF &&
-	master |three
+	main |three
 	side |four
 	odd/spot |three
 	annotated-tag |An annotated tag
@@ -269,7 +269,7 @@ test_expect_success 'check `%(contents:lines=1)`' '
 
 test_expect_success 'check `%(contents:lines=0)`' '
 	cat >expect <<-\EOF &&
-	master |
+	main |
 	side |
 	odd/spot |
 	annotated-tag |
@@ -287,7 +287,7 @@ test_expect_success 'check `%(contents:lines=0)`' '
 
 test_expect_success 'check `%(contents:lines=99999)`' '
 	cat >expect <<-\EOF &&
-	master |three
+	main |three
 	side |four
 	odd/spot |three
 	annotated-tag |An annotated tag
@@ -360,7 +360,7 @@ test_expect_success 'improper usage of %(if), %(then), %(else) and %(end) atoms'
 test_expect_success 'check %(if)...%(then)...%(end) atoms' '
 	git for-each-ref --format="%(refname)%(if)%(authorname)%(then) Author: %(authorname)%(end)" >actual &&
 	cat >expect <<-\EOF &&
-	refs/heads/master Author: A U Thor
+	refs/heads/main Author: A U Thor
 	refs/heads/side Author: A U Thor
 	refs/odd/spot Author: A U Thor
 	refs/tags/annotated-tag
@@ -381,7 +381,7 @@ test_expect_success 'check %(if)...%(then)...%(end) atoms' '
 test_expect_success 'check %(if)...%(then)...%(else)...%(end) atoms' '
 	git for-each-ref --format="%(if)%(authorname)%(then)%(authorname)%(else)No author%(end): %(refname)" >actual &&
 	cat >expect <<-\EOF &&
-	A U Thor: refs/heads/master
+	A U Thor: refs/heads/main
 	A U Thor: refs/heads/side
 	A U Thor: refs/odd/spot
 	No author: refs/tags/annotated-tag
@@ -401,7 +401,7 @@ test_expect_success 'check %(if)...%(then)...%(else)...%(end) atoms' '
 test_expect_success 'ignore spaces in %(if) atom usage' '
 	git for-each-ref --format="%(refname:short): %(if)%(HEAD)%(then)Head ref%(else)Not Head ref%(end)" >actual &&
 	cat >expect <<-\EOF &&
-	master: Head ref
+	main: Head ref
 	side: Not Head ref
 	odd/spot: Not Head ref
 	annotated-tag: Not Head ref
@@ -420,19 +420,19 @@ test_expect_success 'ignore spaces in %(if) atom usage' '
 '
 
 test_expect_success 'check %(if:equals=<string>)' '
-	git for-each-ref --format="%(if:equals=master)%(refname:short)%(then)Found master%(else)Not master%(end)" refs/heads/ >actual &&
+	git for-each-ref --format="%(if:equals=main)%(refname:short)%(then)Found main%(else)Not main%(end)" refs/heads/ >actual &&
 	cat >expect <<-\EOF &&
-	Found master
-	Not master
+	Found main
+	Not main
 	EOF
 	test_cmp expect actual
 '
 
 test_expect_success 'check %(if:notequals=<string>)' '
-	git for-each-ref --format="%(if:notequals=master)%(refname:short)%(then)Not master%(else)Found master%(end)" refs/heads/ >actual &&
+	git for-each-ref --format="%(if:notequals=main)%(refname:short)%(then)Not main%(else)Found main%(end)" refs/heads/ >actual &&
 	cat >expect <<-\EOF &&
-	Found master
-	Not master
+	Found main
+	Not main
 	EOF
 	test_cmp expect actual
 '
@@ -443,11 +443,11 @@ test_expect_success '--merged is compatible with --no-merged' '
 
 test_expect_success 'validate worktree atom' '
 	cat >expect <<-EOF &&
-	master: $(pwd)
-	master_worktree: $(pwd)/worktree_dir
+	main: $(pwd)
+	main_worktree: $(pwd)/worktree_dir
 	side: not checked out
 	EOF
-	git worktree add -b master_worktree worktree_dir master &&
+	git worktree add -b main_worktree worktree_dir main &&
 	git for-each-ref --format="%(refname:short): %(if)%(worktreepath)%(then)%(worktreepath)%(else)not checked out%(end)" refs/heads/ >actual &&
 	rm -r worktree_dir &&
 	git worktree prune &&
diff --git a/t/test-lib.sh b/t/test-lib.sh
index a78ff1e57e..307b75eafe 100644
--- a/t/test-lib.sh
+++ b/t/test-lib.sh
@@ -257,13 +257,13 @@ case "$TRASH_DIRECTORY" in
 esac
 
 case "$TEST_NUMBER" in
-3404|4013|5310)
+3404|4013|5310|6300)
 	# Avoid conflicts with patch series that are cooking at the same time
 	# as the patch series changing the default of `init.defaultBranch`.
 	GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
 	export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 	;;
-[0-5]*)
+[0-5]*|6[0-3]*)
 	GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 	export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 	;;
-- 
gitgitgadget


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH 18/28] t64*: preemptively adjust alignment to prepare for `master` -> `main`
  2020-11-12 22:43 [PATCH 00/28] Use main as default branch name Johannes Schindelin via GitGitGadget
                   ` (16 preceding siblings ...)
  2020-11-12 22:43 ` [PATCH 17/28] t6[0-3]*: " Johannes Schindelin via GitGitGadget
@ 2020-11-12 22:43 ` Johannes Schindelin via GitGitGadget
  2020-11-12 22:43 ` [PATCH 19/28] t6[4-9]*: adjust the references to the default branch name "main" Johannes Schindelin via GitGitGadget
                   ` (14 subsequent siblings)
  32 siblings, 0 replies; 163+ messages in thread
From: Johannes Schindelin via GitGitGadget @ 2020-11-12 22:43 UTC (permalink / raw)
  To: git; +Cc: Johannes Schindelin, Johannes Schindelin

From: Johannes Schindelin <johannes.schindelin@gmx.de>

We are in the process of renaming the default branch name to `main`,
which is two characters shorter than `master`. Therefore, some lines
need to be adjusted in t6416, t6422 and t6427 that want to align text
involving the default branch name.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
---
 t/t6416-recursive-corner-cases.sh    | 8 ++++----
 t/t6422-merge-rename-corner-cases.sh | 4 ++--
 t/t6427-diff3-conflict-markers.sh    | 4 ++--
 3 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/t/t6416-recursive-corner-cases.sh b/t/t6416-recursive-corner-cases.sh
index 887c2195a9..dbccc3158a 100755
--- a/t/t6416-recursive-corner-cases.sh
+++ b/t/t6416-recursive-corner-cases.sh
@@ -385,7 +385,7 @@ test_expect_success 'git detects conflict merging criss-cross+modify/delete' '
 		test_line_count = 2 out &&
 
 		git rev-parse >expect       \
-			master:file  B:file &&
+			master:file    B:file &&
 		git rev-parse   >actual      \
 			:1:file      :2:file &&
 		test_cmp expect actual
@@ -407,7 +407,7 @@ test_expect_success 'git detects conflict merging criss-cross+modify/delete, rev
 		test_line_count = 2 out &&
 
 		git rev-parse >expect       \
-			master:file  B:file &&
+			master:file    B:file &&
 		git rev-parse   >actual      \
 			:1:file      :3:file &&
 		test_cmp expect actual
@@ -1553,7 +1553,7 @@ test_expect_failure 'check conflicting modes for regular file' '
 # Setup:
 #          L1---L2
 #         /  \ /  \
-#   master    X    ?
+#     master    X    ?
 #         \  / \  /
 #          R1---R2
 #
@@ -1748,7 +1748,7 @@ test_expect_success 'check nested conflicts' '
 # Setup:
 #          L1---L2---L3
 #         /  \ /  \ /  \
-#   master    X1   X2   ?
+#     master    X1   X2   ?
 #         \  / \  / \  /
 #          R1---R2---R3
 #
diff --git a/t/t6422-merge-rename-corner-cases.sh b/t/t6422-merge-rename-corner-cases.sh
index 78bfaf17f0..e40a1b686f 100755
--- a/t/t6422-merge-rename-corner-cases.sh
+++ b/t/t6422-merge-rename-corner-cases.sh
@@ -1130,7 +1130,7 @@ test_conflicts_with_adds_and_renames() {
 	# Setup:
 	#          L
 	#         / \
-	#   master   ?
+	#     master   ?
 	#         \ /
 	#          R
 	#
@@ -1290,7 +1290,7 @@ test_conflicts_with_adds_and_renames add    add
 # Setup:
 #          L
 #         / \
-#   master   ?
+#     master   ?
 #         \ /
 #          R
 #
diff --git a/t/t6427-diff3-conflict-markers.sh b/t/t6427-diff3-conflict-markers.sh
index f4655bb358..f7620e677c 100755
--- a/t/t6427-diff3-conflict-markers.sh
+++ b/t/t6427-diff3-conflict-markers.sh
@@ -43,7 +43,7 @@ test_expect_success 'check no merge base' '
 # Setup:
 #          L1
 #         /  \
-#   master    ?
+#     master    ?
 #         \  /
 #          R1
 #
@@ -101,7 +101,7 @@ test_expect_success 'check unique merge base' '
 # Setup:
 #          L1---L2--L3
 #         /  \ /      \
-#   master    X1       ?
+#     master    X1       ?
 #         \  / \      /
 #          R1---R2--R3
 #
-- 
gitgitgadget


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH 19/28] t6[4-9]*: adjust the references to the default branch name "main"
  2020-11-12 22:43 [PATCH 00/28] Use main as default branch name Johannes Schindelin via GitGitGadget
                   ` (17 preceding siblings ...)
  2020-11-12 22:43 ` [PATCH 18/28] t64*: preemptively adjust alignment to prepare for `master` -> `main` Johannes Schindelin via GitGitGadget
@ 2020-11-12 22:43 ` Johannes Schindelin via GitGitGadget
  2020-11-12 22:43 ` [PATCH 20/28] t7[0-4]*: " Johannes Schindelin via GitGitGadget
                   ` (13 subsequent siblings)
  32 siblings, 0 replies; 163+ messages in thread
From: Johannes Schindelin via GitGitGadget @ 2020-11-12 22:43 UTC (permalink / raw)
  To: git; +Cc: Johannes Schindelin, Johannes Schindelin

From: Johannes Schindelin <johannes.schindelin@gmx.de>

This trick was performed via

	$ (cd t &&
	   sed -i -e 's/master/main/g' -e 's/MASTER/MAIN/g' \
		-e 's/Master/Main/g' -- t6[4-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>
---
 t/t6400-merge-df.sh                       |  6 +--
 t/t6402-merge-rename.sh                   | 46 +++++++++++------------
 t/t6404-recursive-merge.sh                |  4 +-
 t/t6405-merge-symlinks.sh                 | 14 +++----
 t/t6406-merge-attr.sh                     | 24 ++++++------
 t/t6407-merge-binary.sh                   |  6 +--
 t/t6409-merge-subtree.sh                  | 16 ++++----
 t/t6411-merge-filemode.sh                 | 10 ++---
 t/t6412-merge-large-rename.sh             |  6 +--
 t/t6413-merge-crlf.sh                     |  2 +-
 t/t6414-merge-rename-nocruft.sh           |  2 +-
 t/t6415-merge-dir-to-symlink.sh           | 22 +++++------
 t/t6416-recursive-corner-cases.sh         | 28 +++++++-------
 t/t6417-merge-ours-theirs.sh              | 28 +++++++-------
 t/t6418-merge-text-auto.sh                | 12 +++---
 t/t6419-merge-ignorecase.sh               | 10 ++---
 t/t6422-merge-rename-corner-cases.sh      | 12 +++---
 t/t6425-merge-rename-delete.sh            |  2 +-
 t/t6427-diff3-conflict-markers.sh         | 14 +++----
 t/t6430-merge-recursive.sh                | 18 ++++-----
 t/t6432-merge-recursive-space-options.sh  |  6 +--
 t/t6433-merge-toplevel.sh                 |  8 ++--
 t/t6434-merge-recursive-rename-options.sh |  6 +--
 t/t6436-merge-overwrite.sh                |  2 +-
 t/t6437-submodule-merge.sh                | 14 +++----
 t/t6439-merge-co-error-msgs.sh            |  6 +--
 t/t6501-freshen-objects.sh                |  2 +-
 t/test-lib.sh                             |  2 +-
 28 files changed, 164 insertions(+), 164 deletions(-)

diff --git a/t/t6400-merge-df.sh b/t/t6400-merge-df.sh
index 9da0838216..f7907df3af 100755
--- a/t/t6400-merge-df.sh
+++ b/t/t6400-merge-df.sh
@@ -24,12 +24,12 @@ test_expect_success 'prepare repository' '
 '
 
 test_expect_success 'Merge with d/f conflicts' '
-	test_expect_code 1 git merge -m "merge msg" master
+	test_expect_code 1 git merge -m "merge msg" main
 '
 
 test_expect_success 'F/D conflict' '
 	git reset --hard &&
-	git checkout master &&
+	git checkout main &&
 	rm .git/index &&
 
 	mkdir before &&
@@ -47,7 +47,7 @@ test_expect_success 'F/D conflict' '
 	git add . &&
 	git commit -m para &&
 
-	git merge master
+	git merge main
 '
 
 test_expect_success 'setup modify/delete + directory/file conflict' '
diff --git a/t/t6402-merge-rename.sh b/t/t6402-merge-rename.sh
index 3f64f62224..82b1b00d5b 100755
--- a/t/t6402-merge-rename.sh
+++ b/t/t6402-merge-rename.sh
@@ -54,9 +54,9 @@ test_expect_success 'setup' '
 	git branch change &&
 	git branch change+rename &&
 
-	sed -e "/^g /s/.*/g : master changes a line/" <A >A+ &&
+	sed -e "/^g /s/.*/g : main changes a line/" <A >A+ &&
 	mv A+ A &&
-	git commit -a -m "master updates A" &&
+	git commit -a -m "main updates A" &&
 
 	git checkout yellow &&
 	rm -f M &&
@@ -94,7 +94,7 @@ test_expect_success 'setup' '
 	git update-index --add B &&
 	git commit -q -a -m "changed and renamed" &&
 
-	git checkout master
+	git checkout main
 '
 
 test_expect_success 'pull renaming branch into unrenaming one' \
@@ -109,7 +109,7 @@ test_expect_success 'pull renaming branch into unrenaming one' \
 	sed -ne "/^g/{
 	p
 	q
-	}" B | grep master &&
+	}" B | grep main &&
 	git diff --exit-code white N
 '
 
@@ -134,7 +134,7 @@ test_expect_success 'pull unrenaming branch into renaming one' \
 '
 	git reset --hard &&
 	git show-branch &&
-	test_expect_code 1 git pull . master &&
+	test_expect_code 1 git pull . main &&
 	git ls-files -u B >b.stages &&
 	test_line_count = 3 b.stages &&
 	git ls-files -s N >n.stages &&
@@ -187,7 +187,7 @@ test_expect_success 'interference with untracked working tree file' '
 test_expect_success 'interference with untracked working tree file' '
 	git reset --hard &&
 	rm -f A M &&
-	git checkout -f master &&
+	git checkout -f main &&
 	git tag -f anchor &&
 	git show-branch &&
 	git pull . yellow &&
@@ -198,7 +198,7 @@ test_expect_success 'interference with untracked working tree file' '
 test_expect_success 'updated working tree file should prevent the merge' '
 	git reset --hard &&
 	rm -f A M &&
-	git checkout -f master &&
+	git checkout -f main &&
 	git tag -f anchor &&
 	git show-branch &&
 	echo >>M one line addition &&
@@ -211,7 +211,7 @@ test_expect_success 'updated working tree file should prevent the merge' '
 test_expect_success 'updated working tree file should prevent the merge' '
 	git reset --hard &&
 	rm -f A M &&
-	git checkout -f master &&
+	git checkout -f main &&
 	git tag -f anchor &&
 	git show-branch &&
 	echo >>M one line addition &&
@@ -229,7 +229,7 @@ test_expect_success 'interference with untracked working tree file' '
 	git tag -f anchor &&
 	git show-branch &&
 	echo >M this file should not matter &&
-	git pull . master &&
+	git pull . main &&
 	test_path_is_file M &&
 	! {
 		git ls-files -s |
@@ -764,7 +764,7 @@ test_expect_success 'setup avoid unnecessary update, dir->(file,nothing)' '
 	git rm -rf df &&
 	git commit -mB &&
 
-	git checkout master &&
+	git checkout main &&
 	git rm -rf df &&
 	echo bla >df &&
 	git add -A &&
@@ -772,7 +772,7 @@ test_expect_success 'setup avoid unnecessary update, dir->(file,nothing)' '
 '
 
 test_expect_success 'avoid unnecessary update, dir->(file,nothing)' '
-	git checkout -q master^0 &&
+	git checkout -q main^0 &&
 	test-tool chmtime --get -3600 df >expect &&
 	git merge side &&
 	test-tool chmtime --get df >actual &&
@@ -794,14 +794,14 @@ test_expect_success 'setup avoid unnecessary update, modify/delete' '
 	git rm -f file &&
 	git commit -m "Delete file" &&
 
-	git checkout master &&
+	git checkout main &&
 	echo bla >file &&
 	git add -A &&
 	git commit -m "Modify file"
 '
 
 test_expect_success 'avoid unnecessary update, modify/delete' '
-	git checkout -q master^0 &&
+	git checkout -q main^0 &&
 	test-tool chmtime --get -3600 file >expect &&
 	test_must_fail git merge side &&
 	test-tool chmtime --get file >actual &&
@@ -823,13 +823,13 @@ test_expect_success 'setup avoid unnecessary update, rename/add-dest' '
 	git add -A &&
 	git commit -m "Add file copy" &&
 
-	git checkout master &&
+	git checkout main &&
 	git mv file newfile &&
 	git commit -m "Rename file"
 '
 
 test_expect_success 'avoid unnecessary update, rename/add-dest' '
-	git checkout -q master^0 &&
+	git checkout -q main^0 &&
 	test-tool chmtime --get -3600 newfile >expect &&
 	git merge side &&
 	test-tool chmtime --get newfile >actual &&
@@ -879,15 +879,15 @@ test_expect_success 'setup for use of extended merge markers' '
 	git mv original_file renamed_file &&
 	git commit -mB &&
 
-	git checkout master &&
+	git checkout main &&
 	echo 8.5 >>original_file &&
 	git add original_file &&
 	git commit -mC
 '
 
-test_expect_success 'merge master into rename has correct extended markers' '
+test_expect_success 'merge main into rename has correct extended markers' '
 	git checkout rename^0 &&
-	test_must_fail git merge -s recursive master^0 &&
+	test_must_fail git merge -s recursive main^0 &&
 
 	cat >expected <<-\EOF &&
 	1
@@ -902,14 +902,14 @@ test_expect_success 'merge master into rename has correct extended markers' '
 	9
 	=======
 	8.5
-	>>>>>>> master^0:original_file
+	>>>>>>> main^0:original_file
 	EOF
 	test_cmp expected renamed_file
 '
 
-test_expect_success 'merge rename into master has correct extended markers' '
+test_expect_success 'merge rename into main has correct extended markers' '
 	git reset --hard &&
-	git checkout master^0 &&
+	git checkout main^0 &&
 	test_must_fail git merge -s recursive rename^0 &&
 
 	cat >expected <<-\EOF &&
@@ -945,13 +945,13 @@ test_expect_success 'setup spurious "refusing to lose untracked" message' '
 	git mv original_file renamed_file &&
 	git commit -mB &&
 
-	git checkout master &&
+	git checkout main &&
 	git rm original_file &&
 	git commit -mC
 '
 
 test_expect_success 'no spurious "refusing to lose untracked" message' '
-	git checkout master^0 &&
+	git checkout main^0 &&
 	test_must_fail git merge rename^0 2>errors.txt &&
 	! grep "refusing to lose untracked file" errors.txt
 '
diff --git a/t/t6404-recursive-merge.sh b/t/t6404-recursive-merge.sh
index b1c3d4dda4..410a17865b 100755
--- a/t/t6404-recursive-merge.sh
+++ b/t/t6404-recursive-merge.sh
@@ -19,11 +19,11 @@ test_expect_success 'setup tests' '
 	git add a1 &&
 	GIT_AUTHOR_DATE="2006-12-12 23:00:00" git commit -m 1 a1 &&
 
-	git checkout -b A master &&
+	git checkout -b A main &&
 	echo A >a1 &&
 	GIT_AUTHOR_DATE="2006-12-12 23:00:01" git commit -m A a1 &&
 
-	git checkout -b B master &&
+	git checkout -b B main &&
 	echo B >a1 &&
 	GIT_AUTHOR_DATE="2006-12-12 23:00:02" git commit -m B a1 &&
 
diff --git a/t/t6405-merge-symlinks.sh b/t/t6405-merge-symlinks.sh
index 6c0a90d044..160c2c10f6 100755
--- a/t/t6405-merge-symlinks.sh
+++ b/t/t6405-merge-symlinks.sh
@@ -19,7 +19,7 @@ test_expect_success 'setup' '
 	git branch b-file &&
 	l=$(printf file | git hash-object -t blob -w --stdin) &&
 	echo "120000 $l	symlink" | git update-index --index-info &&
-	git commit -m master &&
+	git commit -m main &&
 	git checkout b-symlink &&
 	l=$(printf file-different | git hash-object -t blob -w --stdin) &&
 	echo "120000 $l	symlink" | git update-index --index-info &&
@@ -30,28 +30,28 @@ test_expect_success 'setup' '
 	git commit -m b-file
 '
 
-test_expect_success 'merge master into b-symlink, which has a different symbolic link' '
+test_expect_success 'merge main into b-symlink, which has a different symbolic link' '
 	git checkout b-symlink &&
-	test_must_fail git merge master
+	test_must_fail git merge main
 '
 
 test_expect_success 'the merge result must be a file' '
 	test_path_is_file symlink
 '
 
-test_expect_success 'merge master into b-file, which has a file instead of a symbolic link' '
+test_expect_success 'merge main into b-file, which has a file instead of a symbolic link' '
 	git reset --hard &&
 	git checkout b-file &&
-	test_must_fail git merge master
+	test_must_fail git merge main
 '
 
 test_expect_success 'the merge result must be a file' '
 	test_path_is_file symlink
 '
 
-test_expect_success 'merge b-file, which has a file instead of a symbolic link, into master' '
+test_expect_success 'merge b-file, which has a file instead of a symbolic link, into main' '
 	git reset --hard &&
-	git checkout master &&
+	git checkout main &&
 	test_must_fail git merge b-file
 '
 
diff --git a/t/t6406-merge-attr.sh b/t/t6406-merge-attr.sh
index 76a55f838c..c559b5a3e6 100755
--- a/t/t6406-merge-attr.sh
+++ b/t/t6406-merge-attr.sh
@@ -19,10 +19,10 @@ test_expect_success setup '
 	git branch side &&
 	for f in text binary union
 	do
-		echo Master >>$f && git add $f || return 1
+		echo Main >>$f && git add $f || return 1
 	done &&
 	test_tick &&
-	git commit -m Master &&
+	git commit -m Main &&
 
 	git checkout side &&
 	for f in text binary union
@@ -64,7 +64,7 @@ test_expect_success merge '
 		echo "union merge=union"
 	} >.gitattributes &&
 
-	if git merge master
+	if git merge main
 	then
 		echo Gaah, should have conflicted
 		false
@@ -87,7 +87,7 @@ test_expect_success 'check merge result in working tree' '
 	grep "<<<<<<<" text &&
 	cmp binary-orig binary &&
 	! grep "<<<<<<<" union &&
-	grep Master union &&
+	grep Main union &&
 	grep Side union
 
 '
@@ -115,13 +115,13 @@ test_expect_success 'custom merge backend' '
 	git config --replace-all \
 	merge.custom.name "custom merge driver for testing" &&
 
-	git merge master &&
+	git merge main &&
 
 	cmp binary union &&
 	sed -e 1,3d text >check-1 &&
-	o=$(git unpack-file master^:text) &&
+	o=$(git unpack-file main^:text) &&
 	a=$(git unpack-file side^:text) &&
-	b=$(git unpack-file master:text) &&
+	b=$(git unpack-file main:text) &&
 	sh -c "./custom-merge $o $a $b 0 text" &&
 	sed -e 1,3d $a >check-2 &&
 	cmp check-1 check-2 &&
@@ -136,7 +136,7 @@ test_expect_success 'custom merge backend' '
 	git config --replace-all \
 	merge.custom.name "custom merge driver for testing" &&
 
-	if git merge master
+	if git merge main
 	then
 		echo "Eh? should have conflicted"
 		false
@@ -146,9 +146,9 @@ test_expect_success 'custom merge backend' '
 
 	cmp binary union &&
 	sed -e 1,3d text >check-1 &&
-	o=$(git unpack-file master^:text) &&
+	o=$(git unpack-file main^:text) &&
 	a=$(git unpack-file anchor:text) &&
-	b=$(git unpack-file master:text) &&
+	b=$(git unpack-file main:text) &&
 	sh -c "./custom-merge $o $a $b 0 text" &&
 	sed -e 1,3d $a >check-2 &&
 	cmp check-1 check-2 &&
@@ -176,7 +176,7 @@ test_expect_success 'up-to-date merge without common ancestor' '
 	test_tick &&
 	(
 		cd repo1 &&
-		git fetch ../repo2 master &&
+		git fetch ../repo2 main &&
 		git merge --allow-unrelated-histories FETCH_HEAD
 	)
 '
@@ -201,7 +201,7 @@ test_expect_success 'custom merge does not lock index' '
 	# By packaging the command in test_when_finished, we get both
 	# the correctness check and the clean-up.
 	test_when_finished "kill \$(cat sleep.pid)" &&
-	git merge master
+	git merge main
 '
 
 test_done
diff --git a/t/t6407-merge-binary.sh b/t/t6407-merge-binary.sh
index 4e6c7cb77e..a76c85ec1e 100755
--- a/t/t6407-merge-binary.sh
+++ b/t/t6407-merge-binary.sh
@@ -20,7 +20,7 @@ test_expect_success setup '
 	git ls-files -s a >E0 &&
 	git ls-files -s m | sed -e "s/ 0	/ 3	/" >E3 &&
 	test_tick &&
-	git commit -m "master adds some" &&
+	git commit -m "main adds some" &&
 
 	git checkout side &&
 	echo rezrov >>m &&
@@ -39,7 +39,7 @@ test_expect_success resolve '
 	rm -f a* m* &&
 	git reset --hard anchor &&
 
-	if git merge -s resolve master
+	if git merge -s resolve main
 	then
 		echo Oops, should not have succeeded
 		false
@@ -54,7 +54,7 @@ test_expect_success recursive '
 	rm -f a* m* &&
 	git reset --hard anchor &&
 
-	if git merge -s recursive master
+	if git merge -s recursive main
 	then
 		echo Oops, should not have succeeded
 		false
diff --git a/t/t6409-merge-subtree.sh b/t/t6409-merge-subtree.sh
index b8e8b6f642..55ae58584a 100755
--- a/t/t6409-merge-subtree.sh
+++ b/t/t6409-merge-subtree.sh
@@ -14,10 +14,10 @@ test_expect_success setup '
 	echo >>hello world &&
 	git add hello &&
 	git commit -m second &&
-	git checkout master &&
+	git checkout main &&
 	for i in mundo $s; do echo $i; done >hello &&
 	git add hello &&
-	git commit -m master
+	git commit -m main
 
 '
 
@@ -36,7 +36,7 @@ test_expect_success 'setup branch sub' '
 '
 
 test_expect_success 'setup topic branch' '
-	git checkout -b topic master &&
+	git checkout -b topic main &&
 	git merge -s ours --no-commit --allow-unrelated-histories sub &&
 	git read-tree --prefix=dir/ -u sub &&
 	git commit -m "initial merge of sub into topic" &&
@@ -77,8 +77,8 @@ test_expect_success 'setup' '
 
 test_expect_success 'initial merge' '
 	git remote add -f gui ../git-gui &&
-	git merge -s ours --no-commit --allow-unrelated-histories gui/master &&
-	git read-tree --prefix=git-gui/ -u gui/master &&
+	git merge -s ours --no-commit --allow-unrelated-histories gui/main &&
+	git read-tree --prefix=git-gui/ -u gui/main &&
 	git commit -m "Merge git-gui as our subdirectory" &&
 	git checkout -b work &&
 	git ls-files -s >actual &&
@@ -108,10 +108,10 @@ test_expect_success 'merge update' '
 
 test_expect_success 'initial ambiguous subtree' '
 	cd ../git &&
-	git reset --hard master &&
+	git reset --hard main &&
 	git checkout -b topic_2 &&
-	git merge -s ours --no-commit gui/master &&
-	git read-tree --prefix=git-gui2/ -u gui/master &&
+	git merge -s ours --no-commit gui/main &&
+	git read-tree --prefix=git-gui2/ -u gui/main &&
 	git commit -m "Merge git-gui2 as our subdirectory" &&
 	git checkout -b work2 &&
 	git ls-files -s >actual &&
diff --git a/t/t6411-merge-filemode.sh b/t/t6411-merge-filemode.sh
index 87741efad3..7ded226de4 100755
--- a/t/t6411-merge-filemode.sh
+++ b/t/t6411-merge-filemode.sh
@@ -7,11 +7,11 @@ test_expect_success 'set up mode change in one branch' '
 	: >file1 &&
 	git add file1 &&
 	git commit -m initial &&
-	git checkout -b a1 master &&
+	git checkout -b a1 main &&
 	: >dummy &&
 	git add dummy &&
 	git commit -m a &&
-	git checkout -b b1 master &&
+	git checkout -b b1 main &&
 	test_chmod +x file1 &&
 	git add file1 &&
 	git commit -m b1
@@ -39,12 +39,12 @@ do_one_mode resolve b1 a1
 
 test_expect_success 'set up mode change in both branches' '
 	git reset --hard HEAD &&
-	git checkout -b a2 master &&
+	git checkout -b a2 main &&
 	: >file2 &&
 	H=$(git hash-object file2) &&
 	test_chmod +x file2 &&
 	git commit -m a2 &&
-	git checkout -b b2 master &&
+	git checkout -b b2 main &&
 	: >file2 &&
 	git add file2 &&
 	git commit -m b2 &&
@@ -76,7 +76,7 @@ do_both_modes resolve
 
 test_expect_success 'set up delete/modechange scenario' '
 	git reset --hard &&
-	git checkout -b deletion master &&
+	git checkout -b deletion main &&
 	git rm file1 &&
 	git commit -m deletion
 '
diff --git a/t/t6412-merge-large-rename.sh b/t/t6412-merge-large-rename.sh
index 80777386dc..489ebd9bb7 100755
--- a/t/t6412-merge-large-rename.sh
+++ b/t/t6412-merge-large-rename.sh
@@ -30,7 +30,7 @@ test_rename() {
 	test_expect_success "rename ($1, $2)" '
 	n='$1' &&
 	expect='$2' &&
-	git checkout -f master &&
+	git checkout -f main &&
 	test_might_fail git branch -D test$n &&
 	git reset --hard initial &&
 	for i in $(count $n); do
@@ -50,8 +50,8 @@ test_rename() {
 	git add . &&
 	git commit -m change+rename=$n &&
 	case "$expect" in
-		ok) git merge master ;;
-		 *) test_must_fail git merge master ;;
+		ok) git merge main ;;
+		 *) test_must_fail git merge main ;;
 	esac
 	'
 }
diff --git a/t/t6413-merge-crlf.sh b/t/t6413-merge-crlf.sh
index e8d65eefb5..feaf9ef1a0 100755
--- a/t/t6413-merge-crlf.sh
+++ b/t/t6413-merge-crlf.sh
@@ -24,7 +24,7 @@ test_expect_success setup '
 	echo line from b | append_cr >file &&
 	git commit -m "add line from b" file &&
 	git tag b &&
-	git checkout master
+	git checkout main
 '
 
 test_expect_success 'Check "ours" is CRLF' '
diff --git a/t/t6414-merge-rename-nocruft.sh b/t/t6414-merge-rename-nocruft.sh
index a25e730460..81fa89331c 100755
--- a/t/t6414-merge-rename-nocruft.sh
+++ b/t/t6414-merge-rename-nocruft.sh
@@ -65,7 +65,7 @@ test_expect_success 'setup' '
 	git update-index A &&
 	git commit -m "blue modify A" &&
 
-	git checkout master
+	git checkout main
 '
 
 # This test broke in 65ac6e9c3f47807cb603af07a6a9e1a43bc119ae
diff --git a/t/t6415-merge-dir-to-symlink.sh b/t/t6415-merge-dir-to-symlink.sh
index 2eddcc7664..3bbabbee49 100755
--- a/t/t6415-merge-dir-to-symlink.sh
+++ b/t/t6415-merge-dir-to-symlink.sh
@@ -19,7 +19,7 @@ test_expect_success 'create a commit where dir a/b changed to symlink' '
 
 test_expect_success 'checkout does not clobber untracked symlink' '
 	git checkout HEAD^0 &&
-	git reset --hard master &&
+	git reset --hard main &&
 	git rm --cached a/b &&
 	git commit -m "untracked symlink remains" &&
 	test_must_fail git checkout start^0
@@ -27,7 +27,7 @@ test_expect_success 'checkout does not clobber untracked symlink' '
 
 test_expect_success 'a/b-2/c/d is kept when clobbering symlink b' '
 	git checkout HEAD^0 &&
-	git reset --hard master &&
+	git reset --hard main &&
 	git rm --cached a/b &&
 	git commit -m "untracked symlink remains" &&
 	git checkout -f start^0 &&
@@ -36,7 +36,7 @@ test_expect_success 'a/b-2/c/d is kept when clobbering symlink b' '
 
 test_expect_success 'checkout should not have deleted a/b-2/c/d' '
 	git checkout HEAD^0 &&
-	git reset --hard master &&
+	git reset --hard main &&
 	 git checkout start^0 &&
 	 test_path_is_file a/b-2/c/d
 '
@@ -53,7 +53,7 @@ test_expect_success 'setup for merge test' '
 test_expect_success 'Handle D/F conflict, do not lose a/b-2/c/d in merge (resolve)' '
 	git reset --hard &&
 	git checkout baseline^0 &&
-	git merge -s resolve master &&
+	git merge -s resolve main &&
 	test_path_is_file a/b-2/c/d
 '
 
@@ -64,7 +64,7 @@ test_expect_success SYMLINKS 'a/b was resolved as symlink' '
 test_expect_success 'Handle D/F conflict, do not lose a/b-2/c/d in merge (recursive)' '
 	git reset --hard &&
 	git checkout baseline^0 &&
-	git merge -s recursive master &&
+	git merge -s recursive main &&
 	test_path_is_file a/b-2/c/d
 '
 
@@ -74,7 +74,7 @@ test_expect_success SYMLINKS 'a/b was resolved as symlink' '
 
 test_expect_success 'Handle F/D conflict, do not lose a/b-2/c/d in merge (resolve)' '
 	git reset --hard &&
-	git checkout master^0 &&
+	git checkout main^0 &&
 	git merge -s resolve baseline^0 &&
 	test_path_is_file a/b-2/c/d
 '
@@ -85,7 +85,7 @@ test_expect_success SYMLINKS 'a/b was resolved as symlink' '
 
 test_expect_success 'Handle F/D conflict, do not lose a/b-2/c/d in merge (recursive)' '
 	git reset --hard &&
-	git checkout master^0 &&
+	git checkout main^0 &&
 	git merge -s recursive baseline^0 &&
 	test_path_is_file a/b-2/c/d
 '
@@ -98,7 +98,7 @@ test_expect_failure 'do not lose untracked in merge (resolve)' '
 	git reset --hard &&
 	git checkout baseline^0 &&
 	>a/b/c/e &&
-	test_must_fail git merge -s resolve master &&
+	test_must_fail git merge -s resolve main &&
 	test_path_is_file a/b/c/e &&
 	test_path_is_file a/b-2/c/d
 '
@@ -107,7 +107,7 @@ test_expect_success 'do not lose untracked in merge (recursive)' '
 	git reset --hard &&
 	git checkout baseline^0 &&
 	>a/b/c/e &&
-	test_must_fail git merge -s recursive master &&
+	test_must_fail git merge -s recursive main &&
 	test_path_is_file a/b/c/e &&
 	test_path_is_file a/b-2/c/d
 '
@@ -116,14 +116,14 @@ test_expect_success 'do not lose modifications in merge (resolve)' '
 	git reset --hard &&
 	git checkout baseline^0 &&
 	echo more content >>a/b/c/d &&
-	test_must_fail git merge -s resolve master
+	test_must_fail git merge -s resolve main
 '
 
 test_expect_success 'do not lose modifications in merge (recursive)' '
 	git reset --hard &&
 	git checkout baseline^0 &&
 	echo more content >>a/b/c/d &&
-	test_must_fail git merge -s recursive master
+	test_must_fail git merge -s recursive main
 '
 
 test_expect_success 'setup a merge where dir a/b-2 changed to symlink' '
diff --git a/t/t6416-recursive-corner-cases.sh b/t/t6416-recursive-corner-cases.sh
index dbccc3158a..b43ecb38b7 100755
--- a/t/t6416-recursive-corner-cases.sh
+++ b/t/t6416-recursive-corner-cases.sh
@@ -385,7 +385,7 @@ test_expect_success 'git detects conflict merging criss-cross+modify/delete' '
 		test_line_count = 2 out &&
 
 		git rev-parse >expect       \
-			master:file    B:file &&
+			main:file    B:file &&
 		git rev-parse   >actual      \
 			:1:file      :2:file &&
 		test_cmp expect actual
@@ -407,7 +407,7 @@ test_expect_success 'git detects conflict merging criss-cross+modify/delete, rev
 		test_line_count = 2 out &&
 
 		git rev-parse >expect       \
-			master:file    B:file &&
+			main:file    B:file &&
 		git rev-parse   >actual      \
 			:1:file      :3:file &&
 		test_cmp expect actual
@@ -1553,12 +1553,12 @@ test_expect_failure 'check conflicting modes for regular file' '
 # Setup:
 #          L1---L2
 #         /  \ /  \
-#     master    X    ?
+#     main    X    ?
 #         \  / \  /
 #          R1---R2
 #
 # Where:
-#   master has two files, named 'b' and 'a'
+#   main has two files, named 'b' and 'a'
 #   branches L1 and R1 both modify each of the two files in conflicting ways
 #
 #   L2 is a merge of R1 into L1; more on it later.
@@ -1663,7 +1663,7 @@ test_expect_success 'check nested conflicts' '
 		cd nested_conflicts &&
 
 		git clean -f &&
-		MASTER=$(git rev-parse --short master) &&
+		MAIN=$(git rev-parse --short main) &&
 		git checkout L2^0 &&
 
 		# Merge must fail; there is a conflict
@@ -1679,24 +1679,24 @@ test_expect_success 'check nested conflicts' '
 		test_line_count = 1 out &&
 
 		# Create a and b from virtual merge base X
-		git cat-file -p master:a >base &&
+		git cat-file -p main:a >base &&
 		git cat-file -p L1:a >ours &&
 		git cat-file -p R1:a >theirs &&
 		test_must_fail git merge-file --diff3 \
 			-L "Temporary merge branch 1" \
-			-L "$MASTER"  \
+			-L "$MAIN"  \
 			-L "Temporary merge branch 2" \
 			ours  \
 			base  \
 			theirs &&
 		sed -e "s/^\([<|=>]\)/\1\1/" ours >vmb_a &&
 
-		git cat-file -p master:b >base &&
+		git cat-file -p main:b >base &&
 		git cat-file -p L1:b >ours &&
 		git cat-file -p R1:b >theirs &&
 		test_must_fail git merge-file --diff3 \
 			-L "Temporary merge branch 1" \
-			-L "$MASTER"  \
+			-L "$MAIN"  \
 			-L "Temporary merge branch 2" \
 			ours  \
 			base  \
@@ -1748,12 +1748,12 @@ test_expect_success 'check nested conflicts' '
 # Setup:
 #          L1---L2---L3
 #         /  \ /  \ /  \
-#     master    X1   X2   ?
+#     main    X1   X2   ?
 #         \  / \  / \  /
 #          R1---R2---R3
 #
 # Where:
-#   master has one file named 'content'
+#   main has one file named 'content'
 #   branches L1 and R1 both modify each of the two files in conflicting ways
 #
 #   L<n> (n>1) is a merge of R<n-1> into L<n-1>
@@ -1834,7 +1834,7 @@ test_expect_success 'check virtual merge base with nested conflicts' '
 	(
 		cd virtual_merge_base_has_nested_conflicts &&
 
-		MASTER=$(git rev-parse --short master) &&
+		MAIN=$(git rev-parse --short main) &&
 		git checkout L3^0 &&
 
 		# Merge must fail; there is a conflict
@@ -1857,13 +1857,13 @@ test_expect_success 'check virtual merge base with nested conflicts' '
 		# Imitate X1 merge base, except without long enough conflict
 		# markers because a subsequent sed will modify them.  Put
 		# result into vmb.
-		git cat-file -p master:content >base &&
+		git cat-file -p main:content >base &&
 		git cat-file -p L:content >left &&
 		git cat-file -p R:content >right &&
 		cp left merged-once &&
 		test_must_fail git merge-file --diff3 \
 			-L "Temporary merge branch 1" \
-			-L "$MASTER"  \
+			-L "$MAIN"  \
 			-L "Temporary merge branch 2" \
 			merged-once \
 			base        \
diff --git a/t/t6417-merge-ours-theirs.sh b/t/t6417-merge-ours-theirs.sh
index 0aebc6c028..4bb77b9779 100755
--- a/t/t6417-merge-ours-theirs.sh
+++ b/t/t6417-merge-ours-theirs.sh
@@ -20,11 +20,11 @@ test_expect_success setup '
 	sed -e "s/9/nueve/" >file <elif &&
 	git commit -a -m theirs &&
 
-	git checkout master^0
+	git checkout main^0
 '
 
 test_expect_success 'plain recursive - should conflict' '
-	git reset --hard master &&
+	git reset --hard main &&
 	test_must_fail git merge -s recursive side &&
 	grep nine file &&
 	grep nueve file &&
@@ -34,7 +34,7 @@ test_expect_success 'plain recursive - should conflict' '
 '
 
 test_expect_success 'recursive favouring theirs' '
-	git reset --hard master &&
+	git reset --hard main &&
 	git merge -s recursive -Xtheirs side &&
 	! grep nine file &&
 	grep nueve file &&
@@ -44,7 +44,7 @@ test_expect_success 'recursive favouring theirs' '
 '
 
 test_expect_success 'recursive favouring ours' '
-	git reset --hard master &&
+	git reset --hard main &&
 	git merge -s recursive -X ours side &&
 	grep nine file &&
 	! grep nueve file &&
@@ -56,26 +56,26 @@ test_expect_success 'recursive favouring ours' '
 test_expect_success 'binary file with -Xours/-Xtheirs' '
 	echo file binary >.gitattributes &&
 
-	git reset --hard master &&
+	git reset --hard main &&
 	git merge -s recursive -X theirs side &&
 	git diff --exit-code side HEAD -- file &&
 
-	git reset --hard master &&
+	git reset --hard main &&
 	git merge -s recursive -X ours side &&
-	git diff --exit-code master HEAD -- file
+	git diff --exit-code main HEAD -- file
 '
 
 test_expect_success 'pull passes -X to underlying merge' '
-	git reset --hard master && git pull -s recursive -Xours . side &&
-	git reset --hard master && git pull -s recursive -X ours . side &&
-	git reset --hard master && git pull -s recursive -Xtheirs . side &&
-	git reset --hard master && git pull -s recursive -X theirs . side &&
-	git reset --hard master && test_must_fail git pull -s recursive -X bork . side
+	git reset --hard main && git pull -s recursive -Xours . side &&
+	git reset --hard main && git pull -s recursive -X ours . side &&
+	git reset --hard main && git pull -s recursive -Xtheirs . side &&
+	git reset --hard main && git pull -s recursive -X theirs . side &&
+	git reset --hard main && test_must_fail git pull -s recursive -X bork . side
 '
 
 test_expect_success SYMLINKS 'symlink with -Xours/-Xtheirs' '
-	git reset --hard master &&
-	git checkout -b two master &&
+	git reset --hard main &&
+	git checkout -b two main &&
 	ln -s target-zero link &&
 	git add link &&
 	git commit -m "add link pointing to zero" &&
diff --git a/t/t6418-merge-text-auto.sh b/t/t6418-merge-text-auto.sh
index 30983d18b1..b8df80d2df 100755
--- a/t/t6418-merge-text-auto.sh
+++ b/t/t6418-merge-text-auto.sh
@@ -2,13 +2,13 @@
 
 test_description='CRLF merge conflict across text=auto change
 
-* [master] remove .gitattributes
+* [main] remove .gitattributes
  ! [side] add line from b
 --
  + [side] add line from b
-*  [master] remove .gitattributes
-*  [master^] add line from a
-*  [master~2] normalize file
+*  [main] remove .gitattributes
+*  [main^] add line from a
+*  [main~2] normalize file
 *+ [side^] Initial
 '
 
@@ -64,7 +64,7 @@ test_expect_success setup '
 	git commit -m "add line from b" &&
 	git tag b &&
 
-	git checkout master
+	git checkout main
 '
 
 test_expect_success 'set up fuzz_conflict() helper' '
@@ -195,7 +195,7 @@ test_expect_success 'Test delete/normalize conflict' '
 	git reset --hard initial &&
 	git rm file &&
 	git commit -m "remove file" &&
-	git checkout master &&
+	git checkout main &&
 	git reset --hard a^ &&
 	git merge side &&
 	test_path_is_missing file
diff --git a/t/t6419-merge-ignorecase.sh b/t/t6419-merge-ignorecase.sh
index 531850d834..d32bbb3359 100755
--- a/t/t6419-merge-ignorecase.sh
+++ b/t/t6419-merge-ignorecase.sh
@@ -20,18 +20,18 @@ test_expect_success 'merge with case-changing rename' '
 	>foo &&
 	git add foo &&
 	git commit -m "intervening commit" &&
-	git checkout master &&
+	git checkout main &&
 	git rm TestCase &&
 	>testcase &&
 	git add testcase &&
 	git commit -m "rename to testcase" &&
 	git checkout with-camel &&
-	git merge master -m "merge" &&
+	git merge main -m "merge" &&
 	test_path_is_file testcase
 '
 
 test_expect_success 'merge with case-changing rename on both sides' '
-	git checkout master &&
+	git checkout main &&
 	git reset --hard baseline &&
 	git branch -D with-camel &&
 	git checkout -b with-camel &&
@@ -40,13 +40,13 @@ test_expect_success 'merge with case-changing rename on both sides' '
 	>foo &&
 	git add foo &&
 	git commit -m "intervening commit" &&
-	git checkout master &&
+	git checkout main &&
 	git rm TestCase &&
 	>testcase &&
 	git add testcase &&
 	git commit -m "rename to testcase" &&
 	git checkout with-camel &&
-	git merge master -m "merge" &&
+	git merge main -m "merge" &&
 	test_path_is_file testcase
 '
 
diff --git a/t/t6422-merge-rename-corner-cases.sh b/t/t6422-merge-rename-corner-cases.sh
index e40a1b686f..21c64b51be 100755
--- a/t/t6422-merge-rename-corner-cases.sh
+++ b/t/t6422-merge-rename-corner-cases.sh
@@ -1130,7 +1130,7 @@ test_conflicts_with_adds_and_renames() {
 	# Setup:
 	#          L
 	#         / \
-	#     master   ?
+	#     main   ?
 	#         \ /
 	#          R
 	#
@@ -1260,7 +1260,7 @@ test_conflicts_with_adds_and_renames() {
 				:2:three           \
 				:3:three           &&
 			git rev-parse >expected        \
-				master:irrelevant_file \
+				main:irrelevant_file \
 				file_v2                \
 				file_v4                &&
 			test_cmp expected actual &&
@@ -1290,12 +1290,12 @@ test_conflicts_with_adds_and_renames add    add
 # Setup:
 #          L
 #         / \
-#     master   ?
+#     main   ?
 #         \ /
 #          R
 #
 # Where:
-#   master has two files, named 'one' and 'two'.
+#   main has two files, named 'one' and 'two'.
 #   branches L and R both modify 'one', in conflicting ways.
 #   branches L and R both modify 'two', in conflicting ways.
 #   branch L also renames 'one' to 'three'.
@@ -1376,7 +1376,7 @@ test_expect_success 'check nested conflicts from rename/rename(2to1)' '
 		test_line_count = 1 out &&
 
 		# Compare :2:three to expected values
-		git cat-file -p master:one >base &&
+		git cat-file -p main:one >base &&
 		git cat-file -p L:three >ours &&
 		git cat-file -p R:one >theirs &&
 		test_must_fail git merge-file    \
@@ -1387,7 +1387,7 @@ test_expect_success 'check nested conflicts from rename/rename(2to1)' '
 		test_cmp expect L-three &&
 
 		# Compare :2:three to expected values
-		git cat-file -p master:two >base &&
+		git cat-file -p main:two >base &&
 		git cat-file -p L:two >ours &&
 		git cat-file -p R:three >theirs &&
 		test_must_fail git merge-file    \
diff --git a/t/t6425-merge-rename-delete.sh b/t/t6425-merge-rename-delete.sh
index f79d021590..2d39bf630e 100755
--- a/t/t6425-merge-rename-delete.sh
+++ b/t/t6425-merge-rename-delete.sh
@@ -12,7 +12,7 @@ test_expect_success 'rename/delete' '
 	git mv A B &&
 	git commit -m "rename" &&
 
-	git checkout master &&
+	git checkout main &&
 	git rm A &&
 	git commit -m "delete" &&
 
diff --git a/t/t6427-diff3-conflict-markers.sh b/t/t6427-diff3-conflict-markers.sh
index f7620e677c..b28966d0f4 100755
--- a/t/t6427-diff3-conflict-markers.sh
+++ b/t/t6427-diff3-conflict-markers.sh
@@ -43,7 +43,7 @@ test_expect_success 'check no merge base' '
 # Setup:
 #          L1
 #         /  \
-#     master    ?
+#     main    ?
 #         \  /
 #          R1
 #
@@ -90,18 +90,18 @@ test_expect_success 'check unique merge base' '
 		cd unique_merge_base &&
 
 		git checkout L^0 &&
-		MASTER=$(git rev-parse --short master) &&
+		MAIN=$(git rev-parse --short main) &&
 
 		test_must_fail git -c merge.conflictstyle=diff3 merge -s recursive R^0 &&
 
-		grep "|||||| $MASTER:content" renamed
+		grep "|||||| $MAIN:content" renamed
 	)
 '
 
 # Setup:
 #          L1---L2--L3
 #         /  \ /      \
-#     master    X1       ?
+#     main    X1       ?
 #         \  / \      /
 #          R1---R2--R3
 #
@@ -191,10 +191,10 @@ test_expect_success 'rebase --merge describes parent of commit being picked' '
 	(
 		cd rebase &&
 		test_commit base file &&
-		test_commit master file &&
+		test_commit main file &&
 		git checkout -b side HEAD^ &&
 		test_commit side file &&
-		test_must_fail git -c merge.conflictstyle=diff3 rebase --merge master &&
+		test_must_fail git -c merge.conflictstyle=diff3 rebase --merge main &&
 		grep "||||||| parent of" file
 	)
 '
@@ -203,7 +203,7 @@ test_expect_success 'rebase --apply describes fake ancestor base' '
 	(
 		cd rebase &&
 		git rebase --abort &&
-		test_must_fail git -c merge.conflictstyle=diff3 rebase --apply master &&
+		test_must_fail git -c merge.conflictstyle=diff3 rebase --apply main &&
 		grep "||||||| constructed merge base" file
 	)
 '
diff --git a/t/t6430-merge-recursive.sh b/t/t6430-merge-recursive.sh
index 9c08e63af2..4bc8cc764b 100755
--- a/t/t6430-merge-recursive.sh
+++ b/t/t6430-merge-recursive.sh
@@ -35,7 +35,7 @@ test_expect_success 'setup 1' '
 	git add a d/e &&
 
 	test_tick &&
-	git commit -m "master modifies a and d/e" &&
+	git commit -m "main modifies a and d/e" &&
 	c1=$(git rev-parse --verify HEAD) &&
 	( git ls-tree -r HEAD && git ls-files -s ) >actual &&
 	(
@@ -466,7 +466,7 @@ test_expect_success SYMLINKS 'dir in working tree with symlink ancestor does not
 		git checkout -b branch1 &&
 		git commit --allow-empty -m "empty commit" &&
 
-		git checkout master &&
+		git checkout main &&
 		git rm foo &&
 		mkdir foo &&
 		>foo/bar &&
@@ -475,7 +475,7 @@ test_expect_success SYMLINKS 'dir in working tree with symlink ancestor does not
 
 		git checkout branch1 &&
 
-		git cherry-pick master &&
+		git cherry-pick main &&
 		test_path_is_dir foo &&
 		test_path_is_file foo/bar
 	)
@@ -490,8 +490,8 @@ test_expect_success 'reset and 3-way merge' '
 
 test_expect_success 'reset and bind merge' '
 
-	git reset --hard master &&
-	git read-tree --prefix=M/ master &&
+	git reset --hard main &&
+	git read-tree --prefix=M/ main &&
 	git ls-files -s >actual &&
 	(
 		echo "100644 $o1 0	M/a" &&
@@ -505,7 +505,7 @@ test_expect_success 'reset and bind merge' '
 	) >expected &&
 	test_cmp expected actual &&
 
-	git read-tree --prefix=a1/ master &&
+	git read-tree --prefix=a1/ main &&
 	git ls-files -s >actual &&
 	(
 		echo "100644 $o1 0	M/a" &&
@@ -523,7 +523,7 @@ test_expect_success 'reset and bind merge' '
 	) >expected &&
 	test_cmp expected actual &&
 
-	git read-tree --prefix=z/ master &&
+	git read-tree --prefix=z/ main &&
 	git ls-files -s >actual &&
 	(
 		echo "100644 $o1 0	M/a" &&
@@ -599,11 +599,11 @@ test_expect_success 'merge-recursive w/ empty work tree - theirs has rename' '
 
 test_expect_success 'merge removes empty directories' '
 
-	git reset --hard master &&
+	git reset --hard main &&
 	git checkout -b rm &&
 	git rm d/e &&
 	git commit -mremoved-d/e &&
-	git checkout master &&
+	git checkout main &&
 	git merge -s recursive rm &&
 	test_path_is_missing d
 '
diff --git a/t/t6432-merge-recursive-space-options.sh b/t/t6432-merge-recursive-space-options.sh
index b56180ee4a..4eda1dd444 100755
--- a/t/t6432-merge-recursive-space-options.sh
+++ b/t/t6432-merge-recursive-space-options.sh
@@ -2,11 +2,11 @@
 
 test_description='merge-recursive space options
 
-* [master] Clarify
+* [main] Clarify
  ! [remote] Remove cruft
 --
  + [remote] Remove cruft
-*  [master] Clarify
+*  [main] Clarify
 *+ [remote^] Initial revision
 *   ok 1: setup
 '
@@ -87,7 +87,7 @@ test_expect_success 'setup' '
 	mv text.txt+ text.txt &&
 	git commit -a -m "Remove cruft" &&
 
-	git checkout master &&
+	git checkout main &&
 	sed -e "
 			s/\(not in his right mind\),\(.*\)/\1;\2Q/
 			s/Quite correct\(.*\)/It is too correct\1Q/
diff --git a/t/t6433-merge-toplevel.sh b/t/t6433-merge-toplevel.sh
index e29c284b9b..fdbd095cde 100755
--- a/t/t6433-merge-toplevel.sh
+++ b/t/t6433-merge-toplevel.sh
@@ -5,7 +5,7 @@ test_description='"git merge" top-level frontend'
 . ./test-lib.sh
 
 t3033_reset () {
-	git checkout -B master two &&
+	git checkout -B main two &&
 	git branch -f left three &&
 	git branch -f right four
 }
@@ -21,7 +21,7 @@ test_expect_success setup '
 	test_commit four &&
 	git checkout --orphan newroot &&
 	test_commit five &&
-	git checkout master
+	git checkout main
 '
 
 # Local branches
@@ -61,7 +61,7 @@ test_expect_success 'merge octopus, non-fast-forward (ff)' '
 test_expect_success 'merge octopus, fast-forward (does not ff)' '
 	t3033_reset &&
 	git merge left right &&
-	# two (master) is not an ancestor of three (left) and four (right)
+	# two (main) is not an ancestor of three (left) and four (right)
 	test_must_fail git rev-parse --verify HEAD^4 &&
 	git rev-parse HEAD^1 HEAD^2 HEAD^3 | sort >actual &&
 	git rev-parse two three four | sort >expect &&
@@ -118,7 +118,7 @@ test_expect_success 'merge FETCH_HEAD octopus fast-forward (does not ff)' '
 	t3033_reset &&
 	git fetch . left right &&
 	git merge FETCH_HEAD &&
-	# two (master) is not an ancestor of three (left) and four (right)
+	# two (main) is not an ancestor of three (left) and four (right)
 	test_must_fail git rev-parse --verify HEAD^4 &&
 	git rev-parse HEAD^1 HEAD^2 HEAD^3 | sort >actual &&
 	git rev-parse two three four | sort >expect &&
diff --git a/t/t6434-merge-recursive-rename-options.sh b/t/t6434-merge-recursive-rename-options.sh
index 3d9fae68c4..1203984101 100755
--- a/t/t6434-merge-recursive-rename-options.sh
+++ b/t/t6434-merge-recursive-rename-options.sh
@@ -5,11 +5,11 @@ test_description='merge-recursive rename options
 Test rename detection by examining rename/delete conflicts.
 
 * (HEAD -> rename) rename
-| * (master) delete
+| * (main) delete
 |/
 * base
 
-git diff --name-status base master
+git diff --name-status base main
 D	0-old
 D	1-old
 D	2-old
@@ -118,7 +118,7 @@ test_expect_success 'setup repo' '
 	get_expected_stages 2 &&
 	get_expected_stages 3 &&
 	check_50="false" &&
-	tail="HEAD^ -- HEAD master"
+	tail="HEAD^ -- HEAD main"
 '
 
 test_expect_success 'setup thresholds' '
diff --git a/t/t6436-merge-overwrite.sh b/t/t6436-merge-overwrite.sh
index dd9376842f..8efe96dc8c 100755
--- a/t/t6436-merge-overwrite.sh
+++ b/t/t6436-merge-overwrite.sh
@@ -193,7 +193,7 @@ test_expect_success 'set up unborn branch and content' '
 '
 
 test_expect_success 'will not clobber WT/index when merging into unborn' '
-	git merge master &&
+	git merge main &&
 	grep foo tracked-file &&
 	git show :tracked-file >expect &&
 	grep foo expect &&
diff --git a/t/t6437-submodule-merge.sh b/t/t6437-submodule-merge.sh
index 3ead2b726f..d71e9410b9 100755
--- a/t/t6437-submodule-merge.sh
+++ b/t/t6437-submodule-merge.sh
@@ -27,7 +27,7 @@ test_expect_success setup '
 	test_tick &&
 	git commit -m root &&
 
-	git checkout -b a master &&
+	git checkout -b a main &&
 	(cd sub &&
 	 echo A > file &&
 	 git add file &&
@@ -37,7 +37,7 @@ test_expect_success setup '
 	test_tick &&
 	git commit -m a &&
 
-	git checkout -b b master &&
+	git checkout -b b main &&
 	(cd sub &&
 	 echo B > file &&
 	 git add file &&
@@ -254,22 +254,22 @@ test_expect_success 'setup for recursive merge with submodule' '
 	 (cd sub &&
 	  git init &&
 	  test_commit a &&
-	  git checkout -b sub-b master &&
+	  git checkout -b sub-b main &&
 	  test_commit b &&
-	  git checkout -b sub-c master &&
+	  git checkout -b sub-c main &&
 	  test_commit c &&
 	  git checkout -b sub-bc sub-b &&
 	  git merge sub-c &&
 	  git checkout -b sub-cb sub-c &&
 	  git merge sub-b &&
-	  git checkout master) &&
+	  git checkout main) &&
 	 git add sub &&
 	 git commit -m a &&
-	 git checkout -b top-b master &&
+	 git checkout -b top-b main &&
 	 (cd sub && git checkout sub-b) &&
 	 git add sub &&
 	 git commit -m b &&
-	 git checkout -b top-c master &&
+	 git checkout -b top-c main &&
 	 (cd sub && git checkout sub-c) &&
 	 git add sub &&
 	 git commit -m c &&
diff --git a/t/t6439-merge-co-error-msgs.sh b/t/t6439-merge-co-error-msgs.sh
index 5c8894d94f..cd87fe6dd4 100755
--- a/t/t6439-merge-co-error-msgs.sh
+++ b/t/t6439-merge-co-error-msgs.sh
@@ -18,7 +18,7 @@ test_expect_success 'setup' '
 	git add two three four five &&
 	git commit -m Second &&
 
-	git checkout master &&
+	git checkout main &&
 	echo other >two &&
 	echo other >three &&
 	echo other >four &&
@@ -83,7 +83,7 @@ test_expect_success 'cannot switch branches because of local changes' '
 	echo two >rep/two &&
 	git add rep/one rep/two &&
 	git commit -m Fourth &&
-	git checkout master &&
+	git checkout main &&
 	echo uno >rep/one &&
 	echo dos >rep/two &&
 	test_must_fail git checkout branch 2>out &&
@@ -128,7 +128,7 @@ test_expect_success 'not_uptodate_dir porcelain checkout error' '
 	>rep2 &&
 	git add rep rep2 &&
 	git commit -m "added test as a file" &&
-	git checkout master &&
+	git checkout main &&
 	>rep/untracked-file &&
 	>rep2/untracked-file &&
 	test_must_fail git checkout branch 2>out &&
diff --git a/t/t6501-freshen-objects.sh b/t/t6501-freshen-objects.sh
index 8a3bb4105b..2f2b89f229 100755
--- a/t/t6501-freshen-objects.sh
+++ b/t/t6501-freshen-objects.sh
@@ -67,7 +67,7 @@ for repack in '' true; do
 		git checkout -b experiment &&
 		commit abandon &&
 		maybe_repack &&
-		git checkout master &&
+		git checkout main &&
 		git branch -D experiment
 	'
 
diff --git a/t/test-lib.sh b/t/test-lib.sh
index 307b75eafe..44b4bba0cb 100644
--- a/t/test-lib.sh
+++ b/t/test-lib.sh
@@ -263,7 +263,7 @@ case "$TEST_NUMBER" in
 	GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
 	export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 	;;
-[0-5]*|6[0-3]*)
+[0-6]*)
 	GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 	export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 	;;
-- 
gitgitgadget


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH 20/28] t7[0-4]*: adjust the references to the default branch name "main"
  2020-11-12 22:43 [PATCH 00/28] Use main as default branch name Johannes Schindelin via GitGitGadget
                   ` (18 preceding siblings ...)
  2020-11-12 22:43 ` [PATCH 19/28] t6[4-9]*: adjust the references to the default branch name "main" Johannes Schindelin via GitGitGadget
@ 2020-11-12 22:43 ` Johannes Schindelin via GitGitGadget
  2020-11-12 22:43 ` [PATCH 21/28] t7[5-9]*: " Johannes Schindelin via GitGitGadget
                   ` (12 subsequent siblings)
  32 siblings, 0 replies; 163+ messages in thread
From: Johannes Schindelin via GitGitGadget @ 2020-11-12 22:43 UTC (permalink / raw)
  To: git; +Cc: Johannes Schindelin, Johannes Schindelin

From: Johannes Schindelin <johannes.schindelin@gmx.de>

Carefully excluding t7064, which sees independent development elsewhere
at the time of writing, we use `main` as the default branch name in
t7[0-4]*. This trick was performed via

	$ (cd t &&
	   sed -i -e 's/master/main/g' -e 's/MASTER/MAIN/g' \
		-e 's/Master/Main/g' -- t7[0-4]*.sh &&
	   git checkout HEAD -- t7064\*)

This allows us to define `GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main`
for those tests.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
---
 t/t7003-filter-branch.sh                |  40 ++++-----
 t/t7004-tag.sh                          |   8 +-
 t/t7030-verify-tag.sh                   |   2 +-
 t/t7060-wtstatus.sh                     |  26 +++---
 t/t7063-status-untracked-cache.sh       |  14 +--
 t/t7102-reset.sh                        |   6 +-
 t/t7113-post-index-change-hook.sh       |   2 +-
 t/t7201-co.sh                           | 110 ++++++++++++------------
 t/t7400-submodule-basic.sh              |  20 ++---
 t/t7403-submodule-sync.sh               |  10 +--
 t/t7406-submodule-update.sh             |  38 ++++----
 t/t7407-submodule-foreach.sh            |  24 +++---
 t/t7409-submodule-detached-work-tree.sh |   8 +-
 t/t7417-submodule-path-url.sh           |   2 +-
 t/test-lib.sh                           |   4 +-
 15 files changed, 157 insertions(+), 157 deletions(-)

diff --git a/t/t7003-filter-branch.sh b/t/t7003-filter-branch.sh
index 36477cb1f4..e8df682c8d 100755
--- a/t/t7003-filter-branch.sh
+++ b/t/t7003-filter-branch.sh
@@ -13,7 +13,7 @@ test_expect_success 'setup' '
 	mkdir dir &&
 	test_commit dir/D &&
 	test_commit E &&
-	git checkout master &&
+	git checkout main &&
 	test_commit C &&
 	git checkout branch &&
 	git merge C &&
@@ -25,7 +25,7 @@ test_expect_success 'setup' '
 # * G
 # *   Merge commit 'C' into branch
 # |\
-# | * (master) C
+# | * (main) C
 # * | E
 # * | dir/D
 # * | D
@@ -162,15 +162,15 @@ test_expect_success 'subdirectory filter result looks okay' '
 '
 
 test_expect_success 'more setup' '
-	git checkout master &&
+	git checkout main &&
 	mkdir subdir &&
 	echo A > subdir/new &&
 	git add subdir/new &&
 	test_tick &&
-	git commit -m "subdir on master" subdir/new &&
+	git commit -m "subdir on main" subdir/new &&
 	git rm A.t &&
 	test_tick &&
-	git commit -m "again subdir on master" &&
+	git commit -m "again subdir on main" &&
 	git merge branch
 '
 
@@ -199,7 +199,7 @@ test_expect_success 'author information is preserved' '
 	git branch preserved-author &&
 	(sane_unset GIT_AUTHOR_NAME &&
 	 git filter-branch -f --msg-filter "cat; \
-			test \$GIT_COMMIT != $(git rev-parse master) || \
+			test \$GIT_COMMIT != $(git rev-parse main) || \
 			echo Hallo" \
 		preserved-author) &&
 	git rev-list --author="B V Uips" preserved-author >actual &&
@@ -218,7 +218,7 @@ test_expect_success "remove a certain author's commits" '
 		else\
 			git commit-tree \"\$@\";\
 		fi" removed-author &&
-	cnt1=$(git rev-list master | wc -l) &&
+	cnt1=$(git rev-list main | wc -l) &&
 	cnt2=$(git rev-list removed-author | wc -l) &&
 	test $cnt1 -eq $(($cnt2 + 1)) &&
 	git rev-list --author="B V Uips" removed-author >actual &&
@@ -226,7 +226,7 @@ test_expect_success "remove a certain author's commits" '
 '
 
 test_expect_success 'barf on invalid name' '
-	test_must_fail git filter-branch -f master xy-problem &&
+	test_must_fail git filter-branch -f main xy-problem &&
 	test_must_fail git filter-branch -f HEAD^
 '
 
@@ -236,8 +236,8 @@ test_expect_success '"map" works in commit filter' '
 		mapped=\$(map \$parent) &&
 		actual=\$(echo \"\$@\" | sed \"s/^.*-p //\") &&
 		test \$mapped = \$actual &&
-		git commit-tree \"\$@\";" master~2..master &&
-	git rev-parse --verify master
+		git commit-tree \"\$@\";" main~2..main &&
+	git rev-parse --verify main
 '
 
 test_expect_success 'Name needing quotes' '
@@ -256,7 +256,7 @@ test_expect_success 'Name needing quotes' '
 
 test_expect_success 'Subdirectory filter with disappearing trees' '
 	git reset --hard &&
-	git checkout master &&
+	git checkout main &&
 
 	mkdir foo &&
 	touch foo/bar &&
@@ -275,7 +275,7 @@ test_expect_success 'Subdirectory filter with disappearing trees' '
 	git commit -m "Re-adding foo" &&
 
 	git filter-branch -f --subdirectory-filter foo &&
-	git rev-list master >actual &&
+	git rev-list main >actual &&
 	test_line_count = 3 actual
 '
 
@@ -332,7 +332,7 @@ test_expect_success 'Tag name filtering allows slashes in tag names' '
 	test_cmp expect actual
 '
 test_expect_success 'setup --prune-empty comparisons' '
-	git checkout --orphan master-no-a &&
+	git checkout --orphan main-no-a &&
 	git rm -rf . &&
 	unset test_tick &&
 	test_tick &&
@@ -343,7 +343,7 @@ test_expect_success 'setup --prune-empty comparisons' '
 	mkdir dir &&
 	test_commit dir/D dir/D.t dir/D dir/Dx &&
 	test_commit E E.t E Ex &&
-	git checkout master-no-a &&
+	git checkout main-no-a &&
 	test_commit C C.t C Cx &&
 	git checkout branch-no-a &&
 	git merge Cx -m "Merge tag '\''C'\'' into branch" &&
@@ -397,7 +397,7 @@ test_expect_success '--prune-empty is able to prune entire branch' '
 '
 
 test_expect_success '--remap-to-ancestor with filename filters' '
-	git checkout master &&
+	git checkout main &&
 	git reset --hard A &&
 	test_commit add-foo foo 1 &&
 	git branch moved-foo &&
@@ -407,15 +407,15 @@ test_expect_success '--remap-to-ancestor with filename filters' '
 	git branch moved-bar &&
 	test_commit change-foo foo 2 &&
 	git filter-branch -f --remap-to-ancestor \
-		moved-foo moved-bar A..master \
+		moved-foo moved-bar A..main \
 		-- -- foo &&
 	test $(git rev-parse moved-foo) = $(git rev-parse moved-bar) &&
-	test $(git rev-parse moved-foo) = $(git rev-parse master^) &&
+	test $(git rev-parse moved-foo) = $(git rev-parse main^) &&
 	test $orig_invariant = $(git rev-parse invariant)
 '
 
 test_expect_success 'automatic remapping to ancestor with filename filters' '
-	git checkout master &&
+	git checkout main &&
 	git reset --hard A &&
 	test_commit add-foo2 foo 1 &&
 	git branch moved-foo2 &&
@@ -425,10 +425,10 @@ test_expect_success 'automatic remapping to ancestor with filename filters' '
 	git branch moved-bar2 &&
 	test_commit change-foo2 foo 2 &&
 	git filter-branch -f \
-		moved-foo2 moved-bar2 A..master \
+		moved-foo2 moved-bar2 A..main \
 		-- -- foo &&
 	test $(git rev-parse moved-foo2) = $(git rev-parse moved-bar2) &&
-	test $(git rev-parse moved-foo2) = $(git rev-parse master^) &&
+	test $(git rev-parse moved-foo2) = $(git rev-parse main^) &&
 	test $orig_invariant = $(git rev-parse invariant2)
 '
 
diff --git a/t/t7004-tag.sh b/t/t7004-tag.sh
index 05f411c821..630fcde90b 100755
--- a/t/t7004-tag.sh
+++ b/t/t7004-tag.sh
@@ -1583,7 +1583,7 @@ test_expect_success 'checking that branch head with --no-contains lists all but
 "
 
 test_expect_success 'merging original branch into this branch' '
-	git merge --strategy=ours master &&
+	git merge --strategy=ours main &&
         git tag v4.0
 '
 
@@ -1944,15 +1944,15 @@ test_expect_success ULIMIT_STACK_SIZE '--contains and --no-contains work in a de
 	i=1 &&
 	while test $i -lt 8000
 	do
-		echo "commit refs/heads/master
+		echo "commit refs/heads/main
 committer A U Thor <author@example.com> $((1000000000 + $i * 100)) +0200
 data <<EOF
 commit #$i
 EOF"
-		test $i = 1 && echo "from refs/heads/master^0"
+		test $i = 1 && echo "from refs/heads/main^0"
 		i=$(($i + 1))
 	done | git fast-import &&
-	git checkout master &&
+	git checkout main &&
 	git tag far-far-away HEAD^ &&
 	run_with_limited_stack git tag --contains HEAD >actual &&
 	test_must_be_empty actual &&
diff --git a/t/t7030-verify-tag.sh b/t/t7030-verify-tag.sh
index 5c5bc32ccb..7a70df79a2 100755
--- a/t/t7030-verify-tag.sh
+++ b/t/t7030-verify-tag.sh
@@ -17,7 +17,7 @@ test_expect_success GPG 'create signed tags' '
 	echo 3 >elif && git add elif &&
 	test_tick && git commit -m "third on side" &&
 
-	git checkout master &&
+	git checkout main &&
 	test_tick && git merge -S side &&
 	git tag -s -m merge merge &&
 
diff --git a/t/t7060-wtstatus.sh b/t/t7060-wtstatus.sh
index d5218743e9..cb4e104e4b 100755
--- a/t/t7060-wtstatus.sh
+++ b/t/t7060-wtstatus.sh
@@ -51,7 +51,7 @@ EOF
 		git checkout -b side HEAD^ &&
 		git rm foo &&
 		git commit -m delete &&
-		test_must_fail git merge master &&
+		test_must_fail git merge main &&
 		test_must_fail git commit --dry-run >../actual &&
 		test_i18ncmp ../expect ../actual &&
 		git status >../actual &&
@@ -124,18 +124,18 @@ test_expect_success 'git diff-index --cached -C shows 2 copies + 1 unmerged' '
 
 test_expect_success 'status when conflicts with add and rm advice (deleted by them)' '
 	git reset --hard &&
-	git checkout master &&
+	git checkout main &&
 	test_commit init main.txt init &&
 	git checkout -b second_branch &&
 	git rm main.txt &&
 	git commit -m "main.txt deleted on second_branch" &&
 	test_commit second conflict.txt second &&
-	git checkout master &&
+	git checkout main &&
 	test_commit on_second main.txt on_second &&
-	test_commit master conflict.txt master &&
+	test_commit main conflict.txt main &&
 	test_must_fail git merge second_branch &&
 	cat >expected <<\EOF &&
-On branch master
+On branch main
 You have unmerged paths.
   (fix conflicts and run "git commit")
   (use "git merge --abort" to abort the merge)
@@ -157,8 +157,8 @@ test_expect_success 'prepare for conflicts' '
 	git checkout -b conflict &&
 	test_commit one main.txt one &&
 	git branch conflict_second &&
-	git mv main.txt sub_master.txt &&
-	git commit -m "main.txt renamed in sub_master.txt" &&
+	git mv main.txt sub_main.txt &&
+	git commit -m "main.txt renamed in sub_main.txt" &&
 	git checkout conflict_second &&
 	git mv main.txt sub_second.txt &&
 	git commit -m "main.txt renamed in sub_second.txt"
@@ -176,7 +176,7 @@ You have unmerged paths.
 Unmerged paths:
   (use "git add/rm <file>..." as appropriate to mark resolution)
 	both deleted:    main.txt
-	added by them:   sub_master.txt
+	added by them:   sub_main.txt
 	added by us:     sub_second.txt
 
 no changes added to commit (use "git add" and/or "git commit -a")
@@ -189,7 +189,7 @@ EOF
 test_expect_success 'status when conflicts with only rm advice (both deleted)' '
 	git reset --hard conflict_second &&
 	test_must_fail git merge conflict &&
-	git add sub_master.txt &&
+	git add sub_main.txt &&
 	git add sub_second.txt &&
 	cat >expected <<\EOF &&
 On branch conflict_second
@@ -198,7 +198,7 @@ You have unmerged paths.
   (use "git merge --abort" to abort the merge)
 
 Changes to be committed:
-	new file:   sub_master.txt
+	new file:   sub_main.txt
 
 Unmerged paths:
   (use "git rm <file>..." to mark resolution)
@@ -209,12 +209,12 @@ EOF
 	git status --untracked-files=no >actual &&
 	test_i18ncmp expected actual &&
 	git reset --hard &&
-	git checkout master
+	git checkout main
 '
 
 test_expect_success 'status --branch with detached HEAD' '
 	git reset --hard &&
-	git checkout master^0 &&
+	git checkout main^0 &&
 	git status --branch --porcelain >actual &&
 	cat >expected <<-EOF &&
 	## HEAD (no branch)
@@ -230,7 +230,7 @@ test_expect_success 'status --branch with detached HEAD' '
 ## Duplicate the above test and verify --porcelain=v1 arg parsing.
 test_expect_success 'status --porcelain=v1 --branch with detached HEAD' '
 	git reset --hard &&
-	git checkout master^0 &&
+	git checkout main^0 &&
 	git status --branch --porcelain=v1 >actual &&
 	cat >expected <<-EOF &&
 	## HEAD (no branch)
diff --git a/t/t7063-status-untracked-cache.sh b/t/t7063-status-untracked-cache.sh
index a682a3d826..3b41d563d5 100755
--- a/t/t7063-status-untracked-cache.sh
+++ b/t/t7063-status-untracked-cache.sh
@@ -475,7 +475,7 @@ EOF
 test_expect_success 'set up sparse checkout' '
 	echo "done/[a-z]*" >.git/info/sparse-checkout &&
 	test_config core.sparsecheckout true &&
-	git checkout master &&
+	git checkout main &&
 	git update-index --force-untracked-cache &&
 	git status --porcelain >/dev/null && # prime the cache
 	test_path_is_missing done/.gitignore &&
@@ -734,13 +734,13 @@ test_expect_success 'test ident field is working' '
 test_expect_success 'untracked cache survives a checkout' '
 	git commit --allow-empty -m empty &&
 	test-tool dump-untracked-cache >../before &&
-	test_when_finished  "git checkout master" &&
+	test_when_finished  "git checkout main" &&
 	git checkout -b other_branch &&
 	test-tool dump-untracked-cache >../after &&
 	test_cmp ../before ../after &&
 	test_commit test &&
 	test-tool dump-untracked-cache >../before &&
-	git checkout master &&
+	git checkout main &&
 	test-tool dump-untracked-cache >../after &&
 	test_cmp ../before ../after
 '
@@ -775,7 +775,7 @@ test_expect_success SYMLINKS '"status" after symlink replacement should be clean
 	git checkout HEAD~ &&
 	status_is_clean &&
 	status_is_clean &&
-	git checkout master &&
+	git checkout main &&
 	avoid_racy &&
 	status_is_clean &&
 	status_is_clean
@@ -786,7 +786,7 @@ test_expect_success SYMLINKS '"status" after symlink replacement should be clean
 	git checkout HEAD~ &&
 	status_is_clean &&
 	status_is_clean &&
-	git checkout master &&
+	git checkout main &&
 	avoid_racy &&
 	status_is_clean &&
 	status_is_clean
@@ -810,7 +810,7 @@ test_expect_success '"status" after file replacement should be clean with UC=tru
 	git checkout HEAD~ &&
 	status_is_clean &&
 	status_is_clean &&
-	git checkout master &&
+	git checkout main &&
 	avoid_racy &&
 	status_is_clean &&
 	test-tool dump-untracked-cache >../actual &&
@@ -828,7 +828,7 @@ test_expect_success '"status" after file replacement should be clean with UC=fal
 	git checkout HEAD~ &&
 	status_is_clean &&
 	status_is_clean &&
-	git checkout master &&
+	git checkout main &&
 	avoid_racy &&
 	status_is_clean &&
 	status_is_clean
diff --git a/t/t7102-reset.sh b/t/t7102-reset.sh
index b1affb001f..9dfed50354 100755
--- a/t/t7102-reset.sh
+++ b/t/t7102-reset.sh
@@ -145,7 +145,7 @@ test_expect_success 'trying to do reset --soft with pending merge should fail' '
 	printf "1st line 2nd file\n2nd line 2nd file\n3rd line" >secondfile &&
 	git commit -a -m "the change in branch2" &&
 
-	git checkout master &&
+	git checkout main &&
 	git branch -D branch1 branch2 &&
 	check_changes $head5
 '
@@ -167,7 +167,7 @@ test_expect_success 'trying to do reset --soft with pending checkout merge shoul
 	printf "1st line 2nd file\n2nd line 2nd file\n3rd line" >secondfile &&
 	git commit -a -m "the line in branch3" &&
 
-	git checkout master &&
+	git checkout main &&
 	git branch -D branch3 branch4 &&
 	check_changes $head5
 '
@@ -380,7 +380,7 @@ test_expect_success '--hard reset to ORIG_HEAD should clear a fast-forward merge
 	git reset --hard ORIG_HEAD &&
 	check_changes $head5 &&
 
-	git checkout master &&
+	git checkout main &&
 	git branch -D branch1 branch2 &&
 	check_changes $head5
 '
diff --git a/t/t7113-post-index-change-hook.sh b/t/t7113-post-index-change-hook.sh
index f011ad7eec..2e38428176 100755
--- a/t/t7113-post-index-change-hook.sh
+++ b/t/t7113-post-index-change-hook.sh
@@ -85,7 +85,7 @@ test_expect_success 'test checkout and reset trigger the hook' '
 	EOF
 	: force index to be dirty &&
 	test-tool chmtime +60 dir1/file1.txt &&
-	git checkout master &&
+	git checkout main &&
 	test_path_is_file testsuccess && rm -f testsuccess &&
 	test_path_is_missing testfailure &&
 	test-tool chmtime +60 dir1/file1.txt &&
diff --git a/t/t7201-co.sh b/t/t7201-co.sh
index b36a93056f..3ab219a04e 100755
--- a/t/t7201-co.sh
+++ b/t/t7201-co.sh
@@ -5,10 +5,10 @@
 
 test_description='git checkout tests.
 
-Creates master, forks renamer and side branches from it.
+Creates main, forks renamer and side branches from it.
 Test switching across them.
 
-  ! [master] Initial A one, A two
+  ! [main] Initial A one, A two
    * [renamer] Renamer R one->uno, M two
     ! [side] Side M one, D two, A three
      ! [simple] Simple D one, M two
@@ -16,7 +16,7 @@ Test switching across them.
      + [simple] Simple D one, M two
     +  [side] Side M one, D two, A three
    *   [renamer] Renamer R one->uno, M two
-  +*++ [master] Initial A one, A two
+  +*++ [main] Initial A one, A two
 
 '
 
@@ -46,27 +46,27 @@ test_expect_success setup '
 	fill a b c d e f >two &&
 	git commit -a -m "Renamer R one->uno, M two" &&
 
-	git checkout -b side master &&
+	git checkout -b side main &&
 	fill 1 2 3 4 5 6 7 >one &&
 	fill A B C D E >three &&
 	rm -f two &&
 	git update-index --add --remove one two three &&
 	git commit -m "Side M one, D two, A three" &&
 
-	git checkout -b simple master &&
+	git checkout -b simple main &&
 	rm -f one &&
 	fill a c e >two &&
 	git commit -a -m "Simple D one, M two" &&
 
-	git checkout master
+	git checkout main
 '
 
 test_expect_success 'checkout from non-existing branch' '
-	git checkout -b delete-me master &&
+	git checkout -b delete-me main &&
 	git update-ref -d --no-deref refs/heads/delete-me &&
 	test refs/heads/delete-me = "$(git symbolic-ref HEAD)" &&
-	git checkout master &&
-	test refs/heads/master = "$(git symbolic-ref HEAD)"
+	git checkout main &&
+	test refs/heads/main = "$(git symbolic-ref HEAD)"
 '
 
 test_expect_success 'checkout with dirty tree without -m' '
@@ -81,7 +81,7 @@ test_expect_success 'checkout with dirty tree without -m' '
 '
 
 test_expect_success 'checkout with unrelated dirty tree without -m' '
-	git checkout -f master &&
+	git checkout -f main &&
 	fill 0 1 2 3 4 5 6 7 8 >same &&
 	cp same kept &&
 	git checkout side >messages &&
@@ -91,7 +91,7 @@ test_expect_success 'checkout with unrelated dirty tree without -m' '
 '
 
 test_expect_success 'checkout -m with dirty tree' '
-	git checkout -f master &&
+	git checkout -f main &&
 	git clean -f &&
 
 	fill 0 1 2 3 4 5 6 7 8 >one &&
@@ -102,9 +102,9 @@ test_expect_success 'checkout -m with dirty tree' '
 	printf "M\t%s\n" one >expect.messages &&
 	test_cmp expect.messages messages &&
 
-	fill "M	one" "A	three" "D	two" >expect.master &&
-	git diff --name-status master >current.master &&
-	test_cmp expect.master current.master &&
+	fill "M	one" "A	three" "D	two" >expect.main &&
+	git diff --name-status main >current.main &&
+	test_cmp expect.main current.main &&
 
 	fill "M	one" >expect.side &&
 	git diff --name-status side >current.side &&
@@ -115,7 +115,7 @@ test_expect_success 'checkout -m with dirty tree' '
 '
 
 test_expect_success 'checkout -m with dirty tree, renamed' '
-	git checkout -f master && git clean -f &&
+	git checkout -f main && git clean -f &&
 
 	fill 1 2 3 4 5 7 8 >one &&
 	if git checkout renamer
@@ -135,7 +135,7 @@ test_expect_success 'checkout -m with dirty tree, renamed' '
 '
 
 test_expect_success 'checkout -m with merge conflict' '
-	git checkout -f master && git clean -f &&
+	git checkout -f main && git clean -f &&
 
 	fill 1 T 3 4 5 6 S 8 >one &&
 	if git checkout renamer
@@ -148,7 +148,7 @@ test_expect_success 'checkout -m with merge conflict' '
 
 	git checkout -m renamer &&
 
-	git diff master:one :3:uno |
+	git diff main:one :3:uno |
 	sed -e "1,/^@@/d" -e "/^ /d" -e "s/^-/d/" -e "s/^+/a/" >current &&
 	fill d2 aT d7 aS >expect &&
 	test_cmp expect current &&
@@ -157,7 +157,7 @@ test_expect_success 'checkout -m with merge conflict' '
 '
 
 test_expect_success 'format of merge conflict from checkout -m' '
-	git checkout -f master &&
+	git checkout -f main &&
 	git clean -f &&
 
 	fill b d >two &&
@@ -181,7 +181,7 @@ test_expect_success 'format of merge conflict from checkout -m' '
 '
 
 test_expect_success 'checkout --merge --conflict=diff3 <branch>' '
-	git checkout -f master &&
+	git checkout -f main &&
 	git reset --hard &&
 	git clean -f &&
 
@@ -193,7 +193,7 @@ test_expect_success 'checkout --merge --conflict=diff3 <branch>' '
 	a
 	c
 	e
-	||||||| master
+	||||||| main
 	a
 	b
 	c
@@ -208,7 +208,7 @@ test_expect_success 'checkout --merge --conflict=diff3 <branch>' '
 '
 
 test_expect_success 'switch to another branch while carrying a deletion' '
-	git checkout -f master &&
+	git checkout -f main &&
 	git reset --hard &&
 	git clean -f &&
 	git rm two &&
@@ -229,7 +229,7 @@ test_expect_success 'checkout to detach HEAD (with advice declined)' '
 	test_i18ngrep "HEAD is now at $rev" messages &&
 	test_line_count = 1 messages &&
 	H=$(git rev-parse --verify HEAD) &&
-	M=$(git show-ref -s --verify refs/heads/master) &&
+	M=$(git show-ref -s --verify refs/heads/main) &&
 	test "z$H" = "z$M" &&
 	if git symbolic-ref HEAD >/dev/null 2>&1
 	then
@@ -249,7 +249,7 @@ test_expect_success 'checkout to detach HEAD' '
 	grep "HEAD is now at $rev" messages &&
 	test_line_count -gt 1 messages &&
 	H=$(git rev-parse --verify HEAD) &&
-	M=$(git show-ref -s --verify refs/heads/master) &&
+	M=$(git show-ref -s --verify refs/heads/main) &&
 	test "z$H" = "z$M" &&
 	if git symbolic-ref HEAD >/dev/null 2>&1
 	then
@@ -261,11 +261,11 @@ test_expect_success 'checkout to detach HEAD' '
 '
 
 test_expect_success 'checkout to detach HEAD with branchname^' '
-	git checkout -f master &&
+	git checkout -f main &&
 	git clean -f &&
 	git checkout renamer^ &&
 	H=$(git rev-parse --verify HEAD) &&
-	M=$(git show-ref -s --verify refs/heads/master) &&
+	M=$(git show-ref -s --verify refs/heads/main) &&
 	test "z$H" = "z$M" &&
 	if git symbolic-ref HEAD >/dev/null 2>&1
 	then
@@ -277,11 +277,11 @@ test_expect_success 'checkout to detach HEAD with branchname^' '
 '
 
 test_expect_success 'checkout to detach HEAD with :/message' '
-	git checkout -f master &&
+	git checkout -f main &&
 	git clean -f &&
 	git checkout ":/Initial" &&
 	H=$(git rev-parse --verify HEAD) &&
-	M=$(git show-ref -s --verify refs/heads/master) &&
+	M=$(git show-ref -s --verify refs/heads/main) &&
 	test "z$H" = "z$M" &&
 	if git symbolic-ref HEAD >/dev/null 2>&1
 	then
@@ -293,11 +293,11 @@ test_expect_success 'checkout to detach HEAD with :/message' '
 '
 
 test_expect_success 'checkout to detach HEAD with HEAD^0' '
-	git checkout -f master &&
+	git checkout -f main &&
 	git clean -f &&
 	git checkout HEAD^0 &&
 	H=$(git rev-parse --verify HEAD) &&
-	M=$(git show-ref -s --verify refs/heads/master) &&
+	M=$(git show-ref -s --verify refs/heads/main) &&
 	test "z$H" = "z$M" &&
 	if git symbolic-ref HEAD >/dev/null 2>&1
 	then
@@ -310,13 +310,13 @@ test_expect_success 'checkout to detach HEAD with HEAD^0' '
 
 test_expect_success 'checkout with ambiguous tag/branch names' '
 	git tag both side &&
-	git branch both master &&
+	git branch both main &&
 	git reset --hard &&
-	git checkout master &&
+	git checkout main &&
 
 	git checkout both &&
 	H=$(git rev-parse --verify HEAD) &&
-	M=$(git show-ref -s --verify refs/heads/master) &&
+	M=$(git show-ref -s --verify refs/heads/main) &&
 	test "z$H" = "z$M" &&
 	name=$(git symbolic-ref HEAD 2>/dev/null) &&
 	test "z$name" = zrefs/heads/both
@@ -324,12 +324,12 @@ test_expect_success 'checkout with ambiguous tag/branch names' '
 
 test_expect_success 'checkout with ambiguous tag/branch names' '
 	git reset --hard &&
-	git checkout master &&
+	git checkout main &&
 
 	git tag frotz side &&
-	git branch frotz master &&
+	git branch frotz main &&
 	git reset --hard &&
-	git checkout master &&
+	git checkout main &&
 
 	git checkout tags/frotz &&
 	H=$(git rev-parse --verify HEAD) &&
@@ -346,7 +346,7 @@ test_expect_success 'checkout with ambiguous tag/branch names' '
 
 test_expect_success 'switch branches while in subdirectory' '
 	git reset --hard &&
-	git checkout master &&
+	git checkout main &&
 
 	mkdir subs &&
 	git -C subs checkout side &&
@@ -362,7 +362,7 @@ test_expect_success 'checkout specific path while in subdirectory' '
 	git add subs/bero &&
 	git commit -m "add subs/bero" &&
 
-	git checkout master &&
+	git checkout main &&
 	mkdir -p subs &&
 	git -C subs checkout side -- bero &&
 	test -f subs/bero
@@ -370,7 +370,7 @@ test_expect_success 'checkout specific path while in subdirectory' '
 
 test_expect_success 'checkout w/--track sets up tracking' '
     git config branch.autosetupmerge false &&
-    git checkout master &&
+    git checkout main &&
     git checkout --track -b track1 &&
     test "$(git config branch.track1.remote)" &&
     test "$(git config branch.track1.merge)"
@@ -379,40 +379,40 @@ test_expect_success 'checkout w/--track sets up tracking' '
 test_expect_success 'checkout w/autosetupmerge=always sets up tracking' '
     test_when_finished git config branch.autosetupmerge false &&
     git config branch.autosetupmerge always &&
-    git checkout master &&
+    git checkout main &&
     git checkout -b track2 &&
     test "$(git config branch.track2.remote)" &&
     test "$(git config branch.track2.merge)"
 '
 
 test_expect_success 'checkout w/--track from non-branch HEAD fails' '
-    git checkout master^0 &&
+    git checkout main^0 &&
     test_must_fail git symbolic-ref HEAD &&
     test_must_fail git checkout --track -b track &&
     test_must_fail git rev-parse --verify track &&
     test_must_fail git symbolic-ref HEAD &&
-    test "z$(git rev-parse master^0)" = "z$(git rev-parse HEAD)"
+    test "z$(git rev-parse main^0)" = "z$(git rev-parse HEAD)"
 '
 
 test_expect_success 'checkout w/--track from tag fails' '
-    git checkout master^0 &&
+    git checkout main^0 &&
     test_must_fail git symbolic-ref HEAD &&
     test_must_fail git checkout --track -b track frotz &&
     test_must_fail git rev-parse --verify track &&
     test_must_fail git symbolic-ref HEAD &&
-    test "z$(git rev-parse master^0)" = "z$(git rev-parse HEAD)"
+    test "z$(git rev-parse main^0)" = "z$(git rev-parse HEAD)"
 '
 
 test_expect_success 'detach a symbolic link HEAD' '
-    git checkout master &&
+    git checkout main &&
     git config --bool core.prefersymlinkrefs yes &&
     git checkout side &&
-    git checkout master &&
+    git checkout main &&
     it=$(git symbolic-ref HEAD) &&
-    test "z$it" = zrefs/heads/master &&
-    here=$(git rev-parse --verify refs/heads/master) &&
+    test "z$it" = zrefs/heads/main &&
+    here=$(git rev-parse --verify refs/heads/main) &&
     git checkout side^ &&
-    test "z$(git rev-parse --verify refs/heads/master)" = "z$here"
+    test "z$(git rev-parse --verify refs/heads/main)" = "z$here"
 '
 
 test_expect_success 'checkout with --track fakes a sensible -b <name>' '
@@ -423,13 +423,13 @@ test_expect_success 'checkout with --track fakes a sensible -b <name>' '
     test "refs/heads/koala/bear" = "$(git symbolic-ref HEAD)" &&
     test "$(git rev-parse HEAD)" = "$(git rev-parse renamer)" &&
 
-    git checkout master && git branch -D koala/bear &&
+    git checkout main && git branch -D koala/bear &&
 
     git checkout --track refs/remotes/origin/koala/bear &&
     test "refs/heads/koala/bear" = "$(git symbolic-ref HEAD)" &&
     test "$(git rev-parse HEAD)" = "$(git rev-parse renamer)" &&
 
-    git checkout master && git branch -D koala/bear &&
+    git checkout main && git branch -D koala/bear &&
 
     git checkout --track remotes/origin/koala/bear &&
     test "refs/heads/koala/bear" = "$(git symbolic-ref HEAD)" &&
@@ -582,17 +582,17 @@ test_expect_success 'checkout --conflict=diff3' '
 '
 
 test_expect_success 'failing checkout -b should not break working tree' '
-	git reset --hard master &&
-	git symbolic-ref HEAD refs/heads/master &&
+	git reset --hard main &&
+	git symbolic-ref HEAD refs/heads/main &&
 	test_must_fail git checkout -b renamer side^ &&
-	test $(git symbolic-ref HEAD) = refs/heads/master &&
+	test $(git symbolic-ref HEAD) = refs/heads/main &&
 	git diff --exit-code &&
 	git diff --cached --exit-code
 '
 
 test_expect_success 'switch out of non-branch' '
-	git reset --hard master &&
-	git checkout master^0 &&
+	git reset --hard main &&
+	git checkout main^0 &&
 	echo modified >one &&
 	test_must_fail git checkout renamer 2>error.log &&
 	! grep "^Previous HEAD" error.log
diff --git a/t/t7400-submodule-basic.sh b/t/t7400-submodule-basic.sh
index fec7e0299d..ce320807d4 100755
--- a/t/t7400-submodule-basic.sh
+++ b/t/t7400-submodule-basic.sh
@@ -124,7 +124,7 @@ inspect() {
 }
 
 test_expect_success 'submodule add' '
-	echo "refs/heads/master" >expect &&
+	echo "refs/heads/main" >expect &&
 
 	(
 		cd addtest &&
@@ -223,7 +223,7 @@ test_expect_success 'submodule add --branch' '
 	echo "refs/heads/initial" >expect-head &&
 	cat <<-\EOF >expect-heads &&
 	refs/heads/initial
-	refs/heads/master
+	refs/heads/main
 	EOF
 
 	(
@@ -241,7 +241,7 @@ test_expect_success 'submodule add --branch' '
 '
 
 test_expect_success 'submodule add with ./ in path' '
-	echo "refs/heads/master" >expect &&
+	echo "refs/heads/main" >expect &&
 
 	(
 		cd addtest &&
@@ -257,7 +257,7 @@ test_expect_success 'submodule add with ./ in path' '
 '
 
 test_expect_success 'submodule add with /././ in path' '
-	echo "refs/heads/master" >expect &&
+	echo "refs/heads/main" >expect &&
 
 	(
 		cd addtest &&
@@ -273,7 +273,7 @@ test_expect_success 'submodule add with /././ in path' '
 '
 
 test_expect_success 'submodule add with // in path' '
-	echo "refs/heads/master" >expect &&
+	echo "refs/heads/main" >expect &&
 
 	(
 		cd addtest &&
@@ -289,7 +289,7 @@ test_expect_success 'submodule add with // in path' '
 '
 
 test_expect_success 'submodule add with /.. in path' '
-	echo "refs/heads/master" >expect &&
+	echo "refs/heads/main" >expect &&
 
 	(
 		cd addtest &&
@@ -305,7 +305,7 @@ test_expect_success 'submodule add with /.. in path' '
 '
 
 test_expect_success 'submodule add with ./, /.. and // in path' '
-	echo "refs/heads/master" >expect &&
+	echo "refs/heads/main" >expect &&
 
 	(
 		cd addtest &&
@@ -335,7 +335,7 @@ test_expect_success !CYGWIN 'submodule add with \\ in path' '
 '
 
 test_expect_success 'submodule add in subdirectory' '
-	echo "refs/heads/master" >expect &&
+	echo "refs/heads/main" >expect &&
 
 	mkdir addtest/sub &&
 	(
@@ -557,7 +557,7 @@ test_expect_success 'status should be "up-to-date" after update' '
 
 test_expect_success 'checkout superproject with subproject already present' '
 	git checkout initial &&
-	git checkout master
+	git checkout main
 '
 
 test_expect_success 'apply submodule diff' '
@@ -574,7 +574,7 @@ test_expect_success 'apply submodule diff' '
 	git checkout second &&
 	git apply --index P.diff &&
 
-	git diff --cached master >staged &&
+	git diff --cached main >staged &&
 	test_must_be_empty staged
 '
 
diff --git a/t/t7403-submodule-sync.sh b/t/t7403-submodule-sync.sh
index 0726799e74..848d4e7db7 100755
--- a/t/t7403-submodule-sync.sh
+++ b/t/t7403-submodule-sync.sh
@@ -78,7 +78,7 @@ test_expect_success 'change submodule url' '
 	(
 		cd super &&
 		cd submodule &&
-		git checkout master &&
+		git checkout main &&
 		git pull
 	) &&
 	mv submodule moved-submodule &&
@@ -112,7 +112,7 @@ test_expect_success '"git submodule sync" should update submodule URLs' '
 	)" &&
 	(
 		cd super-clone/submodule &&
-		git checkout master &&
+		git checkout main &&
 		git pull
 	) &&
 	(
@@ -140,7 +140,7 @@ test_expect_success '"git submodule sync --recursive" should update all submodul
 	)" &&
 	(
 		cd super-clone/submodule/sub-submodule &&
-		git checkout master &&
+		git checkout main &&
 		git pull
 	)
 '
@@ -168,7 +168,7 @@ test_expect_success '"git submodule sync" should update submodule URLs - subdire
 	)" &&
 	(
 		cd super-clone/submodule &&
-		git checkout master &&
+		git checkout main &&
 		git pull
 	) &&
 	(
@@ -199,7 +199,7 @@ test_expect_success '"git submodule sync --recursive" should update all submodul
 	)" &&
 	(
 		cd super-clone/submodule/sub-submodule &&
-		git checkout master &&
+		git checkout main &&
 		git pull
 	)
 '
diff --git a/t/t7406-submodule-update.sh b/t/t7406-submodule-update.sh
index acb8766ac2..87097846cb 100755
--- a/t/t7406-submodule-update.sh
+++ b/t/t7406-submodule-update.sh
@@ -14,10 +14,10 @@ submodule and "git submodule update --rebase/--merge" does not detach the HEAD.
 
 compare_head()
 {
-    sha_master=$(git rev-list --max-count=1 master)
+    sha_main=$(git rev-list --max-count=1 main)
     sha_head=$(git rev-list --max-count=1 HEAD)
 
-    test "$sha_master" = "$sha_head"
+    test "$sha_main" = "$sha_head"
 }
 
 
@@ -262,14 +262,14 @@ test_expect_success 'submodule update --remote should fetch upstream changes wit
 		cd super &&
 		git submodule update --remote --force submodule &&
 		git -C submodule log -1 --oneline >actual &&
-		git -C ../submodule log -1 --oneline master >expect &&
+		git -C ../submodule log -1 --oneline main >expect &&
 		test_cmp expect actual &&
 		git checkout -b test-branch &&
 		git submodule update --remote --force submodule &&
 		git -C submodule log -1 --oneline >actual &&
 		git -C ../submodule log -1 --oneline test-branch >expect &&
 		test_cmp expect actual &&
-		git checkout master &&
+		git checkout main &&
 		git branch -d test-branch &&
 		git reset --hard HEAD^
 	)
@@ -282,7 +282,7 @@ test_expect_success 'local config should override .gitmodules branch' '
 	 git add file &&
 	 test_tick &&
 	 git commit -m "upstream line5" &&
-	 git checkout master
+	 git checkout main
 	) &&
 	(cd super &&
 	 git config submodule.submodule.branch test-branch &&
@@ -292,9 +292,9 @@ test_expect_success 'local config should override .gitmodules branch' '
 	)
 '
 
-test_expect_success 'submodule update --rebase staying on master' '
+test_expect_success 'submodule update --rebase staying on main' '
 	(cd super/submodule &&
-	  git checkout master
+	  git checkout main
 	) &&
 	(cd super &&
 	 (cd submodule &&
@@ -306,7 +306,7 @@ test_expect_success 'submodule update --rebase staying on master' '
 	)
 '
 
-test_expect_success 'submodule update --merge staying on master' '
+test_expect_success 'submodule update --merge staying on main' '
 	(cd super/submodule &&
 	  git reset --hard HEAD~1
 	) &&
@@ -609,7 +609,7 @@ test_expect_success 'submodule update - update=none in .git/config' '
 	(cd super &&
 	 git config submodule.submodule.update none &&
 	 (cd submodule &&
-	  git checkout master &&
+	  git checkout main &&
 	  compare_head
 	 ) &&
 	 git diff --name-only >out &&
@@ -629,7 +629,7 @@ test_expect_success 'submodule update - update=none in .git/config but --checkou
 	(cd super &&
 	 git config submodule.submodule.update none &&
 	 (cd submodule &&
-	  git checkout master &&
+	  git checkout main &&
 	  compare_head
 	 ) &&
 	 git diff --name-only >out &&
@@ -689,7 +689,7 @@ test_expect_success 'submodule update continues after checkout error' '
 test_expect_success 'submodule update continues after recursive checkout error' '
 	(cd super &&
 	 git reset --hard HEAD &&
-	 git checkout master &&
+	 git checkout main &&
 	 git submodule update &&
 	 (cd submodule &&
 	  git submodule add ../submodule subsubmodule &&
@@ -733,7 +733,7 @@ test_expect_success 'submodule update continues after recursive checkout error'
 
 test_expect_success 'submodule update exit immediately in case of merge conflict' '
 	(cd super &&
-	 git checkout master &&
+	 git checkout main &&
 	 git reset --hard HEAD &&
 	 (cd submodule &&
 	  (cd subsubmodule &&
@@ -751,7 +751,7 @@ test_expect_success 'submodule update exit immediately in case of merge conflict
 	 git add submodule2 &&
 	 git commit -m "two_new_submodule_commits" &&
 	 (cd submodule &&
-	  git checkout master &&
+	  git checkout main &&
 	  test_commit "conflict" file &&
 	  echo "conflict" > file
 	 ) &&
@@ -770,7 +770,7 @@ test_expect_success 'submodule update exit immediately in case of merge conflict
 
 test_expect_success 'submodule update exit immediately after recursive rebase error' '
 	(cd super &&
-	 git checkout master &&
+	 git checkout main &&
 	 git reset --hard HEAD &&
 	 (cd submodule &&
 	  git reset --hard HEAD &&
@@ -786,7 +786,7 @@ test_expect_success 'submodule update exit immediately after recursive rebase er
 	 git add submodule2 &&
 	 git commit -m "two_new_submodule_commits" &&
 	 (cd submodule &&
-	  git checkout master &&
+	  git checkout main &&
 	  test_commit "conflict2" file &&
 	  echo "conflict" > file
 	 ) &&
@@ -878,21 +878,21 @@ test_expect_success 'submodule update places git-dir in superprojects git-dir re
 	git clone subsubsuper_update_r subsubsuper_update_r2 &&
 	(cd subsubsuper_update_r2 &&
 	 test_commit "update_subsubsuper" file &&
-	 git push origin master
+	 git push origin main
 	) &&
 	git clone subsuper_update_r subsuper_update_r2 &&
 	(cd subsuper_update_r2 &&
 	 test_commit "update_subsuper" file &&
 	 git submodule add ../subsubsuper_update_r subsubmodule &&
 	 git commit -am "subsubmodule" &&
-	 git push origin master
+	 git push origin main
 	) &&
 	git clone super_update_r super_update_r2 &&
 	(cd super_update_r2 &&
 	 test_commit "update_super" file &&
 	 git submodule add ../subsuper_update_r submodule &&
 	 git commit -am "submodule" &&
-	 git push origin master
+	 git push origin main
 	) &&
 	rm -rf super_update_r2 &&
 	git clone super_update_r super_update_r2 &&
@@ -911,7 +911,7 @@ test_expect_success 'submodule update places git-dir in superprojects git-dir re
 
 test_expect_success 'submodule add properly re-creates deeper level submodules' '
 	(cd super &&
-	 git reset --hard master &&
+	 git reset --hard main &&
 	 rm -rf deeper/ &&
 	 git submodule add --force ../submodule deeper/submodule
 	)
diff --git a/t/t7407-submodule-foreach.sh b/t/t7407-submodule-foreach.sh
index 6b2aa917e1..8ebcaa3694 100755
--- a/t/t7407-submodule-foreach.sh
+++ b/t/t7407-submodule-foreach.sh
@@ -277,13 +277,13 @@ sub1sha1_short=$(cd clone3/sub1 && git rev-parse --short HEAD)
 sub2sha1_short=$(cd clone3/sub2 && git rev-parse --short HEAD)
 
 cat > expect <<EOF
- $nested1sha1 nested1 (heads/master)
- $nested2sha1 nested1/nested2 (heads/master)
- $nested3sha1 nested1/nested2/nested3 (heads/master)
- $submodulesha1 nested1/nested2/nested3/submodule (heads/master)
+ $nested1sha1 nested1 (heads/main)
+ $nested2sha1 nested1/nested2 (heads/main)
+ $nested3sha1 nested1/nested2/nested3 (heads/main)
+ $submodulesha1 nested1/nested2/nested3/submodule (heads/main)
  $sub1sha1 sub1 ($sub1sha1_short)
  $sub2sha1 sub2 ($sub2sha1_short)
- $sub3sha1 sub3 (heads/master)
+ $sub3sha1 sub3 (heads/main)
 EOF
 
 test_expect_success 'test "status --recursive"' '
@@ -295,10 +295,10 @@ test_expect_success 'test "status --recursive"' '
 '
 
 cat > expect <<EOF
- $nested1sha1 nested1 (heads/master)
+ $nested1sha1 nested1 (heads/main)
 +$nested2sha1 nested1/nested2 (file2~1)
- $nested3sha1 nested1/nested2/nested3 (heads/master)
- $submodulesha1 nested1/nested2/nested3/submodule (heads/master)
+ $nested3sha1 nested1/nested2/nested3 (heads/main)
+ $submodulesha1 nested1/nested2/nested3/submodule (heads/main)
 EOF
 
 test_expect_success 'ensure "status --cached --recursive" preserves the --cached flag' '
@@ -316,13 +316,13 @@ test_expect_success 'ensure "status --cached --recursive" preserves the --cached
 nested2sha1=$(git -C clone3/nested1/nested2 rev-parse HEAD)
 
 cat > expect <<EOF
- $nested1sha1 ../nested1 (heads/master)
+ $nested1sha1 ../nested1 (heads/main)
 +$nested2sha1 ../nested1/nested2 (file2)
- $nested3sha1 ../nested1/nested2/nested3 (heads/master)
- $submodulesha1 ../nested1/nested2/nested3/submodule (heads/master)
+ $nested3sha1 ../nested1/nested2/nested3 (heads/main)
+ $submodulesha1 ../nested1/nested2/nested3/submodule (heads/main)
  $sub1sha1 ../sub1 ($sub1sha1_short)
  $sub2sha1 ../sub2 ($sub2sha1_short)
- $sub3sha1 ../sub3 (heads/master)
+ $sub3sha1 ../sub3 (heads/main)
 EOF
 
 test_expect_success 'test "status --recursive" from sub directory' '
diff --git a/t/t7409-submodule-detached-work-tree.sh b/t/t7409-submodule-detached-work-tree.sh
index fc018e3638..727490eb15 100755
--- a/t/t7409-submodule-detached-work-tree.sh
+++ b/t/t7409-submodule-detached-work-tree.sh
@@ -35,7 +35,7 @@ test_expect_success 'submodule on detached working tree' '
 			git rev-parse --verify HEAD >actual &&
 			test_cmp ../../../../expect actual
 		) &&
-		git push origin master
+		git push origin main
 	) &&
 	mkdir home2 &&
 	(
@@ -44,7 +44,7 @@ test_expect_success 'submodule on detached working tree' '
 		GIT_WORK_TREE="$(pwd)" &&
 		GIT_DIR="$(pwd)/.dotfiles" &&
 		export GIT_WORK_TREE GIT_DIR &&
-		git checkout master &&
+		git checkout main &&
 		git submodule update --init &&
 		(
 			unset GIT_WORK_TREE GIT_DIR &&
@@ -64,10 +64,10 @@ test_expect_success 'submodule on detached working pointed by core.worktree' '
 		git clone --bare ../remote "$GIT_DIR" &&
 		git config core.bare false &&
 		git config core.worktree .. &&
-		git checkout master &&
+		git checkout main &&
 		git submodule add ../bundle1 .vim/bundle/dupe &&
 		test_commit "dupe" &&
-		git push origin master
+		git push origin main
 	) &&
 	(
 		cd home &&
diff --git a/t/t7417-submodule-path-url.sh b/t/t7417-submodule-path-url.sh
index f7e7e94d7b..1c9181aee7 100755
--- a/t/t7417-submodule-path-url.sh
+++ b/t/t7417-submodule-path-url.sh
@@ -36,7 +36,7 @@ test_expect_success MINGW 'submodule paths disallows trailing spaces' '
 	sed "s/sub/sub /" <tree >tree.new &&
 	tree=$(git -C super mktree <tree.new) &&
 	commit=$(echo with space | git -C super commit-tree $tree) &&
-	git -C super update-ref refs/heads/master $commit &&
+	git -C super update-ref refs/heads/main $commit &&
 
 	test_must_fail git clone --recurse-submodules super dst 2>err &&
 	test_i18ngrep "sub " err
diff --git a/t/test-lib.sh b/t/test-lib.sh
index 44b4bba0cb..815d7b21fe 100644
--- a/t/test-lib.sh
+++ b/t/test-lib.sh
@@ -257,13 +257,13 @@ case "$TRASH_DIRECTORY" in
 esac
 
 case "$TEST_NUMBER" in
-3404|4013|5310|6300)
+3404|4013|5310|6300|7064)
 	# Avoid conflicts with patch series that are cooking at the same time
 	# as the patch series changing the default of `init.defaultBranch`.
 	GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
 	export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 	;;
-[0-6]*)
+[0-6]*|7[0-4]*)
 	GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 	export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 	;;
-- 
gitgitgadget


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH 21/28] t7[5-9]*: adjust the references to the default branch name "main"
  2020-11-12 22:43 [PATCH 00/28] Use main as default branch name Johannes Schindelin via GitGitGadget
                   ` (19 preceding siblings ...)
  2020-11-12 22:43 ` [PATCH 20/28] t7[0-4]*: " Johannes Schindelin via GitGitGadget
@ 2020-11-12 22:43 ` Johannes Schindelin via GitGitGadget
  2020-11-12 22:43 ` [PATCH 22/28] t8*: " Johannes Schindelin via GitGitGadget
                   ` (11 subsequent siblings)
  32 siblings, 0 replies; 163+ messages in thread
From: Johannes Schindelin via GitGitGadget @ 2020-11-12 22:43 UTC (permalink / raw)
  To: git; +Cc: Johannes Schindelin, Johannes Schindelin

From: Johannes Schindelin <johannes.schindelin@gmx.de>

Excluding t7817, which is added in an unrelated patch series at the time
of writing, this adjusts t7[5-9]*. This trick was performed via

	$ (cd t &&
	   sed -i -e 's/master/main/g' -e 's/MASTER/MAIN/g' \
		-e 's/Master/Main/g' -- t7[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>
---
 t/t7501-commit-basic-functionality.sh         |   2 +-
 t/t7502-commit-porcelain.sh                   |  12 +-
 ...3-pre-commit-and-pre-merge-commit-hooks.sh |  42 ++---
 t/t7504-commit-msg-hook.sh                    |  24 +--
 t/t7505-prepare-commit-msg-hook.sh            |  20 +-
 t/t7508-status.sh                             |  58 +++---
 t/t7510-signed-commit.sh                      |   2 +-
 t/t7512-status-help.sh                        |  40 ++--
 t/t7517-per-repo-email.sh                     |  12 +-
 t/t7600-merge.sh                              |  44 ++---
 t/t7606-merge-custom.sh                       |   2 +-
 t/t7608-merge-messages.sh                     |  36 ++--
 t/t7610-mergetool.sh                          | 174 +++++++++---------
 t/t7611-merge-abort.sh                        |   4 +-
 t/t7612-merge-verify-signatures.sh            |   2 +-
 t/t7614-merge-signoff.sh                      |  24 +--
 t/t7701-repack-unpack-unreachable.sh          |   2 +-
 t/t7800-difftool.sh                           |  38 ++--
 t/t7810-grep.sh                               |  28 +--
 t/test-lib.sh                                 |   4 +-
 20 files changed, 285 insertions(+), 285 deletions(-)

diff --git a/t/t7501-commit-basic-functionality.sh b/t/t7501-commit-basic-functionality.sh
index 110b4bf459..72c9031934 100755
--- a/t/t7501-commit-basic-functionality.sh
+++ b/t/t7501-commit-basic-functionality.sh
@@ -603,7 +603,7 @@ test_expect_success 'same tree (merge and amend merge)' '
 	echo zero >zero &&
 	git add zero &&
 	git commit -m "add zero" &&
-	git checkout master &&
+	git checkout main &&
 
 	git merge -s ours side -m "empty ok" &&
 	git diff HEAD^ HEAD >actual &&
diff --git a/t/t7502-commit-porcelain.sh b/t/t7502-commit-porcelain.sh
index 14c92e4c25..3956dcc237 100755
--- a/t/t7502-commit-porcelain.sh
+++ b/t/t7502-commit-porcelain.sh
@@ -76,7 +76,7 @@ test_expect_success 'output summary format for merges' '
 
 output_tests_cleanup() {
 	# this is needed for "do not fire editor in the presence of conflicts"
-	git checkout master &&
+	git checkout main &&
 
 	# this is needed for the "partial removal" test to pass
 	git rm file1 &&
@@ -440,7 +440,7 @@ test_expect_success 'do not fire editor in the presence of conflicts' '
 	git add g &&
 	git commit -m "add g" &&
 	git branch second &&
-	echo master >g &&
+	echo main >g &&
 	echo g >h &&
 	git add g h &&
 	git commit -m "modify g and add h" &&
@@ -449,7 +449,7 @@ test_expect_success 'do not fire editor in the presence of conflicts' '
 	git add g &&
 	git commit -m second &&
 	# Must fail due to conflict
-	test_must_fail git cherry-pick -n master &&
+	test_must_fail git cherry-pick -n main &&
 	echo "editor not started" >.git/result &&
 	(
 		GIT_EDITOR="\"$(pwd)/.git/FAKE_EDITOR\"" &&
@@ -478,9 +478,9 @@ git reset -q --hard
 
 test_expect_success 'Hand committing of a redundant merge removes dups' '
 
-	git rev-parse second master >expect &&
-	test_must_fail git merge second master &&
-	git checkout master g &&
+	git rev-parse second main >expect &&
+	test_must_fail git merge second main &&
+	git checkout main g &&
 	EDITOR=: git commit -a &&
 	git cat-file commit HEAD >raw &&
 	sed -n -e "s/^parent //p" -e "/^$/q" raw >actual &&
diff --git a/t/t7503-pre-commit-and-pre-merge-commit-hooks.sh b/t/t7503-pre-commit-and-pre-merge-commit-hooks.sh
index b3485450a2..6ac12726d6 100755
--- a/t/t7503-pre-commit-and-pre-merge-commit-hooks.sh
+++ b/t/t7503-pre-commit-and-pre-merge-commit-hooks.sh
@@ -44,16 +44,16 @@ test_expect_success 'root commit' '
 	git add foo &&
 	git commit -m "make it non-ff" &&
 	git branch side-orig side &&
-	git checkout master
+	git checkout main
 '
 
 test_expect_success 'setup conflicting branches' '
-	test_when_finished "git checkout master" &&
-	git checkout -b conflicting-a master &&
+	test_when_finished "git checkout main" &&
+	git checkout -b conflicting-a main &&
 	echo a >conflicting &&
 	git add conflicting &&
 	git commit -m conflicting-a &&
-	git checkout -b conflicting-b master &&
+	git checkout -b conflicting-b main &&
 	echo b >conflicting &&
 	git add conflicting &&
 	git commit -m conflicting-b
@@ -71,8 +71,8 @@ test_expect_success 'with no hook (merge)' '
 	test_when_finished "rm -f actual_hooks" &&
 	git branch -f side side-orig &&
 	git checkout side &&
-	git merge -m "merge master" master &&
-	git checkout master &&
+	git merge -m "merge main" main &&
+	git checkout main &&
 	test_path_is_missing actual_hooks
 '
 
@@ -88,8 +88,8 @@ test_expect_success '--no-verify with no hook (merge)' '
 	test_when_finished "rm -f actual_hooks" &&
 	git branch -f side side-orig &&
 	git checkout side &&
-	git merge --no-verify -m "merge master" master &&
-	git checkout master &&
+	git merge --no-verify -m "merge main" main &&
+	git checkout main &&
 	test_path_is_missing actual_hooks
 '
 
@@ -108,15 +108,15 @@ test_expect_success 'with succeeding hook (merge)' '
 	cp "$HOOKDIR/success.sample" "$PREMERGE" &&
 	echo "$PREMERGE" >expected_hooks &&
 	git checkout side &&
-	git merge -m "merge master" master &&
-	git checkout master &&
+	git merge -m "merge main" main &&
+	git checkout main &&
 	test_cmp expected_hooks actual_hooks
 '
 
 test_expect_success 'automatic merge fails; both hooks are available' '
 	test_when_finished "rm -f \"$PREMERGE\" \"$PRECOMMIT\"" &&
 	test_when_finished "rm -f expected_hooks actual_hooks" &&
-	test_when_finished "git checkout master" &&
+	test_when_finished "git checkout main" &&
 	cp "$HOOKDIR/success.sample" "$PREMERGE" &&
 	cp "$HOOKDIR/success.sample" "$PRECOMMIT" &&
 
@@ -145,8 +145,8 @@ test_expect_success '--no-verify with succeeding hook (merge)' '
 	cp "$HOOKDIR/success.sample" "$PREMERGE" &&
 	git branch -f side side-orig &&
 	git checkout side &&
-	git merge --no-verify -m "merge master" master &&
-	git checkout master &&
+	git merge --no-verify -m "merge main" main &&
+	git checkout main &&
 	test_path_is_missing actual_hooks
 '
 
@@ -174,8 +174,8 @@ test_expect_success 'with failing hook (merge)' '
 	cp "$HOOKDIR/fail.sample" "$PREMERGE" &&
 	echo "$PREMERGE" >expected_hooks &&
 	git checkout side &&
-	test_must_fail git merge -m "merge master" master &&
-	git checkout master &&
+	test_must_fail git merge -m "merge main" main &&
+	git checkout main &&
 	test_cmp expected_hooks actual_hooks
 '
 
@@ -184,8 +184,8 @@ test_expect_success '--no-verify with failing hook (merge)' '
 	cp "$HOOKDIR/fail.sample" "$PREMERGE" &&
 	git branch -f side side-orig &&
 	git checkout side &&
-	git merge --no-verify -m "merge master" master &&
-	git checkout master &&
+	git merge --no-verify -m "merge main" main &&
+	git checkout main &&
 	test_path_is_missing actual_hooks
 '
 
@@ -212,8 +212,8 @@ test_expect_success POSIXPERM 'with non-executable hook (merge)' '
 	cp "$HOOKDIR/non-exec.sample" "$PREMERGE" &&
 	git branch -f side side-orig &&
 	git checkout side &&
-	git merge -m "merge master" master &&
-	git checkout master &&
+	git merge -m "merge main" main &&
+	git checkout main &&
 	test_path_is_missing actual_hooks
 '
 
@@ -222,8 +222,8 @@ test_expect_success POSIXPERM '--no-verify with non-executable hook (merge)' '
 	cp "$HOOKDIR/non-exec.sample" "$PREMERGE" &&
 	git branch -f side side-orig &&
 	git checkout side &&
-	git merge --no-verify -m "merge master" master &&
-	git checkout master &&
+	git merge --no-verify -m "merge main" main &&
+	git checkout main &&
 	test_path_is_missing actual_hooks
 '
 
diff --git a/t/t7504-commit-msg-hook.sh b/t/t7504-commit-msg-hook.sh
index 31b9c6a2c1..2547362a39 100755
--- a/t/t7504-commit-msg-hook.sh
+++ b/t/t7504-commit-msg-hook.sh
@@ -142,12 +142,12 @@ test_expect_success '--no-verify with failing hook (editor)' '
 test_expect_success 'merge fails with failing hook' '
 
 	test_when_finished "git branch -D newbranch" &&
-	test_when_finished "git checkout -f master" &&
+	test_when_finished "git checkout -f main" &&
 	git checkout --orphan newbranch &&
 	: >file2 &&
 	git add file2 &&
 	git commit --no-verify file2 -m in-side-branch &&
-	test_must_fail git merge --allow-unrelated-histories master &&
+	test_must_fail git merge --allow-unrelated-histories main &&
 	commit_msg_is "in-side-branch" # HEAD before merge
 
 '
@@ -155,14 +155,14 @@ test_expect_success 'merge fails with failing hook' '
 test_expect_success 'merge bypasses failing hook with --no-verify' '
 
 	test_when_finished "git branch -D newbranch" &&
-	test_when_finished "git checkout -f master" &&
+	test_when_finished "git checkout -f main" &&
 	git checkout --orphan newbranch &&
 	git rm -f file &&
 	: >file2 &&
 	git add file2 &&
 	git commit --no-verify file2 -m in-side-branch &&
-	git merge --no-verify --allow-unrelated-histories master &&
-	commit_msg_is "Merge branch '\''master'\'' into newbranch"
+	git merge --no-verify --allow-unrelated-histories main &&
+	commit_msg_is "Merge branch '\''main'\'' into newbranch"
 '
 
 
@@ -248,28 +248,28 @@ test_expect_success "hook doesn't edit commit message (editor)" '
 
 test_expect_success 'hook called in git-merge picks up commit message' '
 	test_when_finished "git branch -D newbranch" &&
-	test_when_finished "git checkout -f master" &&
+	test_when_finished "git checkout -f main" &&
 	git checkout --orphan newbranch &&
 	git rm -f file &&
 	: >file2 &&
 	git add file2 &&
 	git commit --no-verify file2 -m in-side-branch &&
-	git merge --allow-unrelated-histories master &&
+	git merge --allow-unrelated-histories main &&
 	commit_msg_is "new message"
 '
 
 test_expect_failure 'merge --continue remembers --no-verify' '
 	test_when_finished "git branch -D newbranch" &&
-	test_when_finished "git checkout -f master" &&
-	git checkout master &&
+	test_when_finished "git checkout -f main" &&
+	git checkout main &&
 	echo a >file2 &&
 	git add file2 &&
-	git commit --no-verify -m "add file2 to master" &&
-	git checkout -b newbranch master^ &&
+	git commit --no-verify -m "add file2 to main" &&
+	git checkout -b newbranch main^ &&
 	echo b >file2 &&
 	git add file2 &&
 	git commit --no-verify file2 -m in-side-branch &&
-	git merge --no-verify -m not-rewritten-by-hook master &&
+	git merge --no-verify -m not-rewritten-by-hook main &&
 	# resolve conflict:
 	echo c >file2 &&
 	git add file2 &&
diff --git a/t/t7505-prepare-commit-msg-hook.sh b/t/t7505-prepare-commit-msg-hook.sh
index 94f85cdf83..20b49629cd 100755
--- a/t/t7505-prepare-commit-msg-hook.sh
+++ b/t/t7505-prepare-commit-msg-hook.sh
@@ -15,7 +15,7 @@ test_expect_success 'set up commits for rebasing' '
 	do
 		test_commit rebase-$i c $i
 	done &&
-	git checkout master &&
+	git checkout main &&
 
 	cat >rebase-todo <<-EOF
 	pick $(git rev-parse rebase-a)
@@ -190,7 +190,7 @@ test_expect_success 'with hook (-c)' '
 
 test_expect_success 'with hook (merge)' '
 
-	test_when_finished "git checkout -f master" &&
+	test_when_finished "git checkout -f main" &&
 	git checkout -B other HEAD@{1} &&
 	echo "more" >>file &&
 	git add file &&
@@ -202,7 +202,7 @@ test_expect_success 'with hook (merge)' '
 
 test_expect_success 'with hook and editor (merge)' '
 
-	test_when_finished "git checkout -f master" &&
+	test_when_finished "git checkout -f main" &&
 	git checkout -B other HEAD@{1} &&
 	echo "more" >>file &&
 	git add file &&
@@ -218,7 +218,7 @@ test_rebase () {
 	test_expect_$expect C_LOCALE_OUTPUT "with hook (rebase ${mode:--i})" '
 		test_when_finished "\
 			git rebase --abort
-			git checkout -f master
+			git checkout -f main
 			git branch -D tmp" &&
 		git checkout -b tmp rebase-me &&
 		GIT_SEQUENCE_EDITOR="cp rebase-todo" &&
@@ -250,14 +250,14 @@ test_rebase success
 test_have_prereq !REBASE_P || test_rebase success -p
 
 test_expect_success 'with hook (cherry-pick)' '
-	test_when_finished "git checkout -f master" &&
+	test_when_finished "git checkout -f main" &&
 	git checkout -B other b &&
 	git cherry-pick rebase-1 &&
 	test "$(git log -1 --pretty=format:%s)" = "message (no editor)"
 '
 
 test_expect_success 'with hook and editor (cherry-pick)' '
-	test_when_finished "git checkout -f master" &&
+	test_when_finished "git checkout -f main" &&
 	git checkout -B other b &&
 	git cherry-pick -e rebase-1 &&
 	test "$(git log -1 --pretty=format:%s)" = merge
@@ -270,7 +270,7 @@ EOF
 
 test_expect_success 'with failing hook' '
 
-	test_when_finished "git checkout -f master" &&
+	test_when_finished "git checkout -f main" &&
 	head=$(git rev-parse HEAD) &&
 	echo "more" >> file &&
 	git add file &&
@@ -280,7 +280,7 @@ test_expect_success 'with failing hook' '
 
 test_expect_success 'with failing hook (--no-verify)' '
 
-	test_when_finished "git checkout -f master" &&
+	test_when_finished "git checkout -f main" &&
 	head=$(git rev-parse HEAD) &&
 	echo "more" >> file &&
 	git add file &&
@@ -290,7 +290,7 @@ test_expect_success 'with failing hook (--no-verify)' '
 
 test_expect_success 'with failing hook (merge)' '
 
-	test_when_finished "git checkout -f master" &&
+	test_when_finished "git checkout -f main" &&
 	git checkout -B other HEAD@{1} &&
 	echo "more" >> file &&
 	git add file &&
@@ -305,7 +305,7 @@ test_expect_success 'with failing hook (merge)' '
 '
 
 test_expect_success C_LOCALE_OUTPUT 'with failing hook (cherry-pick)' '
-	test_when_finished "git checkout -f master" &&
+	test_when_finished "git checkout -f main" &&
 	git checkout -B other b &&
 	test_must_fail git cherry-pick rebase-1 2>actual &&
 	test $(grep -c prepare-commit-msg actual) = 1
diff --git a/t/t7508-status.sh b/t/t7508-status.sh
index 963fed6821..d01aacb66b 100755
--- a/t/t7508-status.sh
+++ b/t/t7508-status.sh
@@ -37,11 +37,11 @@ test_expect_success 'create upstream branch' '
 	git checkout -b upstream &&
 	test_commit upstream1 &&
 	test_commit upstream2 &&
-	# leave the first commit on master as root because several
+	# leave the first commit on main as root because several
 	# tests depend on this case; for our upstream we only
 	# care about commit counts anyway, so a totally divergent
 	# history is OK
-	git checkout --orphan master
+	git checkout --orphan main
 '
 
 test_expect_success 'setup' '
@@ -88,7 +88,7 @@ EOF
 
 test_expect_success 'status --column' '
 	cat >expect <<\EOF &&
-# On branch master
+# On branch main
 # Your branch and '\''upstream'\'' have diverged,
 # and have 1 and 2 different commits each, respectively.
 #   (use "git pull" to merge the remote branch into yours)
@@ -119,7 +119,7 @@ test_expect_success 'status --column status.displayCommentPrefix=false' '
 '
 
 cat >expect <<\EOF
-# On branch master
+# On branch main
 # Your branch and 'upstream' have diverged,
 # and have 1 and 2 different commits each, respectively.
 #   (use "git pull" to merge the remote branch into yours)
@@ -193,7 +193,7 @@ test_expect_success 'commit ignores status.displayCommentPrefix=false in COMMIT_
 '
 
 cat >expect <<\EOF
-On branch master
+On branch main
 Your branch and 'upstream' have diverged,
 and have 1 and 2 different commits each, respectively.
 
@@ -266,7 +266,7 @@ test_expect_success 'status with gitignore' '
 	test_cmp expect output &&
 
 	cat >expect <<\EOF &&
-On branch master
+On branch main
 Your branch and '\''upstream'\'' have diverged,
 and have 1 and 2 different commits each, respectively.
   (use "git pull" to merge the remote branch into yours)
@@ -331,7 +331,7 @@ test_expect_success 'status with gitignore (nothing untracked)' '
 	test_cmp expect output &&
 
 	cat >expect <<\EOF &&
-On branch master
+On branch main
 Your branch and '\''upstream'\'' have diverged,
 and have 1 and 2 different commits each, respectively.
   (use "git pull" to merge the remote branch into yours)
@@ -368,7 +368,7 @@ output*
 EOF
 
 cat >expect <<\EOF
-## master...upstream [ahead 1, behind 2]
+## main...upstream [ahead 1, behind 2]
  M dir1/modified
 A  dir2/added
 ?? dir1/untracked
@@ -401,7 +401,7 @@ test_expect_success 'setup dir3' '
 
 test_expect_success 'status -uno' '
 	cat >expect <<EOF &&
-On branch master
+On branch main
 Your branch and '\''upstream'\'' have diverged,
 and have 1 and 2 different commits each, respectively.
   (use "git pull" to merge the remote branch into yours)
@@ -429,7 +429,7 @@ test_expect_success 'status (status.showUntrackedFiles no)' '
 
 test_expect_success 'status -uno (advice.statusHints false)' '
 	cat >expect <<EOF &&
-On branch master
+On branch main
 Your branch and '\''upstream'\'' have diverged,
 and have 1 and 2 different commits each, respectively.
 
@@ -463,7 +463,7 @@ test_expect_success 'status -s (status.showUntrackedFiles no)' '
 
 test_expect_success 'status -unormal' '
 	cat >expect <<EOF &&
-On branch master
+On branch main
 Your branch and '\''upstream'\'' have diverged,
 and have 1 and 2 different commits each, respectively.
   (use "git pull" to merge the remote branch into yours)
@@ -518,7 +518,7 @@ test_expect_success 'status -s (status.showUntrackedFiles normal)' '
 
 test_expect_success 'status -uall' '
 	cat >expect <<EOF &&
-On branch master
+On branch main
 Your branch and '\''upstream'\'' have diverged,
 and have 1 and 2 different commits each, respectively.
   (use "git pull" to merge the remote branch into yours)
@@ -578,7 +578,7 @@ test_expect_success 'status -s (status.showUntrackedFiles all)' '
 
 test_expect_success 'status with relative paths' '
 	cat >expect <<\EOF &&
-On branch master
+On branch main
 Your branch and '\''upstream'\'' have diverged,
 and have 1 and 2 different commits each, respectively.
   (use "git pull" to merge the remote branch into yours)
@@ -646,7 +646,7 @@ test_expect_success 'setup unique colors' '
 
 test_expect_success TTY 'status with color.ui' '
 	cat >expect <<\EOF &&
-On branch <GREEN>master<RESET>
+On branch <GREEN>main<RESET>
 Your branch and '\''upstream'\'' have diverged,
 and have 1 and 2 different commits each, respectively.
   (use "git pull" to merge the remote branch into yours)
@@ -706,7 +706,7 @@ test_expect_success TTY 'status -s with color.status' '
 '
 
 cat >expect <<\EOF
-## <YELLOW>master<RESET>...<CYAN>upstream<RESET> [ahead <YELLOW>1<RESET>, behind <CYAN>2<RESET>]
+## <YELLOW>main<RESET>...<CYAN>upstream<RESET> [ahead <YELLOW>1<RESET>, behind <CYAN>2<RESET>]
  <RED>M<RESET> dir1/modified
 <GREEN>A<RESET>  dir2/added
 <BLUE>??<RESET> dir1/untracked
@@ -757,7 +757,7 @@ test_expect_success 'status --porcelain respects -b' '
 
 	git status --porcelain -b >output &&
 	{
-		echo "## master...upstream [ahead 1, behind 2]" &&
+		echo "## main...upstream [ahead 1, behind 2]" &&
 		cat expect
 	} >tmp &&
 	mv tmp expect &&
@@ -769,7 +769,7 @@ test_expect_success 'status --porcelain respects -b' '
 
 test_expect_success 'status without relative paths' '
 	cat >expect <<\EOF &&
-On branch master
+On branch main
 Your branch and '\''upstream'\'' have diverged,
 and have 1 and 2 different commits each, respectively.
   (use "git pull" to merge the remote branch into yours)
@@ -843,7 +843,7 @@ test_expect_success 'status -s without relative paths' '
 
 test_expect_success 'dry-run of partial commit excluding new file in index' '
 	cat >expect <<EOF &&
-On branch master
+On branch main
 Your branch and '\''upstream'\'' have diverged,
 and have 1 and 2 different commits each, respectively.
   (use "git pull" to merge the remote branch into yours)
@@ -897,7 +897,7 @@ test_expect_success 'setup status submodule summary' '
 
 test_expect_success 'status submodule summary is disabled by default' '
 	cat >expect <<EOF &&
-On branch master
+On branch main
 Your branch and '\''upstream'\'' have diverged,
 and have 1 and 2 different commits each, respectively.
   (use "git pull" to merge the remote branch into yours)
@@ -954,7 +954,7 @@ head=$(cd sm && git rev-parse --short=7 --verify HEAD)
 
 test_expect_success 'status submodule summary' '
 	cat >expect <<EOF &&
-On branch master
+On branch main
 Your branch and '\''upstream'\'' have diverged,
 and have 1 and 2 different commits each, respectively.
   (use "git pull" to merge the remote branch into yours)
@@ -1013,7 +1013,7 @@ test_expect_success 'status -s submodule summary' '
 
 test_expect_success 'status submodule summary (clean submodule): commit' '
 	cat >expect <<EOF &&
-On branch master
+On branch main
 Your branch and '\''upstream'\'' have diverged,
 and have 2 and 2 different commits each, respectively.
   (use "git pull" to merge the remote branch into yours)
@@ -1061,7 +1061,7 @@ test_expect_success 'status -z implies porcelain' '
 
 test_expect_success 'commit --dry-run submodule summary (--amend)' '
 	cat >expect <<EOF &&
-On branch master
+On branch main
 Your branch and '\''upstream'\'' have diverged,
 and have 2 and 2 different commits each, respectively.
   (use "git pull" to merge the remote branch into yours)
@@ -1113,7 +1113,7 @@ touch .gitmodules
 
 test_expect_success '--ignore-submodules=untracked suppresses submodules with untracked content' '
 	cat > expect << EOF &&
-On branch master
+On branch main
 Your branch and '\''upstream'\'' have diverged,
 and have 2 and 2 different commits each, respectively.
   (use "git pull" to merge the remote branch into yours)
@@ -1222,7 +1222,7 @@ test_expect_success '.git/config ignore=dirty suppresses submodules with modifie
 
 test_expect_success "--ignore-submodules=untracked doesn't suppress submodules with modified content" '
 	cat > expect << EOF &&
-On branch master
+On branch main
 Your branch and '\''upstream'\'' have diverged,
 and have 2 and 2 different commits each, respectively.
   (use "git pull" to merge the remote branch into yours)
@@ -1279,7 +1279,7 @@ head2=$(cd sm && git commit -q -m "2nd commit" foo && git rev-parse --short=7 --
 
 test_expect_success "--ignore-submodules=untracked doesn't suppress submodule summary" '
 	cat > expect << EOF &&
-On branch master
+On branch main
 Your branch and '\''upstream'\'' have diverged,
 and have 2 and 2 different commits each, respectively.
   (use "git pull" to merge the remote branch into yours)
@@ -1360,7 +1360,7 @@ test_expect_success ".git/config ignore=dirty doesn't suppress submodule summary
 '
 
 cat > expect << EOF
-; On branch master
+; On branch main
 ; Your branch and 'upstream' have diverged,
 ; and have 2 and 2 different commits each, respectively.
 ;   (use "git pull" to merge the remote branch into yours)
@@ -1408,7 +1408,7 @@ test_expect_success "status (core.commentchar with two chars with submodule summ
 
 test_expect_success "--ignore-submodules=all suppresses submodule summary" '
 	cat > expect << EOF &&
-On branch master
+On branch main
 Your branch and '\''upstream'\'' have diverged,
 and have 2 and 2 different commits each, respectively.
   (use "git pull" to merge the remote branch into yours)
@@ -1434,7 +1434,7 @@ EOF
 
 test_expect_success '.gitmodules ignore=all suppresses unstaged submodule summary' '
 	cat > expect << EOF &&
-On branch master
+On branch main
 Your branch and '\''upstream'\'' have diverged,
 and have 2 and 2 different commits each, respectively.
   (use "git pull" to merge the remote branch into yours)
@@ -1554,7 +1554,7 @@ test_expect_success 'git commit --dry-run will show a staged but ignored submodu
 	git reset HEAD^ &&
 	git add sm &&
 	cat >expect << EOF &&
-On branch master
+On branch main
 Your branch and '\''upstream'\'' have diverged,
 and have 2 and 2 different commits each, respectively.
   (use "git pull" to merge the remote branch into yours)
diff --git a/t/t7510-signed-commit.sh b/t/t7510-signed-commit.sh
index 6baaa1ad91..0653fdcd02 100755
--- a/t/t7510-signed-commit.sh
+++ b/t/t7510-signed-commit.sh
@@ -25,7 +25,7 @@ test_expect_success GPG 'create signed commits' '
 	echo 3 >elif && git add elif &&
 	test_tick && git commit -m "third on side" &&
 
-	git checkout master &&
+	git checkout main &&
 	test_tick && git merge -S side &&
 	git tag merge &&
 
diff --git a/t/t7512-status-help.sh b/t/t7512-status-help.sh
index 29518e0949..29aa9adcfd 100755
--- a/t/t7512-status-help.sh
+++ b/t/t7512-status-help.sh
@@ -17,14 +17,14 @@ test_expect_success 'prepare for conflicts' '
 	git config --global advice.statusuoption false &&
 	test_commit init main.txt init &&
 	git branch conflicts &&
-	test_commit on_master main.txt on_master &&
+	test_commit on_main main.txt on_main &&
 	git checkout conflicts &&
 	test_commit on_conflicts main.txt on_conflicts
 '
 
 
 test_expect_success 'status when conflicts unresolved' '
-	test_must_fail git merge master &&
+	test_must_fail git merge main &&
 	cat >expected <<\EOF &&
 On branch conflicts
 You have unmerged paths.
@@ -44,7 +44,7 @@ EOF
 
 test_expect_success 'status when conflicts resolved before commit' '
 	git reset --hard conflicts &&
-	test_must_fail git merge master &&
+	test_must_fail git merge main &&
 	echo one >main.txt &&
 	git add main.txt &&
 	cat >expected <<\EOF &&
@@ -63,7 +63,7 @@ EOF
 
 
 test_expect_success 'prepare for rebase conflicts' '
-	git reset --hard master &&
+	git reset --hard main &&
 	git checkout -b rebase_conflicts &&
 	test_commit one_rebase main.txt one &&
 	test_commit two_rebase main.txt two &&
@@ -118,11 +118,11 @@ EOF
 
 
 test_expect_success 'prepare for rebase_i_conflicts' '
-	git reset --hard master &&
+	git reset --hard main &&
 	git checkout -b rebase_i_conflicts &&
 	test_commit one_unmerge main.txt one_unmerge &&
 	git branch rebase_i_conflicts_second &&
-	test_commit one_master main.txt one_master &&
+	test_commit one_main main.txt one_main &&
 	git checkout rebase_i_conflicts_second &&
 	test_commit one_second main.txt one_second
 '
@@ -182,7 +182,7 @@ EOF
 
 
 test_expect_success 'status when rebasing -i in edit mode' '
-	git reset --hard master &&
+	git reset --hard main &&
 	git checkout -b rebase_i_edit &&
 	test_commit one_rebase_i main.txt one &&
 	test_commit two_rebase_i main.txt two &&
@@ -212,7 +212,7 @@ EOF
 
 
 test_expect_success 'status when splitting a commit' '
-	git reset --hard master &&
+	git reset --hard main &&
 	git checkout -b split_commit &&
 	test_commit one_split main.txt one &&
 	test_commit two_split main.txt two &&
@@ -251,7 +251,7 @@ EOF
 
 
 test_expect_success 'status after editing the last commit with --amend during a rebase -i' '
-	git reset --hard master &&
+	git reset --hard main &&
 	git checkout -b amend_last &&
 	test_commit one_amend main.txt one &&
 	test_commit two_amend main.txt two &&
@@ -284,7 +284,7 @@ EOF
 
 
 test_expect_success 'prepare for several edits' '
-	git reset --hard master &&
+	git reset --hard main &&
 	git checkout -b several_edits &&
 	test_commit one_edits main.txt one &&
 	test_commit two_edits main.txt two &&
@@ -593,7 +593,7 @@ EOF
 
 
 test_expect_success 'prepare am_session' '
-	git reset --hard master &&
+	git reset --hard main &&
 	git checkout -b am_session &&
 	test_commit one_am one.txt "one" &&
 	test_commit two_am two.txt "two" &&
@@ -666,7 +666,7 @@ EOF
 
 
 test_expect_success 'status when bisecting' '
-	git reset --hard master &&
+	git reset --hard main &&
 	git checkout -b bisect &&
 	test_commit one_bisect main.txt one &&
 	test_commit two_bisect main.txt two &&
@@ -689,7 +689,7 @@ EOF
 
 
 test_expect_success 'status when rebase --apply conflicts with statushints disabled' '
-	git reset --hard master &&
+	git reset --hard main &&
 	git checkout -b statushints_disabled &&
 	test_when_finished "git config --local advice.statushints true" &&
 	git config --local advice.statushints false &&
@@ -714,7 +714,7 @@ EOF
 
 
 test_expect_success 'prepare for cherry-pick conflicts' '
-	git reset --hard master &&
+	git reset --hard main &&
 	git checkout -b cherry_branch &&
 	test_commit one_cherry main.txt one &&
 	test_commit two_cherries main.txt two &&
@@ -825,7 +825,7 @@ EOF
 '
 
 test_expect_success 'status while reverting commit (conflicts)' '
-	git checkout master &&
+	git checkout main &&
 	echo before >to-revert.txt &&
 	test_commit before to-revert.txt &&
 	echo old >to-revert.txt &&
@@ -835,7 +835,7 @@ test_expect_success 'status while reverting commit (conflicts)' '
 	TO_REVERT=$(git rev-parse --short HEAD^) &&
 	test_must_fail git revert $TO_REVERT &&
 	cat >expected <<EOF &&
-On branch master
+On branch main
 You are currently reverting commit $TO_REVERT.
   (fix conflicts and run "git revert --continue")
   (use "git revert --skip" to skip this patch)
@@ -856,7 +856,7 @@ test_expect_success 'status while reverting commit (conflicts resolved)' '
 	echo reverted >to-revert.txt &&
 	git add to-revert.txt &&
 	cat >expected <<EOF &&
-On branch master
+On branch main
 You are currently reverting commit $TO_REVERT.
   (all conflicts fixed: run "git revert --continue")
   (use "git revert --skip" to skip this patch)
@@ -875,7 +875,7 @@ EOF
 test_expect_success 'status after reverting commit' '
 	git revert --continue &&
 	cat >expected <<\EOF &&
-On branch master
+On branch main
 nothing to commit (use -u to show untracked files)
 EOF
 	git status --untracked-files=no >actual &&
@@ -889,7 +889,7 @@ test_expect_success 'status while reverting after committing conflict resolution
 	echo reverted >to-revert.txt &&
 	git commit -a &&
 	cat >expected <<EOF &&
-On branch master
+On branch main
 Revert currently in progress.
   (run "git revert --continue" to continue)
   (use "git revert --skip" to skip this patch)
@@ -902,7 +902,7 @@ EOF
 '
 
 test_expect_success 'prepare for different number of commits rebased' '
-	git reset --hard master &&
+	git reset --hard main &&
 	git checkout -b several_commits &&
 	test_commit one_commit main.txt one &&
 	test_commit two_commit main.txt two &&
diff --git a/t/t7517-per-repo-email.sh b/t/t7517-per-repo-email.sh
index b2401cec3e..3a7723d16b 100755
--- a/t/t7517-per-repo-email.sh
+++ b/t/t7517-per-repo-email.sh
@@ -47,24 +47,24 @@ test_expect_success 'set up rebase scenarios' '
 
 test_expect_success 'fast-forward rebase does not care about ident' '
 	git checkout -B tmp side-without-commit &&
-	git rebase master
+	git rebase main
 '
 
 test_expect_success 'non-fast-forward rebase refuses to write commits' '
 	test_when_finished "git rebase --abort || true" &&
 	git checkout -B tmp side-with-commit &&
-	test_must_fail git rebase master
+	test_must_fail git rebase main
 '
 
 test_expect_success 'fast-forward rebase does not care about ident (interactive)' '
 	git checkout -B tmp side-without-commit &&
-	git rebase -i master
+	git rebase -i main
 '
 
 test_expect_success 'non-fast-forward rebase refuses to write commits (interactive)' '
 	test_when_finished "git rebase --abort || true" &&
 	git checkout -B tmp side-with-commit &&
-	test_must_fail git rebase -i master
+	test_must_fail git rebase -i main
 '
 
 test_expect_success 'noop interactive rebase does not care about ident' '
@@ -75,14 +75,14 @@ test_expect_success 'noop interactive rebase does not care about ident' '
 test_expect_success REBASE_P \
 	'fast-forward rebase does not care about ident (preserve)' '
 	git checkout -B tmp side-without-commit &&
-	git rebase -p master
+	git rebase -p main
 '
 
 test_expect_success REBASE_P \
 	'non-fast-forward rebase refuses to write commits (preserve)' '
 	test_when_finished "git rebase --abort || true" &&
 	git checkout -B tmp side-with-commit &&
-	test_must_fail git rebase -p master
+	test_must_fail git rebase -p main
 '
 
 test_expect_success 'author.name overrides user.name' '
diff --git a/t/t7600-merge.sh b/t/t7600-merge.sh
index 1c85f75555..6feb8895f3 100755
--- a/t/t7600-merge.sh
+++ b/t/t7600-merge.sh
@@ -14,9 +14,9 @@ Testing basic merge operations/option parsing.
     ! [c4] c4
      ! [c5] c5
       ! [c6] c6
-       * [master] Merge commit 'c1'
+       * [main] Merge commit 'c1'
 --------
-       - [master] Merge commit 'c1'
+       - [main] Merge commit 'c1'
  +     * [c1] commit 1
       +  [c6] c6
      +   [c5] c5
@@ -203,13 +203,13 @@ test_expect_success 'merge c0 with c1 with --ff-only' '
 test_debug 'git log --graph --decorate --oneline --all'
 
 test_expect_success 'merge from unborn branch' '
-	git checkout -f master &&
+	git checkout -f main &&
 	test_might_fail git branch -D kid &&
 
 	echo "OBJID HEAD@{0}: initial pull" >reflog.expected &&
 
 	git checkout --orphan kid &&
-	test_when_finished "git checkout -f master" &&
+	test_when_finished "git checkout -f main" &&
 	git rm -fr . &&
 	test_tick &&
 	git merge --ff-only c1 &&
@@ -413,7 +413,7 @@ test_debug 'git log --graph --decorate --oneline --all'
 
 test_expect_success 'merge c1 with c2 (no-commit in config)' '
 	git reset --hard c1 &&
-	test_config branch.master.mergeoptions "--no-commit" &&
+	test_config branch.main.mergeoptions "--no-commit" &&
 	git merge c2 &&
 	verify_merge file result.1-5 &&
 	verify_head $c1 &&
@@ -427,7 +427,7 @@ test_expect_success 'merge c1 with c2 (log in config)' '
 	git merge --log c2 &&
 	git show -s --pretty=tformat:%s%n%b >expect &&
 
-	test_config branch.master.mergeoptions "--log" &&
+	test_config branch.main.mergeoptions "--log" &&
 	git reset --hard c1 &&
 	git merge c2 &&
 	git show -s --pretty=tformat:%s%n%b >actual &&
@@ -440,7 +440,7 @@ test_expect_success 'merge c1 with c2 (log in config gets overridden)' '
 	git merge c2 &&
 	git show -s --pretty=tformat:%s%n%b >expect &&
 
-	test_config branch.master.mergeoptions "--no-log" &&
+	test_config branch.main.mergeoptions "--no-log" &&
 	test_config merge.log "true" &&
 	git reset --hard c1 &&
 	git merge c2 &&
@@ -451,7 +451,7 @@ test_expect_success 'merge c1 with c2 (log in config gets overridden)' '
 
 test_expect_success 'merge c1 with c2 (squash in config)' '
 	git reset --hard c1 &&
-	test_config branch.master.mergeoptions "--squash" &&
+	test_config branch.main.mergeoptions "--squash" &&
 	git merge c2 &&
 	verify_merge file result.1-5 &&
 	verify_head $c1 &&
@@ -463,7 +463,7 @@ test_debug 'git log --graph --decorate --oneline --all'
 
 test_expect_success 'override config option -n with --summary' '
 	git reset --hard c1 &&
-	test_config branch.master.mergeoptions "-n" &&
+	test_config branch.main.mergeoptions "-n" &&
 	test_tick &&
 	git merge --summary c2 >diffstat.txt &&
 	verify_merge file result.1-5 msg.1-5 &&
@@ -477,7 +477,7 @@ test_expect_success 'override config option -n with --summary' '
 
 test_expect_success 'override config option -n with --stat' '
 	git reset --hard c1 &&
-	test_config branch.master.mergeoptions "-n" &&
+	test_config branch.main.mergeoptions "-n" &&
 	test_tick &&
 	git merge --stat c2 >diffstat.txt &&
 	verify_merge file result.1-5 msg.1-5 &&
@@ -493,7 +493,7 @@ test_debug 'git log --graph --decorate --oneline --all'
 
 test_expect_success 'override config option --stat' '
 	git reset --hard c1 &&
-	test_config branch.master.mergeoptions "--stat" &&
+	test_config branch.main.mergeoptions "--stat" &&
 	test_tick &&
 	git merge -n c2 >diffstat.txt &&
 	verify_merge file result.1-5 msg.1-5 &&
@@ -509,7 +509,7 @@ test_debug 'git log --graph --decorate --oneline --all'
 
 test_expect_success 'merge c1 with c2 (override --no-commit)' '
 	git reset --hard c1 &&
-	test_config branch.master.mergeoptions "--no-commit" &&
+	test_config branch.main.mergeoptions "--no-commit" &&
 	test_tick &&
 	git merge --commit c2 &&
 	verify_merge file result.1-5 msg.1-5 &&
@@ -520,7 +520,7 @@ test_debug 'git log --graph --decorate --oneline --all'
 
 test_expect_success 'merge c1 with c2 (override --squash)' '
 	git reset --hard c1 &&
-	test_config branch.master.mergeoptions "--squash" &&
+	test_config branch.main.mergeoptions "--squash" &&
 	test_tick &&
 	git merge --no-squash c2 &&
 	verify_merge file result.1-5 msg.1-5 &&
@@ -549,9 +549,9 @@ test_expect_success 'merge c0 with c1 (merge.ff=false)' '
 '
 test_debug 'git log --graph --decorate --oneline --all'
 
-test_expect_success 'combine branch.master.mergeoptions with merge.ff' '
+test_expect_success 'combine branch.main.mergeoptions with merge.ff' '
 	git reset --hard c0 &&
-	test_config branch.master.mergeoptions "--ff" &&
+	test_config branch.main.mergeoptions "--ff" &&
 	test_config merge.ff "false" &&
 	test_tick &&
 	git merge c1 &&
@@ -593,7 +593,7 @@ test_expect_success 'option --no-ff overrides merge.ff=only config' '
 
 test_expect_success 'merge c0 with c1 (ff overrides no-ff)' '
 	git reset --hard c0 &&
-	test_config branch.master.mergeoptions "--no-ff" &&
+	test_config branch.main.mergeoptions "--no-ff" &&
 	git merge --ff c1 &&
 	verify_merge file result.1 &&
 	verify_head $c1
@@ -606,7 +606,7 @@ test_expect_success 'merge log message' '
 	test_must_be_empty msg.act &&
 
 	git reset --hard c0 &&
-	test_config branch.master.mergeoptions "--no-ff" &&
+	test_config branch.main.mergeoptions "--no-ff" &&
 	git merge --no-log c2 &&
 	git show -s --pretty=format:%b HEAD >msg.act &&
 	test_must_be_empty msg.act &&
@@ -950,10 +950,10 @@ test_expect_success 'set up mod-256 conflict scenario' '
 	git add file &&
 	git commit -m base &&
 
-	# one side changes the first line of each to "master"
-	sed s/-1/-master/ file >tmp &&
+	# one side changes the first line of each to "main"
+	sed s/-1/-main/ file >tmp &&
 	mv tmp file &&
-	git commit -am master &&
+	git commit -am main &&
 
 	# and the other to "side"; merging the two will
 	# yield 256 separate conflicts
@@ -965,12 +965,12 @@ test_expect_success 'set up mod-256 conflict scenario' '
 
 test_expect_success 'merge detects mod-256 conflicts (recursive)' '
 	git reset --hard &&
-	test_must_fail git merge -s recursive master
+	test_must_fail git merge -s recursive main
 '
 
 test_expect_success 'merge detects mod-256 conflicts (resolve)' '
 	git reset --hard &&
-	test_must_fail git merge -s resolve master
+	test_must_fail git merge -s resolve main
 '
 
 test_expect_success 'merge nothing into void' '
diff --git a/t/t7606-merge-custom.sh b/t/t7606-merge-custom.sh
index 8e8c4d7246..81fb7c474c 100755
--- a/t/t7606-merge-custom.sh
+++ b/t/t7606-merge-custom.sh
@@ -4,7 +4,7 @@ test_description="git merge
 
 Testing a custom strategy.
 
-*   (HEAD, master) Merge commit 'c3'
+*   (HEAD, main) Merge commit 'c3'
 |\
 | * (tag: c3) c3
 * | (tag: c1) c1
diff --git a/t/t7608-merge-messages.sh b/t/t7608-merge-messages.sh
index 8e7e0a5865..d5e411daf5 100755
--- a/t/t7608-merge-messages.sh
+++ b/t/t7608-merge-messages.sh
@@ -10,51 +10,51 @@ check_oneline() {
 }
 
 test_expect_success 'merge local branch' '
-	test_commit master-1 &&
+	test_commit main-1 &&
 	git checkout -b local-branch &&
 	test_commit branch-1 &&
-	git checkout master &&
-	test_commit master-2 &&
+	git checkout main &&
+	test_commit main-2 &&
 	git merge local-branch &&
 	check_oneline "Merge branch Qlocal-branchQ"
 '
 
 test_expect_success 'merge octopus branches' '
-	git checkout -b octopus-a master &&
+	git checkout -b octopus-a main &&
 	test_commit octopus-1 &&
-	git checkout -b octopus-b master &&
+	git checkout -b octopus-b main &&
 	test_commit octopus-2 &&
-	git checkout master &&
+	git checkout main &&
 	git merge octopus-a octopus-b &&
 	check_oneline "Merge branches Qoctopus-aQ and Qoctopus-bQ"
 '
 
 test_expect_success 'merge tag' '
-	git checkout -b tag-branch master &&
+	git checkout -b tag-branch main &&
 	test_commit tag-1 &&
-	git checkout master &&
-	test_commit master-3 &&
+	git checkout main &&
+	test_commit main-3 &&
 	git merge tag-1 &&
 	check_oneline "Merge tag Qtag-1Q"
 '
 
 test_expect_success 'ambiguous tag' '
-	git checkout -b ambiguous master &&
+	git checkout -b ambiguous main &&
 	test_commit ambiguous &&
-	git checkout master &&
-	test_commit master-4 &&
+	git checkout main &&
+	test_commit main-4 &&
 	git merge ambiguous &&
 	check_oneline "Merge tag QambiguousQ"
 '
 
 test_expect_success 'remote-tracking branch' '
-	git checkout -b remote master &&
+	git checkout -b remote main &&
 	test_commit remote-1 &&
-	git update-ref refs/remotes/origin/master remote &&
-	git checkout master &&
-	test_commit master-5 &&
-	git merge origin/master &&
-	check_oneline "Merge remote-tracking branch Qorigin/masterQ"
+	git update-ref refs/remotes/origin/main remote &&
+	git checkout main &&
+	test_commit main-5 &&
+	git merge origin/main &&
+	check_oneline "Merge remote-tracking branch Qorigin/mainQ"
 '
 
 test_done
diff --git a/t/t7610-mergetool.sh b/t/t7610-mergetool.sh
index 70afdd06fa..69ef7f7356 100755
--- a/t/t7610-mergetool.sh
+++ b/t/t7610-mergetool.sh
@@ -10,19 +10,19 @@ Testing basic merge tool invocation'
 . ./test-lib.sh
 
 # All the mergetool test work by checking out a temporary branch based
-# off 'branch1' and then merging in master and checking the results of
+# off 'branch1' and then merging in main and checking the results of
 # running mergetool
 
 test_expect_success 'setup' '
 	test_config rerere.enabled true &&
-	echo master >file1 &&
-	echo master spaced >"spaced name" &&
-	echo master file11 >file11 &&
-	echo master file12 >file12 &&
-	echo master file13 >file13 &&
-	echo master file14 >file14 &&
+	echo main >file1 &&
+	echo main spaced >"spaced name" &&
+	echo main file11 >file11 &&
+	echo main file12 >file12 &&
+	echo main file13 >file13 &&
+	echo main file14 >file14 &&
 	mkdir subdir &&
-	echo master sub >subdir/file3 &&
+	echo main sub >subdir/file3 &&
 	test_create_repo submod &&
 	(
 		cd submod &&
@@ -34,7 +34,7 @@ test_expect_success 'setup' '
 	git add file1 "spaced name" file1[1-4] subdir/file3 .gitmodules submod &&
 	git commit -m "add initial versions" &&
 
-	git checkout -b branch1 master &&
+	git checkout -b branch1 main &&
 	git submodule update -N &&
 	echo branch1 change >file1 &&
 	echo branch1 newfile >file2 &&
@@ -71,39 +71,39 @@ test_expect_success 'setup' '
 	test_write_lines one two 3 >c/c/file.txt &&
 	git commit -a -m"move to c" &&
 
-	git checkout -b stash1 master &&
+	git checkout -b stash1 main &&
 	echo stash1 change file11 >file11 &&
 	git add file11 &&
 	git commit -m "stash1 changes" &&
 
-	git checkout -b stash2 master &&
+	git checkout -b stash2 main &&
 	echo stash2 change file11 >file11 &&
 	git add file11 &&
 	git commit -m "stash2 changes" &&
 
-	git checkout master &&
+	git checkout main &&
 	git submodule update -N &&
-	echo master updated >file1 &&
-	echo master new >file2 &&
-	echo master updated spaced >"spaced name" &&
-	echo master both added >both &&
-	echo master updated file12 >file12 &&
-	echo master updated file14 >file14 &&
-	echo master new sub >subdir/file3 &&
+	echo main updated >file1 &&
+	echo main new >file2 &&
+	echo main updated spaced >"spaced name" &&
+	echo main both added >both &&
+	echo main updated file12 >file12 &&
+	echo main updated file14 >file14 &&
+	echo main new sub >subdir/file3 &&
 	(
 		cd submod &&
-		echo master submodule >bar &&
+		echo main submodule >bar &&
 		git add bar &&
-		git commit -m "Add bar on master" &&
-		git checkout -b submod-master
+		git commit -m "Add bar on main" &&
+		git checkout -b submod-main
 	) &&
 	git add file1 "spaced name" file12 file14 file2 subdir/file3 submod &&
 	git add both &&
 	git rm file11 &&
-	git commit -m "master updates" &&
+	git commit -m "main updates" &&
 
 	git clean -fdx &&
-	git checkout -b order-file-start master &&
+	git checkout -b order-file-start main &&
 	echo start >a &&
 	echo start >b &&
 	git add a b &&
@@ -130,7 +130,7 @@ test_expect_success 'custom mergetool' '
 	test_when_finished "git reset --hard" &&
 	git checkout -b test$test_count branch1 &&
 	git submodule update -N &&
-	test_must_fail git merge master &&
+	test_must_fail git merge main &&
 	yes "" | git mergetool both &&
 	yes "" | git mergetool file1 file1 &&
 	yes "" | git mergetool file2 "spaced name" &&
@@ -138,11 +138,11 @@ test_expect_success 'custom mergetool' '
 	yes "d" | git mergetool file11 &&
 	yes "d" | git mergetool file12 &&
 	yes "l" | git mergetool submod &&
-	echo "master updated" >expect &&
+	echo "main updated" >expect &&
 	test_cmp expect file1 &&
-	echo "master new" >expect &&
+	echo "main new" >expect &&
 	test_cmp expect file2 &&
-	echo "master new sub" >expect &&
+	echo "main new sub" >expect &&
 	test_cmp expect subdir/file3 &&
 	echo "branch1 submodule" >expect &&
 	test_cmp expect submod/bar &&
@@ -156,7 +156,7 @@ test_expect_success 'gui mergetool' '
 	test_when_finished "git reset --hard" &&
 	git checkout -b test$test_count branch1 &&
 	git submodule update -N &&
-	test_must_fail git merge master &&
+	test_must_fail git merge main &&
 	yes "" | git mergetool --gui both &&
 	yes "" | git mergetool -g file1 file1 &&
 	yes "" | git mergetool --gui file2 "spaced name" &&
@@ -164,11 +164,11 @@ test_expect_success 'gui mergetool' '
 	yes "d" | git mergetool --gui file11 &&
 	yes "d" | git mergetool --gui file12 &&
 	yes "l" | git mergetool --gui submod &&
-	echo "gui master updated" >expect &&
+	echo "gui main updated" >expect &&
 	test_cmp expect file1 &&
-	echo "gui master new" >expect &&
+	echo "gui main new" >expect &&
 	test_cmp expect file2 &&
-	echo "gui master new sub" >expect &&
+	echo "gui main new sub" >expect &&
 	test_cmp expect subdir/file3 &&
 	echo "branch1 submodule" >expect &&
 	test_cmp expect submod/bar &&
@@ -179,7 +179,7 @@ test_expect_success 'gui mergetool without merge.guitool set falls back to merge
 	test_when_finished "git reset --hard" &&
 	git checkout -b test$test_count branch1 &&
 	git submodule update -N &&
-	test_must_fail git merge master &&
+	test_must_fail git merge main &&
 	yes "" | git mergetool --gui both &&
 	yes "" | git mergetool -g file1 file1 &&
 	yes "" | git mergetool --gui file2 "spaced name" &&
@@ -187,11 +187,11 @@ test_expect_success 'gui mergetool without merge.guitool set falls back to merge
 	yes "d" | git mergetool --gui file11 &&
 	yes "d" | git mergetool --gui file12 &&
 	yes "l" | git mergetool --gui submod &&
-	echo "master updated" >expect &&
+	echo "main updated" >expect &&
 	test_cmp expect file1 &&
-	echo "master new" >expect &&
+	echo "main new" >expect &&
 	test_cmp expect file2 &&
-	echo "master new sub" >expect &&
+	echo "main new sub" >expect &&
 	test_cmp expect subdir/file3 &&
 	echo "branch1 submodule" >expect &&
 	test_cmp expect submod/bar &&
@@ -206,7 +206,7 @@ test_expect_success 'mergetool crlf' '
 	# test_when_finished is LIFO.)
 	test_config core.autocrlf true &&
 	git checkout -b test$test_count branch1 &&
-	test_must_fail git merge master &&
+	test_must_fail git merge main &&
 	yes "" | git mergetool file1 &&
 	yes "" | git mergetool file2 &&
 	yes "" | git mergetool "spaced name" &&
@@ -215,11 +215,11 @@ test_expect_success 'mergetool crlf' '
 	yes "d" | git mergetool file11 &&
 	yes "d" | git mergetool file12 &&
 	yes "r" | git mergetool submod &&
-	test "$(printf x | cat file1 -)" = "$(printf "master updated\r\nx")" &&
-	test "$(printf x | cat file2 -)" = "$(printf "master new\r\nx")" &&
-	test "$(printf x | cat subdir/file3 -)" = "$(printf "master new sub\r\nx")" &&
+	test "$(printf x | cat file1 -)" = "$(printf "main updated\r\nx")" &&
+	test "$(printf x | cat file2 -)" = "$(printf "main new\r\nx")" &&
+	test "$(printf x | cat subdir/file3 -)" = "$(printf "main new sub\r\nx")" &&
 	git submodule update -N &&
-	echo "master submodule" >expect &&
+	echo "main submodule" >expect &&
 	test_cmp expect submod/bar &&
 	git commit -m "branch1 resolved with mergetool - autocrlf"
 '
@@ -230,9 +230,9 @@ test_expect_success 'mergetool in subdir' '
 	git submodule update -N &&
 	(
 		cd subdir &&
-		test_must_fail git merge master &&
+		test_must_fail git merge main &&
 		yes "" | git mergetool file3 &&
-		echo "master new sub" >expect &&
+		echo "main new sub" >expect &&
 		test_cmp expect file3
 	)
 '
@@ -243,7 +243,7 @@ test_expect_success 'mergetool on file in parent dir' '
 	git submodule update -N &&
 	(
 		cd subdir &&
-		test_must_fail git merge master &&
+		test_must_fail git merge main &&
 		yes "" | git mergetool file3 &&
 		yes "" | git mergetool ../file1 &&
 		yes "" | git mergetool ../file2 ../spaced\ name &&
@@ -251,9 +251,9 @@ test_expect_success 'mergetool on file in parent dir' '
 		yes "d" | git mergetool ../file11 &&
 		yes "d" | git mergetool ../file12 &&
 		yes "l" | git mergetool ../submod &&
-		echo "master updated" >expect &&
+		echo "main updated" >expect &&
 		test_cmp expect ../file1 &&
-		echo "master new" >expect &&
+		echo "main new" >expect &&
 		test_cmp expect ../file2 &&
 		echo "branch1 submodule" >expect &&
 		test_cmp expect ../submod/bar &&
@@ -265,7 +265,7 @@ test_expect_success 'mergetool skips autoresolved' '
 	test_when_finished "git reset --hard" &&
 	git checkout -b test$test_count branch1 &&
 	git submodule update -N &&
-	test_must_fail git merge master &&
+	test_must_fail git merge main &&
 	test -n "$(git ls-files -u)" &&
 	yes "d" | git mergetool file11 &&
 	yes "d" | git mergetool file12 &&
@@ -280,17 +280,17 @@ test_expect_success 'mergetool merges all from subdir (rerere disabled)' '
 	test_config rerere.enabled false &&
 	(
 		cd subdir &&
-		test_must_fail git merge master &&
+		test_must_fail git merge main &&
 		yes "r" | git mergetool ../submod &&
 		yes "d" "d" | git mergetool --no-prompt &&
-		echo "master updated" >expect &&
+		echo "main updated" >expect &&
 		test_cmp expect ../file1 &&
-		echo "master new" >expect &&
+		echo "main new" >expect &&
 		test_cmp expect ../file2 &&
-		echo "master new sub" >expect &&
+		echo "main new sub" >expect &&
 		test_cmp expect file3 &&
 		( cd .. && git submodule update -N ) &&
-		echo "master submodule" >expect &&
+		echo "main submodule" >expect &&
 		test_cmp expect ../submod/bar &&
 		git commit -m "branch2 resolved by mergetool from subdir"
 	)
@@ -303,17 +303,17 @@ test_expect_success 'mergetool merges all from subdir (rerere enabled)' '
 	rm -rf .git/rr-cache &&
 	(
 		cd subdir &&
-		test_must_fail git merge master &&
+		test_must_fail git merge main &&
 		yes "r" | git mergetool ../submod &&
 		yes "d" "d" | git mergetool --no-prompt &&
-		echo "master updated" >expect &&
+		echo "main updated" >expect &&
 		test_cmp expect ../file1 &&
-		echo "master new" >expect &&
+		echo "main new" >expect &&
 		test_cmp expect ../file2 &&
-		echo "master new sub" >expect &&
+		echo "main new sub" >expect &&
 		test_cmp expect file3 &&
 		( cd .. && git submodule update -N ) &&
-		echo "master submodule" >expect &&
+		echo "main submodule" >expect &&
 		test_cmp expect ../submod/bar &&
 		git commit -m "branch2 resolved by mergetool from subdir"
 	)
@@ -325,7 +325,7 @@ test_expect_success 'mergetool skips resolved paths when rerere is active' '
 	rm -rf .git/rr-cache &&
 	git checkout -b test$test_count branch1 &&
 	git submodule update -N &&
-	test_must_fail git merge master &&
+	test_must_fail git merge main &&
 	yes "l" | git mergetool --no-prompt submod &&
 	yes "d" "d" | git mergetool --no-prompt &&
 	git submodule update -N &&
@@ -366,11 +366,11 @@ test_expect_success 'mergetool takes partial path' '
 	test_config rerere.enabled false &&
 	git checkout -b test$test_count branch1 &&
 	git submodule update -N &&
-	test_must_fail git merge master &&
+	test_must_fail git merge main &&
 
 	yes "" | git mergetool subdir &&
 
-	echo "master new sub" >expect &&
+	echo "main new sub" >expect &&
 	test_cmp expect subdir/file3
 '
 
@@ -434,7 +434,7 @@ test_expect_success 'deleted vs modified submodule' '
 	git rm --cached submod &&
 	git commit -m "Submodule deleted from branch" &&
 	git checkout -b test$test_count.a test$test_count &&
-	test_must_fail git merge master &&
+	test_must_fail git merge main &&
 	test -n "$(git ls-files -u)" &&
 	yes "" | git mergetool file1 file2 spaced\ name subdir/file3 &&
 	yes "" | git mergetool both &&
@@ -444,7 +444,7 @@ test_expect_success 'deleted vs modified submodule' '
 	echo "branch1 submodule" >expect &&
 	test_cmp expect submod/bar &&
 	git submodule update -N &&
-	echo "master submodule" >expect &&
+	echo "main submodule" >expect &&
 	test_cmp expect submod/bar &&
 	output="$(git mergetool --no-prompt)" &&
 	test "$output" = "No files need merging" &&
@@ -453,7 +453,7 @@ test_expect_success 'deleted vs modified submodule' '
 	mv submod submod-movedaside &&
 	git checkout -b test$test_count.b test$test_count &&
 	git submodule update -N &&
-	test_must_fail git merge master &&
+	test_must_fail git merge main &&
 	test -n "$(git ls-files -u)" &&
 	yes "" | git mergetool file1 file2 spaced\ name subdir/file3 &&
 	yes "" | git mergetool both &&
@@ -465,7 +465,7 @@ test_expect_success 'deleted vs modified submodule' '
 	git commit -m "Merge resolved by deleting module" &&
 
 	mv submod-movedaside submod &&
-	git checkout -b test$test_count.c master &&
+	git checkout -b test$test_count.c main &&
 	git submodule update -N &&
 	test_must_fail git merge test$test_count &&
 	test -n "$(git ls-files -u)" &&
@@ -481,7 +481,7 @@ test_expect_success 'deleted vs modified submodule' '
 	git commit -m "Merge resolved by deleting module" &&
 	mv submod.orig submod &&
 
-	git checkout -b test$test_count.d master &&
+	git checkout -b test$test_count.d main &&
 	git submodule update -N &&
 	test_must_fail git merge test$test_count &&
 	test -n "$(git ls-files -u)" &&
@@ -489,10 +489,10 @@ test_expect_success 'deleted vs modified submodule' '
 	yes "" | git mergetool both &&
 	yes "d" | git mergetool file11 file12 &&
 	yes "l" | git mergetool submod &&
-	echo "master submodule" >expect &&
+	echo "main submodule" >expect &&
 	test_cmp expect submod/bar &&
 	git submodule update -N &&
-	echo "master submodule" >expect &&
+	echo "main submodule" >expect &&
 	test_cmp expect submod/bar &&
 	output="$(git mergetool --no-prompt)" &&
 	test "$output" = "No files need merging" &&
@@ -509,7 +509,7 @@ test_expect_success 'file vs modified submodule' '
 	git add submod &&
 	git commit -m "Submodule path becomes file" &&
 	git checkout -b test$test_count.a branch1 &&
-	test_must_fail git merge master &&
+	test_must_fail git merge main &&
 	test -n "$(git ls-files -u)" &&
 	yes "" | git mergetool file1 file2 spaced\ name subdir/file3 &&
 	yes "" | git mergetool both &&
@@ -519,7 +519,7 @@ test_expect_success 'file vs modified submodule' '
 	echo "branch1 submodule" >expect &&
 	test_cmp expect submod/bar &&
 	git submodule update -N &&
-	echo "master submodule" >expect &&
+	echo "main submodule" >expect &&
 	test_cmp expect submod/bar &&
 	output="$(git mergetool --no-prompt)" &&
 	test "$output" = "No files need merging" &&
@@ -527,7 +527,7 @@ test_expect_success 'file vs modified submodule' '
 
 	mv submod submod-movedaside &&
 	git checkout -b test$test_count.b test$test_count &&
-	test_must_fail git merge master &&
+	test_must_fail git merge main &&
 	test -n "$(git ls-files -u)" &&
 	yes "" | git mergetool file1 file2 spaced\ name subdir/file3 &&
 	yes "" | git mergetool both &&
@@ -547,7 +547,7 @@ test_expect_success 'file vs modified submodule' '
 	test "$output" = "No files need merging" &&
 	git commit -m "Merge resolved by keeping file" &&
 
-	git checkout -b test$test_count.c master &&
+	git checkout -b test$test_count.c main &&
 	rmdir submod && mv submod-movedaside submod &&
 	test ! -e submod.orig &&
 	git submodule update -N &&
@@ -573,7 +573,7 @@ test_expect_success 'file vs modified submodule' '
 	test "$output" = "No files need merging" &&
 	git commit -m "Merge resolved by keeping file" &&
 
-	git checkout -b test$test_count.d master &&
+	git checkout -b test$test_count.d main &&
 	rmdir submod && mv submod.orig submod &&
 	git submodule update -N &&
 	test_must_fail git merge test$test_count &&
@@ -586,10 +586,10 @@ test_expect_success 'file vs modified submodule' '
 	then
 		yes "d" | git mergetool submod~test19
 	fi &&
-	echo "master submodule" >expect &&
+	echo "main submodule" >expect &&
 	test_cmp expect submod/bar &&
 	git submodule update -N &&
-	echo "master submodule" >expect &&
+	echo "main submodule" >expect &&
 	test_cmp expect submod/bar &&
 	output="$(git mergetool --no-prompt)" &&
 	test "$output" = "No files need merging" &&
@@ -672,7 +672,7 @@ test_expect_success 'directory vs modified submodule' '
 	git add submod/file16 &&
 	git commit -m "Submodule path becomes directory" &&
 
-	test_must_fail git merge master &&
+	test_must_fail git merge main &&
 	test -n "$(git ls-files -u)" &&
 	yes "l" | git mergetool submod &&
 	echo "not a submodule" >expect &&
@@ -680,14 +680,14 @@ test_expect_success 'directory vs modified submodule' '
 	rm -rf submod.orig &&
 
 	git reset --hard &&
-	test_must_fail git merge master &&
+	test_must_fail git merge main &&
 	test -n "$(git ls-files -u)" &&
 	test ! -e submod.orig &&
 	if test "$GIT_TEST_MERGE_ALGORITHM" = ort
 	then
-		yes "r" | git mergetool submod~master &&
+		yes "r" | git mergetool submod~main &&
 		git mv submod submod.orig &&
-		git mv submod~master submod
+		git mv submod~main submod
 	else
 		yes "r" | git mergetool submod
 	fi &&
@@ -698,18 +698,18 @@ test_expect_success 'directory vs modified submodule' '
 	mv submod-movedaside/.git submod &&
 	( cd submod && git clean -f && git reset --hard ) &&
 	git submodule update -N &&
-	echo "master submodule" >expect &&
+	echo "main submodule" >expect &&
 	test_cmp expect submod/bar &&
 	git reset --hard &&
 	rm -rf submod-movedaside &&
 
-	git checkout -b test$test_count.c master &&
+	git checkout -b test$test_count.c main &&
 	git submodule update -N &&
 	test_must_fail git merge test$test_count &&
 	test -n "$(git ls-files -u)" &&
 	yes "l" | git mergetool submod &&
 	git submodule update -N &&
-	echo "master submodule" >expect &&
+	echo "main submodule" >expect &&
 	test_cmp expect submod/bar &&
 
 	git reset --hard &&
@@ -721,7 +721,7 @@ test_expect_success 'directory vs modified submodule' '
 	echo "not a submodule" >expect &&
 	test_cmp expect submod/file16 &&
 
-	git reset --hard master &&
+	git reset --hard main &&
 	( cd submod && git clean -f && git reset --hard ) &&
 	git submodule update -N
 '
@@ -729,7 +729,7 @@ test_expect_success 'directory vs modified submodule' '
 test_expect_success 'file with no base' '
 	test_when_finished "git reset --hard" &&
 	git checkout -b test$test_count branch1 &&
-	test_must_fail git merge master &&
+	test_must_fail git merge main &&
 	git mergetool --no-prompt --tool mybase -- both &&
 	test_must_be_empty both
 '
@@ -739,9 +739,9 @@ test_expect_success 'custom commands override built-ins' '
 	git checkout -b test$test_count branch1 &&
 	test_config mergetool.defaults.cmd "cat \"\$REMOTE\" >\"\$MERGED\"" &&
 	test_config mergetool.defaults.trustExitCode true &&
-	test_must_fail git merge master &&
+	test_must_fail git merge main &&
 	git mergetool --no-prompt --tool defaults -- both &&
-	echo master both added >expected &&
+	echo main both added >expected &&
 	test_cmp expected both
 '
 
@@ -751,7 +751,7 @@ test_expect_success 'filenames seen by tools start with ./' '
 	test_config mergetool.writeToTemp false &&
 	test_config mergetool.myecho.cmd "echo \"\$LOCAL\"" &&
 	test_config mergetool.myecho.trustExitCode true &&
-	test_must_fail git merge master &&
+	test_must_fail git merge main &&
 	git mergetool --no-prompt --tool myecho -- both >actual &&
 	grep ^\./both_LOCAL_ actual
 '
@@ -768,7 +768,7 @@ test_expect_success MKTEMP 'temporary filenames are used with mergetool.writeToT
 	test_config mergetool.writeToTemp true &&
 	test_config mergetool.myecho.cmd "echo \"\$LOCAL\"" &&
 	test_config mergetool.myecho.trustExitCode true &&
-	test_must_fail git merge master &&
+	test_must_fail git merge main &&
 	git mergetool --no-prompt --tool myecho -- both >actual &&
 	! grep ^\./both_LOCAL_ actual &&
 	grep /both_LOCAL_ actual
diff --git a/t/t7611-merge-abort.sh b/t/t7611-merge-abort.sh
index 7c84a518aa..8e95182566 100755
--- a/t/t7611-merge-abort.sh
+++ b/t/t7611-merge-abort.sh
@@ -7,7 +7,7 @@ Set up repo with conflicting and non-conflicting branches:
 There are three files foo/bar/baz, and the following graph illustrates the
 content of these files in each commit:
 
-# foo/bar/baz --- foo/bar/bazz     <-- master
+# foo/bar/baz --- foo/bar/bazz     <-- main
 #             \
 #              --- foo/barf/bazf   <-- conflict_branch
 #               \
@@ -40,7 +40,7 @@ test_expect_success 'setup' '
 	git checkout -b clean_branch HEAD^ &&
 	echo bart > bar &&
 	git commit -a -m "clean" &&
-	git checkout master
+	git checkout main
 '
 
 pre_merge_head="$(git rev-parse HEAD)"
diff --git a/t/t7612-merge-verify-signatures.sh b/t/t7612-merge-verify-signatures.sh
index a426f3a89a..6c52b6ac1e 100755
--- a/t/t7612-merge-verify-signatures.sh
+++ b/t/t7612-merge-verify-signatures.sh
@@ -31,7 +31,7 @@ test_expect_success GPG 'create signed commits' '
 	echo 3 >baz && git add baz &&
 	test_tick && git commit -SB7227189 -m "untrusted on side" &&
 
-	git checkout master
+	git checkout main
 '
 
 test_expect_success GPG 'merge unsigned commit with verification' '
diff --git a/t/t7614-merge-signoff.sh b/t/t7614-merge-signoff.sh
index c1b8446f49..1e901224cd 100755
--- a/t/t7614-merge-signoff.sh
+++ b/t/t7614-merge-signoff.sh
@@ -11,17 +11,17 @@ This test runs git merge --signoff and makes sure that it works.
 test_setup() {
 	# Expected commit message after merge --signoff
 	cat >expected-signed <<EOF &&
-Merge branch 'master' into other-branch
+Merge branch 'main' into other-branch
 
 Signed-off-by: $(git var GIT_COMMITTER_IDENT | sed -e "s/>.*/>/")
 EOF
 
 	# Expected commit message after merge without --signoff (or with --no-signoff)
 	cat >expected-unsigned <<EOF &&
-Merge branch 'master' into other-branch
+Merge branch 'main' into other-branch
 EOF
 
-	# Initial commit and feature branch to merge master into it.
+	# Initial commit and feature branch to merge main into it.
 	git commit --allow-empty -m "Initial empty commit" &&
 	git checkout -b other-branch &&
 	test_commit other-branch file1 1
@@ -38,30 +38,30 @@ test_expect_success 'setup' '
 
 # Test with --signoff flag
 test_expect_success 'git merge --signoff adds a sign-off line' '
-	git checkout master &&
-	test_commit master-branch-2 file2 2 &&
+	git checkout main &&
+	test_commit main-branch-2 file2 2 &&
 	git checkout other-branch &&
-	git merge master --signoff --no-edit &&
+	git merge main --signoff --no-edit &&
 	git cat-file commit HEAD | sed -e "1,/^\$/d" >actual &&
 	test_cmp expected-signed actual
 '
 
 # Test without --signoff flag
 test_expect_success 'git merge does not add a sign-off line' '
-	git checkout master &&
-	test_commit master-branch-3 file3 3 &&
+	git checkout main &&
+	test_commit main-branch-3 file3 3 &&
 	git checkout other-branch &&
-	git merge master --no-edit &&
+	git merge main --no-edit &&
 	git cat-file commit HEAD | sed -e "1,/^\$/d" >actual &&
 	test_cmp expected-unsigned actual
 '
 
 # Test for --no-signoff flag
 test_expect_success 'git merge --no-signoff flag cancels --signoff flag' '
-	git checkout master &&
-	test_commit master-branch-4 file4 4 &&
+	git checkout main &&
+	test_commit main-branch-4 file4 4 &&
 	git checkout other-branch &&
-	git merge master --no-edit --signoff --no-signoff &&
+	git merge main --no-edit --signoff --no-signoff &&
 	git cat-file commit HEAD | sed -e "1,/^\$/d" >actual &&
 	test_cmp expected-unsigned actual
 '
diff --git a/t/t7701-repack-unpack-unreachable.sh b/t/t7701-repack-unpack-unreachable.sh
index 48261ba080..852c81d13e 100755
--- a/t/t7701-repack-unpack-unreachable.sh
+++ b/t/t7701-repack-unpack-unreachable.sh
@@ -22,7 +22,7 @@ test_expect_success '-A with -d option leaves unreachable objects unpacked' '
 	git commit -a -m more_content &&
 	csha1=$(git rev-parse HEAD^{commit}) &&
 	tsha1=$(git rev-parse HEAD^{tree}) &&
-	git checkout master &&
+	git checkout main &&
 	echo even more content >> file1 &&
 	test_tick &&
 	git commit -a -m even_more_content &&
diff --git a/t/t7800-difftool.sh b/t/t7800-difftool.sh
index a578b35761..31e719e361 100755
--- a/t/t7800-difftool.sh
+++ b/t/t7800-difftool.sh
@@ -35,23 +35,23 @@ test_expect_success 'basic usage requires no repo' '
 	test_i18ngrep ^usage: output
 '
 
-# Create a file on master and change it on branch
+# Create a file on main and change it on branch
 test_expect_success 'setup' '
-	echo master >file &&
+	echo main >file &&
 	git add file &&
 	git commit -m "added file" &&
 
-	git checkout -b branch master &&
+	git checkout -b branch main &&
 	echo branch >file &&
 	git commit -a -m "branch changed file" &&
-	git checkout master
+	git checkout main
 '
 
 # Configure a custom difftool.<tool>.cmd and use it
 test_expect_success 'custom commands' '
 	difftool_test_setup &&
 	test_config difftool.test-tool.cmd "cat \"\$REMOTE\"" &&
-	echo master >expect &&
+	echo main >expect &&
 	git difftool --no-prompt branch >actual &&
 	test_cmp expect actual &&
 
@@ -63,7 +63,7 @@ test_expect_success 'custom commands' '
 
 test_expect_success 'custom tool commands override built-ins' '
 	test_config difftool.vimdiff.cmd "cat \"\$REMOTE\"" &&
-	echo master >expect &&
+	echo main >expect &&
 	git difftool --tool vimdiff --no-prompt branch >actual &&
 	test_cmp expect actual
 '
@@ -311,21 +311,21 @@ test_expect_success 'difftool.<tool>.path' '
 
 test_expect_success 'difftool --extcmd=cat' '
 	echo branch >expect &&
-	echo master >>expect &&
+	echo main >>expect &&
 	git difftool --no-prompt --extcmd=cat branch >actual &&
 	test_cmp expect actual
 '
 
 test_expect_success 'difftool --extcmd cat' '
 	echo branch >expect &&
-	echo master >>expect &&
+	echo main >>expect &&
 	git difftool --no-prompt --extcmd=cat branch >actual &&
 	test_cmp expect actual
 '
 
 test_expect_success 'difftool -x cat' '
 	echo branch >expect &&
-	echo master >>expect &&
+	echo main >>expect &&
 	git difftool --no-prompt -x cat branch >actual &&
 	test_cmp expect actual
 '
@@ -338,7 +338,7 @@ test_expect_success 'difftool --extcmd echo arg1' '
 '
 
 test_expect_success 'difftool --extcmd cat arg1' '
-	echo master >expect &&
+	echo main >expect &&
 	git difftool --no-prompt \
 		--extcmd sh\ -c\ \"cat\ \$1\" branch >actual &&
 	test_cmp expect actual
@@ -351,7 +351,7 @@ test_expect_success 'difftool --extcmd cat arg2' '
 	test_cmp expect actual
 '
 
-# Create a second file on master and a different version on branch
+# Create a second file on main and a different version on branch
 test_expect_success 'setup with 2 files different' '
 	echo m2 >file2 &&
 	git add file2 &&
@@ -361,7 +361,7 @@ test_expect_success 'setup with 2 files different' '
 	echo br2 >file2 &&
 	git add file2 &&
 	git commit -a -m "branch changed file2" &&
-	git checkout master
+	git checkout main
 '
 
 test_expect_success 'say no to the first file' '
@@ -369,14 +369,14 @@ test_expect_success 'say no to the first file' '
 	git difftool -x cat branch <input >output &&
 	grep m2 output &&
 	grep br2 output &&
-	! grep master output &&
+	! grep main output &&
 	! grep branch output
 '
 
 test_expect_success 'say no to the second file' '
 	(echo && echo n) >input &&
 	git difftool -x cat branch <input >output &&
-	grep master output &&
+	grep main output &&
 	grep branch output &&
 	! grep m2 output &&
 	! grep br2 output
@@ -384,7 +384,7 @@ test_expect_success 'say no to the second file' '
 
 test_expect_success 'ending prompt input with EOF' '
 	git difftool -x cat branch </dev/null >output &&
-	! grep master output &&
+	! grep main output &&
 	! grep branch output &&
 	! grep m2 output &&
 	! grep br2 output
@@ -396,9 +396,9 @@ test_expect_success 'difftool --tool-help' '
 '
 
 test_expect_success 'setup change in subdirectory' '
-	git checkout master &&
+	git checkout main &&
 	mkdir sub &&
-	echo master >sub/sub &&
+	echo main >sub/sub &&
 	git add sub/sub &&
 	git commit -m "added sub/sub" &&
 	git tag v1 &&
@@ -526,7 +526,7 @@ run_dir_diff_test 'difftool --dir-diff from subdirectory with GIT_DIR set' '
 run_dir_diff_test 'difftool --dir-diff when worktree file is missing' '
 	test_when_finished git reset --hard &&
 	rm file2 &&
-	git difftool --dir-diff $symlinks --extcmd ls branch master >output &&
+	git difftool --dir-diff $symlinks --extcmd ls branch main >output &&
 	grep file2 output
 '
 
@@ -543,7 +543,7 @@ run_dir_diff_test 'difftool --dir-diff with unmerged files' '
 	echo b >>file &&
 	git add file &&
 	git commit -m conflict-b &&
-	git checkout master &&
+	git checkout main &&
 	git merge conflict-a &&
 	test_must_fail git merge conflict-b &&
 	cat >expect <<-EOF &&
diff --git a/t/t7810-grep.sh b/t/t7810-grep.sh
index 991d5bd9c0..bee57a4e08 100755
--- a/t/t7810-grep.sh
+++ b/t/t7810-grep.sh
@@ -1206,19 +1206,19 @@ test_expect_success 'grep -e -- -- path' '
 '
 
 test_expect_success 'dashdash disambiguates rev as rev' '
-	test_when_finished "rm -f master" &&
-	echo content >master &&
-	echo master:hello.c >expect &&
-	git grep -l o master -- hello.c >actual &&
+	test_when_finished "rm -f main" &&
+	echo content >main &&
+	echo main:hello.c >expect &&
+	git grep -l o main -- hello.c >actual &&
 	test_cmp expect actual
 '
 
 test_expect_success 'dashdash disambiguates pathspec as pathspec' '
-	test_when_finished "git rm -f master" &&
-	echo content >master &&
-	git add master &&
-	echo master:content >expect &&
-	git grep o -- master >actual &&
+	test_when_finished "git rm -f main" &&
+	echo content >main &&
+	git add main &&
+	echo main:content >expect &&
+	git grep o -- main >actual &&
 	test_cmp expect actual
 '
 
@@ -1254,15 +1254,15 @@ test_expect_success 'grep --no-index pattern -- path' '
 '
 
 test_expect_success 'grep --no-index complains of revs' '
-	test_must_fail git grep --no-index o master -- 2>err &&
+	test_must_fail git grep --no-index o main -- 2>err &&
 	test_i18ngrep "cannot be used with revs" err
 '
 
 test_expect_success 'grep --no-index prefers paths to revs' '
-	test_when_finished "rm -f master" &&
-	echo content >master &&
-	echo master:content >expect &&
-	git grep --no-index o master >actual &&
+	test_when_finished "rm -f main" &&
+	echo content >main &&
+	echo main:content >expect &&
+	git grep --no-index o main >actual &&
 	test_cmp expect actual
 '
 
diff --git a/t/test-lib.sh b/t/test-lib.sh
index 815d7b21fe..2ef51a4f3f 100644
--- a/t/test-lib.sh
+++ b/t/test-lib.sh
@@ -257,13 +257,13 @@ case "$TRASH_DIRECTORY" in
 esac
 
 case "$TEST_NUMBER" in
-3404|4013|5310|6300|7064)
+3404|4013|5310|6300|7064|7817)
 	# Avoid conflicts with patch series that are cooking at the same time
 	# as the patch series changing the default of `init.defaultBranch`.
 	GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
 	export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 	;;
-[0-6]*|7[0-4]*)
+[0-7]*)
 	GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 	export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 	;;
-- 
gitgitgadget


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH 22/28] t8*: adjust the references to the default branch name "main"
  2020-11-12 22:43 [PATCH 00/28] Use main as default branch name Johannes Schindelin via GitGitGadget
                   ` (20 preceding siblings ...)
  2020-11-12 22:43 ` [PATCH 21/28] t7[5-9]*: " Johannes Schindelin via GitGitGadget
@ 2020-11-12 22:43 ` Johannes Schindelin via GitGitGadget
  2020-11-12 22:43 ` [PATCH 23/28] t9[0-4]*: " Johannes Schindelin via GitGitGadget
                   ` (10 subsequent siblings)
  32 siblings, 0 replies; 163+ messages in thread
From: Johannes Schindelin via GitGitGadget @ 2020-11-12 22:43 UTC (permalink / raw)
  To: git; +Cc: Johannes Schindelin, Johannes Schindelin

From: Johannes Schindelin <johannes.schindelin@gmx.de>

This trick was performed via

	$ (cd t &&
	   sed -i -e 's/master/main/g' -e 's/MASTER/MAIN/g' \
		-e 's/Master/Main/g' -- t8*.sh annotate*.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>
---
 t/annotate-tests.sh             |  8 ++++----
 t/t8001-annotate.sh             |  2 +-
 t/t8003-blame-corner-cases.sh   |  4 ++--
 t/t8004-blame-with-conflicts.sh | 14 +++++++-------
 t/test-lib.sh                   |  2 +-
 5 files changed, 15 insertions(+), 15 deletions(-)

diff --git a/t/annotate-tests.sh b/t/annotate-tests.sh
index 3aee61d2cc..ee5d2d4cf8 100644
--- a/t/annotate-tests.sh
+++ b/t/annotate-tests.sh
@@ -95,7 +95,7 @@ test_expect_success 'blame 2 authors' '
 '
 
 test_expect_success 'setup B1 lines (branch1)' '
-	git checkout -b branch1 master &&
+	git checkout -b branch1 main &&
 	echo "3A slow green fox jumps into the" >>file &&
 	echo "well." >>file &&
 	GIT_AUTHOR_NAME="B1" GIT_AUTHOR_EMAIL="B1@test.git" \
@@ -107,7 +107,7 @@ test_expect_success 'blame 2 authors + 1 branch1 author' '
 '
 
 test_expect_success 'setup B2 lines (branch2)' '
-	git checkout -b branch2 master &&
+	git checkout -b branch2 main &&
 	sed -e "s/2A quick brown/4A quick brown lazy dog/" <file >file.new &&
 	mv file.new file &&
 	GIT_AUTHOR_NAME="B2" GIT_AUTHOR_EMAIL="B2@test.git" \
@@ -131,11 +131,11 @@ test_expect_success 'blame --first-parent blames merge for branch1' '
 '
 
 test_expect_success 'blame ancestor' '
-	check_count -h master A 2 B 2
+	check_count -h main A 2 B 2
 '
 
 test_expect_success 'blame great-ancestor' '
-	check_count -h master^ A 2
+	check_count -h main^ A 2
 '
 
 test_expect_success 'setup evil merge' '
diff --git a/t/t8001-annotate.sh b/t/t8001-annotate.sh
index 72176e42c1..3687fc58d8 100755
--- a/t/t8001-annotate.sh
+++ b/t/t8001-annotate.sh
@@ -7,7 +7,7 @@ PROG='git annotate'
 . "$TEST_DIRECTORY"/annotate-tests.sh
 
 test_expect_success 'annotate old revision' '
-	git annotate file master >actual &&
+	git annotate file main >actual &&
 	awk "{ print \$3; }" <actual >authors &&
 	test 2 = $(grep A <authors | wc -l) &&
 	test 2 = $(grep B <authors | wc -l)
diff --git a/t/t8003-blame-corner-cases.sh b/t/t8003-blame-corner-cases.sh
index ba8013b002..2e499b4511 100755
--- a/t/t8003-blame-corner-cases.sh
+++ b/t/t8003-blame-corner-cases.sh
@@ -161,13 +161,13 @@ test_expect_success 'blame wholesale copy and more in the index' '
 
 test_expect_success 'blame during cherry-pick with file rename conflict' '
 
-	test_when_finished "git reset --hard && git checkout master" &&
+	test_when_finished "git reset --hard && git checkout main" &&
 	git checkout HEAD~3 &&
 	echo MOUSE >> mouse &&
 	git mv mouse rodent &&
 	git add rodent &&
 	GIT_AUTHOR_NAME=Rodent git commit -m "rodent" &&
-	git checkout --detach master &&
+	git checkout --detach main &&
 	(git cherry-pick HEAD@{1} || test $? -eq 1) &&
 	git show HEAD@{1}:rodent > rodent &&
 	git add rodent &&
diff --git a/t/t8004-blame-with-conflicts.sh b/t/t8004-blame-with-conflicts.sh
index 9c353ab222..b6c992ec45 100755
--- a/t/t8004-blame-with-conflicts.sh
+++ b/t/t8004-blame-with-conflicts.sh
@@ -21,16 +21,16 @@ test_expect_success 'setup first case' '
 	git add file2 &&
 	git commit --author "U Gly <ug@localhost>" -m ugly &&
 
-	# Back to master and change something
-	git checkout master &&
+	# Back to main and change something
+	git checkout main &&
 	echo "
 
 bla" >> file1 &&
 	git commit --author "Old Line <ol@localhost>" -a -m file1.b &&
 
-	# Back to foo and merge master
+	# Back to foo and merge main
 	git checkout foo &&
-	if git merge master; then
+	if git merge main; then
 		echo needed conflict here
 		exit 1
 	else
@@ -44,8 +44,8 @@ Even more" > file2 &&
 	git rm file1 &&
 	git commit --author "M Result <mr@localhost>" -a -m merged &&
 
-	# Back to master and change file1 again
-	git checkout master &&
+	# Back to main and change file1 again
+	git checkout main &&
 	sed s/bla/foo/ <file1 >X &&
 	rm file1 &&
 	mv X file1 &&
@@ -53,7 +53,7 @@ Even more" > file2 &&
 
 	# Try to merge into foo again
 	git checkout foo &&
-	if git merge master; then
+	if git merge main; then
 		echo needed conflict here
 		exit 1
 	else
diff --git a/t/test-lib.sh b/t/test-lib.sh
index 2ef51a4f3f..4ddfb9e3ee 100644
--- a/t/test-lib.sh
+++ b/t/test-lib.sh
@@ -263,7 +263,7 @@ case "$TEST_NUMBER" in
 	GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
 	export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 	;;
-[0-7]*)
+[0-8]*)
 	GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 	export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 	;;
-- 
gitgitgadget


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH 23/28] t9[0-4]*: adjust the references to the default branch name "main"
  2020-11-12 22:43 [PATCH 00/28] Use main as default branch name Johannes Schindelin via GitGitGadget
                   ` (21 preceding siblings ...)
  2020-11-12 22:43 ` [PATCH 22/28] t8*: " Johannes Schindelin via GitGitGadget
@ 2020-11-12 22:43 ` Johannes Schindelin via GitGitGadget
  2020-11-12 22:43 ` [PATCH 24/28] t9[5-7]*: " Johannes Schindelin via GitGitGadget
                   ` (9 subsequent siblings)
  32 siblings, 0 replies; 163+ messages in thread
From: Johannes Schindelin via GitGitGadget @ 2020-11-12 22:43 UTC (permalink / raw)
  To: git; +Cc: Johannes Schindelin, Johannes Schindelin

From: Johannes Schindelin <johannes.schindelin@gmx.de>

This trick was performed via

	$ (cd t &&
	   sed -i -e 's/master/main/g' -e 's/MASTER/MAIN/g' \
		-e 's/Master/Main/g' -- t9[0-4]*.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>
---
 t/t9001-send-email.sh                  | 28 ++++-----
 t/t9100-git-svn-basic.sh               |  2 +-
 t/t9145-git-svn-master-branch.sh       |  6 +-
 t/t9151-svn-mergeinfo.sh               |  2 +-
 t/t9155-git-svn-fetch-deleted-tag.sh   |  2 +-
 t/t9156-git-svn-fetch-deleted-tag-2.sh |  6 +-
 t/t9163-git-svn-reset-clears-caches.sh |  2 +-
 t/t9169-git-svn-dcommit-crlf.sh        |  2 +-
 t/t9300-fast-import.sh                 | 82 ++++++++++++------------
 t/t9301-fast-import-notes.sh           | 14 ++---
 t/t9302-fast-import-unpack-limit.sh    | 16 ++---
 t/t9350-fast-export.sh                 | 86 +++++++++++++-------------
 t/t9351-fast-export-anonymize.sh       |  4 +-
 t/t9400-git-cvsserver-server.sh        | 32 +++++-----
 t/t9401-git-cvsserver-crlf.sh          | 16 ++---
 t/t9402-git-cvsserver-refs.sh          |  8 +--
 t/test-lib.sh                          |  2 +-
 17 files changed, 155 insertions(+), 155 deletions(-)

diff --git a/t/t9001-send-email.sh b/t/t9001-send-email.sh
index a08f72596a..579360d2f1 100755
--- a/t/t9001-send-email.sh
+++ b/t/t9001-send-email.sh
@@ -1168,10 +1168,10 @@ test_expect_success $PREREQ '--compose-encoding adds correct MIME for subject' '
 '
 
 test_expect_success $PREREQ 'detects ambiguous reference/file conflict' '
-	echo master >master &&
-	git add master &&
-	git commit -m"add master" &&
-	test_must_fail git send-email --dry-run master 2>errors &&
+	echo main >main &&
+	git add main &&
+	git commit -m"add main" &&
+	test_must_fail git send-email --dry-run main 2>errors &&
 	grep disambiguate errors
 '
 
@@ -1185,7 +1185,7 @@ test_expect_success $PREREQ 'feed two files' '
 		outdir/000?-*.patch 2>errors >out &&
 	grep "^Subject: " out >subjects &&
 	test "z$(sed -n -e 1p subjects)" = "zSubject: [PATCH 1/2] Second." &&
-	test "z$(sed -n -e 2p subjects)" = "zSubject: [PATCH 2/2] add master"
+	test "z$(sed -n -e 2p subjects)" = "zSubject: [PATCH 2/2] add main"
 '
 
 test_expect_success $PREREQ 'in-reply-to but no threading' '
@@ -2037,7 +2037,7 @@ test_expect_success $PREREQ 'setup expected-list' '
 	--cc="Cc2 <cc2@example.com>" \
 	--bcc="bcc1@example.com" \
 	--bcc="bcc2@example.com" \
-	0001-add-master.patch | replace_variable_fields \
+	0001-add-main.patch | replace_variable_fields \
 	>expected-list
 '
 
@@ -2049,7 +2049,7 @@ test_expect_success $PREREQ 'use email list in --cc --to and --bcc' '
 	--to="to3@example.com" \
 	--cc="Cc 1 <cc1@example.com>, Cc2 <cc2@example.com>" \
 	--bcc="bcc1@example.com, bcc2@example.com" \
-	0001-add-master.patch | replace_variable_fields \
+	0001-add-main.patch | replace_variable_fields \
 	>actual-list &&
 	test_cmp expected-list actual-list
 '
@@ -2065,7 +2065,7 @@ test_expect_success $PREREQ 'aliases work with email list' '
 	--to="To 1 <to1@example.com>, to2, to3@example.com" \
 	--cc="cc1, Cc2 <cc2@example.com>" \
 	--bcc="bcc1@example.com, bcc2@example.com" \
-	0001-add-master.patch | replace_variable_fields \
+	0001-add-main.patch | replace_variable_fields \
 	>actual-list &&
 	test_cmp expected-list actual-list
 '
@@ -2089,7 +2089,7 @@ test_expect_success $PREREQ 'leading and trailing whitespaces are removed' '
 	--cc="Cc2 <cc2@example.com>" \
 	--bcc="$BCC1" \
 	--bcc="bcc2@example.com" \
-	0001-add-master.patch | replace_variable_fields \
+	0001-add-main.patch | replace_variable_fields \
 	>actual-list &&
 	test_cmp expected-list actual-list
 '
@@ -2108,8 +2108,8 @@ test_expect_success $PREREQ 'invoke hook' '
 		false
 		;;
 	esac &&
-	test -f 0001-add-master.patch &&
-	grep "add master" "$1"
+	test -f 0001-add-main.patch &&
+	grep "add main" "$1"
 	EOF
 
 	mkdir subdir &&
@@ -2121,10 +2121,10 @@ test_expect_success $PREREQ 'invoke hook' '
 			--from="Example <nobody@example.com>" \
 			--to=nobody@example.com \
 			--smtp-server="$(pwd)/../fake.sendmail" \
-			../0001-add-master.patch &&
+			../0001-add-main.patch &&
 
 		# Verify error message when a patch is rejected by the hook
-		sed -e "s/add master/x/" ../0001-add-master.patch >../another.patch &&
+		sed -e "s/add main/x/" ../0001-add-main.patch >../another.patch &&
 		test_must_fail git send-email \
 			--from="Example <nobody@example.com>" \
 			--to=nobody@example.com \
@@ -2139,7 +2139,7 @@ test_expect_success $PREREQ 'test that send-email works outside a repo' '
 		--from="Example <nobody@example.com>" \
 		--to=nobody@example.com \
 		--smtp-server="$(pwd)/fake.sendmail" \
-		"$(pwd)/0001-add-master.patch"
+		"$(pwd)/0001-add-main.patch"
 '
 
 test_expect_success $PREREQ 'test that sendmail config is rejected' '
diff --git a/t/t9100-git-svn-basic.sh b/t/t9100-git-svn-basic.sh
index e4bb22034e..7dbf4b8fa0 100755
--- a/t/t9100-git-svn-basic.sh
+++ b/t/t9100-git-svn-basic.sh
@@ -275,7 +275,7 @@ test_expect_success 'dcommit $rev does not clobber current branch' '
 	test refs/heads/my-bar = $(git symbolic-ref HEAD) &&
 	git log refs/remotes/bar | grep "change 1" &&
 	! git log refs/remotes/bar | grep "change 2" &&
-	git checkout master &&
+	git checkout main &&
 	git branch -D my-bar
 	'
 
diff --git a/t/t9145-git-svn-master-branch.sh b/t/t9145-git-svn-master-branch.sh
index 3bbf341f6a..c5acce010d 100755
--- a/t/t9145-git-svn-master-branch.sh
+++ b/t/t9145-git-svn-master-branch.sh
@@ -2,7 +2,7 @@
 #
 # Copyright (c) 2009 Eric Wong
 #
-test_description='git svn initial master branch is "trunk" if possible'
+test_description='git svn initial main branch is "trunk" if possible'
 . ./lib-git-svn.sh
 
 test_expect_success 'setup test repository' '
@@ -13,12 +13,12 @@ test_expect_success 'setup test repository' '
 	svn_cmd import -m b/b i "$svnrepo/branches/b"
 '
 
-test_expect_success 'git svn clone --stdlayout sets up trunk as master' '
+test_expect_success 'git svn clone --stdlayout sets up trunk as main' '
 	git svn clone -s "$svnrepo" g &&
 	(
 		cd g &&
 		test x$(git rev-parse --verify refs/remotes/origin/trunk^0) = \
-		     x$(git rev-parse --verify refs/heads/master^0)
+		     x$(git rev-parse --verify refs/heads/main^0)
 	)
 '
 
diff --git a/t/t9151-svn-mergeinfo.sh b/t/t9151-svn-mergeinfo.sh
index 4f6c06ecb2..e2f63823f1 100755
--- a/t/t9151-svn-mergeinfo.sh
+++ b/t/t9151-svn-mergeinfo.sh
@@ -50,7 +50,7 @@ test_expect_success 'merging two branches in one commit is detected correctly' '
 	'
 
 test_expect_failure 'everything got merged in the end' '
-	unmerged=$(git rev-list --all --not master) &&
+	unmerged=$(git rev-list --all --not main) &&
 	[ -z "$unmerged" ]
 	'
 
diff --git a/t/t9155-git-svn-fetch-deleted-tag.sh b/t/t9155-git-svn-fetch-deleted-tag.sh
index 184336f346..891c209238 100755
--- a/t/t9155-git-svn-fetch-deleted-tag.sh
+++ b/t/t9155-git-svn-fetch-deleted-tag.sh
@@ -36,7 +36,7 @@ test_expect_success 'fetch deleted tags from same revision with checksum error'
 	git svn fetch &&
 
 	git diff --exit-code origin/mybranch:trunk/subdir/file origin/tags/mytag:file &&
-	git diff --exit-code master:subdir/file origin/tags/mytag^:file
+	git diff --exit-code main:subdir/file origin/tags/mytag^:file
 '
 
 test_done
diff --git a/t/t9156-git-svn-fetch-deleted-tag-2.sh b/t/t9156-git-svn-fetch-deleted-tag-2.sh
index 7a6e33ba3c..0b91063edb 100755
--- a/t/t9156-git-svn-fetch-deleted-tag-2.sh
+++ b/t/t9156-git-svn-fetch-deleted-tag-2.sh
@@ -36,9 +36,9 @@ test_expect_success 'fetch deleted tags from same revision with no checksum erro
 	cd git_project &&
 	git svn fetch &&
 
-	git diff --exit-code master:subdir3/file origin/tags/mytag:file &&
-	git diff --exit-code master:subdir2/file origin/tags/mytag^:file &&
-	git diff --exit-code master:subdir1/file origin/tags/mytag^^:file
+	git diff --exit-code main:subdir3/file origin/tags/mytag:file &&
+	git diff --exit-code main:subdir2/file origin/tags/mytag^:file &&
+	git diff --exit-code main:subdir1/file origin/tags/mytag^^:file
 '
 
 test_done
diff --git a/t/t9163-git-svn-reset-clears-caches.sh b/t/t9163-git-svn-reset-clears-caches.sh
index d6245cee08..0da856338f 100755
--- a/t/t9163-git-svn-reset-clears-caches.sh
+++ b/t/t9163-git-svn-reset-clears-caches.sh
@@ -59,7 +59,7 @@ test_expect_success 'fetch to merge-base (a)' '
 test_expect_success 'rebase looses SVN merge (m)' '
 	git svn rebase &&
 	git svn fetch &&
-	test 1 = $(git cat-file -p master|grep parent|wc -l)
+	test 1 = $(git cat-file -p main|grep parent|wc -l)
 '
 
 # git svn fetch creates correct history with merge commit
diff --git a/t/t9169-git-svn-dcommit-crlf.sh b/t/t9169-git-svn-dcommit-crlf.sh
index 54b1f61a2a..5016896ae6 100755
--- a/t/t9169-git-svn-dcommit-crlf.sh
+++ b/t/t9169-git-svn-dcommit-crlf.sh
@@ -14,7 +14,7 @@ test_expect_success 'setup commit repository' '
 		p=$(git rev-parse HEAD) &&
 		t=$(git write-tree) &&
 		cmt=$(git commit-tree -p $p $t <cmt) &&
-		git update-ref refs/heads/master $cmt &&
+		git update-ref refs/heads/main $cmt &&
 		git cat-file commit HEAD | tail -n4 >out &&
 		test_cmp cmt out &&
 		git svn dcommit &&
diff --git a/t/t9300-fast-import.sh b/t/t9300-fast-import.sh
index 308c1ef42c..e66f438e64 100755
--- a/t/t9300-fast-import.sh
+++ b/t/t9300-fast-import.sh
@@ -62,7 +62,7 @@ test_expect_success 'A: create pack from stdin' '
 	mark :4
 	data $file4_len
 	$file4_data
-	commit refs/heads/master
+	commit refs/heads/main
 	mark :5
 	committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
 	data <<COMMIT
@@ -117,7 +117,7 @@ test_expect_success 'A: create pack from stdin' '
 
 	INPUT_END
 	git fast-import --export-marks=marks.out <input &&
-	git whatchanged master
+	git whatchanged main
 '
 
 test_expect_success 'A: verify pack' '
@@ -131,7 +131,7 @@ test_expect_success 'A: verify commit' '
 
 	initial
 	EOF
-	git cat-file commit master | sed 1d >actual &&
+	git cat-file commit main | sed 1d >actual &&
 	test_cmp expect actual
 '
 
@@ -141,31 +141,31 @@ test_expect_success 'A: verify tree' '
 	100644 blob file3
 	100755 blob file4
 	EOF
-	git cat-file -p master^{tree} | sed "s/ [0-9a-f]*	/ /" >actual &&
+	git cat-file -p main^{tree} | sed "s/ [0-9a-f]*	/ /" >actual &&
 	test_cmp expect actual
 '
 
 test_expect_success 'A: verify file2' '
 	echo "$file2_data" >expect &&
-	git cat-file blob master:file2 >actual &&
+	git cat-file blob main:file2 >actual &&
 	test_cmp expect actual
 '
 
 test_expect_success 'A: verify file3' '
 	echo "$file3_data" >expect &&
-	git cat-file blob master:file3 >actual &&
+	git cat-file blob main:file3 >actual &&
 	test_cmp expect actual
 '
 
 test_expect_success 'A: verify file4' '
 	printf "$file4_data" >expect &&
-	git cat-file blob master:file4 >actual &&
+	git cat-file blob main:file4 >actual &&
 	test_cmp expect actual
 '
 
 test_expect_success 'A: verify tag/series-A' '
 	cat >expect <<-EOF &&
-	object $(git rev-parse refs/heads/master)
+	object $(git rev-parse refs/heads/main)
 	type commit
 	tag series-A
 
@@ -177,7 +177,7 @@ test_expect_success 'A: verify tag/series-A' '
 
 test_expect_success 'A: verify tag/series-A-blob' '
 	cat >expect <<-EOF &&
-	object $(git rev-parse refs/heads/master:file3)
+	object $(git rev-parse refs/heads/main:file3)
 	type blob
 	tag series-A-blob
 
@@ -193,13 +193,13 @@ test_expect_success 'A: verify tag deletion is successful' '
 
 test_expect_success 'A: verify marks output' '
 	cat >expect <<-EOF &&
-	:2 $(git rev-parse --verify master:file2)
-	:3 $(git rev-parse --verify master:file3)
-	:4 $(git rev-parse --verify master:file4)
-	:5 $(git rev-parse --verify master^0)
+	:2 $(git rev-parse --verify main:file2)
+	:3 $(git rev-parse --verify main:file3)
+	:4 $(git rev-parse --verify main:file4)
+	:5 $(git rev-parse --verify main^0)
 	:6 $(git cat-file tag nested | grep object | cut -d" " -f 2)
 	:7 $(git rev-parse --verify nested)
-	:8 $(git rev-parse --verify master^0)
+	:8 $(git rev-parse --verify main^0)
 	EOF
 	test_cmp expect marks.out
 '
@@ -217,7 +217,7 @@ test_expect_success 'A: tag blob by sha1' '
 	new_blob=$(echo testing | git hash-object --stdin) &&
 	cat >input <<-INPUT_END &&
 	tag series-A-blob-2
-	from $(git rev-parse refs/heads/master:file3)
+	from $(git rev-parse refs/heads/main:file3)
 	data <<EOF
 	Tag blob by sha1.
 	EOF
@@ -243,7 +243,7 @@ test_expect_success 'A: tag blob by sha1' '
 	INPUT_END
 
 	cat >expect <<-EOF &&
-	object $(git rev-parse refs/heads/master:file3)
+	object $(git rev-parse refs/heads/main:file3)
 	type blob
 	tag series-A-blob-2
 
@@ -284,13 +284,13 @@ test_expect_success 'A: verify pack' '
 '
 
 test_expect_success 'A: verify diff' '
-	copy=$(git rev-parse --verify master:file2) &&
+	copy=$(git rev-parse --verify main:file2) &&
 	cat >expect <<-EOF &&
 	:000000 100755 $ZERO_OID $copy A	copy-of-file2
 	EOF
-	git diff-tree -M -r master verify--import-marks >actual &&
+	git diff-tree -M -r main verify--import-marks >actual &&
 	compare_diff_raw expect actual &&
-	test $(git rev-parse --verify master:file2) \
+	test $(git rev-parse --verify main:file2) \
 	    = $(git rev-parse --verify verify--import-marks:copy-of-file2)
 '
 
@@ -364,7 +364,7 @@ test_expect_success 'B: fail on invalid blob sha1' '
 	corrupt
 	COMMIT
 
-	from refs/heads/master
+	from refs/heads/main
 	M 755 $(echo $ZERO_OID | sed -e "s/0$/1/") zero1
 
 	INPUT_END
@@ -381,7 +381,7 @@ test_expect_success 'B: accept branch name "TEMP_TAG"' '
 	tag base
 	COMMIT
 
-	from refs/heads/master
+	from refs/heads/main
 
 	INPUT_END
 
@@ -390,7 +390,7 @@ test_expect_success 'B: accept branch name "TEMP_TAG"' '
 		git prune" &&
 	git fast-import <input &&
 	test -f .git/TEMP_TAG &&
-	test $(git rev-parse master) = $(git rev-parse TEMP_TAG^)
+	test $(git rev-parse main) = $(git rev-parse TEMP_TAG^)
 '
 
 test_expect_success 'B: accept empty committer' '
@@ -528,8 +528,8 @@ test_expect_success 'B: fail on invalid committer (5)' '
 
 test_expect_success 'C: incremental import create pack from stdin' '
 	newf=$(echo hi newf | git hash-object -w --stdin) &&
-	oldf=$(git rev-parse --verify master:file2) &&
-	thrf=$(git rev-parse --verify master:file3) &&
+	oldf=$(git rev-parse --verify main:file2) &&
+	thrf=$(git rev-parse --verify main:file3) &&
 	test_tick &&
 	cat >input <<-INPUT_END &&
 	commit refs/heads/branch
@@ -538,7 +538,7 @@ test_expect_success 'C: incremental import create pack from stdin' '
 	second
 	COMMIT
 
-	from refs/heads/master
+	from refs/heads/main
 	M 644 $oldf file2/oldf
 	M 755 $newf file2/newf
 	D file3
@@ -560,7 +560,7 @@ test_expect_success 'C: validate reuse existing blob' '
 
 test_expect_success 'C: verify commit' '
 	cat >expect <<-EOF &&
-	parent $(git rev-parse --verify master^0)
+	parent $(git rev-parse --verify main^0)
 	author $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
 	committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
 
@@ -578,7 +578,7 @@ test_expect_success 'C: validate rename result' '
 	:100644 100644 $oldf $oldf R100	file2	file2/oldf
 	:100644 000000 $thrf $zero D	file3
 	EOF
-	git diff-tree -M -r master branch >actual &&
+	git diff-tree -M -r main branch >actual &&
 	compare_diff_raw expect actual
 '
 
@@ -1698,7 +1698,7 @@ test_expect_success 'P: superproject & submodule mix' '
 	committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
 	data 8
 	initial
-	from refs/heads/master
+	from refs/heads/main
 	M 100644 :3 .gitmodules
 	M 160000 :2 sub
 
@@ -1733,8 +1733,8 @@ test_expect_success 'P: superproject & submodule mix' '
 	(
 		cd sub &&
 		git init &&
-		git fetch --update-head-ok .. refs/heads/sub:refs/heads/master &&
-		git checkout master
+		git fetch --update-head-ok .. refs/heads/sub:refs/heads/main &&
+		git checkout main
 	) &&
 	git submodule init &&
 	git submodule update
@@ -1758,7 +1758,7 @@ test_expect_success 'P: verbatim SHA gitlinks' '
 	committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
 	data 8
 	initial
-	from refs/heads/master
+	from refs/heads/main
 	M 100644 :1 .gitmodules
 	M 160000 $SUBPREV sub
 
@@ -3429,8 +3429,8 @@ mark :1
 data 4
 foo
 
-reset refs/heads/master
-commit refs/heads/master
+reset refs/heads/main
+commit refs/heads/main
 mark :2
 author Full Name <user@company.tld> 1000000000 +0100
 committer Full Name <user@company.tld> 1000000000 +0100
@@ -3444,7 +3444,7 @@ data 8
 foo
 bar
 
-commit refs/heads/master
+commit refs/heads/main
 mark :4
 author Full Name <user@company.tld> 1000000001 +0100
 committer Full Name <user@company.tld> 1000000001 +0100
@@ -3461,8 +3461,8 @@ mark :1
 data 4
 foo
 
-reset refs/heads/master
-commit refs/heads/master
+reset refs/heads/main
+commit refs/heads/main
 mark :2
 author Full Name <user@company.tld> 2000000000 +0100
 committer Full Name <user@company.tld> 2000000000 +0100
@@ -3477,7 +3477,7 @@ data 73
 	path = sub1
 	url = https://void.example.com/main.git
 
-commit refs/heads/master
+commit refs/heads/main
 mark :4
 author Full Name <user@company.tld> 2000000001 +0100
 committer Full Name <user@company.tld> 2000000001 +0100
@@ -3493,7 +3493,7 @@ data 8
 foo
 bar
 
-commit refs/heads/master
+commit refs/heads/main
 mark :6
 author Full Name <user@company.tld> 2000000002 +0100
 committer Full Name <user@company.tld> 2000000002 +0100
@@ -3511,8 +3511,8 @@ Y_INPUT_END
 
 test_expect_success 'Y: setup' '
 	test_oid_cache <<-EOF
-	Ymaster sha1:9afed2f9161ddf416c0a1863b8b0725b00070504
-	Ymaster sha256:c0a1010da1df187b2e287654793df01b464bd6f8e3f17fc1481a7dadf84caee3
+	Ymain sha1:9afed2f9161ddf416c0a1863b8b0725b00070504
+	Ymain sha256:c0a1010da1df187b2e287654793df01b464bd6f8e3f17fc1481a7dadf84caee3
 	EOF
 '
 
@@ -3524,7 +3524,7 @@ test_expect_success 'Y: rewrite submodules' '
 		git -C sub2 fast-import --export-marks=../sub2-marks <../Y-sub-input &&
 		git fast-import --rewrite-submodules-from=sub:../Y-marks \
 			--rewrite-submodules-to=sub:sub2-marks <../Y-main-input &&
-		test "$(git rev-parse master)" = "$(test_oid Ymaster)"
+		test "$(git rev-parse main)" = "$(test_oid Ymain)"
 	)
 '
 
diff --git a/t/t9301-fast-import-notes.sh b/t/t9301-fast-import-notes.sh
index 14c1baa739..ea6efbd387 100755
--- a/t/t9301-fast-import-notes.sh
+++ b/t/t9301-fast-import-notes.sh
@@ -9,7 +9,7 @@ test_description='test git fast-import of notes objects'
 
 test_tick
 cat >input <<INPUT_END
-commit refs/heads/master
+commit refs/heads/main
 committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
 data <<COMMIT
 first commit
@@ -30,7 +30,7 @@ data <<EOF
 file baz/xyzzy in first commit
 EOF
 
-commit refs/heads/master
+commit refs/heads/main
 committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
 data <<COMMIT
 second commit
@@ -46,7 +46,7 @@ data <<EOF
 file baz/xyzzy in second commit
 EOF
 
-commit refs/heads/master
+commit refs/heads/main
 committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
 data <<COMMIT
 third commit
@@ -57,7 +57,7 @@ data <<EOF
 file foo in third commit
 EOF
 
-commit refs/heads/master
+commit refs/heads/main
 committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
 data <<COMMIT
 fourth commit
@@ -70,13 +70,13 @@ EOF
 
 INPUT_END
 
-test_expect_success 'set up master branch' '
+test_expect_success 'set up main branch' '
 
 	git fast-import <input &&
-	git whatchanged master
+	git whatchanged main
 '
 
-commit4=$(git rev-parse refs/heads/master)
+commit4=$(git rev-parse refs/heads/main)
 commit3=$(git rev-parse "$commit4^")
 commit2=$(git rev-parse "$commit4~2")
 commit1=$(git rev-parse "$commit4~3")
diff --git a/t/t9302-fast-import-unpack-limit.sh b/t/t9302-fast-import-unpack-limit.sh
index bb1c39cfcc..f519e4f1bf 100755
--- a/t/t9302-fast-import-unpack-limit.sh
+++ b/t/t9302-fast-import-unpack-limit.sh
@@ -5,7 +5,7 @@ test_description='test git fast-import unpack limit'
 test_expect_success 'create loose objects on import' '
 	test_tick &&
 	cat >input <<-INPUT_END &&
-	commit refs/heads/master
+	commit refs/heads/main
 	committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
 	data <<COMMIT
 	initial
@@ -23,12 +23,12 @@ test_expect_success 'create loose objects on import' '
 test_expect_success 'bigger packs are preserved' '
 	test_tick &&
 	cat >input <<-INPUT_END &&
-	commit refs/heads/master
+	commit refs/heads/main
 	committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
 	data <<COMMIT
 	incremental should create a pack
 	COMMIT
-	from refs/heads/master^0
+	from refs/heads/main^0
 
 	commit refs/heads/branch
 	committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
@@ -48,7 +48,7 @@ test_expect_success 'bigger packs are preserved' '
 test_expect_success 'lookups after checkpoint works' '
 	hello_id=$(echo hello | git hash-object --stdin -t blob) &&
 	id="$GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE" &&
-	before=$(git rev-parse refs/heads/master^0) &&
+	before=$(git rev-parse refs/heads/main^0) &&
 	(
 		cat <<-INPUT_END &&
 		blob
@@ -56,13 +56,13 @@ test_expect_success 'lookups after checkpoint works' '
 		data 6
 		hello
 
-		commit refs/heads/master
+		commit refs/heads/main
 		mark :2
 		committer $id
 		data <<COMMIT
 		checkpoint after this
 		COMMIT
-		from refs/heads/master^0
+		from refs/heads/main^0
 		M 100644 :1 hello
 
 		# pre-checkpoint
@@ -86,10 +86,10 @@ test_expect_success 'lookups after checkpoint works' '
 				n=$(($n + 1))
 			fi &&
 			sleep 1 &&
-			from=$(git rev-parse refs/heads/master^0)
+			from=$(git rev-parse refs/heads/main^0)
 		done &&
 		cat <<-INPUT_END &&
-		commit refs/heads/master
+		commit refs/heads/main
 		committer $id
 		data <<COMMIT
 		make sure from "unpacked sha1 reference" works, too
diff --git a/t/t9350-fast-export.sh b/t/t9350-fast-export.sh
index 1372842559..0715eefd52 100755
--- a/t/t9350-fast-export.sh
+++ b/t/t9350-fast-export.sh
@@ -31,13 +31,13 @@ test_expect_success 'setup' '
 	git commit -m sitzt file2 &&
 	test_tick &&
 	git tag -a -m valentin muss &&
-	git merge -s ours master
+	git merge -s ours main
 
 '
 
 test_expect_success 'fast-export | fast-import' '
 
-	MASTER=$(git rev-parse --verify master) &&
+	MAIN=$(git rev-parse --verify main) &&
 	REIN=$(git rev-parse --verify rein) &&
 	WER=$(git rev-parse --verify wer) &&
 	MUSS=$(git rev-parse --verify muss) &&
@@ -46,7 +46,7 @@ test_expect_success 'fast-export | fast-import' '
 	git fast-export --all >actual &&
 	(cd new &&
 	 git fast-import &&
-	 test $MASTER = $(git rev-parse --verify refs/heads/master) &&
+	 test $MAIN = $(git rev-parse --verify refs/heads/main) &&
 	 test $REIN = $(git rev-parse --verify refs/tags/rein) &&
 	 test $WER = $(git rev-parse --verify refs/heads/wer) &&
 	 test $MUSS = $(git rev-parse --verify refs/tags/muss)) <actual
@@ -80,35 +80,35 @@ test_expect_success 'fast-export --mark-tags ^muss^{commit} muss' '
 	test_cmp expected actual
 '
 
-test_expect_success 'fast-export master~2..master' '
+test_expect_success 'fast-export main~2..main' '
 
-	git fast-export master~2..master >actual &&
-	sed "s/master/partial/" actual |
+	git fast-export main~2..main >actual &&
+	sed "s/main/partial/" actual |
 		(cd new &&
 		 git fast-import &&
-		 test $MASTER != $(git rev-parse --verify refs/heads/partial) &&
-		 git diff --exit-code master partial &&
-		 git diff --exit-code master^ partial^ &&
+		 test $MAIN != $(git rev-parse --verify refs/heads/partial) &&
+		 git diff --exit-code main partial &&
+		 git diff --exit-code main^ partial^ &&
 		 test_must_fail git rev-parse partial~2)
 
 '
 
-test_expect_success 'fast-export --reference-excluded-parents master~2..master' '
+test_expect_success 'fast-export --reference-excluded-parents main~2..main' '
 
-	git fast-export --reference-excluded-parents master~2..master >actual &&
-	grep commit.refs/heads/master actual >commit-count &&
+	git fast-export --reference-excluded-parents main~2..main >actual &&
+	grep commit.refs/heads/main actual >commit-count &&
 	test_line_count = 2 commit-count &&
-	sed "s/master/rewrite/" actual |
+	sed "s/main/rewrite/" actual |
 		(cd new &&
 		 git fast-import &&
-		 test $MASTER = $(git rev-parse --verify refs/heads/rewrite))
+		 test $MAIN = $(git rev-parse --verify refs/heads/rewrite))
 '
 
 test_expect_success 'fast-export --show-original-ids' '
 
-	git fast-export --show-original-ids master >output &&
+	git fast-export --show-original-ids main >output &&
 	grep ^original-oid output| sed -e s/^original-oid.// | sort >actual &&
-	git rev-list --objects master muss >objects-and-names &&
+	git rev-list --objects main muss >objects-and-names &&
 	awk "{print \$1}" objects-and-names | sort >commits-trees-blobs &&
 	comm -23 actual commits-trees-blobs >unfound &&
 	test_must_be_empty unfound
@@ -116,8 +116,8 @@ test_expect_success 'fast-export --show-original-ids' '
 
 test_expect_success 'fast-export --show-original-ids | git fast-import' '
 
-	git fast-export --show-original-ids master muss | git fast-import --quiet &&
-	test $MASTER = $(git rev-parse --verify refs/heads/master) &&
+	git fast-export --show-original-ids main muss | git fast-import --quiet &&
+	test $MAIN = $(git rev-parse --verify refs/heads/main) &&
 	test $MUSS = $(git rev-parse --verify refs/tags/muss)
 '
 
@@ -200,7 +200,7 @@ test_expect_success 'encoding preserved if reencoding fails' '
 
 test_expect_success 'import/export-marks' '
 
-	git checkout -b marks master &&
+	git checkout -b marks main &&
 	git fast-export --export-marks=tmp-marks HEAD &&
 	test -s tmp-marks &&
 	test_line_count = 3 tmp-marks &&
@@ -265,7 +265,7 @@ test_expect_success 'signed-tags=warn-strip' '
 
 test_expect_success 'setup submodule' '
 
-	git checkout -f master &&
+	git checkout -f main &&
 	mkdir sub &&
 	(
 		cd sub &&
@@ -290,17 +290,17 @@ test_expect_success 'setup submodule' '
 
 test_expect_success 'submodule fast-export | fast-import' '
 
-	SUBENT1=$(git ls-tree master^ sub) &&
-	SUBENT2=$(git ls-tree master sub) &&
+	SUBENT1=$(git ls-tree main^ sub) &&
+	SUBENT2=$(git ls-tree main sub) &&
 	rm -rf new &&
 	mkdir new &&
 	git --git-dir=new/.git init &&
 	git fast-export --signed-tags=strip --all >actual &&
 	(cd new &&
 	 git fast-import &&
-	 test "$SUBENT1" = "$(git ls-tree refs/heads/master^ sub)" &&
-	 test "$SUBENT2" = "$(git ls-tree refs/heads/master sub)" &&
-	 git checkout master &&
+	 test "$SUBENT1" = "$(git ls-tree refs/heads/main^ sub)" &&
+	 test "$SUBENT2" = "$(git ls-tree refs/heads/main sub)" &&
+	 git checkout main &&
 	 git submodule init &&
 	 git submodule update &&
 	 cmp sub/file ../sub/file) <actual
@@ -352,7 +352,7 @@ test_expect_success 'fast-export -C -C | fast-import' '
 
 '
 
-test_expect_success 'fast-export | fast-import when master is tagged' '
+test_expect_success 'fast-export | fast-import when main is tagged' '
 
 	git tag -m msg last &&
 	git fast-export -C -C --signed-tags=strip --all > output &&
@@ -467,8 +467,8 @@ mark :2
 data 3
 hi
 
-reset refs/heads/master
-commit refs/heads/master
+reset refs/heads/main
+commit refs/heads/main
 mark :3
 author A U Thor <author@example.com> 1112912713 -0700
 committer C O Mitter <committer@example.com> 1112912713 -0700
@@ -482,7 +482,7 @@ EOF
 test_expect_failure 'no exact-ref revisions included' '
 	(
 		cd limit-by-paths &&
-		git fast-export master~2..master~1 > output &&
+		git fast-export main~2..main~1 > output &&
 		test_cmp expected output
 	)
 '
@@ -524,7 +524,7 @@ test_expect_success 'full-tree re-shows unmodified files'        '
 '
 
 test_expect_success 'set-up a few more tags for tag export tests' '
-	git checkout -f master &&
+	git checkout -f main &&
 	HEAD_TREE=$(git show -s --pretty=raw HEAD | grep tree | sed "s/tree //") &&
 	git tag    tree_tag        -m "tagging a tree" $HEAD_TREE &&
 	git tag -a tree_tag-obj    -m "tagging a tree" $HEAD_TREE &&
@@ -549,7 +549,7 @@ test_expect_success 'tag-obj_tag'     'git fast-export tag-obj_tag'
 test_expect_success 'tag-obj_tag-obj' 'git fast-export tag-obj_tag-obj'
 
 test_expect_success 'handling tags of blobs' '
-	git tag -a -m "Tag of a blob" blobtag $(git rev-parse master:file) &&
+	git tag -a -m "Tag of a blob" blobtag $(git rev-parse main:file) &&
 	git fast-export blobtag >actual &&
 	cat >expect <<-EOF &&
 	blob
@@ -592,10 +592,10 @@ test_expect_success 'directory becomes symlink'        '
 	) &&
 	(
 		cd dirtosymlink &&
-		git fast-export master -- foo |
+		git fast-export main -- foo |
 		(cd ../result && git fast-import --quiet)
 	) &&
-	(cd result && git show master:foo)
+	(cd result && git show main:foo)
 '
 
 test_expect_success 'fast-export quotes pathnames' '
@@ -643,7 +643,7 @@ mark :13
 data 5
 bump
 
-commit refs/heads/master
+commit refs/heads/main
 mark :14
 author A U Thor <author@example.com> 1112912773 -0700
 committer C O Mitter <committer@example.com> 1112912773 -0700
@@ -657,18 +657,18 @@ EOF
 test_expect_success 'avoid uninteresting refs' '
 	> tmp-marks &&
 	git fast-export --import-marks=tmp-marks \
-		--export-marks=tmp-marks master > /dev/null &&
+		--export-marks=tmp-marks main > /dev/null &&
 	git tag v1.0 &&
 	git branch uninteresting &&
 	echo bump > file &&
 	git commit -a -m bump &&
 	git fast-export --import-marks=tmp-marks \
-		--export-marks=tmp-marks ^uninteresting ^v1.0 master > actual &&
+		--export-marks=tmp-marks ^uninteresting ^v1.0 main > actual &&
 	test_cmp expected actual
 '
 
 cat > expected << EOF
-reset refs/heads/master
+reset refs/heads/main
 from :14
 
 EOF
@@ -676,14 +676,14 @@ EOF
 test_expect_success 'refs are updated even if no commits need to be exported' '
 	> tmp-marks &&
 	git fast-export --import-marks=tmp-marks \
-		--export-marks=tmp-marks master > /dev/null &&
+		--export-marks=tmp-marks main > /dev/null &&
 	git fast-export --import-marks=tmp-marks \
-		--export-marks=tmp-marks master > actual &&
+		--export-marks=tmp-marks main > actual &&
 	test_cmp expected actual
 '
 
 test_expect_success 'use refspec' '
-	git fast-export --refspec refs/heads/master:refs/heads/foobar master >actual2 &&
+	git fast-export --refspec refs/heads/main:refs/heads/foobar main >actual2 &&
 	grep "^commit " actual2 | sort | uniq >actual &&
 	echo "commit refs/heads/foobar" > expected &&
 	test_cmp expected actual
@@ -736,13 +736,13 @@ test_expect_success 'merge commit gets exported with --import-marks' '
 		test_commit initial &&
 		git checkout -b topic &&
 		test_commit on-topic &&
-		git checkout master &&
-		test_commit on-master &&
+		git checkout main &&
+		test_commit on-main &&
 		test_tick &&
 		git merge --no-ff -m Yeah topic &&
 
 		echo ":1 $(git rev-parse HEAD^^)" >marks &&
-		git fast-export --import-marks=marks master >out &&
+		git fast-export --import-marks=marks main >out &&
 		grep Yeah out
 	)
 '
diff --git a/t/t9351-fast-export-anonymize.sh b/t/t9351-fast-export-anonymize.sh
index 5ac2c3b5ee..c07175db47 100755
--- a/t/t9351-fast-export-anonymize.sh
+++ b/t/t9351-fast-export-anonymize.sh
@@ -51,7 +51,7 @@ test_expect_success 'stream retains other as refname' '
 '
 
 test_expect_success 'stream omits other refnames' '
-	! grep master stream &&
+	! grep main stream &&
 	! grep mytag stream
 '
 
@@ -85,7 +85,7 @@ test_expect_success 'repo has original shape and timestamps' '
 	shape () {
 		git log --format="%m %ct" --left-right --boundary "$@"
 	} &&
-	(cd .. && shape master...other) >expect &&
+	(cd .. && shape main...other) >expect &&
 	shape $main_branch...$other_branch >actual &&
 	test_cmp expect actual
 '
diff --git a/t/t9400-git-cvsserver-server.sh b/t/t9400-git-cvsserver-server.sh
index 4a46f31c41..9aa49c6906 100755
--- a/t/t9400-git-cvsserver-server.sh
+++ b/t/t9400-git-cvsserver-server.sh
@@ -45,7 +45,7 @@ test_expect_success 'setup' '
   touch secondrootfile &&
   git add secondrootfile &&
   git commit -m "second root") &&
-  git fetch secondroot master &&
+  git fetch secondroot main &&
   git merge --allow-unrelated-histories FETCH_HEAD &&
   git clone -q --bare "$WORKDIR/.git" "$SERVERDIR" >/dev/null 2>&1 &&
   GIT_DIR="$SERVERDIR" git config --bool gitcvs.enabled true &&
@@ -57,7 +57,7 @@ test_expect_success 'setup' '
 # note that cvs doesn't accept absolute pathnames
 # as argument to co -d
 test_expect_success 'basic checkout' \
-  'GIT_CONFIG="$git_config" cvs -Q co -d cvswork master &&
+  'GIT_CONFIG="$git_config" cvs -Q co -d cvswork main &&
    test "$(echo $(grep -v ^D cvswork/CVS/Entries|cut -d/ -f2,3,5 | head -n 1))" = "empty/1.1/" &&
    test "$(echo $(grep -v ^D cvswork/CVS/Entries|cut -d/ -f2,3,5 | sed -ne \$p))" = "secondrootfile/1.1/"'
 
@@ -226,7 +226,7 @@ GIT_DIR="$SERVERDIR" git config --bool gitcvs.enabled true || exit 1
 
 test_expect_success 'gitcvs.enabled = false' \
   'GIT_DIR="$SERVERDIR" git config --bool gitcvs.enabled false &&
-   if GIT_CONFIG="$git_config" cvs -Q co -d cvswork2 master >cvs.log 2>&1
+   if GIT_CONFIG="$git_config" cvs -Q co -d cvswork2 main >cvs.log 2>&1
    then
      echo unexpected cvs success
      false
@@ -240,14 +240,14 @@ rm -fr cvswork2
 test_expect_success 'gitcvs.ext.enabled = true' \
   'GIT_DIR="$SERVERDIR" git config --bool gitcvs.ext.enabled true &&
    GIT_DIR="$SERVERDIR" git config --bool gitcvs.enabled false &&
-   GIT_CONFIG="$git_config" cvs -Q co -d cvswork2 master >cvs.log 2>&1 &&
+   GIT_CONFIG="$git_config" cvs -Q co -d cvswork2 main >cvs.log 2>&1 &&
    test_cmp cvswork cvswork2'
 
 rm -fr cvswork2
 test_expect_success 'gitcvs.ext.enabled = false' \
   'GIT_DIR="$SERVERDIR" git config --bool gitcvs.ext.enabled false &&
    GIT_DIR="$SERVERDIR" git config --bool gitcvs.enabled true &&
-   if GIT_CONFIG="$git_config" cvs -Q co -d cvswork2 master >cvs.log 2>&1
+   if GIT_CONFIG="$git_config" cvs -Q co -d cvswork2 main >cvs.log 2>&1
    then
      echo unexpected cvs success
      false
@@ -261,21 +261,21 @@ rm -fr cvswork2
 test_expect_success 'gitcvs.dbname' \
   'GIT_DIR="$SERVERDIR" git config --bool gitcvs.ext.enabled true &&
    GIT_DIR="$SERVERDIR" git config gitcvs.dbname %Ggitcvs.%a.%m.sqlite &&
-   GIT_CONFIG="$git_config" cvs -Q co -d cvswork2 master >cvs.log 2>&1 &&
+   GIT_CONFIG="$git_config" cvs -Q co -d cvswork2 main >cvs.log 2>&1 &&
    test_cmp cvswork cvswork2 &&
-   test -f "$SERVERDIR/gitcvs.ext.master.sqlite" &&
-   cmp "$SERVERDIR/gitcvs.master.sqlite" "$SERVERDIR/gitcvs.ext.master.sqlite"'
+   test -f "$SERVERDIR/gitcvs.ext.main.sqlite" &&
+   cmp "$SERVERDIR/gitcvs.main.sqlite" "$SERVERDIR/gitcvs.ext.main.sqlite"'
 
 rm -fr cvswork2
 test_expect_success 'gitcvs.ext.dbname' \
   'GIT_DIR="$SERVERDIR" git config --bool gitcvs.ext.enabled true &&
    GIT_DIR="$SERVERDIR" git config gitcvs.ext.dbname %Ggitcvs1.%a.%m.sqlite &&
    GIT_DIR="$SERVERDIR" git config gitcvs.dbname %Ggitcvs2.%a.%m.sqlite &&
-   GIT_CONFIG="$git_config" cvs -Q co -d cvswork2 master >cvs.log 2>&1 &&
+   GIT_CONFIG="$git_config" cvs -Q co -d cvswork2 main >cvs.log 2>&1 &&
    test_cmp cvswork cvswork2 &&
-   test -f "$SERVERDIR/gitcvs1.ext.master.sqlite" &&
-   test ! -f "$SERVERDIR/gitcvs2.ext.master.sqlite" &&
-   cmp "$SERVERDIR/gitcvs.master.sqlite" "$SERVERDIR/gitcvs1.ext.master.sqlite"'
+   test -f "$SERVERDIR/gitcvs1.ext.main.sqlite" &&
+   test ! -f "$SERVERDIR/gitcvs2.ext.main.sqlite" &&
+   cmp "$SERVERDIR/gitcvs.main.sqlite" "$SERVERDIR/gitcvs1.ext.main.sqlite"'
 
 
 #------------
@@ -457,7 +457,7 @@ cd "$WORKDIR"
 test_expect_success 'cvs update (module list supports packed refs)' '
     GIT_DIR="$SERVERDIR" git pack-refs --all &&
     GIT_CONFIG="$git_config" cvs -n up -d 2> out &&
-    grep "cvs update: New directory \`master'\''" < out
+    grep "cvs update: New directory \`main'\''" < out
 '
 
 #------------
@@ -499,8 +499,8 @@ test_expect_success 'cvs status (no subdirs in header)' '
 cd "$WORKDIR"
 test_expect_success 'cvs co -c (shows module database)' '
     GIT_CONFIG="$git_config" cvs co -c > out &&
-    grep "^master[	 ][ 	]*master$" <out &&
-    ! grep -v "^master[	 ][ 	]*master$" <out
+    grep "^main[	 ][ 	]*main$" <out &&
+    ! grep -v "^main[	 ][ 	]*main$" <out
 '
 
 #------------
@@ -526,7 +526,7 @@ test_expect_success 'cvs co -c (shows module database)' '
 
 sed -e 's/^x//' -e 's/SP$/ /' > "$WORKDIR/expect" <<EOF
 x
-xRCS file: $WORKDIR/gitcvs.git/master/merge,v
+xRCS file: $WORKDIR/gitcvs.git/main/merge,v
 xWorking file: merge
 xhead: 1.4
 xbranch:
diff --git a/t/t9401-git-cvsserver-crlf.sh b/t/t9401-git-cvsserver-crlf.sh
index c7a0dd84a4..8046a25b1f 100755
--- a/t/t9401-git-cvsserver-crlf.sh
+++ b/t/t9401-git-cvsserver-crlf.sh
@@ -105,14 +105,14 @@ test_expect_success 'setup' '
 '
 
 test_expect_success 'cvs co (default crlf)' '
-    GIT_CONFIG="$git_config" cvs -Q co -d cvswork master >cvs.log 2>&1 &&
+    GIT_CONFIG="$git_config" cvs -Q co -d cvswork main >cvs.log 2>&1 &&
     test x"$(grep '/-k' cvswork/CVS/Entries cvswork/subdir/CVS/Entries)" = x""
 '
 
 rm -rf cvswork
 test_expect_success 'cvs co (allbinary)' '
     GIT_DIR="$SERVERDIR" git config --bool gitcvs.allbinary true &&
-    GIT_CONFIG="$git_config" cvs -Q co -d cvswork master >cvs.log 2>&1 &&
+    GIT_CONFIG="$git_config" cvs -Q co -d cvswork main >cvs.log 2>&1 &&
     marked_as cvswork textfile.c -kb &&
     marked_as cvswork binfile.bin -kb &&
     marked_as cvswork .gitattributes -kb &&
@@ -125,7 +125,7 @@ test_expect_success 'cvs co (allbinary)' '
 rm -rf cvswork cvs.log
 test_expect_success 'cvs co (use attributes/allbinary)' '
     GIT_DIR="$SERVERDIR" git config --bool gitcvs.usecrlfattr true &&
-    GIT_CONFIG="$git_config" cvs -Q co -d cvswork master >cvs.log 2>&1 &&
+    GIT_CONFIG="$git_config" cvs -Q co -d cvswork main >cvs.log 2>&1 &&
     marked_as cvswork textfile.c "" &&
     marked_as cvswork binfile.bin -kb &&
     marked_as cvswork .gitattributes -kb &&
@@ -138,7 +138,7 @@ test_expect_success 'cvs co (use attributes/allbinary)' '
 rm -rf cvswork
 test_expect_success 'cvs co (use attributes)' '
     GIT_DIR="$SERVERDIR" git config --bool gitcvs.allbinary false &&
-    GIT_CONFIG="$git_config" cvs -Q co -d cvswork master >cvs.log 2>&1 &&
+    GIT_CONFIG="$git_config" cvs -Q co -d cvswork main >cvs.log 2>&1 &&
     marked_as cvswork textfile.c "" &&
     marked_as cvswork binfile.bin -kb &&
     marked_as cvswork .gitattributes "" &&
@@ -194,7 +194,7 @@ test_expect_success 'updating' '
 rm -rf cvswork
 test_expect_success 'cvs co (use attributes/guess)' '
     GIT_DIR="$SERVERDIR" git config gitcvs.allbinary guess &&
-    GIT_CONFIG="$git_config" cvs -Q co -d cvswork master >cvs.log 2>&1 &&
+    GIT_CONFIG="$git_config" cvs -Q co -d cvswork main >cvs.log 2>&1 &&
     marked_as cvswork textfile.c "" &&
     marked_as cvswork binfile.bin -kb &&
     marked_as cvswork .gitattributes "" &&
@@ -224,7 +224,7 @@ test_expect_success 'setup multi-line files' '
 rm -rf cvswork
 test_expect_success 'cvs co (guess)' '
     GIT_DIR="$SERVERDIR" git config --bool gitcvs.usecrlfattr false &&
-    GIT_CONFIG="$git_config" cvs -Q co -d cvswork master >cvs.log 2>&1 &&
+    GIT_CONFIG="$git_config" cvs -Q co -d cvswork main >cvs.log 2>&1 &&
     marked_as cvswork textfile.c "" &&
     marked_as cvswork binfile.bin -kb &&
     marked_as cvswork .gitattributes "" &&
@@ -239,7 +239,7 @@ test_expect_success 'cvs co (guess)' '
 '
 
 test_expect_success 'cvs co another copy (guess)' '
-    GIT_CONFIG="$git_config" cvs -Q co -d cvswork2 master >cvs.log 2>&1 &&
+    GIT_CONFIG="$git_config" cvs -Q co -d cvswork2 main >cvs.log 2>&1 &&
     marked_as cvswork2 textfile.c "" &&
     marked_as cvswork2 binfile.bin -kb &&
     marked_as cvswork2 .gitattributes "" &&
@@ -335,7 +335,7 @@ test_expect_success 'update subdir of other copy (guess)' '
 
 echo "starting update/merge" >> "${WORKDIR}/marked.log"
 test_expect_success 'update/merge full other copy (guess)' '
-    git pull gitcvs.git master &&
+    git pull gitcvs.git main &&
     sed "s/3/replaced_3/" < multilineTxt.c > ml.temp &&
     mv ml.temp multilineTxt.c &&
     git add multilineTxt.c &&
diff --git a/t/t9402-git-cvsserver-refs.sh b/t/t9402-git-cvsserver-refs.sh
index 6436c91a3c..3b30b02bd1 100755
--- a/t/t9402-git-cvsserver-refs.sh
+++ b/t/t9402-git-cvsserver-refs.sh
@@ -115,7 +115,7 @@ test_expect_success 'setup v1, b1' '
 
 rm -rf cvswork
 test_expect_success 'cvs co v1' '
-	cvs -f -Q co -r v1 -d cvswork master >cvs.log 2>&1 &&
+	cvs -f -Q co -r v1 -d cvswork main >cvs.log 2>&1 &&
 	check_start_tree cvswork &&
 	check_file cvswork textfile.c v1 &&
 	check_file cvswork t2 v1 &&
@@ -128,7 +128,7 @@ test_expect_success 'cvs co v1' '
 
 rm -rf cvswork
 test_expect_success 'cvs co b1' '
-	cvs -f co -r b1 -d cvswork master >cvs.log 2>&1 &&
+	cvs -f co -r b1 -d cvswork main >cvs.log 2>&1 &&
 	check_start_tree cvswork &&
 	check_file cvswork textfile.c v1 &&
 	check_file cvswork t2 v1 &&
@@ -140,7 +140,7 @@ test_expect_success 'cvs co b1' '
 '
 
 test_expect_success 'cvs co b1 [cvswork3]' '
-	cvs -f co -r b1 -d cvswork3 master >cvs.log 2>&1 &&
+	cvs -f co -r b1 -d cvswork3 main >cvs.log 2>&1 &&
 	check_start_tree cvswork3 &&
 	check_file cvswork3 textfile.c v1 &&
 	check_file cvswork3 t2 v1 &&
@@ -265,7 +265,7 @@ test_expect_success 'setup simple b2' '
 '
 
 test_expect_success 'cvs co b2 [into cvswork2]' '
-	cvs -f co -r b2 -d cvswork2 master >cvs.log 2>&1 &&
+	cvs -f co -r b2 -d cvswork2 main >cvs.log 2>&1 &&
 	check_start_tree cvswork &&
 	check_file cvswork textfile.c v1 &&
 	check_file cvswork t2 v1 &&
diff --git a/t/test-lib.sh b/t/test-lib.sh
index 4ddfb9e3ee..a2b539aa30 100644
--- a/t/test-lib.sh
+++ b/t/test-lib.sh
@@ -263,7 +263,7 @@ case "$TEST_NUMBER" in
 	GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
 	export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 	;;
-[0-8]*)
+[0-8]*|9[0-4]*)
 	GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 	export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 	;;
-- 
gitgitgadget


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH 24/28] t9[5-7]*: adjust the references to the default branch name "main"
  2020-11-12 22:43 [PATCH 00/28] Use main as default branch name Johannes Schindelin via GitGitGadget
                   ` (22 preceding siblings ...)
  2020-11-12 22:43 ` [PATCH 23/28] t9[0-4]*: " Johannes Schindelin via GitGitGadget
@ 2020-11-12 22:43 ` Johannes Schindelin via GitGitGadget
  2020-11-12 22:43 ` [PATCH 25/28] tests(git-p4): transition to the default branch name `main` Johannes Schindelin via GitGitGadget
                   ` (8 subsequent siblings)
  32 siblings, 0 replies; 163+ messages in thread
From: Johannes Schindelin via GitGitGadget @ 2020-11-12 22:43 UTC (permalink / raw)
  To: git; +Cc: Johannes Schindelin, Johannes Schindelin

From: Johannes Schindelin <johannes.schindelin@gmx.de>

This trick was performed via

	$ (cd t &&
	   sed -i -e 's/master/main/g' -e 's/MASTER/MAIN/g' \
		-e 's/Master/Main/g' -- t9[5-7]*.sh lib-cvs.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>
---
 t/lib-cvs.sh                              |  2 +-
 t/t9500-gitweb-standalone-no-errors.sh    | 20 ++++++++++----------
 t/t9501-gitweb-standalone-http-status.sh  | 14 +++++++-------
 t/t9502-gitweb-standalone-parse-output.sh | 16 ++++++++--------
 t/t9600-cvsimport.sh                      |  2 +-
 t/t9601-cvsimport-vendor-branch.sh        | 16 ++++++++--------
 t/t9602-cvsimport-branches-tags.sh        |  4 ++--
 t/t9603-cvsimport-patchsets.sh            |  8 ++++----
 t/test-lib.sh                             |  2 +-
 9 files changed, 42 insertions(+), 42 deletions(-)

diff --git a/t/lib-cvs.sh b/t/lib-cvs.sh
index 9b2bcfb1b0..32b3473379 100644
--- a/t/lib-cvs.sh
+++ b/t/lib-cvs.sh
@@ -36,7 +36,7 @@ setup_cvs_test_repository () {
 test_cvs_co () {
 	# Usage: test_cvs_co BRANCH_NAME
 	rm -rf module-cvs-"$1"
-	if [ "$1" = "master" ]
+	if [ "$1" = "main" ]
 	then
 		$CVS co -P -d module-cvs-"$1" -A module
 	else
diff --git a/t/t9500-gitweb-standalone-no-errors.sh b/t/t9500-gitweb-standalone-no-errors.sh
index b484e3e250..452470ff3b 100755
--- a/t/t9500-gitweb-standalone-no-errors.sh
+++ b/t/t9500-gitweb-standalone-no-errors.sh
@@ -327,7 +327,7 @@ test_expect_success \
 	 echo "Branch" >>b &&
 	 git add b &&
 	 git commit -a -m "On branch" &&
-	 git checkout master &&
+	 git checkout main &&
 	 git merge b &&
 	 git tag merge_commit'
 
@@ -364,7 +364,7 @@ test_expect_success \
 	 echo "Changed and have mode changed" >07-change-mode-change &&
 	 test_chmod +x 07-change-mode-change &&
 	 git commit -a -m "Large commit" &&
-	 git checkout master'
+	 git checkout main'
 
 test_expect_success \
 	'commit(1): large commit' \
@@ -402,7 +402,7 @@ test_expect_success 'side-by-side: merge commit' '
 
 test_expect_success \
 	'tags: list of different types of tags' \
-	'git checkout master &&
+	'git checkout main &&
 	 git tag -a -m "Tag commit object" tag-commit HEAD &&
 	 git tag -a -m "" tag-commit-nomessage HEAD &&
 	 git tag -a -m "Tag tag object" tag-tag tag-commit &&
@@ -443,7 +443,7 @@ test_expect_success \
 
 test_expect_success \
 	'logs: history (implicit HEAD, deleted file)' \
-	'git checkout master &&
+	'git checkout main &&
 	 echo "to be deleted" >deleted_file &&
 	 git add deleted_file &&
 	 git commit -m "Add file to be deleted" &&
@@ -463,11 +463,11 @@ test_expect_success \
 
 test_expect_success \
 	'path_info: project/branch:file' \
-	'gitweb_run "" "/.git/master:file"'
+	'gitweb_run "" "/.git/main:file"'
 
 test_expect_success \
 	'path_info: project/branch:dir/' \
-	'gitweb_run "" "/.git/master:foo/"'
+	'gitweb_run "" "/.git/main:foo/"'
 
 test_expect_success \
 	'path_info: project/branch (non-existent)' \
@@ -479,16 +479,16 @@ test_expect_success \
 
 test_expect_success \
 	'path_info: project/branch:file (non-existent)' \
-	'gitweb_run "" "/.git/master:non-existent"'
+	'gitweb_run "" "/.git/main:non-existent"'
 
 test_expect_success \
 	'path_info: project/branch:dir/ (non-existent)' \
-	'gitweb_run "" "/.git/master:non-existent/"'
+	'gitweb_run "" "/.git/main:non-existent/"'
 
 
 test_expect_success \
 	'path_info: project/branch:/file' \
-	'gitweb_run "" "/.git/master:/file"'
+	'gitweb_run "" "/.git/main:/file"'
 
 test_expect_success \
 	'path_info: project/:/file (implicit HEAD)' \
@@ -801,7 +801,7 @@ test_expect_success \
 		git checkout orphan_branch ||
 		git checkout --orphan orphan_branch
 	 } &&
-	 test_when_finished "git checkout master" &&
+	 test_when_finished "git checkout main" &&
 	 gitweb_run "p=.git;a=summary"'
 
 test_done
diff --git a/t/t9501-gitweb-standalone-http-status.sh b/t/t9501-gitweb-standalone-http-status.sh
index 2a0ffed870..16f98ab54e 100755
--- a/t/t9501-gitweb-standalone-http-status.sh
+++ b/t/t9501-gitweb-standalone-http-status.sh
@@ -85,7 +85,7 @@ test_debug 'cat gitweb.headers'
 # snapshot hash ids
 
 test_expect_success 'snapshots: good tree-ish id' '
-	gitweb_run "p=.git;a=snapshot;h=master;sf=tgz" &&
+	gitweb_run "p=.git;a=snapshot;h=main;sf=tgz" &&
 	grep "Status: 200 OK" gitweb.output
 '
 test_debug 'cat gitweb.headers'
@@ -123,7 +123,7 @@ test_debug 'cat gitweb.output'
 # modification times (Last-Modified and If-Modified-Since)
 
 test_expect_success DATE_PARSER 'modification: feed last-modified' '
-	gitweb_run "p=.git;a=atom;h=master" &&
+	gitweb_run "p=.git;a=atom;h=main" &&
 	grep "Status: 200 OK" gitweb.headers &&
 	grep "Last-modified: Thu, 7 Apr 2005 22:14:13 +0000" gitweb.headers
 '
@@ -133,7 +133,7 @@ test_expect_success DATE_PARSER 'modification: feed if-modified-since (modified)
 	HTTP_IF_MODIFIED_SINCE="Wed, 6 Apr 2005 22:14:13 +0000" &&
 	export HTTP_IF_MODIFIED_SINCE &&
 	test_when_finished "unset HTTP_IF_MODIFIED_SINCE" &&
-	gitweb_run "p=.git;a=atom;h=master" &&
+	gitweb_run "p=.git;a=atom;h=main" &&
 	grep "Status: 200 OK" gitweb.headers
 '
 test_debug 'cat gitweb.headers'
@@ -142,13 +142,13 @@ test_expect_success DATE_PARSER 'modification: feed if-modified-since (unmodifie
 	HTTP_IF_MODIFIED_SINCE="Thu, 7 Apr 2005 22:14:13 +0000" &&
 	export HTTP_IF_MODIFIED_SINCE &&
 	test_when_finished "unset HTTP_IF_MODIFIED_SINCE" &&
-	gitweb_run "p=.git;a=atom;h=master" &&
+	gitweb_run "p=.git;a=atom;h=main" &&
 	grep "Status: 304 Not Modified" gitweb.headers
 '
 test_debug 'cat gitweb.headers'
 
 test_expect_success DATE_PARSER 'modification: snapshot last-modified' '
-	gitweb_run "p=.git;a=snapshot;h=master;sf=tgz" &&
+	gitweb_run "p=.git;a=snapshot;h=main;sf=tgz" &&
 	grep "Status: 200 OK" gitweb.headers &&
 	grep "Last-modified: Thu, 7 Apr 2005 22:14:13 +0000" gitweb.headers
 '
@@ -158,7 +158,7 @@ test_expect_success DATE_PARSER 'modification: snapshot if-modified-since (modif
 	HTTP_IF_MODIFIED_SINCE="Wed, 6 Apr 2005 22:14:13 +0000" &&
 	export HTTP_IF_MODIFIED_SINCE &&
 	test_when_finished "unset HTTP_IF_MODIFIED_SINCE" &&
-	gitweb_run "p=.git;a=snapshot;h=master;sf=tgz" &&
+	gitweb_run "p=.git;a=snapshot;h=main;sf=tgz" &&
 	grep "Status: 200 OK" gitweb.headers
 '
 test_debug 'cat gitweb.headers'
@@ -167,7 +167,7 @@ test_expect_success DATE_PARSER 'modification: snapshot if-modified-since (unmod
 	HTTP_IF_MODIFIED_SINCE="Thu, 7 Apr 2005 22:14:13 +0000" &&
 	export HTTP_IF_MODIFIED_SINCE &&
 	test_when_finished "unset HTTP_IF_MODIFIED_SINCE" &&
-	gitweb_run "p=.git;a=snapshot;h=master;sf=tgz" &&
+	gitweb_run "p=.git;a=snapshot;h=main;sf=tgz" &&
 	grep "Status: 304 Not Modified" gitweb.headers
 '
 test_debug 'cat gitweb.headers'
diff --git a/t/t9502-gitweb-standalone-parse-output.sh b/t/t9502-gitweb-standalone-parse-output.sh
index e38cbc97d3..d0cfff9fdd 100755
--- a/t/t9502-gitweb-standalone-parse-output.sh
+++ b/t/t9502-gitweb-standalone-parse-output.sh
@@ -79,10 +79,10 @@ test_expect_success 'snapshot: HEAD' '
 '
 test_debug 'cat gitweb.headers && cat file_list'
 
-test_expect_success 'snapshot: short branch name (master)' '
-	gitweb_run "p=.git;a=snapshot;h=master;sf=tar" &&
-	ID=$(git rev-parse --verify --short=7 master) &&
-	check_snapshot ".git-master-$ID"
+test_expect_success 'snapshot: short branch name (main)' '
+	gitweb_run "p=.git;a=snapshot;h=main;sf=tar" &&
+	ID=$(git rev-parse --verify --short=7 main) &&
+	check_snapshot ".git-main-$ID"
 '
 test_debug 'cat gitweb.headers && cat file_list'
 
@@ -93,10 +93,10 @@ test_expect_success 'snapshot: short tag name (first)' '
 '
 test_debug 'cat gitweb.headers && cat file_list'
 
-test_expect_success 'snapshot: full branch name (refs/heads/master)' '
-	gitweb_run "p=.git;a=snapshot;h=refs/heads/master;sf=tar" &&
-	ID=$(git rev-parse --verify --short=7 master) &&
-	check_snapshot ".git-master-$ID"
+test_expect_success 'snapshot: full branch name (refs/heads/main)' '
+	gitweb_run "p=.git;a=snapshot;h=refs/heads/main;sf=tar" &&
+	ID=$(git rev-parse --verify --short=7 main) &&
+	check_snapshot ".git-main-$ID"
 '
 test_debug 'cat gitweb.headers && cat file_list'
 
diff --git a/t/t9600-cvsimport.sh b/t/t9600-cvsimport.sh
index 251fdd66c4..0c8e02c2b3 100755
--- a/t/t9600-cvsimport.sh
+++ b/t/t9600-cvsimport.sh
@@ -159,6 +159,6 @@ test_expect_success PERL 'no .git/cvs-revisions created by default' '
 
 '
 
-test_expect_success PERL 'test entire HEAD' 'test_cmp_branch_tree master'
+test_expect_success PERL 'test entire HEAD' 'test_cmp_branch_tree main'
 
 test_done
diff --git a/t/t9601-cvsimport-vendor-branch.sh b/t/t9601-cvsimport-vendor-branch.sh
index 827d39f5bf..1e89f936e8 100755
--- a/t/t9601-cvsimport-vendor-branch.sh
+++ b/t/t9601-cvsimport-vendor-branch.sh
@@ -42,43 +42,43 @@ test_expect_success PERL 'import a module with a vendor branch' '
 
 '
 
-test_expect_success PERL 'check HEAD out of cvs repository' 'test_cvs_co master'
+test_expect_success PERL 'check HEAD out of cvs repository' 'test_cvs_co main'
 
-test_expect_success PERL 'check master out of git repository' 'test_git_co master'
+test_expect_success PERL 'check main out of git repository' 'test_git_co main'
 
 test_expect_success PERL 'check a file that was imported once' '
 
-	test_cmp_branch_file master imported-once.txt
+	test_cmp_branch_file main imported-once.txt
 
 '
 
 test_expect_failure PERL 'check a file that was imported twice' '
 
-	test_cmp_branch_file master imported-twice.txt
+	test_cmp_branch_file main imported-twice.txt
 
 '
 
 test_expect_success PERL 'check a file that was imported then modified on HEAD' '
 
-	test_cmp_branch_file master imported-modified.txt
+	test_cmp_branch_file main imported-modified.txt
 
 '
 
 test_expect_success PERL 'check a file that was imported, modified, then imported again' '
 
-	test_cmp_branch_file master imported-modified-imported.txt
+	test_cmp_branch_file main imported-modified-imported.txt
 
 '
 
 test_expect_success PERL 'check a file that was added to HEAD then imported' '
 
-	test_cmp_branch_file master added-imported.txt
+	test_cmp_branch_file main added-imported.txt
 
 '
 
 test_expect_success PERL 'a vendor branch whose tag has been removed' '
 
-	test_cmp_branch_file master imported-anonymously.txt
+	test_cmp_branch_file main imported-anonymously.txt
 
 '
 
diff --git a/t/t9602-cvsimport-branches-tags.sh b/t/t9602-cvsimport-branches-tags.sh
index e1db323f54..fa3c1ae133 100755
--- a/t/t9602-cvsimport-branches-tags.sh
+++ b/t/t9602-cvsimport-branches-tags.sh
@@ -14,9 +14,9 @@ test_expect_success PERL 'import module' '
 
 '
 
-test_expect_success PERL 'test branch master' '
+test_expect_success PERL 'test branch main' '
 
-	test_cmp_branch_tree master
+	test_cmp_branch_tree main
 
 '
 
diff --git a/t/t9603-cvsimport-patchsets.sh b/t/t9603-cvsimport-patchsets.sh
index e7a91611dc..19f38f78f2 100755
--- a/t/t9603-cvsimport-patchsets.sh
+++ b/t/t9603-cvsimport-patchsets.sh
@@ -20,16 +20,16 @@ test_expect_failure PERL 'import with criss cross times on revisions' '
 	git cvsimport -p"-x" -C module-git module &&
 	(
 		cd module-git &&
-		git log --pretty=format:%s > ../actual-master &&
+		git log --pretty=format:%s > ../actual-main &&
 		git log A~2..A --pretty="format:%s %ad" -- > ../actual-A &&
-		echo "" >> ../actual-master &&
+		echo "" >> ../actual-main &&
 		echo "" >> ../actual-A
 	) &&
 	echo "Rev 4
 Rev 3
 Rev 2
-Rev 1" > expect-master &&
-	test_cmp expect-master actual-master &&
+Rev 1" > expect-main &&
+	test_cmp expect-main actual-main &&
 
 	echo "Rev 5 Branch A Wed Mar 11 19:09:10 2009 +0000
 Rev 4 Branch A Wed Mar 11 19:03:52 2009 +0000" > expect-A &&
diff --git a/t/test-lib.sh b/t/test-lib.sh
index a2b539aa30..803b9c2a58 100644
--- a/t/test-lib.sh
+++ b/t/test-lib.sh
@@ -263,7 +263,7 @@ case "$TEST_NUMBER" in
 	GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
 	export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 	;;
-[0-8]*|9[0-4]*)
+[0-8]*|9[0-7]*)
 	GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 	export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 	;;
-- 
gitgitgadget


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH 25/28] tests(git-p4): transition to the default branch name `main`
  2020-11-12 22:43 [PATCH 00/28] Use main as default branch name Johannes Schindelin via GitGitGadget
                   ` (23 preceding siblings ...)
  2020-11-12 22:43 ` [PATCH 24/28] t9[5-7]*: " Johannes Schindelin via GitGitGadget
@ 2020-11-12 22:43 ` Johannes Schindelin via GitGitGadget
  2020-11-12 22:43 ` [PATCH 26/28] t99*: adjust the references to the default branch name "main" Johannes Schindelin via GitGitGadget
                   ` (7 subsequent siblings)
  32 siblings, 0 replies; 163+ messages in thread
From: Johannes Schindelin via GitGitGadget @ 2020-11-12 22:43 UTC (permalink / raw)
  To: git; +Cc: Johannes Schindelin, Johannes Schindelin

From: Johannes Schindelin <johannes.schindelin@gmx.de>

In the previous commits, we adjusted the test suite to use the branch
name `main` for initial branches.

The `git p4`-related tests are a bit harder to adjust because `git p4`
uses the ref `refs/heads/p4/master` to track the remote branches, and
for now, we do not want to change that (this might be the subject of a
future patch series). We only need to adjust for the actual initial
branch name to be changed to `main`.

This allows us to define `GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main`
for those tests.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
---
 t/t9800-git-p4-basic.sh        |  2 +-
 t/t9801-git-p4-branch.sh       | 16 ++++++++--------
 t/t9806-git-p4-options.sh      | 18 +++++++++---------
 t/t9807-git-p4-submit.sh       |  2 +-
 t/t9811-git-p4-label-import.sh |  2 +-
 t/test-lib.sh                  |  2 +-
 6 files changed, 21 insertions(+), 21 deletions(-)

diff --git a/t/t9800-git-p4-basic.sh b/t/t9800-git-p4-basic.sh
index c98c1dfc23..0c543a8708 100755
--- a/t/t9800-git-p4-basic.sh
+++ b/t/t9800-git-p4-basic.sh
@@ -226,7 +226,7 @@ test_expect_success 'clone --bare should make a bare repository' '
 		git config --get --bool core.bare true &&
 		git rev-parse --verify refs/remotes/p4/master &&
 		git rev-parse --verify refs/remotes/p4/HEAD &&
-		git rev-parse --verify refs/heads/master &&
+		git rev-parse --verify refs/heads/main &&
 		git rev-parse --verify HEAD
 	)
 '
diff --git a/t/t9801-git-p4-branch.sh b/t/t9801-git-p4-branch.sh
index a3abd778f9..94161d4b57 100755
--- a/t/t9801-git-p4-branch.sh
+++ b/t/t9801-git-p4-branch.sh
@@ -67,7 +67,7 @@ test_expect_success 'import main, no branch detection' '
 	(
 		cd "$git" &&
 		git log --oneline --graph --decorate --all &&
-		git rev-list master -- >wc &&
+		git rev-list main -- >wc &&
 		test_line_count = 4 wc
 	)
 '
@@ -78,7 +78,7 @@ test_expect_success 'import branch1, no branch detection' '
 	(
 		cd "$git" &&
 		git log --oneline --graph --decorate --all &&
-		git rev-list master -- >wc &&
+		git rev-list main -- >wc &&
 		test_line_count = 2 wc
 	)
 '
@@ -89,7 +89,7 @@ test_expect_success 'import branch2, no branch detection' '
 	(
 		cd "$git" &&
 		git log --oneline --graph --decorate --all &&
-		git rev-list master -- >wc &&
+		git rev-list main -- >wc &&
 		test_line_count = 2 wc
 	)
 '
@@ -100,7 +100,7 @@ test_expect_success 'import depot, no branch detection' '
 	(
 		cd "$git" &&
 		git log --oneline --graph --decorate --all &&
-		git rev-list master -- >wc &&
+		git rev-list main -- >wc &&
 		test_line_count = 8 wc
 	)
 '
@@ -114,7 +114,7 @@ test_expect_success 'import depot, branch detection' '
 		git log --oneline --graph --decorate --all &&
 
 		# 4 main commits
-		git rev-list master -- >wc &&
+		git rev-list main -- >wc &&
 		test_line_count = 4 wc &&
 
 		# 3 main, 1 integrate, 1 on branch2
@@ -137,7 +137,7 @@ test_expect_success 'import depot, branch detection, branchList branch definitio
 		git log --oneline --graph --decorate --all &&
 
 		# 4 main commits
-		git rev-list master -- >wc &&
+		git rev-list main -- >wc &&
 		test_line_count = 4 wc &&
 
 		# 3 main, 1 integrate, 1 on branch2
@@ -484,7 +484,7 @@ test_expect_success 'use-client-spec detect-branches files in top-level' '
 	(
 		cd "$git" &&
 		git p4 sync --detect-branches --use-client-spec //depot/usecs@all &&
-		git checkout -b master p4/usecs/b1 &&
+		git checkout -b main p4/usecs/b1 &&
 		test_path_is_file b1-file1 &&
 		test_path_is_missing b2-file2 &&
 		test_path_is_missing b1 &&
@@ -537,7 +537,7 @@ test_expect_success 'use-client-spec detect-branches skips files in branches' '
 	(
 		cd "$git" &&
 		git p4 sync --detect-branches --use-client-spec //depot/usecs@all &&
-		git checkout -b master p4/usecs/b3 &&
+		git checkout -b main p4/usecs/b3 &&
 		test_path_is_file b1-file1 &&
 		test_path_is_file b3-file3_2 &&
 		test_path_is_missing b3-file3_1
diff --git a/t/t9806-git-p4-options.sh b/t/t9806-git-p4-options.sh
index 4e794a01bf..0beae2e3f3 100755
--- a/t/t9806-git-p4-options.sh
+++ b/t/t9806-git-p4-options.sh
@@ -27,14 +27,14 @@ test_expect_success 'clone no --git-dir' '
 	test_must_fail git p4 clone --git-dir=xx //depot
 '
 
-test_expect_success 'clone --branch should checkout master' '
+test_expect_success 'clone --branch should checkout main' '
 	git p4 clone --branch=refs/remotes/p4/sb --dest="$git" //depot &&
 	test_when_finished cleanup_git &&
 	(
 		cd "$git" &&
 		git rev-parse refs/remotes/p4/sb >sb &&
-		git rev-parse refs/heads/master >master &&
-		test_cmp sb master &&
+		git rev-parse refs/heads/main >main &&
+		test_cmp sb main &&
 		git rev-parse HEAD >head &&
 		test_cmp sb head
 	)
@@ -147,22 +147,22 @@ test_expect_success 'clone --changesfile, @all' '
 	test_must_fail git p4 clone --changesfile="$TRASH_DIRECTORY/cf" --dest="$git" //depot@all
 '
 
-# imports both master and p4/master in refs/heads
+# imports both main and p4/master in refs/heads
 # requires --import-local on sync to find p4 refs/heads
-# does not update master on sync, just p4/master
+# does not update main on sync, just p4/master
 test_expect_success 'clone/sync --import-local' '
 	git p4 clone --import-local --dest="$git" //depot@1,2 &&
 	test_when_finished cleanup_git &&
 	(
 		cd "$git" &&
-		git log --oneline refs/heads/master >lines &&
+		git log --oneline refs/heads/main >lines &&
 		test_line_count = 2 lines &&
 		git log --oneline refs/heads/p4/master >lines &&
 		test_line_count = 2 lines &&
 		test_must_fail git p4 sync &&
 
 		git p4 sync --import-local &&
-		git log --oneline refs/heads/master >lines &&
+		git log --oneline refs/heads/main >lines &&
 		test_line_count = 2 lines &&
 		git log --oneline refs/heads/p4/master >lines &&
 		test_line_count = 3 lines
@@ -174,7 +174,7 @@ test_expect_success 'clone --max-changes' '
 	test_when_finished cleanup_git &&
 	(
 		cd "$git" &&
-		git log --oneline refs/heads/master >lines &&
+		git log --oneline refs/heads/main >lines &&
 		test_line_count = 2 lines
 	)
 '
@@ -237,7 +237,7 @@ test_expect_success 'clone --use-client-spec' '
 			git init &&
 			git config git-p4.useClientSpec true &&
 			git p4 sync //depot/... &&
-			git checkout -b master p4/master &&
+			git checkout -b main p4/master &&
 			test_path_is_file bus/dir/f4 &&
 			test_path_is_missing file1
 		)
diff --git a/t/t9807-git-p4-submit.sh b/t/t9807-git-p4-submit.sh
index eaaae414a1..e45104d1ef 100755
--- a/t/t9807-git-p4-submit.sh
+++ b/t/t9807-git-p4-submit.sh
@@ -114,7 +114,7 @@ test_expect_success 'submit with allowSubmit' '
 		git config git-p4.skipSubmitEdit true &&
 		git config git-p4.allowSubmit "nobranch" &&
 		test_must_fail git p4 submit &&
-		git config git-p4.allowSubmit "nobranch,master" &&
+		git config git-p4.allowSubmit "nobranch,main" &&
 		git p4 submit
 	)
 '
diff --git a/t/t9811-git-p4-label-import.sh b/t/t9811-git-p4-label-import.sh
index c1446f26ab..c722b5a176 100755
--- a/t/t9811-git-p4-label-import.sh
+++ b/t/t9811-git-p4-label-import.sh
@@ -185,7 +185,7 @@ test_expect_success 'tag that cannot be exported' '
 		git add main/f12 &&
 		git commit -m "adding f12" &&
 		git tag -m "tag on a_branch" GIT_TAG_ON_A_BRANCH &&
-		git checkout master &&
+		git checkout main &&
 		git p4 submit --export-labels
 	) &&
 	(
diff --git a/t/test-lib.sh b/t/test-lib.sh
index 803b9c2a58..173880196e 100644
--- a/t/test-lib.sh
+++ b/t/test-lib.sh
@@ -263,7 +263,7 @@ case "$TEST_NUMBER" in
 	GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
 	export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 	;;
-[0-8]*|9[0-7]*)
+[0-8]*|9[0-8]*)
 	GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 	export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 	;;
-- 
gitgitgadget


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH 26/28] t99*: adjust the references to the default branch name "main"
  2020-11-12 22:43 [PATCH 00/28] Use main as default branch name Johannes Schindelin via GitGitGadget
                   ` (24 preceding siblings ...)
  2020-11-12 22:43 ` [PATCH 25/28] tests(git-p4): transition to the default branch name `main` Johannes Schindelin via GitGitGadget
@ 2020-11-12 22:43 ` Johannes Schindelin via GitGitGadget
  2020-11-12 22:43 ` [PATCH 27/28] tests: drop prereq `PREPARE_FOR_MAIN_BRANCH` where no longer needed Johannes Schindelin via GitGitGadget
                   ` (6 subsequent siblings)
  32 siblings, 0 replies; 163+ messages in thread
From: Johannes Schindelin via GitGitGadget @ 2020-11-12 22:43 UTC (permalink / raw)
  To: git; +Cc: Johannes Schindelin, Johannes Schindelin

From: Johannes Schindelin <johannes.schindelin@gmx.de>

Carefully excluding t9902, which sees independent development elsewhere
at the time of writing, we use `main` as the default branch name in
t9903. This trick was performed via

	$ (cd t &&
	   sed -i -e 's/master/main/g' -e 's/MASTER/MAIN/g' \
		-e 's/Master/Main/g' -- t99*.sh lib-cvs.sh &&
	   git checkout HEAD -- t9902\*)

This allows us to define `GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main`
for all tests (except the ones we specifically excluded for now).

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
---
 t/t9903-bash-prompt.sh | 114 ++++++++++++++++++++---------------------
 t/test-lib.sh          |   4 +-
 2 files changed, 59 insertions(+), 59 deletions(-)

diff --git a/t/t9903-bash-prompt.sh b/t/t9903-bash-prompt.sh
index ab5da2cabc..a77daa7419 100755
--- a/t/t9903-bash-prompt.sh
+++ b/t/t9903-bash-prompt.sh
@@ -28,7 +28,7 @@ test_expect_success 'setup for prompt tests' '
 	echo 3 >file &&
 	git commit -m "third b1" file &&
 	git tag -a -m msg2 t2 &&
-	git checkout -b b2 master &&
+	git checkout -b b2 main &&
 	echo 0 >file &&
 	git commit -m "second b2" file &&
 	echo 00 >file &&
@@ -37,20 +37,20 @@ test_expect_success 'setup for prompt tests' '
 	git commit -m "yet another b2" file &&
 	mkdir ignored_dir &&
 	echo "ignored_dir/" >>.gitignore &&
-	git checkout master
+	git checkout main
 '
 
 test_expect_success 'prompt - branch name' '
-	printf " (master)" >expected &&
+	printf " (main)" >expected &&
 	__git_ps1 >"$actual" &&
 	test_cmp expected "$actual"
 '
 
 test_expect_success SYMLINKS 'prompt - branch name - symlink symref' '
-	printf " (master)" >expected &&
-	test_when_finished "git checkout master" &&
+	printf " (main)" >expected &&
+	test_when_finished "git checkout main" &&
 	test_config core.preferSymlinkRefs true &&
-	git checkout master &&
+	git checkout main &&
 	__git_ps1 >"$actual" &&
 	test_cmp expected "$actual"
 '
@@ -58,7 +58,7 @@ test_expect_success SYMLINKS 'prompt - branch name - symlink symref' '
 test_expect_success 'prompt - unborn branch' '
 	printf " (unborn)" >expected &&
 	git checkout --orphan unborn &&
-	test_when_finished "git checkout master" &&
+	test_when_finished "git checkout main" &&
 	__git_ps1 >"$actual" &&
 	test_cmp expected "$actual"
 '
@@ -72,7 +72,7 @@ test_expect_success FUNNYNAMES 'prompt - with newline in path' '
 with
 newline" &&
 	mkdir "$repo_with_newline" &&
-	printf " (master)" >expected &&
+	printf " (main)" >expected &&
 	git init "$repo_with_newline" &&
 	test_when_finished "rm -rf \"$repo_with_newline\"" &&
 	mkdir "$repo_with_newline"/subdir &&
@@ -87,7 +87,7 @@ test_expect_success 'prompt - detached head' '
 	printf " ((%s...))" $(git log -1 --format="%h" --abbrev=13 b1^) >expected &&
 	test_config core.abbrev 13 &&
 	git checkout b1^ &&
-	test_when_finished "git checkout master" &&
+	test_when_finished "git checkout main" &&
 	__git_ps1 >"$actual" &&
 	test_cmp expected "$actual"
 '
@@ -95,7 +95,7 @@ test_expect_success 'prompt - detached head' '
 test_expect_success 'prompt - describe detached head - contains' '
 	printf " ((t2~1))" >expected &&
 	git checkout b1^ &&
-	test_when_finished "git checkout master" &&
+	test_when_finished "git checkout main" &&
 	(
 		GIT_PS1_DESCRIBE_STYLE=contains &&
 		__git_ps1 >"$actual"
@@ -106,7 +106,7 @@ test_expect_success 'prompt - describe detached head - contains' '
 test_expect_success 'prompt - describe detached head - branch' '
 	printf " ((tags/t2~1))" >expected &&
 	git checkout b1^ &&
-	test_when_finished "git checkout master" &&
+	test_when_finished "git checkout main" &&
 	(
 		GIT_PS1_DESCRIBE_STYLE=branch &&
 		__git_ps1 >"$actual"
@@ -117,7 +117,7 @@ test_expect_success 'prompt - describe detached head - branch' '
 test_expect_success 'prompt - describe detached head - describe' '
 	printf " ((t1-1-g%s))" $(git log -1 --format="%h" b1^) >expected &&
 	git checkout b1^ &&
-	test_when_finished "git checkout master" &&
+	test_when_finished "git checkout main" &&
 	(
 		GIT_PS1_DESCRIBE_STYLE=describe &&
 		__git_ps1 >"$actual"
@@ -128,7 +128,7 @@ test_expect_success 'prompt - describe detached head - describe' '
 test_expect_success 'prompt - describe detached head - default' '
 	printf " ((t2))" >expected &&
 	git checkout --detach b1 &&
-	test_when_finished "git checkout master" &&
+	test_when_finished "git checkout main" &&
 	__git_ps1 >"$actual" &&
 	test_cmp expected "$actual"
 '
@@ -152,7 +152,7 @@ test_expect_success 'prompt - deep inside .git directory' '
 '
 
 test_expect_success 'prompt - inside bare repository' '
-	printf " (BARE:master)" >expected &&
+	printf " (BARE:main)" >expected &&
 	git init --bare bare.git &&
 	test_when_finished "rm -rf bare.git" &&
 	(
@@ -172,7 +172,7 @@ test_expect_success 'prompt - interactive rebase' '
 	test_when_finished "rm -f fake_editor.sh" &&
 	test_set_editor "$TRASH_DIRECTORY/fake_editor.sh" &&
 	git checkout b1 &&
-	test_when_finished "git checkout master" &&
+	test_when_finished "git checkout main" &&
 	git rebase -i HEAD^ &&
 	test_when_finished "git rebase --abort" &&
 	__git_ps1 >"$actual" &&
@@ -182,7 +182,7 @@ test_expect_success 'prompt - interactive rebase' '
 test_expect_success 'prompt - rebase merge' '
 	printf " (b2|REBASE 1/3)" >expected &&
 	git checkout b2 &&
-	test_when_finished "git checkout master" &&
+	test_when_finished "git checkout main" &&
 	test_must_fail git rebase --merge b1 b2 &&
 	test_when_finished "git rebase --abort" &&
 	__git_ps1 >"$actual" &&
@@ -192,7 +192,7 @@ test_expect_success 'prompt - rebase merge' '
 test_expect_success 'prompt - rebase am' '
 	printf " (b2|REBASE 1/3)" >expected &&
 	git checkout b2 &&
-	test_when_finished "git checkout master" &&
+	test_when_finished "git checkout main" &&
 	test_must_fail git rebase --apply b1 b2 &&
 	test_when_finished "git rebase --abort" &&
 	__git_ps1 >"$actual" &&
@@ -202,7 +202,7 @@ test_expect_success 'prompt - rebase am' '
 test_expect_success 'prompt - merge' '
 	printf " (b1|MERGING)" >expected &&
 	git checkout b1 &&
-	test_when_finished "git checkout master" &&
+	test_when_finished "git checkout main" &&
 	test_must_fail git merge b2 &&
 	test_when_finished "git reset --hard" &&
 	__git_ps1 >"$actual" &&
@@ -210,7 +210,7 @@ test_expect_success 'prompt - merge' '
 '
 
 test_expect_success 'prompt - cherry-pick' '
-	printf " (master|CHERRY-PICKING)" >expected &&
+	printf " (main|CHERRY-PICKING)" >expected &&
 	test_must_fail git cherry-pick b1 b1^ &&
 	test_when_finished "git cherry-pick --abort" &&
 	__git_ps1 >"$actual" &&
@@ -222,7 +222,7 @@ test_expect_success 'prompt - cherry-pick' '
 '
 
 test_expect_success 'prompt - revert' '
-	printf " (master|REVERTING)" >expected &&
+	printf " (main|REVERTING)" >expected &&
 	test_must_fail git revert b1^ b1 &&
 	test_when_finished "git revert --abort" &&
 	__git_ps1 >"$actual" &&
@@ -234,7 +234,7 @@ test_expect_success 'prompt - revert' '
 '
 
 test_expect_success 'prompt - bisect' '
-	printf " (master|BISECTING)" >expected &&
+	printf " (main|BISECTING)" >expected &&
 	git bisect start &&
 	test_when_finished "git bisect reset" &&
 	__git_ps1 >"$actual" &&
@@ -242,7 +242,7 @@ test_expect_success 'prompt - bisect' '
 '
 
 test_expect_success 'prompt - dirty status indicator - clean' '
-	printf " (master)" >expected &&
+	printf " (main)" >expected &&
 	(
 		GIT_PS1_SHOWDIRTYSTATE=y &&
 		__git_ps1 >"$actual"
@@ -251,7 +251,7 @@ test_expect_success 'prompt - dirty status indicator - clean' '
 '
 
 test_expect_success 'prompt - dirty status indicator - dirty worktree' '
-	printf " (master *)" >expected &&
+	printf " (main *)" >expected &&
 	echo "dirty" >file &&
 	test_when_finished "git reset --hard" &&
 	(
@@ -262,7 +262,7 @@ test_expect_success 'prompt - dirty status indicator - dirty worktree' '
 '
 
 test_expect_success 'prompt - dirty status indicator - dirty index' '
-	printf " (master +)" >expected &&
+	printf " (main +)" >expected &&
 	echo "dirty" >file &&
 	test_when_finished "git reset --hard" &&
 	git add -u &&
@@ -274,7 +274,7 @@ test_expect_success 'prompt - dirty status indicator - dirty index' '
 '
 
 test_expect_success 'prompt - dirty status indicator - dirty index and worktree' '
-	printf " (master *+)" >expected &&
+	printf " (main *+)" >expected &&
 	echo "dirty index" >file &&
 	test_when_finished "git reset --hard" &&
 	git add -u &&
@@ -288,7 +288,7 @@ test_expect_success 'prompt - dirty status indicator - dirty index and worktree'
 
 test_expect_success 'prompt - dirty status indicator - orphan branch - clean' '
 	printf " (orphan #)" >expected &&
-	test_when_finished "git checkout master" &&
+	test_when_finished "git checkout main" &&
 	git checkout --orphan orphan &&
 	git reset --hard &&
 	(
@@ -300,7 +300,7 @@ test_expect_success 'prompt - dirty status indicator - orphan branch - clean' '
 
 test_expect_success 'prompt - dirty status indicator - orphan branch - dirty index' '
 	printf " (orphan +)" >expected &&
-	test_when_finished "git checkout master" &&
+	test_when_finished "git checkout main" &&
 	git checkout --orphan orphan &&
 	(
 		GIT_PS1_SHOWDIRTYSTATE=y &&
@@ -311,7 +311,7 @@ test_expect_success 'prompt - dirty status indicator - orphan branch - dirty ind
 
 test_expect_success 'prompt - dirty status indicator - orphan branch - dirty index and worktree' '
 	printf " (orphan *+)" >expected &&
-	test_when_finished "git checkout master" &&
+	test_when_finished "git checkout main" &&
 	git checkout --orphan orphan &&
 	>file &&
 	(
@@ -322,7 +322,7 @@ test_expect_success 'prompt - dirty status indicator - orphan branch - dirty ind
 '
 
 test_expect_success 'prompt - dirty status indicator - shell variable unset with config disabled' '
-	printf " (master)" >expected &&
+	printf " (main)" >expected &&
 	echo "dirty" >file &&
 	test_when_finished "git reset --hard" &&
 	test_config bash.showDirtyState false &&
@@ -334,7 +334,7 @@ test_expect_success 'prompt - dirty status indicator - shell variable unset with
 '
 
 test_expect_success 'prompt - dirty status indicator - shell variable unset with config enabled' '
-	printf " (master)" >expected &&
+	printf " (main)" >expected &&
 	echo "dirty" >file &&
 	test_when_finished "git reset --hard" &&
 	test_config bash.showDirtyState true &&
@@ -346,7 +346,7 @@ test_expect_success 'prompt - dirty status indicator - shell variable unset with
 '
 
 test_expect_success 'prompt - dirty status indicator - shell variable set with config disabled' '
-	printf " (master)" >expected &&
+	printf " (main)" >expected &&
 	echo "dirty" >file &&
 	test_when_finished "git reset --hard" &&
 	test_config bash.showDirtyState false &&
@@ -358,7 +358,7 @@ test_expect_success 'prompt - dirty status indicator - shell variable set with c
 '
 
 test_expect_success 'prompt - dirty status indicator - shell variable set with config enabled' '
-	printf " (master *)" >expected &&
+	printf " (main *)" >expected &&
 	echo "dirty" >file &&
 	test_when_finished "git reset --hard" &&
 	test_config bash.showDirtyState true &&
@@ -382,7 +382,7 @@ test_expect_success 'prompt - dirty status indicator - not shown inside .git dir
 '
 
 test_expect_success 'prompt - stash status indicator - no stash' '
-	printf " (master)" >expected &&
+	printf " (main)" >expected &&
 	(
 		GIT_PS1_SHOWSTASHSTATE=y &&
 		__git_ps1 >"$actual"
@@ -391,7 +391,7 @@ test_expect_success 'prompt - stash status indicator - no stash' '
 '
 
 test_expect_success 'prompt - stash status indicator - stash' '
-	printf " (master $)" >expected &&
+	printf " (main $)" >expected &&
 	echo 2 >file &&
 	git stash &&
 	test_when_finished "git stash drop" &&
@@ -417,7 +417,7 @@ test_expect_success 'prompt - stash status indicator - not shown inside .git dir
 '
 
 test_expect_success 'prompt - untracked files status indicator - no untracked files' '
-	printf " (master)" >expected &&
+	printf " (main)" >expected &&
 	(
 		GIT_PS1_SHOWUNTRACKEDFILES=y &&
 		cd otherrepo &&
@@ -427,7 +427,7 @@ test_expect_success 'prompt - untracked files status indicator - no untracked fi
 '
 
 test_expect_success 'prompt - untracked files status indicator - untracked files' '
-	printf " (master %%)" >expected &&
+	printf " (main %%)" >expected &&
 	(
 		GIT_PS1_SHOWUNTRACKEDFILES=y &&
 		__git_ps1 >"$actual"
@@ -436,7 +436,7 @@ test_expect_success 'prompt - untracked files status indicator - untracked files
 '
 
 test_expect_success 'prompt - untracked files status indicator - empty untracked dir' '
-	printf " (master)" >expected &&
+	printf " (main)" >expected &&
 	mkdir otherrepo/untracked-dir &&
 	test_when_finished "rm -rf otherrepo/untracked-dir" &&
 	(
@@ -448,7 +448,7 @@ test_expect_success 'prompt - untracked files status indicator - empty untracked
 '
 
 test_expect_success 'prompt - untracked files status indicator - non-empty untracked dir' '
-	printf " (master %%)" >expected &&
+	printf " (main %%)" >expected &&
 	mkdir otherrepo/untracked-dir &&
 	test_when_finished "rm -rf otherrepo/untracked-dir" &&
 	>otherrepo/untracked-dir/untracked-file &&
@@ -461,7 +461,7 @@ test_expect_success 'prompt - untracked files status indicator - non-empty untra
 '
 
 test_expect_success 'prompt - untracked files status indicator - untracked files outside cwd' '
-	printf " (master %%)" >expected &&
+	printf " (main %%)" >expected &&
 	(
 		mkdir -p ignored_dir &&
 		cd ignored_dir &&
@@ -472,7 +472,7 @@ test_expect_success 'prompt - untracked files status indicator - untracked files
 '
 
 test_expect_success 'prompt - untracked files status indicator - shell variable unset with config disabled' '
-	printf " (master)" >expected &&
+	printf " (main)" >expected &&
 	test_config bash.showUntrackedFiles false &&
 	(
 		sane_unset GIT_PS1_SHOWUNTRACKEDFILES &&
@@ -482,7 +482,7 @@ test_expect_success 'prompt - untracked files status indicator - shell variable
 '
 
 test_expect_success 'prompt - untracked files status indicator - shell variable unset with config enabled' '
-	printf " (master)" >expected &&
+	printf " (main)" >expected &&
 	test_config bash.showUntrackedFiles true &&
 	(
 		sane_unset GIT_PS1_SHOWUNTRACKEDFILES &&
@@ -492,7 +492,7 @@ test_expect_success 'prompt - untracked files status indicator - shell variable
 '
 
 test_expect_success 'prompt - untracked files status indicator - shell variable set with config disabled' '
-	printf " (master)" >expected &&
+	printf " (main)" >expected &&
 	test_config bash.showUntrackedFiles false &&
 	(
 		GIT_PS1_SHOWUNTRACKEDFILES=y &&
@@ -502,7 +502,7 @@ test_expect_success 'prompt - untracked files status indicator - shell variable
 '
 
 test_expect_success 'prompt - untracked files status indicator - shell variable set with config enabled' '
-	printf " (master %%)" >expected &&
+	printf " (main %%)" >expected &&
 	test_config bash.showUntrackedFiles true &&
 	(
 		GIT_PS1_SHOWUNTRACKEDFILES=y &&
@@ -522,13 +522,13 @@ test_expect_success 'prompt - untracked files status indicator - not shown insid
 '
 
 test_expect_success 'prompt - format string starting with dash' '
-	printf -- "-master" >expected &&
+	printf -- "-main" >expected &&
 	__git_ps1 "-%s" >"$actual" &&
 	test_cmp expected "$actual"
 '
 
 test_expect_success 'prompt - pc mode' '
-	printf "BEFORE: (\${__git_ps1_branch_name}):AFTER\\nmaster" >expected &&
+	printf "BEFORE: (\${__git_ps1_branch_name}):AFTER\\nmain" >expected &&
 	(
 		__git_ps1 "BEFORE:" ":AFTER" >"$actual" &&
 		test_must_be_empty "$actual" &&
@@ -538,7 +538,7 @@ test_expect_success 'prompt - pc mode' '
 '
 
 test_expect_success 'prompt - bash color pc mode - branch name' '
-	printf "BEFORE: (${c_green}\${__git_ps1_branch_name}${c_clear}):AFTER\\nmaster" >expected &&
+	printf "BEFORE: (${c_green}\${__git_ps1_branch_name}${c_clear}):AFTER\\nmain" >expected &&
 	(
 		GIT_PS1_SHOWCOLORHINTS=y &&
 		__git_ps1 "BEFORE:" ":AFTER" >"$actual" &&
@@ -550,7 +550,7 @@ test_expect_success 'prompt - bash color pc mode - branch name' '
 test_expect_success 'prompt - bash color pc mode - detached head' '
 	printf "BEFORE: (${c_red}\${__git_ps1_branch_name}${c_clear}):AFTER\\n(%s...)" $(git log -1 --format="%h" b1^) >expected &&
 	git checkout b1^ &&
-	test_when_finished "git checkout master" &&
+	test_when_finished "git checkout main" &&
 	(
 		GIT_PS1_SHOWCOLORHINTS=y &&
 		__git_ps1 "BEFORE:" ":AFTER" &&
@@ -560,7 +560,7 @@ test_expect_success 'prompt - bash color pc mode - detached head' '
 '
 
 test_expect_success 'prompt - bash color pc mode - dirty status indicator - dirty worktree' '
-	printf "BEFORE: (${c_green}\${__git_ps1_branch_name}${c_clear} ${c_red}*${c_clear}):AFTER\\nmaster" >expected &&
+	printf "BEFORE: (${c_green}\${__git_ps1_branch_name}${c_clear} ${c_red}*${c_clear}):AFTER\\nmain" >expected &&
 	echo "dirty" >file &&
 	test_when_finished "git reset --hard" &&
 	(
@@ -573,7 +573,7 @@ test_expect_success 'prompt - bash color pc mode - dirty status indicator - dirt
 '
 
 test_expect_success 'prompt - bash color pc mode - dirty status indicator - dirty index' '
-	printf "BEFORE: (${c_green}\${__git_ps1_branch_name}${c_clear} ${c_green}+${c_clear}):AFTER\\nmaster" >expected &&
+	printf "BEFORE: (${c_green}\${__git_ps1_branch_name}${c_clear} ${c_green}+${c_clear}):AFTER\\nmain" >expected &&
 	echo "dirty" >file &&
 	test_when_finished "git reset --hard" &&
 	git add -u &&
@@ -587,7 +587,7 @@ test_expect_success 'prompt - bash color pc mode - dirty status indicator - dirt
 '
 
 test_expect_success 'prompt - bash color pc mode - dirty status indicator - dirty index and worktree' '
-	printf "BEFORE: (${c_green}\${__git_ps1_branch_name}${c_clear} ${c_red}*${c_green}+${c_clear}):AFTER\\nmaster" >expected &&
+	printf "BEFORE: (${c_green}\${__git_ps1_branch_name}${c_clear} ${c_red}*${c_green}+${c_clear}):AFTER\\nmain" >expected &&
 	echo "dirty index" >file &&
 	test_when_finished "git reset --hard" &&
 	git add -u &&
@@ -602,7 +602,7 @@ test_expect_success 'prompt - bash color pc mode - dirty status indicator - dirt
 '
 
 test_expect_success 'prompt - bash color pc mode - dirty status indicator - before root commit' '
-	printf "BEFORE: (${c_green}\${__git_ps1_branch_name}${c_clear} ${c_green}#${c_clear}):AFTER\\nmaster" >expected &&
+	printf "BEFORE: (${c_green}\${__git_ps1_branch_name}${c_clear} ${c_green}#${c_clear}):AFTER\\nmain" >expected &&
 	(
 		GIT_PS1_SHOWDIRTYSTATE=y &&
 		GIT_PS1_SHOWCOLORHINTS=y &&
@@ -628,7 +628,7 @@ test_expect_success 'prompt - bash color pc mode - inside .git directory' '
 '
 
 test_expect_success 'prompt - bash color pc mode - stash status indicator' '
-	printf "BEFORE: (${c_green}\${__git_ps1_branch_name}${c_clear} ${c_lblue}\$${c_clear}):AFTER\\nmaster" >expected &&
+	printf "BEFORE: (${c_green}\${__git_ps1_branch_name}${c_clear} ${c_lblue}\$${c_clear}):AFTER\\nmain" >expected &&
 	echo 2 >file &&
 	git stash &&
 	test_when_finished "git stash drop" &&
@@ -642,7 +642,7 @@ test_expect_success 'prompt - bash color pc mode - stash status indicator' '
 '
 
 test_expect_success 'prompt - bash color pc mode - untracked files status indicator' '
-	printf "BEFORE: (${c_green}\${__git_ps1_branch_name}${c_clear} ${c_red}%%${c_clear}):AFTER\\nmaster" >expected &&
+	printf "BEFORE: (${c_green}\${__git_ps1_branch_name}${c_clear} ${c_red}%%${c_clear}):AFTER\\nmain" >expected &&
 	(
 		GIT_PS1_SHOWUNTRACKEDFILES=y &&
 		GIT_PS1_SHOWCOLORHINTS=y &&
@@ -653,7 +653,7 @@ test_expect_success 'prompt - bash color pc mode - untracked files status indica
 '
 
 test_expect_success 'prompt - zsh color pc mode' '
-	printf "BEFORE: (%%F{green}master%%f):AFTER" >expected &&
+	printf "BEFORE: (%%F{green}main%%f):AFTER" >expected &&
 	(
 		ZSH_VERSION=5.0.0 &&
 		GIT_PS1_SHOWCOLORHINTS=y &&
@@ -664,7 +664,7 @@ test_expect_success 'prompt - zsh color pc mode' '
 '
 
 test_expect_success 'prompt - hide if pwd ignored - env var unset, config disabled' '
-	printf " (master)" >expected &&
+	printf " (main)" >expected &&
 	test_config bash.hideIfPwdIgnored false &&
 	(
 		cd ignored_dir &&
@@ -685,7 +685,7 @@ test_expect_success 'prompt - hide if pwd ignored - env var unset, config disabl
 '
 
 test_expect_success 'prompt - hide if pwd ignored - env var unset, config unset' '
-	printf " (master)" >expected &&
+	printf " (main)" >expected &&
 	(
 		cd ignored_dir &&
 		__git_ps1 >"$actual"
@@ -704,7 +704,7 @@ test_expect_success 'prompt - hide if pwd ignored - env var unset, config unset,
 '
 
 test_expect_success 'prompt - hide if pwd ignored - env var set, config disabled' '
-	printf " (master)" >expected &&
+	printf " (main)" >expected &&
 	test_config bash.hideIfPwdIgnored false &&
 	(
 		cd ignored_dir &&
diff --git a/t/test-lib.sh b/t/test-lib.sh
index 173880196e..cbd5ca7944 100644
--- a/t/test-lib.sh
+++ b/t/test-lib.sh
@@ -257,13 +257,13 @@ case "$TRASH_DIRECTORY" in
 esac
 
 case "$TEST_NUMBER" in
-3404|4013|5310|6300|7064|7817)
+3404|4013|5310|6300|7064|7817|9902)
 	# Avoid conflicts with patch series that are cooking at the same time
 	# as the patch series changing the default of `init.defaultBranch`.
 	GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
 	export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 	;;
-[0-8]*|9[0-8]*)
+*)
 	GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 	export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 	;;
-- 
gitgitgadget


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH 27/28] tests: drop prereq `PREPARE_FOR_MAIN_BRANCH` where no longer needed
  2020-11-12 22:43 [PATCH 00/28] Use main as default branch name Johannes Schindelin via GitGitGadget
                   ` (25 preceding siblings ...)
  2020-11-12 22:43 ` [PATCH 26/28] t99*: adjust the references to the default branch name "main" Johannes Schindelin via GitGitGadget
@ 2020-11-12 22:43 ` Johannes Schindelin via GitGitGadget
  2020-11-12 22:43 ` [PATCH 28/28] Change the default branch name to `main` Don Goodman-Wilson via GitGitGadget
                   ` (5 subsequent siblings)
  32 siblings, 0 replies; 163+ messages in thread
From: Johannes Schindelin via GitGitGadget @ 2020-11-12 22:43 UTC (permalink / raw)
  To: git; +Cc: Johannes Schindelin, Johannes Schindelin

From: Johannes Schindelin <johannes.schindelin@gmx.de>

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 exception is t9902: at the time of writing, there
are other patches in flight that touch this test script, therefore the
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/t9902\*

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
---
 t/t1400-update-ref.sh              |  4 +--
 t/t3200-branch.sh                  |  6 ++---
 t/t3201-branch-contains.sh         |  2 +-
 t/t3203-branch-output.sh           |  2 +-
 t/t3205-branch-color.sh            |  2 +-
 t/t5505-remote.sh                  |  8 +++---
 t/t5510-fetch.sh                   |  4 +--
 t/t5526-fetch-submodules.sh        | 42 +++++++++++++++---------------
 t/t5703-upload-pack-ref-in-want.sh |  2 +-
 t/t6302-for-each-ref-filter.sh     | 12 ++++-----
 10 files changed, 42 insertions(+), 42 deletions(-)

diff --git a/t/t1400-update-ref.sh b/t/t1400-update-ref.sh
index 3265a8c58e..127efff136 100755
--- a/t/t1400-update-ref.sh
+++ b/t/t1400-update-ref.sh
@@ -585,7 +585,7 @@ test_expect_success 'stdin fails on unbalanced quotes' '
 	grep "fatal: badly quoted argument: \\\"main" err
 '
 
-test_expect_success PREPARE_FOR_MAIN_BRANCH 'stdin fails on invalid escape' '
+test_expect_success 'stdin fails on invalid escape' '
 	echo "create $a \"ma\zn\"" >stdin &&
 	test_must_fail git update-ref --stdin <stdin 2>err &&
 	grep "fatal: badly quoted argument: \\\"ma\\\\zn\\\"" err
@@ -704,7 +704,7 @@ test_expect_success 'stdin succeeds with quoted argument' '
 	test_cmp expect actual
 '
 
-test_expect_success PREPARE_FOR_MAIN_BRANCH 'stdin succeeds with escaped character' '
+test_expect_success 'stdin succeeds with escaped character' '
 	git update-ref -d $a &&
 	echo "create $a \"ma\\151n\"" >stdin &&
 	git update-ref --stdin <stdin &&
diff --git a/t/t3200-branch.sh b/t/t3200-branch.sh
index 63036e0369..430f5af21b 100755
--- a/t/t3200-branch.sh
+++ b/t/t3200-branch.sh
@@ -321,7 +321,7 @@ test_expect_success 'git branch --list -v with --abbrev' '
 
 '
 
-test_expect_success PREPARE_FOR_MAIN_BRANCH 'git branch --column' '
+test_expect_success 'git branch --column' '
 	COLUMNS=81 git branch --column=column >actual &&
 	cat >expect <<\EOF &&
   a/b/c   bam     foo     l     * main    n       o/p     r
@@ -358,7 +358,7 @@ EOF
 	test_cmp expect actual
 '
 
-test_expect_success PREPARE_FOR_MAIN_BRANCH 'git branch with column.*' '
+test_expect_success 'git branch with column.*' '
 	git config column.ui column &&
 	git config column.branch "dense" &&
 	COLUMNS=80 git branch >actual &&
@@ -375,7 +375,7 @@ test_expect_success 'git branch --column -v should fail' '
 	test_must_fail git branch --column -v
 '
 
-test_expect_success PREPARE_FOR_MAIN_BRANCH 'git branch -v with column.ui ignored' '
+test_expect_success 'git branch -v with column.ui ignored' '
 	git config column.ui column &&
 	COLUMNS=80 git branch -v | cut -c -8 | sed "s/ *$//" >actual &&
 	git config --unset column.ui &&
diff --git a/t/t3201-branch-contains.sh b/t/t3201-branch-contains.sh
index 110cfef820..f39ae97264 100755
--- a/t/t3201-branch-contains.sh
+++ b/t/t3201-branch-contains.sh
@@ -242,7 +242,7 @@ test_expect_success 'branch --merged combined with --no-merged' '
 # Here "topic" tracks "main" with one extra commit, and "zzz" points to the
 # same tip as main The name "zzz" must come alphabetically after "topic"
 # as we process them in that order.
-test_expect_success PREPARE_FOR_MAIN_BRANCH 'branch --merged with --verbose' '
+test_expect_success 'branch --merged with --verbose' '
 	git branch --track topic main &&
 	git branch zzz topic &&
 	git checkout topic &&
diff --git a/t/t3203-branch-output.sh b/t/t3203-branch-output.sh
index 727c9d9caa..211eb8357f 100755
--- a/t/t3203-branch-output.sh
+++ b/t/t3203-branch-output.sh
@@ -329,7 +329,7 @@ test_expect_success '--color overrides auto-color' '
 	test_cmp expect.color actual
 '
 
-test_expect_success PREPARE_FOR_MAIN_BRANCH 'verbose output lists worktree path' '
+test_expect_success 'verbose output lists worktree path' '
 	one=$(git rev-parse --short HEAD) &&
 	two=$(git rev-parse --short main) &&
 	cat >expect <<-EOF &&
diff --git a/t/t3205-branch-color.sh b/t/t3205-branch-color.sh
index 9f2fb785d2..2eb619231d 100755
--- a/t/t3205-branch-color.sh
+++ b/t/t3205-branch-color.sh
@@ -28,7 +28,7 @@ test_expect_success 'regular output shows colors' '
 	test_cmp expect actual
 '
 
-test_expect_success PREPARE_FOR_MAIN_BRANCH 'verbose output shows colors' '
+test_expect_success 'verbose output shows colors' '
 	oid=$(git rev-parse --short HEAD) &&
 	cat >expect <<-EOF &&
 	* <CYAN>main               <RESET> $oid foo
diff --git a/t/t5505-remote.sh b/t/t5505-remote.sh
index 540d65aa22..869109a2c6 100755
--- a/t/t5505-remote.sh
+++ b/t/t5505-remote.sh
@@ -234,7 +234,7 @@ cat >test/expect <<EOF
     main  pushes to another (up to date)
 EOF
 
-test_expect_success PREPARE_FOR_MAIN_BRANCH 'show' '
+test_expect_success 'show' '
 	(
 		cd test &&
 		git config --add remote.origin.fetch refs/heads/main:refs/heads/upstream &&
@@ -285,7 +285,7 @@ cat >test/expect <<EOF
     refs/tags/lastbackup forces to refs/tags/lastbackup
 EOF
 
-test_expect_success PREPARE_FOR_MAIN_BRANCH 'show -n' '
+test_expect_success 'show -n' '
 	mv one one.unreachable &&
 	(
 		cd test &&
@@ -328,7 +328,7 @@ test_expect_success 'set-head --auto' '
 	)
 '
 
-test_expect_success PREPARE_FOR_MAIN_BRANCH 'set-head --auto has no problem w/multiple HEADs' '
+test_expect_success 'set-head --auto has no problem w/multiple HEADs' '
 	(
 		cd test &&
 		git fetch two "refs/heads/*:refs/remotes/two/*" &&
@@ -1348,7 +1348,7 @@ test_expect_success 'unqualified <dst> refspec DWIM and advice' '
 	)
 '
 
-test_expect_success PREPARE_FOR_MAIN_BRANCH 'refs/remotes/* <src> refspec and unqualified <dst> DWIM and advice' '
+test_expect_success 'refs/remotes/* <src> refspec and unqualified <dst> DWIM and advice' '
 	(
 		cd two &&
 		git tag -a -m "Some tag" my-tag main &&
diff --git a/t/t5510-fetch.sh b/t/t5510-fetch.sh
index 206e3be695..f8bcaeca08 100755
--- a/t/t5510-fetch.sh
+++ b/t/t5510-fetch.sh
@@ -942,7 +942,7 @@ test_expect_success 'fetching with auto-gc does not lock up' '
 	)
 '
 
-test_expect_success PREPARE_FOR_MAIN_BRANCH,C_LOCALE_OUTPUT 'fetch aligned output' '
+test_expect_success C_LOCALE_OUTPUT 'fetch aligned output' '
 	git clone . full-output &&
 	test_commit looooooooooooong-tag &&
 	(
@@ -957,7 +957,7 @@ test_expect_success PREPARE_FOR_MAIN_BRANCH,C_LOCALE_OUTPUT 'fetch aligned outpu
 	test_cmp expect actual
 '
 
-test_expect_success PREPARE_FOR_MAIN_BRANCH,C_LOCALE_OUTPUT 'fetch compact output' '
+test_expect_success C_LOCALE_OUTPUT 'fetch compact output' '
 	git clone . compact &&
 	test_commit extraaa &&
 	(
diff --git a/t/t5526-fetch-submodules.sh b/t/t5526-fetch-submodules.sh
index f45ba02b8a..356ce31d48 100755
--- a/t/t5526-fetch-submodules.sh
+++ b/t/t5526-fetch-submodules.sh
@@ -61,7 +61,7 @@ test_expect_success setup '
 	)
 '
 
-test_expect_success PREPARE_FOR_MAIN_BRANCH "fetch --recurse-submodules recurses into submodules" '
+test_expect_success "fetch --recurse-submodules recurses into submodules" '
 	add_upstream_commit &&
 	(
 		cd downstream &&
@@ -71,7 +71,7 @@ test_expect_success PREPARE_FOR_MAIN_BRANCH "fetch --recurse-submodules recurses
 	test_i18ncmp expect.err actual.err
 '
 
-test_expect_success PREPARE_FOR_MAIN_BRANCH "submodule.recurse option triggers recursive fetch" '
+test_expect_success "submodule.recurse option triggers recursive fetch" '
 	add_upstream_commit &&
 	(
 		cd downstream &&
@@ -81,7 +81,7 @@ test_expect_success PREPARE_FOR_MAIN_BRANCH "submodule.recurse option triggers r
 	test_i18ncmp expect.err actual.err
 '
 
-test_expect_success PREPARE_FOR_MAIN_BRANCH "fetch --recurse-submodules -j2 has the same output behaviour" '
+test_expect_success "fetch --recurse-submodules -j2 has the same output behaviour" '
 	add_upstream_commit &&
 	(
 		cd downstream &&
@@ -111,7 +111,7 @@ test_expect_success "fetch --no-recurse-submodules only fetches superproject" '
 	test_must_be_empty actual.err
 '
 
-test_expect_success PREPARE_FOR_MAIN_BRANCH "using fetchRecurseSubmodules=true in .gitmodules recurses into submodules" '
+test_expect_success "using fetchRecurseSubmodules=true in .gitmodules recurses into submodules" '
 	(
 		cd downstream &&
 		git config -f .gitmodules submodule.submodule.fetchRecurseSubmodules true &&
@@ -141,7 +141,7 @@ test_expect_success "using fetchRecurseSubmodules=false in .git/config overrides
 	test_must_be_empty actual.err
 '
 
-test_expect_success PREPARE_FOR_MAIN_BRANCH "--recurse-submodules overrides fetchRecurseSubmodules setting from .git/config" '
+test_expect_success "--recurse-submodules overrides fetchRecurseSubmodules setting from .git/config" '
 	(
 		cd downstream &&
 		git fetch --recurse-submodules >../actual.out 2>../actual.err &&
@@ -170,7 +170,7 @@ test_expect_success "--quiet propagates to parallel submodules" '
 	test_must_be_empty actual.err
 '
 
-test_expect_success PREPARE_FOR_MAIN_BRANCH "--dry-run propagates to submodules" '
+test_expect_success "--dry-run propagates to submodules" '
 	add_upstream_commit &&
 	(
 		cd downstream &&
@@ -180,7 +180,7 @@ test_expect_success PREPARE_FOR_MAIN_BRANCH "--dry-run propagates to submodules"
 	test_i18ncmp expect.err actual.err
 '
 
-test_expect_success PREPARE_FOR_MAIN_BRANCH "Without --dry-run propagates to submodules" '
+test_expect_success "Without --dry-run propagates to submodules" '
 	(
 		cd downstream &&
 		git fetch --recurse-submodules >../actual.out 2>../actual.err
@@ -189,7 +189,7 @@ test_expect_success PREPARE_FOR_MAIN_BRANCH "Without --dry-run propagates to sub
 	test_i18ncmp expect.err actual.err
 '
 
-test_expect_success PREPARE_FOR_MAIN_BRANCH "recurseSubmodules=true propagates into submodules" '
+test_expect_success "recurseSubmodules=true propagates into submodules" '
 	add_upstream_commit &&
 	(
 		cd downstream &&
@@ -200,7 +200,7 @@ test_expect_success PREPARE_FOR_MAIN_BRANCH "recurseSubmodules=true propagates i
 	test_i18ncmp expect.err actual.err
 '
 
-test_expect_success PREPARE_FOR_MAIN_BRANCH "--recurse-submodules overrides config in submodule" '
+test_expect_success "--recurse-submodules overrides config in submodule" '
 	add_upstream_commit &&
 	(
 		cd downstream &&
@@ -225,7 +225,7 @@ test_expect_success "--no-recurse-submodules overrides config setting" '
 	test_must_be_empty actual.err
 '
 
-test_expect_success PREPARE_FOR_MAIN_BRANCH "Recursion doesn't happen when no new commits are fetched in the superproject" '
+test_expect_success "Recursion doesn't happen when no new commits are fetched in the superproject" '
 	(
 		cd downstream &&
 		(
@@ -239,7 +239,7 @@ test_expect_success PREPARE_FOR_MAIN_BRANCH "Recursion doesn't happen when no ne
 	test_must_be_empty actual.err
 '
 
-test_expect_success PREPARE_FOR_MAIN_BRANCH "Recursion stops when no new submodule commits are fetched" '
+test_expect_success "Recursion stops when no new submodule commits are fetched" '
 	head1=$(git rev-parse --short HEAD) &&
 	git add submodule &&
 	git commit -m "new submodule" &&
@@ -255,7 +255,7 @@ test_expect_success PREPARE_FOR_MAIN_BRANCH "Recursion stops when no new submodu
 	test_must_be_empty actual.out
 '
 
-test_expect_success PREPARE_FOR_MAIN_BRANCH "Recursion doesn't happen when new superproject commits don't change any submodules" '
+test_expect_success "Recursion doesn't happen when new superproject commits don't change any submodules" '
 	add_upstream_commit &&
 	head1=$(git rev-parse --short HEAD) &&
 	echo a > file &&
@@ -272,7 +272,7 @@ test_expect_success PREPARE_FOR_MAIN_BRANCH "Recursion doesn't happen when new s
 	test_i18ncmp expect.err.file actual.err
 '
 
-test_expect_success PREPARE_FOR_MAIN_BRANCH "Recursion picks up config in submodule" '
+test_expect_success "Recursion picks up config in submodule" '
 	(
 		cd downstream &&
 		git fetch --recurse-submodules &&
@@ -301,7 +301,7 @@ test_expect_success PREPARE_FOR_MAIN_BRANCH "Recursion picks up config in submod
 	test_must_be_empty actual.out
 '
 
-test_expect_success PREPARE_FOR_MAIN_BRANCH "Recursion picks up all submodules when necessary" '
+test_expect_success "Recursion picks up all submodules when necessary" '
 	add_upstream_commit &&
 	(
 		cd submodule &&
@@ -334,7 +334,7 @@ test_expect_success PREPARE_FOR_MAIN_BRANCH "Recursion picks up all submodules w
 	test_must_be_empty actual.out
 '
 
-test_expect_success PREPARE_FOR_MAIN_BRANCH "'--recurse-submodules=on-demand' doesn't recurse when no new commits are fetched in the superproject (and ignores config)" '
+test_expect_success "'--recurse-submodules=on-demand' doesn't recurse when no new commits are fetched in the superproject (and ignores config)" '
 	add_upstream_commit &&
 	(
 		cd submodule &&
@@ -361,7 +361,7 @@ test_expect_success PREPARE_FOR_MAIN_BRANCH "'--recurse-submodules=on-demand' do
 	test_must_be_empty actual.err
 '
 
-test_expect_success PREPARE_FOR_MAIN_BRANCH "'--recurse-submodules=on-demand' recurses as deep as necessary (and ignores config)" '
+test_expect_success "'--recurse-submodules=on-demand' recurses as deep as necessary (and ignores config)" '
 	head1=$(git rev-parse --short HEAD) &&
 	git add submodule &&
 	git commit -m "new submodule" &&
@@ -389,7 +389,7 @@ test_expect_success PREPARE_FOR_MAIN_BRANCH "'--recurse-submodules=on-demand' re
 	test_i18ncmp expect.err actual.err
 '
 
-test_expect_success PREPARE_FOR_MAIN_BRANCH "'--recurse-submodules=on-demand' stops when no new submodule commits are found in the superproject (and ignores config)" '
+test_expect_success "'--recurse-submodules=on-demand' stops when no new submodule commits are found in the superproject (and ignores config)" '
 	add_upstream_commit &&
 	head1=$(git rev-parse --short HEAD) &&
 	echo a >> file &&
@@ -406,7 +406,7 @@ test_expect_success PREPARE_FOR_MAIN_BRANCH "'--recurse-submodules=on-demand' st
 	test_i18ncmp expect.err.file actual.err
 '
 
-test_expect_success PREPARE_FOR_MAIN_BRANCH "'fetch.recurseSubmodules=on-demand' overrides global config" '
+test_expect_success "'fetch.recurseSubmodules=on-demand' overrides global config" '
 	(
 		cd downstream &&
 		git fetch --recurse-submodules
@@ -434,7 +434,7 @@ test_expect_success PREPARE_FOR_MAIN_BRANCH "'fetch.recurseSubmodules=on-demand'
 	test_i18ncmp expect.err.2 actual.err
 '
 
-test_expect_success PREPARE_FOR_MAIN_BRANCH "'submodule.<sub>.fetchRecurseSubmodules=on-demand' overrides fetch.recurseSubmodules" '
+test_expect_success "'submodule.<sub>.fetchRecurseSubmodules=on-demand' overrides fetch.recurseSubmodules" '
 	(
 		cd downstream &&
 		git fetch --recurse-submodules
@@ -462,7 +462,7 @@ test_expect_success PREPARE_FOR_MAIN_BRANCH "'submodule.<sub>.fetchRecurseSubmod
 	test_i18ncmp expect.err.2 actual.err
 '
 
-test_expect_success PREPARE_FOR_MAIN_BRANCH "don't fetch submodule when newly recorded commits are already present" '
+test_expect_success "don't fetch submodule when newly recorded commits are already present" '
 	(
 		cd submodule &&
 		git checkout -q HEAD^^
@@ -485,7 +485,7 @@ test_expect_success PREPARE_FOR_MAIN_BRANCH "don't fetch submodule when newly re
 	)
 '
 
-test_expect_success PREPARE_FOR_MAIN_BRANCH "'fetch.recurseSubmodules=on-demand' works also without .gitmodules entry" '
+test_expect_success "'fetch.recurseSubmodules=on-demand' works also without .gitmodules entry" '
 	(
 		cd downstream &&
 		git fetch --recurse-submodules
diff --git a/t/t5703-upload-pack-ref-in-want.sh b/t/t5703-upload-pack-ref-in-want.sh
index bbf03a8f66..fe89ea55b1 100755
--- a/t/t5703-upload-pack-ref-in-want.sh
+++ b/t/t5703-upload-pack-ref-in-want.sh
@@ -383,7 +383,7 @@ test_expect_success 'server is initially behind - ref in want' '
 	test_cmp expected actual
 '
 
-test_expect_success PREPARE_FOR_MAIN_BRANCH 'server loses a ref - ref in want' '
+test_expect_success 'server loses a ref - ref in want' '
 	git -C "$REPO" config uploadpack.allowRefInWant true &&
 	rm -rf local &&
 	cp -r "$LOCAL_PRISTINE" local &&
diff --git a/t/t6302-for-each-ref-filter.sh b/t/t6302-for-each-ref-filter.sh
index f5a55c1991..7a45bbf048 100755
--- a/t/t6302-for-each-ref-filter.sh
+++ b/t/t6302-for-each-ref-filter.sh
@@ -113,7 +113,7 @@ test_expect_success '%(color) must fail' '
 	test_must_fail git for-each-ref --format="%(color)%(refname)"
 '
 
-test_expect_success PREPARE_FOR_MAIN_BRANCH 'left alignment is default' '
+test_expect_success 'left alignment is default' '
 	cat >expect <<-\EOF &&
 	refname is refs/heads/main    |refs/heads/main
 	refname is refs/heads/side    |refs/heads/side
@@ -131,7 +131,7 @@ test_expect_success PREPARE_FOR_MAIN_BRANCH 'left alignment is default' '
 	test_cmp expect actual
 '
 
-test_expect_success PREPARE_FOR_MAIN_BRANCH 'middle alignment' '
+test_expect_success 'middle alignment' '
 	cat >expect <<-\EOF &&
 	|  refname is refs/heads/main  |refs/heads/main
 	|  refname is refs/heads/side  |refs/heads/side
@@ -149,7 +149,7 @@ test_expect_success PREPARE_FOR_MAIN_BRANCH 'middle alignment' '
 	test_cmp expect actual
 '
 
-test_expect_success PREPARE_FOR_MAIN_BRANCH 'right alignment' '
+test_expect_success 'right alignment' '
 	cat >expect <<-\EOF &&
 	|    refname is refs/heads/main|refs/heads/main
 	|    refname is refs/heads/side|refs/heads/side
@@ -184,7 +184,7 @@ EOF
 test_align_permutations() {
 	while read -r option
 	do
-		test_expect_success PREPARE_FOR_MAIN_BRANCH "align:$option" '
+		test_expect_success "align:$option" '
 			git for-each-ref --format="|%(align:$option)refname is %(refname)%(end)|%(refname)" >actual &&
 			test_cmp expect actual
 		'
@@ -213,7 +213,7 @@ EOF
 
 # Individual atoms inside %(align:...) and %(end) must not be quoted.
 
-test_expect_success PREPARE_FOR_MAIN_BRANCH 'alignment with format quote' "
+test_expect_success 'alignment with format quote' "
 	cat >expect <<-\EOF &&
 	|'       '\''main| A U Thor'\''       '|
 	|'       '\''side| A U Thor'\''       '|
@@ -231,7 +231,7 @@ test_expect_success PREPARE_FOR_MAIN_BRANCH 'alignment with format quote' "
 	test_cmp expect actual
 "
 
-test_expect_success PREPARE_FOR_MAIN_BRANCH 'nested alignment with quote formatting' "
+test_expect_success 'nested alignment with quote formatting' "
 	cat >expect <<-\EOF &&
 	|'           main               '|
 	|'           side               '|
-- 
gitgitgadget


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH 28/28] Change the default branch name to `main`
  2020-11-12 22:43 [PATCH 00/28] Use main as default branch name Johannes Schindelin via GitGitGadget
                   ` (26 preceding siblings ...)
  2020-11-12 22:43 ` [PATCH 27/28] tests: drop prereq `PREPARE_FOR_MAIN_BRANCH` where no longer needed Johannes Schindelin via GitGitGadget
@ 2020-11-12 22:43 ` Don Goodman-Wilson via GitGitGadget
  2020-11-13  9:57   ` Ævar Arnfjörð Bjarmason
  2020-11-13  0:11 ` [PATCH 00/28] Use main as default branch name Felipe Contreras
                   ` (4 subsequent siblings)
  32 siblings, 1 reply; 163+ messages in thread
From: Don Goodman-Wilson via GitGitGadget @ 2020-11-12 22:43 UTC (permalink / raw)
  To: git; +Cc: Johannes Schindelin, Don Goodman-Wilson

From: Don Goodman-Wilson <don@goodman-wilson.com>

The current default name for the initial branch is a loaded term, and
many Open Source projects renamed their principal branches already. A
common choice appears to be `main`.

Let's follow their lead and change the default of `init.defaultBranch`.

Co-authored-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Don Goodman-Wilson <don@goodman-wilson.com>
---
 refs.c                    | 2 +-
 t/lib-submodule-update.sh | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/refs.c b/refs.c
index 392f0bbf68..5576a90573 100644
--- a/refs.c
+++ b/refs.c
@@ -575,7 +575,7 @@ char *repo_default_branch_name(struct repository *r)
 		die(_("could not retrieve `%s`"), config_display_key);
 
 	if (!ret)
-		ret = xstrdup("master");
+		ret = xstrdup("main");
 
 	full_ref = xstrfmt("refs/heads/%s", ret);
 	if (check_refname_format(full_ref, 0))
diff --git a/t/lib-submodule-update.sh b/t/lib-submodule-update.sh
index bd3fa3c6da..1b0abcb0f8 100644
--- a/t/lib-submodule-update.sh
+++ b/t/lib-submodule-update.sh
@@ -144,7 +144,7 @@ create_lib_submodule_repo () {
 		git checkout -b valid_sub1 &&
 		git revert HEAD &&
 
-		git checkout "${GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME-master}"
+		git checkout "${GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME-main}"
 	)
 }
 
-- 
gitgitgadget

^ permalink raw reply related	[flat|nested] 163+ messages in thread

* Re: [PATCH 00/28] Use main as default branch name
  2020-11-12 22:43 [PATCH 00/28] Use main as default branch name Johannes Schindelin via GitGitGadget
                   ` (27 preceding siblings ...)
  2020-11-12 22:43 ` [PATCH 28/28] Change the default branch name to `main` Don Goodman-Wilson via GitGitGadget
@ 2020-11-13  0:11 ` Felipe Contreras
  2020-11-13 12:55 ` Ævar Arnfjörð Bjarmason
                   ` (3 subsequent siblings)
  32 siblings, 0 replies; 163+ messages in thread
From: Felipe Contreras @ 2020-11-13  0:11 UTC (permalink / raw)
  To: Johannes Schindelin via GitGitGadget; +Cc: Git, Johannes Schindelin

On Thu, Nov 12, 2020 at 5:55 PM Johannes Schindelin via GitGitGadget
<gitgitgadget@gmail.com> wrote:

> This is the big one. This changes the default of init.defaultBranch to main,
> reflecting what many open source projects already did (which was followed by
> GitHub, Azure Repos and others).

I want to plant a big red flag here for the record.

I am against this change.

At the very least in the manner it is being made. I started a separate
thread [1] explaining the reasoning.

In addition to the manner--which I argue in that other thread should
be done for Git 3.0--I also object to the reasoning behind the change.

Let me know if you would rather hear my arguments against the
reasoning here, or in the other thread.

Cheers.

[1] https://lore.kernel.org/git/CAMP44s3BJ3dGsLJ-6yA-Po459=+m826KD9an4+P3qOY1vkbxZg@mail.gmail.com/

-- 
Felipe Contreras

^ permalink raw reply	[flat|nested] 163+ messages in thread

* Re: [PATCH 28/28] Change the default branch name to `main`
  2020-11-12 22:43 ` [PATCH 28/28] Change the default branch name to `main` Don Goodman-Wilson via GitGitGadget
@ 2020-11-13  9:57   ` Ævar Arnfjörð Bjarmason
  2020-11-13 14:09     ` Johannes Schindelin
  0 siblings, 1 reply; 163+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2020-11-13  9:57 UTC (permalink / raw)
  To: Don Goodman-Wilson via GitGitGadget
  Cc: git, Johannes Schindelin, Don Goodman-Wilson


On Thu, Nov 12 2020, Don Goodman-Wilson via GitGitGadget wrote:

> The current default name for the initial branch is a loaded term, and
> many Open Source projects renamed their principal branches already. A
> common choice appears to be `main`.
>
> Let's follow their lead and change the default of `init.defaultBranch`.

I think it makes sense to split this change off from a 28-series test
cleanup series.

> diff --git a/t/lib-submodule-update.sh b/t/lib-submodule-update.sh
> index bd3fa3c6da..1b0abcb0f8 100644
> --- a/t/lib-submodule-update.sh
> +++ b/t/lib-submodule-update.sh
> @@ -144,7 +144,7 @@ create_lib_submodule_repo () {
>  		git checkout -b valid_sub1 &&
>  		git revert HEAD &&
>  
> -		git checkout "${GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME-master}"
> +		git checkout "${GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME-main}"

Earlier in that function we're doing a "git init". With all this test
cleanup I wonder why not just "git rev-parse --abbrev-ref" to get the
default name, instead of carrying the hardcoding forward.


^ permalink raw reply	[flat|nested] 163+ messages in thread

* Re: [PATCH 14/28] t55[23]*: adjust the references to the default branch name "main"
  2020-11-12 22:43 ` [PATCH 14/28] t55[23]*: " Johannes Schindelin via GitGitGadget
@ 2020-11-13 10:02   ` Ævar Arnfjörð Bjarmason
  2020-11-13 14:18     ` Johannes Schindelin
  2020-11-16 20:07     ` Junio C Hamano
  0 siblings, 2 replies; 163+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2020-11-13 10:02 UTC (permalink / raw)
  To: Johannes Schindelin via GitGitGadget; +Cc: git, Johannes Schindelin


On Thu, Nov 12 2020, Johannes Schindelin via GitGitGadget wrote:

> From: Johannes Schindelin <johannes.schindelin@gmx.de>
>
> This trick was performed via
>
> 	$ (cd t &&
> 	   sed -i -e 's/master/main/g' -e 's/MASTER/MAIN/g' \
> 		-e 's/Master/Main/g' -e 's/naster/nain/g' -- t55[23]*.sh)
>
> Note that t5533 contains a variation of the name `master` (`naster`)
> that we rename here, too.
>
> This commit allows us to define
> `GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main` for that range of tests.

There's also a "naster" in t/t1402-check-ref-format.sh that's not
changed here and missed by 02/28 of this series.

Is there some meaning to the name "nain" and "naster" that I'm missing?
If not can we just call this "topic" or something while we're at it?
I.e. this on top (just s/nain/topic/g):

diff --git a/t/t5533-push-cas.sh b/t/t5533-push-cas.sh
index 9fcec604c3..4e33ec1fb9 100755
--- a/t/t5533-push-cas.sh
+++ b/t/t5533-push-cas.sh
@@ -201,12 +201,12 @@ test_expect_success 'cover everything with default force-with-lease (protected)'
 	setup_srcdst_basic &&
 	(
 		cd src &&
-		git branch nain main^
+		git branch topic main^
 	) &&
 	git ls-remote src refs/heads/\* >expect &&
 	(
 		cd dst &&
-		test_must_fail git push --force-with-lease origin main main:nain
+		test_must_fail git push --force-with-lease origin main main:topic
 	) &&
 	git ls-remote src refs/heads/\* >actual &&
 	test_cmp expect actual
@@ -216,16 +216,16 @@ test_expect_success 'cover everything with default force-with-lease (allowed)' '
 	setup_srcdst_basic &&
 	(
 		cd src &&
-		git branch nain main^
+		git branch topic main^
 	) &&
 	(
 		cd dst &&
 		git fetch &&
-		git push --force-with-lease origin main main:nain
+		git push --force-with-lease origin main main:topic
 	) &&
 	git ls-remote dst refs/heads/main |
-	sed -e "s/main/nain/" >expect &&
-	git ls-remote src refs/heads/nain >actual &&
+	sed -e "s/main/topic/" >expect &&
+	git ls-remote src refs/heads/topic >actual &&
 	test_cmp expect actual
 '
 

^ permalink raw reply related	[flat|nested] 163+ messages in thread

* Re: [PATCH 00/28] Use main as default branch name
  2020-11-12 22:43 [PATCH 00/28] Use main as default branch name Johannes Schindelin via GitGitGadget
                   ` (28 preceding siblings ...)
  2020-11-13  0:11 ` [PATCH 00/28] Use main as default branch name Felipe Contreras
@ 2020-11-13 12:55 ` Ævar Arnfjörð Bjarmason
  2020-11-13 14:22   ` Johannes Schindelin
  2020-11-13 17:42   ` [PATCH 00/28] Use main as default branch name Felipe Contreras
  2020-11-14  6:13 ` Junio C Hamano
                   ` (2 subsequent siblings)
  32 siblings, 2 replies; 163+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2020-11-13 12:55 UTC (permalink / raw)
  To: Johannes Schindelin via GitGitGadget; +Cc: git, Johannes Schindelin


On Thu, Nov 12 2020, Johannes Schindelin via GitGitGadget wrote:

> This is the big one. This changes the default of init.defaultBranch to main,
> reflecting what many open source projects already did (which was followed by
> GitHub, Azure Repos and others).

I don't have an issue with the end goal of s/master/main|$whatever/ as
UX here as noted in previous related review rounds. But I don't think
this series as it stands is anywhere near ready.

This is 27 patches of s/master/main/ in the tests, followed by making
the change to the default in refs.c without as much as a single
documentation update to inform users of the change.

I don't see the point in doing these sorts of test suite changes, it
just seems like needless churn. But I have not read the whole backlog of
previous iterations of this & related patches, so bear with me.

Why not instead do what we did when we added protocol v2 to the tests,
e.g. in 8a1b0978ab ("test: request GIT_TEST_PROTOCOL_VERSION=0 when
appropriate", 2019-12-23) we simply set the t5515 test to always run
with protocol v1. If you'd do this:
    
    diff --git a/t/t5515-fetch-merge-logic.sh b/t/t5515-fetch-merge-logic.sh
    index 70a9d2d8ab..939c8b2f83 100755
    --- a/t/t5515-fetch-merge-logic.sh
    +++ b/t/t5515-fetch-merge-logic.sh
    @@ -11,6 +11,9 @@ test_description='Merge logic in fetch'
     GIT_TEST_PROTOCOL_VERSION=0
     export GIT_TEST_PROTOCOL_VERSION
     
    +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
    +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
    +
     . ./test-lib.sh
     
     build_script () {
    
Of course that also needs:
    
    index fa347ed3e1..2d700a171b 100644
    --- a/t/test-lib.sh
    +++ b/t/test-lib.sh
    @@ -1711,10 +1711,8 @@ test_lazy_prereq SHA1 '
     test_lazy_prereq REBASE_P '
     	test -z "$GIT_TEST_SKIP_REBASE_P"
     '
    -# Special-purpose prereq for transitioning to a new default branch name:
    -# Some tests need more than just a mindless (case-preserving) s/master/main/g
    -# replacement. The non-trivial adjustments are guarded behind this
    -# prerequisite, acting kind of as a feature flag
    -test_lazy_prereq PREPARE_FOR_MAIN_BRANCH '
    -	test "$GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME" = main
    +
    +test_lazy_prereq MAIN_BRANCH_IS_MASTER '
    +	test -z "$GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME" ||
    +	test "$GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME" = "master"
     '

Because (but see "later" a few paragraphs later), the logic as it stands
on "master" is entirely backwards & broken. I.e. if you don't set
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME or set it to "master" we now skip a
bunch of tests ... which only work if the value is "master". If you set
it to "main" they'll break.

Then instead of ending up with a hardcoding of "main" we'd be able to
run the tests with a new custom branch name (even one with whitespace in
it). That coverage is plenty to test any branch name hardcoding.

The remaining tests that would still have "master" would then just be
dealt with by the same thing we did for the too-protocol-v1-specific
tests, i.e.:
    
    diff --git a/t/t3502-cherry-pick-merge.sh b/t/t3502-cherry-pick-merge.sh
    index 8b635a196d..354f9bd851 100755
    --- a/t/t3502-cherry-pick-merge.sh
    +++ b/t/t3502-cherry-pick-merge.sh
    @@ -8,6 +8,8 @@ test_description='cherry picking and reverting a merge
     
     '
     
    +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
    +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     . ./test-lib.sh
     
     test_expect_success setup '
    
Except unlike protocol v1/v2 we're really not gaining anything in
coverage by going further, it's not the point of any of these tests to
test for the default branch name. It's a *lot* of churn, 

"Later": After writing the above I see from 704fed9ea2 ("tests: start
moving to a different default main branch name", 2020-10-23) that this
state of affairs is intentional. But doesn't discuss why the more usual
(because we've done it that way a few times before) v1/v2-esque
transition wasn't done instead.

Doing it the other way still seems better. We're now not running our
full tests in anticipation for this series landing on "master", and
after applying this we're still not running all of them.

Anyway, enough with discussing this detail of the test suite churn. My
main objection to this version of it is:

After this series as it stands lands what's a rather big UI change in
git isn't discussed *anywhere* in the docs.

I'm not saying we need some similar s/master/main/g in Documentation/ as
what's being done here in t/, but I think a bare minimum for a rather
big UI change like this is:

 1) Let's at least talk about it in some way in git-init(1), i.e. that
    it used to be "master" before version so-and-so and is now
    different. With this series applied we still say:

    Documentation/git-init.txt:If not specified, fall back to the default name: `master`.

 2) Ditto in the init.defaultBranch and things like that

 3) After all this effort at eliminating "master" entirely in the tests
    we're still shipping a sample hook that expects "master" on "git
    init", and breaks now that it's "main"

And maybe stuff like:

 4) Have "git init" emit some new advice message saying that the default
    has changed and we've init-ed a new repo with a "main" branch.

Our primary concern should be the vast majority of users who don't
follow this topic on Twitter, don't read this mailing list, and are just
going to waste 10 minutes of their day because some script they've had
working for years using "git init" did something unexpected.

Let's at least aim to make that 5 minutes instead by making the change
more discoverable.

^ permalink raw reply	[flat|nested] 163+ messages in thread

* Re: [PATCH 28/28] Change the default branch name to `main`
  2020-11-13  9:57   ` Ævar Arnfjörð Bjarmason
@ 2020-11-13 14:09     ` Johannes Schindelin
  2020-11-16 20:04       ` Junio C Hamano
  0 siblings, 1 reply; 163+ messages in thread
From: Johannes Schindelin @ 2020-11-13 14:09 UTC (permalink / raw)
  To: Ævar Arnfjörð Bjarmason
  Cc: Don Goodman-Wilson via GitGitGadget, git, Don Goodman-Wilson

[-- Attachment #1: Type: text/plain, Size: 1899 bytes --]

Hi Ævar,

On Fri, 13 Nov 2020, Ævar Arnfjörð Bjarmason wrote:

>
> On Thu, Nov 12 2020, Don Goodman-Wilson via GitGitGadget wrote:
>
> > The current default name for the initial branch is a loaded term, and
> > many Open Source projects renamed their principal branches already. A
> > common choice appears to be `main`.
> >
> > Let's follow their lead and change the default of `init.defaultBranch`.
>
> I think it makes sense to split this change off from a 28-series test
> cleanup series.

It is not a test cleanup. It is a series of 27 patches preparing the test
suite for the change made in the 28th patch.

I don't think that it is a good idea to split off that 28th patch from
the patches whose entire purpose is to prepare for that 28th patch.

>
> > diff --git a/t/lib-submodule-update.sh b/t/lib-submodule-update.sh
> > index bd3fa3c6da..1b0abcb0f8 100644
> > --- a/t/lib-submodule-update.sh
> > +++ b/t/lib-submodule-update.sh
> > @@ -144,7 +144,7 @@ create_lib_submodule_repo () {
> >  		git checkout -b valid_sub1 &&
> >  		git revert HEAD &&
> >
> > -		git checkout "${GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME-master}"
> > +		git checkout "${GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME-main}"
>
> Earlier in that function we're doing a "git init". With all this test
> cleanup I wonder why not just "git rev-parse --abbrev-ref" to get the
> default name, instead of carrying the hardcoding forward.

My goal was to keep everything as close to its original as possible. In
v2.29.2, this line reads:

		git checkout master

See https://github.com/git/git/blob/v2.29.2/t/lib-submodule-update.sh#L147
to convince yourself.

Personally, I would have used something like

		main=$(git symbolic-ref --short HEAD) &&
		[...]
		git checkout $main

instead of what you suggested. That's a topic for another patch (series),
though.

Ciao,
Dscho

^ permalink raw reply	[flat|nested] 163+ messages in thread

* Re: [PATCH 14/28] t55[23]*: adjust the references to the default branch name "main"
  2020-11-13 10:02   ` Ævar Arnfjörð Bjarmason
@ 2020-11-13 14:18     ` Johannes Schindelin
  2020-11-16 20:07     ` Junio C Hamano
  1 sibling, 0 replies; 163+ messages in thread
From: Johannes Schindelin @ 2020-11-13 14:18 UTC (permalink / raw)
  To: Ævar Arnfjörð Bjarmason
  Cc: Johannes Schindelin via GitGitGadget, git

[-- Attachment #1: Type: text/plain, Size: 2899 bytes --]

Hi Ævar,

On Fri, 13 Nov 2020, Ævar Arnfjörð Bjarmason wrote:

>
> On Thu, Nov 12 2020, Johannes Schindelin via GitGitGadget wrote:
>
> > From: Johannes Schindelin <johannes.schindelin@gmx.de>
> >
> > This trick was performed via
> >
> > 	$ (cd t &&
> > 	   sed -i -e 's/master/main/g' -e 's/MASTER/MAIN/g' \
> > 		-e 's/Master/Main/g' -e 's/naster/nain/g' -- t55[23]*.sh)
> >
> > Note that t5533 contains a variation of the name `master` (`naster`)
> > that we rename here, too.
> >
> > This commit allows us to define
> > `GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main` for that range of tests.
>
> There's also a "naster" in t/t1402-check-ref-format.sh that's not
> changed here and missed by 02/28 of this series.

Whoops, you're right. It's not even new: 7c3f847aad7 (check-ref-format
--branch: do not expand @{...} outside repository, 2017-10-17) introduced
it. I missed that one, thank you for pointing it out.

I will follow up with a separate patch to fix that, once the dust settles
on this here patch series.

> Is there some meaning to the name "nain" and "naster" that I'm missing?

I guess the original reasoning was to stay close to the original default
branch name. I'm not sure whether it is worth changing that idea. Like, if
you ask me whether it hurts to use "nain"? I looked up possible
connotations, and the most common one was "grandmother", and that's rather
endearing to me.

Ciao,
Dscho

> If not can we just call this "topic" or something while we're at it?
> I.e. this on top (just s/nain/topic/g):
>
> diff --git a/t/t5533-push-cas.sh b/t/t5533-push-cas.sh
> index 9fcec604c3..4e33ec1fb9 100755
> --- a/t/t5533-push-cas.sh
> +++ b/t/t5533-push-cas.sh
> @@ -201,12 +201,12 @@ test_expect_success 'cover everything with default force-with-lease (protected)'
>  	setup_srcdst_basic &&
>  	(
>  		cd src &&
> -		git branch nain main^
> +		git branch topic main^
>  	) &&
>  	git ls-remote src refs/heads/\* >expect &&
>  	(
>  		cd dst &&
> -		test_must_fail git push --force-with-lease origin main main:nain
> +		test_must_fail git push --force-with-lease origin main main:topic
>  	) &&
>  	git ls-remote src refs/heads/\* >actual &&
>  	test_cmp expect actual
> @@ -216,16 +216,16 @@ test_expect_success 'cover everything with default force-with-lease (allowed)' '
>  	setup_srcdst_basic &&
>  	(
>  		cd src &&
> -		git branch nain main^
> +		git branch topic main^
>  	) &&
>  	(
>  		cd dst &&
>  		git fetch &&
> -		git push --force-with-lease origin main main:nain
> +		git push --force-with-lease origin main main:topic
>  	) &&
>  	git ls-remote dst refs/heads/main |
> -	sed -e "s/main/nain/" >expect &&
> -	git ls-remote src refs/heads/nain >actual &&
> +	sed -e "s/main/topic/" >expect &&
> +	git ls-remote src refs/heads/topic >actual &&
>  	test_cmp expect actual
>  '
>
>

^ permalink raw reply	[flat|nested] 163+ messages in thread

* Re: [PATCH 00/28] Use main as default branch name
  2020-11-13 12:55 ` Ævar Arnfjörð Bjarmason
@ 2020-11-13 14:22   ` Johannes Schindelin
  2020-11-13 16:13     ` [RFC/PATCH] tests: support testing with an arbitrary default branch (sort of) Ævar Arnfjörð Bjarmason
  2020-11-13 17:42   ` [PATCH 00/28] Use main as default branch name Felipe Contreras
  1 sibling, 1 reply; 163+ messages in thread
From: Johannes Schindelin @ 2020-11-13 14:22 UTC (permalink / raw)
  To: Ævar Arnfjörð Bjarmason
  Cc: Johannes Schindelin via GitGitGadget, git

[-- Attachment #1: Type: text/plain, Size: 6813 bytes --]

Hi Ævar,

On Fri, 13 Nov 2020, Ævar Arnfjörð Bjarmason wrote:

> On Thu, Nov 12 2020, Johannes Schindelin via GitGitGadget wrote:
>
> > This is the big one. This changes the default of init.defaultBranch to main,
> > reflecting what many open source projects already did (which was followed by
> > GitHub, Azure Repos and others).
>
> I don't have an issue with the end goal of s/master/main|$whatever/ as
> UX here as noted in previous related review rounds. But I don't think
> this series as it stands is anywhere near ready.
>
> This is 27 patches of s/master/main/ in the tests, followed by making
> the change to the default in refs.c without as much as a single
> documentation update to inform users of the change.

Of course, this is _the one_ patch series mentioned in
https://github.com/gitgitgadget/git/pull/655 that does _not_ link back to
the meta-PR.

So you're right, on its own, these 28 patches do not make sense.

And if you split off the 28th patch, the remaining 27 patches make even
less sense.

The reason why I partitioned the changes this way was that it is a _ton_
of patches to review, and in many ways, these 28 patches are the most
important ones to review (I didn't want to just rely on the CI builds
passing, I reviewed those patches carefully, multiple times, to make sure
that they made sense in the goal to transition to `main`).

I will respond to the rest of your concerns later,
Dscho

>
> I don't see the point in doing these sorts of test suite changes, it
> just seems like needless churn. But I have not read the whole backlog of
> previous iterations of this & related patches, so bear with me.
>
> Why not instead do what we did when we added protocol v2 to the tests,
> e.g. in 8a1b0978ab ("test: request GIT_TEST_PROTOCOL_VERSION=0 when
> appropriate", 2019-12-23) we simply set the t5515 test to always run
> with protocol v1. If you'd do this:
>
>     diff --git a/t/t5515-fetch-merge-logic.sh b/t/t5515-fetch-merge-logic.sh
>     index 70a9d2d8ab..939c8b2f83 100755
>     --- a/t/t5515-fetch-merge-logic.sh
>     +++ b/t/t5515-fetch-merge-logic.sh
>     @@ -11,6 +11,9 @@ test_description='Merge logic in fetch'
>      GIT_TEST_PROTOCOL_VERSION=0
>      export GIT_TEST_PROTOCOL_VERSION
>
>     +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
>     +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
>     +
>      . ./test-lib.sh
>
>      build_script () {
>
> Of course that also needs:
>
>     index fa347ed3e1..2d700a171b 100644
>     --- a/t/test-lib.sh
>     +++ b/t/test-lib.sh
>     @@ -1711,10 +1711,8 @@ test_lazy_prereq SHA1 '
>      test_lazy_prereq REBASE_P '
>      	test -z "$GIT_TEST_SKIP_REBASE_P"
>      '
>     -# Special-purpose prereq for transitioning to a new default branch name:
>     -# Some tests need more than just a mindless (case-preserving) s/master/main/g
>     -# replacement. The non-trivial adjustments are guarded behind this
>     -# prerequisite, acting kind of as a feature flag
>     -test_lazy_prereq PREPARE_FOR_MAIN_BRANCH '
>     -	test "$GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME" = main
>     +
>     +test_lazy_prereq MAIN_BRANCH_IS_MASTER '
>     +	test -z "$GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME" ||
>     +	test "$GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME" = "master"
>      '
>
> Because (but see "later" a few paragraphs later), the logic as it stands
> on "master" is entirely backwards & broken. I.e. if you don't set
> GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME or set it to "master" we now skip a
> bunch of tests ... which only work if the value is "master". If you set
> it to "main" they'll break.
>
> Then instead of ending up with a hardcoding of "main" we'd be able to
> run the tests with a new custom branch name (even one with whitespace in
> it). That coverage is plenty to test any branch name hardcoding.
>
> The remaining tests that would still have "master" would then just be
> dealt with by the same thing we did for the too-protocol-v1-specific
> tests, i.e.:
>
>     diff --git a/t/t3502-cherry-pick-merge.sh b/t/t3502-cherry-pick-merge.sh
>     index 8b635a196d..354f9bd851 100755
>     --- a/t/t3502-cherry-pick-merge.sh
>     +++ b/t/t3502-cherry-pick-merge.sh
>     @@ -8,6 +8,8 @@ test_description='cherry picking and reverting a merge
>
>      '
>
>     +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
>     +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
>      . ./test-lib.sh
>
>      test_expect_success setup '
>
> Except unlike protocol v1/v2 we're really not gaining anything in
> coverage by going further, it's not the point of any of these tests to
> test for the default branch name. It's a *lot* of churn,
>
> "Later": After writing the above I see from 704fed9ea2 ("tests: start
> moving to a different default main branch name", 2020-10-23) that this
> state of affairs is intentional. But doesn't discuss why the more usual
> (because we've done it that way a few times before) v1/v2-esque
> transition wasn't done instead.
>
> Doing it the other way still seems better. We're now not running our
> full tests in anticipation for this series landing on "master", and
> after applying this we're still not running all of them.
>
> Anyway, enough with discussing this detail of the test suite churn. My
> main objection to this version of it is:
>
> After this series as it stands lands what's a rather big UI change in
> git isn't discussed *anywhere* in the docs.
>
> I'm not saying we need some similar s/master/main/g in Documentation/ as
> what's being done here in t/, but I think a bare minimum for a rather
> big UI change like this is:
>
>  1) Let's at least talk about it in some way in git-init(1), i.e. that
>     it used to be "master" before version so-and-so and is now
>     different. With this series applied we still say:
>
>     Documentation/git-init.txt:If not specified, fall back to the default name: `master`.
>
>  2) Ditto in the init.defaultBranch and things like that
>
>  3) After all this effort at eliminating "master" entirely in the tests
>     we're still shipping a sample hook that expects "master" on "git
>     init", and breaks now that it's "main"
>
> And maybe stuff like:
>
>  4) Have "git init" emit some new advice message saying that the default
>     has changed and we've init-ed a new repo with a "main" branch.
>
> Our primary concern should be the vast majority of users who don't
> follow this topic on Twitter, don't read this mailing list, and are just
> going to waste 10 minutes of their day because some script they've had
> working for years using "git init" did something unexpected.
>
> Let's at least aim to make that 5 minutes instead by making the change
> more discoverable.
>

^ permalink raw reply	[flat|nested] 163+ messages in thread

* [RFC/PATCH] tests: support testing with an arbitrary default branch (sort of)
  2020-11-13 14:22   ` Johannes Schindelin
@ 2020-11-13 16:13     ` Ævar Arnfjörð Bjarmason
  2020-11-13 19:14       ` Jeff King
  0 siblings, 1 reply; 163+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2020-11-13 16:13 UTC (permalink / raw)
  To: git
  Cc: Junio C Hamano, Johannes Schindelin, Jeff King,
	Ævar Arnfjörð Bjarmason

Since 704fed9ea2 ("tests: start moving to a different default main
branch name", 2020-10-23) we've been needlessly skipping tests if the
branch is "master" in preparation for an eventual switch to another name.

As I noted in [1] I don't see why we shouldn't be doing a more
graceful approach here where we don't start skipping unrelated tests
just because some s/master/main/g changes are in flight.

Furthermore the seeming goal of eliminating the string "master" from
anywhere in git's sources results in needless patch churn, and has
nothing to do with the goal of changing the branch name in the UX.

This patch demonstrates that things could be much simpler if we don't
set ourselves that requirement. Now we:

 * Can set GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=<some-name>, but this
   no longer overrides config, so it behaves like other GIT_TEST_*
   variables.

 * Have a test-tool helper that gives us refs.c's idea of the main
   branch name to share the logic between the tests and the main C
   code.

 * A lot of tests (but a small minority of the total) have master
   "master" hardcoded in some way. We now inventory them in
   tests-that-need-master.txt, we can still remove the names from that
   file and manually change the code later, but this accomplishes a
   clean test run with a relatively easy-to-review diff.

   We ignore GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=<name> when it comes
   to these files, unless
   GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME_HARDER=true is set.

 * The changes to t5515-fetch-merge-logic.sh and
   t5560-http-backend-noserver.sh show how much easier it is to just
   punt on certain tests. In these tests that heavily rely on the
   "master" name (not inherently, it's just hardcoded in a lot of
   places) we just give up and keep using "master".

1. https://lore.kernel.org/git/87pn4hfmc4.fsf@evledraar.gmail.com/

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
---

I need to walk away from the computer now, but this is an RFC of what
I was commenting on upthread.

 Makefile                            |   1 +
 config.c                            |  10 +
 config.h                            |   1 +
 refs.c                              |   7 +-
 t/helper/test-default-branch-name.c |  16 ++
 t/helper/test-tool.c                |   1 +
 t/helper/test-tool.h                |   1 +
 t/t0001-init.sh                     |   2 +-
 t/t5515-fetch-merge-logic.sh        |   3 +
 t/t5560-http-backend-noserver.sh    |   4 +
 t/test-lib.sh                       |  27 ++-
 t/tests-that-need-master.txt        | 343 ++++++++++++++++++++++++++++
 12 files changed, 403 insertions(+), 13 deletions(-)
 create mode 100644 t/helper/test-default-branch-name.c
 create mode 100644 t/tests-that-need-master.txt

diff --git a/Makefile b/Makefile
index 790a883932..fb94c836e2 100644
--- a/Makefile
+++ b/Makefile
@@ -696,6 +696,7 @@ TEST_BUILTINS_OBJS += test-chmtime.o
 TEST_BUILTINS_OBJS += test-config.o
 TEST_BUILTINS_OBJS += test-ctype.o
 TEST_BUILTINS_OBJS += test-date.o
+TEST_BUILTINS_OBJS += test-default-branch-name.o
 TEST_BUILTINS_OBJS += test-delta.o
 TEST_BUILTINS_OBJS += test-dir-iterator.o
 TEST_BUILTINS_OBJS += test-drop-caches.o
diff --git a/config.c b/config.c
index 2bdff4457b..0c12864b79 100644
--- a/config.c
+++ b/config.c
@@ -1706,6 +1706,16 @@ unsigned long git_env_ulong(const char *k, unsigned long val)
 	return val;
 }
 
+/*
+ * Parse environment variable 'k' as a char *; if missing, use the
+ * default value 'def'.
+ */
+const char* git_env_str(const char *k, const char *def)
+{
+	const char *v = getenv(k);
+	return v && strlen(v) ? v : def;
+}
+
 int git_config_system(void)
 {
 	return !git_env_bool("GIT_CONFIG_NOSYSTEM", 0);
diff --git a/config.h b/config.h
index 91cdfbfb41..36a7284f8a 100644
--- a/config.h
+++ b/config.h
@@ -298,6 +298,7 @@ int git_config_copy_section_in_file(const char *, const char *, const char *);
 const char *git_etc_gitconfig(void);
 int git_env_bool(const char *, int);
 unsigned long git_env_ulong(const char *, unsigned long);
+const char* git_env_str(const char *, const char *);
 int git_config_system(void);
 int config_error_nonbool(const char *);
 #if defined(__GNUC__)
diff --git a/refs.c b/refs.c
index 392f0bbf68..ca8875e945 100644
--- a/refs.c
+++ b/refs.c
@@ -567,15 +567,12 @@ char *repo_default_branch_name(struct repository *r)
 	const char *config_key = "init.defaultbranch";
 	const char *config_display_key = "init.defaultBranch";
 	char *ret = NULL, *full_ref;
-	const char *env = getenv("GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME");
 
-	if (env && *env)
-		ret = xstrdup(env);
-	else if (repo_config_get_string(r, config_key, &ret) < 0)
+	if (repo_config_get_string(r, config_key, &ret) < 0)
 		die(_("could not retrieve `%s`"), config_display_key);
 
 	if (!ret)
-		ret = xstrdup("master");
+		ret = xstrdup(git_env_str("GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME", "master"));
 
 	full_ref = xstrfmt("refs/heads/%s", ret);
 	if (check_refname_format(full_ref, 0))
diff --git a/t/helper/test-default-branch-name.c b/t/helper/test-default-branch-name.c
new file mode 100644
index 0000000000..1a0c8502ee
--- /dev/null
+++ b/t/helper/test-default-branch-name.c
@@ -0,0 +1,16 @@
+#include "test-tool.h"
+#include "git-compat-util.h"
+#include "refs.h"
+
+/*
+ * usage:
+ * tool-test default-branch-name
+ */
+int cmd__default_branch_name(int argc, const char **argv)
+{
+	const char *name = git_default_branch_name();
+
+	puts(name);
+
+	return 0;
+}
diff --git a/t/helper/test-tool.c b/t/helper/test-tool.c
index a0d3966b29..ad4bd7274c 100644
--- a/t/helper/test-tool.c
+++ b/t/helper/test-tool.c
@@ -21,6 +21,7 @@ static struct test_cmd cmds[] = {
 	{ "ctype", cmd__ctype },
 	{ "date", cmd__date },
 	{ "delta", cmd__delta },
+	{ "default-branch-name", cmd__default_branch_name },
 	{ "dir-iterator", cmd__dir_iterator },
 	{ "drop-caches", cmd__drop_caches },
 	{ "dump-cache-tree", cmd__dump_cache_tree },
diff --git a/t/helper/test-tool.h b/t/helper/test-tool.h
index 07034d3f38..e0dda6bfd8 100644
--- a/t/helper/test-tool.h
+++ b/t/helper/test-tool.h
@@ -10,6 +10,7 @@ int cmd__chmtime(int argc, const char **argv);
 int cmd__config(int argc, const char **argv);
 int cmd__ctype(int argc, const char **argv);
 int cmd__date(int argc, const char **argv);
+int cmd__default_branch_name(int argc, const char **argv);
 int cmd__delta(int argc, const char **argv);
 int cmd__dir_iterator(int argc, const char **argv);
 int cmd__drop_caches(int argc, const char **argv);
diff --git a/t/t0001-init.sh b/t/t0001-init.sh
index 69a320489f..68adb9a832 100755
--- a/t/t0001-init.sh
+++ b/t/t0001-init.sh
@@ -562,7 +562,7 @@ test_expect_success 'overridden default main branch name (env)' '
 	test_config_global init.defaultBranch nmb &&
 	GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=env git init main-branch-env &&
 	git -C main-branch-env symbolic-ref HEAD >actual &&
-	grep env actual
+	grep nmb actual
 '
 
 test_expect_success 'invalid default branch name' '
diff --git a/t/t5515-fetch-merge-logic.sh b/t/t5515-fetch-merge-logic.sh
index 70a9d2d8ab..939c8b2f83 100755
--- a/t/t5515-fetch-merge-logic.sh
+++ b/t/t5515-fetch-merge-logic.sh
@@ -11,6 +11,9 @@ test_description='Merge logic in fetch'
 GIT_TEST_PROTOCOL_VERSION=0
 export GIT_TEST_PROTOCOL_VERSION
 
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 build_script () {
diff --git a/t/t5560-http-backend-noserver.sh b/t/t5560-http-backend-noserver.sh
index 9fafcf1945..27b31745ad 100755
--- a/t/t5560-http-backend-noserver.sh
+++ b/t/t5560-http-backend-noserver.sh
@@ -1,6 +1,10 @@
 #!/bin/sh
 
 test_description='test git-http-backend-noserver'
+
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 HTTPD_DOCUMENT_ROOT_PATH="$TRASH_DIRECTORY"
diff --git a/t/test-lib.sh b/t/test-lib.sh
index fa347ed3e1..11ea009717 100644
--- a/t/test-lib.sh
+++ b/t/test-lib.sh
@@ -1382,6 +1382,26 @@ HOME="$TRASH_DIRECTORY"
 GNUPGHOME="$HOME/gnupg-home-not-used"
 export HOME GNUPGHOME
 
+# Check if we're doing tests with the main branch != master, and if
+# we'd like to override that for known-broken tests.
+GIT_TEST_MAIN=$(test-tool default-branch-name)
+if test "$GIT_TEST_MAIN" = "master"
+then
+	test_set_prereq MAIN_BRANCH_IS_MASTER
+else
+	if test -z "$GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME_HARDER" &&
+	   grep -q $TEST_NAME "$TEST_DIRECTORY/tests-that-need-master.txt"
+	then
+		echo overriding
+		GIT_TEST_MAIN=master
+		GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+		test_set_prereq MAIN_BRANCH_IS_MASTER
+	fi
+fi
+export GIT_TEST_MAIN
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
+# Initialize the repository after we know the main branch name.
 if test -z "$TEST_NO_CREATE_REPO"
 then
 	test_create_repo "$TRASH_DIRECTORY"
@@ -1711,10 +1731,3 @@ test_lazy_prereq SHA1 '
 test_lazy_prereq REBASE_P '
 	test -z "$GIT_TEST_SKIP_REBASE_P"
 '
-# Special-purpose prereq for transitioning to a new default branch name:
-# Some tests need more than just a mindless (case-preserving) s/master/main/g
-# replacement. The non-trivial adjustments are guarded behind this
-# prerequisite, acting kind of as a feature flag
-test_lazy_prereq PREPARE_FOR_MAIN_BRANCH '
-	test "$GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME" = main
-'
diff --git a/t/tests-that-need-master.txt b/t/tests-that-need-master.txt
new file mode 100644
index 0000000000..d7a693b19e
--- /dev/null
+++ b/t/tests-that-need-master.txt
@@ -0,0 +1,343 @@
+t0002-gitfile.sh
+t0020-crlf.sh
+t0021-conversion.sh
+t0027-auto-crlf.sh
+t0028-working-tree-encoding.sh
+t0041-usage.sh
+t0050-filesystem.sh
+t0060-path-utils.sh
+t0100-previous.sh
+t1004-read-tree-m-u-wf.sh
+t1008-read-tree-overlay.sh
+t1009-read-tree-new-index.sh
+t1011-read-tree-sparse-checkout.sh
+t1021-rerere-in-workdir.sh
+t1090-sparse-checkout-scope.sh
+t1091-sparse-checkout-builtin.sh
+t1300-config.sh
+t1301-shared-repo.sh
+t1305-config-include.sh
+t1309-early-config.sh
+t1400-update-ref.sh
+t1402-check-ref-format.sh
+t1403-show-ref.sh
+t1405-main-ref-store.sh
+t1406-submodule-ref-store.sh
+t1407-worktree-ref-store.sh
+t1408-packed-refs.sh
+t1410-reflog.sh
+t1411-reflog-show.sh
+t1413-reflog-detach.sh
+t1414-reflog-walk.sh
+t1416-ref-transaction-hooks.sh
+t1430-bad-ref-name.sh
+t1450-fsck.sh
+t1500-rev-parse.sh
+t1503-rev-parse-verify.sh
+t1505-rev-parse-last.sh
+t1506-rev-parse-diagnosis.sh
+t1507-rev-parse-upstream.sh
+t1508-at-combinations.sh
+t1511-rev-parse-caret.sh
+t1512-rev-parse-disambiguation.sh
+t1513-rev-parse-prefix.sh
+t1514-rev-parse-push.sh
+t1700-split-index.sh
+t2007-checkout-symlink.sh
+t2009-checkout-statinfo.sh
+t2010-checkout-ambiguous.sh
+t2011-checkout-invalid-head.sh
+t2012-checkout-last.sh
+t2015-checkout-unborn.sh
+t2017-checkout-orphan.sh
+t2020-checkout-detach.sh
+t2022-checkout-paths.sh
+t2023-checkout-m.sh
+t2024-checkout-dwim.sh
+t2027-checkout-track.sh
+t2030-unresolve-info.sh
+t2060-switch.sh
+t2070-restore.sh
+t2106-update-index-assume-unchanged.sh
+t2400-worktree-add.sh
+t2401-worktree-prune.sh
+t2402-worktree-list.sh
+t2405-worktree-submodule.sh
+t3040-subprojects-basic.sh
+t3200-branch.sh
+t3201-branch-contains.sh
+t3202-show-branch-octopus.sh
+t3203-branch-output.sh
+t3204-branch-name-interpretation.sh
+t3205-branch-color.sh
+t3206-range-diff.sh
+t3210-pack-refs.sh
+t3211-peel-ref.sh
+t3301-notes.sh
+t3302-notes-index-expensive.sh
+t3303-notes-subtrees.sh
+t3304-notes-mixed.sh
+t3308-notes-merge.sh
+t3320-notes-merge-worktrees.sh
+t3400-rebase.sh
+t3402-rebase-merge.sh
+t3403-rebase-skip.sh
+t3405-rebase-malformed.sh
+t3406-rebase-message.sh
+t3407-rebase-abort.sh
+t3408-rebase-multi-line.sh
+t3409-rebase-preserve-merges.sh
+t3412-rebase-root.sh
+t3413-rebase-hook.sh
+t3415-rebase-autosquash.sh
+t3416-rebase-onto-threedots.sh
+t3418-rebase-continue.sh
+t3419-rebase-patch-id.sh
+t3420-rebase-autostash.sh
+t3423-rebase-reword.sh
+t3427-rebase-subtree.sh
+t3430-rebase-merges.sh
+t3431-rebase-fork-point.sh
+t3432-rebase-fast-forward.sh
+t3434-rebase-i18n.sh
+t3435-rebase-gpg-sign.sh
+t3436-rebase-more-options.sh
+t3500-cherry.sh
+t3501-revert-cherry-pick.sh
+t3502-cherry-pick-merge.sh
+t3503-cherry-pick-root.sh
+t3504-cherry-pick-rerere.sh
+t3505-cherry-pick-empty.sh
+t3506-cherry-pick-ff.sh
+t3507-cherry-pick-conflict.sh
+t3508-cherry-pick-many-commits.sh
+t3509-cherry-pick-merge-df.sh
+t3512-cherry-pick-submodule.sh
+t3600-rm.sh
+t3701-add-interactive.sh
+t3901-i18n-patch.sh
+t3903-stash.sh
+t3910-mac-os-precompose.sh
+t4014-format-patch.sh
+t4015-diff-whitespace.sh
+t4017-diff-retval.sh
+t4038-diff-combined.sh
+t4041-diff-submodule-option.sh
+t4048-diff-combined-binary.sh
+t4052-stat-output.sh
+t4056-diff-order.sh
+t4057-diff-combined-paths.sh
+t4061-diff-indent.sh
+t4066-diff-emit-delay.sh
+t4068-diff-symmetric-merge-base.sh
+t4103-apply-binary.sh
+t4108-apply-threeway.sh
+t4121-apply-diffs.sh
+t4122-apply-symlink-inside.sh
+t4150-am.sh
+t4200-rerere.sh
+t4201-shortlog.sh
+t4202-log.sh
+t4203-mailmap.sh
+t4204-patch-id.sh
+t4207-log-decoration-colors.sh
+t4208-log-magic-pathspec.sh
+t4214-log-graph-octopus.sh
+t4216-log-bloom.sh
+t4253-am-keep-cr-dos.sh
+t4257-am-interactive.sh
+t5150-request-pull.sh
+t5304-prune.sh
+t5305-include-tag.sh
+t5312-prune-corruption.sh
+t5317-pack-objects-filter-objects.sh
+t5322-pack-objects-sparse.sh
+t5323-pack-redundant.sh
+t5400-send-pack.sh
+t5401-update-hooks.sh
+t5402-post-merge-hook.sh
+t5403-post-checkout-hook.sh
+t5404-tracking-branches.sh
+t5405-send-pack-rewind.sh
+t5407-post-rewrite-hook.sh
+t5410-receive-pack-alternates.sh
+t5500-fetch-pack.sh
+t5501-fetch-push-alternates.sh
+t5502-quickfetch.sh
+t5503-tagfollow.sh
+t5504-fetch-receive-strict.sh
+t5505-remote.sh
+t5506-remote-groups.sh
+t5509-fetch-push-namespaces.sh
+t5510-fetch.sh
+t5511-refspec.sh
+t5512-ls-remote.sh
+t5514-fetch-multiple.sh
+t5516-fetch-push.sh
+t5517-push-mirror.sh
+t5518-fetch-exit-status.sh
+t5519-push-alternates.sh
+t5520-pull.sh
+t5521-pull-options.sh
+t5523-push-upstream.sh
+t5526-fetch-submodules.sh
+t5527-fetch-odd-refs.sh
+t5528-push-default.sh
+t5529-push-errors.sh
+t5530-upload-pack-error.sh
+t5531-deep-submodule-push.sh
+t5533-push-cas.sh
+t5534-push-signed.sh
+t5537-fetch-shallow.sh
+t5538-push-shallow.sh
+t5539-fetch-http-shallow.sh
+t5540-http-push-webdav.sh
+t5541-http-push-smart.sh
+t5542-push-http-shallow.sh
+t5543-atomic-push.sh
+t5545-push-options.sh
+t5548-push-porcelain.sh
+t5550-http-fetch-dumb.sh
+t5551-http-fetch-smart.sh
+t5552-skipping-fetch-negotiator.sh
+t5553-set-upstream.sh
+t5561-http-backend.sh
+t5570-git-daemon.sh
+t5571-pre-push-hook.sh
+t5572-pull-submodule.sh
+t5580-unc-paths.sh
+t5581-http-curl-verbose.sh
+t5582-fetch-negative-refspec.sh
+t5601-clone.sh
+t5604-clone-reference.sh
+t5605-clone-local.sh
+t5606-clone-options.sh
+t5607-clone-bundle.sh
+t5608-clone-2gb.sh
+t5609-clone-branch.sh
+t5610-clone-detached.sh
+t5611-clone-config.sh
+t5612-clone-refspec.sh
+t5614-clone-submodules-shallow.sh
+t5616-partial-clone.sh
+t5617-clone-submodules-remote.sh
+t5700-protocol-v1.sh
+t5701-git-serve.sh
+t5702-protocol-v2.sh
+t5703-upload-pack-ref-in-want.sh
+t5801-remote-helpers.sh
+t6000-rev-list-misc.sh
+t6001-rev-list-graft.sh
+t6004-rev-list-path-optim.sh
+t6006-rev-list-format.sh
+t6007-rev-list-cherry-pick-file.sh
+t6008-rev-list-submodule.sh
+t6009-rev-list-parent.sh
+t6012-rev-list-simplify.sh
+t6013-rev-list-reverse-parents.sh
+t6016-rev-list-graph-simplify-history.sh
+t6017-rev-list-stdin.sh
+t6018-rev-list-glob.sh
+t6019-rev-list-ancestry-path.sh
+t6030-bisect-porcelain.sh
+t6040-tracking-info.sh
+t6050-replace.sh
+t6101-rev-parse-parents.sh
+t6110-rev-list-sparse.sh
+t6111-rev-list-treesame.sh
+t6112-rev-list-filters-objects.sh
+t6120-describe.sh
+t6200-fmt-merge-msg.sh
+t6302-for-each-ref-filter.sh
+t6400-merge-df.sh
+t6402-merge-rename.sh
+t6404-recursive-merge.sh
+t6405-merge-symlinks.sh
+t6406-merge-attr.sh
+t6407-merge-binary.sh
+t6409-merge-subtree.sh
+t6411-merge-filemode.sh
+t6412-merge-large-rename.sh
+t6413-merge-crlf.sh
+t6414-merge-rename-nocruft.sh
+t6415-merge-dir-to-symlink.sh
+t6416-recursive-corner-cases.sh
+t6417-merge-ours-theirs.sh
+t6418-merge-text-auto.sh
+t6419-merge-ignorecase.sh
+t6422-merge-rename-corner-cases.sh
+t6425-merge-rename-delete.sh
+t6427-diff3-conflict-markers.sh
+t6430-merge-recursive.sh
+t6432-merge-recursive-space-options.sh
+t6433-merge-toplevel.sh
+t6434-merge-recursive-rename-options.sh
+t6436-merge-overwrite.sh
+t6437-submodule-merge.sh
+t6439-merge-co-error-msgs.sh
+t6501-freshen-objects.sh
+t7003-filter-branch.sh
+t7004-tag.sh
+t7030-verify-tag.sh
+t7060-wtstatus.sh
+t7063-status-untracked-cache.sh
+t7102-reset.sh
+t7113-post-index-change-hook.sh
+t7201-co.sh
+t7400-submodule-basic.sh
+t7403-submodule-sync.sh
+t7406-submodule-update.sh
+t7407-submodule-foreach.sh
+t7409-submodule-detached-work-tree.sh
+t7417-submodule-path-url.sh
+t7501-commit-basic-functionality.sh
+t7502-commit-porcelain.sh
+t7503-pre-commit-and-pre-merge-commit-hooks.sh
+t7504-commit-msg-hook.sh
+t7505-prepare-commit-msg-hook.sh
+t7508-status.sh
+t7510-signed-commit.sh
+t7512-status-help.sh
+t7517-per-repo-email.sh
+t7600-merge.sh
+t7606-merge-custom.sh
+t7608-merge-messages.sh
+t7610-mergetool.sh
+t7611-merge-abort.sh
+t7612-merge-verify-signatures.sh
+t7614-merge-signoff.sh
+t7701-repack-unpack-unreachable.sh
+t7800-difftool.sh
+t7810-grep.sh
+t8001-annotate.sh
+t8003-blame-corner-cases.sh
+t8004-blame-with-conflicts.sh
+t9001-send-email.sh
+t9100-git-svn-basic.sh
+t9145-git-svn-master-branch.sh
+t9151-svn-mergeinfo.sh
+t9155-git-svn-fetch-deleted-tag.sh
+t9156-git-svn-fetch-deleted-tag-2.sh
+t9163-git-svn-reset-clears-caches.sh
+t9169-git-svn-dcommit-crlf.sh
+t9300-fast-import.sh
+t9301-fast-import-notes.sh
+t9302-fast-import-unpack-limit.sh
+t9350-fast-export.sh
+t9351-fast-export-anonymize.sh
+t9400-git-cvsserver-server.sh
+t9401-git-cvsserver-crlf.sh
+t9402-git-cvsserver-refs.sh
+t9500-gitweb-standalone-no-errors.sh
+t9501-gitweb-standalone-http-status.sh
+t9502-gitweb-standalone-parse-output.sh
+t9600-cvsimport.sh
+t9601-cvsimport-vendor-branch.sh
+t9602-cvsimport-branches-tags.sh
+t9603-cvsimport-patchsets.sh
+t9800-git-p4-basic.sh
+t9801-git-p4-branch.sh
+t9806-git-p4-options.sh
+t9807-git-p4-submit.sh
+t9811-git-p4-label-import.sh
+t9903-bash-prompt.sh
-- 
2.29.2.222.g5d2a92d10f8


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* Re: [PATCH 00/28] Use main as default branch name
  2020-11-13 12:55 ` Ævar Arnfjörð Bjarmason
  2020-11-13 14:22   ` Johannes Schindelin
@ 2020-11-13 17:42   ` Felipe Contreras
  1 sibling, 0 replies; 163+ messages in thread
From: Felipe Contreras @ 2020-11-13 17:42 UTC (permalink / raw)
  To: Ævar Arnfjörð Bjarmason
  Cc: Johannes Schindelin via GitGitGadget, Git, Johannes Schindelin

On Fri, Nov 13, 2020 at 7:00 AM Ævar Arnfjörð Bjarmason
<avarab@gmail.com> wrote:
> On Thu, Nov 12 2020, Johannes Schindelin via GitGitGadget wrote:

> After this series as it stands lands what's a rather big UI change in
> git isn't discussed *anywhere* in the docs.
>
> I'm not saying we need some similar s/master/main/g in Documentation/ as
> what's being done here in t/, but I think a bare minimum for a rather
> big UI change like this is:

Why not?

Isn't this change being championed on behalf of users who find the
word offensive?

Why would it be offensive to see the word on the commands you type on
the command line, but not offensive if the documentation tells you to
type those commands? This does not compute.

And worse; for the rest of the users that don't find the word
offensive (99.9% of them?), the documentation is left in an
inconsistent state, where some commands would not work as they are
stated.

If a word is so offensive it has to be erased from the Git lexicon,
then it has to be erased *everywhere*, or at least everywhere a user
might look.

Cheers.

-- 
Felipe Contreras

^ permalink raw reply	[flat|nested] 163+ messages in thread

* Re: [RFC/PATCH] tests: support testing with an arbitrary default branch (sort of)
  2020-11-13 16:13     ` [RFC/PATCH] tests: support testing with an arbitrary default branch (sort of) Ævar Arnfjörð Bjarmason
@ 2020-11-13 19:14       ` Jeff King
  2020-11-13 22:00         ` Johannes Schindelin
  0 siblings, 1 reply; 163+ messages in thread
From: Jeff King @ 2020-11-13 19:14 UTC (permalink / raw)
  To: Ævar Arnfjörð Bjarmason
  Cc: git, Junio C Hamano, Johannes Schindelin

On Fri, Nov 13, 2020 at 05:13:20PM +0100, Ævar Arnfjörð Bjarmason wrote:

>  * A lot of tests (but a small minority of the total) have master
>    "master" hardcoded in some way. We now inventory them in
>    tests-that-need-master.txt, we can still remove the names from that
>    file and manually change the code later, but this accomplishes a
>    clean test run with a relatively easy-to-review diff.
> 
>    We ignore GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=<name> when it comes
>    to these files, unless
>    GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME_HARDER=true is set.

I'm confused how this is better. We could just be setting
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME at the top of those files, couldn't
we? (Likewise, I think annotating individual scripts is more
decentralized than a magic pattern in test-lib.sh, though it amounts to
the same thing).

And if I understand the current state of Dscho's patches, we don't
_have_ to convert any tests right now. We could just annotate those
scripts which are not yet converted to have them use the old name.

But I don't think we want to live in that state indefinitely. It's
slightly annoying to have inconsistent naming within the tests. I'd be
happy to switch individual tests at a leisurely pace over the next
couple of months or whatever. But since Dscho has bothered to write all
of the patches now, why not use them?

I'm much more concerned about the lack of documentation changes
associated with the final patch. We don't necessarily need to eradicate
every mention of "master" from the documentation, but I think we do need
to make sure that examples and instructions are consistent with how Git
will actually behave. And that does need to happen at the same time as
the user-visible flip of the default.

I'm on the fence whether there should be a deprecation period or major
version bump for the final patch, but making the tests flexible enough
to handle the before and after state seems like it can be done uncoupled
from the actual default-flip.

-Peff

^ permalink raw reply	[flat|nested] 163+ messages in thread

* Re: [RFC/PATCH] tests: support testing with an arbitrary default branch (sort of)
  2020-11-13 19:14       ` Jeff King
@ 2020-11-13 22:00         ` Johannes Schindelin
  2020-11-13 22:39           ` Johannes Schindelin
                             ` (2 more replies)
  0 siblings, 3 replies; 163+ messages in thread
From: Johannes Schindelin @ 2020-11-13 22:00 UTC (permalink / raw)
  To: Jeff King; +Cc: Ævar Arnfjörð Bjarmason, git, Junio C Hamano

[-- Attachment #1: Type: text/plain, Size: 5613 bytes --]

Hi Peff and Ævar,

On Fri, 13 Nov 2020, Jeff King wrote:

> On Fri, Nov 13, 2020 at 05:13:20PM +0100, Ævar Arnfjörð Bjarmason wrote:
>
> >  * A lot of tests (but a small minority of the total) have master
> >    "master" hardcoded in some way. We now inventory them in
> >    tests-that-need-master.txt, we can still remove the names from that
> >    file and manually change the code later, but this accomplishes a
> >    clean test run with a relatively easy-to-review diff.
> >
> >    We ignore GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=<name> when it comes
> >    to these files, unless
> >    GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME_HARDER=true is set.
>
> I'm confused how this is better. We could just be setting
> GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME at the top of those files, couldn't
> we? (Likewise, I think annotating individual scripts is more
> decentralized than a magic pattern in test-lib.sh, though it amounts to
> the same thing).

I considered this alternative very briefly, and rejected it immediately
because it would have implied a drawn-out limbo where the test suite will
be inconsistent. That's not what I want.

> And if I understand the current state of Dscho's patches, we don't
> _have_ to convert any tests right now. We could just annotate those
> scripts which are not yet converted to have them use the old name.

And that's what I did in some cases, see e.g. 5d5f4ea30de (t5411: finish
preparing for `main` being the default branch name, 2020-10-31).

It's just quite a ton of work to do this for all the affected test
scripts, and I wanted to automate as much as possible of that process so
that it'll be easier to cope with all the other topics that are in flight.

Therefore, I opted to "annotate the scripts" via a `case` in
`test-lib.sh`. It should be quite a bit easier to understand, too, for the
occasional reader, as it shows you the complete range of scripts that have
been handled so far.

> But I don't think we want to live in that state indefinitely. It's
> slightly annoying to have inconsistent naming within the tests. I'd be
> happy to switch individual tests at a leisurely pace over the next
> couple of months or whatever. But since Dscho has bothered to write all
> of the patches now, why not use them?

Yep, I am a bit puzzled why we need to consider other approaches. I would
have thought that the more pressing issue is to verify that I

1) caught all the necessary conversions,

2) did not miss any non-trivial adjustments (such as `naster` and aligned
   comments).

At the same time, I am quite thankful for all the help Ævar provided;
mentioning that I missed `naster` in t1400 was definitely super helpful.

> I'm much more concerned about the lack of documentation changes
> associated with the final patch. We don't necessarily need to eradicate
> every mention of "master" from the documentation, but I think we do need
> to make sure that examples and instructions are consistent with how Git
> will actually behave. And that does need to happen at the same time as
> the user-visible flip of the default.

I am sorry. This is totally my fault. I should have described this much
better in the cover letter. This patch series deliberately omits all the
documentation changes.

I _did_ prepare them, they are pretty much ready-to-go, as part of the
`inclusive-naming` branch I track in
https://github.com/gitgitgadget/git/pull/655 (I use the branch name
`use-main-as-default-branch-name-docs` in the `inclusive-naming` branch
thicket to track the documentation changes).

The decision to separate them out into their own patch series was made
consciously, to avoid having one big, honking, totally unreviewably large
patch series.

Therefore, just like I fed the preparatory patch series in a slow cadence,
I planned on feeding the `-docs` patch series once the dust settles on
this patch series (i.e. once it hits `next`).

> I'm on the fence whether there should be a deprecation period or major
> version bump for the final patch, but making the tests flexible enough
> to handle the before and after state seems like it can be done uncoupled
> from the actual default-flip.

Hmm. On that matter, I wonder what the big fuss is all about. It's not
like Git is forcing anybody to change their default branch. That's not at
all what we're doing. To the contrary: _after_ many projects chose to
change their default branch names, and _after_ GitHub started to follow
that trend, Git added support for `init.defaultBranch` to accommodate that
use case better. So in a sense, we're actually pretty late changing the
fall-back of `init.defaultBranch`, at least from the perspective outside
of the Git project.

There have been plenty of articles about this in the meantime, too, and
I could imagine that most developers are at least aware that the shift
away from `master` is happening, in many quite visible projects.

So to me, this whole discussion about whether this should bump the major
version of Git seems a bit overblown. It's not like the median developer
is creating new repositories on a regular basis, and if they do, chances
are that they go with whatever branch name happens to be the initial one.

What is much more common is that developers clone existing projects. And
guess what, many of those projects already use a different default branch
name. And developers seem to accept that and just go on with their lives.

If it was up to me, I would reserve a major version increment to much
bigger changes.

Ciao,
Dscho

^ permalink raw reply	[flat|nested] 163+ messages in thread

* Re: [RFC/PATCH] tests: support testing with an arbitrary default branch (sort of)
  2020-11-13 22:00         ` Johannes Schindelin
@ 2020-11-13 22:39           ` Johannes Schindelin
  2020-11-13 23:49           ` Ævar Arnfjörð Bjarmason
  2020-11-14  0:25           ` Felipe Contreras
  2 siblings, 0 replies; 163+ messages in thread
From: Johannes Schindelin @ 2020-11-13 22:39 UTC (permalink / raw)
  To: Jeff King; +Cc: Ævar Arnfjörð Bjarmason, git, Junio C Hamano

Hi Peff,

On Fri, 13 Nov 2020, Johannes Schindelin wrote:

> On Fri, 13 Nov 2020, Jeff King wrote:
>
> > I'm on the fence whether there should be a deprecation period or major
> > version bump for the final patch, but making the tests flexible enough
> > to handle the before and after state seems like it can be done uncoupled
> > from the actual default-flip.
>
> [...] It's not like the median developer is creating new repositories on
> a regular basis, and if they do, chances are that they go with whatever
> branch name happens to be the initial one.
>
> What is much more common is that developers clone existing projects. And
> guess what, many of those projects already use a different default branch
> name. And developers seem to accept that and just go on with their lives.

After sending off this mail, I felt a bit bad about not backing this up
with data.

Whatever telemetry I would be able to pull would not be representative,
and I would not be at liberty to share it anyway. So I asked Alex Mullans
of GitHub (who is in charge of the default branch name switch to `main`
there) whether he has any data I could share publicly and he said: "Across
GitHub, 1/4 of daily pushes (and growing) go to `main`."

Seeing as the branch name to be used in newly-created repositories on
GitHub changed only very recently (October 1st, i.e. some 6 weeks ago), I
highly suspect that this number means that _a lot_ of existing projects
have changed their primary branch name to `main`, and seem to be quite
happy with it.

All this is to say that I consider it unnecessary to have a long
deprecation period or major version bump for this patch series, based on
available public data. The name `main` is already in wide-spread use (and
growing) as primary branch name of Git projects.

Ciao,
Dscho

^ permalink raw reply	[flat|nested] 163+ messages in thread

* Re: [RFC/PATCH] tests: support testing with an arbitrary default branch (sort of)
  2020-11-13 22:00         ` Johannes Schindelin
  2020-11-13 22:39           ` Johannes Schindelin
@ 2020-11-13 23:49           ` Ævar Arnfjörð Bjarmason
       [not found]             ` <nycvar.QRO.7.76.6.2011162118060.18437@tvgsbejvaqbjf.bet>
  2020-11-14  0:25           ` Felipe Contreras
  2 siblings, 1 reply; 163+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2020-11-13 23:49 UTC (permalink / raw)
  To: Johannes Schindelin
  Cc: Jeff King, git, Junio C Hamano, Theodore Ts'o,
	Don Goodman-Wilson, brian m. carlson, Felipe Contreras


On Fri, Nov 13 2020, Johannes Schindelin wrote:

> Hi Peff and Ævar,
>
> On Fri, 13 Nov 2020, Jeff King wrote:
>
>> On Fri, Nov 13, 2020 at 05:13:20PM +0100, Ævar Arnfjörð Bjarmason wrote:
>>
>> >  * A lot of tests (but a small minority of the total) have master
>> >    "master" hardcoded in some way. We now inventory them in
>> >    tests-that-need-master.txt, we can still remove the names from that
>> >    file and manually change the code later, but this accomplishes a
>> >    clean test run with a relatively easy-to-review diff.
>> >
>> >    We ignore GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=<name> when it comes
>> >    to these files, unless
>> >    GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME_HARDER=true is set.
>>
>> I'm confused how this is better. We could just be setting
>> GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME at the top of those files, couldn't
>> we? (Likewise, I think annotating individual scripts is more
>> decentralized than a magic pattern in test-lib.sh, though it amounts to
>> the same thing).
>
> I considered this alternative very briefly, and rejected it immediately
> because it would have implied a drawn-out limbo where the test suite will
> be inconsistent. That's not what I want.
>
>> And if I understand the current state of Dscho's patches, we don't
>> _have_ to convert any tests right now. We could just annotate those
>> scripts which are not yet converted to have them use the old name.
>
> And that's what I did in some cases, see e.g. 5d5f4ea30de (t5411: finish
> preparing for `main` being the default branch name, 2020-10-31).
>
> It's just quite a ton of work to do this for all the affected test
> scripts, and I wanted to automate as much as possible of that process so
> that it'll be easier to cope with all the other topics that are in flight.
>
> Therefore, I opted to "annotate the scripts" via a `case` in
> `test-lib.sh`. It should be quite a bit easier to understand, too, for the
> occasional reader, as it shows you the complete range of scripts that have
> been handled so far.
>
>> But I don't think we want to live in that state indefinitely. It's
>> slightly annoying to have inconsistent naming within the tests. I'd be
>> happy to switch individual tests at a leisurely pace over the next
>> couple of months or whatever. But since Dscho has bothered to write all
>> of the patches now, why not use them?
>
> Yep, I am a bit puzzled why we need to consider other approaches. I would
> have thought that the more pressing issue is to verify that I
>
> 1) caught all the necessary conversions,
>
> 2) did not miss any non-trivial adjustments (such as `naster` and aligned
>    comments).
>
> At the same time, I am quite thankful for all the help Ævar provided;
> mentioning that I missed `naster` in t1400 was definitely super helpful.

Not being up-to-date on this whole s/master/main/g discussion, is the
context here that we've essentially pre-approved these patches & doc for
integration into the next release? If so I really don't mind doing it
this way.

I started poking at this because I noticed that on git.git's master
branch tests were being skipped due to PREPARE_FOR_MAIN_BRANCH, so it's
in some in-between state between patch serieses.

We're now in week 4/9 of a release cycle for 2.30 (or 3.00 or
whatever). I hope the one thing people for & against this master/main
change can agree on is that it would be bad to ship a git with an
incomplete migration to "main", e.g. the 28/28 patch here which changes
it but without any doc updates.

I may be reading this wrong, but it seems
pr-762/dscho/use-main-as-default-branch-name-v1...remotes/dscho/inclusive-naming
(which I'm assuming is what's left) is another ~30k line diff on top of
this ~25k one.

So yes I'm very late to the discussion, sorry about that. I'm just
chiming in to say that if we're doing this as part of our regular patch
review front-loading these massive search/replace changes seems to be
too much of a change for one cycle.

But if Junio's going to chime in to say he's applying it all I don't
care & don't have any concern about it.

>> I'm much more concerned about the lack of documentation changes
>> associated with the final patch. We don't necessarily need to eradicate
>> every mention of "master" from the documentation, but I think we do need
>> to make sure that examples and instructions are consistent with how Git
>> will actually behave. And that does need to happen at the same time as
>> the user-visible flip of the default.
>
> I am sorry. This is totally my fault. I should have described this much
> better in the cover letter. This patch series deliberately omits all the

Ditto in my hastily-written RFC commit message. A better summary is:

 * Yours: All tests depend on master changed to all tests depend on main
 * Mine (well, partway there): You can set $ANY_NAME for the branch, but
   we blacklist some as being hardcoded on <name> (which I just left at
   master).

   This means we can test e.g. non-ASCII default branch names. It seems
   better to me if we're going to s/master/something/g & review it to
   have that something be \$GIT_TEST_MAIN (or another variable). Then we
   can mark that test as "accepts any default branch name" and move on.

 * Yours: Requires not running some tests while we wait for this to land
 * Mine: Run all tests & mark them as we go along for
   master||$NEWNAME. Similar to the test protocol v2 refactoring

But yeah e.g. the t/tests-that-need-master.txt I added in my RFC is
better marked in the test itself, I should have stolen your 'case
"$TEST_NUMBER"' way of doing it.

In my defense I honestly managed to miss it in skimming the ginormous
diff, which I think makes part of my argument here :)

> I _did_ prepare them, they are pretty much ready-to-go, as part of the
> `inclusive-naming` branch I track in
> https://github.com/gitgitgadget/git/pull/655 (I use the branch name
> `use-main-as-default-branch-name-docs` in the `inclusive-naming` branch
> thicket to track the documentation changes).
>
> The decision to separate them out into their own patch series was made
> consciously, to avoid having one big, honking, totally unreviewably large
> patch series.
>
> Therefore, just like I fed the preparatory patch series in a slow cadence,
> I planned on feeding the `-docs` patch series once the dust settles on
> this patch series (i.e. once it hits `next`).

On the topic of deprecation etc.:

>> I'm on the fence whether there should be a deprecation period or major
>> version bump for the final patch, but making the tests flexible enough
>> to handle the before and after state seems like it can be done uncoupled
>> from the actual default-flip.
>
> Hmm. On that matter, I wonder what the big fuss is all about. It's not
> like Git is forcing anybody to change their default branch. That's not at
> all what we're doing. To the contrary: _after_ many projects chose to
> change their default branch names, and _after_ GitHub started to follow
> that trend, Git added support for `init.defaultBranch` to accommodate that
> use case better. So in a sense, we're actually pretty late changing the
> fall-back of `init.defaultBranch`, at least from the perspective outside
> of the Git project.
>
> There have been plenty of articles about this in the meantime, too, and
> I could imagine that most developers are at least aware that the shift
> away from `master` is happening, in many quite visible projects.
>
> So to me, this whole discussion about whether this should bump the major
> version of Git seems a bit overblown. It's not like the median developer
> is creating new repositories on a regular basis, and if they do, chances
> are that they go with whatever branch name happens to be the initial one.
>
> What is much more common is that developers clone existing projects. And
> guess what, many of those projects already use a different default branch
> name. And developers seem to accept that and just go on with their lives.
>
> If it was up to me, I would reserve a major version increment to much
> bigger changes.
>
[I'm continuing quoting you here from your downthread
<nycvar.QRO.7.76.6.2011132324070.18437@tvgsbejvaqbjf.bet>]

> Whatever telemetry I would be able to pull would not be representative,
> and I would not be at liberty to share it anyway. So I asked Alex Mullans
> of GitHub (who is in charge of the default branch name switch to `main`
> there) whether he has any data I could share publicly and he said: "Across
> GitHub, 1/4 of daily pushes (and growing) go to `main`."
> 
> Seeing as the branch name to be used in newly-created repositories on
> GitHub changed only very recently (October 1st, i.e. some 6 weeks ago), I
> highly suspect that this number means that _a lot_ of existing projects
> have changed their primary branch name to `main`, and seem to be quite
> happy with it.
> 
> All this is to say that I consider it unnecessary to have a long
> deprecation period or major version bump for this patch series, based on
> available public data. The name `main` is already in wide-spread use (and
> growing) as primary branch name of Git projects.

All of that's true, but I really don't see how it's relevant to the
change we're discussing making to refs.c in git.git, which from my
generous reading of some of the threads in objection to this is the main
point of contention.

(I'm generously not engaging with some of the more howler-monkey esque
replies we've had on-list from people who seemed to have no idea what
was actually being proposed in git.git)

*That* change is not whether we approve of people using "main", or
hosting sites like GitHub etc. making it the default.

I think it's fair to say that even in some alternate universe where the
particular reasons we're switching away from "master" didn't exist and
e.g. GitHub et al had just decided on this out of the blue based on an
aesthetic preference we'd just say "uh, sure, whatever, you configure it
how you want".

Rather, we're talking about what happens when you run "git init".

Most people who are using or creating git repositories are nowadays
never going to be impacted by what "git init" does. So I think the data
you're citing here doesn't support your argument at all, it does the
opposite.

The people using these repositories with "main" on GitHub did not do so
with a patch to "git init". They clicked a button in the UI, or
copy/pasted GitHub's "how to create a local repo" which nowadays will
manually set the branch to "main" before pushing.

Then who's using "git init" who's going to be impacted by this change?
It's everyone else, like probably tens of tens of thousands of one-off
cronjobs somewhere creating a daily report of some by "init && commit &&
git diff master..".

I'm on the fence about what we should do in that case, but I'm leaning
towards some deprecation period or at least some other approach than a
s/master/main/g change precisely because of the numbers you're citing.

Because they shows how irrelevant the default shipped with git.git is to
users who want this s/master/main/g change in repositories they
regularly use. So we're really mostly talking about an impact to scripts
& some advanced users, both of who have a pretty good argument for
"init"'s default being what's been explicitly documented for ages in its
manpage.

Even if we want to just change it I think it's uncharitable to those
people not to at least consider throwing them some bone. E.g. "init"
could use the old default when it's not connected to a terminal, we
could show an advice notice and sleep(5) saying we're using a new
default etc. etc.

^ permalink raw reply	[flat|nested] 163+ messages in thread

* Re: [RFC/PATCH] tests: support testing with an arbitrary default branch (sort of)
  2020-11-13 22:00         ` Johannes Schindelin
  2020-11-13 22:39           ` Johannes Schindelin
  2020-11-13 23:49           ` Ævar Arnfjörð Bjarmason
@ 2020-11-14  0:25           ` Felipe Contreras
  2 siblings, 0 replies; 163+ messages in thread
From: Felipe Contreras @ 2020-11-14  0:25 UTC (permalink / raw)
  To: Johannes Schindelin
  Cc: Jeff King, Ævar Arnfjörð Bjarmason, Git, Junio C Hamano

On Fri, Nov 13, 2020 at 4:05 PM Johannes Schindelin
<Johannes.Schindelin@gmx.de> wrote:
> On Fri, 13 Nov 2020, Jeff King wrote:

> > I'm on the fence whether there should be a deprecation period or major
> > version bump for the final patch, but making the tests flexible enough
> > to handle the before and after state seems like it can be done uncoupled
> > from the actual default-flip.
>
> Hmm. On that matter, I wonder what the big fuss is all about. It's not
> like Git is forcing anybody to change their default branch.

Except you are, and you will be doing it without the user consent, and
without warning. This is the opposite of what any software project
that cares about its users should do.

The consequences are predictable.

Exactly the same argument was used in 2008, and it was wrong for
exactly the same reasons.

Yes, people could add the exec-path to their PATH, so "nobody was
being forced" ultimately, but that's missing the point entirely,
because that happened *after* they were forced initially, and being
caught completely off guard.

> There have been plenty of articles about this in the meantime, too, and
> I could imagine that most developers are at least aware that the shift
> away from `master` is happening, in many quite visible projects.

I have used Git since 2005, contributed since 2009, follow the git
subreddit, and I was not aware of the change, and presumably neither
was Ævar.

What you imagine most developers know is irrelevant, what is relevant
is what they actually know.

This is the bias known as the curse of knowledge: since you have a lot
of specific knowledge you fail to see how other people could not see
the same thing you are seeing, but they don't, and the reason is that
they don't have the same knowledge as you.

But just because you can't see it happen, doesn't mean it can't.

It did in 2008, and people back then used the same argument you are using now.

Developers back then could not imagine how it was possible that users
were not aware of the upcoming change that had been cooking for years,
but alas they did not.

Do not assume what your users know. Deprecation periods exist for a
reason, and so do warnings.

-- 
Felipe Contreras

^ permalink raw reply	[flat|nested] 163+ messages in thread

* Re: [PATCH 00/28] Use main as default branch name
  2020-11-12 22:43 [PATCH 00/28] Use main as default branch name Johannes Schindelin via GitGitGadget
                   ` (29 preceding siblings ...)
  2020-11-13 12:55 ` Ævar Arnfjörð Bjarmason
@ 2020-11-14  6:13 ` Junio C Hamano
  2020-11-16 19:52   ` Junio C Hamano
  2020-11-17 16:12 ` [PATCH v2 00/27] tests: use " Johannes Schindelin via GitGitGadget
  2020-11-17 20:48 ` [PATCH 00/28] Use " Eric W. Biederman
  32 siblings, 1 reply; 163+ messages in thread
From: Junio C Hamano @ 2020-11-14  6:13 UTC (permalink / raw)
  To: Johannes Schindelin via GitGitGadget; +Cc: git, Johannes Schindelin

"Johannes Schindelin via GitGitGadget" <gitgitgadget@gmail.com>
writes:

> This is the big one. This changes the default of init.defaultBranch to main,
> reflecting what many open source projects already did (which was followed by
> GitHub, Azure Repos and others).

I'll keep this brief as I'm still offline/vacation til next week.

As other people already said, I'd prefer to see

 - all tests updated to work, without losing any coverage,
   regardless of the default for the init.defaultbranch is.  

   Some test scripts may require setting init.defaultBranch='master'
   at the top in the 'setup' part (I've shown how in my response to
   t4013 patchset) if the body of the test relies too heavily on the
   primary branch to be 'master'.  On the other hand, some test
   scripts may require setting init.defaultBranch='main' at the top,
   if they have been converted to work _only_ with 'main'.

   Both of these are unfortunate, but it is much better than losing
   test coverage during the test update effort.

   Some test scripts may not need any "this test would only work
   with 'master|main', so we are forcing".  After your test update
   series so far, hopefully many may already be ready to be force to
   'main' even when the Git binary may still use 'master' as the
   fallback default for init.defaultBranch.

 - a well thought-out transition plan (including user education and
   publicity), with the final "flip of the fallback default".

and I'd strongly prefer that these two to be done separately.  Since
we cannot anticipate how long the latter would take with unknown
amount of distraction, I'd prefer 100% of our tests keep working
while the fallback default for init.defaultBranch is 'master', and
they still work on the flag day when the default is changed to 'main'
(or 'primary' for that matter---after all, tests that care too deeply
what the primary branch name is, and have been updated to eradicate
'master' from them, would be forcing 'main', so the hardcoded
fallback default in our binary should not matter).

Thanks.

^ permalink raw reply	[flat|nested] 163+ messages in thread

* Re: [PATCH 00/28] Use main as default branch name
  2020-11-14  6:13 ` Junio C Hamano
@ 2020-11-16 19:52   ` Junio C Hamano
  2020-11-17 16:10     ` Johannes Schindelin
  0 siblings, 1 reply; 163+ messages in thread
From: Junio C Hamano @ 2020-11-16 19:52 UTC (permalink / raw)
  To: Johannes Schindelin via GitGitGadget; +Cc: git, Johannes Schindelin

Junio C Hamano <gitster@pobox.com> writes:

>    Some test scripts may require setting init.defaultBranch='master'
>    at the top in the 'setup' part (I've shown how in my response to
>    t4013 patchset) if the body of the test relies too heavily on the
>    primary branch to be 'master'.

Ah, I realized we have much better mechanism already in the form of
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME environment.

So, my three wishes in this message now become

 - lose PREPARE_FOR_MAIN_BRANCH prerequisite as quickly as possible
   by doing the following two.

 - Use that mechanism to force 'main' in test scripts that now only
   can work with 'main', even before we change the fallback default
   from master to main in the production code, so that we won't lose
   test coverage.

 - The same for test scripts that are not converted yet to force use
   of 'master', so that we could change the fallback default from
   master to main in the production code even before converting
   these other scripts, so that we won't lose test coverage.

Thanks.

^ permalink raw reply	[flat|nested] 163+ messages in thread

* Re: [PATCH 28/28] Change the default branch name to `main`
  2020-11-13 14:09     ` Johannes Schindelin
@ 2020-11-16 20:04       ` Junio C Hamano
  0 siblings, 0 replies; 163+ messages in thread
From: Junio C Hamano @ 2020-11-16 20:04 UTC (permalink / raw)
  To: Johannes Schindelin
  Cc: Ævar Arnfjörð Bjarmason,
	Don Goodman-Wilson via GitGitGadget, git, Don Goodman-Wilson

Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:

> Hi Ævar,
>
> On Fri, 13 Nov 2020, Ævar Arnfjörð Bjarmason wrote:
>
>>
>> On Thu, Nov 12 2020, Don Goodman-Wilson via GitGitGadget wrote:
>>
>> > The current default name for the initial branch is a loaded term, and
>> > many Open Source projects renamed their principal branches already. A
>> > common choice appears to be `main`.
>> >
>> > Let's follow their lead and change the default of `init.defaultBranch`.
>>
>> I think it makes sense to split this change off from a 28-series test
>> cleanup series.
>
> It is not a test cleanup. It is a series of 27 patches preparing the test
> suite for the change made in the 28th patch.
>
> I don't think that it is a good idea to split off that 28th patch from
> the patches whose entire purpose is to prepare for that 28th patch.

Well, I personally think that the "purpose" of the first 27 patches
must be updated if that is the case.  

The test should NOT be prepared only to work in the post "switch
from master to main" world.

Instead, what we want to see is that the test would work whether the
fallback default value for init.defaultBranch is 'master' (i.e. old
world) or 'main (i.e. a possible new world).  Perhaps by using the
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME mechanism for tests that relies
on a particular value to be the fallback default.  So in the sense,
the goal the first 26 patches support is the 27th one, which is the
most important one in the series from _my_ point of view.  We get
ourselves prepared so that 28th one can happen at any time.

That way, as long as the first 27 patches land, we will keep the
same test coverage as we've always had, regardless of the timing
we actually ship the 28th one to the production environment.

> Personally, I would have used something like
>
> 		main=$(git symbolic-ref --short HEAD) &&
> 		[...]
> 		git checkout $main
>
> instead of what you suggested. That's a topic for another patch (series),
> though.

Yeah, I would have used $primary or some word that is neither these
m* names, but I think that is a good alternative, when workable, to
the GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME mechanism.  When the golden
master compared with actual output hardcodes the expected branch
names, however, the approach becomes awkward, though.

Thanks.

^ permalink raw reply	[flat|nested] 163+ messages in thread

* Re: [PATCH 14/28] t55[23]*: adjust the references to the default branch name "main"
  2020-11-13 10:02   ` Ævar Arnfjörð Bjarmason
  2020-11-13 14:18     ` Johannes Schindelin
@ 2020-11-16 20:07     ` Junio C Hamano
  1 sibling, 0 replies; 163+ messages in thread
From: Junio C Hamano @ 2020-11-16 20:07 UTC (permalink / raw)
  To: Ævar Arnfjörð Bjarmason
  Cc: Johannes Schindelin via GitGitGadget, git, Johannes Schindelin

Ævar Arnfjörð Bjarmason <avarab@gmail.com> writes:

> Is there some meaning to the name "nain" and "naster" that I'm missing?

Not for "naster", which came from me who just chose "any single
letter" followed by "aster" to match 'master', and there is no other
reason.  I think Dscho just followed suit.

> If not can we just call this "topic" or something while we're at it?
> I.e. this on top (just s/nain/topic/g):
>
> diff --git a/t/t5533-push-cas.sh b/t/t5533-push-cas.sh
> index 9fcec604c3..4e33ec1fb9 100755
> --- a/t/t5533-push-cas.sh
> +++ b/t/t5533-push-cas.sh
> @@ -201,12 +201,12 @@ test_expect_success 'cover everything with default force-with-lease (protected)'
>  	setup_srcdst_basic &&
>  	(
>  		cd src &&
> -		git branch nain main^
> +		git branch topic main^
>  	) &&
>  	git ls-remote src refs/heads/\* >expect &&
>  	(
>  		cd dst &&
> -		test_must_fail git push --force-with-lease origin main main:nain
> +		test_must_fail git push --force-with-lease origin main main:topic
>  	) &&
>  	git ls-remote src refs/heads/\* >actual &&
>  	test_cmp expect actual
> @@ -216,16 +216,16 @@ test_expect_success 'cover everything with default force-with-lease (allowed)' '
>  	setup_srcdst_basic &&
>  	(
>  		cd src &&
> -		git branch nain main^
> +		git branch topic main^
>  	) &&
>  	(
>  		cd dst &&
>  		git fetch &&
> -		git push --force-with-lease origin main main:nain
> +		git push --force-with-lease origin main main:topic
>  	) &&
>  	git ls-remote dst refs/heads/main |
> -	sed -e "s/main/nain/" >expect &&
> -	git ls-remote src refs/heads/nain >actual &&
> +	sed -e "s/main/topic/" >expect &&
> +	git ls-remote src refs/heads/topic >actual &&
>  	test_cmp expect actual
>  '
>  

^ permalink raw reply	[flat|nested] 163+ messages in thread

* Re: [PATCH 00/28] Use main as default branch name
  2020-11-16 19:52   ` Junio C Hamano
@ 2020-11-17 16:10     ` Johannes Schindelin
  2020-11-17 19:09       ` Junio C Hamano
  0 siblings, 1 reply; 163+ messages in thread
From: Johannes Schindelin @ 2020-11-17 16:10 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Johannes Schindelin via GitGitGadget, git

Hi Junio,

On Mon, 16 Nov 2020, Junio C Hamano wrote:

> Junio C Hamano <gitster@pobox.com> writes:
>
> >    Some test scripts may require setting init.defaultBranch='master'
> >    at the top in the 'setup' part (I've shown how in my response to
> >    t4013 patchset) if the body of the test relies too heavily on the
> >    primary branch to be 'master'.
>
> Ah, I realized we have much better mechanism already in the form of
> GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME environment.
>
> So, my three wishes in this message now become
>
>  - lose PREPARE_FOR_MAIN_BRANCH prerequisite as quickly as possible

Okay, we're on the same page here.

>    by doing the following two.

A couple of test cases already have the `PREPARE_FOR_MAIN_BRANCH` prereq
(in preparation for transitioning the test suite, which is what I will
settle for in v2 of this patch series). Most notably, t5526 and t9902,
which I had to exclude to avoid clashing with branches that are currently
in flight.

So my goal is to transition the test suite as quickly as possible, by
first converting the majority in v2 of this patch series, and then
handling the rest of the test scripts individually, on top of the
in-flight topics.

>  - Use that mechanism to force 'main' in test scripts that now only
>    can work with 'main', even before we change the fallback default
>    from master to main in the production code, so that we won't lose
>    test coverage.

That's precisely what I do, incrementally, by adjusting that `case`
statement in `t/test-lib.sh` whenever a range of test scripts has been
transitioned. In patch 2/28, it looks like this:

	case "$TEST_NUMBER" in
	[01]*)
	       GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
	       export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
	       ;;
	esac

By patch 26/28, it looks like this:

	case "$TEST_NUMBER" in
	3404|4013|5310|5526|6300|7064|7817|9902)
		# Avoid conflicts with patch series that are cooking at the same
		# time
		# as the patch series changing the default of
		# `init.defaultBranch`.
		GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
		export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
		;;
	*)
		GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
		export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
		;;
	esac

>  - The same for test scripts that are not converted yet to force use
>    of 'master', so that we could change the fallback default from
>    master to main in the production code even before converting
>    these other scripts, so that we won't lose test coverage.

Okay, I could have done it that way by starting with

	case "$TEST_NUMBER" in
	[01]*)
		GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
		export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
		;;
	*)
		GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
		export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
		;;
	esac

But that would result in a funny-looking intermediate state with a
`master` arm, then `main`, then again `master`.

Besides, it would be more complicated because t/t5411-proc-receive-hook.sh
and t/t5515-fetch-merge-logic.sh already ask for `main`, but by setting it
before sourcing `test-lib.sh`, and therefore we would have to special-case
them in that `case` from the get-go.

Therefore, in the interest of making this patch series _slightly_ easier
to review (you still have to look at the _bottom_ of most of those patches
to catch the crucial change to `t/test-lib.sh`), I would like to keep the
patch series in the current shape.

Will send v2 in a moment.

Thanks,
Dscho

^ permalink raw reply	[flat|nested] 163+ messages in thread

* [PATCH v2 00/27] tests: use main as default branch name
  2020-11-12 22:43 [PATCH 00/28] Use main as default branch name Johannes Schindelin via GitGitGadget
                   ` (30 preceding siblings ...)
  2020-11-14  6:13 ` Junio C Hamano
@ 2020-11-17 16:12 ` Johannes Schindelin via GitGitGadget
  2020-11-17 16:12   ` [PATCH v2 01/27] t0060: preemptively adjust alignment Johannes Schindelin via GitGitGadget
                     ` (28 more replies)
  2020-11-17 20:48 ` [PATCH 00/28] Use " Eric W. Biederman
  32 siblings, 29 replies; 163+ messages in thread
From: Johannes Schindelin via GitGitGadget @ 2020-11-17 16:12 UTC (permalink / raw)
  To: git
  Cc: Felipe Contreras, Ævar Arnfjörð Bjarmason,
	Johannes Schindelin, Jeff King, Johannes Schindelin

This (big) patch series (almost) concludes the transition of Git's test
suite to use init.defaultBranch=main that was started in 
js/default-branch-name-part-4-minus-1, continued in 
js/default-branch-name-adjust-t5411 and in 
js/default-branch-name-adjust-t5515. This transition prepares for changing
the fall-back value of init.defaultBranch accordingly (which will be done in
a different set of patch series, with an appropriate deprecation period),
reflecting what many open source projects already did followed by GitHub,
Azure Repos and others.

Instead of one huge patch that reflects essentially a search-and-replace in
the test suite, this patch series splits the changes up into chunks that are
intended to be smaller than 100kB so that they are not rejected by the Git
mailing list. Interspersed between those changes are adjustments e.g. in
alignment, to make it easier to review (or recreate) the search-and-replace
patches.

Note that this branch is based on next, mostly because it would otherwise
conflict with en/merge-tests, jk/diff-release-filespec-fix and 
ds/maintenance-part-3.

To avoid even more conflicts with topics that did not even make it to seen 
yet, this patch series specifically excludes t3404, t4013, t5310, t5526,
t6300, t7064, t7817, t9902: in those test scripts, we will still use master 
for the time being. Once the topics in question have settled, I will send
the appropriate follow-up patches to adjust them to use main instead.

Note that even after this patch series, master is still found in t/, even
outside of the tests we excluded specifically to avoid conflicts with other
patch series that are currently in flight: t/perf/, the git p4 tests
(because git p4 still uses p4/master to refer to the remote main branch),
and some comments still refer to this name. I intend to address at least
some of those, in patch series separate from the current one.

Changes since v1:

 * Dropped the commit changing the default initial branch name for git init.
 * Adjusted the patch for t1402 to also replace naster by nain.
 * Excluded t5526 from the patches for now, to avoid clashing with 
   pk/subsub-fetch-fix.

Johannes Schindelin (27):
  t0060: preemptively adjust alignment
  t[01]*: adjust the references to the default branch name "main"
  t2*: adjust the references to the default branch name "main"
  t3[0-3]*: adjust the references to the default branch name "main"
  t3416: preemptively adjust alignment in a comment
  t34*: adjust the references to the default branch name "main"
  t3[5-9]*: adjust the references to the default branch name "main"
  t4*: adjust the references to the default branch name "main"
  t5323: prepare centered comment for `master` -> `main`
  t5[0-4]*: adjust the references to the default branch name "main"
  t5503: prepare aligned comment for replacing `master` with `main`
  t550*: adjust the references to the default branch name "main"
  t551*: adjust the references to the default branch name "main"
  t55[23]*: adjust the references to the default branch name "main"
  t55[4-9]*: adjust the references to the default branch name "main"
  t5[6-9]*: adjust the references to the default branch name "main"
  t6[0-3]*: adjust the references to the default branch name "main"
  t64*: preemptively adjust alignment to prepare for `master` -> `main`
  t6[4-9]*: adjust the references to the default branch name "main"
  t7[0-4]*: adjust the references to the default branch name "main"
  t7[5-9]*: adjust the references to the default branch name "main"
  t8*: adjust the references to the default branch name "main"
  t9[0-4]*: adjust the references to the default branch name "main"
  t9[5-7]*: adjust the references to the default branch name "main"
  tests(git-p4): transition to the default branch name `main`
  t99*: adjust the references to the default branch name "main"
  tests: drop prereq `PREPARE_FOR_MAIN_BRANCH` where no longer needed

 t/annotate-tests.sh                           |   8 +-
 t/lib-cvs.sh                                  |   2 +-
 t/t0002-gitfile.sh                            |   6 +-
 t/t0020-crlf.sh                               |   8 +-
 t/t0021-conversion.sh                         |  40 +-
 t/t0027-auto-crlf.sh                          |   4 +-
 t/t0028-working-tree-encoding.sh              |   4 +-
 t/t0041-usage.sh                              |  10 +-
 t/t0050-filesystem.sh                         |   6 +-
 t/t0060-path-utils.sh                         |   4 +-
 t/t0100-previous.sh                           |  18 +-
 t/t1004-read-tree-m-u-wf.sh                   |  40 +-
 t/t1008-read-tree-overlay.sh                  |   2 +-
 t/t1009-read-tree-new-index.sh                |   4 +-
 t/t1011-read-tree-sparse-checkout.sh          |   2 +-
 t/t1021-rerere-in-workdir.sh                  |   2 +-
 t/t1090-sparse-checkout-scope.sh              |  10 +-
 t/t1091-sparse-checkout-builtin.sh            |   2 +-
 t/t1300-config.sh                             |   8 +-
 t/t1301-shared-repo.sh                        |   4 +-
 t/t1305-config-include.sh                     |   2 +-
 t/t1309-early-config.sh                       |   4 +-
 t/t1400-update-ref.sh                         |  72 +--
 t/t1402-check-ref-format.sh                   |  32 +-
 t/t1403-show-ref.sh                           |  18 +-
 t/t1405-main-ref-store.sh                     |  42 +-
 t/t1406-submodule-ref-store.sh                |  30 +-
 t/t1407-worktree-ref-store.sh                 |  32 +-
 t/t1408-packed-refs.sh                        |  12 +-
 t/t1410-reflog.sh                             |  56 +-
 t/t1411-reflog-show.sh                        |   2 +-
 t/t1413-reflog-detach.sh                      |  24 +-
 t/t1414-reflog-walk.sh                        |  12 +-
 t/t1416-ref-transaction-hooks.sh              |  10 +-
 t/t1430-bad-ref-name.sh                       |  52 +-
 t/t1450-fsck.sh                               |   2 +-
 t/t1500-rev-parse.sh                          |   4 +-
 t/t1503-rev-parse-verify.sh                   |  28 +-
 t/t1505-rev-parse-last.sh                     |   8 +-
 t/t1506-rev-parse-diagnosis.sh                |   4 +-
 t/t1507-rev-parse-upstream.sh                 |  40 +-
 t/t1508-at-combinations.sh                    |  10 +-
 t/t1511-rev-parse-caret.sh                    |  26 +-
 t/t1512-rev-parse-disambiguation.sh           |   2 +-
 t/t1513-rev-parse-prefix.sh                   |   4 +-
 t/t1514-rev-parse-push.sh                     |  16 +-
 t/t1700-split-index.sh                        |   2 +-
 t/t2007-checkout-symlink.sh                   |  10 +-
 t/t2009-checkout-statinfo.sh                  |   8 +-
 t/t2010-checkout-ambiguous.sh                 |   4 +-
 t/t2011-checkout-invalid-head.sh              |  16 +-
 t/t2012-checkout-last.sh                      |  48 +-
 t/t2015-checkout-unborn.sh                    |   2 +-
 t/t2017-checkout-orphan.sh                    |  44 +-
 t/t2020-checkout-detach.sh                    |  28 +-
 t/t2022-checkout-paths.sh                     |  22 +-
 t/t2023-checkout-m.sh                         |  10 +-
 t/t2024-checkout-dwim.sh                      |  70 +--
 t/t2027-checkout-track.sh                     |   6 +-
 t/t2030-unresolve-info.sh                     |   6 +-
 t/t2060-switch.sh                             |  30 +-
 t/t2070-restore.sh                            |   4 +-
 t/t2106-update-index-assume-unchanged.sh      |   2 +-
 t/t2400-worktree-add.sh                       |  66 +--
 t/t2401-worktree-prune.sh                     |   2 +-
 t/t2402-worktree-list.sh                      |  20 +-
 t/t2405-worktree-submodule.sh                 |   6 +-
 t/t3040-subprojects-basic.sh                  |   2 +-
 t/t3200-branch.sh                             | 248 ++++-----
 t/t3201-branch-contains.sh                    |  82 +--
 t/t3202-show-branch-octopus.sh                |   2 +-
 t/t3203-branch-output.sh                      |  40 +-
 t/t3204-branch-name-interpretation.sh         |   6 +-
 t/t3205-branch-color.sh                       |   8 +-
 t/t3206-range-diff.sh                         |  40 +-
 t/t3206/history.export                        |   2 +-
 t/t3210-pack-refs.sh                          |   4 +-
 t/t3211-peel-ref.sh                           |   4 +-
 t/t3301-notes.sh                              |   6 +-
 t/t3302-notes-index-expensive.sh              |   2 +-
 t/t3303-notes-subtrees.sh                     |   8 +-
 t/t3304-notes-mixed.sh                        |   8 +-
 t/t3308-notes-merge.sh                        |   2 +-
 t/t3320-notes-merge-worktrees.sh              |   4 +-
 t/t3400-rebase.sh                             |  60 +--
 t/t3402-rebase-merge.sh                       |  44 +-
 t/t3403-rebase-skip.sh                        |   6 +-
 t/t3405-rebase-malformed.sh                   |   8 +-
 t/t3406-rebase-message.sh                     |  24 +-
 t/t3407-rebase-abort.sh                       |  18 +-
 t/t3408-rebase-multi-line.sh                  |   2 +-
 t/t3409-rebase-preserve-merges.sh             |  10 +-
 t/t3412-rebase-root.sh                        |  28 +-
 t/t3413-rebase-hook.sh                        |  42 +-
 t/t3415-rebase-autosquash.sh                  |   2 +-
 t/t3416-rebase-onto-threedots.sh              |  54 +-
 t/t3418-rebase-continue.sh                    |  24 +-
 t/t3419-rebase-patch-id.sh                    |  12 +-
 t/t3420-rebase-autostash.sh                   |   8 +-
 t/t3423-rebase-reword.sh                      |   6 +-
 t/t3427-rebase-subtree.sh                     |  20 +-
 t/t3430-rebase-merges.sh                      |  16 +-
 t/t3431-rebase-fork-point.sh                  |  32 +-
 t/t3432-rebase-fast-forward.sh                |  34 +-
 t/t3434-rebase-i18n.sh                        |   8 +-
 t/t3435-rebase-gpg-sign.sh                    |   4 +-
 t/t3436-rebase-more-options.sh                |   2 +-
 t/t3500-cherry.sh                             |  12 +-
 t/t3501-revert-cherry-pick.sh                 |   4 +-
 t/t3502-cherry-pick-merge.sh                  |   2 +-
 t/t3503-cherry-pick-root.sh                   |  10 +-
 t/t3504-cherry-pick-rerere.sh                 |  24 +-
 t/t3505-cherry-pick-empty.sh                  |  24 +-
 t/t3506-cherry-pick-ff.sh                     |   8 +-
 t/t3507-cherry-pick-conflict.sh               |   2 +-
 t/t3508-cherry-pick-many-commits.sh           |  38 +-
 t/t3509-cherry-pick-merge-df.sh               |   2 +-
 t/t3512-cherry-pick-submodule.sh              |   2 +-
 t/t3600-rm.sh                                 |  10 +-
 t/t3701-add-interactive.sh                    |   4 +-
 t/t3901-i18n-patch.sh                         |  40 +-
 t/t3903-stash.sh                              |  32 +-
 t/t3910-mac-os-precompose.sh                  |   6 +-
 t/t4014-format-patch.sh                       | 176 +++---
 t/t4015-diff-whitespace.sh                    |   2 +-
 t/t4017-diff-retval.sh                        |   2 +-
 t/t4038-diff-combined.sh                      |  14 +-
 t/t4041-diff-submodule-option.sh              |   2 +-
 t/t4048-diff-combined-binary.sh               |  10 +-
 t/t4052-stat-output.sh                        |   4 +-
 t/t4056-diff-order.sh                         |   2 +-
 t/t4057-diff-combined-paths.sh                |  20 +-
 t/t4061-diff-indent.sh                        |  24 +-
 t/t4066-diff-emit-delay.sh                    |   2 +-
 t/t4068-diff-symmetric-merge-base.sh          |  48 +-
 t/t4103-apply-binary.sh                       |  36 +-
 t/t4108-apply-threeway.sh                     |  14 +-
 t/t4121-apply-diffs.sh                        |   2 +-
 t/t4122-apply-symlink-inside.sh               |   6 +-
 t/t4150-am.sh                                 |  26 +-
 t/t4200-rerere.sh                             |  20 +-
 t/t4201-shortlog.sh                           |   2 +-
 t/t4202-log.sh                                | 106 ++--
 t/t4203-mailmap.sh                            |   2 +-
 t/t4204-patch-id.sh                           |  26 +-
 t/t4207-log-decoration-colors.sh              |   6 +-
 t/t4208-log-magic-pathspec.sh                 |   4 +-
 t/t4211/history.export                        |   2 +-
 t/t4214-log-graph-octopus.sh                  |   2 +-
 t/t4216-log-bloom.sh                          |   4 +-
 t/t4253-am-keep-cr-dos.sh                     |  20 +-
 t/t4257-am-interactive.sh                     |   2 +-
 t/t5150-request-pull.sh                       |  34 +-
 t/t5304-prune.sh                              |   2 +-
 t/t5305-include-tag.sh                        |   2 +-
 t/t5312-prune-corruption.sh                   |  16 +-
 t/t5317-pack-objects-filter-objects.sh        |   2 +-
 t/t5322-pack-objects-sparse.sh                |   2 +-
 t/t5323-pack-redundant.sh                     |  66 +--
 t/t5400-send-pack.sh                          |  60 +--
 t/t5401-update-hooks.sh                       |  24 +-
 t/t5402-post-merge-hook.sh                    |   2 +-
 t/t5403-post-checkout-hook.sh                 |   6 +-
 t/t5404-tracking-branches.sh                  |   8 +-
 t/t5405-send-pack-rewind.sh                   |   6 +-
 t/t5407-post-rewrite-hook.sh                  |   2 +-
 t/t5410-receive-pack-alternates.sh            |   4 +-
 t/t5500-fetch-pack.sh                         |  28 +-
 t/t5501-fetch-push-alternates.sh              |   4 +-
 t/t5502-quickfetch.sh                         |   6 +-
 t/t5503-tagfollow.sh                          |  12 +-
 t/t5504-fetch-receive-strict.sh               |  20 +-
 t/t5505-remote.sh                             | 148 +++---
 t/t5506-remote-groups.sh                      |   4 +-
 t/t5509-fetch-push-namespaces.sh              |  30 +-
 t/t5510-fetch.sh                              | 162 +++---
 t/t5511-refspec.sh                            |  12 +-
 t/t5512-ls-remote.sh                          |  26 +-
 t/t5514-fetch-multiple.sh                     |  30 +-
 t/t5516-fetch-push.sh                         | 500 +++++++++---------
 t/t5517-push-mirror.sh                        | 124 ++---
 t/t5518-fetch-exit-status.sh                  |   6 +-
 t/t5519-push-alternates.sh                    |  12 +-
 t/t5520-pull.sh                               |  30 +-
 t/t5521-pull-options.sh                       |  16 +-
 t/t5523-push-upstream.sh                      |  30 +-
 t/t5527-fetch-odd-refs.sh                     |  14 +-
 t/t5528-push-default.sh                       |  98 ++--
 t/t5529-push-errors.sh                        |   2 +-
 t/t5530-upload-pack-error.sh                  |   2 +-
 t/t5531-deep-submodule-push.sh                | 188 +++----
 t/t5533-push-cas.sh                           | 142 ++---
 t/t5534-push-signed.sh                        |   4 +-
 t/t5537-fetch-shallow.sh                      |  30 +-
 t/t5538-push-shallow.sh                       |  22 +-
 t/t5539-fetch-http-shallow.sh                 |  14 +-
 t/t5540-http-push-webdav.sh                   |   8 +-
 t/t5541-http-push-smart.sh                    |  40 +-
 t/t5542-push-http-shallow.sh                  |   8 +-
 t/t5543-atomic-push.sh                        |  80 +--
 t/t5545-push-options.sh                       |  62 +--
 t/t5548-push-porcelain.sh                     |  64 +--
 t/t5550-http-fetch-dumb.sh                    |  20 +-
 t/t5551-http-fetch-smart.sh                   |  20 +-
 t/t5552-skipping-fetch-negotiator.sh          |   2 +-
 t/t5553-set-upstream.sh                       |  82 +--
 t/t5561-http-backend.sh                       |   4 +-
 t/t556x_common                                |   8 +-
 t/t5570-git-daemon.sh                         |  16 +-
 t/t5571-pre-push-hook.sh                      |   4 +-
 t/t5572-pull-submodule.sh                     |   4 +-
 t/t5580-unc-paths.sh                          |   2 +-
 t/t5581-http-curl-verbose.sh                  |   2 +-
 t/t5582-fetch-negative-refspec.sh             |  22 +-
 t/t5601-clone.sh                              |   4 +-
 t/t5604-clone-reference.sh                    |  12 +-
 t/t5605-clone-local.sh                        |  10 +-
 t/t5606-clone-options.sh                      |   8 +-
 t/t5607-clone-bundle.sh                       |  14 +-
 t/t5608-clone-2gb.sh                          |   2 +-
 t/t5609-clone-branch.sh                       |   6 +-
 t/t5610-clone-detached.sh                     |   4 +-
 t/t5611-clone-config.sh                       |  16 +-
 t/t5612-clone-refspec.sh                      |  42 +-
 t/t5614-clone-submodules-shallow.sh           |   2 +-
 t/t5616-partial-clone.sh                      |  50 +-
 t/t5617-clone-submodules-remote.sh            |   6 +-
 t/t5700-protocol-v1.sh                        |  16 +-
 t/t5701-git-serve.sh                          |  16 +-
 t/t5702-protocol-v2.sh                        |  50 +-
 t/t5703-upload-pack-ref-in-want.sh            |  60 +--
 t/t5801-remote-helpers.sh                     |  24 +-
 t/t6000-rev-list-misc.sh                      |   2 +-
 t/t6001-rev-list-graft.sh                     |   2 +-
 t/t6004-rev-list-path-optim.sh                |  14 +-
 t/t6006-rev-list-format.sh                    |  14 +-
 t/t6007-rev-list-cherry-pick-file.sh          |   4 +-
 t/t6008-rev-list-submodule.sh                 |   2 +-
 t/t6009-rev-list-parent.sh                    |   6 +-
 t/t6012-rev-list-simplify.sh                  |   8 +-
 t/t6013-rev-list-reverse-parents.sh           |  10 +-
 t/t6016-rev-list-graph-simplify-history.sh    |   2 +-
 t/t6017-rev-list-stdin.sh                     |   8 +-
 t/t6018-rev-list-glob.sh                      |  50 +-
 t/t6019-rev-list-ancestry-path.sh             |   6 +-
 t/t6030-bisect-porcelain.sh                   |  10 +-
 t/t6040-tracking-info.sh                      |  54 +-
 t/t6050-replace.sh                            |  10 +-
 t/t6101-rev-parse-parents.sh                  |   2 +-
 t/t6110-rev-list-sparse.sh                    |   2 +-
 t/t6111-rev-list-treesame.sh                  |   6 +-
 t/t6112-rev-list-filters-objects.sh           |  14 +-
 t/t6120-describe.sh                           |  20 +-
 t/t6200-fmt-merge-msg.sh                      |  50 +-
 t/t6302-for-each-ref-filter.sh                |  58 +-
 t/t6400-merge-df.sh                           |   6 +-
 t/t6402-merge-rename.sh                       |  46 +-
 t/t6404-recursive-merge.sh                    |   4 +-
 t/t6405-merge-symlinks.sh                     |  14 +-
 t/t6406-merge-attr.sh                         |  24 +-
 t/t6407-merge-binary.sh                       |   6 +-
 t/t6409-merge-subtree.sh                      |  16 +-
 t/t6411-merge-filemode.sh                     |  10 +-
 t/t6412-merge-large-rename.sh                 |   6 +-
 t/t6413-merge-crlf.sh                         |   2 +-
 t/t6414-merge-rename-nocruft.sh               |   2 +-
 t/t6415-merge-dir-to-symlink.sh               |  22 +-
 t/t6416-recursive-corner-cases.sh             |  28 +-
 t/t6417-merge-ours-theirs.sh                  |  28 +-
 t/t6418-merge-text-auto.sh                    |  12 +-
 t/t6419-merge-ignorecase.sh                   |  10 +-
 t/t6422-merge-rename-corner-cases.sh          |  12 +-
 t/t6425-merge-rename-delete.sh                |   2 +-
 t/t6427-diff3-conflict-markers.sh             |  14 +-
 t/t6430-merge-recursive.sh                    |  18 +-
 t/t6432-merge-recursive-space-options.sh      |   6 +-
 t/t6433-merge-toplevel.sh                     |   8 +-
 t/t6434-merge-recursive-rename-options.sh     |   6 +-
 t/t6436-merge-overwrite.sh                    |   2 +-
 t/t6437-submodule-merge.sh                    |  14 +-
 t/t6439-merge-co-error-msgs.sh                |   6 +-
 t/t6501-freshen-objects.sh                    |   2 +-
 t/t7003-filter-branch.sh                      |  40 +-
 t/t7004-tag.sh                                |   8 +-
 t/t7030-verify-tag.sh                         |   2 +-
 t/t7060-wtstatus.sh                           |  26 +-
 t/t7063-status-untracked-cache.sh             |  14 +-
 t/t7102-reset.sh                              |   6 +-
 t/t7113-post-index-change-hook.sh             |   2 +-
 t/t7201-co.sh                                 | 110 ++--
 t/t7400-submodule-basic.sh                    |  20 +-
 t/t7403-submodule-sync.sh                     |  10 +-
 t/t7406-submodule-update.sh                   |  38 +-
 t/t7407-submodule-foreach.sh                  |  24 +-
 t/t7409-submodule-detached-work-tree.sh       |   8 +-
 t/t7417-submodule-path-url.sh                 |   2 +-
 t/t7501-commit-basic-functionality.sh         |   2 +-
 t/t7502-commit-porcelain.sh                   |  12 +-
 ...3-pre-commit-and-pre-merge-commit-hooks.sh |  42 +-
 t/t7504-commit-msg-hook.sh                    |  24 +-
 t/t7505-prepare-commit-msg-hook.sh            |  20 +-
 t/t7508-status.sh                             |  58 +-
 t/t7510-signed-commit.sh                      |   2 +-
 t/t7512-status-help.sh                        |  40 +-
 t/t7517-per-repo-email.sh                     |  12 +-
 t/t7600-merge.sh                              |  44 +-
 t/t7606-merge-custom.sh                       |   2 +-
 t/t7608-merge-messages.sh                     |  36 +-
 t/t7610-mergetool.sh                          | 174 +++---
 t/t7611-merge-abort.sh                        |   4 +-
 t/t7612-merge-verify-signatures.sh            |   2 +-
 t/t7614-merge-signoff.sh                      |  24 +-
 t/t7701-repack-unpack-unreachable.sh          |   2 +-
 t/t7800-difftool.sh                           |  38 +-
 t/t7810-grep.sh                               |  28 +-
 t/t8001-annotate.sh                           |   2 +-
 t/t8003-blame-corner-cases.sh                 |   4 +-
 t/t8004-blame-with-conflicts.sh               |  14 +-
 t/t9001-send-email.sh                         |  28 +-
 t/t9100-git-svn-basic.sh                      |   2 +-
 t/t9145-git-svn-master-branch.sh              |   6 +-
 t/t9151-svn-mergeinfo.sh                      |   2 +-
 t/t9155-git-svn-fetch-deleted-tag.sh          |   2 +-
 t/t9156-git-svn-fetch-deleted-tag-2.sh        |   6 +-
 t/t9163-git-svn-reset-clears-caches.sh        |   2 +-
 t/t9169-git-svn-dcommit-crlf.sh               |   2 +-
 t/t9300-fast-import.sh                        |  82 +--
 t/t9301-fast-import-notes.sh                  |  14 +-
 t/t9302-fast-import-unpack-limit.sh           |  16 +-
 t/t9350-fast-export.sh                        |  86 +--
 t/t9351-fast-export-anonymize.sh              |   4 +-
 t/t9400-git-cvsserver-server.sh               |  32 +-
 t/t9401-git-cvsserver-crlf.sh                 |  16 +-
 t/t9402-git-cvsserver-refs.sh                 |   8 +-
 t/t9500-gitweb-standalone-no-errors.sh        |  20 +-
 t/t9501-gitweb-standalone-http-status.sh      |  14 +-
 t/t9502-gitweb-standalone-parse-output.sh     |  16 +-
 t/t9600-cvsimport.sh                          |   2 +-
 t/t9601-cvsimport-vendor-branch.sh            |  16 +-
 t/t9602-cvsimport-branches-tags.sh            |   4 +-
 t/t9603-cvsimport-patchsets.sh                |   8 +-
 t/t9800-git-p4-basic.sh                       |   2 +-
 t/t9801-git-p4-branch.sh                      |  16 +-
 t/t9806-git-p4-options.sh                     |  18 +-
 t/t9807-git-p4-submit.sh                      |   2 +-
 t/t9811-git-p4-label-import.sh                |   2 +-
 t/t9903-bash-prompt.sh                        | 114 ++--
 t/test-lib.sh                                 |  13 +
 348 files changed, 3879 insertions(+), 3866 deletions(-)


base-commit: aff20da3a209088e7f8f3632077fa11b86453d67
Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-762%2Fdscho%2Fuse-main-as-default-branch-name-v2
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-762/dscho/use-main-as-default-branch-name-v2
Pull-Request: https://github.com/gitgitgadget/git/pull/762

Range-diff vs v1:

  1:  0a05d319c0 =  1:  0a05d319c0 t0060: preemptively adjust alignment
  2:  830130fa9f !  2:  b8fa037791 t[01]*: adjust the references to the default branch name "main"
     @@ Commit message
      
                  $ (cd t &&
                     sed -i -e 's/master/main/g' -e 's/MASTER/MAIN/g' \
     -                    -e 's/Master/Main/g' -- t[01]*.sh)
     +                    -e 's/Master/Main/g' -e 's/naster/nain/g' -- t[01]*.sh)
     +
     +    Note that t5533 contains a variation of the name `master` (`naster`)
     +    that we rename here, too.
      
          This allows us to define `GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main`
          for those tests.
      
     +    Helped-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
          Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
      
       ## t/t0002-gitfile.sh ##
     @@ t/t1402-check-ref-format.sh: valid_ref !MINGW "$ref" '--refspec-pattern --allow-
      -	test "$refname2" = master'
      +	test "$refname2" = main'
       
     - test_expect_success 'check-ref-format --branch -naster' '
     - 	test_must_fail git check-ref-format --branch -naster >actual &&
     +-test_expect_success 'check-ref-format --branch -naster' '
     +-	test_must_fail git check-ref-format --branch -naster >actual &&
     ++test_expect_success 'check-ref-format --branch -nain' '
     ++	test_must_fail git check-ref-format --branch -nain >actual &&
     + 	test_must_be_empty actual
     + '
     + 
      @@ t/t1402-check-ref-format.sh: test_expect_success 'check-ref-format --branch from subdir' '
       
       	T=$(git write-tree) &&
  3:  9b368b1ce1 =  3:  0d4f1275f7 t2*: adjust the references to the default branch name "main"
  4:  0697ef9742 =  4:  aee29a0528 t3[0-3]*: adjust the references to the default branch name "main"
  5:  e494152c3e =  5:  041ad86e33 t3416: preemptively adjust alignment in a comment
  6:  ec7102156e =  6:  2f62b3f469 t34*: adjust the references to the default branch name "main"
  7:  7a9349653d =  7:  0cf754646e t3[5-9]*: adjust the references to the default branch name "main"
  8:  d141e476b1 =  8:  cf6c1d1d83 t4*: adjust the references to the default branch name "main"
  9:  86c85666d5 =  9:  6ff4594a28 t5323: prepare centered comment for `master` -> `main`
 10:  55b6c04fc0 = 10:  be29e07892 t5[0-4]*: adjust the references to the default branch name "main"
 11:  40cdd5db8c = 11:  5126d90a32 t5503: prepare aligned comment for replacing `master` with `main`
 12:  b5ca6e9acd = 12:  332677cbf9 t550*: adjust the references to the default branch name "main"
 13:  727de6fdf5 = 13:  b7333ef201 t551*: adjust the references to the default branch name "main"
 14:  3aef39320e ! 14:  4b1b1ee51f t55[23]*: adjust the references to the default branch name "main"
     @@ Metadata
       ## Commit message ##
          t55[23]*: adjust the references to the default branch name "main"
      
     -    This trick was performed via
     +    Carefully excluding t5526, which sees independent development elsewhere
     +    at the time of writing, we use `main` as the default branch name in
     +    t55[23]*. This trick was performed via
      
                  $ (cd t &&
                     sed -i -e 's/master/main/g' -e 's/MASTER/MAIN/g' \
     -                    -e 's/Master/Main/g' -e 's/naster/nain/g' -- t55[23]*.sh)
     +                    -e 's/Master/Main/g' -e 's/naster/nain/g' -- \
     +                    t55[23]*.sh &&
     +               git checkout HEAD -- t5526\*)
      
          Note that t5533 contains a variation of the name `master` (`naster`)
          that we rename here, too.
     @@ t/t5523-push-upstream.sh: test_expect_success TTY 'push --no-progress suppresses
       '
       
      
     - ## t/t5526-fetch-submodules.sh ##
     -@@ t/t5526-fetch-submodules.sh: test_expect_success PREPARE_FOR_MAIN_BRANCH "don't fetch submodule when newly re
     - 	test_i18ncmp expect.err actual.err &&
     - 	(
     - 		cd submodule &&
     --		git checkout -q master
     -+		git checkout -q main
     - 	)
     - '
     - 
     -@@ t/t5526-fetch-submodules.sh: test_expect_success 'fetch new submodule commits on-demand without .gitmodules e
     - 	git config -f .gitmodules --remove-section submodule.sub1 &&
     - 	git add .gitmodules &&
     - 	git commit -m "delete gitmodules file" &&
     --	git checkout -B master &&
     -+	git checkout -B main &&
     - 	git -C downstream fetch &&
     --	git -C downstream checkout origin/master &&
     -+	git -C downstream checkout origin/main &&
     - 
     - 	C=$(git -C submodule commit-tree -m "yet another change outside refs/heads" HEAD^{tree}) &&
     - 	git -C submodule update-ref refs/changes/7 $C &&
     -
       ## t/t5527-fetch-odd-refs.sh ##
      @@ t/t5527-fetch-odd-refs.sh: test_description='test fetching of oddly-named refs'
       
     @@ t/t5539-fetch-http-shallow.sh: test_expect_success 'fetching deepen' '
       	three
      
       ## t/test-lib.sh ##
     -@@ t/test-lib.sh: case "$TEST_NUMBER" in
     +@@ t/test-lib.sh: case "$TRASH_DIRECTORY" in
     + esac
     + 
     + case "$TEST_NUMBER" in
     +-3404|4013|5310)
     ++3404|4013|5310|5526)
     + 	# Avoid conflicts with patch series that are cooking at the same time
     + 	# as the patch series changing the default of `init.defaultBranch`.
       	GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
       	export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
       	;;
 15:  8a2511b38e = 15:  c37d97c2d8 t55[4-9]*: adjust the references to the default branch name "main"
 16:  af24b6d69d = 16:  dda6ce098c t5[6-9]*: adjust the references to the default branch name "main"
 17:  dc8011e4bf ! 17:  27d7994933 t6[0-3]*: adjust the references to the default branch name "main"
     @@ t/test-lib.sh: case "$TRASH_DIRECTORY" in
       esac
       
       case "$TEST_NUMBER" in
     --3404|4013|5310)
     -+3404|4013|5310|6300)
     +-3404|4013|5310|5526)
     ++3404|4013|5310|5526|6300)
       	# Avoid conflicts with patch series that are cooking at the same time
       	# as the patch series changing the default of `init.defaultBranch`.
       	GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
 18:  e2f1409399 = 18:  04878e2268 t64*: preemptively adjust alignment to prepare for `master` -> `main`
 19:  1ef276c97e = 19:  f0fa12b577 t6[4-9]*: adjust the references to the default branch name "main"
 20:  7f67471c03 ! 20:  f9c30dc516 t7[0-4]*: adjust the references to the default branch name "main"
     @@ t/test-lib.sh: case "$TRASH_DIRECTORY" in
       esac
       
       case "$TEST_NUMBER" in
     --3404|4013|5310|6300)
     -+3404|4013|5310|6300|7064)
     +-3404|4013|5310|5526|6300)
     ++3404|4013|5310|5526|6300|7064)
       	# Avoid conflicts with patch series that are cooking at the same time
       	# as the patch series changing the default of `init.defaultBranch`.
       	GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
 21:  07714a8c65 ! 21:  2b269ca983 t7[5-9]*: adjust the references to the default branch name "main"
     @@ t/test-lib.sh: case "$TRASH_DIRECTORY" in
       esac
       
       case "$TEST_NUMBER" in
     --3404|4013|5310|6300|7064)
     -+3404|4013|5310|6300|7064|7817)
     +-3404|4013|5310|5526|6300|7064)
     ++3404|4013|5310|5526|6300|7064|7817)
       	# Avoid conflicts with patch series that are cooking at the same time
       	# as the patch series changing the default of `init.defaultBranch`.
       	GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
 22:  3a987c452e = 22:  5cac0065c8 t8*: adjust the references to the default branch name "main"
 23:  e788b61074 = 23:  57e90d459a t9[0-4]*: adjust the references to the default branch name "main"
 24:  2367a322c8 = 24:  f9e01de17f t9[5-7]*: adjust the references to the default branch name "main"
 25:  bd32d55eab = 25:  4da4b69114 tests(git-p4): transition to the default branch name `main`
 26:  73100477a8 ! 26:  cfa29c7f71 t99*: adjust the references to the default branch name "main"
     @@ t/test-lib.sh: case "$TRASH_DIRECTORY" in
       esac
       
       case "$TEST_NUMBER" in
     --3404|4013|5310|6300|7064|7817)
     -+3404|4013|5310|6300|7064|7817|9902)
     +-3404|4013|5310|5526|6300|7064|7817)
     ++3404|4013|5310|5526|6300|7064|7817|9902)
       	# Avoid conflicts with patch series that are cooking at the same time
       	# as the patch series changing the default of `init.defaultBranch`.
       	GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
 27:  09b611a359 ! 27:  fc0c1f6463 tests: drop prereq `PREPARE_FOR_MAIN_BRANCH` where no longer needed
     @@ Commit message
          `master` -> `main` rename before the automatable ones.
      
          Now that the transition is almost complete, we can stop using it in most
     -    instances. The only exception is t9902: at the time of writing, there
     -    are other patches in flight that touch this test script, therefore the
     -    transition to `main` is postponed to a later date.
     +    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/t9902\*
     +            git checkout HEAD -- t/t5526\* t/t9902\*
      
          Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
      
     @@ t/t5510-fetch.sh: test_expect_success PREPARE_FOR_MAIN_BRANCH,C_LOCALE_OUTPUT 'f
       	test_commit extraaa &&
       	(
      
     - ## t/t5526-fetch-submodules.sh ##
     -@@ t/t5526-fetch-submodules.sh: test_expect_success setup '
     - 	)
     - '
     - 
     --test_expect_success PREPARE_FOR_MAIN_BRANCH "fetch --recurse-submodules recurses into submodules" '
     -+test_expect_success "fetch --recurse-submodules recurses into submodules" '
     - 	add_upstream_commit &&
     - 	(
     - 		cd downstream &&
     -@@ t/t5526-fetch-submodules.sh: test_expect_success PREPARE_FOR_MAIN_BRANCH "fetch --recurse-submodules recurses
     - 	test_i18ncmp expect.err actual.err
     - '
     - 
     --test_expect_success PREPARE_FOR_MAIN_BRANCH "submodule.recurse option triggers recursive fetch" '
     -+test_expect_success "submodule.recurse option triggers recursive fetch" '
     - 	add_upstream_commit &&
     - 	(
     - 		cd downstream &&
     -@@ t/t5526-fetch-submodules.sh: test_expect_success PREPARE_FOR_MAIN_BRANCH "submodule.recurse option triggers r
     - 	test_i18ncmp expect.err actual.err
     - '
     - 
     --test_expect_success PREPARE_FOR_MAIN_BRANCH "fetch --recurse-submodules -j2 has the same output behaviour" '
     -+test_expect_success "fetch --recurse-submodules -j2 has the same output behaviour" '
     - 	add_upstream_commit &&
     - 	(
     - 		cd downstream &&
     -@@ t/t5526-fetch-submodules.sh: test_expect_success "fetch --no-recurse-submodules only fetches superproject" '
     - 	test_must_be_empty actual.err
     - '
     - 
     --test_expect_success PREPARE_FOR_MAIN_BRANCH "using fetchRecurseSubmodules=true in .gitmodules recurses into submodules" '
     -+test_expect_success "using fetchRecurseSubmodules=true in .gitmodules recurses into submodules" '
     - 	(
     - 		cd downstream &&
     - 		git config -f .gitmodules submodule.submodule.fetchRecurseSubmodules true &&
     -@@ t/t5526-fetch-submodules.sh: test_expect_success "using fetchRecurseSubmodules=false in .git/config overrides
     - 	test_must_be_empty actual.err
     - '
     - 
     --test_expect_success PREPARE_FOR_MAIN_BRANCH "--recurse-submodules overrides fetchRecurseSubmodules setting from .git/config" '
     -+test_expect_success "--recurse-submodules overrides fetchRecurseSubmodules setting from .git/config" '
     - 	(
     - 		cd downstream &&
     - 		git fetch --recurse-submodules >../actual.out 2>../actual.err &&
     -@@ t/t5526-fetch-submodules.sh: test_expect_success "--quiet propagates to parallel submodules" '
     - 	test_must_be_empty actual.err
     - '
     - 
     --test_expect_success PREPARE_FOR_MAIN_BRANCH "--dry-run propagates to submodules" '
     -+test_expect_success "--dry-run propagates to submodules" '
     - 	add_upstream_commit &&
     - 	(
     - 		cd downstream &&
     -@@ t/t5526-fetch-submodules.sh: test_expect_success PREPARE_FOR_MAIN_BRANCH "--dry-run propagates to submodules"
     - 	test_i18ncmp expect.err actual.err
     - '
     - 
     --test_expect_success PREPARE_FOR_MAIN_BRANCH "Without --dry-run propagates to submodules" '
     -+test_expect_success "Without --dry-run propagates to submodules" '
     - 	(
     - 		cd downstream &&
     - 		git fetch --recurse-submodules >../actual.out 2>../actual.err
     -@@ t/t5526-fetch-submodules.sh: test_expect_success PREPARE_FOR_MAIN_BRANCH "Without --dry-run propagates to sub
     - 	test_i18ncmp expect.err actual.err
     - '
     - 
     --test_expect_success PREPARE_FOR_MAIN_BRANCH "recurseSubmodules=true propagates into submodules" '
     -+test_expect_success "recurseSubmodules=true propagates into submodules" '
     - 	add_upstream_commit &&
     - 	(
     - 		cd downstream &&
     -@@ t/t5526-fetch-submodules.sh: test_expect_success PREPARE_FOR_MAIN_BRANCH "recurseSubmodules=true propagates i
     - 	test_i18ncmp expect.err actual.err
     - '
     - 
     --test_expect_success PREPARE_FOR_MAIN_BRANCH "--recurse-submodules overrides config in submodule" '
     -+test_expect_success "--recurse-submodules overrides config in submodule" '
     - 	add_upstream_commit &&
     - 	(
     - 		cd downstream &&
     -@@ t/t5526-fetch-submodules.sh: test_expect_success "--no-recurse-submodules overrides config setting" '
     - 	test_must_be_empty actual.err
     - '
     - 
     --test_expect_success PREPARE_FOR_MAIN_BRANCH "Recursion doesn't happen when no new commits are fetched in the superproject" '
     -+test_expect_success "Recursion doesn't happen when no new commits are fetched in the superproject" '
     - 	(
     - 		cd downstream &&
     - 		(
     -@@ t/t5526-fetch-submodules.sh: test_expect_success PREPARE_FOR_MAIN_BRANCH "Recursion doesn't happen when no ne
     - 	test_must_be_empty actual.err
     - '
     - 
     --test_expect_success PREPARE_FOR_MAIN_BRANCH "Recursion stops when no new submodule commits are fetched" '
     -+test_expect_success "Recursion stops when no new submodule commits are fetched" '
     - 	head1=$(git rev-parse --short HEAD) &&
     - 	git add submodule &&
     - 	git commit -m "new submodule" &&
     -@@ t/t5526-fetch-submodules.sh: test_expect_success PREPARE_FOR_MAIN_BRANCH "Recursion stops when no new submodu
     - 	test_must_be_empty actual.out
     - '
     - 
     --test_expect_success PREPARE_FOR_MAIN_BRANCH "Recursion doesn't happen when new superproject commits don't change any submodules" '
     -+test_expect_success "Recursion doesn't happen when new superproject commits don't change any submodules" '
     - 	add_upstream_commit &&
     - 	head1=$(git rev-parse --short HEAD) &&
     - 	echo a > file &&
     -@@ t/t5526-fetch-submodules.sh: test_expect_success PREPARE_FOR_MAIN_BRANCH "Recursion doesn't happen when new s
     - 	test_i18ncmp expect.err.file actual.err
     - '
     - 
     --test_expect_success PREPARE_FOR_MAIN_BRANCH "Recursion picks up config in submodule" '
     -+test_expect_success "Recursion picks up config in submodule" '
     - 	(
     - 		cd downstream &&
     - 		git fetch --recurse-submodules &&
     -@@ t/t5526-fetch-submodules.sh: test_expect_success PREPARE_FOR_MAIN_BRANCH "Recursion picks up config in submod
     - 	test_must_be_empty actual.out
     - '
     - 
     --test_expect_success PREPARE_FOR_MAIN_BRANCH "Recursion picks up all submodules when necessary" '
     -+test_expect_success "Recursion picks up all submodules when necessary" '
     - 	add_upstream_commit &&
     - 	(
     - 		cd submodule &&
     -@@ t/t5526-fetch-submodules.sh: test_expect_success PREPARE_FOR_MAIN_BRANCH "Recursion picks up all submodules w
     - 	test_must_be_empty actual.out
     - '
     - 
     --test_expect_success PREPARE_FOR_MAIN_BRANCH "'--recurse-submodules=on-demand' doesn't recurse when no new commits are fetched in the superproject (and ignores config)" '
     -+test_expect_success "'--recurse-submodules=on-demand' doesn't recurse when no new commits are fetched in the superproject (and ignores config)" '
     - 	add_upstream_commit &&
     - 	(
     - 		cd submodule &&
     -@@ t/t5526-fetch-submodules.sh: test_expect_success PREPARE_FOR_MAIN_BRANCH "'--recurse-submodules=on-demand' do
     - 	test_must_be_empty actual.err
     - '
     - 
     --test_expect_success PREPARE_FOR_MAIN_BRANCH "'--recurse-submodules=on-demand' recurses as deep as necessary (and ignores config)" '
     -+test_expect_success "'--recurse-submodules=on-demand' recurses as deep as necessary (and ignores config)" '
     - 	head1=$(git rev-parse --short HEAD) &&
     - 	git add submodule &&
     - 	git commit -m "new submodule" &&
     -@@ t/t5526-fetch-submodules.sh: test_expect_success PREPARE_FOR_MAIN_BRANCH "'--recurse-submodules=on-demand' re
     - 	test_i18ncmp expect.err actual.err
     - '
     - 
     --test_expect_success PREPARE_FOR_MAIN_BRANCH "'--recurse-submodules=on-demand' stops when no new submodule commits are found in the superproject (and ignores config)" '
     -+test_expect_success "'--recurse-submodules=on-demand' stops when no new submodule commits are found in the superproject (and ignores config)" '
     - 	add_upstream_commit &&
     - 	head1=$(git rev-parse --short HEAD) &&
     - 	echo a >> file &&
     -@@ t/t5526-fetch-submodules.sh: test_expect_success PREPARE_FOR_MAIN_BRANCH "'--recurse-submodules=on-demand' st
     - 	test_i18ncmp expect.err.file actual.err
     - '
     - 
     --test_expect_success PREPARE_FOR_MAIN_BRANCH "'fetch.recurseSubmodules=on-demand' overrides global config" '
     -+test_expect_success "'fetch.recurseSubmodules=on-demand' overrides global config" '
     - 	(
     - 		cd downstream &&
     - 		git fetch --recurse-submodules
     -@@ t/t5526-fetch-submodules.sh: test_expect_success PREPARE_FOR_MAIN_BRANCH "'fetch.recurseSubmodules=on-demand'
     - 	test_i18ncmp expect.err.2 actual.err
     - '
     - 
     --test_expect_success PREPARE_FOR_MAIN_BRANCH "'submodule.<sub>.fetchRecurseSubmodules=on-demand' overrides fetch.recurseSubmodules" '
     -+test_expect_success "'submodule.<sub>.fetchRecurseSubmodules=on-demand' overrides fetch.recurseSubmodules" '
     - 	(
     - 		cd downstream &&
     - 		git fetch --recurse-submodules
     -@@ t/t5526-fetch-submodules.sh: test_expect_success PREPARE_FOR_MAIN_BRANCH "'submodule.<sub>.fetchRecurseSubmod
     - 	test_i18ncmp expect.err.2 actual.err
     - '
     - 
     --test_expect_success PREPARE_FOR_MAIN_BRANCH "don't fetch submodule when newly recorded commits are already present" '
     -+test_expect_success "don't fetch submodule when newly recorded commits are already present" '
     - 	(
     - 		cd submodule &&
     - 		git checkout -q HEAD^^
     -@@ t/t5526-fetch-submodules.sh: test_expect_success PREPARE_FOR_MAIN_BRANCH "don't fetch submodule when newly re
     - 	)
     - '
     - 
     --test_expect_success PREPARE_FOR_MAIN_BRANCH "'fetch.recurseSubmodules=on-demand' works also without .gitmodules entry" '
     -+test_expect_success "'fetch.recurseSubmodules=on-demand' works also without .gitmodules entry" '
     - 	(
     - 		cd downstream &&
     - 		git fetch --recurse-submodules
     -
       ## t/t5703-upload-pack-ref-in-want.sh ##
      @@ t/t5703-upload-pack-ref-in-want.sh: test_expect_success 'server is initially behind - ref in want' '
       	test_cmp expected actual
 28:  f853fa946f <  -:  ---------- Change the default branch name to `main`

-- 
gitgitgadget

^ permalink raw reply	[flat|nested] 163+ messages in thread

* [PATCH v2 01/27] t0060: preemptively adjust alignment
  2020-11-17 16:12 ` [PATCH v2 00/27] tests: use " Johannes Schindelin via GitGitGadget
@ 2020-11-17 16:12   ` Johannes Schindelin via GitGitGadget
  2020-11-17 16:12   ` [PATCH v2 02/27] t[01]*: adjust the references to the default branch name "main" Johannes Schindelin via GitGitGadget
                     ` (27 subsequent siblings)
  28 siblings, 0 replies; 163+ messages in thread
From: Johannes Schindelin via GitGitGadget @ 2020-11-17 16:12 UTC (permalink / raw)
  To: git
  Cc: Felipe Contreras, Ævar Arnfjörð Bjarmason,
	Johannes Schindelin, Jeff King, Johannes Schindelin,
	Johannes Schindelin

From: Johannes Schindelin <johannes.schindelin@gmx.de>

We are about to adjust t0060 for the new default branch name `main`.
This name is two characters shorter and therefore needs two spaces more
padding to align correctly.

Adjusting the alignment before the big search-and-replace makes it
easier to verify that the final result does not leave any misaligned
lines behind.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
---
 t/t0060-path-utils.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/t/t0060-path-utils.sh b/t/t0060-path-utils.sh
index b2e3cf3f4c..928eebbdc0 100755
--- a/t/t0060-path-utils.sh
+++ b/t/t0060-path-utils.sh
@@ -312,8 +312,8 @@ test_git_path GIT_COMMON_DIR=bar info/sparse-checkout     .git/info/sparse-check
 test_git_path GIT_COMMON_DIR=bar info//sparse-checkout    .git/info//sparse-checkout
 test_git_path GIT_COMMON_DIR=bar remotes/bar              bar/remotes/bar
 test_git_path GIT_COMMON_DIR=bar branches/bar             bar/branches/bar
-test_git_path GIT_COMMON_DIR=bar logs/refs/heads/master   bar/logs/refs/heads/master
-test_git_path GIT_COMMON_DIR=bar refs/heads/master        bar/refs/heads/master
+test_git_path GIT_COMMON_DIR=bar logs/refs/heads/master     bar/logs/refs/heads/master
+test_git_path GIT_COMMON_DIR=bar refs/heads/master          bar/refs/heads/master
 test_git_path GIT_COMMON_DIR=bar refs/bisect/foo          .git/refs/bisect/foo
 test_git_path GIT_COMMON_DIR=bar hooks/me                 bar/hooks/me
 test_git_path GIT_COMMON_DIR=bar config                   bar/config
-- 
gitgitgadget


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH v2 02/27] t[01]*: adjust the references to the default branch name "main"
  2020-11-17 16:12 ` [PATCH v2 00/27] tests: use " Johannes Schindelin via GitGitGadget
  2020-11-17 16:12   ` [PATCH v2 01/27] t0060: preemptively adjust alignment Johannes Schindelin via GitGitGadget
@ 2020-11-17 16:12   ` Johannes Schindelin via GitGitGadget
  2020-11-17 16:12   ` [PATCH v2 03/27] t2*: " Johannes Schindelin via GitGitGadget
                     ` (26 subsequent siblings)
  28 siblings, 0 replies; 163+ messages in thread
From: Johannes Schindelin via GitGitGadget @ 2020-11-17 16:12 UTC (permalink / raw)
  To: git
  Cc: Felipe Contreras, Ævar Arnfjörð Bjarmason,
	Johannes Schindelin, Jeff King, Johannes Schindelin,
	Johannes Schindelin

From: Johannes Schindelin <johannes.schindelin@gmx.de>

This trick was performed via

	$ (cd t &&
	   sed -i -e 's/master/main/g' -e 's/MASTER/MAIN/g' \
		-e 's/Master/Main/g' -e 's/naster/nain/g' -- t[01]*.sh)

Note that t5533 contains a variation of the name `master` (`naster`)
that we rename here, too.

This allows us to define `GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main`
for those tests.

Helped-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
---
 t/t0002-gitfile.sh                   |  6 +--
 t/t0020-crlf.sh                      |  8 ++--
 t/t0021-conversion.sh                | 40 ++++++++--------
 t/t0027-auto-crlf.sh                 |  4 +-
 t/t0028-working-tree-encoding.sh     |  4 +-
 t/t0041-usage.sh                     | 10 ++--
 t/t0050-filesystem.sh                |  6 +--
 t/t0060-path-utils.sh                |  4 +-
 t/t0100-previous.sh                  | 18 ++++----
 t/t1004-read-tree-m-u-wf.sh          | 40 ++++++++--------
 t/t1008-read-tree-overlay.sh         |  2 +-
 t/t1009-read-tree-new-index.sh       |  4 +-
 t/t1011-read-tree-sparse-checkout.sh |  2 +-
 t/t1021-rerere-in-workdir.sh         |  2 +-
 t/t1090-sparse-checkout-scope.sh     | 10 ++--
 t/t1091-sparse-checkout-builtin.sh   |  2 +-
 t/t1300-config.sh                    |  8 ++--
 t/t1301-shared-repo.sh               |  4 +-
 t/t1305-config-include.sh            |  2 +-
 t/t1309-early-config.sh              |  4 +-
 t/t1400-update-ref.sh                | 68 ++++++++++++++--------------
 t/t1402-check-ref-format.sh          | 32 ++++++-------
 t/t1403-show-ref.sh                  | 18 ++++----
 t/t1405-main-ref-store.sh            | 42 ++++++++---------
 t/t1406-submodule-ref-store.sh       | 30 ++++++------
 t/t1407-worktree-ref-store.sh        | 32 ++++++-------
 t/t1408-packed-refs.sh               | 12 ++---
 t/t1410-reflog.sh                    | 56 +++++++++++------------
 t/t1411-reflog-show.sh               |  2 +-
 t/t1413-reflog-detach.sh             | 24 +++++-----
 t/t1414-reflog-walk.sh               | 12 ++---
 t/t1416-ref-transaction-hooks.sh     | 10 ++--
 t/t1430-bad-ref-name.sh              | 52 ++++++++++-----------
 t/t1450-fsck.sh                      |  2 +-
 t/t1500-rev-parse.sh                 |  4 +-
 t/t1503-rev-parse-verify.sh          | 28 ++++++------
 t/t1505-rev-parse-last.sh            |  8 ++--
 t/t1506-rev-parse-diagnosis.sh       |  4 +-
 t/t1507-rev-parse-upstream.sh        | 40 ++++++++--------
 t/t1508-at-combinations.sh           | 10 ++--
 t/t1511-rev-parse-caret.sh           | 26 +++++------
 t/t1512-rev-parse-disambiguation.sh  |  2 +-
 t/t1513-rev-parse-prefix.sh          |  4 +-
 t/t1514-rev-parse-push.sh            | 16 +++----
 t/t1700-split-index.sh               |  2 +-
 t/test-lib.sh                        |  7 +++
 46 files changed, 365 insertions(+), 358 deletions(-)

diff --git a/t/t0002-gitfile.sh b/t/t0002-gitfile.sh
index 960ed150cb..bbcfc8a0b5 100755
--- a/t/t0002-gitfile.sh
+++ b/t/t0002-gitfile.sh
@@ -96,7 +96,7 @@ test_expect_success 'enter_repo non-strict mode' '
 	git ls-remote enter_repo >actual &&
 	cat >expected <<-EOF &&
 	$head	HEAD
-	$head	refs/heads/master
+	$head	refs/heads/main
 	$head	refs/tags/foo
 	EOF
 	test_cmp expected actual
@@ -111,7 +111,7 @@ test_expect_success 'enter_repo linked checkout' '
 	git ls-remote foo >actual &&
 	cat >expected <<-EOF &&
 	$head	HEAD
-	$head	refs/heads/master
+	$head	refs/heads/main
 	$head	refs/tags/foo
 	EOF
 	test_cmp expected actual
@@ -122,7 +122,7 @@ test_expect_success 'enter_repo strict mode' '
 	git ls-remote --upload-pack="git upload-pack --strict" foo/.git >actual &&
 	cat >expected <<-EOF &&
 	$head	HEAD
-	$head	refs/heads/master
+	$head	refs/heads/main
 	$head	refs/tags/foo
 	EOF
 	test_cmp expected actual
diff --git a/t/t0020-crlf.sh b/t/t0020-crlf.sh
index b63ba62e5d..04bf4b1e82 100755
--- a/t/t0020-crlf.sh
+++ b/t/t0020-crlf.sh
@@ -318,8 +318,8 @@ test_expect_success 'checkout with existing .gitattributes' '
 	git add .gitattributes .file &&
 	git commit -m second &&
 
-	git checkout master~1 &&
-	git checkout master &&
+	git checkout main~1 &&
+	git checkout main &&
 	test "$(git diff-files --raw)" = ""
 
 '
@@ -331,8 +331,8 @@ test_expect_success 'checkout when deleting .gitattributes' '
 	git add .file2 &&
 	git commit -m third &&
 
-	git checkout master~1 &&
-	git checkout master &&
+	git checkout main~1 &&
+	git checkout main &&
 	has_cr .file2
 
 '
diff --git a/t/t0021-conversion.sh b/t/t0021-conversion.sh
index f6deaf498b..d0eeca4556 100755
--- a/t/t0021-conversion.sh
+++ b/t/t0021-conversion.sh
@@ -378,8 +378,8 @@ test_expect_success PERL 'required process filter should filter data' '
 		test_cmp_count expected.log debug.log &&
 
 		git commit -m "test commit 2" &&
-		MASTER=$(git rev-parse --verify master) &&
-		META="ref=refs/heads/master treeish=$MASTER" &&
+		MAIN=$(git rev-parse --verify main) &&
+		META="ref=refs/heads/main treeish=$MAIN" &&
 		rm -f test2.r "testsubdir/test3 '\''sq'\'',\$x=.r" &&
 
 		filter_git checkout --quiet --no-progress . &&
@@ -404,7 +404,7 @@ test_expect_success PERL 'required process filter should filter data' '
 		EOF
 		test_cmp_exclude_clean expected.log debug.log &&
 
-		filter_git checkout --quiet --no-progress master &&
+		filter_git checkout --quiet --no-progress main &&
 		cat >expected.log <<-EOF &&
 			START
 			init handshake complete
@@ -436,15 +436,15 @@ test_expect_success PERL 'required process filter should filter data for various
 		M3=$(git hash-object "testsubdir/test3 '\''sq'\'',\$x=.r") &&
 		EMPTY=$(git hash-object /dev/null) &&
 
-		MASTER=$(git rev-parse --verify master) &&
+		MAIN=$(git rev-parse --verify main) &&
 
 		cp "$TEST_ROOT/test.o" test5.r &&
 		git add test5.r &&
 		git commit -m "test commit 3" &&
 		git checkout empty-branch &&
-		filter_git rebase --onto empty-branch master^^ master &&
-		MASTER2=$(git rev-parse --verify master) &&
-		META="ref=refs/heads/master treeish=$MASTER2" &&
+		filter_git rebase --onto empty-branch main^^ main &&
+		MAIN2=$(git rev-parse --verify main) &&
+		META="ref=refs/heads/main treeish=$MAIN2" &&
 		cat >expected.log <<-EOF &&
 			START
 			init handshake complete
@@ -458,8 +458,8 @@ test_expect_success PERL 'required process filter should filter data for various
 		test_cmp_exclude_clean expected.log debug.log &&
 
 		git reset --hard empty-branch &&
-		filter_git reset --hard $MASTER &&
-		META="treeish=$MASTER" &&
+		filter_git reset --hard $MAIN &&
+		META="treeish=$MAIN" &&
 		cat >expected.log <<-EOF &&
 			START
 			init handshake complete
@@ -471,10 +471,10 @@ test_expect_success PERL 'required process filter should filter data for various
 		EOF
 		test_cmp_exclude_clean expected.log debug.log &&
 
-		git branch old-master $MASTER &&
+		git branch old-main $MAIN &&
 		git reset --hard empty-branch &&
-		filter_git reset --hard old-master &&
-		META="ref=refs/heads/old-master treeish=$MASTER" &&
+		filter_git reset --hard old-main &&
+		META="ref=refs/heads/old-main treeish=$MAIN" &&
 		cat >expected.log <<-EOF &&
 			START
 			init handshake complete
@@ -487,9 +487,9 @@ test_expect_success PERL 'required process filter should filter data for various
 		test_cmp_exclude_clean expected.log debug.log &&
 
 		git checkout -b merge empty-branch &&
-		git branch -f master $MASTER2 &&
-		filter_git merge master &&
-		META="treeish=$MASTER2" &&
+		git branch -f main $MAIN2 &&
+		filter_git merge main &&
+		META="treeish=$MAIN2" &&
 		cat >expected.log <<-EOF &&
 			START
 			init handshake complete
@@ -502,8 +502,8 @@ test_expect_success PERL 'required process filter should filter data for various
 		EOF
 		test_cmp_exclude_clean expected.log debug.log &&
 
-		filter_git archive master >/dev/null &&
-		META="ref=refs/heads/master treeish=$MASTER2" &&
+		filter_git archive main >/dev/null &&
+		META="ref=refs/heads/main treeish=$MAIN2" &&
 		cat >expected.log <<-EOF &&
 			START
 			init handshake complete
@@ -516,7 +516,7 @@ test_expect_success PERL 'required process filter should filter data for various
 		EOF
 		test_cmp_exclude_clean expected.log debug.log &&
 
-		TREE="$(git rev-parse $MASTER2^{tree})" &&
+		TREE="$(git rev-parse $MAIN2^{tree})" &&
 		filter_git archive $TREE >/dev/null &&
 		META="treeish=$TREE" &&
 		cat >expected.log <<-EOF &&
@@ -856,8 +856,8 @@ test_expect_success PERL 'delayed checkout in process filter' '
 	) &&
 
 	S=$(test_file_size "$TEST_ROOT/test.o") &&
-	PM="ref=refs/heads/master treeish=$(git -C repo rev-parse --verify master) " &&
-	M="${PM}blob=$(git -C repo rev-parse --verify master:test.a)" &&
+	PM="ref=refs/heads/main treeish=$(git -C repo rev-parse --verify main) " &&
+	M="${PM}blob=$(git -C repo rev-parse --verify main:test.a)" &&
 	cat >a.exp <<-EOF &&
 		START
 		init handshake complete
diff --git a/t/t0027-auto-crlf.sh b/t/t0027-auto-crlf.sh
index 9fcd56fab3..51f74a3ddf 100755
--- a/t/t0027-auto-crlf.sh
+++ b/t/t0027-auto-crlf.sh
@@ -368,9 +368,9 @@ test_expect_success 'ls-files --eol -o Text/Binary' '
 	test_cmp expect actual
 '
 
-test_expect_success 'setup master' '
+test_expect_success 'setup main' '
 	echo >.gitattributes &&
-	git checkout -b master &&
+	git checkout -b main &&
 	git add .gitattributes &&
 	git commit -m "add .gitattributes" . &&
 	printf "\$Id: 0000000000000000000000000000000000000000 \$\nLINEONE\nLINETWO\nLINETHREE"     >LF &&
diff --git a/t/t0028-working-tree-encoding.sh b/t/t0028-working-tree-encoding.sh
index bfc4fb9af5..9c48037884 100755
--- a/t/t0028-working-tree-encoding.sh
+++ b/t/t0028-working-tree-encoding.sh
@@ -215,7 +215,7 @@ test_expect_success 'error if encoding round trip is not the same during refresh
 	TEST_HASH=$(git hash-object --no-filters -w nonsense.utf16le) &&
 	git update-index --add --cacheinfo 100644 $TEST_HASH nonsense.utf16le &&
 	COMMIT=$(git commit-tree -p $(git rev-parse HEAD) -m "plain commit" $(git write-tree)) &&
-	git update-ref refs/heads/master $COMMIT &&
+	git update-ref refs/heads/main $COMMIT &&
 
 	test_must_fail git checkout HEAD^ 2>err.out &&
 	test_i18ngrep "error: .* overwritten by checkout:" err.out
@@ -231,7 +231,7 @@ test_expect_success 'error if encoding garbage is already in Git' '
 	TEST_HASH=$(git hash-object --no-filters -w nonsense.utf16) &&
 	git update-index --add --cacheinfo 100644 $TEST_HASH nonsense.utf16 &&
 	COMMIT=$(git commit-tree -p $(git rev-parse HEAD) -m "plain commit" $(git write-tree)) &&
-	git update-ref refs/heads/master $COMMIT &&
+	git update-ref refs/heads/main $COMMIT &&
 
 	git diff 2>err.out &&
 	test_i18ngrep "error: BOM is required" err.out
diff --git a/t/t0041-usage.sh b/t/t0041-usage.sh
index 5b927b76fe..6f93450597 100755
--- a/t/t0041-usage.sh
+++ b/t/t0041-usage.sh
@@ -41,8 +41,8 @@ test_expect_success 'tag usage error' '
 '
 
 test_expect_success 'branch --contains <existent_commit>' '
-	git branch --contains "master" >actual 2>actual.err &&
-	test_i18ngrep "master" actual &&
+	git branch --contains "main" >actual 2>actual.err &&
+	test_i18ngrep "main" actual &&
 	test_line_count = 0 actual.err
 '
 
@@ -54,7 +54,7 @@ test_expect_success 'branch --contains <inexistent_commit>' '
 '
 
 test_expect_success 'branch --no-contains <existent_commit>' '
-	git branch --no-contains "master" >actual 2>actual.err &&
+	git branch --no-contains "main" >actual 2>actual.err &&
 	test_line_count = 0 actual &&
 	test_line_count = 0 actual.err
 '
@@ -73,7 +73,7 @@ test_expect_success 'branch usage error' '
 '
 
 test_expect_success 'for-each-ref --contains <existent_object>' '
-	git for-each-ref --contains "master" >actual 2>actual.err &&
+	git for-each-ref --contains "main" >actual 2>actual.err &&
 	test_line_count = 2 actual &&
 	test_line_count = 0 actual.err
 '
@@ -86,7 +86,7 @@ test_expect_success 'for-each-ref --contains <inexistent_object>' '
 '
 
 test_expect_success 'for-each-ref --no-contains <existent_object>' '
-	git for-each-ref --no-contains "master" >actual 2>actual.err &&
+	git for-each-ref --no-contains "main" >actual 2>actual.err &&
 	test_line_count = 0 actual &&
 	test_line_count = 0 actual.err
 '
diff --git a/t/t0050-filesystem.sh b/t/t0050-filesystem.sh
index 608673fb77..e3412b896b 100755
--- a/t/t0050-filesystem.sh
+++ b/t/t0050-filesystem.sh
@@ -65,7 +65,7 @@ test_expect_success "setup case tests" '
 	git mv camelcase tmp &&
 	git mv tmp CamelCase &&
 	git commit -m "rename" &&
-	git checkout -f master
+	git checkout -f main
 '
 
 test_expect_success 'rename (case change)' '
@@ -118,7 +118,7 @@ test_expect_success "setup unicode normalization tests" '
 	git mv $aumlcdiar tmp &&
 	git mv tmp "$auml" &&
 	git commit -m rename &&
-	git checkout -f master
+	git checkout -f main
 '
 
 $test_unicode 'rename (silent unicode normalization)' '
@@ -147,7 +147,7 @@ test_expect_success CASE_INSENSITIVE_FS 'checkout with no pathspec and a case in
 		git add gitweb &&
 		git commit -m "add gitweb/subdir/file" &&
 
-		git checkout master
+		git checkout main
 	)
 '
 
diff --git a/t/t0060-path-utils.sh b/t/t0060-path-utils.sh
index 928eebbdc0..fab077b6f7 100755
--- a/t/t0060-path-utils.sh
+++ b/t/t0060-path-utils.sh
@@ -312,8 +312,8 @@ test_git_path GIT_COMMON_DIR=bar info/sparse-checkout     .git/info/sparse-check
 test_git_path GIT_COMMON_DIR=bar info//sparse-checkout    .git/info//sparse-checkout
 test_git_path GIT_COMMON_DIR=bar remotes/bar              bar/remotes/bar
 test_git_path GIT_COMMON_DIR=bar branches/bar             bar/branches/bar
-test_git_path GIT_COMMON_DIR=bar logs/refs/heads/master     bar/logs/refs/heads/master
-test_git_path GIT_COMMON_DIR=bar refs/heads/master          bar/refs/heads/master
+test_git_path GIT_COMMON_DIR=bar logs/refs/heads/main     bar/logs/refs/heads/main
+test_git_path GIT_COMMON_DIR=bar refs/heads/main          bar/refs/heads/main
 test_git_path GIT_COMMON_DIR=bar refs/bisect/foo          .git/refs/bisect/foo
 test_git_path GIT_COMMON_DIR=bar hooks/me                 bar/hooks/me
 test_git_path GIT_COMMON_DIR=bar config                   bar/config
diff --git a/t/t0100-previous.sh b/t/t0100-previous.sh
index 58c0b7e9b6..dfb367b720 100755
--- a/t/t0100-previous.sh
+++ b/t/t0100-previous.sh
@@ -8,7 +8,7 @@ test_expect_success 'branch -d @{-1}' '
 	test_commit A &&
 	git checkout -b junk &&
 	git checkout - &&
-	test "$(git symbolic-ref HEAD)" = refs/heads/master &&
+	test "$(git symbolic-ref HEAD)" = refs/heads/main &&
 	git branch -d @{-1} &&
 	test_must_fail git rev-parse --verify refs/heads/junk
 '
@@ -17,9 +17,9 @@ test_expect_success 'branch -d @{-12} when there is not enough switches yet' '
 	git reflog expire --expire=now &&
 	git checkout -b junk2 &&
 	git checkout - &&
-	test "$(git symbolic-ref HEAD)" = refs/heads/master &&
+	test "$(git symbolic-ref HEAD)" = refs/heads/main &&
 	test_must_fail git branch -d @{-12} &&
-	git rev-parse --verify refs/heads/master
+	git rev-parse --verify refs/heads/main
 '
 
 test_expect_success 'merge @{-1}' '
@@ -28,19 +28,19 @@ test_expect_success 'merge @{-1}' '
 	git checkout A &&
 	test_commit C &&
 	test_commit D &&
-	git branch -f master B &&
+	git branch -f main B &&
 	git branch -f other &&
 	git checkout other &&
-	git checkout master &&
+	git checkout main &&
 	git merge @{-1} &&
 	git cat-file commit HEAD | grep "Merge branch '\''other'\''"
 '
 
 test_expect_success 'merge @{-1}~1' '
-	git checkout master &&
+	git checkout main &&
 	git reset --hard B &&
 	git checkout other &&
-	git checkout master &&
+	git checkout main &&
 	git merge @{-1}~1 &&
 	git cat-file commit HEAD >actual &&
 	grep "Merge branch '\''other'\''" actual
@@ -48,11 +48,11 @@ test_expect_success 'merge @{-1}~1' '
 
 test_expect_success 'merge @{-100} before checking out that many branches yet' '
 	git reflog expire --expire=now &&
-	git checkout -f master &&
+	git checkout -f main &&
 	git reset --hard B &&
 	git branch -f other C &&
 	git checkout other &&
-	git checkout master &&
+	git checkout main &&
 	test_must_fail git merge @{-100}
 '
 
diff --git a/t/t1004-read-tree-m-u-wf.sh b/t/t1004-read-tree-m-u-wf.sh
index 181956b241..c8a81f180f 100755
--- a/t/t1004-read-tree-m-u-wf.sh
+++ b/t/t1004-read-tree-m-u-wf.sh
@@ -20,17 +20,17 @@ test_expect_success 'two-way setup' '
 	git branch side &&
 	git tag -f branch-point &&
 
-	echo file2 is not tracked on the master branch anymore &&
+	echo file2 is not tracked on the main branch anymore &&
 	rm -f file2 subdir/file2 &&
 	git update-index --remove file2 subdir/file2 &&
-	git commit -a -m "master removes file2 and subdir/file2"
+	git commit -a -m "main removes file2 and subdir/file2"
 '
 
 test_expect_success 'two-way not clobbering' '
 
-	echo >file2 master creates untracked file2 &&
-	echo >subdir/file2 master creates untracked subdir/file2 &&
-	if err=$(read_tree_u_must_succeed -m -u master side 2>&1)
+	echo >file2 main creates untracked file2 &&
+	echo >subdir/file2 main creates untracked subdir/file2 &&
+	if err=$(read_tree_u_must_succeed -m -u main side 2>&1)
 	then
 		echo should have complained
 		false
@@ -43,7 +43,7 @@ echo file2 >.gitignore
 
 test_expect_success 'two-way with incorrect --exclude-per-directory (1)' '
 
-	if err=$(read_tree_u_must_succeed -m --exclude-per-directory=.gitignore master side 2>&1)
+	if err=$(read_tree_u_must_succeed -m --exclude-per-directory=.gitignore main side 2>&1)
 	then
 		echo should have complained
 		false
@@ -54,7 +54,7 @@ test_expect_success 'two-way with incorrect --exclude-per-directory (1)' '
 
 test_expect_success 'two-way with incorrect --exclude-per-directory (2)' '
 
-	if err=$(read_tree_u_must_succeed -m -u --exclude-per-directory=foo --exclude-per-directory=.gitignore master side 2>&1)
+	if err=$(read_tree_u_must_succeed -m -u --exclude-per-directory=foo --exclude-per-directory=.gitignore main side 2>&1)
 	then
 		echo should have complained
 		false
@@ -65,7 +65,7 @@ test_expect_success 'two-way with incorrect --exclude-per-directory (2)' '
 
 test_expect_success 'two-way clobbering a ignored file' '
 
-	read_tree_u_must_succeed -m -u --exclude-per-directory=.gitignore master side
+	read_tree_u_must_succeed -m -u --exclude-per-directory=.gitignore main side
 '
 
 rm -f .gitignore
@@ -81,21 +81,21 @@ test_expect_success 'three-way not complaining on an untracked path in both' '
 	git update-index --add file3 subdir/file3 &&
 	git commit -a -m "side adds file3 and removes file2" &&
 
-	git checkout master &&
-	echo >file2 file two is untracked on the master side &&
-	echo >subdir/file2 file two is untracked on the master side &&
+	git checkout main &&
+	echo >file2 file two is untracked on the main side &&
+	echo >subdir/file2 file two is untracked on the main side &&
 
-	read_tree_u_must_succeed -m -u branch-point master side
+	read_tree_u_must_succeed -m -u branch-point main side
 '
 
 test_expect_success 'three-way not clobbering a working tree file' '
 
 	git reset --hard &&
 	rm -f file2 subdir/file2 file3 subdir/file3 &&
-	git checkout master &&
-	echo >file3 file three created in master, untracked &&
-	echo >subdir/file3 file three created in master, untracked &&
-	if err=$(read_tree_u_must_succeed -m -u branch-point master side 2>&1)
+	git checkout main &&
+	echo >file3 file three created in main, untracked &&
+	echo >subdir/file3 file three created in main, untracked &&
+	if err=$(read_tree_u_must_succeed -m -u branch-point main side 2>&1)
 	then
 		echo should have complained
 		false
@@ -110,11 +110,11 @@ test_expect_success 'three-way not complaining on an untracked file' '
 
 	git reset --hard &&
 	rm -f file2 subdir/file2 file3 subdir/file3 &&
-	git checkout master &&
-	echo >file3 file three created in master, untracked &&
-	echo >subdir/file3 file three created in master, untracked &&
+	git checkout main &&
+	echo >file3 file three created in main, untracked &&
+	echo >subdir/file3 file three created in main, untracked &&
 
-	read_tree_u_must_succeed -m -u --exclude-per-directory=.gitignore branch-point master side
+	read_tree_u_must_succeed -m -u --exclude-per-directory=.gitignore branch-point main side
 '
 
 test_expect_success '3-way not overwriting local changes (setup)' '
diff --git a/t/t1008-read-tree-overlay.sh b/t/t1008-read-tree-overlay.sh
index cf96016844..2a757bd6d5 100755
--- a/t/t1008-read-tree-overlay.sh
+++ b/t/t1008-read-tree-overlay.sh
@@ -22,7 +22,7 @@ test_expect_success setup '
 '
 
 test_expect_success 'multi-read' '
-	read_tree_must_succeed initial master side &&
+	read_tree_must_succeed initial main side &&
 	test_write_lines a b/c >expect &&
 	git ls-files >actual &&
 	test_cmp expect actual
diff --git a/t/t1009-read-tree-new-index.sh b/t/t1009-read-tree-new-index.sh
index 59b3aa4bc4..7302adfb20 100755
--- a/t/t1009-read-tree-new-index.sh
+++ b/t/t1009-read-tree-new-index.sh
@@ -12,13 +12,13 @@ test_expect_success setup '
 
 test_expect_success 'non-existent index file' '
 	rm -f new-index &&
-	GIT_INDEX_FILE=new-index git read-tree master
+	GIT_INDEX_FILE=new-index git read-tree main
 '
 
 test_expect_success 'empty index file' '
 	rm -f new-index &&
 	> new-index &&
-	GIT_INDEX_FILE=new-index git read-tree master
+	GIT_INDEX_FILE=new-index git read-tree main
 '
 
 test_done
diff --git a/t/t1011-read-tree-sparse-checkout.sh b/t/t1011-read-tree-sparse-checkout.sh
index 140f459977..dfe9794a74 100755
--- a/t/t1011-read-tree-sparse-checkout.sh
+++ b/t/t1011-read-tree-sparse-checkout.sh
@@ -2,7 +2,7 @@
 
 test_description='sparse checkout tests
 
-* (tag: removed, master) removed
+* (tag: removed, main) removed
 | D	sub/added
 * (HEAD, tag: top) modified and added
 | M	init.t
diff --git a/t/t1021-rerere-in-workdir.sh b/t/t1021-rerere-in-workdir.sh
index 301e071ff7..a32b4a50e0 100755
--- a/t/t1021-rerere-in-workdir.sh
+++ b/t/t1021-rerere-in-workdir.sh
@@ -19,7 +19,7 @@ test_expect_success SYMLINKS setup '
 	test_tick &&
 	git commit -a -m goodbye &&
 
-	git checkout master
+	git checkout main
 '
 
 test_expect_success SYMLINKS 'rerere in workdir' '
diff --git a/t/t1090-sparse-checkout-scope.sh b/t/t1090-sparse-checkout-scope.sh
index f35a73dd20..6c253fd526 100755
--- a/t/t1090-sparse-checkout-scope.sh
+++ b/t/t1090-sparse-checkout-scope.sh
@@ -20,18 +20,18 @@ test_expect_success 'create feature branch' '
 	git commit -m "modification"
 '
 
-test_expect_success 'perform sparse checkout of master' '
+test_expect_success 'perform sparse checkout of main' '
 	git config --local --bool core.sparsecheckout true &&
 	echo "!/*" >.git/info/sparse-checkout &&
 	echo "/a" >>.git/info/sparse-checkout &&
 	echo "/c" >>.git/info/sparse-checkout &&
-	git checkout master &&
+	git checkout main &&
 	test_path_is_file a &&
 	test_path_is_missing b &&
 	test_path_is_file c
 '
 
-test_expect_success 'merge feature branch into sparse checkout of master' '
+test_expect_success 'merge feature branch into sparse checkout of main' '
 	git merge feature &&
 	test_path_is_file a &&
 	test_path_is_missing b &&
@@ -39,10 +39,10 @@ test_expect_success 'merge feature branch into sparse checkout of master' '
 	test "$(cat c)" = "modified"
 '
 
-test_expect_success 'return to full checkout of master' '
+test_expect_success 'return to full checkout of main' '
 	git checkout feature &&
 	echo "/*" >.git/info/sparse-checkout &&
-	git checkout master &&
+	git checkout main &&
 	test_path_is_file a &&
 	test_path_is_file b &&
 	test_path_is_file c &&
diff --git a/t/t1091-sparse-checkout-builtin.sh b/t/t1091-sparse-checkout-builtin.sh
index 84acfc48b6..4ee16805bb 100755
--- a/t/t1091-sparse-checkout-builtin.sh
+++ b/t/t1091-sparse-checkout-builtin.sh
@@ -117,7 +117,7 @@ test_expect_success 'interaction with clone --no-checkout (unborn index)' '
 	test_path_is_missing clone_no_checkout/.git/index &&
 
 	# No branch is checked out until we manually switch to one
-	git -C clone_no_checkout switch master &&
+	git -C clone_no_checkout switch main &&
 	test_path_is_file clone_no_checkout/.git/index &&
 	check_files clone_no_checkout a folder1
 '
diff --git a/t/t1300-config.sh b/t/t1300-config.sh
index 825d9a184f..11a8e641da 100755
--- a/t/t1300-config.sh
+++ b/t/t1300-config.sh
@@ -1054,8 +1054,8 @@ test_expect_success 'check split_cmdline return' "
 	echo foo > foo &&
 	git add foo &&
 	git commit -m 'initial commit' &&
-	git config branch.master.mergeoptions 'echo \"' &&
-	test_must_fail git merge master
+	git config branch.main.mergeoptions 'echo \"' &&
+	test_must_fail git merge main
 "
 
 test_expect_success 'git -c "key=value" support' '
@@ -1769,11 +1769,11 @@ test_expect_success '--show-origin blob' '
 
 test_expect_success '--show-origin blob ref' '
 	cat >expect <<-\EOF &&
-	blob:master:custom.conf	user.custom=true
+	blob:main:custom.conf	user.custom=true
 	EOF
 	git add "$CUSTOM_CONFIG_FILE" &&
 	git commit -m "new config file" &&
-	git config --blob=master:"$CUSTOM_CONFIG_FILE" --show-origin --list >output &&
+	git config --blob=main:"$CUSTOM_CONFIG_FILE" --show-origin --list >output &&
 	test_cmp expect output
 '
 
diff --git a/t/t1301-shared-repo.sh b/t/t1301-shared-repo.sh
index 2dc853d1be..b0236ffe4a 100755
--- a/t/t1301-shared-repo.sh
+++ b/t/t1301-shared-repo.sh
@@ -115,13 +115,13 @@ test_expect_success POSIXPERM 'git reflog expire honors core.sharedRepository' '
 	umask 077 &&
 	git config core.sharedRepository group &&
 	git reflog expire --all &&
-	actual="$(ls -l .git/logs/refs/heads/master)" &&
+	actual="$(ls -l .git/logs/refs/heads/main)" &&
 	case "$actual" in
 	-rw-rw-*)
 		: happy
 		;;
 	*)
-		echo Ooops, .git/logs/refs/heads/master is not 0662 [$actual]
+		echo Ooops, .git/logs/refs/heads/main is not 0662 [$actual]
 		false
 		;;
 	esac
diff --git a/t/t1305-config-include.sh b/t/t1305-config-include.sh
index f1e1b289f9..938ca17d78 100755
--- a/t/t1305-config-include.sh
+++ b/t/t1305-config-include.sh
@@ -312,7 +312,7 @@ test_expect_success SYMLINKS 'conditional include, gitdir matching symlink, icas
 test_expect_success 'conditional include, onbranch' '
 	echo "[includeIf \"onbranch:foo-branch\"]path=bar9" >>.git/config &&
 	echo "[test]nine=9" >.git/bar9 &&
-	git checkout -b master &&
+	git checkout -b main &&
 	test_must_fail git config test.nine &&
 	git checkout -b foo-branch &&
 	echo 9 >expect &&
diff --git a/t/t1309-early-config.sh b/t/t1309-early-config.sh
index ebb8e1aecb..598e62eb4c 100755
--- a/t/t1309-early-config.sh
+++ b/t/t1309-early-config.sh
@@ -91,11 +91,11 @@ test_expect_failure 'ignore .git/ with invalid config' '
 
 test_expect_success 'early config and onbranch' '
 	echo "[broken" >broken &&
-	test_with_config "[includeif \"onbranch:master\"]path=../broken"
+	test_with_config "[includeif \"onbranch:main\"]path=../broken"
 '
 
 test_expect_success 'onbranch config outside of git repo' '
-	test_config_global includeIf.onbranch:master.path non-existent &&
+	test_config_global includeIf.onbranch:main.path non-existent &&
 	nongit git help
 '
 
diff --git a/t/t1400-update-ref.sh b/t/t1400-update-ref.sh
index 4c01e08551..3265a8c58e 100755
--- a/t/t1400-update-ref.sh
+++ b/t/t1400-update-ref.sh
@@ -8,7 +8,7 @@ test_description='Test git update-ref and basic ref logging'
 
 Z=$ZERO_OID
 
-m=refs/heads/master
+m=refs/heads/main
 n_dir=refs/heads/gu
 n=$n_dir/fixes
 outside=refs/foo
@@ -258,7 +258,7 @@ test_expect_success "(not) changed .git/$m" '
 	! test $B = $(git show-ref -s --verify $m)
 '
 
-rm -f .git/logs/refs/heads/master
+rm -f .git/logs/refs/heads/main
 test_expect_success "create $m (logged by touch)" '
 	test_config core.logAllRefUpdates false &&
 	GIT_COMMITTER_DATE="2005-05-26 23:30" \
@@ -294,7 +294,7 @@ test_expect_success 'symref empty directory removal' '
 	git branch e1/e2/r1 HEAD &&
 	git branch e1/r2 HEAD &&
 	git checkout e1/e2/r1 &&
-	test_when_finished "git checkout master" &&
+	test_when_finished "git checkout main" &&
 	test_path_is_file .git/refs/heads/e1/e2/r1 &&
 	test_path_is_file .git/logs/refs/heads/e1/e2/r1 &&
 	git update-ref -d HEAD &&
@@ -358,68 +358,68 @@ test_expect_success 'set up for querying the reflog' '
 ed="Thu, 26 May 2005 18:32:00 -0500"
 gd="Thu, 26 May 2005 18:33:00 -0500"
 ld="Thu, 26 May 2005 18:43:00 -0500"
-test_expect_success 'Query "master@{May 25 2005}" (before history)' '
+test_expect_success 'Query "main@{May 25 2005}" (before history)' '
 	test_when_finished "rm -f o e" &&
-	git rev-parse --verify "master@{May 25 2005}" >o 2>e &&
+	git rev-parse --verify "main@{May 25 2005}" >o 2>e &&
 	echo "$C" >expect &&
 	test_cmp expect o &&
-	echo "warning: log for '\''master'\'' only goes back to $ed" >expect &&
+	echo "warning: log for '\''main'\'' only goes back to $ed" >expect &&
 	test_i18ncmp expect e
 '
-test_expect_success 'Query master@{2005-05-25} (before history)' '
+test_expect_success 'Query main@{2005-05-25} (before history)' '
 	test_when_finished "rm -f o e" &&
-	git rev-parse --verify master@{2005-05-25} >o 2>e &&
+	git rev-parse --verify main@{2005-05-25} >o 2>e &&
 	echo "$C" >expect &&
 	test_cmp expect o &&
-	echo "warning: log for '\''master'\'' only goes back to $ed" >expect &&
+	echo "warning: log for '\''main'\'' only goes back to $ed" >expect &&
 	test_i18ncmp expect e
 '
-test_expect_success 'Query "master@{May 26 2005 23:31:59}" (1 second before history)' '
+test_expect_success 'Query "main@{May 26 2005 23:31:59}" (1 second before history)' '
 	test_when_finished "rm -f o e" &&
-	git rev-parse --verify "master@{May 26 2005 23:31:59}" >o 2>e &&
+	git rev-parse --verify "main@{May 26 2005 23:31:59}" >o 2>e &&
 	echo "$C" >expect &&
 	test_cmp expect o &&
-	echo "warning: log for '\''master'\'' only goes back to $ed" >expect &&
+	echo "warning: log for '\''main'\'' only goes back to $ed" >expect &&
 	test_i18ncmp expect e
 '
-test_expect_success 'Query "master@{May 26 2005 23:32:00}" (exactly history start)' '
+test_expect_success 'Query "main@{May 26 2005 23:32:00}" (exactly history start)' '
 	test_when_finished "rm -f o e" &&
-	git rev-parse --verify "master@{May 26 2005 23:32:00}" >o 2>e &&
+	git rev-parse --verify "main@{May 26 2005 23:32:00}" >o 2>e &&
 	echo "$C" >expect &&
 	test_cmp expect o &&
 	test_must_be_empty e
 '
-test_expect_success 'Query "master@{May 26 2005 23:32:30}" (first non-creation change)' '
+test_expect_success 'Query "main@{May 26 2005 23:32:30}" (first non-creation change)' '
 	test_when_finished "rm -f o e" &&
-	git rev-parse --verify "master@{May 26 2005 23:32:30}" >o 2>e &&
+	git rev-parse --verify "main@{May 26 2005 23:32:30}" >o 2>e &&
 	echo "$A" >expect &&
 	test_cmp expect o &&
 	test_must_be_empty e
 '
-test_expect_success 'Query "master@{2005-05-26 23:33:01}" (middle of history with gap)' '
+test_expect_success 'Query "main@{2005-05-26 23:33:01}" (middle of history with gap)' '
 	test_when_finished "rm -f o e" &&
-	git rev-parse --verify "master@{2005-05-26 23:33:01}" >o 2>e &&
+	git rev-parse --verify "main@{2005-05-26 23:33:01}" >o 2>e &&
 	echo "$B" >expect &&
 	test_cmp expect o &&
 	test_i18ngrep -F "warning: log for ref $m has gap after $gd" e
 '
-test_expect_success 'Query "master@{2005-05-26 23:38:00}" (middle of history)' '
+test_expect_success 'Query "main@{2005-05-26 23:38:00}" (middle of history)' '
 	test_when_finished "rm -f o e" &&
-	git rev-parse --verify "master@{2005-05-26 23:38:00}" >o 2>e &&
+	git rev-parse --verify "main@{2005-05-26 23:38:00}" >o 2>e &&
 	echo "$Z" >expect &&
 	test_cmp expect o &&
 	test_must_be_empty e
 '
-test_expect_success 'Query "master@{2005-05-26 23:43:00}" (exact end of history)' '
+test_expect_success 'Query "main@{2005-05-26 23:43:00}" (exact end of history)' '
 	test_when_finished "rm -f o e" &&
-	git rev-parse --verify "master@{2005-05-26 23:43:00}" >o 2>e &&
+	git rev-parse --verify "main@{2005-05-26 23:43:00}" >o 2>e &&
 	echo "$E" >expect &&
 	test_cmp expect o &&
 	test_must_be_empty e
 '
-test_expect_success 'Query "master@{2005-05-28}" (past end of history)' '
+test_expect_success 'Query "main@{2005-05-28}" (past end of history)' '
 	test_when_finished "rm -f o e" &&
-	git rev-parse --verify "master@{2005-05-28}" >o 2>e &&
+	git rev-parse --verify "main@{2005-05-28}" >o 2>e &&
 	echo "$D" >expect &&
 	test_cmp expect o &&
 	test_i18ngrep -F "warning: log for ref $m unexpectedly ended on $ld" e
@@ -461,14 +461,14 @@ test_expect_success 'git commit logged updates' '
 '
 unset h_TEST h_OTHER h_FIXED h_MERGED
 
-test_expect_success 'git cat-file blob master:F (expect OTHER)' '
-	test OTHER = $(git cat-file blob master:F)
+test_expect_success 'git cat-file blob main:F (expect OTHER)' '
+	test OTHER = $(git cat-file blob main:F)
 '
-test_expect_success 'git cat-file blob master@{2005-05-26 23:30}:F (expect TEST)' '
-	test TEST = $(git cat-file blob "master@{2005-05-26 23:30}:F")
+test_expect_success 'git cat-file blob main@{2005-05-26 23:30}:F (expect TEST)' '
+	test TEST = $(git cat-file blob "main@{2005-05-26 23:30}:F")
 '
-test_expect_success 'git cat-file blob master@{2005-05-26 23:42}:F (expect OTHER)' '
-	test OTHER = $(git cat-file blob "master@{2005-05-26 23:42}:F")
+test_expect_success 'git cat-file blob main@{2005-05-26 23:42}:F (expect OTHER)' '
+	test OTHER = $(git cat-file blob "main@{2005-05-26 23:42}:F")
 '
 
 # Test adding and deleting pseudorefs
@@ -580,9 +580,9 @@ test_expect_success 'stdin fails on unknown command' '
 '
 
 test_expect_success 'stdin fails on unbalanced quotes' '
-	echo "create $a \"master" >stdin &&
+	echo "create $a \"main" >stdin &&
 	test_must_fail git update-ref --stdin <stdin 2>err &&
-	grep "fatal: badly quoted argument: \\\"master" err
+	grep "fatal: badly quoted argument: \\\"main" err
 '
 
 test_expect_success PREPARE_FOR_MAIN_BRANCH 'stdin fails on invalid escape' '
@@ -592,9 +592,9 @@ test_expect_success PREPARE_FOR_MAIN_BRANCH 'stdin fails on invalid escape' '
 '
 
 test_expect_success 'stdin fails on junk after quoted argument' '
-	echo "create \"$a\"master" >stdin &&
+	echo "create \"$a\"main" >stdin &&
 	test_must_fail git update-ref --stdin <stdin 2>err &&
-	grep "fatal: unexpected character after quoted argument: \\\"$a\\\"master" err
+	grep "fatal: unexpected character after quoted argument: \\\"$a\\\"main" err
 '
 
 test_expect_success 'stdin fails create with no ref' '
diff --git a/t/t1402-check-ref-format.sh b/t/t1402-check-ref-format.sh
index 98e4a8613b..cabc516ae9 100755
--- a/t/t1402-check-ref-format.sh
+++ b/t/t1402-check-ref-format.sh
@@ -134,18 +134,18 @@ valid_ref !MINGW "$ref" '--refspec-pattern --allow-onelevel --normalize'
 test_expect_success "check-ref-format --branch @{-1}" '
 	T=$(git write-tree) &&
 	sha1=$(echo A | git commit-tree $T) &&
-	git update-ref refs/heads/master $sha1 &&
-	git update-ref refs/remotes/origin/master $sha1 &&
-	git checkout master &&
-	git checkout origin/master &&
-	git checkout master &&
+	git update-ref refs/heads/main $sha1 &&
+	git update-ref refs/remotes/origin/main $sha1 &&
+	git checkout main &&
+	git checkout origin/main &&
+	git checkout main &&
 	refname=$(git check-ref-format --branch @{-1}) &&
 	test "$refname" = "$sha1" &&
 	refname2=$(git check-ref-format --branch @{-2}) &&
-	test "$refname2" = master'
+	test "$refname2" = main'
 
-test_expect_success 'check-ref-format --branch -naster' '
-	test_must_fail git check-ref-format --branch -naster >actual &&
+test_expect_success 'check-ref-format --branch -nain' '
+	test_must_fail git check-ref-format --branch -nain >actual &&
 	test_must_be_empty actual
 '
 
@@ -154,11 +154,11 @@ test_expect_success 'check-ref-format --branch from subdir' '
 
 	T=$(git write-tree) &&
 	sha1=$(echo A | git commit-tree $T) &&
-	git update-ref refs/heads/master $sha1 &&
-	git update-ref refs/remotes/origin/master $sha1 &&
-	git checkout master &&
-	git checkout origin/master &&
-	git checkout master &&
+	git update-ref refs/heads/main $sha1 &&
+	git update-ref refs/remotes/origin/main $sha1 &&
+	git checkout main &&
+	git checkout origin/main &&
+	git checkout main &&
 	refname=$(
 		cd subdir &&
 		git check-ref-format --branch @{-1}
@@ -171,9 +171,9 @@ test_expect_success 'check-ref-format --branch @{-1} from non-repo' '
 	test_must_be_empty actual
 '
 
-test_expect_success 'check-ref-format --branch master from non-repo' '
-	echo master >expect &&
-	nongit git check-ref-format --branch master >actual &&
+test_expect_success 'check-ref-format --branch main from non-repo' '
+	echo main >expect &&
+	nongit git check-ref-format --branch main >actual &&
 	test_cmp expect actual
 '
 
diff --git a/t/t1403-show-ref.sh b/t/t1403-show-ref.sh
index 5d955c3bff..681b7022c3 100755
--- a/t/t1403-show-ref.sh
+++ b/t/t1403-show-ref.sh
@@ -9,7 +9,7 @@ test_expect_success setup '
 	git checkout -b side &&
 	test_commit B &&
 	git tag -f -a -m "annotated B" B &&
-	git checkout master &&
+	git checkout main &&
 	test_commit C &&
 	git branch B A^0
 '
@@ -92,23 +92,23 @@ test_expect_success 'show-ref -d' '
 	git show-ref --verify -d refs/tags/A refs/tags/C >actual &&
 	test_cmp expect actual &&
 
-	echo $(git rev-parse refs/heads/master) refs/heads/master >expect &&
-	git show-ref -d master >actual &&
+	echo $(git rev-parse refs/heads/main) refs/heads/main >expect &&
+	git show-ref -d main >actual &&
 	test_cmp expect actual &&
 
-	git show-ref -d heads/master >actual &&
+	git show-ref -d heads/main >actual &&
 	test_cmp expect actual &&
 
-	git show-ref -d refs/heads/master >actual &&
+	git show-ref -d refs/heads/main >actual &&
 	test_cmp expect actual &&
 
-	git show-ref -d --verify refs/heads/master >actual &&
+	git show-ref -d --verify refs/heads/main >actual &&
 	test_cmp expect actual &&
 
-	test_must_fail git show-ref -d --verify master >actual &&
+	test_must_fail git show-ref -d --verify main >actual &&
 	test_must_be_empty actual &&
 
-	test_must_fail git show-ref -d --verify heads/master >actual &&
+	test_must_fail git show-ref -d --verify heads/main >actual &&
 	test_must_be_empty actual &&
 
 	test_must_fail git show-ref --verify -d A C >actual &&
@@ -120,7 +120,7 @@ test_expect_success 'show-ref -d' '
 '
 
 test_expect_success 'show-ref --heads, --tags, --head, pattern' '
-	for branch in B master side
+	for branch in B main side
 	do
 		echo $(git rev-parse refs/heads/$branch) refs/heads/$branch
 	done >expect.heads &&
diff --git a/t/t1405-main-ref-store.sh b/t/t1405-main-ref-store.sh
index 74af927fba..5661df799b 100755
--- a/t/t1405-main-ref-store.sh
+++ b/t/t1405-main-ref-store.sh
@@ -21,9 +21,9 @@ test_expect_success 'peel_ref(new-tag)' '
 	test_cmp expected actual
 '
 
-test_expect_success 'create_symref(FOO, refs/heads/master)' '
-	$RUN create-symref FOO refs/heads/master nothing &&
-	echo refs/heads/master >expected &&
+test_expect_success 'create_symref(FOO, refs/heads/main)' '
+	$RUN create-symref FOO refs/heads/main nothing &&
+	echo refs/heads/main >expected &&
 	git symbolic-ref FOO >actual &&
 	test_cmp expected actual
 '
@@ -31,7 +31,7 @@ test_expect_success 'create_symref(FOO, refs/heads/master)' '
 test_expect_success 'delete_refs(FOO, refs/tags/new-tag)' '
 	git rev-parse FOO -- &&
 	git rev-parse refs/tags/new-tag -- &&
-	m=$(git rev-parse master) &&
+	m=$(git rev-parse main) &&
 	REF_NO_DEREF=1 &&
 	$RUN delete-refs $REF_NO_DEREF nothing FOO refs/tags/new-tag &&
 	test_must_fail git rev-parse --symbolic-full-name FOO &&
@@ -39,19 +39,19 @@ test_expect_success 'delete_refs(FOO, refs/tags/new-tag)' '
 	test_must_fail git rev-parse refs/tags/new-tag --
 '
 
-test_expect_success 'rename_refs(master, new-master)' '
-	git rev-parse master >expected &&
-	$RUN rename-ref refs/heads/master refs/heads/new-master &&
-	git rev-parse new-master >actual &&
+test_expect_success 'rename_refs(main, new-main)' '
+	git rev-parse main >expected &&
+	$RUN rename-ref refs/heads/main refs/heads/new-main &&
+	git rev-parse new-main >actual &&
 	test_cmp expected actual &&
-	test_commit recreate-master
+	test_commit recreate-main
 '
 
 test_expect_success 'for_each_ref(refs/heads/)' '
 	$RUN for-each-ref refs/heads/ | cut -d" " -f 2- >actual &&
 	cat >expected <<-\EOF &&
-	master 0x0
-	new-master 0x0
+	main 0x0
+	new-main 0x0
 	EOF
 	test_cmp expected actual
 '
@@ -62,23 +62,23 @@ test_expect_success 'for_each_ref() is sorted' '
 	test_cmp expected actual
 '
 
-test_expect_success 'resolve_ref(new-master)' '
-	SHA1=`git rev-parse new-master` &&
-	echo "$SHA1 refs/heads/new-master 0x0" >expected &&
-	$RUN resolve-ref refs/heads/new-master 0 >actual &&
+test_expect_success 'resolve_ref(new-main)' '
+	SHA1=`git rev-parse new-main` &&
+	echo "$SHA1 refs/heads/new-main 0x0" >expected &&
+	$RUN resolve-ref refs/heads/new-main 0 >actual &&
 	test_cmp expected actual
 '
 
-test_expect_success 'verify_ref(new-master)' '
-	$RUN verify-ref refs/heads/new-master
+test_expect_success 'verify_ref(new-main)' '
+	$RUN verify-ref refs/heads/new-main
 '
 
 test_expect_success 'for_each_reflog()' '
 	$RUN for-each-reflog | sort -k2 | cut -d" " -f 2- >actual &&
 	cat >expected <<-\EOF &&
 	HEAD 0x1
-	refs/heads/master 0x0
-	refs/heads/new-master 0x0
+	refs/heads/main 0x0
+	refs/heads/new-main 0x0
 	EOF
 	test_cmp expected actual
 '
@@ -86,12 +86,12 @@ test_expect_success 'for_each_reflog()' '
 test_expect_success 'for_each_reflog_ent()' '
 	$RUN for-each-reflog-ent HEAD >actual &&
 	head -n1 actual | grep one &&
-	tail -n2 actual | head -n1 | grep recreate-master
+	tail -n2 actual | head -n1 | grep recreate-main
 '
 
 test_expect_success 'for_each_reflog_ent_reverse()' '
 	$RUN for-each-reflog-ent-reverse HEAD >actual &&
-	head -n1 actual | grep recreate-master &&
+	head -n1 actual | grep recreate-main &&
 	tail -n2 actual | head -n1 | grep one
 '
 
diff --git a/t/t1406-submodule-ref-store.sh b/t/t1406-submodule-ref-store.sh
index 36b7ef5046..e3e3b9c84c 100755
--- a/t/t1406-submodule-ref-store.sh
+++ b/t/t1406-submodule-ref-store.sh
@@ -11,7 +11,7 @@ test_expect_success 'setup' '
 	(
 		cd sub &&
 		test_commit first &&
-		git checkout -b new-master
+		git checkout -b new-main
 	)
 '
 
@@ -27,7 +27,7 @@ test_expect_success 'peel_ref(new-tag)' '
 '
 
 test_expect_success 'create_symref() not allowed' '
-	test_must_fail $RUN create-symref FOO refs/heads/master nothing
+	test_must_fail $RUN create-symref FOO refs/heads/main nothing
 '
 
 test_expect_success 'delete_refs() not allowed' '
@@ -35,14 +35,14 @@ test_expect_success 'delete_refs() not allowed' '
 '
 
 test_expect_success 'rename_refs() not allowed' '
-	test_must_fail $RUN rename-ref refs/heads/master refs/heads/new-master
+	test_must_fail $RUN rename-ref refs/heads/main refs/heads/new-main
 '
 
 test_expect_success 'for_each_ref(refs/heads/)' '
 	$RUN for-each-ref refs/heads/ | cut -d" " -f 2- >actual &&
 	cat >expected <<-\EOF &&
-	master 0x0
-	new-master 0x0
+	main 0x0
+	new-main 0x0
 	EOF
 	test_cmp expected actual
 '
@@ -53,23 +53,23 @@ test_expect_success 'for_each_ref() is sorted' '
 	test_cmp expected actual
 '
 
-test_expect_success 'resolve_ref(master)' '
-	SHA1=`git -C sub rev-parse master` &&
-	echo "$SHA1 refs/heads/master 0x0" >expected &&
-	$RUN resolve-ref refs/heads/master 0 >actual &&
+test_expect_success 'resolve_ref(main)' '
+	SHA1=`git -C sub rev-parse main` &&
+	echo "$SHA1 refs/heads/main 0x0" >expected &&
+	$RUN resolve-ref refs/heads/main 0 >actual &&
 	test_cmp expected actual
 '
 
-test_expect_success 'verify_ref(new-master)' '
-	$RUN verify-ref refs/heads/new-master
+test_expect_success 'verify_ref(new-main)' '
+	$RUN verify-ref refs/heads/new-main
 '
 
 test_expect_success 'for_each_reflog()' '
 	$RUN for-each-reflog | sort | cut -d" " -f 2- >actual &&
 	cat >expected <<-\EOF &&
 	HEAD 0x1
-	refs/heads/master 0x0
-	refs/heads/new-master 0x0
+	refs/heads/main 0x0
+	refs/heads/new-main 0x0
 	EOF
 	test_cmp expected actual
 '
@@ -77,12 +77,12 @@ test_expect_success 'for_each_reflog()' '
 test_expect_success 'for_each_reflog_ent()' '
 	$RUN for-each-reflog-ent HEAD >actual &&
 	head -n1 actual | grep first &&
-	tail -n2 actual | head -n1 | grep master.to.new
+	tail -n2 actual | head -n1 | grep main.to.new
 '
 
 test_expect_success 'for_each_reflog_ent_reverse()' '
 	$RUN for-each-reflog-ent-reverse HEAD >actual &&
-	head -n1 actual | grep master.to.new &&
+	head -n1 actual | grep main.to.new &&
 	tail -n2 actual | head -n1 | grep first
 '
 
diff --git a/t/t1407-worktree-ref-store.sh b/t/t1407-worktree-ref-store.sh
index 9a84858118..71059cb254 100755
--- a/t/t1407-worktree-ref-store.sh
+++ b/t/t1407-worktree-ref-store.sh
@@ -9,7 +9,7 @@ RMAIN="test-tool ref-store worktree:main"
 
 test_expect_success 'setup' '
 	test_commit first &&
-	git worktree add -b wt-master wt &&
+	git worktree add -b wt-main wt &&
 	(
 		cd wt &&
 		test_commit second
@@ -17,34 +17,34 @@ test_expect_success 'setup' '
 '
 
 test_expect_success 'resolve_ref(<shared-ref>)' '
-	SHA1=`git rev-parse master` &&
-	echo "$SHA1 refs/heads/master 0x0" >expected &&
-	$RWT resolve-ref refs/heads/master 0 >actual &&
+	SHA1=`git rev-parse main` &&
+	echo "$SHA1 refs/heads/main 0x0" >expected &&
+	$RWT resolve-ref refs/heads/main 0 >actual &&
 	test_cmp expected actual &&
-	$RMAIN resolve-ref refs/heads/master 0 >actual &&
+	$RMAIN resolve-ref refs/heads/main 0 >actual &&
 	test_cmp expected actual
 '
 
 test_expect_success 'resolve_ref(<per-worktree-ref>)' '
 	SHA1=`git -C wt rev-parse HEAD` &&
-	echo "$SHA1 refs/heads/wt-master 0x1" >expected &&
+	echo "$SHA1 refs/heads/wt-main 0x1" >expected &&
 	$RWT resolve-ref HEAD 0 >actual &&
 	test_cmp expected actual &&
 
 	SHA1=`git rev-parse HEAD` &&
-	echo "$SHA1 refs/heads/master 0x1" >expected &&
+	echo "$SHA1 refs/heads/main 0x1" >expected &&
 	$RMAIN resolve-ref HEAD 0 >actual &&
 	test_cmp expected actual
 '
 
-test_expect_success 'create_symref(FOO, refs/heads/master)' '
-	$RWT create-symref FOO refs/heads/master nothing &&
-	echo refs/heads/master >expected &&
+test_expect_success 'create_symref(FOO, refs/heads/main)' '
+	$RWT create-symref FOO refs/heads/main nothing &&
+	echo refs/heads/main >expected &&
 	git -C wt symbolic-ref FOO >actual &&
 	test_cmp expected actual &&
 
-	$RMAIN create-symref FOO refs/heads/wt-master nothing &&
-	echo refs/heads/wt-master >expected &&
+	$RMAIN create-symref FOO refs/heads/wt-main nothing &&
+	echo refs/heads/wt-main >expected &&
 	git symbolic-ref FOO >actual &&
 	test_cmp expected actual
 '
@@ -63,8 +63,8 @@ test_expect_success 'for_each_reflog()' '
 	HEAD 0x1
 	PSEUDO-WT 0x0
 	refs/bisect/wt-random 0x0
-	refs/heads/master 0x0
-	refs/heads/wt-master 0x0
+	refs/heads/main 0x0
+	refs/heads/wt-main 0x0
 	EOF
 	test_cmp expected actual &&
 
@@ -73,8 +73,8 @@ test_expect_success 'for_each_reflog()' '
 	HEAD 0x1
 	PSEUDO-MAIN 0x0
 	refs/bisect/random 0x0
-	refs/heads/master 0x0
-	refs/heads/wt-master 0x0
+	refs/heads/main 0x0
+	refs/heads/wt-main 0x0
 	EOF
 	test_cmp expected actual
 '
diff --git a/t/t1408-packed-refs.sh b/t/t1408-packed-refs.sh
index 1e44a17eea..f40e7af8ce 100755
--- a/t/t1408-packed-refs.sh
+++ b/t/t1408-packed-refs.sh
@@ -9,32 +9,32 @@ test_expect_success setup '
 	git commit --allow-empty -m one &&
 	one=$(git rev-parse HEAD) &&
 	git for-each-ref >actual &&
-	echo "$one commit	refs/heads/master" >expect &&
+	echo "$one commit	refs/heads/main" >expect &&
 	test_cmp expect actual &&
 
 	git pack-refs --all &&
 	git for-each-ref >actual &&
-	echo "$one commit	refs/heads/master" >expect &&
+	echo "$one commit	refs/heads/main" >expect &&
 	test_cmp expect actual &&
 
 	git checkout --orphan another &&
 	test_tick &&
 	git commit --allow-empty -m two &&
 	two=$(git rev-parse HEAD) &&
-	git checkout -B master &&
+	git checkout -B main &&
 	git branch -D another &&
 
 	git for-each-ref >actual &&
-	echo "$two commit	refs/heads/master" >expect &&
+	echo "$two commit	refs/heads/main" >expect &&
 	test_cmp expect actual &&
 
 	git reflog expire --expire=now --all &&
 	git prune &&
-	git tag -m v1.0 v1.0 master
+	git tag -m v1.0 v1.0 main
 '
 
 test_expect_success 'no error from stale entry in packed-refs' '
-	git describe master >actual 2>&1 &&
+	git describe main >actual 2>&1 &&
 	echo "v1.0" >expect &&
 	test_cmp expect actual
 '
diff --git a/t/t1410-reflog.sh b/t/t1410-reflog.sh
index 730a43d9dd..8553141434 100755
--- a/t/t1410-reflog.sh
+++ b/t/t1410-reflog.sh
@@ -99,7 +99,7 @@ test_expect_success setup '
 
 	check_fsck &&
 
-	git reflog refs/heads/master >output &&
+	git reflog refs/heads/main >output &&
 	test_line_count = 4 output
 '
 
@@ -116,7 +116,7 @@ test_expect_success rewind '
 
 	check_have A B C D E F G H I J K L &&
 
-	git reflog refs/heads/master >output &&
+	git reflog refs/heads/main >output &&
 	test_line_count = 5 output
 '
 
@@ -135,7 +135,7 @@ test_expect_success 'reflog expire --dry-run should not touch reflog' '
 		--stale-fix \
 		--all &&
 
-	git reflog refs/heads/master >output &&
+	git reflog refs/heads/main >output &&
 	test_line_count = 5 output &&
 
 	check_fsck "missing blob $F"
@@ -149,7 +149,7 @@ test_expect_success 'reflog expire' '
 		--stale-fix \
 		--all &&
 
-	git reflog refs/heads/master >output &&
+	git reflog refs/heads/main >output &&
 	test_line_count = 2 output &&
 
 	check_fsck "dangling commit $K"
@@ -186,29 +186,29 @@ test_expect_success 'delete' '
 	git commit -m tiger C &&
 
 	HEAD_entry_count=$(git reflog | wc -l) &&
-	master_entry_count=$(git reflog show master | wc -l) &&
+	main_entry_count=$(git reflog show main | wc -l) &&
 
 	test $HEAD_entry_count = 5 &&
-	test $master_entry_count = 5 &&
+	test $main_entry_count = 5 &&
 
 
-	git reflog delete master@{1} &&
-	git reflog show master > output &&
-	test_line_count = $(($master_entry_count - 1)) output &&
+	git reflog delete main@{1} &&
+	git reflog show main > output &&
+	test_line_count = $(($main_entry_count - 1)) output &&
 	test $HEAD_entry_count = $(git reflog | wc -l) &&
 	! grep ox < output &&
 
-	master_entry_count=$(wc -l < output) &&
+	main_entry_count=$(wc -l < output) &&
 
 	git reflog delete HEAD@{1} &&
 	test $(($HEAD_entry_count -1)) = $(git reflog | wc -l) &&
-	test $master_entry_count = $(git reflog show master | wc -l) &&
+	test $main_entry_count = $(git reflog show main | wc -l) &&
 
 	HEAD_entry_count=$(git reflog | wc -l) &&
 
-	git reflog delete master@{07.04.2005.15:15:00.-0700} &&
-	git reflog show master > output &&
-	test_line_count = $(($master_entry_count - 1)) output &&
+	git reflog delete main@{07.04.2005.15:15:00.-0700} &&
+	git reflog show main > output &&
+	test_line_count = $(($main_entry_count - 1)) output &&
 	! grep dragon < output
 
 '
@@ -216,7 +216,7 @@ test_expect_success 'delete' '
 test_expect_success 'rewind2' '
 
 	test_tick && git reset --hard HEAD~2 &&
-	git reflog refs/heads/master >output &&
+	git reflog refs/heads/main >output &&
 	test_line_count = 4 output
 '
 
@@ -226,7 +226,7 @@ test_expect_success '--expire=never' '
 		--expire=never \
 		--expire-unreachable=never \
 		--all &&
-	git reflog refs/heads/master >output &&
+	git reflog refs/heads/main >output &&
 	test_line_count = 4 output
 '
 
@@ -237,7 +237,7 @@ test_expect_success 'gc.reflogexpire=never' '
 	git reflog expire --verbose --all >output &&
 	test_line_count = 9 output &&
 
-	git reflog refs/heads/master >output &&
+	git reflog refs/heads/main >output &&
 	test_line_count = 4 output
 '
 
@@ -246,7 +246,7 @@ test_expect_success 'gc.reflogexpire=false' '
 	test_config gc.reflogexpireunreachable false &&
 
 	git reflog expire --verbose --all &&
-	git reflog refs/heads/master >output &&
+	git reflog refs/heads/main >output &&
 	test_line_count = 4 output
 
 '
@@ -255,33 +255,33 @@ test_expect_success 'git reflog expire unknown reference' '
 	test_config gc.reflogexpire never &&
 	test_config gc.reflogexpireunreachable never &&
 
-	test_must_fail git reflog expire master@{123} 2>stderr &&
+	test_must_fail git reflog expire main@{123} 2>stderr &&
 	test_i18ngrep "points nowhere" stderr &&
 	test_must_fail git reflog expire does-not-exist 2>stderr &&
 	test_i18ngrep "points nowhere" stderr
 '
 
 test_expect_success 'checkout should not delete log for packed ref' '
-	test $(git reflog master | wc -l) = 4 &&
+	test $(git reflog main | wc -l) = 4 &&
 	git branch foo &&
 	git pack-refs --all &&
 	git checkout foo &&
-	test $(git reflog master | wc -l) = 4
+	test $(git reflog main | wc -l) = 4
 '
 
 test_expect_success 'stale dirs do not cause d/f conflicts (reflogs on)' '
 	test_when_finished "git branch -d one || git branch -d one/two" &&
 
-	git branch one/two master &&
-	echo "one/two@{0} branch: Created from master" >expect &&
+	git branch one/two main &&
+	echo "one/two@{0} branch: Created from main" >expect &&
 	git log -g --format="%gd %gs" one/two >actual &&
 	test_cmp expect actual &&
 	git branch -d one/two &&
 
 	# now logs/refs/heads/one is a stale directory, but
 	# we should move it out of the way to create "one" reflog
-	git branch one master &&
-	echo "one@{0} branch: Created from master" >expect &&
+	git branch one main &&
+	echo "one@{0} branch: Created from main" >expect &&
 	git log -g --format="%gd %gs" one >actual &&
 	test_cmp expect actual
 '
@@ -289,15 +289,15 @@ test_expect_success 'stale dirs do not cause d/f conflicts (reflogs on)' '
 test_expect_success 'stale dirs do not cause d/f conflicts (reflogs off)' '
 	test_when_finished "git branch -d one || git branch -d one/two" &&
 
-	git branch one/two master &&
-	echo "one/two@{0} branch: Created from master" >expect &&
+	git branch one/two main &&
+	echo "one/two@{0} branch: Created from main" >expect &&
 	git log -g --format="%gd %gs" one/two >actual &&
 	test_cmp expect actual &&
 	git branch -d one/two &&
 
 	# same as before, but we only create a reflog for "one" if
 	# it already exists, which it does not
-	git -c core.logallrefupdates=false branch one master &&
+	git -c core.logallrefupdates=false branch one main &&
 	git log -g --format="%gd %gs" one >actual &&
 	test_must_be_empty actual
 '
diff --git a/t/t1411-reflog-show.sh b/t/t1411-reflog-show.sh
index 985daf1def..333b35aebc 100755
--- a/t/t1411-reflog-show.sh
+++ b/t/t1411-reflog-show.sh
@@ -167,7 +167,7 @@ test_expect_success 'git log -g -p shows diffs vs. parents' '
 '
 
 test_expect_success 'reflog exists works' '
-	git reflog exists refs/heads/master &&
+	git reflog exists refs/heads/main &&
 	! git reflog exists refs/heads/nonexistent
 '
 
diff --git a/t/t1413-reflog-detach.sh b/t/t1413-reflog-detach.sh
index c730600d8a..b1f7f35fe9 100755
--- a/t/t1413-reflog-detach.sh
+++ b/t/t1413-reflog-detach.sh
@@ -4,7 +4,7 @@ test_description='Test reflog interaction with detached HEAD'
 . ./test-lib.sh
 
 reset_state () {
-	git checkout master &&
+	git checkout main &&
 	cp saved_reflog .git/logs/HEAD
 }
 
@@ -19,14 +19,14 @@ test_expect_success setup '
 
 test_expect_success baseline '
 	reset_state &&
-	git rev-parse master master^ >expect &&
+	git rev-parse main main^ >expect &&
 	git log -g --format=%H >actual &&
 	test_cmp expect actual
 '
 
 test_expect_success 'switch to branch' '
 	reset_state &&
-	git rev-parse side master master^ >expect &&
+	git rev-parse side main main^ >expect &&
 	git checkout side &&
 	git log -g --format=%H >actual &&
 	test_cmp expect actual
@@ -34,34 +34,34 @@ test_expect_success 'switch to branch' '
 
 test_expect_success 'detach to other' '
 	reset_state &&
-	git rev-parse master side master master^ >expect &&
+	git rev-parse main side main main^ >expect &&
 	git checkout side &&
-	git checkout master^0 &&
+	git checkout main^0 &&
 	git log -g --format=%H >actual &&
 	test_cmp expect actual
 '
 
 test_expect_success 'detach to self' '
 	reset_state &&
-	git rev-parse master master master^ >expect &&
-	git checkout master^0 &&
+	git rev-parse main main main^ >expect &&
+	git checkout main^0 &&
 	git log -g --format=%H >actual &&
 	test_cmp expect actual
 '
 
 test_expect_success 'attach to self' '
 	reset_state &&
-	git rev-parse master master master master^ >expect &&
-	git checkout master^0 &&
-	git checkout master &&
+	git rev-parse main main main main^ >expect &&
+	git checkout main^0 &&
+	git checkout main &&
 	git log -g --format=%H >actual &&
 	test_cmp expect actual
 '
 
 test_expect_success 'attach to other' '
 	reset_state &&
-	git rev-parse side master master master^ >expect &&
-	git checkout master^0 &&
+	git rev-parse side main main main^ >expect &&
+	git checkout main^0 &&
 	git checkout side &&
 	git log -g --format=%H >actual &&
 	test_cmp expect actual
diff --git a/t/t1414-reflog-walk.sh b/t/t1414-reflog-walk.sh
index 1181a9fb28..89458b7158 100755
--- a/t/t1414-reflog-walk.sh
+++ b/t/t1414-reflog-walk.sh
@@ -8,7 +8,7 @@ test_expect_success 'set up some reflog entries' '
 	test_commit two &&
 	git checkout -b side HEAD^ &&
 	test_commit three &&
-	git merge --no-commit master &&
+	git merge --no-commit main &&
 	echo evil-merge-content >>one.t &&
 	test_tick &&
 	git commit --no-edit -a
@@ -20,9 +20,9 @@ do_walk () {
 
 test_expect_success 'set up expected reflog' '
 	cat >expect.all <<-EOF
-	HEAD@{0} commit (merge): Merge branch ${SQ}master${SQ} into side
+	HEAD@{0} commit (merge): Merge branch ${SQ}main${SQ} into side
 	HEAD@{1} commit: three
-	HEAD@{2} checkout: moving from master to side
+	HEAD@{2} checkout: moving from main to side
 	HEAD@{3} commit: two
 	HEAD@{4} commit (initial): one
 	EOF
@@ -73,15 +73,15 @@ test_expect_success 'walking multiple reflogs shows all' '
 	#      sort ignores the bits after the timestamp.
 	#
 	#   2. POSIX leaves undefined whether this is a stable sort or not. So
-	#      we use "-k 1" to ensure that we see HEAD before master before
+	#      we use "-k 1" to ensure that we see HEAD before main before
 	#      side when breaking ties.
 	{
 		do_walk --date=unix HEAD &&
 		do_walk --date=unix side &&
-		do_walk --date=unix master
+		do_walk --date=unix main
 	} >expect.raw &&
 	sort -t "{" -k 2nr -k 1 <expect.raw >expect &&
-	do_walk --date=unix HEAD master side >actual &&
+	do_walk --date=unix HEAD main side >actual &&
 	test_cmp expect actual
 '
 
diff --git a/t/t1416-ref-transaction-hooks.sh b/t/t1416-ref-transaction-hooks.sh
index f6e741c6c0..4cabc07c86 100755
--- a/t/t1416-ref-transaction-hooks.sh
+++ b/t/t1416-ref-transaction-hooks.sh
@@ -53,11 +53,11 @@ test_expect_success 'hook gets all queued updates in prepared state' '
 	EOF
 	cat >expect <<-EOF &&
 		$ZERO_OID $POST_OID HEAD
-		$ZERO_OID $POST_OID refs/heads/master
+		$ZERO_OID $POST_OID refs/heads/main
 	EOF
 	git update-ref HEAD POST <<-EOF &&
 		update HEAD $ZERO_OID $POST_OID
-		update refs/heads/master $ZERO_OID $POST_OID
+		update refs/heads/main $ZERO_OID $POST_OID
 	EOF
 	test_cmp expect actual
 '
@@ -76,7 +76,7 @@ test_expect_success 'hook gets all queued updates in committed state' '
 	EOF
 	cat >expect <<-EOF &&
 		$ZERO_OID $POST_OID HEAD
-		$ZERO_OID $POST_OID refs/heads/master
+		$ZERO_OID $POST_OID refs/heads/main
 	EOF
 	git update-ref HEAD POST &&
 	test_cmp expect actual
@@ -96,12 +96,12 @@ test_expect_success 'hook gets all queued updates in aborted state' '
 	EOF
 	cat >expect <<-EOF &&
 		$ZERO_OID $POST_OID HEAD
-		$ZERO_OID $POST_OID refs/heads/master
+		$ZERO_OID $POST_OID refs/heads/main
 	EOF
 	git update-ref --stdin <<-EOF &&
 		start
 		update HEAD POST $ZERO_OID
-		update refs/heads/master POST $ZERO_OID
+		update refs/heads/main POST $ZERO_OID
 		abort
 	EOF
 	test_cmp expect actual
diff --git a/t/t1430-bad-ref-name.sh b/t/t1430-bad-ref-name.sh
index c7878a60ed..fcc0194d7e 100755
--- a/t/t1430-bad-ref-name.sh
+++ b/t/t1430-bad-ref-name.sh
@@ -17,7 +17,7 @@ test_expect_success 'fast-import: fail on invalid branch name ".badbranchname"'
 		corrupt
 		COMMIT
 
-		from refs/heads/master
+		from refs/heads/main
 
 	INPUT_END
 	test_must_fail git fast-import <input
@@ -32,14 +32,14 @@ test_expect_success 'fast-import: fail on invalid branch name "bad[branch]name"'
 		corrupt
 		COMMIT
 
-		from refs/heads/master
+		from refs/heads/main
 
 	INPUT_END
 	test_must_fail git fast-import <input
 '
 
 test_expect_success 'git branch shows badly named ref as warning' '
-	cp .git/refs/heads/master .git/refs/heads/broken...ref &&
+	cp .git/refs/heads/main .git/refs/heads/broken...ref &&
 	test_when_finished "rm -f .git/refs/heads/broken...ref" &&
 	git branch >output 2>error &&
 	test_i18ngrep -e "ignoring ref with broken name refs/heads/broken\.\.\.ref" error &&
@@ -47,7 +47,7 @@ test_expect_success 'git branch shows badly named ref as warning' '
 '
 
 test_expect_success 'branch -d can delete badly named ref' '
-	cp .git/refs/heads/master .git/refs/heads/broken...ref &&
+	cp .git/refs/heads/main .git/refs/heads/broken...ref &&
 	test_when_finished "rm -f .git/refs/heads/broken...ref" &&
 	git branch -d broken...ref &&
 	git branch >output 2>error &&
@@ -56,7 +56,7 @@ test_expect_success 'branch -d can delete badly named ref' '
 '
 
 test_expect_success 'branch -D can delete badly named ref' '
-	cp .git/refs/heads/master .git/refs/heads/broken...ref &&
+	cp .git/refs/heads/main .git/refs/heads/broken...ref &&
 	test_when_finished "rm -f .git/refs/heads/broken...ref" &&
 	git branch -D broken...ref &&
 	git branch >output 2>error &&
@@ -98,17 +98,17 @@ test_expect_success 'branch -m cannot rename to a bad ref name' '
 	test_might_fail git branch -D goodref &&
 	git branch goodref &&
 	test_must_fail git branch -m goodref broken...ref &&
-	test_cmp_rev master goodref &&
+	test_cmp_rev main goodref &&
 	git branch >output 2>error &&
 	! grep -e "broken\.\.\.ref" error &&
 	! grep -e "broken\.\.\.ref" output
 '
 
 test_expect_failure 'branch -m can rename from a bad ref name' '
-	cp .git/refs/heads/master .git/refs/heads/broken...ref &&
+	cp .git/refs/heads/main .git/refs/heads/broken...ref &&
 	test_when_finished "rm -f .git/refs/heads/broken...ref" &&
 	git branch -m broken...ref renamed &&
-	test_cmp_rev master renamed &&
+	test_cmp_rev main renamed &&
 	git branch >output 2>error &&
 	! grep -e "broken\.\.\.ref" error &&
 	! grep -e "broken\.\.\.ref" output
@@ -135,7 +135,7 @@ test_expect_failure C_LOCALE_OUTPUT 'push --mirror can delete badly named ref' '
 		cd dest &&
 		test_commit two &&
 		git checkout --detach &&
-		cp .git/refs/heads/master .git/refs/heads/broken...ref
+		cp .git/refs/heads/main .git/refs/heads/broken...ref
 	) &&
 	git -C src push --mirror "file://$top/dest" &&
 	git -C dest branch >output 2>error &&
@@ -146,7 +146,7 @@ test_expect_failure C_LOCALE_OUTPUT 'push --mirror can delete badly named ref' '
 test_expect_success 'rev-parse skips symref pointing to broken name' '
 	test_when_finished "rm -f .git/refs/heads/broken...ref" &&
 	git branch shadow one &&
-	cp .git/refs/heads/master .git/refs/heads/broken...ref &&
+	cp .git/refs/heads/main .git/refs/heads/broken...ref &&
 	printf "ref: refs/heads/broken...ref\n" >.git/refs/tags/shadow &&
 	test_when_finished "rm -f .git/refs/tags/shadow" &&
 	git rev-parse --verify one >expect &&
@@ -156,11 +156,11 @@ test_expect_success 'rev-parse skips symref pointing to broken name' '
 '
 
 test_expect_success 'for-each-ref emits warnings for broken names' '
-	cp .git/refs/heads/master .git/refs/heads/broken...ref &&
+	cp .git/refs/heads/main .git/refs/heads/broken...ref &&
 	test_when_finished "rm -f .git/refs/heads/broken...ref" &&
 	printf "ref: refs/heads/broken...ref\n" >.git/refs/heads/badname &&
 	test_when_finished "rm -f .git/refs/heads/badname" &&
-	printf "ref: refs/heads/master\n" >.git/refs/heads/broken...symref &&
+	printf "ref: refs/heads/main\n" >.git/refs/heads/broken...symref &&
 	test_when_finished "rm -f .git/refs/heads/broken...symref" &&
 	git for-each-ref >output 2>error &&
 	! grep -e "broken\.\.\.ref" output &&
@@ -172,7 +172,7 @@ test_expect_success 'for-each-ref emits warnings for broken names' '
 '
 
 test_expect_success 'update-ref -d can delete broken name' '
-	cp .git/refs/heads/master .git/refs/heads/broken...ref &&
+	cp .git/refs/heads/main .git/refs/heads/broken...ref &&
 	test_when_finished "rm -f .git/refs/heads/broken...ref" &&
 	git update-ref -d refs/heads/broken...ref >output 2>error &&
 	test_must_be_empty output &&
@@ -183,7 +183,7 @@ test_expect_success 'update-ref -d can delete broken name' '
 '
 
 test_expect_success 'branch -d can delete broken name' '
-	cp .git/refs/heads/master .git/refs/heads/broken...ref &&
+	cp .git/refs/heads/main .git/refs/heads/broken...ref &&
 	test_when_finished "rm -f .git/refs/heads/broken...ref" &&
 	git branch -d broken...ref >output 2>error &&
 	test_i18ngrep "Deleted branch broken...ref (was broken)" output &&
@@ -194,7 +194,7 @@ test_expect_success 'branch -d can delete broken name' '
 '
 
 test_expect_success 'update-ref --no-deref -d can delete symref to broken name' '
-	cp .git/refs/heads/master .git/refs/heads/broken...ref &&
+	cp .git/refs/heads/main .git/refs/heads/broken...ref &&
 	test_when_finished "rm -f .git/refs/heads/broken...ref" &&
 	printf "ref: refs/heads/broken...ref\n" >.git/refs/heads/badname &&
 	test_when_finished "rm -f .git/refs/heads/badname" &&
@@ -205,7 +205,7 @@ test_expect_success 'update-ref --no-deref -d can delete symref to broken name'
 '
 
 test_expect_success 'branch -d can delete symref to broken name' '
-	cp .git/refs/heads/master .git/refs/heads/broken...ref &&
+	cp .git/refs/heads/main .git/refs/heads/broken...ref &&
 	test_when_finished "rm -f .git/refs/heads/broken...ref" &&
 	printf "ref: refs/heads/broken...ref\n" >.git/refs/heads/badname &&
 	test_when_finished "rm -f .git/refs/heads/badname" &&
@@ -234,7 +234,7 @@ test_expect_success 'branch -d can delete dangling symref to broken name' '
 '
 
 test_expect_success 'update-ref -d can delete broken name through symref' '
-	cp .git/refs/heads/master .git/refs/heads/broken...ref &&
+	cp .git/refs/heads/main .git/refs/heads/broken...ref &&
 	test_when_finished "rm -f .git/refs/heads/broken...ref" &&
 	printf "ref: refs/heads/broken...ref\n" >.git/refs/heads/badname &&
 	test_when_finished "rm -f .git/refs/heads/badname" &&
@@ -245,7 +245,7 @@ test_expect_success 'update-ref -d can delete broken name through symref' '
 '
 
 test_expect_success 'update-ref --no-deref -d can delete symref with broken name' '
-	printf "ref: refs/heads/master\n" >.git/refs/heads/broken...symref &&
+	printf "ref: refs/heads/main\n" >.git/refs/heads/broken...symref &&
 	test_when_finished "rm -f .git/refs/heads/broken...symref" &&
 	git update-ref --no-deref -d refs/heads/broken...symref >output 2>error &&
 	test_path_is_missing .git/refs/heads/broken...symref &&
@@ -254,11 +254,11 @@ test_expect_success 'update-ref --no-deref -d can delete symref with broken name
 '
 
 test_expect_success 'branch -d can delete symref with broken name' '
-	printf "ref: refs/heads/master\n" >.git/refs/heads/broken...symref &&
+	printf "ref: refs/heads/main\n" >.git/refs/heads/broken...symref &&
 	test_when_finished "rm -f .git/refs/heads/broken...symref" &&
 	git branch -d broken...symref >output 2>error &&
 	test_path_is_missing .git/refs/heads/broken...symref &&
-	test_i18ngrep "Deleted branch broken...symref (was refs/heads/master)" output &&
+	test_i18ngrep "Deleted branch broken...symref (was refs/heads/main)" output &&
 	test_must_be_empty error
 '
 
@@ -296,37 +296,37 @@ test_expect_success 'update-ref -d cannot delete absolute path' '
 '
 
 test_expect_success 'update-ref --stdin fails create with bad ref name' '
-	echo "create ~a refs/heads/master" >stdin &&
+	echo "create ~a refs/heads/main" >stdin &&
 	test_must_fail git update-ref --stdin <stdin 2>err &&
 	grep "fatal: invalid ref format: ~a" err
 '
 
 test_expect_success 'update-ref --stdin fails update with bad ref name' '
-	echo "update ~a refs/heads/master" >stdin &&
+	echo "update ~a refs/heads/main" >stdin &&
 	test_must_fail git update-ref --stdin <stdin 2>err &&
 	grep "fatal: invalid ref format: ~a" err
 '
 
 test_expect_success 'update-ref --stdin fails delete with bad ref name' '
-	echo "delete ~a refs/heads/master" >stdin &&
+	echo "delete ~a refs/heads/main" >stdin &&
 	test_must_fail git update-ref --stdin <stdin 2>err &&
 	grep "fatal: invalid ref format: ~a" err
 '
 
 test_expect_success 'update-ref --stdin -z fails create with bad ref name' '
-	printf "%s\0" "create ~a " refs/heads/master >stdin &&
+	printf "%s\0" "create ~a " refs/heads/main >stdin &&
 	test_must_fail git update-ref -z --stdin <stdin 2>err &&
 	grep "fatal: invalid ref format: ~a " err
 '
 
 test_expect_success 'update-ref --stdin -z fails update with bad ref name' '
-	printf "%s\0" "update ~a" refs/heads/master "" >stdin &&
+	printf "%s\0" "update ~a" refs/heads/main "" >stdin &&
 	test_must_fail git update-ref -z --stdin <stdin 2>err &&
 	grep "fatal: invalid ref format: ~a" err
 '
 
 test_expect_success 'update-ref --stdin -z fails delete with bad ref name' '
-	printf "%s\0" "delete ~a" refs/heads/master >stdin &&
+	printf "%s\0" "delete ~a" refs/heads/main >stdin &&
 	test_must_fail git update-ref -z --stdin <stdin 2>err &&
 	grep "fatal: invalid ref format: ~a" err
 '
diff --git a/t/t1450-fsck.sh b/t/t1450-fsck.sh
index b17f5c21fb..a30fc5f74a 100755
--- a/t/t1450-fsck.sh
+++ b/t/t1450-fsck.sh
@@ -3,7 +3,7 @@
 test_description='git fsck random collection of tests
 
 * (HEAD) B
-* (master) A
+* (main) A
 '
 
 . ./test-lib.sh
diff --git a/t/t1500-rev-parse.sh b/t/t1500-rev-parse.sh
index 408b97d5af..a85692ffff 100755
--- a/t/t1500-rev-parse.sh
+++ b/t/t1500-rev-parse.sh
@@ -174,8 +174,8 @@ test_expect_success 'showing the superproject correctly' '
 	test_commit -C super/dir/sub branch1_commit &&
 	git -C super add dir/sub &&
 	test_commit -C super branch1_commit &&
-	git -C super checkout -b branch2 master &&
-	git -C super/dir/sub checkout -b branch2 master &&
+	git -C super checkout -b branch2 main &&
+	git -C super/dir/sub checkout -b branch2 main &&
 	test_commit -C super/dir/sub branch2_commit &&
 	git -C super add dir/sub &&
 	test_commit -C super branch2_commit &&
diff --git a/t/t1503-rev-parse-verify.sh b/t/t1503-rev-parse-verify.sh
index dc9fe3cbf1..de63186587 100755
--- a/t/t1503-rev-parse-verify.sh
+++ b/t/t1503-rev-parse-verify.sh
@@ -51,8 +51,8 @@ test_expect_success 'works with one good rev' '
 	test "$rev_hash3" = "$HASH3" &&
 	rev_hash4=$(git rev-parse --verify $HASH4) &&
 	test "$rev_hash4" = "$HASH4" &&
-	rev_master=$(git rev-parse --verify master) &&
-	test "$rev_master" = "$HASH4" &&
+	rev_main=$(git rev-parse --verify main) &&
+	test "$rev_main" = "$HASH4" &&
 	rev_head=$(git rev-parse --verify HEAD) &&
 	test "$rev_head" = "$HASH4"
 '
@@ -116,27 +116,27 @@ test_expect_success 'no stdout output on error' '
 '
 
 test_expect_success 'use --default' '
-	git rev-parse --verify --default master &&
-	git rev-parse --verify --default master HEAD &&
-	git rev-parse --default master --verify &&
-	git rev-parse --default master --verify HEAD &&
-	git rev-parse --verify HEAD --default master &&
-	test_must_fail git rev-parse --verify foo --default master &&
+	git rev-parse --verify --default main &&
+	git rev-parse --verify --default main HEAD &&
+	git rev-parse --default main --verify &&
+	git rev-parse --default main --verify HEAD &&
+	git rev-parse --verify HEAD --default main &&
+	test_must_fail git rev-parse --verify foo --default main &&
 	test_must_fail git rev-parse --default HEAD --verify bar &&
 	test_must_fail git rev-parse --verify --default HEAD baz &&
 	test_must_fail git rev-parse --default foo --verify &&
 	test_must_fail git rev-parse --verify --default bar
 '
 
-test_expect_success 'master@{n} for various n' '
+test_expect_success 'main@{n} for various n' '
 	N=$(git reflog | wc -l) &&
 	Nm1=$(($N-1)) &&
 	Np1=$(($N+1)) &&
-	git rev-parse --verify master@{0} &&
-	git rev-parse --verify master@{1} &&
-	git rev-parse --verify master@{$Nm1} &&
-	test_must_fail git rev-parse --verify master@{$N} &&
-	test_must_fail git rev-parse --verify master@{$Np1}
+	git rev-parse --verify main@{0} &&
+	git rev-parse --verify main@{1} &&
+	git rev-parse --verify main@{$Nm1} &&
+	test_must_fail git rev-parse --verify main@{$N} &&
+	test_must_fail git rev-parse --verify main@{$Np1}
 '
 
 test_expect_success SYMLINKS 'ref resolution not confused by broken symlinks' '
diff --git a/t/t1505-rev-parse-last.sh b/t/t1505-rev-parse-last.sh
index 4969edb314..a64cd4ce14 100755
--- a/t/t1505-rev-parse-last.sh
+++ b/t/t1505-rev-parse-last.sh
@@ -20,12 +20,12 @@ test_expect_success 'setup' '
 	make_commit 3 &&
 	git checkout side &&
 	make_commit 4 &&
-	git merge master &&
-	git checkout master
+	git merge main &&
+	git checkout main
 
 '
 
-# 1 -- 2 -- 3 master
+# 1 -- 2 -- 3 main
 #  \         \
 #   \         \
 #    --- 4 --- 5 side
@@ -49,7 +49,7 @@ test_expect_success '@{-1}@{1} works' '
 '
 
 test_expect_success '@{-2} works' '
-	test_cmp_rev master @{-2}
+	test_cmp_rev main @{-2}
 '
 
 test_expect_success '@{-3} fails' '
diff --git a/t/t1506-rev-parse-diagnosis.sh b/t/t1506-rev-parse-diagnosis.sh
index e2ae15a2cf..8b183f1de1 100755
--- a/t/t1506-rev-parse-diagnosis.sh
+++ b/t/t1506-rev-parse-diagnosis.sh
@@ -137,10 +137,10 @@ test_expect_success 'incorrect file in :path and :N:path' '
 '
 
 test_expect_success 'invalid @{n} reference' '
-	test_must_fail git rev-parse master@{99999} >output 2>error &&
+	test_must_fail git rev-parse main@{99999} >output 2>error &&
 	test_must_be_empty output &&
 	test_i18ngrep "log for [^ ]* only has [0-9][0-9]* entries" error  &&
-	test_must_fail git rev-parse --verify master@{99999} >output 2>error &&
+	test_must_fail git rev-parse --verify main@{99999} >output 2>error &&
 	test_must_be_empty output &&
 	test_i18ngrep "log for [^ ]* only has [0-9][0-9]* entries" error
 '
diff --git a/t/t1507-rev-parse-upstream.sh b/t/t1507-rev-parse-upstream.sh
index dfc0d96d8a..d49998ceb6 100755
--- a/t/t1507-rev-parse-upstream.sh
+++ b/t/t1507-rev-parse-upstream.sh
@@ -10,20 +10,20 @@ test_expect_success 'setup' '
 	test_commit 1 &&
 	git checkout -b side &&
 	test_commit 2 &&
-	git checkout master &&
+	git checkout main &&
 	git clone . clone &&
 	test_commit 3 &&
 	(cd clone &&
 	 test_commit 4 &&
 	 git branch --track my-side origin/side &&
-	 git branch --track local-master master &&
+	 git branch --track local-main main &&
 	 git branch --track fun@ny origin/side &&
 	 git branch --track @funny origin/side &&
 	 git branch --track funny@ origin/side &&
-	 git remote add -t master master-only .. &&
-	 git fetch master-only &&
+	 git remote add -t main main-only .. &&
+	 git fetch main-only &&
 	 git branch bad-upstream &&
-	 git config branch.bad-upstream.remote master-only &&
+	 git config branch.bad-upstream.remote main-only &&
 	 git config branch.bad-upstream.merge refs/heads/side
 	)
 '
@@ -39,7 +39,7 @@ error_message () {
 }
 
 test_expect_success '@{upstream} resolves to correct full name' '
-	echo refs/remotes/origin/master >expect &&
+	echo refs/remotes/origin/main >expect &&
 	git -C clone rev-parse --symbolic-full-name @{upstream} >actual &&
 	test_cmp expect actual &&
 	git -C clone rev-parse --symbolic-full-name @{UPSTREAM} >actual &&
@@ -49,7 +49,7 @@ test_expect_success '@{upstream} resolves to correct full name' '
 '
 
 test_expect_success '@{u} resolves to correct full name' '
-	echo refs/remotes/origin/master >expect &&
+	echo refs/remotes/origin/main >expect &&
 	git -C clone rev-parse --symbolic-full-name @{u} >actual &&
 	test_cmp expect actual &&
 	git -C clone rev-parse --symbolic-full-name @{U} >actual &&
@@ -132,7 +132,7 @@ test_expect_success 'checkout -b new my-side@{u} forks from the same' '
 test_expect_success 'merge my-side@{u} records the correct name' '
 (
 	cd clone &&
-	git checkout master &&
+	git checkout main &&
 	test_might_fail git branch -D new &&
 	git branch -t new my-side@{u} &&
 	git merge -s ours new@{u} &&
@@ -143,24 +143,24 @@ test_expect_success 'merge my-side@{u} records the correct name' '
 '
 
 test_expect_success 'branch -d other@{u}' '
-	git checkout -t -b other master &&
+	git checkout -t -b other main &&
 	git branch -d @{u} &&
-	git for-each-ref refs/heads/master >actual &&
+	git for-each-ref refs/heads/main >actual &&
 	test_must_be_empty actual
 '
 
 test_expect_success 'checkout other@{u}' '
-	git branch -f master HEAD &&
-	git checkout -t -b another master &&
+	git branch -f main HEAD &&
+	git checkout -t -b another main &&
 	git checkout @{u} &&
 	git symbolic-ref HEAD >actual &&
-	echo refs/heads/master >expect &&
+	echo refs/heads/main >expect &&
 	test_cmp expect actual
 '
 
 test_expect_success 'branch@{u} works when tracking a local branch' '
-	echo refs/heads/master >expect &&
-	git -C clone rev-parse --symbolic-full-name local-master@{u} >actual &&
+	echo refs/heads/main >expect &&
+	git -C clone rev-parse --symbolic-full-name local-main@{u} >actual &&
 	test_cmp expect actual
 '
 
@@ -174,7 +174,7 @@ test_expect_success 'branch@{u} error message when no upstream' '
 
 test_expect_success '@{u} error message when no upstream' '
 	cat >expect <<-EOF &&
-	fatal: no upstream configured for branch ${SQ}master${SQ}
+	fatal: no upstream configured for branch ${SQ}main${SQ}
 	EOF
 	test_must_fail git rev-parse --verify @{u} 2>actual &&
 	test_i18ncmp expect actual
@@ -208,14 +208,14 @@ test_expect_success 'branch@{u} error message if upstream branch not fetched' '
 test_expect_success 'pull works when tracking a local branch' '
 (
 	cd clone &&
-	git checkout local-master &&
+	git checkout local-main &&
 	git pull
 )
 '
 
 # makes sense if the previous one succeeded
 test_expect_success '@{u} works when tracking a local branch' '
-	echo refs/heads/master >expect &&
+	echo refs/heads/main >expect &&
 	git -C clone rev-parse --symbolic-full-name @{u} >actual &&
 	test_cmp expect actual
 '
@@ -224,7 +224,7 @@ test_expect_success 'log -g other@{u}' '
 	commit=$(git rev-parse HEAD) &&
 	cat >expect <<-EOF &&
 	commit $commit
-	Reflog: master@{0} (C O Mitter <committer@example.com>)
+	Reflog: main@{0} (C O Mitter <committer@example.com>)
 	Reflog message: branch: Created from HEAD
 	Author: A U Thor <author@example.com>
 	Date:   Thu Apr 7 15:15:13 2005 -0700
@@ -239,7 +239,7 @@ test_expect_success 'log -g other@{u}@{now}' '
 	commit=$(git rev-parse HEAD) &&
 	cat >expect <<-EOF &&
 	commit $commit
-	Reflog: master@{Thu Apr 7 15:17:13 2005 -0700} (C O Mitter <committer@example.com>)
+	Reflog: main@{Thu Apr 7 15:17:13 2005 -0700} (C O Mitter <committer@example.com>)
 	Reflog message: branch: Created from HEAD
 	Author: A U Thor <author@example.com>
 	Date:   Thu Apr 7 15:15:13 2005 -0700
diff --git a/t/t1508-at-combinations.sh b/t/t1508-at-combinations.sh
index 4a9964e9dc..bda6e7900c 100755
--- a/t/t1508-at-combinations.sh
+++ b/t/t1508-at-combinations.sh
@@ -30,8 +30,8 @@ fail() {
 }
 
 test_expect_success 'setup' '
-	test_commit master-one &&
-	test_commit master-two &&
+	test_commit main-one &&
+	test_commit main-two &&
 	git checkout -b upstream-branch &&
 	test_commit upstream-one &&
 	test_commit upstream-two &&
@@ -47,7 +47,7 @@ test_expect_success 'setup' '
 	git checkout -b new-branch &&
 	test_commit new-one &&
 	test_commit new-two &&
-	git branch -u master old-branch &&
+	git branch -u main old-branch &&
 	git branch -u upstream-branch new-branch
 '
 
@@ -62,8 +62,8 @@ check "@{-1}@{1}" commit old-one
 check "@{u}" ref refs/heads/upstream-branch
 check "HEAD@{u}" ref refs/heads/upstream-branch
 check "@{u}@{1}" commit upstream-one
-check "@{-1}@{u}" ref refs/heads/master
-check "@{-1}@{u}@{1}" commit master-one
+check "@{-1}@{u}" ref refs/heads/main
+check "@{-1}@{u}@{1}" commit main-one
 check "@" commit new-two
 check "@@{u}" ref refs/heads/upstream-branch
 check "@@/at-test" ref refs/heads/@@/at-test
diff --git a/t/t1511-rev-parse-caret.sh b/t/t1511-rev-parse-caret.sh
index e0a49a651f..cc324bea52 100755
--- a/t/t1511-rev-parse-caret.sh
+++ b/t/t1511-rev-parse-caret.sh
@@ -15,7 +15,7 @@ test_expect_success 'setup' '
 	git commit -m Initial &&
 	git tag -a -m commit commit-tag &&
 	git branch ref &&
-	git checkout master &&
+	git checkout main &&
 	echo modified >>a-blob &&
 	git add -u &&
 	git commit -m Modified &&
@@ -73,52 +73,52 @@ test_expect_success 'ref^{tag}' '
 '
 
 test_expect_success 'ref^{/.}' '
-	git rev-parse master >expected &&
-	git rev-parse master^{/.} >actual &&
+	git rev-parse main >expected &&
+	git rev-parse main^{/.} >actual &&
 	test_cmp expected actual
 '
 
 test_expect_success 'ref^{/non-existent}' '
-	test_must_fail git rev-parse master^{/non-existent}
+	test_must_fail git rev-parse main^{/non-existent}
 '
 
 test_expect_success 'ref^{/Initial}' '
 	git rev-parse ref >expected &&
-	git rev-parse master^{/Initial} >actual &&
+	git rev-parse main^{/Initial} >actual &&
 	test_cmp expected actual
 '
 
 test_expect_success 'ref^{/!Exp}' '
-	test_must_fail git rev-parse master^{/!Exp}
+	test_must_fail git rev-parse main^{/!Exp}
 '
 
 test_expect_success 'ref^{/!}' '
-	test_must_fail git rev-parse master^{/!}
+	test_must_fail git rev-parse main^{/!}
 '
 
 test_expect_success 'ref^{/!!Exp}' '
 	git rev-parse expref >expected &&
-	git rev-parse master^{/!!Exp} >actual &&
+	git rev-parse main^{/!!Exp} >actual &&
 	test_cmp expected actual
 '
 
 test_expect_success 'ref^{/!-}' '
-	test_must_fail git rev-parse master^{/!-}
+	test_must_fail git rev-parse main^{/!-}
 '
 
 test_expect_success 'ref^{/!-.}' '
-	test_must_fail git rev-parse master^{/!-.}
+	test_must_fail git rev-parse main^{/!-.}
 '
 
 test_expect_success 'ref^{/!-non-existent}' '
-	git rev-parse master >expected &&
-	git rev-parse master^{/!-non-existent} >actual &&
+	git rev-parse main >expected &&
+	git rev-parse main^{/!-non-existent} >actual &&
 	test_cmp expected actual
 '
 
 test_expect_success 'ref^{/!-Changed}' '
 	git rev-parse expref >expected &&
-	git rev-parse master^{/!-Changed} >actual &&
+	git rev-parse main^{/!-Changed} >actual &&
 	test_cmp expected actual
 '
 
diff --git a/t/t1512-rev-parse-disambiguation.sh b/t/t1512-rev-parse-disambiguation.sh
index 18fa6cf40d..6b4481d36b 100755
--- a/t/t1512-rev-parse-disambiguation.sh
+++ b/t/t1512-rev-parse-disambiguation.sh
@@ -212,7 +212,7 @@ test_expect_success 'more history' '
 	side=$(git rev-parse HEAD) &&
 
 	# commit 000000000066
-	git checkout master &&
+	git checkout main &&
 
 	# If you use recursive, merge will fail and you will need to
 	# clean up a0blgqsjc as well.  If you use resolve, merge will
diff --git a/t/t1513-rev-parse-prefix.sh b/t/t1513-rev-parse-prefix.sh
index 87ec3ae714..f77e59121c 100755
--- a/t/t1513-rev-parse-prefix.sh
+++ b/t/t1513-rev-parse-prefix.sh
@@ -76,9 +76,9 @@ test_expect_success 'disambiguate path with valid prefix' '
 '
 
 test_expect_success 'file and refs with prefix' '
-	git rev-parse --prefix sub1/ master file1 >actual &&
+	git rev-parse --prefix sub1/ main file1 >actual &&
 	cat <<-EOF >expected &&
-	$(git rev-parse master)
+	$(git rev-parse main)
 	sub1/file1
 	EOF
 	test_cmp expected actual
diff --git a/t/t1514-rev-parse-push.sh b/t/t1514-rev-parse-push.sh
index 788cc91e45..e85b222e99 100755
--- a/t/t1514-rev-parse-push.sh
+++ b/t/t1514-rev-parse-push.sh
@@ -16,24 +16,24 @@ test_expect_success 'setup' '
 	git remote add other other.git &&
 	test_commit base &&
 	git push origin HEAD &&
-	git branch --set-upstream-to=origin/master master &&
-	git branch --track topic origin/master &&
+	git branch --set-upstream-to=origin/main main &&
+	git branch --track topic origin/main &&
 	git push origin topic &&
 	git push other topic
 '
 
 test_expect_success '@{push} with default=nothing' '
 	test_config push.default nothing &&
-	test_must_fail git rev-parse master@{push} &&
-	test_must_fail git rev-parse master@{PUSH} &&
-	test_must_fail git rev-parse master@{PuSH}
+	test_must_fail git rev-parse main@{push} &&
+	test_must_fail git rev-parse main@{PUSH} &&
+	test_must_fail git rev-parse main@{PuSH}
 '
 
 test_expect_success '@{push} with default=simple' '
 	test_config push.default simple &&
-	resolve master@{push} refs/remotes/origin/master &&
-	resolve master@{PUSH} refs/remotes/origin/master &&
-	resolve master@{pUSh} refs/remotes/origin/master
+	resolve main@{push} refs/remotes/origin/main &&
+	resolve main@{PUSH} refs/remotes/origin/main &&
+	resolve main@{pUSh} refs/remotes/origin/main
 '
 
 test_expect_success 'triangular @{push} fails with default=simple' '
diff --git a/t/t1700-split-index.sh b/t/t1700-split-index.sh
index 12a5568844..f3309045fe 100755
--- a/t/t1700-split-index.sh
+++ b/t/t1700-split-index.sh
@@ -496,7 +496,7 @@ test_expect_success 'do not refresh null base index' '
 		test_commit initial &&
 		git checkout -b side-branch &&
 		test_commit extra &&
-		git checkout master &&
+		git checkout main &&
 		git update-index --split-index &&
 		test_commit more &&
 		# must not write a new shareindex, or we wont catch the problem
diff --git a/t/test-lib.sh b/t/test-lib.sh
index a863ccee7e..126004e342 100644
--- a/t/test-lib.sh
+++ b/t/test-lib.sh
@@ -256,6 +256,13 @@ case "$TRASH_DIRECTORY" in
  *) TRASH_DIRECTORY="$TEST_OUTPUT_DIRECTORY/$TRASH_DIRECTORY" ;;
 esac
 
+case "$TEST_NUMBER" in
+[01]*)
+	GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
+	export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+	;;
+esac
+
 # If --stress was passed, run this test repeatedly in several parallel loops.
 if test "$GIT_TEST_STRESS_STARTED" = "done"
 then
-- 
gitgitgadget


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH v2 03/27] t2*: adjust the references to the default branch name "main"
  2020-11-17 16:12 ` [PATCH v2 00/27] tests: use " Johannes Schindelin via GitGitGadget
  2020-11-17 16:12   ` [PATCH v2 01/27] t0060: preemptively adjust alignment Johannes Schindelin via GitGitGadget
  2020-11-17 16:12   ` [PATCH v2 02/27] t[01]*: adjust the references to the default branch name "main" Johannes Schindelin via GitGitGadget
@ 2020-11-17 16:12   ` Johannes Schindelin via GitGitGadget
  2020-11-17 16:12   ` [PATCH v2 04/27] t3[0-3]*: " Johannes Schindelin via GitGitGadget
                     ` (25 subsequent siblings)
  28 siblings, 0 replies; 163+ messages in thread
From: Johannes Schindelin via GitGitGadget @ 2020-11-17 16:12 UTC (permalink / raw)
  To: git
  Cc: Felipe Contreras, Ævar Arnfjörð Bjarmason,
	Johannes Schindelin, Jeff King, Johannes Schindelin,
	Johannes Schindelin

From: Johannes Schindelin <johannes.schindelin@gmx.de>

This trick was performed via

	$ (cd t &&
	   sed -i -e 's/master/main/g' -e 's/MASTER/MAIN/g' \
		-e 's/Master/Main/g' -- t2*.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>
---
 t/t2007-checkout-symlink.sh              | 10 ++--
 t/t2009-checkout-statinfo.sh             |  8 +--
 t/t2010-checkout-ambiguous.sh            |  4 +-
 t/t2011-checkout-invalid-head.sh         | 16 +++---
 t/t2012-checkout-last.sh                 | 48 ++++++++--------
 t/t2015-checkout-unborn.sh               |  2 +-
 t/t2017-checkout-orphan.sh               | 44 +++++++--------
 t/t2020-checkout-detach.sh               | 28 +++++-----
 t/t2022-checkout-paths.sh                | 22 ++++----
 t/t2023-checkout-m.sh                    | 10 ++--
 t/t2024-checkout-dwim.sh                 | 70 ++++++++++++------------
 t/t2027-checkout-track.sh                |  6 +-
 t/t2030-unresolve-info.sh                |  6 +-
 t/t2060-switch.sh                        | 30 +++++-----
 t/t2070-restore.sh                       |  4 +-
 t/t2106-update-index-assume-unchanged.sh |  2 +-
 t/t2400-worktree-add.sh                  | 66 +++++++++++-----------
 t/t2401-worktree-prune.sh                |  2 +-
 t/t2402-worktree-list.sh                 | 20 +++----
 t/t2405-worktree-submodule.sh            |  6 +-
 t/test-lib.sh                            |  2 +-
 21 files changed, 203 insertions(+), 203 deletions(-)

diff --git a/t/t2007-checkout-symlink.sh b/t/t2007-checkout-symlink.sh
index fc9aad530e..d6468ad8f3 100755
--- a/t/t2007-checkout-symlink.sh
+++ b/t/t2007-checkout-symlink.sh
@@ -12,14 +12,14 @@ test_expect_success setup '
 	echo hello >frotz/filfre &&
 	git add frotz/filfre &&
 	test_tick &&
-	git commit -m "master has file frotz/filfre" &&
+	git commit -m "main has file frotz/filfre" &&
 
 	git branch side &&
 
 	echo goodbye >nitfol &&
 	git add nitfol &&
 	test_tick &&
-	git commit -m "master adds file nitfol" &&
+	git commit -m "main adds file nitfol" &&
 
 	git checkout side &&
 
@@ -34,13 +34,13 @@ test_expect_success setup '
 
 test_expect_success 'switch from symlink to dir' '
 
-	git checkout master
+	git checkout main
 
 '
 
-test_expect_success 'Remove temporary directories & switch to master' '
+test_expect_success 'Remove temporary directories & switch to main' '
 	rm -fr frotz xyzzy nitfol &&
-	git checkout -f master
+	git checkout -f main
 '
 
 test_expect_success 'switch from dir to symlink' '
diff --git a/t/t2009-checkout-statinfo.sh b/t/t2009-checkout-statinfo.sh
index f3c2152087..91940f3c60 100755
--- a/t/t2009-checkout-statinfo.sh
+++ b/t/t2009-checkout-statinfo.sh
@@ -21,13 +21,13 @@ test_expect_success 'branch switching' '
 	git reset --hard &&
 	test "$(git diff-files --raw)" = "" &&
 
-	git checkout master &&
+	git checkout main &&
 	test "$(git diff-files --raw)" = "" &&
 
 	git checkout side &&
 	test "$(git diff-files --raw)" = "" &&
 
-	git checkout master &&
+	git checkout main &&
 	test "$(git diff-files --raw)" = ""
 
 '
@@ -37,13 +37,13 @@ test_expect_success 'path checkout' '
 	git reset --hard &&
 	test "$(git diff-files --raw)" = "" &&
 
-	git checkout master world &&
+	git checkout main world &&
 	test "$(git diff-files --raw)" = "" &&
 
 	git checkout side world &&
 	test "$(git diff-files --raw)" = "" &&
 
-	git checkout master world &&
+	git checkout main world &&
 	test "$(git diff-files --raw)" = ""
 
 '
diff --git a/t/t2010-checkout-ambiguous.sh b/t/t2010-checkout-ambiguous.sh
index 2e47fe01cf..64395479e8 100755
--- a/t/t2010-checkout-ambiguous.sh
+++ b/t/t2010-checkout-ambiguous.sh
@@ -17,7 +17,7 @@ test_expect_success 'reference must be a tree' '
 '
 
 test_expect_success 'branch switching' '
-	test "refs/heads/master" = "$(git symbolic-ref HEAD)" &&
+	test "refs/heads/main" = "$(git symbolic-ref HEAD)" &&
 	git checkout world -- &&
 	test "refs/heads/world" = "$(git symbolic-ref HEAD)"
 '
@@ -57,7 +57,7 @@ test_expect_success 'disambiguate checking out from a tree-ish' '
 '
 
 test_expect_success 'accurate error message with more than one ref' '
-	test_must_fail git checkout HEAD master -- 2>actual &&
+	test_must_fail git checkout HEAD main -- 2>actual &&
 	test_i18ngrep 2 actual &&
 	test_i18ngrep "one reference expected, 2 given" actual
 '
diff --git a/t/t2011-checkout-invalid-head.sh b/t/t2011-checkout-invalid-head.sh
index 0e8d56aa76..d92f8582ea 100755
--- a/t/t2011-checkout-invalid-head.sh
+++ b/t/t2011-checkout-invalid-head.sh
@@ -11,12 +11,12 @@ test_expect_success 'setup' '
 '
 
 test_expect_success 'checkout should not start branch from a tree' '
-	test_must_fail git checkout -b newbranch master^{tree}
+	test_must_fail git checkout -b newbranch main^{tree}
 '
 
-test_expect_success 'checkout master from invalid HEAD' '
+test_expect_success 'checkout main from invalid HEAD' '
 	echo $ZERO_OID >.git/HEAD &&
-	git checkout master --
+	git checkout main --
 '
 
 test_expect_success 'checkout notices failure to lock HEAD' '
@@ -26,7 +26,7 @@ test_expect_success 'checkout notices failure to lock HEAD' '
 '
 
 test_expect_success 'create ref directory/file conflict scenario' '
-	git update-ref refs/heads/outer/inner master &&
+	git update-ref refs/heads/outer/inner main &&
 
 	# do not rely on symbolic-ref to get a known state,
 	# as it may use the same code we are testing
@@ -37,12 +37,12 @@ test_expect_success 'create ref directory/file conflict scenario' '
 
 test_expect_success 'checkout away from d/f HEAD (unpacked, to branch)' '
 	reset_to_df &&
-	git checkout master
+	git checkout main
 '
 
 test_expect_success 'checkout away from d/f HEAD (unpacked, to detached)' '
 	reset_to_df &&
-	git checkout --detach master
+	git checkout --detach main
 '
 
 test_expect_success 'pack refs' '
@@ -51,11 +51,11 @@ test_expect_success 'pack refs' '
 
 test_expect_success 'checkout away from d/f HEAD (packed, to branch)' '
 	reset_to_df &&
-	git checkout master
+	git checkout main
 '
 
 test_expect_success 'checkout away from d/f HEAD (packed, to detached)' '
 	reset_to_df &&
-	git checkout --detach master
+	git checkout --detach main
 '
 test_done
diff --git a/t/t2012-checkout-last.sh b/t/t2012-checkout-last.sh
index e7ba8c505f..7a126337ca 100755
--- a/t/t2012-checkout-last.sh
+++ b/t/t2012-checkout-last.sh
@@ -24,7 +24,7 @@ test_expect_success 'first branch switch' '
 
 test_expect_success '"checkout -" switches back' '
 	git checkout - &&
-	test "z$(git symbolic-ref HEAD)" = "zrefs/heads/master"
+	test "z$(git symbolic-ref HEAD)" = "zrefs/heads/main"
 '
 
 test_expect_success '"checkout -" switches forth' '
@@ -98,56 +98,56 @@ test_expect_success 'merge base test setup' '
 	git commit -m third
 '
 
-test_expect_success 'another...master' '
+test_expect_success 'another...main' '
 	git checkout another &&
-	git checkout another...master &&
-	test "z$(git rev-parse --verify HEAD)" = "z$(git rev-parse --verify master^)"
+	git checkout another...main &&
+	test "z$(git rev-parse --verify HEAD)" = "z$(git rev-parse --verify main^)"
 '
 
-test_expect_success '...master' '
+test_expect_success '...main' '
 	git checkout another &&
-	git checkout ...master &&
-	test "z$(git rev-parse --verify HEAD)" = "z$(git rev-parse --verify master^)"
+	git checkout ...main &&
+	test "z$(git rev-parse --verify HEAD)" = "z$(git rev-parse --verify main^)"
 '
 
-test_expect_success 'master...' '
+test_expect_success 'main...' '
 	git checkout another &&
-	git checkout master... &&
-	test "z$(git rev-parse --verify HEAD)" = "z$(git rev-parse --verify master^)"
+	git checkout main... &&
+	test "z$(git rev-parse --verify HEAD)" = "z$(git rev-parse --verify main^)"
 '
 
 test_expect_success '"checkout -" works after a rebase A' '
-	git checkout master &&
+	git checkout main &&
 	git checkout other &&
-	git rebase master &&
+	git rebase main &&
 	git checkout - &&
-	test "z$(git symbolic-ref HEAD)" = "zrefs/heads/master"
+	test "z$(git symbolic-ref HEAD)" = "zrefs/heads/main"
 '
 
 test_expect_success '"checkout -" works after a rebase A B' '
-	git branch moodle master~1 &&
-	git checkout master &&
+	git branch moodle main~1 &&
+	git checkout main &&
 	git checkout other &&
-	git rebase master moodle &&
+	git rebase main moodle &&
 	git checkout - &&
-	test "z$(git symbolic-ref HEAD)" = "zrefs/heads/master"
+	test "z$(git symbolic-ref HEAD)" = "zrefs/heads/main"
 '
 
 test_expect_success '"checkout -" works after a rebase -i A' '
-	git checkout master &&
+	git checkout main &&
 	git checkout other &&
-	git rebase -i master &&
+	git rebase -i main &&
 	git checkout - &&
-	test "z$(git symbolic-ref HEAD)" = "zrefs/heads/master"
+	test "z$(git symbolic-ref HEAD)" = "zrefs/heads/main"
 '
 
 test_expect_success '"checkout -" works after a rebase -i A B' '
-	git branch foodle master~1 &&
-	git checkout master &&
+	git branch foodle main~1 &&
+	git checkout main &&
 	git checkout other &&
-	git rebase master foodle &&
+	git rebase main foodle &&
 	git checkout - &&
-	test "z$(git symbolic-ref HEAD)" = "zrefs/heads/master"
+	test "z$(git symbolic-ref HEAD)" = "zrefs/heads/main"
 '
 
 test_done
diff --git a/t/t2015-checkout-unborn.sh b/t/t2015-checkout-unborn.sh
index 37bdcedcc9..2b3e6dc27e 100755
--- a/t/t2015-checkout-unborn.sh
+++ b/t/t2015-checkout-unborn.sh
@@ -11,7 +11,7 @@ test_expect_success 'setup' '
 	 git add file &&
 	 git commit -m base
 	) &&
-	git fetch parent master:origin
+	git fetch parent main:origin
 '
 
 test_expect_success 'checkout from unborn preserves untracked files' '
diff --git a/t/t2017-checkout-orphan.sh b/t/t2017-checkout-orphan.sh
index 655f278c5f..e2ce29c8e7 100755
--- a/t/t2017-checkout-orphan.sh
+++ b/t/t2017-checkout-orphan.sh
@@ -29,34 +29,34 @@ test_expect_success '--orphan creates a new orphan branch from HEAD' '
 	test_tick &&
 	git commit -m "Third Commit" &&
 	test_must_fail git rev-parse --verify HEAD^ &&
-	git diff-tree --quiet master alpha
+	git diff-tree --quiet main alpha
 '
 
 test_expect_success '--orphan creates a new orphan branch from <start_point>' '
-	git checkout master &&
-	git checkout --orphan beta master^ &&
+	git checkout main &&
+	git checkout --orphan beta main^ &&
 	test_must_fail git rev-parse --verify HEAD &&
 	test "refs/heads/beta" = "$(git symbolic-ref HEAD)" &&
 	test_tick &&
 	git commit -m "Fourth Commit" &&
 	test_must_fail git rev-parse --verify HEAD^ &&
-	git diff-tree --quiet master^ beta
+	git diff-tree --quiet main^ beta
 '
 
 test_expect_success '--orphan must be rejected with -b' '
-	git checkout master &&
+	git checkout main &&
 	test_must_fail git checkout --orphan new -b newer &&
-	test refs/heads/master = "$(git symbolic-ref HEAD)"
+	test refs/heads/main = "$(git symbolic-ref HEAD)"
 '
 
 test_expect_success '--orphan must be rejected with -t' '
-	git checkout master &&
-	test_must_fail git checkout --orphan new -t master &&
-	test refs/heads/master = "$(git symbolic-ref HEAD)"
+	git checkout main &&
+	test_must_fail git checkout --orphan new -t main &&
+	test refs/heads/main = "$(git symbolic-ref HEAD)"
 '
 
 test_expect_success '--orphan ignores branch.autosetupmerge' '
-	git checkout master &&
+	git checkout main &&
 	git config branch.autosetupmerge always &&
 	git checkout --orphan gamma &&
 	test -z "$(git config branch.gamma.merge)" &&
@@ -65,7 +65,7 @@ test_expect_success '--orphan ignores branch.autosetupmerge' '
 '
 
 test_expect_success '--orphan makes reflog by default' '
-	git checkout master &&
+	git checkout main &&
 	git config --unset core.logAllRefUpdates &&
 	git checkout --orphan delta &&
 	test_must_fail git rev-parse --verify delta@{0} &&
@@ -74,7 +74,7 @@ test_expect_success '--orphan makes reflog by default' '
 '
 
 test_expect_success '--orphan does not make reflog when core.logAllRefUpdates = false' '
-	git checkout master &&
+	git checkout main &&
 	git config core.logAllRefUpdates false &&
 	git checkout --orphan epsilon &&
 	test_must_fail git rev-parse --verify epsilon@{0} &&
@@ -83,7 +83,7 @@ test_expect_success '--orphan does not make reflog when core.logAllRefUpdates =
 '
 
 test_expect_success '--orphan with -l makes reflog when core.logAllRefUpdates = false' '
-	git checkout master &&
+	git checkout main &&
 	git checkout -l --orphan zeta &&
 	test_must_fail git rev-parse --verify zeta@{0} &&
 	git commit -m Zeta &&
@@ -91,33 +91,33 @@ test_expect_success '--orphan with -l makes reflog when core.logAllRefUpdates =
 '
 
 test_expect_success 'giving up --orphan not committed when -l and core.logAllRefUpdates = false deletes reflog' '
-	git checkout master &&
+	git checkout main &&
 	git checkout -l --orphan eta &&
 	test_must_fail git rev-parse --verify eta@{0} &&
-	git checkout master &&
+	git checkout main &&
 	test_must_fail git rev-parse --verify eta@{0}
 '
 
 test_expect_success '--orphan is rejected with an existing name' '
-	git checkout master &&
-	test_must_fail git checkout --orphan master &&
-	test refs/heads/master = "$(git symbolic-ref HEAD)"
+	git checkout main &&
+	test_must_fail git checkout --orphan main &&
+	test refs/heads/main = "$(git symbolic-ref HEAD)"
 '
 
 test_expect_success '--orphan refuses to switch if a merge is needed' '
-	git checkout master &&
+	git checkout main &&
 	git reset --hard &&
 	echo local >>"$TEST_FILE" &&
 	cat "$TEST_FILE" >"$TEST_FILE.saved" &&
-	test_must_fail git checkout --orphan new master^ &&
-	test refs/heads/master = "$(git symbolic-ref HEAD)" &&
+	test_must_fail git checkout --orphan new main^ &&
+	test refs/heads/main = "$(git symbolic-ref HEAD)" &&
 	test_cmp "$TEST_FILE" "$TEST_FILE.saved" &&
 	git diff-index --quiet --cached HEAD &&
 	git reset --hard
 '
 
 test_expect_success 'cannot --detach on an unborn branch' '
-	git checkout master &&
+	git checkout main &&
 	git checkout --orphan new &&
 	test_must_fail git checkout --detach
 '
diff --git a/t/t2020-checkout-detach.sh b/t/t2020-checkout-detach.sh
index b748db9946..25885c3065 100755
--- a/t/t2020-checkout-detach.sh
+++ b/t/t2020-checkout-detach.sh
@@ -22,7 +22,7 @@ check_no_orphan_warning() {
 }
 
 reset () {
-	git checkout master &&
+	git checkout main &&
 	check_not_detached
 }
 
@@ -85,7 +85,7 @@ test_expect_success 'checkout --detach errors out for non-commit' '
 
 test_expect_success 'checkout --detach errors out for extra argument' '
 	reset &&
-	git checkout master &&
+	git checkout main &&
 	test_must_fail git checkout --detach tag one.t &&
 	check_not_detached
 '
@@ -113,7 +113,7 @@ test_expect_success 'checkout warns on orphan commits' '
 	echo new content >orphan &&
 	git commit -a -m orphan2 &&
 	orphan2=$(git rev-parse HEAD) &&
-	git checkout master 2>stderr
+	git checkout main 2>stderr
 '
 
 test_expect_success 'checkout warns on orphan commits: output' '
@@ -132,7 +132,7 @@ test_expect_success 'checkout warns orphaning 1 of 2 commits: output' '
 test_expect_success 'checkout does not warn leaving ref tip' '
 	reset &&
 	git checkout --detach two &&
-	git checkout master 2>stderr
+	git checkout main 2>stderr
 '
 
 test_expect_success 'checkout does not warn leaving ref tip' '
@@ -142,7 +142,7 @@ test_expect_success 'checkout does not warn leaving ref tip' '
 test_expect_success 'checkout does not warn leaving reachable commit' '
 	reset &&
 	git checkout --detach HEAD^ &&
-	git checkout master 2>stderr
+	git checkout main 2>stderr
 '
 
 test_expect_success 'checkout does not warn leaving reachable commit' '
@@ -150,14 +150,14 @@ test_expect_success 'checkout does not warn leaving reachable commit' '
 '
 
 cat >expect <<'EOF'
-Your branch is behind 'master' by 1 commit, and can be fast-forwarded.
+Your branch is behind 'main' by 1 commit, and can be fast-forwarded.
   (use "git pull" to update your local branch)
 EOF
 test_expect_success 'tracking count is accurate after orphan check' '
 	reset &&
-	git branch child master^ &&
+	git branch child main^ &&
 	git config branch.child.remote . &&
-	git config branch.child.merge refs/heads/master &&
+	git config branch.child.merge refs/heads/main &&
 	git checkout child^ &&
 	git checkout child >stdout &&
 	test_i18ncmp expect stdout
@@ -189,9 +189,9 @@ test_expect_success 'no advice given for explicit detached head state' '
 # Detached HEAD tests for GIT_PRINT_SHA1_ELLIPSIS (new format)
 test_expect_success 'describe_detached_head prints no SHA-1 ellipsis when not asked to' "
 
-	commit=$(git rev-parse --short=12 master^) &&
-	commit2=$(git rev-parse --short=12 master~2) &&
-	commit3=$(git rev-parse --short=12 master~3) &&
+	commit=$(git rev-parse --short=12 main^) &&
+	commit2=$(git rev-parse --short=12 main~2) &&
+	commit3=$(git rev-parse --short=12 main~3) &&
 
 	# The first detach operation is more chatty than the following ones.
 	cat >1st_detach <<-EOF &&
@@ -271,9 +271,9 @@ test_expect_success 'describe_detached_head prints no SHA-1 ellipsis when not as
 # Detached HEAD tests for GIT_PRINT_SHA1_ELLIPSIS (old format)
 test_expect_success 'describe_detached_head does print SHA-1 ellipsis when asked to' "
 
-	commit=$(git rev-parse --short=12 master^) &&
-	commit2=$(git rev-parse --short=12 master~2) &&
-	commit3=$(git rev-parse --short=12 master~3) &&
+	commit=$(git rev-parse --short=12 main^) &&
+	commit2=$(git rev-parse --short=12 main~2) &&
+	commit3=$(git rev-parse --short=12 main~3) &&
 
 	# The first detach operation is more chatty than the following ones.
 	cat >1st_detach <<-EOF &&
diff --git a/t/t2022-checkout-paths.sh b/t/t2022-checkout-paths.sh
index 6844afafc0..4174620cf4 100755
--- a/t/t2022-checkout-paths.sh
+++ b/t/t2022-checkout-paths.sh
@@ -5,15 +5,15 @@ test_description='checkout $tree -- $paths'
 
 test_expect_success setup '
 	mkdir dir &&
-	>dir/master &&
+	>dir/main &&
 	echo common >dir/common &&
-	git add dir/master dir/common &&
-	test_tick && git commit -m "master has dir/master" &&
+	git add dir/main dir/common &&
+	test_tick && git commit -m "main has dir/main" &&
 	git checkout -b next &&
-	git mv dir/master dir/next0 &&
+	git mv dir/main dir/next0 &&
 	echo next >dir/next1 &&
 	git add dir &&
-	test_tick && git commit -m "next has dir/next but not dir/master"
+	test_tick && git commit -m "next has dir/next but not dir/main"
 '
 
 test_expect_success 'checking out paths out of a tree does not clobber unrelated paths' '
@@ -26,11 +26,11 @@ test_expect_success 'checking out paths out of a tree does not clobber unrelated
 	echo untracked >expect.next2 &&
 	cat expect.next2 >dir/next2 &&
 
-	git checkout master dir &&
+	git checkout main dir &&
 
 	test_cmp expect.common dir/common &&
-	test_path_is_file dir/master &&
-	git diff --exit-code master dir/master &&
+	test_path_is_file dir/main &&
+	git diff --exit-code main dir/main &&
 
 	test_path_is_missing dir/next0 &&
 	test_cmp expect.next1 dir/next1 &&
@@ -52,11 +52,11 @@ test_expect_success 'do not touch unmerged entries matching $path but not in $tr
 	EOF
 	git update-index --index-info <expect.next0 &&
 
-	git checkout master dir &&
+	git checkout main dir &&
 
 	test_cmp expect.common dir/common &&
-	test_path_is_file dir/master &&
-	git diff --exit-code master dir/master &&
+	test_path_is_file dir/main &&
+	git diff --exit-code main dir/main &&
 	git ls-files -s dir/next0 >actual.next0 &&
 	test_cmp expect.next0 actual.next0
 '
diff --git a/t/t2023-checkout-m.sh b/t/t2023-checkout-m.sh
index fca3f85824..ddcfcc3e9b 100755
--- a/t/t2023-checkout-m.sh
+++ b/t/t2023-checkout-m.sh
@@ -10,15 +10,15 @@ test_expect_success setup '
 	test_tick &&
 	test_commit both.txt both.txt initial &&
 	git branch topic &&
-	test_commit modified_in_master both.txt in_master &&
-	test_commit added_in_master each.txt in_master &&
+	test_commit modified_in_main both.txt in_main &&
+	test_commit added_in_main each.txt in_main &&
 	git checkout topic &&
 	test_commit modified_in_topic both.txt in_topic &&
 	test_commit added_in_topic each.txt in_topic
 '
 
-test_expect_success 'git merge master' '
-    test_must_fail git merge master
+test_expect_success 'git merge main' '
+    test_must_fail git merge main
 '
 
 clean_branchnames () {
@@ -61,7 +61,7 @@ test_expect_success 'force checkout a conflict file creates stage zero entry' '
 		git checkout topic &&
 		echo c >a &&
 		C_OBJ=$(git hash-object a) &&
-		git checkout -m master &&
+		git checkout -m main &&
 		test_cmp_rev :1:a $A_OBJ &&
 		test_cmp_rev :2:a $B_OBJ &&
 		test_cmp_rev :3:a $C_OBJ &&
diff --git a/t/t2024-checkout-dwim.sh b/t/t2024-checkout-dwim.sh
index a4f8d3a67e..4a1c901456 100755
--- a/t/t2024-checkout-dwim.sh
+++ b/t/t2024-checkout-dwim.sh
@@ -29,11 +29,11 @@ status_uno_is_clean () {
 }
 
 test_expect_success 'setup' '
-	test_commit my_master &&
+	test_commit my_main &&
 	git init repo_a &&
 	(
 		cd repo_a &&
-		test_commit a_master &&
+		test_commit a_main &&
 		git checkout -b foo &&
 		test_commit a_foo &&
 		git checkout -b bar &&
@@ -44,7 +44,7 @@ test_expect_success 'setup' '
 	git init repo_b &&
 	(
 		cd repo_b &&
-		test_commit b_master &&
+		test_commit b_main &&
 		git checkout -b foo &&
 		test_commit b_foo &&
 		git checkout -b baz &&
@@ -60,23 +60,23 @@ test_expect_success 'setup' '
 '
 
 test_expect_success 'checkout of non-existing branch fails' '
-	git checkout -B master &&
+	git checkout -B main &&
 	test_might_fail git branch -D xyzzy &&
 
 	test_must_fail git checkout xyzzy &&
 	status_uno_is_clean &&
 	test_must_fail git rev-parse --verify refs/heads/xyzzy &&
-	test_branch master
+	test_branch main
 '
 
 test_expect_success 'checkout of branch from multiple remotes fails #1' '
-	git checkout -B master &&
+	git checkout -B main &&
 	test_might_fail git branch -D foo &&
 
 	test_must_fail git checkout foo &&
 	status_uno_is_clean &&
 	test_must_fail git rev-parse --verify refs/heads/foo &&
-	test_branch master
+	test_branch main
 '
 
 test_expect_success 'when arg matches multiple remotes, do not fallback to interpreting as pathspec' '
@@ -100,21 +100,21 @@ test_expect_success 'when arg matches multiple remotes, do not fallback to inter
 '
 
 test_expect_success 'checkout of branch from multiple remotes fails with advice' '
-	git checkout -B master &&
+	git checkout -B main &&
 	test_might_fail git branch -D foo &&
 	test_must_fail git checkout foo 2>stderr &&
-	test_branch master &&
+	test_branch main &&
 	status_uno_is_clean &&
 	test_i18ngrep "^hint: " stderr &&
 	test_must_fail git -c advice.checkoutAmbiguousRemoteBranchName=false \
 		checkout foo 2>stderr &&
-	test_branch master &&
+	test_branch main &&
 	status_uno_is_clean &&
 	test_i18ngrep ! "^hint: " stderr
 '
 
 test_expect_success PERL 'checkout -p with multiple remotes does not print advice' '
-	git checkout -B master &&
+	git checkout -B main &&
 	test_might_fail git branch -D foo &&
 
 	git checkout -p foo 2>stderr &&
@@ -123,7 +123,7 @@ test_expect_success PERL 'checkout -p with multiple remotes does not print advic
 '
 
 test_expect_success 'checkout of branch from multiple remotes succeeds with checkout.defaultRemote #1' '
-	git checkout -B master &&
+	git checkout -B main &&
 	status_uno_is_clean &&
 	test_might_fail git branch -D foo &&
 
@@ -135,7 +135,7 @@ test_expect_success 'checkout of branch from multiple remotes succeeds with chec
 '
 
 test_expect_success 'checkout of branch from a single remote succeeds #1' '
-	git checkout -B master &&
+	git checkout -B main &&
 	test_might_fail git branch -D bar &&
 
 	git checkout bar &&
@@ -146,7 +146,7 @@ test_expect_success 'checkout of branch from a single remote succeeds #1' '
 '
 
 test_expect_success 'checkout of branch from a single remote succeeds #2' '
-	git checkout -B master &&
+	git checkout -B main &&
 	test_might_fail git branch -D baz &&
 
 	git checkout baz &&
@@ -157,33 +157,33 @@ test_expect_success 'checkout of branch from a single remote succeeds #2' '
 '
 
 test_expect_success '--no-guess suppresses branch auto-vivification' '
-	git checkout -B master &&
+	git checkout -B main &&
 	status_uno_is_clean &&
 	test_might_fail git branch -D bar &&
 
 	test_must_fail git checkout --no-guess bar &&
 	test_must_fail git rev-parse --verify refs/heads/bar &&
-	test_branch master
+	test_branch main
 '
 
 test_expect_success 'checkout.guess = false suppresses branch auto-vivification' '
-	git checkout -B master &&
+	git checkout -B main &&
 	status_uno_is_clean &&
 	test_might_fail git branch -D bar &&
 
 	test_config checkout.guess false &&
 	test_must_fail git checkout bar &&
 	test_must_fail git rev-parse --verify refs/heads/bar &&
-	test_branch master
+	test_branch main
 '
 
 test_expect_success 'setup more remotes with unconventional refspecs' '
-	git checkout -B master &&
+	git checkout -B main &&
 	status_uno_is_clean &&
 	git init repo_c &&
 	(
 		cd repo_c &&
-		test_commit c_master &&
+		test_commit c_main &&
 		git checkout -b bar &&
 		test_commit c_bar &&
 		git checkout -b spam &&
@@ -192,7 +192,7 @@ test_expect_success 'setup more remotes with unconventional refspecs' '
 	git init repo_d &&
 	(
 		cd repo_d &&
-		test_commit d_master &&
+		test_commit d_main &&
 		git checkout -b baz &&
 		test_commit d_baz &&
 		git checkout -b eggs &&
@@ -208,29 +208,29 @@ test_expect_success 'setup more remotes with unconventional refspecs' '
 '
 
 test_expect_success 'checkout of branch from multiple remotes fails #2' '
-	git checkout -B master &&
+	git checkout -B main &&
 	status_uno_is_clean &&
 	test_might_fail git branch -D bar &&
 
 	test_must_fail git checkout bar &&
 	status_uno_is_clean &&
 	test_must_fail git rev-parse --verify refs/heads/bar &&
-	test_branch master
+	test_branch main
 '
 
 test_expect_success 'checkout of branch from multiple remotes fails #3' '
-	git checkout -B master &&
+	git checkout -B main &&
 	status_uno_is_clean &&
 	test_might_fail git branch -D baz &&
 
 	test_must_fail git checkout baz &&
 	status_uno_is_clean &&
 	test_must_fail git rev-parse --verify refs/heads/baz &&
-	test_branch master
+	test_branch main
 '
 
 test_expect_success 'checkout of branch from a single remote succeeds #3' '
-	git checkout -B master &&
+	git checkout -B main &&
 	status_uno_is_clean &&
 	test_might_fail git branch -D spam &&
 
@@ -242,7 +242,7 @@ test_expect_success 'checkout of branch from a single remote succeeds #3' '
 '
 
 test_expect_success 'checkout of branch from a single remote succeeds #4' '
-	git checkout -B master &&
+	git checkout -B main &&
 	status_uno_is_clean &&
 	test_might_fail git branch -D eggs &&
 
@@ -254,7 +254,7 @@ test_expect_success 'checkout of branch from a single remote succeeds #4' '
 '
 
 test_expect_success 'checkout of branch with a file having the same name fails' '
-	git checkout -B master &&
+	git checkout -B main &&
 	status_uno_is_clean &&
 	test_might_fail git branch -D spam &&
 
@@ -262,11 +262,11 @@ test_expect_success 'checkout of branch with a file having the same name fails'
 	test_must_fail git checkout spam &&
 	status_uno_is_clean &&
 	test_must_fail git rev-parse --verify refs/heads/spam &&
-	test_branch master
+	test_branch main
 '
 
 test_expect_success 'checkout of branch with a file in subdir having the same name fails' '
-	git checkout -B master &&
+	git checkout -B main &&
 	status_uno_is_clean &&
 	test_might_fail git branch -D spam &&
 
@@ -276,11 +276,11 @@ test_expect_success 'checkout of branch with a file in subdir having the same na
 	test_must_fail git -C sub checkout spam &&
 	status_uno_is_clean &&
 	test_must_fail git rev-parse --verify refs/heads/spam &&
-	test_branch master
+	test_branch main
 '
 
 test_expect_success 'checkout <branch> -- succeeds, even if a file with the same name exists' '
-	git checkout -B master &&
+	git checkout -B main &&
 	status_uno_is_clean &&
 	test_might_fail git branch -D spam &&
 
@@ -294,7 +294,7 @@ test_expect_success 'checkout <branch> -- succeeds, even if a file with the same
 
 test_expect_success 'loosely defined local base branch is reported correctly' '
 
-	git checkout master &&
+	git checkout main &&
 	status_uno_is_clean &&
 	git branch strict &&
 	git branch loose &&
@@ -302,8 +302,8 @@ test_expect_success 'loosely defined local base branch is reported correctly' '
 
 	test_config branch.strict.remote . &&
 	test_config branch.loose.remote . &&
-	test_config branch.strict.merge refs/heads/master &&
-	test_config branch.loose.merge master &&
+	test_config branch.strict.merge refs/heads/main &&
+	test_config branch.loose.merge main &&
 
 	git checkout strict | sed -e "s/strict/BRANCHNAME/g" >expect &&
 	status_uno_is_clean &&
diff --git a/t/t2027-checkout-track.sh b/t/t2027-checkout-track.sh
index bcba1bf90c..bc46c5a68e 100755
--- a/t/t2027-checkout-track.sh
+++ b/t/t2027-checkout-track.sh
@@ -10,14 +10,14 @@ test_expect_success 'setup' '
 '
 
 test_expect_success 'checkout --track -b creates a new tracking branch' '
-	git checkout --track -b branch1 master &&
+	git checkout --track -b branch1 main &&
 	test $(git rev-parse --abbrev-ref HEAD) = branch1 &&
 	test $(git config --get branch.branch1.remote) = . &&
-	test $(git config --get branch.branch1.merge) = refs/heads/master
+	test $(git config --get branch.branch1.merge) = refs/heads/main
 '
 
 test_expect_success 'checkout --track -b rejects an extra path argument' '
-	test_must_fail git checkout --track -b branch2 master one.t 2>err &&
+	test_must_fail git checkout --track -b branch2 main one.t 2>err &&
 	test_i18ngrep "cannot be used with updating paths" err
 '
 
diff --git a/t/t2030-unresolve-info.sh b/t/t2030-unresolve-info.sh
index 309199bca2..3cdd73c172 100755
--- a/t/t2030-unresolve-info.sh
+++ b/t/t2030-unresolve-info.sh
@@ -59,7 +59,7 @@ test_expect_success setup '
 	test_commit fourth fi/le fourth &&
 	git checkout add-add &&
 	test_commit fifth add-differently &&
-	git checkout master
+	git checkout main
 '
 
 test_expect_success 'add records switch clears' '
@@ -183,8 +183,8 @@ test_expect_success 'rerere forget (binary)' '
 '
 
 test_expect_success 'rerere forget (add-add conflict)' '
-	git checkout -f master &&
-	echo master >add-differently &&
+	git checkout -f main &&
+	echo main >add-differently &&
 	git add add-differently &&
 	git commit -m "add differently" &&
 	test_must_fail git merge fifth &&
diff --git a/t/t2060-switch.sh b/t/t2060-switch.sh
index 68c9101b02..11f85f8861 100755
--- a/t/t2060-switch.sh
+++ b/t/t2060-switch.sh
@@ -23,41 +23,41 @@ test_expect_success 'switch branch' '
 '
 
 test_expect_success 'switch and detach' '
-	test_when_finished git switch master &&
-	test_must_fail git switch master^{commit} &&
-	git switch --detach master^{commit} &&
+	test_when_finished git switch main &&
+	test_must_fail git switch main^{commit} &&
+	git switch --detach main^{commit} &&
 	test_must_fail git symbolic-ref HEAD
 '
 
 test_expect_success 'switch and detach current branch' '
-	test_when_finished git switch master &&
-	git switch master &&
+	test_when_finished git switch main &&
+	git switch main &&
 	git switch --detach &&
 	test_must_fail git symbolic-ref HEAD
 '
 
 test_expect_success 'switch and create branch' '
-	test_when_finished git switch master &&
-	git switch -c temp master^ &&
-	test_cmp_rev master^ refs/heads/temp &&
+	test_when_finished git switch main &&
+	git switch -c temp main^ &&
+	test_cmp_rev main^ refs/heads/temp &&
 	echo refs/heads/temp >expected-branch &&
 	git symbolic-ref HEAD >actual-branch &&
 	test_cmp expected-branch actual-branch
 '
 
 test_expect_success 'force create branch from HEAD' '
-	test_when_finished git switch master &&
-	git switch --detach master &&
+	test_when_finished git switch main &&
+	git switch --detach main &&
 	test_must_fail git switch -c temp &&
 	git switch -C temp &&
-	test_cmp_rev master refs/heads/temp &&
+	test_cmp_rev main refs/heads/temp &&
 	echo refs/heads/temp >expected-branch &&
 	git symbolic-ref HEAD >actual-branch &&
 	test_cmp expected-branch actual-branch
 '
 
 test_expect_success 'new orphan branch from empty' '
-	test_when_finished git switch master &&
+	test_when_finished git switch main &&
 	test_must_fail git switch --orphan new-orphan HEAD &&
 	git switch --orphan new-orphan &&
 	test_commit orphan &&
@@ -69,7 +69,7 @@ test_expect_success 'new orphan branch from empty' '
 '
 
 test_expect_success 'orphan branch works with --discard-changes' '
-	test_when_finished git switch master &&
+	test_when_finished git switch main &&
 	echo foo >foo.txt &&
 	git switch --discard-changes --orphan new-orphan2 &&
 	git ls-files >tracked-files &&
@@ -77,7 +77,7 @@ test_expect_success 'orphan branch works with --discard-changes' '
 '
 
 test_expect_success 'switching ignores file of same branch name' '
-	test_when_finished git switch master &&
+	test_when_finished git switch main &&
 	: >first-branch &&
 	git switch first-branch &&
 	echo refs/heads/first-branch >expected &&
@@ -86,7 +86,7 @@ test_expect_success 'switching ignores file of same branch name' '
 '
 
 test_expect_success 'guess and create branch' '
-	test_when_finished git switch master &&
+	test_when_finished git switch main &&
 	test_must_fail git switch --no-guess foo &&
 	test_config checkout.guess false &&
 	test_must_fail git switch foo &&
diff --git a/t/t2070-restore.sh b/t/t2070-restore.sh
index 89e5a142c9..46e27212d6 100755
--- a/t/t2070-restore.sh
+++ b/t/t2070-restore.sh
@@ -15,7 +15,7 @@ test_expect_success 'setup' '
 	echo ignored >ignored &&
 	echo /ignored >.gitignore &&
 	git add one two .gitignore &&
-	git update-ref refs/heads/one master
+	git update-ref refs/heads/one main
 '
 
 test_expect_success 'restore without pathspec is not ok' '
@@ -91,7 +91,7 @@ test_expect_success 'restore --ignore-unmerged ignores unmerged entries' '
 		git switch -c first &&
 		echo first >unmerged &&
 		git commit -am first &&
-		git switch -c second master &&
+		git switch -c second main &&
 		echo second >unmerged &&
 		git commit -am second &&
 		test_must_fail git merge first &&
diff --git a/t/t2106-update-index-assume-unchanged.sh b/t/t2106-update-index-assume-unchanged.sh
index 99d858c6b7..2b923824c9 100755
--- a/t/t2106-update-index-assume-unchanged.sh
+++ b/t/t2106-update-index-assume-unchanged.sh
@@ -19,6 +19,6 @@ test_expect_success 'do not switch branches with dirty file' \
 	 git checkout other &&
 	 echo dirt >file &&
 	 git update-index --assume-unchanged file &&
-	 test_must_fail git checkout master'
+	 test_must_fail git checkout main'
 
 test_done
diff --git a/t/t2400-worktree-add.sh b/t/t2400-worktree-add.sh
index 5a7495474a..deca7b0271 100755
--- a/t/t2400-worktree-add.sh
+++ b/t/t2400-worktree-add.sh
@@ -12,12 +12,12 @@ test_expect_success 'setup' '
 
 test_expect_success '"add" an existing worktree' '
 	mkdir -p existing/subtree &&
-	test_must_fail git worktree add --detach existing master
+	test_must_fail git worktree add --detach existing main
 '
 
 test_expect_success '"add" an existing empty worktree' '
 	mkdir existing_empty &&
-	git worktree add --detach existing_empty master
+	git worktree add --detach existing_empty main
 '
 
 test_expect_success '"add" using shorthand - fails when no previous branch' '
@@ -29,7 +29,7 @@ test_expect_success '"add" using - shorthand' '
 	echo hello >myworld &&
 	git add myworld &&
 	git commit -m myworld &&
-	git checkout master &&
+	git checkout main &&
 	git worktree add short-hand - &&
 	echo refs/heads/newbranch >expect &&
 	git -C short-hand rev-parse --symbolic-full-name HEAD >actual &&
@@ -37,7 +37,7 @@ test_expect_success '"add" using - shorthand' '
 '
 
 test_expect_success '"add" refuses to checkout locked branch' '
-	test_must_fail git worktree add zere master &&
+	test_must_fail git worktree add zere main &&
 	! test -d zere &&
 	! test -d .git/worktrees/zere
 '
@@ -46,13 +46,13 @@ test_expect_success 'checking out paths not complaining about linked checkouts'
 	(
 	cd existing_empty &&
 	echo dirty >>init.t &&
-	git checkout master -- init.t
+	git checkout main -- init.t
 	)
 '
 
 test_expect_success '"add" worktree' '
 	git rev-parse HEAD >expect &&
-	git worktree add --detach here master &&
+	git worktree add --detach here main &&
 	(
 		cd here &&
 		test_cmp ../init.t init.t &&
@@ -65,7 +65,7 @@ test_expect_success '"add" worktree' '
 
 test_expect_success '"add" worktree with lock' '
 	git rev-parse HEAD >expect &&
-	git worktree add --detach --lock here-with-lock master &&
+	git worktree add --detach --lock here-with-lock main &&
 	test -f .git/worktrees/here-with-lock/locked
 '
 
@@ -73,7 +73,7 @@ test_expect_success '"add" worktree from a subdir' '
 	(
 		mkdir sub &&
 		cd sub &&
-		git worktree add --detach here master &&
+		git worktree add --detach here main &&
 		cd here &&
 		test_cmp ../../init.t init.t
 	)
@@ -82,19 +82,19 @@ test_expect_success '"add" worktree from a subdir' '
 test_expect_success '"add" from a linked checkout' '
 	(
 		cd here &&
-		git worktree add --detach nested-here master &&
+		git worktree add --detach nested-here main &&
 		cd nested-here &&
 		git fsck
 	)
 '
 
 test_expect_success '"add" worktree creating new branch' '
-	git worktree add -b newmaster there master &&
+	git worktree add -b newmain there main &&
 	(
 		cd there &&
 		test_cmp ../init.t init.t &&
 		git symbolic-ref HEAD >actual &&
-		echo refs/heads/newmaster >expect &&
+		echo refs/heads/newmain >expect &&
 		test_cmp expect actual &&
 		git fsck
 	)
@@ -103,7 +103,7 @@ test_expect_success '"add" worktree creating new branch' '
 test_expect_success 'die the same branch is already checked out' '
 	(
 		cd here &&
-		test_must_fail git checkout newmaster
+		test_must_fail git checkout newmain
 	)
 '
 
@@ -112,20 +112,20 @@ test_expect_success SYMLINKS 'die the same branch is already checked out (symlin
 	ref=$(git -C there symbolic-ref HEAD) &&
 	rm "$head" &&
 	ln -s "$ref" "$head" &&
-	test_must_fail git -C here checkout newmaster
+	test_must_fail git -C here checkout newmain
 '
 
 test_expect_success 'not die the same branch is already checked out' '
 	(
 		cd here &&
-		git worktree add --force anothernewmaster newmaster
+		git worktree add --force anothernewmain newmain
 	)
 '
 
 test_expect_success 'not die on re-checking out current branch' '
 	(
 		cd there &&
-		git checkout newmaster
+		git checkout newmain
 	)
 '
 
@@ -133,14 +133,14 @@ test_expect_success '"add" from a bare repo' '
 	(
 		git clone --bare . bare &&
 		cd bare &&
-		git worktree add -b bare-master ../there2 master
+		git worktree add -b bare-main ../there2 main
 	)
 '
 
 test_expect_success 'checkout from a bare repo without "add"' '
 	(
 		cd bare &&
-		test_must_fail git checkout master
+		test_must_fail git checkout main
 	)
 '
 
@@ -148,7 +148,7 @@ test_expect_success '"add" default branch of a bare repo' '
 	(
 		git clone --bare . bare2 &&
 		cd bare2 &&
-		git worktree add ../there3 master
+		git worktree add ../there3 main
 	)
 '
 
@@ -165,7 +165,7 @@ test_expect_success 'checkout with grafts' '
 	EOF
 	git log --format=%s -2 >actual &&
 	test_cmp expected actual &&
-	git worktree add --detach grafted master &&
+	git worktree add --detach grafted main &&
 	git --git-dir=grafted/.git log --format=%s -2 >actual &&
 	test_cmp expected actual
 '
@@ -226,34 +226,34 @@ test_expect_success '"add" no auto-vivify with --detach and <branch> omitted' '
 '
 
 test_expect_success '"add" -b/-B mutually exclusive' '
-	test_must_fail git worktree add -b poodle -B poodle bamboo master
+	test_must_fail git worktree add -b poodle -B poodle bamboo main
 '
 
 test_expect_success '"add" -b/--detach mutually exclusive' '
-	test_must_fail git worktree add -b poodle --detach bamboo master
+	test_must_fail git worktree add -b poodle --detach bamboo main
 '
 
 test_expect_success '"add" -B/--detach mutually exclusive' '
-	test_must_fail git worktree add -B poodle --detach bamboo master
+	test_must_fail git worktree add -B poodle --detach bamboo main
 '
 
 test_expect_success '"add -B" fails if the branch is checked out' '
-	git rev-parse newmaster >before &&
-	test_must_fail git worktree add -B newmaster bamboo master &&
-	git rev-parse newmaster >after &&
+	git rev-parse newmain >before &&
+	test_must_fail git worktree add -B newmain bamboo main &&
+	git rev-parse newmain >after &&
 	test_cmp before after
 '
 
 test_expect_success 'add -B' '
-	git worktree add -B poodle bamboo2 master^ &&
+	git worktree add -B poodle bamboo2 main^ &&
 	git -C bamboo2 symbolic-ref HEAD >actual &&
 	echo refs/heads/poodle >expected &&
 	test_cmp expected actual &&
-	test_cmp_rev master^ poodle
+	test_cmp_rev main^ poodle
 '
 
 test_expect_success 'add --quiet' '
-	git worktree add --quiet another-worktree master 2>actual &&
+	git worktree add --quiet another-worktree main 2>actual &&
 	test_must_be_empty actual
 '
 
@@ -348,24 +348,24 @@ test_branch_upstream () {
 
 test_expect_success '--track sets up tracking' '
 	test_when_finished rm -rf track &&
-	git worktree add --track -b track track master &&
-	test_branch_upstream track . master
+	git worktree add --track -b track track main &&
+	test_branch_upstream track . main
 '
 
 # setup remote repository $1 and repository $2 with $1 set up as
-# remote.  The remote has two branches, master and foo.
+# remote.  The remote has two branches, main and foo.
 setup_remote_repo () {
 	git init $1 &&
 	(
 		cd $1 &&
-		test_commit $1_master &&
+		test_commit $1_main &&
 		git checkout -b foo &&
 		test_commit upstream_foo
 	) &&
 	git init $2 &&
 	(
 		cd $2 &&
-		test_commit $2_master &&
+		test_commit $2_main &&
 		git remote add $1 ../$1 &&
 		git config remote.$1.fetch \
 			"refs/heads/*:refs/remotes/$1/*" &&
diff --git a/t/t2401-worktree-prune.sh b/t/t2401-worktree-prune.sh
index a6ce7f590b..7a2ff04f44 100755
--- a/t/t2401-worktree-prune.sh
+++ b/t/t2401-worktree-prune.sh
@@ -87,7 +87,7 @@ test_expect_success 'not prune recent checkouts' '
 
 test_expect_success 'not prune proper checkouts' '
 	test_when_finished rm -r .git/worktrees &&
-	git worktree add --detach "$PWD/nop" master &&
+	git worktree add --detach "$PWD/nop" main &&
 	git worktree prune &&
 	test -d .git/worktrees/nop
 '
diff --git a/t/t2402-worktree-list.sh b/t/t2402-worktree-list.sh
index 795ddca2e4..03603d0dd0 100755
--- a/t/t2402-worktree-list.sh
+++ b/t/t2402-worktree-list.sh
@@ -21,7 +21,7 @@ test_expect_success 'rev-parse --git-common-dir on main worktree' '
 test_expect_success 'rev-parse --git-path objects linked worktree' '
 	echo "$(git rev-parse --show-toplevel)/.git/objects" >expect &&
 	test_when_finished "rm -rf linked-tree actual expect && git worktree prune" &&
-	git worktree add --detach linked-tree master &&
+	git worktree add --detach linked-tree main &&
 	git -C linked-tree rev-parse --git-path objects >actual &&
 	test_cmp expect actual
 '
@@ -29,7 +29,7 @@ test_expect_success 'rev-parse --git-path objects linked worktree' '
 test_expect_success '"list" all worktrees from main' '
 	echo "$(git rev-parse --show-toplevel) $(git rev-parse --short HEAD) [$(git symbolic-ref --short HEAD)]" >expect &&
 	test_when_finished "rm -rf here out actual expect && git worktree prune" &&
-	git worktree add --detach here master &&
+	git worktree add --detach here main &&
 	echo "$(git -C here rev-parse --show-toplevel) $(git rev-parse --short HEAD) (detached HEAD)" >>expect &&
 	git worktree list >out &&
 	sed "s/  */ /g" <out >actual &&
@@ -39,7 +39,7 @@ test_expect_success '"list" all worktrees from main' '
 test_expect_success '"list" all worktrees from linked' '
 	echo "$(git rev-parse --show-toplevel) $(git rev-parse --short HEAD) [$(git symbolic-ref --short HEAD)]" >expect &&
 	test_when_finished "rm -rf here out actual expect && git worktree prune" &&
-	git worktree add --detach here master &&
+	git worktree add --detach here main &&
 	echo "$(git -C here rev-parse --show-toplevel) $(git rev-parse --short HEAD) (detached HEAD)" >>expect &&
 	git -C here worktree list >out &&
 	sed "s/  */ /g" <out >actual &&
@@ -52,7 +52,7 @@ test_expect_success '"list" all worktrees --porcelain' '
 	echo "branch $(git symbolic-ref HEAD)" >>expect &&
 	echo >>expect &&
 	test_when_finished "rm -rf here actual expect && git worktree prune" &&
-	git worktree add --detach here master &&
+	git worktree add --detach here main &&
 	echo "worktree $(git -C here rev-parse --show-toplevel)" >>expect &&
 	echo "HEAD $(git rev-parse HEAD)" >>expect &&
 	echo "detached" >>expect &&
@@ -63,8 +63,8 @@ test_expect_success '"list" all worktrees --porcelain' '
 
 test_expect_success '"list" all worktrees with locked annotation' '
 	test_when_finished "rm -rf locked unlocked out && git worktree prune" &&
-	git worktree add --detach locked master &&
-	git worktree add --detach unlocked master &&
+	git worktree add --detach locked main &&
+	git worktree add --detach unlocked main &&
 	git worktree lock locked &&
 	git worktree list >out &&
 	grep "/locked  *[0-9a-f].* locked$" out &&
@@ -76,13 +76,13 @@ test_expect_success 'bare repo setup' '
 	echo "data" >file1 &&
 	git add file1 &&
 	git commit -m"File1: add data" &&
-	git push bare1 master &&
+	git push bare1 main &&
 	git reset --hard HEAD^
 '
 
 test_expect_success '"list" all worktrees from bare main' '
 	test_when_finished "rm -rf there out actual expect && git -C bare1 worktree prune" &&
-	git -C bare1 worktree add --detach ../there master &&
+	git -C bare1 worktree add --detach ../there main &&
 	echo "$(pwd)/bare1 (bare)" >expect &&
 	echo "$(git -C there rev-parse --show-toplevel) $(git -C there rev-parse --short HEAD) (detached HEAD)" >>expect &&
 	git -C bare1 worktree list >out &&
@@ -92,7 +92,7 @@ test_expect_success '"list" all worktrees from bare main' '
 
 test_expect_success '"list" all worktrees --porcelain from bare main' '
 	test_when_finished "rm -rf there actual expect && git -C bare1 worktree prune" &&
-	git -C bare1 worktree add --detach ../there master &&
+	git -C bare1 worktree add --detach ../there main &&
 	echo "worktree $(pwd)/bare1" >expect &&
 	echo "bare" >>expect &&
 	echo >>expect &&
@@ -106,7 +106,7 @@ test_expect_success '"list" all worktrees --porcelain from bare main' '
 
 test_expect_success '"list" all worktrees from linked with a bare main' '
 	test_when_finished "rm -rf there out actual expect && git -C bare1 worktree prune" &&
-	git -C bare1 worktree add --detach ../there master &&
+	git -C bare1 worktree add --detach ../there main &&
 	echo "$(pwd)/bare1 (bare)" >expect &&
 	echo "$(git -C there rev-parse --show-toplevel) $(git -C there rev-parse --short HEAD) (detached HEAD)" >>expect &&
 	git -C there worktree list >out &&
diff --git a/t/t2405-worktree-submodule.sh b/t/t2405-worktree-submodule.sh
index e1b2bfd87e..ccc47fae97 100755
--- a/t/t2405-worktree-submodule.sh
+++ b/t/t2405-worktree-submodule.sh
@@ -31,7 +31,7 @@ test_expect_success 'add superproject worktree' '
 '
 
 test_expect_failure 'submodule is checked out just after worktree add' '
-	git -C worktree diff --submodule master"^!" >out &&
+	git -C worktree diff --submodule main"^!" >out &&
 	grep "file1 updated" out
 '
 
@@ -41,7 +41,7 @@ test_expect_success 'add superproject worktree and initialize submodules' '
 '
 
 test_expect_success 'submodule is checked out just after submodule update in linked worktree' '
-	git -C worktree-submodule-update diff --submodule master"^!" >out &&
+	git -C worktree-submodule-update diff --submodule main"^!" >out &&
 	grep "file1 updated" out
 '
 
@@ -51,7 +51,7 @@ test_expect_success 'add superproject worktree and manually add submodule worktr
 '
 
 test_expect_success 'submodule is checked out after manually adding submodule worktree' '
-	git -C linked_submodule diff --submodule master"^!" >out &&
+	git -C linked_submodule diff --submodule main"^!" >out &&
 	grep "file1 updated" out
 '
 
diff --git a/t/test-lib.sh b/t/test-lib.sh
index 126004e342..3bb6675390 100644
--- a/t/test-lib.sh
+++ b/t/test-lib.sh
@@ -257,7 +257,7 @@ case "$TRASH_DIRECTORY" in
 esac
 
 case "$TEST_NUMBER" in
-[01]*)
+[0-2]*)
 	GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 	export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 	;;
-- 
gitgitgadget


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH v2 04/27] t3[0-3]*: adjust the references to the default branch name "main"
  2020-11-17 16:12 ` [PATCH v2 00/27] tests: use " Johannes Schindelin via GitGitGadget
                     ` (2 preceding siblings ...)
  2020-11-17 16:12   ` [PATCH v2 03/27] t2*: " Johannes Schindelin via GitGitGadget
@ 2020-11-17 16:12   ` Johannes Schindelin via GitGitGadget
  2020-11-17 16:12   ` [PATCH v2 05/27] t3416: preemptively adjust alignment in a comment Johannes Schindelin via GitGitGadget
                     ` (24 subsequent siblings)
  28 siblings, 0 replies; 163+ messages in thread
From: Johannes Schindelin via GitGitGadget @ 2020-11-17 16:12 UTC (permalink / raw)
  To: git
  Cc: Felipe Contreras, Ævar Arnfjörð Bjarmason,
	Johannes Schindelin, Jeff King, Johannes Schindelin,
	Johannes Schindelin

From: Johannes Schindelin <johannes.schindelin@gmx.de>

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[0-3]*.sh t3206/*)

This allows us to define `GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main`
for those tests.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
---
 t/t3040-subprojects-basic.sh          |   2 +-
 t/t3200-branch.sh                     | 242 +++++++++++++-------------
 t/t3201-branch-contains.sh            |  80 ++++-----
 t/t3202-show-branch-octopus.sh        |   2 +-
 t/t3203-branch-output.sh              |  38 ++--
 t/t3204-branch-name-interpretation.sh |   6 +-
 t/t3205-branch-color.sh               |   6 +-
 t/t3206-range-diff.sh                 |  40 ++---
 t/t3206/history.export                |   2 +-
 t/t3210-pack-refs.sh                  |   4 +-
 t/t3211-peel-ref.sh                   |   4 +-
 t/t3301-notes.sh                      |   6 +-
 t/t3302-notes-index-expensive.sh      |   2 +-
 t/t3303-notes-subtrees.sh             |   8 +-
 t/t3304-notes-mixed.sh                |   8 +-
 t/t3308-notes-merge.sh                |   2 +-
 t/t3320-notes-merge-worktrees.sh      |   4 +-
 t/test-lib.sh                         |   2 +-
 18 files changed, 229 insertions(+), 229 deletions(-)

diff --git a/t/t3040-subprojects-basic.sh b/t/t3040-subprojects-basic.sh
index b81eb5fd6f..f3ea8dcf58 100755
--- a/t/t3040-subprojects-basic.sh
+++ b/t/t3040-subprojects-basic.sh
@@ -80,6 +80,6 @@ test_expect_success 'checkout in superproject' '
 '
 
 # just interesting what happened...
-# git diff --name-status -M save master
+# git diff --name-status -M save main
 
 test_done
diff --git a/t/t3200-branch.sh b/t/t3200-branch.sh
index a0b832d59e..63036e0369 100755
--- a/t/t3200-branch.sh
+++ b/t/t3200-branch.sh
@@ -28,7 +28,7 @@ test_expect_success 'branch -h in broken repository' '
 	(
 		cd broken &&
 		git init &&
-		>.git/refs/heads/master &&
+		>.git/refs/heads/main &&
 		test_expect_code 129 git branch -h >usage 2>&1
 	) &&
 	test_i18ngrep "[Uu]sage" broken/usage
@@ -42,8 +42,8 @@ test_expect_success 'git branch a/b/c should create a branch' '
 	git branch a/b/c && test_path_is_file .git/refs/heads/a/b/c
 '
 
-test_expect_success 'git branch mb master... should create a branch' '
-	git branch mb master... && test_path_is_file .git/refs/heads/mb
+test_expect_success 'git branch mb main... should create a branch' '
+	git branch mb main... && test_path_is_file .git/refs/heads/mb
 '
 
 test_expect_success 'git branch HEAD should fail' '
@@ -51,7 +51,7 @@ test_expect_success 'git branch HEAD should fail' '
 '
 
 cat >expect <<EOF
-$ZERO_OID $HEAD $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> 1117150200 +0000	branch: Created from master
+$ZERO_OID $HEAD $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> 1117150200 +0000	branch: Created from main
 EOF
 test_expect_success 'git branch --create-reflog d/e/f should create a branch and a log' '
 	GIT_COMMITTER_DATE="2005-05-26 23:30" \
@@ -110,7 +110,7 @@ test_expect_success 'git branch -m n/n n should work' '
 
 test_expect_success 'git branch -m bbb should rename checked out branch' '
 	test_when_finished git branch -D bbb &&
-	test_when_finished git checkout master &&
+	test_when_finished git checkout main &&
 	git checkout -b aaa &&
 	git commit --allow-empty -m "a new commit" &&
 	git rev-parse aaa@{0} >expect &&
@@ -124,7 +124,7 @@ test_expect_success 'git branch -m bbb should rename checked out branch' '
 
 test_expect_success 'renaming checked out branch works with d/f conflict' '
 	test_when_finished "git branch -D foo/bar || git branch -D foo" &&
-	test_when_finished git checkout master &&
+	test_when_finished git checkout main &&
 	git checkout -b foo &&
 	git branch -m foo/bar &&
 	git symbolic-ref HEAD >actual &&
@@ -185,7 +185,7 @@ test_expect_success 'git branch -M should leave orphaned HEAD alone' '
 		git checkout --orphan lonely &&
 		grep lonely .git/HEAD &&
 		test_path_is_missing .git/refs/head/lonely &&
-		git branch -M master mistress &&
+		git branch -M main mistress &&
 		grep lonely .git/HEAD
 	)
 '
@@ -201,7 +201,7 @@ test_expect_success 'resulting reflog can be shown by log -g' '
 '
 
 test_expect_success 'git branch -M baz bam should succeed when baz is checked out as linked working tree' '
-	git checkout master &&
+	git checkout main &&
 	git worktree add -b baz bazdir &&
 	git worktree add -f bazdir2 baz &&
 	git branch -M baz bam &&
@@ -224,18 +224,18 @@ test_expect_success 'git branch -M baz bam should succeed within a worktree in w
 	git worktree prune
 '
 
-test_expect_success 'git branch -M master should work when master is checked out' '
-	git checkout master &&
-	git branch -M master
+test_expect_success 'git branch -M main should work when main is checked out' '
+	git checkout main &&
+	git branch -M main
 '
 
-test_expect_success 'git branch -M master master should work when master is checked out' '
-	git checkout master &&
-	git branch -M master master
+test_expect_success 'git branch -M main main should work when main is checked out' '
+	git checkout main &&
+	git branch -M main main
 '
 
-test_expect_success 'git branch -M topic topic should work when master is checked out' '
-	git checkout master &&
+test_expect_success 'git branch -M topic topic should work when main is checked out' '
+	git checkout main &&
 	git branch topic &&
 	git branch -M topic topic
 '
@@ -292,8 +292,8 @@ test_expect_success 'bare main worktree has HEAD at branch deleted by secondary
 	git init nonbare &&
 	test_commit -C nonbare x &&
 	git clone --bare nonbare bare &&
-	git -C bare worktree add --detach ../secondary master &&
-	git -C secondary branch -D master
+	git -C bare worktree add --detach ../secondary main &&
+	git -C secondary branch -D main
 '
 
 test_expect_success 'git branch --list -v with --abbrev' '
@@ -345,7 +345,7 @@ test_expect_success 'git branch --column with an extremely long branch name' '
   j/k
   l
   m/m
-* master
+* main
   mb
   n
   o/o
@@ -388,7 +388,7 @@ test_expect_success PREPARE_FOR_MAIN_BRANCH 'git branch -v with column.ui ignore
   j/k
   l
   m/m
-* master
+* main
   mb
   n
   o/o
@@ -427,8 +427,8 @@ test_expect_success 'config information was renamed, too' '
 '
 
 test_expect_success 'git branch -m correctly renames multiple config sections' '
-	test_when_finished "git checkout master" &&
-	git checkout -b source master &&
+	test_when_finished "git checkout main" &&
+	git checkout -b source main &&
 
 	# Assert that a config file with multiple config sections has
 	# those sections preserved...
@@ -587,18 +587,18 @@ test_expect_success 'git branch -C c1 c2 should never touch HEAD' '
 	! grep "$msg$" .git/logs/HEAD
 '
 
-test_expect_success 'git branch -C master should work when master is checked out' '
-	git checkout master &&
-	git branch -C master
+test_expect_success 'git branch -C main should work when main is checked out' '
+	git checkout main &&
+	git branch -C main
 '
 
-test_expect_success 'git branch -C master master should work when master is checked out' '
-	git checkout master &&
-	git branch -C master master
+test_expect_success 'git branch -C main main should work when main is checked out' '
+	git checkout main &&
+	git branch -C main main
 '
 
-test_expect_success 'git branch -C main5 main5 should work when master is checked out' '
-	git checkout master &&
+test_expect_success 'git branch -C main5 main5 should work when main is checked out' '
+	git checkout main &&
 	git branch main5 &&
 	git branch -C main5 main5
 '
@@ -620,8 +620,8 @@ test_expect_success 'git branch -C ab cd should overwrite existing config for cd
 test_expect_success 'git branch -c correctly copies multiple config sections' '
 	FOO=1 &&
 	export FOO &&
-	test_when_finished "git checkout master" &&
-	git checkout -b source2 master &&
+	test_when_finished "git checkout main" &&
+	git checkout -b source2 main &&
 
 	# Assert that a config file with multiple config sections has
 	# those sections preserved...
@@ -711,10 +711,10 @@ test_expect_success 'deleting a self-referential symref' '
 '
 
 test_expect_success 'renaming a symref is not allowed' '
-	git symbolic-ref refs/heads/topic refs/heads/master &&
+	git symbolic-ref refs/heads/topic refs/heads/main &&
 	test_must_fail git branch -m topic new-topic &&
 	git symbolic-ref refs/heads/topic &&
-	test_path_is_file .git/refs/heads/master &&
+	test_path_is_file .git/refs/heads/main &&
 	test_path_is_missing .git/refs/heads/new-topic
 '
 
@@ -728,27 +728,27 @@ test_expect_success SYMLINKS 'git branch -m u v should fail when the reflog for
 test_expect_success 'test tracking setup via --track' '
 	git config remote.local.url . &&
 	git config remote.local.fetch refs/heads/*:refs/remotes/local/* &&
-	(git show-ref -q refs/remotes/local/master || git fetch local) &&
-	git branch --track my1 local/master &&
+	(git show-ref -q refs/remotes/local/main || git fetch local) &&
+	git branch --track my1 local/main &&
 	test $(git config branch.my1.remote) = local &&
-	test $(git config branch.my1.merge) = refs/heads/master
+	test $(git config branch.my1.merge) = refs/heads/main
 '
 
 test_expect_success 'test tracking setup (non-wildcard, matching)' '
 	git config remote.local.url . &&
-	git config remote.local.fetch refs/heads/master:refs/remotes/local/master &&
-	(git show-ref -q refs/remotes/local/master || git fetch local) &&
-	git branch --track my4 local/master &&
+	git config remote.local.fetch refs/heads/main:refs/remotes/local/main &&
+	(git show-ref -q refs/remotes/local/main || git fetch local) &&
+	git branch --track my4 local/main &&
 	test $(git config branch.my4.remote) = local &&
-	test $(git config branch.my4.merge) = refs/heads/master
+	test $(git config branch.my4.merge) = refs/heads/main
 '
 
 test_expect_success 'tracking setup fails on non-matching refspec' '
 	git config remote.local.url . &&
 	git config remote.local.fetch refs/heads/*:refs/remotes/local/* &&
-	(git show-ref -q refs/remotes/local/master || git fetch local) &&
+	(git show-ref -q refs/remotes/local/main || git fetch local) &&
 	git config remote.local.fetch refs/heads/s:refs/remotes/local/s &&
-	test_must_fail git branch --track my5 local/master &&
+	test_must_fail git branch --track my5 local/main &&
 	test_must_fail git config branch.my5.remote &&
 	test_must_fail git config branch.my5.merge
 '
@@ -757,21 +757,21 @@ test_expect_success 'test tracking setup via config' '
 	git config branch.autosetupmerge true &&
 	git config remote.local.url . &&
 	git config remote.local.fetch refs/heads/*:refs/remotes/local/* &&
-	(git show-ref -q refs/remotes/local/master || git fetch local) &&
-	git branch my3 local/master &&
+	(git show-ref -q refs/remotes/local/main || git fetch local) &&
+	git branch my3 local/main &&
 	test $(git config branch.my3.remote) = local &&
-	test $(git config branch.my3.merge) = refs/heads/master
+	test $(git config branch.my3.merge) = refs/heads/main
 '
 
 test_expect_success 'test overriding tracking setup via --no-track' '
 	git config branch.autosetupmerge true &&
 	git config remote.local.url . &&
 	git config remote.local.fetch refs/heads/*:refs/remotes/local/* &&
-	(git show-ref -q refs/remotes/local/master || git fetch local) &&
-	git branch --no-track my2 local/master &&
+	(git show-ref -q refs/remotes/local/main || git fetch local) &&
+	git branch --no-track my2 local/main &&
 	git config branch.autosetupmerge false &&
 	! test "$(git config branch.my2.remote)" = local &&
-	! test "$(git config branch.my2.merge)" = refs/heads/master
+	! test "$(git config branch.my2.merge)" = refs/heads/main
 '
 
 test_expect_success 'no tracking without .fetch entries' '
@@ -836,26 +836,26 @@ test_expect_success 'branch from tag w/--track causes failure' '
 
 test_expect_success '--set-upstream-to fails on multiple branches' '
 	echo "fatal: too many arguments to set new upstream" >expect &&
-	test_must_fail git branch --set-upstream-to master a b c 2>err &&
+	test_must_fail git branch --set-upstream-to main a b c 2>err &&
 	test_i18ncmp expect err
 '
 
 test_expect_success '--set-upstream-to fails on detached HEAD' '
 	git checkout HEAD^{} &&
 	test_when_finished git checkout - &&
-	echo "fatal: could not set upstream of HEAD to master when it does not point to any branch." >expect &&
-	test_must_fail git branch --set-upstream-to master 2>err &&
+	echo "fatal: could not set upstream of HEAD to main when it does not point to any branch." >expect &&
+	test_must_fail git branch --set-upstream-to main 2>err &&
 	test_i18ncmp expect err
 '
 
 test_expect_success '--set-upstream-to fails on a missing dst branch' '
 	echo "fatal: branch '"'"'does-not-exist'"'"' does not exist" >expect &&
-	test_must_fail git branch --set-upstream-to master does-not-exist 2>err &&
+	test_must_fail git branch --set-upstream-to main does-not-exist 2>err &&
 	test_i18ncmp expect err
 '
 
 test_expect_success '--set-upstream-to fails on a missing src branch' '
-	test_must_fail git branch --set-upstream-to does-not-exist master 2>err &&
+	test_must_fail git branch --set-upstream-to does-not-exist main 2>err &&
 	test_i18ngrep "the requested upstream branch '"'"'does-not-exist'"'"' does not exist" err
 '
 
@@ -874,20 +874,20 @@ test_expect_success '--set-upstream-to fails on locked config' '
 '
 
 test_expect_success 'use --set-upstream-to modify HEAD' '
-	test_config branch.master.remote foo &&
-	test_config branch.master.merge foo &&
+	test_config branch.main.remote foo &&
+	test_config branch.main.merge foo &&
 	git branch my12 &&
 	git branch --set-upstream-to my12 &&
-	test "$(git config branch.master.remote)" = "." &&
-	test "$(git config branch.master.merge)" = "refs/heads/my12"
+	test "$(git config branch.main.remote)" = "." &&
+	test "$(git config branch.main.merge)" = "refs/heads/my12"
 '
 
 test_expect_success 'use --set-upstream-to modify a particular branch' '
 	git branch my13 &&
-	git branch --set-upstream-to master my13 &&
+	git branch --set-upstream-to main my13 &&
 	test_when_finished "git branch --unset-upstream my13" &&
 	test "$(git config branch.my13.remote)" = "." &&
-	test "$(git config branch.my13.merge)" = "refs/heads/master"
+	test "$(git config branch.my13.merge)" = "refs/heads/main"
 '
 
 test_expect_success '--unset-upstream should fail if given a non-existent branch' '
@@ -906,14 +906,14 @@ test_expect_success '--unset-upstream should fail if config is locked' '
 
 test_expect_success 'test --unset-upstream on HEAD' '
 	git branch my14 &&
-	test_config branch.master.remote foo &&
-	test_config branch.master.merge foo &&
+	test_config branch.main.remote foo &&
+	test_config branch.main.merge foo &&
 	git branch --set-upstream-to my14 &&
 	git branch --unset-upstream &&
-	test_must_fail git config branch.master.remote &&
-	test_must_fail git config branch.master.merge &&
+	test_must_fail git config branch.main.remote &&
+	test_must_fail git config branch.main.merge &&
 	# fail for a branch without upstream set
-	echo "fatal: Branch '"'"'master'"'"' has no upstream information" >expect &&
+	echo "fatal: Branch '"'"'main'"'"' has no upstream information" >expect &&
 	test_must_fail git branch --unset-upstream 2>err &&
 	test_i18ncmp expect err
 '
@@ -934,14 +934,14 @@ test_expect_success '--unset-upstream should fail on detached HEAD' '
 
 test_expect_success 'test --unset-upstream on a particular branch' '
 	git branch my15 &&
-	git branch --set-upstream-to master my14 &&
+	git branch --set-upstream-to main my14 &&
 	git branch --unset-upstream my14 &&
 	test_must_fail git config branch.my14.remote &&
 	test_must_fail git config branch.my14.merge
 '
 
 test_expect_success 'disabled option --set-upstream fails' '
-	test_must_fail git branch --set-upstream origin/master
+	test_must_fail git branch --set-upstream origin/main
 '
 
 test_expect_success '--set-upstream-to notices an error to set branch as own upstream' '
@@ -956,32 +956,32 @@ test_expect_success '--set-upstream-to notices an error to set branch as own ups
 
 # Keep this test last, as it changes the current branch
 cat >expect <<EOF
-$ZERO_OID $HEAD $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> 1117150200 +0000	branch: Created from master
+$ZERO_OID $HEAD $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> 1117150200 +0000	branch: Created from main
 EOF
 test_expect_success 'git checkout -b g/h/i -l should create a branch and a log' '
 	GIT_COMMITTER_DATE="2005-05-26 23:30" \
-	git checkout -b g/h/i -l master &&
+	git checkout -b g/h/i -l main &&
 	test_path_is_file .git/refs/heads/g/h/i &&
 	test_path_is_file .git/logs/refs/heads/g/h/i &&
 	test_cmp expect .git/logs/refs/heads/g/h/i
 '
 
 test_expect_success 'checkout -b makes reflog by default' '
-	git checkout master &&
+	git checkout main &&
 	git config --unset core.logAllRefUpdates &&
 	git checkout -b alpha &&
 	git rev-parse --verify alpha@{0}
 '
 
 test_expect_success 'checkout -b does not make reflog when core.logAllRefUpdates = false' '
-	git checkout master &&
+	git checkout main &&
 	git config core.logAllRefUpdates false &&
 	git checkout -b beta &&
 	test_must_fail git rev-parse --verify beta@{0}
 '
 
 test_expect_success 'checkout -b with -l makes reflog when core.logAllRefUpdates = false' '
-	git checkout master &&
+	git checkout main &&
 	git checkout -lb gamma &&
 	git config --unset core.logAllRefUpdates &&
 	git rev-parse --verify gamma@{0}
@@ -990,10 +990,10 @@ test_expect_success 'checkout -b with -l makes reflog when core.logAllRefUpdates
 test_expect_success 'avoid ambiguous track' '
 	git config branch.autosetupmerge true &&
 	git config remote.ambi1.url lalala &&
-	git config remote.ambi1.fetch refs/heads/lalala:refs/heads/master &&
+	git config remote.ambi1.fetch refs/heads/lalala:refs/heads/main &&
 	git config remote.ambi2.url lilili &&
-	git config remote.ambi2.fetch refs/heads/lilili:refs/heads/master &&
-	test_must_fail git branch all1 master &&
+	git config remote.ambi2.fetch refs/heads/lilili:refs/heads/main &&
+	test_must_fail git branch all1 main &&
 	test -z "$(git config branch.all1.merge)"
 '
 
@@ -1049,10 +1049,10 @@ test_expect_success 'autosetuprebase local on a tracked remote branch' '
 	git config remote.local.url . &&
 	git config remote.local.fetch refs/heads/*:refs/remotes/local/* &&
 	git config branch.autosetuprebase local &&
-	(git show-ref -q refs/remotes/local/master || git fetch local) &&
-	git branch --track myr5 local/master &&
+	(git show-ref -q refs/remotes/local/main || git fetch local) &&
+	git branch --track myr5 local/main &&
 	test "$(git config branch.myr5.remote)" = local &&
-	test "$(git config branch.myr5.merge)" = refs/heads/master &&
+	test "$(git config branch.myr5.merge)" = refs/heads/main &&
 	! test "$(git config branch.myr5.rebase)" = true
 '
 
@@ -1060,10 +1060,10 @@ test_expect_success 'autosetuprebase never on a tracked remote branch' '
 	git config remote.local.url . &&
 	git config remote.local.fetch refs/heads/*:refs/remotes/local/* &&
 	git config branch.autosetuprebase never &&
-	(git show-ref -q refs/remotes/local/master || git fetch local) &&
-	git branch --track myr6 local/master &&
+	(git show-ref -q refs/remotes/local/main || git fetch local) &&
+	git branch --track myr6 local/main &&
 	test "$(git config branch.myr6.remote)" = local &&
-	test "$(git config branch.myr6.merge)" = refs/heads/master &&
+	test "$(git config branch.myr6.merge)" = refs/heads/main &&
 	! test "$(git config branch.myr6.rebase)" = true
 '
 
@@ -1071,10 +1071,10 @@ test_expect_success 'autosetuprebase remote on a tracked remote branch' '
 	git config remote.local.url . &&
 	git config remote.local.fetch refs/heads/*:refs/remotes/local/* &&
 	git config branch.autosetuprebase remote &&
-	(git show-ref -q refs/remotes/local/master || git fetch local) &&
-	git branch --track myr7 local/master &&
+	(git show-ref -q refs/remotes/local/main || git fetch local) &&
+	git branch --track myr7 local/main &&
 	test "$(git config branch.myr7.remote)" = local &&
-	test "$(git config branch.myr7.merge)" = refs/heads/master &&
+	test "$(git config branch.myr7.merge)" = refs/heads/main &&
 	test "$(git config branch.myr7.rebase)" = true
 '
 
@@ -1082,10 +1082,10 @@ test_expect_success 'autosetuprebase always on a tracked remote branch' '
 	git config remote.local.url . &&
 	git config remote.local.fetch refs/heads/*:refs/remotes/local/* &&
 	git config branch.autosetuprebase remote &&
-	(git show-ref -q refs/remotes/local/master || git fetch local) &&
-	git branch --track myr8 local/master &&
+	(git show-ref -q refs/remotes/local/main || git fetch local) &&
+	git branch --track myr8 local/main &&
 	test "$(git config branch.myr8.remote)" = local &&
-	test "$(git config branch.myr8.merge)" = refs/heads/master &&
+	test "$(git config branch.myr8.merge)" = refs/heads/main &&
 	test "$(git config branch.myr8.rebase)" = true
 '
 
@@ -1093,10 +1093,10 @@ test_expect_success 'autosetuprebase unconfigured on a tracked remote branch' '
 	git config --unset branch.autosetuprebase &&
 	git config remote.local.url . &&
 	git config remote.local.fetch refs/heads/*:refs/remotes/local/* &&
-	(git show-ref -q refs/remotes/local/master || git fetch local) &&
-	git branch --track myr9 local/master &&
+	(git show-ref -q refs/remotes/local/main || git fetch local) &&
+	git branch --track myr9 local/main &&
 	test "$(git config branch.myr9.remote)" = local &&
-	test "$(git config branch.myr9.merge)" = refs/heads/master &&
+	test "$(git config branch.myr9.merge)" = refs/heads/main &&
 	test "z$(git config branch.myr9.rebase)" = z
 '
 
@@ -1114,7 +1114,7 @@ test_expect_success 'autosetuprebase unconfigured on a tracked local branch' '
 test_expect_success 'autosetuprebase unconfigured on untracked local branch' '
 	git config remote.local.url . &&
 	git config remote.local.fetch refs/heads/*:refs/remotes/local/* &&
-	(git show-ref -q refs/remotes/local/master || git fetch local) &&
+	(git show-ref -q refs/remotes/local/main || git fetch local) &&
 	git branch --no-track myr11 mybase2 &&
 	test "z$(git config branch.myr11.remote)" = z &&
 	test "z$(git config branch.myr11.merge)" = z &&
@@ -1124,8 +1124,8 @@ test_expect_success 'autosetuprebase unconfigured on untracked local branch' '
 test_expect_success 'autosetuprebase unconfigured on untracked remote branch' '
 	git config remote.local.url . &&
 	git config remote.local.fetch refs/heads/*:refs/remotes/local/* &&
-	(git show-ref -q refs/remotes/local/master || git fetch local) &&
-	git branch --no-track myr12 local/master &&
+	(git show-ref -q refs/remotes/local/main || git fetch local) &&
+	git branch --no-track myr12 local/main &&
 	test "z$(git config branch.myr12.remote)" = z &&
 	test "z$(git config branch.myr12.merge)" = z &&
 	test "z$(git config branch.myr12.rebase)" = z
@@ -1135,7 +1135,7 @@ test_expect_success 'autosetuprebase never on an untracked local branch' '
 	git config branch.autosetuprebase never &&
 	git config remote.local.url . &&
 	git config remote.local.fetch refs/heads/*:refs/remotes/local/* &&
-	(git show-ref -q refs/remotes/local/master || git fetch local) &&
+	(git show-ref -q refs/remotes/local/main || git fetch local) &&
 	git branch --no-track myr13 mybase2 &&
 	test "z$(git config branch.myr13.remote)" = z &&
 	test "z$(git config branch.myr13.merge)" = z &&
@@ -1146,7 +1146,7 @@ test_expect_success 'autosetuprebase local on an untracked local branch' '
 	git config branch.autosetuprebase local &&
 	git config remote.local.url . &&
 	git config remote.local.fetch refs/heads/*:refs/remotes/local/* &&
-	(git show-ref -q refs/remotes/local/master || git fetch local) &&
+	(git show-ref -q refs/remotes/local/main || git fetch local) &&
 	git branch --no-track myr14 mybase2 &&
 	test "z$(git config branch.myr14.remote)" = z &&
 	test "z$(git config branch.myr14.merge)" = z &&
@@ -1157,7 +1157,7 @@ test_expect_success 'autosetuprebase remote on an untracked local branch' '
 	git config branch.autosetuprebase remote &&
 	git config remote.local.url . &&
 	git config remote.local.fetch refs/heads/*:refs/remotes/local/* &&
-	(git show-ref -q refs/remotes/local/master || git fetch local) &&
+	(git show-ref -q refs/remotes/local/main || git fetch local) &&
 	git branch --no-track myr15 mybase2 &&
 	test "z$(git config branch.myr15.remote)" = z &&
 	test "z$(git config branch.myr15.merge)" = z &&
@@ -1168,7 +1168,7 @@ test_expect_success 'autosetuprebase always on an untracked local branch' '
 	git config branch.autosetuprebase always &&
 	git config remote.local.url . &&
 	git config remote.local.fetch refs/heads/*:refs/remotes/local/* &&
-	(git show-ref -q refs/remotes/local/master || git fetch local) &&
+	(git show-ref -q refs/remotes/local/main || git fetch local) &&
 	git branch --no-track myr16 mybase2 &&
 	test "z$(git config branch.myr16.remote)" = z &&
 	test "z$(git config branch.myr16.merge)" = z &&
@@ -1179,8 +1179,8 @@ test_expect_success 'autosetuprebase never on an untracked remote branch' '
 	git config branch.autosetuprebase never &&
 	git config remote.local.url . &&
 	git config remote.local.fetch refs/heads/*:refs/remotes/local/* &&
-	(git show-ref -q refs/remotes/local/master || git fetch local) &&
-	git branch --no-track myr17 local/master &&
+	(git show-ref -q refs/remotes/local/main || git fetch local) &&
+	git branch --no-track myr17 local/main &&
 	test "z$(git config branch.myr17.remote)" = z &&
 	test "z$(git config branch.myr17.merge)" = z &&
 	test "z$(git config branch.myr17.rebase)" = z
@@ -1190,8 +1190,8 @@ test_expect_success 'autosetuprebase local on an untracked remote branch' '
 	git config branch.autosetuprebase local &&
 	git config remote.local.url . &&
 	git config remote.local.fetch refs/heads/*:refs/remotes/local/* &&
-	(git show-ref -q refs/remotes/local/master || git fetch local) &&
-	git branch --no-track myr18 local/master &&
+	(git show-ref -q refs/remotes/local/main || git fetch local) &&
+	git branch --no-track myr18 local/main &&
 	test "z$(git config branch.myr18.remote)" = z &&
 	test "z$(git config branch.myr18.merge)" = z &&
 	test "z$(git config branch.myr18.rebase)" = z
@@ -1201,8 +1201,8 @@ test_expect_success 'autosetuprebase remote on an untracked remote branch' '
 	git config branch.autosetuprebase remote &&
 	git config remote.local.url . &&
 	git config remote.local.fetch refs/heads/*:refs/remotes/local/* &&
-	(git show-ref -q refs/remotes/local/master || git fetch local) &&
-	git branch --no-track myr19 local/master &&
+	(git show-ref -q refs/remotes/local/main || git fetch local) &&
+	git branch --no-track myr19 local/main &&
 	test "z$(git config branch.myr19.remote)" = z &&
 	test "z$(git config branch.myr19.merge)" = z &&
 	test "z$(git config branch.myr19.rebase)" = z
@@ -1212,8 +1212,8 @@ test_expect_success 'autosetuprebase always on an untracked remote branch' '
 	git config branch.autosetuprebase always &&
 	git config remote.local.url . &&
 	git config remote.local.fetch refs/heads/*:refs/remotes/local/* &&
-	(git show-ref -q refs/remotes/local/master || git fetch local) &&
-	git branch --no-track myr20 local/master &&
+	(git show-ref -q refs/remotes/local/main || git fetch local) &&
+	git branch --no-track myr20 local/main &&
 	test "z$(git config branch.myr20.remote)" = z &&
 	test "z$(git config branch.myr20.merge)" = z &&
 	test "z$(git config branch.myr20.rebase)" = z
@@ -1221,7 +1221,7 @@ test_expect_success 'autosetuprebase always on an untracked remote branch' '
 
 test_expect_success 'autosetuprebase always on detached HEAD' '
 	git config branch.autosetupmerge always &&
-	test_when_finished git checkout master &&
+	test_when_finished git checkout main &&
 	git checkout HEAD^0 &&
 	git branch my11 &&
 	test -z "$(git config branch.my11.remote)" &&
@@ -1249,18 +1249,18 @@ test_expect_success 'attempt to delete a branch without base and unmerged to HEA
 test_expect_success 'attempt to delete a branch merged to its base' '
 	# we are on my9 which is the initial commit; traditionally
 	# we would not have allowed deleting my8 that is not merged
-	# to my9, but it is set to track master that already has my8
-	git config branch.my8.merge refs/heads/master &&
+	# to my9, but it is set to track main that already has my8
+	git config branch.my8.merge refs/heads/main &&
 	git branch -d my8
 '
 
 test_expect_success 'attempt to delete a branch merged to its base' '
-	git checkout master &&
+	git checkout main &&
 	echo Third >>A &&
 	git commit -m "Third commit" A &&
 	git branch -t my10 my9 &&
 	git branch -f my10 HEAD^ &&
-	# we are on master which is at the third commit, and my10
+	# we are on main which is at the third commit, and my10
 	# is behind us, so traditionally we would have allowed deleting
 	# it; but my10 is set to track my9 that is further behind.
 	test_must_fail git branch -d my10
@@ -1287,7 +1287,7 @@ test_expect_success 'detect typo in branch name when using --edit-description' '
 '
 
 test_expect_success 'refuse --edit-description on unborn branch for now' '
-	test_when_finished "git checkout master" &&
+	test_when_finished "git checkout main" &&
 	write_script editor <<-\EOF &&
 		echo "New contents" >"$1"
 	EOF
@@ -1301,18 +1301,18 @@ test_expect_success '--merged catches invalid object names' '
 
 test_expect_success '--list during rebase' '
 	test_when_finished "reset_rebase" &&
-	git checkout master &&
+	git checkout main &&
 	FAKE_LINES="1 edit 2" &&
 	export FAKE_LINES &&
 	set_fake_editor &&
 	git rebase -i HEAD~2 &&
 	git branch --list >actual &&
-	test_i18ngrep "rebasing master" actual
+	test_i18ngrep "rebasing main" actual
 '
 
 test_expect_success '--list during rebase from detached HEAD' '
-	test_when_finished "reset_rebase && git checkout master" &&
-	git checkout master^0 &&
+	test_when_finished "reset_rebase && git checkout main" &&
+	git checkout main^0 &&
 	oid=$(git rev-parse --short HEAD) &&
 	FAKE_LINES="1 edit 2" &&
 	export FAKE_LINES &&
@@ -1348,11 +1348,11 @@ test_expect_success 'tracking with unexpected .fetch refspec' '
 		git remote add c ../c &&
 		git config remote.c.fetch "+refs/remotes/*:refs/remotes/*" &&
 		git fetch c &&
-		git branch --track local/a/master remotes/a/master &&
-		test "$(git config branch.local/a/master.remote)" = "c" &&
-		test "$(git config branch.local/a/master.merge)" = "refs/remotes/a/master" &&
+		git branch --track local/a/main remotes/a/main &&
+		test "$(git config branch.local/a/main.remote)" = "c" &&
+		test "$(git config branch.local/a/main.merge)" = "refs/remotes/a/main" &&
 		git rev-parse --verify a >expect &&
-		git rev-parse --verify local/a/master >actual &&
+		git rev-parse --verify local/a/main >actual &&
 		test_cmp expect actual
 	)
 '
@@ -1371,7 +1371,7 @@ test_expect_success 'configured committerdate sort' '
 		test_commit b &&
 		git branch >actual &&
 		cat >expect <<-\EOF &&
-		  master
+		  main
 		  a
 		  c
 		* b
@@ -1389,7 +1389,7 @@ test_expect_success 'option override configured sort' '
 		  a
 		* b
 		  c
-		  master
+		  main
 		EOF
 		test_cmp expect actual
 	)
diff --git a/t/t3201-branch-contains.sh b/t/t3201-branch-contains.sh
index 3733cd0091..110cfef820 100755
--- a/t/t3201-branch-contains.sh
+++ b/t/t3201-branch-contains.sh
@@ -14,47 +14,47 @@ test_expect_success setup '
 
 	echo 1 >file &&
 	test_tick &&
-	git commit -a -m "second on master" &&
+	git commit -a -m "second on main" &&
 
 	git checkout side &&
 	echo 1 >file &&
 	test_tick &&
 	git commit -a -m "second on side" &&
 
-	git merge master
+	git merge main
 
 '
 
-test_expect_success 'branch --contains=master' '
+test_expect_success 'branch --contains=main' '
 
-	git branch --contains=master >actual &&
+	git branch --contains=main >actual &&
 	{
-		echo "  master" && echo "* side"
+		echo "  main" && echo "* side"
 	} >expect &&
 	test_cmp expect actual
 
 '
 
-test_expect_success 'branch --contains master' '
+test_expect_success 'branch --contains main' '
 
-	git branch --contains master >actual &&
+	git branch --contains main >actual &&
 	{
-		echo "  master" && echo "* side"
+		echo "  main" && echo "* side"
 	} >expect &&
 	test_cmp expect actual
 
 '
 
-test_expect_success 'branch --no-contains=master' '
+test_expect_success 'branch --no-contains=main' '
 
-	git branch --no-contains=master >actual &&
+	git branch --no-contains=main >actual &&
 	test_must_be_empty actual
 
 '
 
-test_expect_success 'branch --no-contains master' '
+test_expect_success 'branch --no-contains main' '
 
-	git branch --no-contains master >actual &&
+	git branch --no-contains main >actual &&
 	test_must_be_empty actual
 
 '
@@ -73,7 +73,7 @@ test_expect_success 'branch --no-contains=side' '
 
 	git branch --no-contains=side >actual &&
 	{
-		echo "  master"
+		echo "  main"
 	} >expect &&
 	test_cmp expect actual
 
@@ -81,9 +81,9 @@ test_expect_success 'branch --no-contains=side' '
 
 test_expect_success 'branch --contains with pattern implies --list' '
 
-	git branch --contains=master master >actual &&
+	git branch --contains=main main >actual &&
 	{
-		echo "  master"
+		echo "  main"
 	} >expect &&
 	test_cmp expect actual
 
@@ -91,7 +91,7 @@ test_expect_success 'branch --contains with pattern implies --list' '
 
 test_expect_success 'branch --no-contains with pattern implies --list' '
 
-	git branch --no-contains=master master >actual &&
+	git branch --no-contains=main main >actual &&
 	test_must_be_empty actual
 
 '
@@ -100,7 +100,7 @@ test_expect_success 'side: branch --merged' '
 
 	git branch --merged >actual &&
 	{
-		echo "  master" &&
+		echo "  main" &&
 		echo "* side"
 	} >expect &&
 	test_cmp expect actual
@@ -109,9 +109,9 @@ test_expect_success 'side: branch --merged' '
 
 test_expect_success 'branch --merged with pattern implies --list' '
 
-	git branch --merged=side master >actual &&
+	git branch --merged=side main >actual &&
 	{
-		echo "  master"
+		echo "  main"
 	} >expect &&
 	test_cmp expect actual
 
@@ -124,18 +124,18 @@ test_expect_success 'side: branch --no-merged' '
 
 '
 
-test_expect_success 'master: branch --merged' '
+test_expect_success 'main: branch --merged' '
 
-	git checkout master &&
+	git checkout main &&
 	git branch --merged >actual &&
 	{
-		echo "* master"
+		echo "* main"
 	} >expect &&
 	test_cmp expect actual
 
 '
 
-test_expect_success 'master: branch --no-merged' '
+test_expect_success 'main: branch --no-merged' '
 
 	git branch --no-merged >actual &&
 	{
@@ -147,22 +147,22 @@ test_expect_success 'master: branch --no-merged' '
 
 test_expect_success 'branch --no-merged with pattern implies --list' '
 
-	git branch --no-merged=master master >actual &&
+	git branch --no-merged=main main >actual &&
 	test_must_be_empty actual
 
 '
 
 test_expect_success 'implicit --list conflicts with modification options' '
 
-	test_must_fail git branch --contains=master -d &&
-	test_must_fail git branch --contains=master -m foo &&
-	test_must_fail git branch --no-contains=master -d &&
-	test_must_fail git branch --no-contains=master -m foo
+	test_must_fail git branch --contains=main -d &&
+	test_must_fail git branch --contains=main -m foo &&
+	test_must_fail git branch --no-contains=main -d &&
+	test_must_fail git branch --no-contains=main -m foo
 
 '
 
 test_expect_success 'Assert that --contains only works on commits, not trees & blobs' '
-	test_must_fail git branch --contains master^{tree} &&
+	test_must_fail git branch --contains main^{tree} &&
 	blob=$(git hash-object -w --stdin <<-\EOF
 	Some blob
 	EOF
@@ -172,11 +172,11 @@ test_expect_success 'Assert that --contains only works on commits, not trees & b
 '
 
 test_expect_success 'multiple branch --contains' '
-	git checkout -b side2 master &&
+	git checkout -b side2 main &&
 	>feature &&
 	git add feature &&
 	git commit -m "add feature" &&
-	git checkout -b next master &&
+	git checkout -b next main &&
 	git merge side &&
 	git branch --contains side --contains side2 >actual &&
 	cat >expect <<-\EOF &&
@@ -188,9 +188,9 @@ test_expect_success 'multiple branch --contains' '
 '
 
 test_expect_success 'multiple branch --merged' '
-	git branch --merged next --merged master >actual &&
+	git branch --merged next --merged main >actual &&
 	cat >expect <<-\EOF &&
-	  master
+	  main
 	* next
 	  side
 	EOF
@@ -200,13 +200,13 @@ test_expect_success 'multiple branch --merged' '
 test_expect_success 'multiple branch --no-contains' '
 	git branch --no-contains side --no-contains side2 >actual &&
 	cat >expect <<-\EOF &&
-	  master
+	  main
 	EOF
 	test_cmp expect actual
 '
 
 test_expect_success 'multiple branch --no-merged' '
-	git branch --no-merged next --no-merged master >actual &&
+	git branch --no-merged next --no-merged main >actual &&
 	cat >expect <<-\EOF &&
 	  side2
 	EOF
@@ -214,7 +214,7 @@ test_expect_success 'multiple branch --no-merged' '
 '
 
 test_expect_success 'branch --contains combined with --no-contains' '
-	git checkout -b seen master &&
+	git checkout -b seen main &&
 	git merge side &&
 	git merge side2 &&
 	git branch --contains side --no-contains side2 >actual &&
@@ -239,17 +239,17 @@ test_expect_success 'branch --merged combined with --no-merged' '
 # that the latter walk does not mess up our flag to see if it was
 # merged).
 #
-# Here "topic" tracks "master" with one extra commit, and "zzz" points to the
-# same tip as master The name "zzz" must come alphabetically after "topic"
+# Here "topic" tracks "main" with one extra commit, and "zzz" points to the
+# same tip as main The name "zzz" must come alphabetically after "topic"
 # as we process them in that order.
 test_expect_success PREPARE_FOR_MAIN_BRANCH 'branch --merged with --verbose' '
-	git branch --track topic master &&
+	git branch --track topic main &&
 	git branch zzz topic &&
 	git checkout topic &&
 	test_commit foo &&
 	git branch --merged topic >actual &&
 	cat >expect <<-\EOF &&
-	  master
+	  main
 	* topic
 	  zzz
 	EOF
diff --git a/t/t3202-show-branch-octopus.sh b/t/t3202-show-branch-octopus.sh
index 6adf47869c..97551016ad 100755
--- a/t/t3202-show-branch-octopus.sh
+++ b/t/t3202-show-branch-octopus.sh
@@ -15,7 +15,7 @@ test_expect_success 'setup' '
 
 	for i in $numbers
 	do
-		git checkout -b branch$i master &&
+		git checkout -b branch$i main &&
 		> file$i &&
 		git add file$i &&
 		test_tick &&
diff --git a/t/t3203-branch-output.sh b/t/t3203-branch-output.sh
index d65586541d..727c9d9caa 100755
--- a/t/t3203-branch-output.sh
+++ b/t/t3203-branch-output.sh
@@ -26,7 +26,7 @@ test_expect_success 'make remote branches' '
 cat >expect <<'EOF'
   branch-one
   branch-two
-* master
+* main
 EOF
 test_expect_success 'git branch shows local branches' '
 	git branch >actual &&
@@ -60,7 +60,7 @@ test_expect_success 'git branch -r shows remote branches' '
 cat >expect <<'EOF'
   branch-one
   branch-two
-* master
+* main
   remotes/origin/HEAD -> origin/branch-one
   remotes/origin/branch-one
   remotes/origin/branch-two
@@ -152,7 +152,7 @@ test_expect_success 'git branch shows detached HEAD properly' '
 * (HEAD detached at $(git rev-parse --short HEAD^0))
   branch-one
   branch-two
-  master
+  main
 EOF
 	git checkout HEAD^0 &&
 	git branch >actual &&
@@ -160,12 +160,12 @@ EOF
 '
 
 test_expect_success 'git branch shows detached HEAD properly after checkout --detach' '
-	git checkout master &&
+	git checkout main &&
 	cat >expect <<EOF &&
 * (HEAD detached at $(git rev-parse --short HEAD^0))
   branch-one
   branch-two
-  master
+  main
 EOF
 	git checkout --detach &&
 	git branch >actual &&
@@ -177,7 +177,7 @@ test_expect_success 'git branch shows detached HEAD properly after moving' '
 * (HEAD detached from $(git rev-parse --short HEAD))
   branch-one
   branch-two
-  master
+  main
 EOF
 	git reset --hard HEAD^1 &&
 	git branch >actual &&
@@ -189,9 +189,9 @@ test_expect_success 'git branch shows detached HEAD properly from tag' '
 * (HEAD detached at fromtag)
   branch-one
   branch-two
-  master
+  main
 EOF
-	git tag fromtag master &&
+	git tag fromtag main &&
 	git checkout fromtag &&
 	git branch >actual &&
 	test_i18ncmp expect actual
@@ -202,7 +202,7 @@ test_expect_success 'git branch shows detached HEAD properly after moving from t
 * (HEAD detached from fromtag)
   branch-one
   branch-two
-  master
+  main
 EOF
 	git reset --hard HEAD^1 &&
 	git branch >actual &&
@@ -214,7 +214,7 @@ test_expect_success 'git branch `--sort` option' '
 	* (HEAD detached from fromtag)
 	  branch-two
 	  branch-one
-	  master
+	  main
 	EOF
 	git branch --sort=objectsize >actual &&
 	test_i18ncmp expect actual
@@ -223,7 +223,7 @@ test_expect_success 'git branch `--sort` option' '
 test_expect_success 'git branch --points-at option' '
 	cat >expect <<-\EOF &&
 	  branch-one
-	  master
+	  main
 	EOF
 	git branch --points-at=branch-one >actual &&
 	test_cmp expect actual
@@ -260,14 +260,14 @@ test_expect_success 'sort branches, ignore case' '
 		cat >expected <<-\EOF &&
 		BRANCH-two
 		branch-one
-		master
+		main
 		EOF
 		test_cmp expected actual &&
 		git branch --list -i | awk "{print \$NF}" >actual &&
 		cat >expected <<-\EOF &&
 		branch-one
 		BRANCH-two
-		master
+		main
 		EOF
 		test_cmp expected actual
 	)
@@ -279,7 +279,7 @@ test_expect_success 'git branch --format option' '
 	Refname is refs/heads/ambiguous
 	Refname is refs/heads/branch-one
 	Refname is refs/heads/branch-two
-	Refname is refs/heads/master
+	Refname is refs/heads/main
 	Refname is refs/heads/ref-to-branch
 	Refname is refs/heads/ref-to-remote
 	EOF
@@ -293,7 +293,7 @@ test_expect_success 'worktree colors correct' '
 	  ambiguous<RESET>
 	  branch-one<RESET>
 	+ <CYAN>branch-two<RESET>
-	  master<RESET>
+	  main<RESET>
 	  ref-to-branch<RESET> -> branch-one
 	  ref-to-remote<RESET> -> origin/branch-one
 	EOF
@@ -306,9 +306,9 @@ test_expect_success 'worktree colors correct' '
 '
 
 test_expect_success "set up color tests" '
-	echo "<RED>master<RESET>" >expect.color &&
-	echo "master" >expect.bare &&
-	color_args="--format=%(color:red)%(refname:short) --list master"
+	echo "<RED>main<RESET>" >expect.color &&
+	echo "main" >expect.bare &&
+	color_args="--format=%(color:red)%(refname:short) --list main"
 '
 
 test_expect_success '%(color) omitted without tty' '
@@ -331,7 +331,7 @@ test_expect_success '--color overrides auto-color' '
 
 test_expect_success PREPARE_FOR_MAIN_BRANCH 'verbose output lists worktree path' '
 	one=$(git rev-parse --short HEAD) &&
-	two=$(git rev-parse --short master) &&
+	two=$(git rev-parse --short main) &&
 	cat >expect <<-EOF &&
 	* (HEAD detached from fromtag) $one one
 	  ambiguous                    $one one
diff --git a/t/t3204-branch-name-interpretation.sh b/t/t3204-branch-name-interpretation.sh
index 698d9cc4f3..e527e0b0c9 100755
--- a/t/t3204-branch-name-interpretation.sh
+++ b/t/t3204-branch-name-interpretation.sh
@@ -28,7 +28,7 @@ test_expect_success 'update branch via @{-1}' '
 	git branch previous one &&
 
 	git checkout previous &&
-	git checkout master &&
+	git checkout main &&
 
 	git branch -f @{-1} two &&
 	expect_branch previous two
@@ -58,7 +58,7 @@ test_expect_success 'delete branch via @{-1}' '
 	git branch previous-del &&
 
 	git checkout previous-del &&
-	git checkout master &&
+	git checkout main &&
 
 	git branch -D @{-1} &&
 	expect_deleted previous-del
@@ -98,7 +98,7 @@ test_expect_success 'disallow deleting remote branch via @{-1}' '
 	git update-ref refs/remotes/origin/previous one &&
 
 	git checkout -b origin/previous two &&
-	git checkout master &&
+	git checkout main &&
 
 	test_must_fail git branch -r -D @{-1} &&
 	expect_branch refs/remotes/origin/previous one &&
diff --git a/t/t3205-branch-color.sh b/t/t3205-branch-color.sh
index 289625c464..9f2fb785d2 100755
--- a/t/t3205-branch-color.sh
+++ b/t/t3205-branch-color.sh
@@ -5,7 +5,7 @@ test_description='basic branch output coloring'
 
 test_expect_success 'set up some sample branches' '
 	test_commit foo &&
-	git update-ref refs/remotes/origin/master HEAD &&
+	git update-ref refs/remotes/origin/main HEAD &&
 	git update-ref refs/heads/other HEAD
 '
 
@@ -19,9 +19,9 @@ test_expect_success 'set up some color config' '
 
 test_expect_success 'regular output shows colors' '
 	cat >expect <<-\EOF &&
-	* <CYAN>master<RESET>
+	* <CYAN>main<RESET>
 	  <BLUE>other<RESET>
-	  <YELLOW>remotes/origin/master<RESET>
+	  <YELLOW>remotes/origin/main<RESET>
 	EOF
 	git branch --color -a >actual.raw &&
 	test_decode_color <actual.raw >actual &&
diff --git a/t/t3206-range-diff.sh b/t/t3206-range-diff.sh
index 6eb344be03..2813a362c7 100755
--- a/t/t3206-range-diff.sh
+++ b/t/t3206-range-diff.sh
@@ -127,7 +127,7 @@ test_expect_success 'setup' '
 '
 
 test_expect_success 'simple A..B A..C (unmodified)' '
-	git range-diff --no-color master..topic master..unmodified \
+	git range-diff --no-color main..topic main..unmodified \
 		>actual &&
 	cat >expect <<-EOF &&
 	1:  $(test_oid t1) = 1:  $(test_oid u1) s/5/A/
@@ -145,13 +145,13 @@ test_expect_success 'simple B...C (unmodified)' '
 '
 
 test_expect_success 'simple A B C (unmodified)' '
-	git range-diff --no-color master topic unmodified >actual &&
+	git range-diff --no-color main topic unmodified >actual &&
 	# same "expect" as above
 	test_cmp expect actual
 '
 
 test_expect_success 'trivial reordering' '
-	git range-diff --no-color master topic reordered >actual &&
+	git range-diff --no-color main topic reordered >actual &&
 	cat >expect <<-EOF &&
 	1:  $(test_oid t1) = 1:  $(test_oid r1) s/5/A/
 	3:  $(test_oid t3) = 2:  $(test_oid r2) s/11/B/
@@ -162,7 +162,7 @@ test_expect_success 'trivial reordering' '
 '
 
 test_expect_success 'removed a commit' '
-	git range-diff --no-color master topic removed >actual &&
+	git range-diff --no-color main topic removed >actual &&
 	cat >expect <<-EOF &&
 	1:  $(test_oid t1) = 1:  $(test_oid d1) s/5/A/
 	2:  $(test_oid t2) < -:  $(test_oid __) s/4/A/
@@ -173,7 +173,7 @@ test_expect_success 'removed a commit' '
 '
 
 test_expect_success 'added a commit' '
-	git range-diff --no-color master topic added >actual &&
+	git range-diff --no-color main topic added >actual &&
 	cat >expect <<-EOF &&
 	1:  $(test_oid t1) = 1:  $(test_oid a1) s/5/A/
 	2:  $(test_oid t2) = 2:  $(test_oid a2) s/4/A/
@@ -185,7 +185,7 @@ test_expect_success 'added a commit' '
 '
 
 test_expect_success 'new base, A B C' '
-	git range-diff --no-color master topic rebased >actual &&
+	git range-diff --no-color main topic rebased >actual &&
 	cat >expect <<-EOF &&
 	1:  $(test_oid t1) = 1:  $(test_oid b1) s/5/A/
 	2:  $(test_oid t2) = 2:  $(test_oid b2) s/4/A/
@@ -196,7 +196,7 @@ test_expect_success 'new base, A B C' '
 '
 
 test_expect_success 'new base, B...C' '
-	# this syntax includes the commits from master!
+	# this syntax includes the commits from main!
 	git range-diff --no-color topic...rebased >actual &&
 	cat >expect <<-EOF &&
 	-:  $(test_oid __) > 1:  $(test_oid b5) unrelated
@@ -420,7 +420,7 @@ test_expect_success 'file added and later removed' '
 
 test_expect_success 'no commits on one side' '
 	git commit --amend -m "new message" &&
-	git range-diff master HEAD@{1} HEAD
+	git range-diff main HEAD@{1} HEAD
 '
 
 test_expect_success 'changed message' '
@@ -482,11 +482,11 @@ test_expect_success 'dual-coloring' '
 	test_cmp expect actual
 '
 
-for prev in topic master..topic
+for prev in topic main..topic
 do
 	test_expect_success "format-patch --range-diff=$prev" '
 		git format-patch --cover-letter --range-diff=$prev \
-			master..unmodified >actual &&
+			main..unmodified >actual &&
 		test_when_finished "rm 000?-*" &&
 		test_line_count = 5 actual &&
 		test_i18ngrep "^Range-diff:$" 0000-* &&
@@ -511,19 +511,19 @@ test_expect_success 'range-diff overrides diff.noprefix internally' '
 
 test_expect_success 'basic with modified format.pretty with suffix' '
 	git -c format.pretty="format:commit %H%d%n" range-diff \
-		master..topic master..unmodified
+		main..topic main..unmodified
 '
 
 test_expect_success 'basic with modified format.pretty without "commit "' '
 	git -c format.pretty="format:%H%n" range-diff \
-		master..topic master..unmodified
+		main..topic main..unmodified
 '
 
 test_expect_success 'range-diff compares notes by default' '
 	git notes add -m "topic note" topic &&
 	git notes add -m "unmodified note" unmodified &&
 	test_when_finished git notes remove topic unmodified &&
-	git range-diff --no-color master..topic master..unmodified \
+	git range-diff --no-color main..topic main..unmodified \
 		>actual &&
 	sed s/Z/\ /g >expect <<-EOF &&
 	1:  $(test_oid t1) = 1:  $(test_oid u1) s/5/A/
@@ -547,7 +547,7 @@ test_expect_success 'range-diff with --no-notes' '
 	git notes add -m "topic note" topic &&
 	git notes add -m "unmodified note" unmodified &&
 	test_when_finished git notes remove topic unmodified &&
-	git range-diff --no-color --no-notes master..topic master..unmodified \
+	git range-diff --no-color --no-notes main..topic main..unmodified \
 		>actual &&
 	cat >expect <<-EOF &&
 	1:  $(test_oid t1) = 1:  $(test_oid u1) s/5/A/
@@ -565,7 +565,7 @@ test_expect_success 'range-diff with multiple --notes' '
 	git notes --ref=note2 add -m "topic note2" topic &&
 	git notes --ref=note2 add -m "unmodified note2" unmodified &&
 	test_when_finished git notes --ref=note2 remove topic unmodified &&
-	git range-diff --no-color --notes=note1 --notes=note2 master..topic master..unmodified \
+	git range-diff --no-color --notes=note1 --notes=note2 main..topic main..unmodified \
 		>actual &&
 	sed s/Z/\ /g >expect <<-EOF &&
 	1:  $(test_oid t1) = 1:  $(test_oid u1) s/5/A/
@@ -595,7 +595,7 @@ test_expect_success 'format-patch --range-diff does not compare notes by default
 	git notes add -m "unmodified note" unmodified &&
 	test_when_finished git notes remove topic unmodified &&
 	git format-patch --cover-letter --range-diff=$prev \
-		master..unmodified >actual &&
+		main..unmodified >actual &&
 	test_when_finished "rm 000?-*" &&
 	test_line_count = 5 actual &&
 	test_i18ngrep "^Range-diff:$" 0000-* &&
@@ -612,7 +612,7 @@ test_expect_success 'format-patch --range-diff with --no-notes' '
 	git notes add -m "unmodified note" unmodified &&
 	test_when_finished git notes remove topic unmodified &&
 	git format-patch --no-notes --cover-letter --range-diff=$prev \
-		master..unmodified >actual &&
+		main..unmodified >actual &&
 	test_when_finished "rm 000?-*" &&
 	test_line_count = 5 actual &&
 	test_i18ngrep "^Range-diff:$" 0000-* &&
@@ -629,7 +629,7 @@ test_expect_success 'format-patch --range-diff with --notes' '
 	git notes add -m "unmodified note" unmodified &&
 	test_when_finished git notes remove topic unmodified &&
 	git format-patch --notes --cover-letter --range-diff=$prev \
-		master..unmodified >actual &&
+		main..unmodified >actual &&
 	test_when_finished "rm 000?-*" &&
 	test_line_count = 5 actual &&
 	test_i18ngrep "^Range-diff:$" 0000-* &&
@@ -658,7 +658,7 @@ test_expect_success 'format-patch --range-diff with format.notes config' '
 	test_when_finished git notes remove topic unmodified &&
 	test_config format.notes true &&
 	git format-patch --cover-letter --range-diff=$prev \
-		master..unmodified >actual &&
+		main..unmodified >actual &&
 	test_when_finished "rm 000?-*" &&
 	test_line_count = 5 actual &&
 	test_i18ngrep "^Range-diff:$" 0000-* &&
@@ -689,7 +689,7 @@ test_expect_success 'format-patch --range-diff with multiple notes' '
 	git notes --ref=note2 add -m "unmodified note2" unmodified &&
 	test_when_finished git notes --ref=note2 remove topic unmodified &&
 	git format-patch --notes=note1 --notes=note2 --cover-letter --range-diff=$prev \
-		master..unmodified >actual &&
+		main..unmodified >actual &&
 	test_when_finished "rm 000?-*" &&
 	test_line_count = 5 actual &&
 	test_i18ngrep "^Range-diff:$" 0000-* &&
diff --git a/t/t3206/history.export b/t/t3206/history.export
index 4c808e5b3b..4485adc37b 100644
--- a/t/t3206/history.export
+++ b/t/t3206/history.export
@@ -168,7 +168,7 @@ mark :11
 data 10
 unrelated
 
-commit refs/heads/master
+commit refs/heads/main
 mark :12
 author Thomas Rast <trast@inf.ethz.ch> 1374485127 +0200
 committer Thomas Rast <trast@inf.ethz.ch> 1374485127 +0200
diff --git a/t/t3210-pack-refs.sh b/t/t3210-pack-refs.sh
index f41b2afb99..a0b188fa4d 100755
--- a/t/t3210-pack-refs.sh
+++ b/t/t3210-pack-refs.sh
@@ -135,7 +135,7 @@ test_expect_success 'delete ref with dangling packed version' '
 	git commit --allow-empty -m "future garbage" &&
 	git pack-refs --all &&
 	git reset --hard HEAD^ &&
-	git checkout master &&
+	git checkout main &&
 	git reflog expire --expire=all --all &&
 	git prune --expire=all &&
 	git branch -d lamb 2>result &&
@@ -240,7 +240,7 @@ test_expect_success 'retry acquiring packed-refs.lock' '
 
 test_expect_success SYMLINKS 'pack symlinked packed-refs' '
 	# First make sure that symlinking works when reading:
-	git update-ref refs/heads/lossy refs/heads/master &&
+	git update-ref refs/heads/lossy refs/heads/main &&
 	git for-each-ref >all-refs-before &&
 	mv .git/packed-refs .git/my-deviant-packed-refs &&
 	ln -s my-deviant-packed-refs .git/packed-refs &&
diff --git a/t/t3211-peel-ref.sh b/t/t3211-peel-ref.sh
index 3b7caca421..73a914d194 100755
--- a/t/t3211-peel-ref.sh
+++ b/t/t3211-peel-ref.sh
@@ -19,7 +19,7 @@ print_ref() {
 
 test_expect_success 'set up expected show-ref output' '
 	{
-		print_ref "refs/heads/master" &&
+		print_ref "refs/heads/main" &&
 		print_ref "refs/outside/foo" &&
 		print_ref "refs/outside/foo^{}" &&
 		print_ref "refs/tags/base" &&
@@ -47,7 +47,7 @@ test_expect_success 'create old-style pack-refs without fully-peeled' '
 	# know we are emulating exactly what an older git would have written.
 	{
 		echo "# pack-refs with: peeled " &&
-		print_ref "refs/heads/master" &&
+		print_ref "refs/heads/main" &&
 		print_ref "refs/outside/foo" &&
 		print_ref "refs/tags/base" &&
 		print_ref "refs/tags/foo" &&
diff --git a/t/t3301-notes.sh b/t/t3301-notes.sh
index 8f43303007..2b685580b6 100755
--- a/t/t3301-notes.sh
+++ b/t/t3301-notes.sh
@@ -1295,11 +1295,11 @@ test_expect_success 'git notes copy diagnoses too many or too few parameters' '
 	test_i18ngrep "too many parameters" error
 '
 
-test_expect_success 'git notes get-ref expands refs/heads/master to refs/notes/refs/heads/master' '
+test_expect_success 'git notes get-ref expands refs/heads/main to refs/notes/refs/heads/main' '
 	test_unconfig core.notesRef &&
 	sane_unset GIT_NOTES_REF &&
-	echo refs/notes/refs/heads/master >expect &&
-	git notes --ref=refs/heads/master get-ref >actual &&
+	echo refs/notes/refs/heads/main >expect &&
+	git notes --ref=refs/heads/main get-ref >actual &&
 	test_cmp expect actual
 '
 
diff --git a/t/t3302-notes-index-expensive.sh b/t/t3302-notes-index-expensive.sh
index 7217c5e222..1c1490ca68 100755
--- a/t/t3302-notes-index-expensive.sh
+++ b/t/t3302-notes-index-expensive.sh
@@ -20,7 +20,7 @@ create_repo () {
 			notemark=$(($mark+1))
 			test_tick &&
 			cat <<-INPUT_END &&
-			commit refs/heads/master
+			commit refs/heads/main
 			mark :$mark
 			committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
 			data <<COMMIT
diff --git a/t/t3303-notes-subtrees.sh b/t/t3303-notes-subtrees.sh
index 704aee81ef..d994492469 100755
--- a/t/t3303-notes-subtrees.sh
+++ b/t/t3303-notes-subtrees.sh
@@ -40,7 +40,7 @@ test_expect_success "setup: create $number_of_commits commits" '
 			nr=$(($nr+1)) &&
 			test_tick &&
 			cat <<INPUT_END
-commit refs/heads/master
+commit refs/heads/main
 committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
 data <<COMMIT
 commit #$nr
@@ -75,7 +75,7 @@ test_sha1_based () {
 	(
 		start_note_commit &&
 		nr=$number_of_commits &&
-		git rev-list refs/heads/master |
+		git rev-list refs/heads/main |
 		while read sha1; do
 			note_path=$(echo "$sha1" | sed "$1")
 			cat <<INPUT_END &&
@@ -105,7 +105,7 @@ test_same_notes () {
 	(
 		start_note_commit &&
 		nr=$number_of_commits &&
-		git rev-list refs/heads/master |
+		git rev-list refs/heads/main |
 		while read sha1; do
 			first_note_path=$(echo "$sha1" | sed "$1")
 			second_note_path=$(echo "$sha1" | sed "$2")
@@ -144,7 +144,7 @@ test_concatenated_notes () {
 	(
 		start_note_commit &&
 		nr=$number_of_commits &&
-		git rev-list refs/heads/master |
+		git rev-list refs/heads/main |
 		while read sha1; do
 			first_note_path=$(echo "$sha1" | sed "$1")
 			second_note_path=$(echo "$sha1" | sed "$2")
diff --git a/t/t3304-notes-mixed.sh b/t/t3304-notes-mixed.sh
index 1709e8c00b..802e004016 100755
--- a/t/t3304-notes-mixed.sh
+++ b/t/t3304-notes-mixed.sh
@@ -36,7 +36,7 @@ test_expect_success "setup: create a couple of commits" '
 
 	test_tick &&
 	cat <<INPUT_END >input &&
-commit refs/heads/master
+commit refs/heads/main
 committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
 data <<COMMIT
 commit #1
@@ -51,7 +51,7 @@ INPUT_END
 
 	test_tick &&
 	cat <<INPUT_END >>input &&
-commit refs/heads/master
+commit refs/heads/main
 committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
 data <<COMMIT
 commit #2
@@ -68,8 +68,8 @@ INPUT_END
 
 test_expect_success "create a notes tree with both notes and non-notes" '
 
-	commit1=$(git rev-parse refs/heads/master^) &&
-	commit2=$(git rev-parse refs/heads/master) &&
+	commit1=$(git rev-parse refs/heads/main^) &&
+	commit2=$(git rev-parse refs/heads/main) &&
 	test_tick &&
 	cat <<INPUT_END >input &&
 commit refs/notes/commits
diff --git a/t/t3308-notes-merge.sh b/t/t3308-notes-merge.sh
index d69c84c640..202702be1a 100755
--- a/t/t3308-notes-merge.sh
+++ b/t/t3308-notes-merge.sh
@@ -108,7 +108,7 @@ test_expect_success 'fail to merge into various non-notes refs' '
 	git update-ref refs/notes/dir/foo HEAD &&
 	test_must_fail git -c "core.notesRef=refs/notes/dir" notes merge x &&
 	test_must_fail git -c "core.notesRef=refs/notes/dir/" notes merge x &&
-	test_must_fail git -c "core.notesRef=refs/heads/master" notes merge x &&
+	test_must_fail git -c "core.notesRef=refs/heads/main" notes merge x &&
 	test_must_fail git -c "core.notesRef=refs/notes/y:" notes merge x &&
 	test_must_fail git -c "core.notesRef=refs/notes/y:foo" notes merge x &&
 	test_must_fail git -c "core.notesRef=refs/notes/foo^{bar" notes merge x
diff --git a/t/t3320-notes-merge-worktrees.sh b/t/t3320-notes-merge-worktrees.sh
index 823fdbda1f..465145c487 100755
--- a/t/t3320-notes-merge-worktrees.sh
+++ b/t/t3320-notes-merge-worktrees.sh
@@ -36,8 +36,8 @@ test_expect_success 'modify notes ref ourselves (x)' '
 '
 
 test_expect_success 'create some new worktrees' '
-	git worktree add -b newbranch worktree master &&
-	git worktree add -b newbranch2 worktree2 master
+	git worktree add -b newbranch worktree main &&
+	git worktree add -b newbranch2 worktree2 main
 '
 
 test_expect_success 'merge z into y fails and sets NOTES_MERGE_REF' '
diff --git a/t/test-lib.sh b/t/test-lib.sh
index 3bb6675390..c464f8dcc8 100644
--- a/t/test-lib.sh
+++ b/t/test-lib.sh
@@ -257,7 +257,7 @@ case "$TRASH_DIRECTORY" in
 esac
 
 case "$TEST_NUMBER" in
-[0-2]*)
+[0-2]*|3[0-3]*)
 	GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 	export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 	;;
-- 
gitgitgadget


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH v2 05/27] t3416: preemptively adjust alignment in a comment
  2020-11-17 16:12 ` [PATCH v2 00/27] tests: use " Johannes Schindelin via GitGitGadget
                     ` (3 preceding siblings ...)
  2020-11-17 16:12   ` [PATCH v2 04/27] t3[0-3]*: " Johannes Schindelin via GitGitGadget
@ 2020-11-17 16:12   ` Johannes Schindelin via GitGitGadget
  2020-11-17 16:12   ` [PATCH v2 06/27] t34*: adjust the references to the default branch name "main" Johannes Schindelin via GitGitGadget
                     ` (23 subsequent siblings)
  28 siblings, 0 replies; 163+ messages in thread
From: Johannes Schindelin via GitGitGadget @ 2020-11-17 16:12 UTC (permalink / raw)
  To: git
  Cc: Felipe Contreras, Ævar Arnfjörð Bjarmason,
	Johannes Schindelin, Jeff King, Johannes Schindelin,
	Johannes Schindelin

From: Johannes Schindelin <johannes.schindelin@gmx.de>

We are about to adjust t3416 for the new default branch name `main`.
This name is two characters shorter and therefore needs two spaces more
padding to align correctly.

Adjusting the alignment before the big search-and-replace makes it
easier to verify that the final result does not leave any misaligned
lines behind.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
---
 t/t3416-rebase-onto-threedots.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/t/t3416-rebase-onto-threedots.sh b/t/t3416-rebase-onto-threedots.sh
index 9c2548423b..1f37adf56b 100755
--- a/t/t3416-rebase-onto-threedots.sh
+++ b/t/t3416-rebase-onto-threedots.sh
@@ -12,7 +12,7 @@ test_description='git rebase --onto A...B'
 #
 #	    F---G topic                             G'
 #	   /                                       /
-# A---B---C---D---E master      -->       A---B---C---D---E
+# A---B---C---D---E master        -->       A---B---C---D---E
 #      \   \ /
 #	\   x
 #	 \ / \
-- 
gitgitgadget


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH v2 06/27] t34*: adjust the references to the default branch name "main"
  2020-11-17 16:12 ` [PATCH v2 00/27] tests: use " Johannes Schindelin via GitGitGadget
                     ` (4 preceding siblings ...)
  2020-11-17 16:12   ` [PATCH v2 05/27] t3416: preemptively adjust alignment in a comment Johannes Schindelin via GitGitGadget
@ 2020-11-17 16:12   ` Johannes Schindelin via GitGitGadget
  2020-11-17 16:12   ` [PATCH v2 07/27] t3[5-9]*: " Johannes Schindelin via GitGitGadget
                     ` (22 subsequent siblings)
  28 siblings, 0 replies; 163+ messages in thread
From: Johannes Schindelin via GitGitGadget @ 2020-11-17 16:12 UTC (permalink / raw)
  To: git
  Cc: Felipe Contreras, Ævar Arnfjörð Bjarmason,
	Johannes Schindelin, Jeff King, Johannes Schindelin,
	Johannes Schindelin

From: Johannes Schindelin <johannes.schindelin@gmx.de>

Carefully excluding t3404, which sees independent development elsewhere
at the time of writing, we use `main` as the default branch name in
t34*. This trick was performed via

	$ (cd t &&
	   sed -i -e 's/master/main/g' -e 's/MASTER/MAIN/g' \
		-e 's/Master/Main/g' -- t34*.sh &&
	   git checkout HEAD -- t34\*)

This allows us to define `GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main`
for those tests.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
---
 t/t3400-rebase.sh                 | 60 +++++++++++++++----------------
 t/t3402-rebase-merge.sh           | 44 +++++++++++------------
 t/t3403-rebase-skip.sh            |  6 ++--
 t/t3405-rebase-malformed.sh       |  8 ++---
 t/t3406-rebase-message.sh         | 24 ++++++-------
 t/t3407-rebase-abort.sh           | 18 +++++-----
 t/t3408-rebase-multi-line.sh      |  2 +-
 t/t3409-rebase-preserve-merges.sh | 10 +++---
 t/t3412-rebase-root.sh            | 28 +++++++--------
 t/t3413-rebase-hook.sh            | 42 +++++++++++-----------
 t/t3415-rebase-autosquash.sh      |  2 +-
 t/t3416-rebase-onto-threedots.sh  | 54 ++++++++++++++--------------
 t/t3418-rebase-continue.sh        | 24 ++++++-------
 t/t3419-rebase-patch-id.sh        | 12 +++----
 t/t3420-rebase-autostash.sh       |  8 ++---
 t/t3423-rebase-reword.sh          |  6 ++--
 t/t3427-rebase-subtree.sh         | 20 +++++------
 t/t3430-rebase-merges.sh          | 16 ++++-----
 t/t3431-rebase-fork-point.sh      | 32 ++++++++---------
 t/t3432-rebase-fast-forward.sh    | 34 +++++++++---------
 t/t3434-rebase-i18n.sh            |  8 ++---
 t/t3435-rebase-gpg-sign.sh        |  4 +--
 t/t3436-rebase-more-options.sh    |  2 +-
 t/test-lib.sh                     |  8 ++++-
 24 files changed, 239 insertions(+), 233 deletions(-)

diff --git a/t/t3400-rebase.sh b/t/t3400-rebase.sh
index 40d2975995..cdfc7e083a 100755
--- a/t/t3400-rebase.sh
+++ b/t/t3400-rebase.sh
@@ -24,15 +24,15 @@ test_expect_success 'prepare repository with topic branches' '
 	git update-index --add Y &&
 	git commit -m "Add Y." &&
 	git checkout -b filemove &&
-	git reset --soft master &&
+	git reset --soft main &&
 	mkdir D &&
 	git mv A D/A &&
 	git commit -m "Move A." &&
-	git checkout -b my-topic-branch master &&
+	git checkout -b my-topic-branch main &&
 	echo Second >B &&
 	git update-index --add B &&
 	git commit -m "Add B." &&
-	git checkout -f master &&
+	git checkout -f main &&
 	echo Third >>A &&
 	git update-index A &&
 	git commit -m "Modify A." &&
@@ -46,23 +46,23 @@ test_expect_success 'prepare repository with topic branches' '
 
 test_expect_success 'rebase on dirty worktree' '
 	echo dirty >>A &&
-	test_must_fail git rebase master
+	test_must_fail git rebase main
 '
 
 test_expect_success 'rebase on dirty cache' '
 	git add A &&
-	test_must_fail git rebase master
+	test_must_fail git rebase main
 '
 
-test_expect_success 'rebase against master' '
+test_expect_success 'rebase against main' '
 	git reset --hard HEAD &&
-	git rebase master
+	git rebase main
 '
 
 test_expect_success 'rebase sets ORIG_HEAD to pre-rebase state' '
 	git checkout -b orig-head topic &&
 	pre="$(git rev-parse --verify HEAD)" &&
-	git rebase master &&
+	git rebase main &&
 	test_cmp_rev "$pre" ORIG_HEAD &&
 	test_cmp_rev ! "$pre" HEAD
 '
@@ -93,19 +93,19 @@ test_expect_success 'HEAD was detached during rebase' '
 
 test_expect_success 'rebase from ambiguous branch name' '
 	git checkout -b topic side &&
-	git rebase master
+	git rebase main
 '
 
 test_expect_success 'rebase off of the previous branch using "-"' '
-	git checkout master &&
+	git checkout main &&
 	git checkout HEAD^ &&
 	git rebase @{-1} >expect.messages &&
-	git merge-base master HEAD >expect.forkpoint &&
+	git merge-base main HEAD >expect.forkpoint &&
 
-	git checkout master &&
+	git checkout main &&
 	git checkout HEAD^ &&
 	git rebase - >actual.messages &&
-	git merge-base master HEAD >actual.forkpoint &&
+	git merge-base main HEAD >actual.forkpoint &&
 
 	test_cmp expect.forkpoint actual.forkpoint &&
 	# the next one is dubious---we may want to say "-",
@@ -114,7 +114,7 @@ test_expect_success 'rebase off of the previous branch using "-"' '
 '
 
 test_expect_success 'rebase a single mode change' '
-	git checkout master &&
+	git checkout main &&
 	git branch -D topic &&
 	echo 1 >X &&
 	git add X &&
@@ -126,7 +126,7 @@ test_expect_success 'rebase a single mode change' '
 	test_chmod +x A &&
 	test_tick &&
 	git commit -m modechange &&
-	GIT_TRACE=1 git rebase master
+	GIT_TRACE=1 git rebase main
 '
 
 test_expect_success 'rebase is not broken by diff.renames' '
@@ -162,11 +162,11 @@ test_expect_success 'fail when upstream arg is missing and not configured' '
 test_expect_success 'rebase works with format.useAutoBase' '
 	test_config format.useAutoBase true &&
 	git checkout topic &&
-	git rebase master
+	git rebase main
 '
 
 test_expect_success 'default to common base in @{upstream}s reflog if no upstream arg (--merge)' '
-	git checkout -b default-base master &&
+	git checkout -b default-base main &&
 	git checkout -b default topic &&
 	git config branch.default.remote . &&
 	git config branch.default.merge refs/heads/default-base &&
@@ -184,7 +184,7 @@ test_expect_success 'default to common base in @{upstream}s reflog if no upstrea
 '
 
 test_expect_success 'default to common base in @{upstream}s reflog if no upstream arg (--apply)' '
-	git checkout -B default-base master &&
+	git checkout -B default-base main &&
 	git checkout -B default topic &&
 	git config branch.default.remote . &&
 	git config branch.default.merge refs/heads/default-base &&
@@ -226,13 +226,13 @@ test_expect_success 'cherry-picked commits and fork-point work together' '
 
 test_expect_success 'rebase --apply -q is quiet' '
 	git checkout -b quiet topic &&
-	git rebase --apply -q master >output.out 2>&1 &&
+	git rebase --apply -q main >output.out 2>&1 &&
 	test_must_be_empty output.out
 '
 
 test_expect_success 'rebase --merge -q is quiet' '
 	git checkout -B quiet topic &&
-	git rebase --merge -q master >output.out 2>&1 &&
+	git rebase --merge -q main >output.out 2>&1 &&
 	test_must_be_empty output.out
 '
 
@@ -294,7 +294,7 @@ test_expect_success 'rebase commit with an ancient timestamp' '
 '
 
 test_expect_success 'rebase with "From " line in commit message' '
-	git checkout -b preserve-from master~1 &&
+	git checkout -b preserve-from main~1 &&
 	cat >From_.msg <<EOF &&
 Somebody embedded an mbox in a commit message
 
@@ -310,7 +310,7 @@ EOF
 	>From_ &&
 	git add From_ &&
 	git commit -F From_.msg &&
-	git rebase master &&
+	git rebase main &&
 	git log -1 --pretty=format:%B >out &&
 	test_cmp From_.msg out
 '
@@ -357,12 +357,12 @@ test_expect_success 'rebase --apply and .gitattributes' '
 		git cherry-pick test &&
 
 		git checkout test &&
-		git rebase master &&
+		git rebase main &&
 		grep "smudged" a.txt &&
 
 		git checkout removal &&
 		git reset --hard &&
-		git rebase master &&
+		git rebase main &&
 		grep "clean" a.txt
 	)
 '
@@ -402,20 +402,20 @@ test_expect_success 'rebase -c rebase.useBuiltin=false warning' '
 '
 
 test_expect_success 'switch to branch checked out here' '
-	git checkout master &&
-	git rebase master master
+	git checkout main &&
+	git rebase main main
 '
 
 test_expect_success 'switch to branch not checked out' '
-	git checkout master &&
+	git checkout main &&
 	git branch other &&
-	git rebase master other
+	git rebase main other
 '
 
 test_expect_success 'refuse to switch to branch checked out elsewhere' '
-	git checkout master &&
+	git checkout main &&
 	git worktree add wt &&
-	test_must_fail git -C wt rebase master master 2>err &&
+	test_must_fail git -C wt rebase main main 2>err &&
 	test_i18ngrep "already checked out" err
 '
 
diff --git a/t/t3402-rebase-merge.sh b/t/t3402-rebase-merge.sh
index 6e032716a6..ed7fcb5a6c 100755
--- a/t/t3402-rebase-merge.sh
+++ b/t/t3402-rebase-merge.sh
@@ -19,10 +19,10 @@ test_expect_success setup '
 	git commit -m"initial" &&
 	git branch side &&
 	echo "11 $T" >>original &&
-	git commit -a -m"master updates a bit." &&
+	git commit -a -m"main updates a bit." &&
 
 	echo "12 $T" >>original &&
-	git commit -a -m"master updates a bit more." &&
+	git commit -a -m"main updates a bit more." &&
 
 	git checkout side &&
 	(echo "0 $T" && cat original) >renamed &&
@@ -47,13 +47,13 @@ test_expect_success setup '
 '
 
 test_expect_success 'reference merge' '
-	git merge -s recursive -m "reference merge" master
+	git merge -s recursive -m "reference merge" main
 '
 
 PRE_REBASE=$(git rev-parse test-rebase)
 test_expect_success rebase '
 	git checkout test-rebase &&
-	GIT_TRACE=1 git rebase --merge master
+	GIT_TRACE=1 git rebase --merge main
 '
 
 test_expect_success 'test-rebase@{1} is pre rebase' '
@@ -72,24 +72,24 @@ test_expect_success 'merge and rebase should match' '
 '
 
 test_expect_success 'rebase the other way' '
-	git reset --hard master &&
+	git reset --hard main &&
 	git rebase --merge side
 '
 
 test_expect_success 'rebase -Xtheirs' '
-	git checkout -b conflicting master~2 &&
+	git checkout -b conflicting main~2 &&
 	echo "AB $T" >> original &&
 	git commit -mconflicting original &&
-	git rebase -Xtheirs master &&
+	git rebase -Xtheirs main &&
 	grep AB original &&
 	! grep 11 original
 '
 
 test_expect_success 'rebase -Xtheirs from orphan' '
-	git checkout --orphan orphan-conflicting master~2 &&
+	git checkout --orphan orphan-conflicting main~2 &&
 	echo "AB $T" >> original &&
 	git commit -morphan-conflicting original &&
-	git rebase -Xtheirs master &&
+	git rebase -Xtheirs main &&
 	grep AB original &&
 	! grep 11 original
 '
@@ -107,9 +107,9 @@ test_expect_success 'merge and rebase should match' '
 
 test_expect_success 'picking rebase' '
 	git reset --hard side &&
-	git rebase --merge --onto master side^^ &&
-	mb=$(git merge-base master HEAD) &&
-	if test "$mb" = "$(git rev-parse master)"
+	git rebase --merge --onto main side^^ &&
+	mb=$(git merge-base main HEAD) &&
+	if test "$mb" = "$(git rev-parse main)"
 	then
 		echo happy
 	else
@@ -140,11 +140,11 @@ test_expect_success 'rebase -s funny -Xopt' '
 	EOF
 	chmod +x test-bin/git-merge-funny &&
 	git reset --hard &&
-	git checkout -b test-funny master^ &&
+	git checkout -b test-funny main^ &&
 	test_commit funny &&
 	(
 		PATH=./test-bin:$PATH &&
-		git rebase -s funny -Xopt master
+		git rebase -s funny -Xopt main
 	) &&
 	test -f funny.was.run
 '
@@ -165,7 +165,7 @@ test_expect_success 'rebase --skip works with two conflicts in a row' '
 test_expect_success '--reapply-cherry-picks' '
 	git init repo &&
 
-	# O(1-10) -- O(1-11) -- O(0-10) master
+	# O(1-10) -- O(1-11) -- O(0-10) main
 	#        \
 	#         -- O(1-11) -- O(1-12) otherbranch
 
@@ -187,18 +187,18 @@ test_expect_success '--reapply-cherry-picks' '
 	git -C repo commit -a -m "add 12 in another branch" &&
 
 	# Regular rebase fails, because the 1-11 commit is deduplicated
-	test_must_fail git -C repo rebase --merge master 2> err &&
+	test_must_fail git -C repo rebase --merge main 2> err &&
 	test_i18ngrep "error: could not apply.*add 12 in another branch" err &&
 	git -C repo rebase --abort &&
 
 	# With --reapply-cherry-picks, it works
-	git -C repo rebase --merge --reapply-cherry-picks master
+	git -C repo rebase --merge --reapply-cherry-picks main
 '
 
 test_expect_success '--reapply-cherry-picks refrains from reading unneeded blobs' '
 	git init server &&
 
-	# O(1-10) -- O(1-11) -- O(1-12) master
+	# O(1-10) -- O(1-11) -- O(1-12) main
 	#        \
 	#         -- O(0-10) otherbranch
 
@@ -220,18 +220,18 @@ test_expect_success '--reapply-cherry-picks refrains from reading unneeded blobs
 	test_config -C server uploadpack.allowanysha1inwant 1 &&
 
 	git clone --filter=blob:none "file://$(pwd)/server" client &&
-	git -C client checkout origin/master &&
+	git -C client checkout origin/main &&
 	git -C client checkout origin/otherbranch &&
 
 	# Sanity check to ensure that the blobs from the merge base and "add
 	# 11" are missing
 	git -C client rev-list --objects --all --missing=print >missing_list &&
-	MERGE_BASE_BLOB=$(git -C server rev-parse master^^:file.txt) &&
-	ADD_11_BLOB=$(git -C server rev-parse master^:file.txt) &&
+	MERGE_BASE_BLOB=$(git -C server rev-parse main^^:file.txt) &&
+	ADD_11_BLOB=$(git -C server rev-parse main^:file.txt) &&
 	grep "[?]$MERGE_BASE_BLOB" missing_list &&
 	grep "[?]$ADD_11_BLOB" missing_list &&
 
-	git -C client rebase --merge --reapply-cherry-picks origin/master &&
+	git -C client rebase --merge --reapply-cherry-picks origin/main &&
 
 	# The blob from the merge base had to be fetched, but not "add 11"
 	git -C client rev-list --objects --all --missing=print >missing_list &&
diff --git a/t/t3403-rebase-skip.sh b/t/t3403-rebase-skip.sh
index a927774910..360b46adef 100755
--- a/t/t3403-rebase-skip.sh
+++ b/t/t3403-rebase-skip.sh
@@ -48,7 +48,7 @@ test_expect_success setup '
 	'
 
 test_expect_success 'rebase with git am -3 (default)' '
-	test_must_fail git rebase master
+	test_must_fail git rebase main
 '
 
 test_expect_success 'rebase --skip can not be used with other options' '
@@ -64,7 +64,7 @@ test_expect_success 'rebase moves back to skip-reference' '
 	test refs/heads/skip-reference = $(git symbolic-ref HEAD) &&
 	git branch post-rebase &&
 	git reset --hard pre-rebase &&
-	test_must_fail git rebase master &&
+	test_must_fail git rebase main &&
 	echo "hello" > hello &&
 	git add hello &&
 	git rebase --continue &&
@@ -75,7 +75,7 @@ test_expect_success 'rebase moves back to skip-reference' '
 test_expect_success 'checkout skip-merge' 'git checkout -f skip-merge'
 
 test_expect_success 'rebase with --merge' '
-	test_must_fail git rebase --merge master
+	test_must_fail git rebase --merge main
 '
 
 test_expect_success 'rebase --skip with --merge' '
diff --git a/t/t3405-rebase-malformed.sh b/t/t3405-rebase-malformed.sh
index 860e63e444..7ef8bfa0ac 100755
--- a/t/t3405-rebase-malformed.sh
+++ b/t/t3405-rebase-malformed.sh
@@ -52,7 +52,7 @@ test_expect_success setup '
 	git add file3 &&
 	git commit --allow-empty-message -m "" &&
 
-	git checkout master &&
+	git checkout main &&
 
 	echo One >file1 &&
 	test_tick &&
@@ -62,7 +62,7 @@ test_expect_success setup '
 
 test_expect_success 'rebase commit with multi-line subject' '
 
-	git rebase master multi-line-subject &&
+	git rebase main multi-line-subject &&
 	git cat-file commit HEAD | sed -e "1,/^\$/d" >F1 &&
 
 	test_cmp F0 F1 &&
@@ -70,14 +70,14 @@ test_expect_success 'rebase commit with multi-line subject' '
 '
 
 test_expect_success 'rebase commit with diff in message' '
-	git rebase master diff-in-message &&
+	git rebase main diff-in-message &&
 	git cat-file commit HEAD | sed -e "1,/^$/d" >G1 &&
 	test_cmp G0 G1 &&
 	test_cmp G G0
 '
 
 test_expect_success 'rebase -m commit with empty message' '
-	git rebase -m master empty-message-merge
+	git rebase -m main empty-message-merge
 '
 
 test_expect_success 'rebase -i commit with empty message' '
diff --git a/t/t3406-rebase-message.sh b/t/t3406-rebase-message.sh
index 4afc528165..00e271fb36 100755
--- a/t/t3406-rebase-message.sh
+++ b/t/t3406-rebase-message.sh
@@ -18,27 +18,27 @@ test_expect_success 'setup' '
 '
 
 test_expect_success 'rebase -m' '
-	git rebase -m master >actual &&
+	git rebase -m main >actual &&
 	test_must_be_empty actual
 '
 
-test_expect_success 'rebase against master twice' '
-	git rebase --apply master >out &&
+test_expect_success 'rebase against main twice' '
+	git rebase --apply main >out &&
 	test_i18ngrep "Current branch topic is up to date" out
 '
 
-test_expect_success 'rebase against master twice with --force' '
-	git rebase --force-rebase --apply master >out &&
+test_expect_success 'rebase against main twice with --force' '
+	git rebase --force-rebase --apply main >out &&
 	test_i18ngrep "Current branch topic is up to date, rebase forced" out
 '
 
-test_expect_success 'rebase against master twice from another branch' '
+test_expect_success 'rebase against main twice from another branch' '
 	git checkout topic^ &&
-	git rebase --apply master topic >out &&
+	git rebase --apply main topic >out &&
 	test_i18ngrep "Current branch topic is up to date" out
 '
 
-test_expect_success 'rebase fast-forward to master' '
+test_expect_success 'rebase fast-forward to main' '
 	git checkout topic^ &&
 	git rebase --apply topic >out &&
 	test_i18ngrep "Fast-forwarded HEAD to topic" out
@@ -46,21 +46,21 @@ test_expect_success 'rebase fast-forward to master' '
 
 test_expect_success 'rebase --stat' '
 	git reset --hard start &&
-	git rebase --stat master >diffstat.txt &&
+	git rebase --stat main >diffstat.txt &&
 	grep "^ fileX |  *1 +$" diffstat.txt
 '
 
 test_expect_success 'rebase w/config rebase.stat' '
 	git reset --hard start &&
 	git config rebase.stat true &&
-	git rebase master >diffstat.txt &&
+	git rebase main >diffstat.txt &&
 	grep "^ fileX |  *1 +$" diffstat.txt
 '
 
 test_expect_success 'rebase -n overrides config rebase.stat config' '
 	git reset --hard start &&
 	git config rebase.stat true &&
-	git rebase -n master >diffstat.txt &&
+	git rebase -n main >diffstat.txt &&
 	! grep "^ fileX |  *1 +$" diffstat.txt
 '
 
@@ -113,7 +113,7 @@ test_expect_success 'rebase -i onto unrelated history' '
 	git init unrelated &&
 	test_commit -C unrelated 1 &&
 	git -C unrelated remote add -f origin "$PWD" &&
-	git -C unrelated branch --set-upstream-to=origin/master &&
+	git -C unrelated branch --set-upstream-to=origin/main &&
 	git -C unrelated -c core.editor=true rebase -i -v --stat >actual &&
 	test_i18ngrep "Changes to " actual &&
 	test_i18ngrep "5 files changed" actual
diff --git a/t/t3407-rebase-abort.sh b/t/t3407-rebase-abort.sh
index 97efea0f56..2c2a5b9c10 100755
--- a/t/t3407-rebase-abort.sh
+++ b/t/t3407-rebase-abort.sh
@@ -37,7 +37,7 @@ testrebase() {
 		cd "$work_dir" &&
 		# Clean up the state from the previous one
 		git reset --hard pre-rebase &&
-		test_must_fail git rebase$type master &&
+		test_must_fail git rebase$type main &&
 		test_path_is_dir "$dotest" &&
 		git rebase --abort &&
 		test $(git rev-parse to-rebase) = $(git rev-parse pre-rebase) &&
@@ -48,10 +48,10 @@ testrebase() {
 		cd "$work_dir" &&
 		# Clean up the state from the previous one
 		git reset --hard pre-rebase &&
-		test_must_fail git rebase$type master &&
+		test_must_fail git rebase$type main &&
 		test_path_is_dir "$dotest" &&
 		test_must_fail git rebase --skip &&
-		test $(git rev-parse HEAD) = $(git rev-parse master) &&
+		test $(git rev-parse HEAD) = $(git rev-parse main) &&
 		git rebase --abort &&
 		test $(git rev-parse to-rebase) = $(git rev-parse pre-rebase) &&
 		test ! -d "$dotest"
@@ -61,13 +61,13 @@ testrebase() {
 		cd "$work_dir" &&
 		# Clean up the state from the previous one
 		git reset --hard pre-rebase &&
-		test_must_fail git rebase$type master &&
+		test_must_fail git rebase$type main &&
 		test_path_is_dir "$dotest" &&
 		echo c > a &&
 		echo d >> a &&
 		git add a &&
 		test_must_fail git rebase --continue &&
-		test $(git rev-parse HEAD) != $(git rev-parse master) &&
+		test $(git rev-parse HEAD) != $(git rev-parse main) &&
 		git rebase --abort &&
 		test $(git rev-parse to-rebase) = $(git rev-parse pre-rebase) &&
 		test ! -d "$dotest"
@@ -78,7 +78,7 @@ testrebase() {
 		# Clean up the state from the previous one
 		git reset --hard pre-rebase &&
 		git reflog show to-rebase > reflog_before &&
-		test_must_fail git rebase$type master &&
+		test_must_fail git rebase$type main &&
 		git rebase --abort &&
 		git reflog show to-rebase > reflog_after &&
 		test_cmp reflog_before reflog_after &&
@@ -89,7 +89,7 @@ testrebase() {
 		cd "$work_dir" &&
 		# Clean up the state from the previous one
 		git reset --hard pre-rebase &&
-		test_must_fail git rebase$type master &&
+		test_must_fail git rebase$type main &&
 		test_must_fail git rebase -v --abort &&
 		test_must_fail git rebase --abort -v &&
 		git rebase --abort
@@ -103,7 +103,7 @@ test_expect_success 'rebase --apply --quit' '
 	cd "$work_dir" &&
 	# Clean up the state from the previous one
 	git reset --hard pre-rebase &&
-	test_must_fail git rebase --apply master &&
+	test_must_fail git rebase --apply main &&
 	test_path_is_dir .git/rebase-apply &&
 	head_before=$(git rev-parse HEAD) &&
 	git rebase --quit &&
@@ -115,7 +115,7 @@ test_expect_success 'rebase --merge --quit' '
 	cd "$work_dir" &&
 	# Clean up the state from the previous one
 	git reset --hard pre-rebase &&
-	test_must_fail git rebase --merge master &&
+	test_must_fail git rebase --merge main &&
 	test_path_is_dir .git/rebase-merge &&
 	head_before=$(git rev-parse HEAD) &&
 	git rebase --quit &&
diff --git a/t/t3408-rebase-multi-line.sh b/t/t3408-rebase-multi-line.sh
index d2bd7c17b0..1cba82f001 100755
--- a/t/t3408-rebase-multi-line.sh
+++ b/t/t3408-rebase-multi-line.sh
@@ -46,7 +46,7 @@ But otherwise with a sane description." side2 &&
 test_expect_success rebase '
 
 	git checkout side &&
-	git rebase master &&
+	git rebase main &&
 	git cat-file commit HEAD | sed -e "1,/^\$/d" >actual &&
 	git cat-file commit side@{1} | sed -e "1,/^\$/d" >expect &&
 	test_cmp expect actual
diff --git a/t/t3409-rebase-preserve-merges.sh b/t/t3409-rebase-preserve-merges.sh
index 3b340f1ece..b078985b95 100755
--- a/t/t3409-rebase-preserve-merges.sh
+++ b/t/t3409-rebase-preserve-merges.sh
@@ -18,7 +18,7 @@ export GIT_AUTHOR_EMAIL
 
 # Clone 2 (conflicting merge):
 #
-# A1--A2--B3   <-- origin/master
+# A1--A2--B3   <-- origin/main
 #  \       \
 #   B1------M  <-- topic
 #    \
@@ -26,7 +26,7 @@ export GIT_AUTHOR_EMAIL
 #
 # Clone 3 (no-ff merge):
 #
-# A1--A2--B3   <-- origin/master
+# A1--A2--B3   <-- origin/main
 #  \
 #   B1------M  <-- topic
 #    \     /
@@ -44,7 +44,7 @@ test_expect_success 'setup for merge-preserving rebase' \
 	echo Second > B &&
 	git add B &&
 	git commit -m "Add B1" &&
-	git checkout -f master &&
+	git checkout -f main &&
 	echo Third >> A &&
 	git commit -a -m "Modify A2" &&
 	echo Fifth > B &&
@@ -55,10 +55,10 @@ test_expect_success 'setup for merge-preserving rebase' \
 	(
 		cd clone2 &&
 		git checkout -b topic origin/topic &&
-		test_must_fail git merge origin/master &&
+		test_must_fail git merge origin/main &&
 		echo Resolved >B &&
 		git add B &&
-		git commit -m "Merge origin/master into topic"
+		git commit -m "Merge origin/main into topic"
 	) &&
 
 	git clone ./. clone3 &&
diff --git a/t/t3412-rebase-root.sh b/t/t3412-rebase-root.sh
index 21632a984e..120315ac0e 100755
--- a/t/t3412-rebase-root.sh
+++ b/t/t3412-rebase-root.sh
@@ -24,7 +24,7 @@ test_expect_success 'prepare repository' '
 
 test_expect_success 'rebase --root fails with too many args' '
 	git checkout -B fail other &&
-	test_must_fail git rebase --onto master --root fail fail
+	test_must_fail git rebase --onto main --root fail fail
 '
 
 test_expect_success 'setup pre-rebase hook' '
@@ -44,7 +44,7 @@ EOF
 
 test_expect_success 'rebase --root --onto <newbase>' '
 	git checkout -b work other &&
-	git rebase --root --onto master &&
+	git rebase --root --onto main &&
 	git log --pretty=tformat:"%s" > rebased &&
 	test_cmp expect rebased
 '
@@ -55,7 +55,7 @@ test_expect_success 'pre-rebase got correct input (1)' '
 
 test_expect_success 'rebase --root --onto <newbase> <branch>' '
 	git branch work2 other &&
-	git rebase --root --onto master work2 &&
+	git rebase --root --onto main work2 &&
 	git log --pretty=tformat:"%s" > rebased2 &&
 	test_cmp expect rebased2
 '
@@ -66,7 +66,7 @@ test_expect_success 'pre-rebase got correct input (2)' '
 
 test_expect_success 'rebase -i --root --onto <newbase>' '
 	git checkout -b work3 other &&
-	git rebase -i --root --onto master &&
+	git rebase -i --root --onto main &&
 	git log --pretty=tformat:"%s" > rebased3 &&
 	test_cmp expect rebased3
 '
@@ -77,7 +77,7 @@ test_expect_success 'pre-rebase got correct input (3)' '
 
 test_expect_success 'rebase -i --root --onto <newbase> <branch>' '
 	git branch work4 other &&
-	git rebase -i --root --onto master work4 &&
+	git rebase -i --root --onto main work4 &&
 	git log --pretty=tformat:"%s" > rebased4 &&
 	test_cmp expect rebased4
 '
@@ -88,7 +88,7 @@ test_expect_success 'pre-rebase got correct input (4)' '
 
 test_expect_success REBASE_P 'rebase -i -p with linear history' '
 	git checkout -b work5 other &&
-	git rebase -i -p --root --onto master &&
+	git rebase -i -p --root --onto main &&
 	git log --pretty=tformat:"%s" > rebased5 &&
 	test_cmp expect rebased5
 '
@@ -122,7 +122,7 @@ EOF
 
 test_expect_success REBASE_P 'rebase -i -p with merge' '
 	git checkout -b work6 other &&
-	git rebase -i -p --root --onto master &&
+	git rebase -i -p --root --onto main &&
 	log_with_names work6 > rebased6 &&
 	test_cmp expect-side rebased6
 '
@@ -157,7 +157,7 @@ EOF
 
 test_expect_success REBASE_P 'rebase -i -p with two roots' '
 	git checkout -b work7 other &&
-	git rebase -i -p --root --onto master &&
+	git rebase -i -p --root --onto main &&
 	log_with_names work7 > rebased7 &&
 	test_cmp expect-third rebased7
 '
@@ -173,14 +173,14 @@ EOF
 
 test_expect_success 'pre-rebase hook stops rebase' '
 	git checkout -b stops1 other &&
-	test_must_fail git rebase --root --onto master &&
+	test_must_fail git rebase --root --onto main &&
 	test "z$(git symbolic-ref HEAD)" = zrefs/heads/stops1 &&
 	test 0 = $(git rev-list other...stops1 | wc -l)
 '
 
 test_expect_success 'pre-rebase hook stops rebase -i' '
 	git checkout -b stops2 other &&
-	test_must_fail git rebase --root --onto master &&
+	test_must_fail git rebase --root --onto main &&
 	test "z$(git symbolic-ref HEAD)" = zrefs/heads/stops2 &&
 	test 0 = $(git rev-list other...stops2 | wc -l)
 '
@@ -190,7 +190,7 @@ test_expect_success 'remove pre-rebase hook' '
 '
 
 test_expect_success 'set up a conflict' '
-	git checkout master &&
+	git checkout main &&
 	echo conflict > B &&
 	git add B &&
 	git commit -m conflict
@@ -198,7 +198,7 @@ test_expect_success 'set up a conflict' '
 
 test_expect_success 'rebase --root with conflict (first part)' '
 	git checkout -b conflict1 other &&
-	test_must_fail git rebase --root --onto master &&
+	test_must_fail git rebase --root --onto main &&
 	git ls-files -u | grep "B$"
 '
 
@@ -225,7 +225,7 @@ test_expect_success 'rebase --root with conflict (second part)' '
 
 test_expect_success 'rebase -i --root with conflict (first part)' '
 	git checkout -b conflict2 other &&
-	test_must_fail git rebase -i --root --onto master &&
+	test_must_fail git rebase -i --root --onto main &&
 	git ls-files -u | grep "B$"
 '
 
@@ -263,7 +263,7 @@ EOF
 
 test_expect_success REBASE_P 'rebase -i -p --root with conflict (first part)' '
 	git checkout -b conflict3 other &&
-	test_must_fail git rebase -i -p --root --onto master &&
+	test_must_fail git rebase -i -p --root --onto main &&
 	git ls-files -u | grep "B$"
 '
 
diff --git a/t/t3413-rebase-hook.sh b/t/t3413-rebase-hook.sh
index b6833e9a5f..b5b8d3556e 100755
--- a/t/t3413-rebase-hook.sh
+++ b/t/t3413-rebase-hook.sh
@@ -18,7 +18,7 @@ test_expect_success setup '
 	git add git &&
 	test_tick &&
 	git commit -m side &&
-	git checkout master &&
+	git checkout main &&
 	git log --pretty=oneline --abbrev-commit --graph --all &&
 	git branch test side
 '
@@ -26,14 +26,14 @@ test_expect_success setup '
 test_expect_success 'rebase' '
 	git checkout test &&
 	git reset --hard side &&
-	git rebase master &&
+	git rebase main &&
 	test "z$(cat git)" = zworld
 '
 
 test_expect_success 'rebase -i' '
 	git checkout test &&
 	git reset --hard side &&
-	EDITOR=true git rebase -i master &&
+	EDITOR=true git rebase -i main &&
 	test "z$(cat git)" = zworld
 '
 
@@ -49,53 +49,53 @@ EOF
 test_expect_success 'pre-rebase hook gets correct input (1)' '
 	git checkout test &&
 	git reset --hard side &&
-	git rebase master &&
+	git rebase main &&
 	test "z$(cat git)" = zworld &&
-	test "z$(cat .git/PRE-REBASE-INPUT)" = zmaster,
+	test "z$(cat .git/PRE-REBASE-INPUT)" = zmain,
 
 '
 
 test_expect_success 'pre-rebase hook gets correct input (2)' '
 	git checkout test &&
 	git reset --hard side &&
-	git rebase master test &&
+	git rebase main test &&
 	test "z$(cat git)" = zworld &&
-	test "z$(cat .git/PRE-REBASE-INPUT)" = zmaster,test
+	test "z$(cat .git/PRE-REBASE-INPUT)" = zmain,test
 '
 
 test_expect_success 'pre-rebase hook gets correct input (3)' '
 	git checkout test &&
 	git reset --hard side &&
-	git checkout master &&
-	git rebase master test &&
+	git checkout main &&
+	git rebase main test &&
 	test "z$(cat git)" = zworld &&
-	test "z$(cat .git/PRE-REBASE-INPUT)" = zmaster,test
+	test "z$(cat .git/PRE-REBASE-INPUT)" = zmain,test
 '
 
 test_expect_success 'pre-rebase hook gets correct input (4)' '
 	git checkout test &&
 	git reset --hard side &&
-	EDITOR=true git rebase -i master &&
+	EDITOR=true git rebase -i main &&
 	test "z$(cat git)" = zworld &&
-	test "z$(cat .git/PRE-REBASE-INPUT)" = zmaster,
+	test "z$(cat .git/PRE-REBASE-INPUT)" = zmain,
 
 '
 
 test_expect_success 'pre-rebase hook gets correct input (5)' '
 	git checkout test &&
 	git reset --hard side &&
-	EDITOR=true git rebase -i master test &&
+	EDITOR=true git rebase -i main test &&
 	test "z$(cat git)" = zworld &&
-	test "z$(cat .git/PRE-REBASE-INPUT)" = zmaster,test
+	test "z$(cat .git/PRE-REBASE-INPUT)" = zmain,test
 '
 
 test_expect_success 'pre-rebase hook gets correct input (6)' '
 	git checkout test &&
 	git reset --hard side &&
-	git checkout master &&
-	EDITOR=true git rebase -i master test &&
+	git checkout main &&
+	EDITOR=true git rebase -i main test &&
 	test "z$(cat git)" = zworld &&
-	test "z$(cat .git/PRE-REBASE-INPUT)" = zmaster,test
+	test "z$(cat .git/PRE-REBASE-INPUT)" = zmain,test
 '
 
 test_expect_success 'setup pre-rebase hook that fails' '
@@ -110,7 +110,7 @@ EOF
 test_expect_success 'pre-rebase hook stops rebase (1)' '
 	git checkout test &&
 	git reset --hard side &&
-	test_must_fail git rebase master &&
+	test_must_fail git rebase main &&
 	test "z$(git symbolic-ref HEAD)" = zrefs/heads/test &&
 	test 0 = $(git rev-list HEAD...side | wc -l)
 '
@@ -118,7 +118,7 @@ test_expect_success 'pre-rebase hook stops rebase (1)' '
 test_expect_success 'pre-rebase hook stops rebase (2)' '
 	git checkout test &&
 	git reset --hard side &&
-	test_must_fail env EDITOR=: git rebase -i master &&
+	test_must_fail env EDITOR=: git rebase -i main &&
 	test "z$(git symbolic-ref HEAD)" = zrefs/heads/test &&
 	test 0 = $(git rev-list HEAD...side | wc -l)
 '
@@ -126,7 +126,7 @@ test_expect_success 'pre-rebase hook stops rebase (2)' '
 test_expect_success 'rebase --no-verify overrides pre-rebase (1)' '
 	git checkout test &&
 	git reset --hard side &&
-	git rebase --no-verify master &&
+	git rebase --no-verify main &&
 	test "z$(git symbolic-ref HEAD)" = zrefs/heads/test &&
 	test "z$(cat git)" = zworld
 '
@@ -134,7 +134,7 @@ test_expect_success 'rebase --no-verify overrides pre-rebase (1)' '
 test_expect_success 'rebase --no-verify overrides pre-rebase (2)' '
 	git checkout test &&
 	git reset --hard side &&
-	EDITOR=true git rebase --no-verify -i master &&
+	EDITOR=true git rebase --no-verify -i main &&
 	test "z$(git symbolic-ref HEAD)" = zrefs/heads/test &&
 	test "z$(cat git)" = zworld
 '
diff --git a/t/t3415-rebase-autosquash.sh b/t/t3415-rebase-autosquash.sh
index 7bab6000dc..40bb7ac649 100755
--- a/t/t3415-rebase-autosquash.sh
+++ b/t/t3415-rebase-autosquash.sh
@@ -407,7 +407,7 @@ test_expect_success 'wrapped original subject' '
 
 test_expect_success 'abort last squash' '
 	test_when_finished "test_might_fail git rebase --abort" &&
-	test_when_finished "git checkout master" &&
+	test_when_finished "git checkout main" &&
 
 	git checkout -b some-squashes &&
 	git commit --allow-empty -m first &&
diff --git a/t/t3416-rebase-onto-threedots.sh b/t/t3416-rebase-onto-threedots.sh
index 1f37adf56b..2360a1e37a 100755
--- a/t/t3416-rebase-onto-threedots.sh
+++ b/t/t3416-rebase-onto-threedots.sh
@@ -5,14 +5,14 @@ test_description='git rebase --onto A...B'
 . ./test-lib.sh
 . "$TEST_DIRECTORY/lib-rebase.sh"
 
-# Rebase only the tip commit of "topic" on merge base between "master"
-# and "topic".  Cannot do this for "side" with "master" because there
+# Rebase only the tip commit of "topic" on merge base between "main"
+# and "topic".  Cannot do this for "side" with "main" because there
 # is no single merge base.
 #
 #
 #	    F---G topic                             G'
 #	   /                                       /
-# A---B---C---D---E master        -->       A---B---C---D---E
+# A---B---C---D---E main        -->       A---B---C---D---E
 #      \   \ /
 #	\   x
 #	 \ / \
@@ -26,7 +26,7 @@ test_expect_success setup '
 	git branch topic &&
 	git checkout side &&
 	test_commit H &&
-	git checkout master &&
+	git checkout main &&
 	test_tick &&
 	git merge H &&
 	git tag D &&
@@ -42,83 +42,83 @@ test_expect_success setup '
 	test_commit K
 '
 
-test_expect_success 'rebase --onto master...topic' '
+test_expect_success 'rebase --onto main...topic' '
 	git reset --hard &&
 	git checkout topic &&
 	git reset --hard G &&
 
-	git rebase --onto master...topic F &&
+	git rebase --onto main...topic F &&
 	git rev-parse HEAD^1 >actual &&
 	git rev-parse C^0 >expect &&
 	test_cmp expect actual
 '
 
-test_expect_success 'rebase --onto master...' '
+test_expect_success 'rebase --onto main...' '
 	git reset --hard &&
 	git checkout topic &&
 	git reset --hard G &&
 
-	git rebase --onto master... F &&
+	git rebase --onto main... F &&
 	git rev-parse HEAD^1 >actual &&
 	git rev-parse C^0 >expect &&
 	test_cmp expect actual
 '
 
-test_expect_success 'rebase --onto master...side' '
+test_expect_success 'rebase --onto main...side' '
 	git reset --hard &&
 	git checkout side &&
 	git reset --hard K &&
 
-	test_must_fail git rebase --onto master...side J
+	test_must_fail git rebase --onto main...side J
 '
 
-test_expect_success 'rebase -i --onto master...topic' '
+test_expect_success 'rebase -i --onto main...topic' '
 	git reset --hard &&
 	git checkout topic &&
 	git reset --hard G &&
 	set_fake_editor &&
-	EXPECT_COUNT=1 git rebase -i --onto master...topic F &&
+	EXPECT_COUNT=1 git rebase -i --onto main...topic F &&
 	git rev-parse HEAD^1 >actual &&
 	git rev-parse C^0 >expect &&
 	test_cmp expect actual
 '
 
-test_expect_success 'rebase -i --onto master...' '
+test_expect_success 'rebase -i --onto main...' '
 	git reset --hard &&
 	git checkout topic &&
 	git reset --hard G &&
 	set_fake_editor &&
-	EXPECT_COUNT=1 git rebase -i --onto master... F &&
+	EXPECT_COUNT=1 git rebase -i --onto main... F &&
 	git rev-parse HEAD^1 >actual &&
 	git rev-parse C^0 >expect &&
 	test_cmp expect actual
 '
 
-test_expect_success 'rebase -i --onto master...side' '
+test_expect_success 'rebase -i --onto main...side' '
 	git reset --hard &&
 	git checkout side &&
 	git reset --hard K &&
 
 	set_fake_editor &&
-	test_must_fail git rebase -i --onto master...side J
+	test_must_fail git rebase -i --onto main...side J
 '
 
 test_expect_success 'rebase --keep-base --onto incompatible' '
-	test_must_fail git rebase --keep-base --onto master...
+	test_must_fail git rebase --keep-base --onto main...
 '
 
 test_expect_success 'rebase --keep-base --root incompatible' '
 	test_must_fail git rebase --keep-base --root
 '
 
-test_expect_success 'rebase --keep-base master from topic' '
+test_expect_success 'rebase --keep-base main from topic' '
 	git reset --hard &&
 	git checkout topic &&
 	git reset --hard G &&
 
-	git rebase --keep-base master &&
+	git rebase --keep-base main &&
 	git rev-parse C >base.expect &&
-	git merge-base master HEAD >base.actual &&
+	git merge-base main HEAD >base.actual &&
 	test_cmp base.expect base.actual &&
 
 	git rev-parse HEAD~2 >actual &&
@@ -126,23 +126,23 @@ test_expect_success 'rebase --keep-base master from topic' '
 	test_cmp expect actual
 '
 
-test_expect_success 'rebase --keep-base master from side' '
+test_expect_success 'rebase --keep-base main from side' '
 	git reset --hard &&
 	git checkout side &&
 	git reset --hard K &&
 
-	test_must_fail git rebase --keep-base master
+	test_must_fail git rebase --keep-base main
 '
 
-test_expect_success 'rebase -i --keep-base master from topic' '
+test_expect_success 'rebase -i --keep-base main from topic' '
 	git reset --hard &&
 	git checkout topic &&
 	git reset --hard G &&
 
 	set_fake_editor &&
-	EXPECT_COUNT=2 git rebase -i --keep-base master &&
+	EXPECT_COUNT=2 git rebase -i --keep-base main &&
 	git rev-parse C >base.expect &&
-	git merge-base master HEAD >base.actual &&
+	git merge-base main HEAD >base.actual &&
 	test_cmp base.expect base.actual &&
 
 	git rev-parse HEAD~2 >actual &&
@@ -150,13 +150,13 @@ test_expect_success 'rebase -i --keep-base master from topic' '
 	test_cmp expect actual
 '
 
-test_expect_success 'rebase -i --keep-base master from side' '
+test_expect_success 'rebase -i --keep-base main from side' '
 	git reset --hard &&
 	git checkout side &&
 	git reset --hard K &&
 
 	set_fake_editor &&
-	test_must_fail git rebase -i --keep-base master
+	test_must_fail git rebase -i --keep-base main
 '
 
 test_done
diff --git a/t/t3418-rebase-continue.sh b/t/t3418-rebase-continue.sh
index 7a2da972fd..b9e059e168 100755
--- a/t/t3418-rebase-continue.sh
+++ b/t/t3418-rebase-continue.sh
@@ -15,13 +15,13 @@ test_expect_success 'setup' '
 	git checkout -b topic HEAD^ &&
 	test_commit "commit-new-file-F2-on-topic-branch" F2 22 &&
 
-	git checkout master
+	git checkout main
 '
 
 test_expect_success 'interactive rebase --continue works with touched file' '
 	rm -fr .git/rebase-* &&
 	git reset --hard &&
-	git checkout master &&
+	git checkout main &&
 
 	FAKE_LINES="edit 1" git rebase -i HEAD^ &&
 	test-tool chmtime =-60 F1 &&
@@ -31,9 +31,9 @@ test_expect_success 'interactive rebase --continue works with touched file' '
 test_expect_success 'non-interactive rebase --continue works with touched file' '
 	rm -fr .git/rebase-* &&
 	git reset --hard &&
-	git checkout master &&
+	git checkout main &&
 
-	test_must_fail git rebase --onto master master topic &&
+	test_must_fail git rebase --onto main main topic &&
 	echo "Resolved" >F2 &&
 	git add F2 &&
 	test-tool chmtime =-60 F1 &&
@@ -61,7 +61,7 @@ test_expect_success 'rebase --continue remembers merge strategy and options' '
 	chmod +x test-bin/git-merge-funny &&
 	(
 		PATH=./test-bin:$PATH &&
-		test_must_fail git rebase -s funny -Xopt master topic
+		test_must_fail git rebase -s funny -Xopt main topic
 	) &&
 	test -f funny.was.run &&
 	rm funny.was.run &&
@@ -93,7 +93,7 @@ test_expect_success 'rebase -i --continue handles merge strategy and options' '
 	chmod +x test-bin/git-merge-funny &&
 	(
 		PATH=./test-bin:$PATH &&
-		test_must_fail git rebase -i -s funny -Xopt -Xfoo master topic
+		test_must_fail git rebase -i -s funny -Xopt -Xfoo main topic
 	) &&
 	test -f funny.was.run &&
 	rm funny.was.run &&
@@ -188,11 +188,11 @@ test_expect_success '--skip after failed fixup cleans commit message' '
 test_expect_success 'setup rerere database' '
 	rm -fr .git/rebase-* &&
 	git reset --hard commit-new-file-F3-on-topic-branch &&
-	git checkout master &&
+	git checkout main &&
 	test_commit "commit-new-file-F3" F3 3 &&
 	test_config rerere.enabled true &&
 	git update-ref refs/heads/topic commit-new-file-F3-on-topic-branch &&
-	test_must_fail git rebase -m master topic &&
+	test_must_fail git rebase -m main topic &&
 	echo "Resolved" >F2 &&
 	cp F2 expected-F2 &&
 	git add F2 &&
@@ -207,7 +207,7 @@ test_expect_success 'setup rerere database' '
 prepare () {
 	rm -fr .git/rebase-* &&
 	git reset --hard commit-new-file-F3-on-topic-branch &&
-	git checkout master &&
+	git checkout main &&
 	test_config rerere.enabled true
 }
 
@@ -215,7 +215,7 @@ test_rerere_autoupdate () {
 	action=$1 &&
 	test_expect_success "rebase $action --continue remembers --rerere-autoupdate" '
 		prepare &&
-		test_must_fail git rebase $action --rerere-autoupdate master topic &&
+		test_must_fail git rebase $action --rerere-autoupdate main topic &&
 		test_cmp expected-F2 F2 &&
 		git diff-files --quiet &&
 		test_must_fail git rebase --continue &&
@@ -227,7 +227,7 @@ test_rerere_autoupdate () {
 	test_expect_success "rebase $action --continue honors rerere.autoUpdate" '
 		prepare &&
 		test_config rerere.autoupdate true &&
-		test_must_fail git rebase $action master topic &&
+		test_must_fail git rebase $action main topic &&
 		test_cmp expected-F2 F2 &&
 		git diff-files --quiet &&
 		test_must_fail git rebase --continue &&
@@ -239,7 +239,7 @@ test_rerere_autoupdate () {
 	test_expect_success "rebase $action --continue remembers --no-rerere-autoupdate" '
 		prepare &&
 		test_config rerere.autoupdate true &&
-		test_must_fail git rebase $action --no-rerere-autoupdate master topic &&
+		test_must_fail git rebase $action --no-rerere-autoupdate main topic &&
 		test_cmp expected-F2 F2 &&
 		test_must_fail git diff-files --quiet &&
 		git add F2 &&
diff --git a/t/t3419-rebase-patch-id.sh b/t/t3419-rebase-patch-id.sh
index 1f32faa4a4..29fa76be4d 100755
--- a/t/t3419-rebase-patch-id.sh
+++ b/t/t3419-rebase-patch-id.sh
@@ -24,7 +24,7 @@ test_expect_success 'setup' '
 
 test_expect_success 'setup: 500 lines' '
 	rm -f .gitattributes &&
-	git checkout -q -f master &&
+	git checkout -q -f main &&
 	git reset --hard root &&
 	test_seq 500 >file &&
 	git add file &&
@@ -40,7 +40,7 @@ test_expect_success 'setup: 500 lines' '
 	git add newfile &&
 	git commit -q -m "add small file" &&
 
-	git cherry-pick master >/dev/null 2>&1
+	git cherry-pick main >/dev/null 2>&1
 '
 
 test_expect_success 'setup attributes' '
@@ -48,18 +48,18 @@ test_expect_success 'setup attributes' '
 '
 
 test_expect_success 'detect upstream patch' '
-	git checkout -q master &&
+	git checkout -q main &&
 	scramble file &&
 	git add file &&
 	git commit -q -m "change big file again" &&
 	git checkout -q other^{} &&
-	git rebase master &&
-	git rev-list master...HEAD~ >revs &&
+	git rebase main &&
+	git rev-list main...HEAD~ >revs &&
 	test_must_be_empty revs
 '
 
 test_expect_success 'do not drop patch' '
-	git branch -f squashed master &&
+	git branch -f squashed main &&
 	git checkout -q -f squashed &&
 	git reset -q --soft HEAD~2 &&
 	git commit -q -m squashed &&
diff --git a/t/t3420-rebase-autostash.sh b/t/t3420-rebase-autostash.sh
index ca331733fb..b1263e5a47 100755
--- a/t/t3420-rebase-autostash.sh
+++ b/t/t3420-rebase-autostash.sh
@@ -21,12 +21,12 @@ test_expect_success setup '
 	git add . &&
 	test_tick &&
 	git commit -m "third commit" &&
-	git checkout -b unrelated-onto-branch master &&
+	git checkout -b unrelated-onto-branch main &&
 	echo unrelated >file4 &&
 	git add . &&
 	test_tick &&
 	git commit -m "unrelated commit" &&
-	git checkout -b related-onto-branch master &&
+	git checkout -b related-onto-branch main &&
 	echo conflicting-change >file2 &&
 	git add . &&
 	test_tick &&
@@ -305,7 +305,7 @@ test_expect_success 'autostash is saved on editor failure with conflict' '
 '
 
 test_expect_success 'autostash with dirty submodules' '
-	test_when_finished "git reset --hard && git checkout master" &&
+	test_when_finished "git reset --hard && git checkout main" &&
 	git checkout -b with-submodule &&
 	git submodule add ./ sub &&
 	test_tick &&
@@ -324,7 +324,7 @@ test_expect_success 'branch is left alone when possible' '
 
 test_expect_success 'never change active branch' '
 	git checkout -b not-the-feature-branch unrelated-onto-branch &&
-	test_when_finished "git reset --hard && git checkout master" &&
+	test_when_finished "git reset --hard && git checkout main" &&
 	echo changed >file0 &&
 	git rebase --autostash not-the-feature-branch feature-branch &&
 	test_cmp_rev not-the-feature-branch unrelated-onto-branch
diff --git a/t/t3423-rebase-reword.sh b/t/t3423-rebase-reword.sh
index 6963750794..4859bb8f72 100755
--- a/t/t3423-rebase-reword.sh
+++ b/t/t3423-rebase-reword.sh
@@ -7,7 +7,7 @@ test_description='git rebase interactive with rewording'
 . "$TEST_DIRECTORY"/lib-rebase.sh
 
 test_expect_success 'setup' '
-	test_commit master file-1 test &&
+	test_commit main file-1 test &&
 
 	git checkout -b stuff &&
 
@@ -22,7 +22,7 @@ test_expect_success 'reword without issues functions as intended' '
 
 	set_fake_editor &&
 	FAKE_LINES="pick 1 reword 2" FAKE_COMMIT_MESSAGE="feature_b_reworded" \
-		git rebase -i -v master &&
+		git rebase -i -v main &&
 
 	test "$(git log -1 --format=%B)" = "feature_b_reworded" &&
 	test $(git rev-list --count HEAD) = 3
@@ -35,7 +35,7 @@ test_expect_success 'reword after a conflict preserves commit' '
 
 	set_fake_editor &&
 	test_must_fail env FAKE_LINES="reword 2" \
-		git rebase -i -v master &&
+		git rebase -i -v main &&
 
 	git checkout --theirs file-2 &&
 	git add file-2 &&
diff --git a/t/t3427-rebase-subtree.sh b/t/t3427-rebase-subtree.sh
index 5839719ba1..265856ece6 100755
--- a/t/t3427-rebase-subtree.sh
+++ b/t/t3427-rebase-subtree.sh
@@ -17,7 +17,7 @@ commit_message() {
 #
 # topic_1 - topic_2 - topic_3
 #                             \
-# README ---------------------- Add subproject master - topic_4 - files_subtree/topic_5
+# README ---------------------- Add subproject main - topic_4 - files_subtree/topic_5
 #
 # Where the merge moves the files topic_[123].t into the subdirectory
 # files_subtree/ and topic_4 as well as files_subtree/topic_5 add files to that
@@ -28,7 +28,7 @@ commit_message() {
 # an empty commit is added on top. The pre-rebase commit history looks like
 # this:
 #
-# Add subproject master - topic_4 - files_subtree/topic_5 - Empty commit
+# Add subproject main - topic_4 - files_subtree/topic_5 - Empty commit
 #
 # where the root commit adds three files: topic_1.t, topic_2.t and topic_3.t.
 #
@@ -48,11 +48,11 @@ test_expect_success 'setup' '
 	test_commit -C files topic_3 &&
 
 	: perform subtree merge into files_subtree/ &&
-	git fetch files refs/heads/master:refs/heads/files-master &&
+	git fetch files refs/heads/main:refs/heads/files-main &&
 	git merge -s ours --no-commit --allow-unrelated-histories \
-		files-master &&
-	git read-tree --prefix=files_subtree -u files-master &&
-	git commit -m "Add subproject master" &&
+		files-main &&
+	git read-tree --prefix=files_subtree -u files-main &&
+	git commit -m "Add subproject main" &&
 
 	: add two extra commits to rebase &&
 	test_commit -C files_subtree topic_4 &&
@@ -70,7 +70,7 @@ test_expect_success 'setup' '
 test_expect_failure REBASE_P 'Rebase -Xsubtree --preserve-merges --onto commit' '
 	reset_rebase &&
 	git checkout -b rebase-preserve-merges to-rebase &&
-	git rebase -Xsubtree=files_subtree --preserve-merges --onto files-master master &&
+	git rebase -Xsubtree=files_subtree --preserve-merges --onto files-main main &&
 	verbose test "$(commit_message HEAD~)" = "topic_4" &&
 	verbose test "$(commit_message HEAD)" = "files_subtree/topic_5"
 '
@@ -79,7 +79,7 @@ test_expect_failure REBASE_P 'Rebase -Xsubtree --preserve-merges --onto commit'
 test_expect_failure REBASE_P 'Rebase -Xsubtree --keep-empty --preserve-merges --onto commit' '
 	reset_rebase &&
 	git checkout -b rebase-keep-empty to-rebase &&
-	git rebase -Xsubtree=files_subtree --keep-empty --preserve-merges --onto files-master master &&
+	git rebase -Xsubtree=files_subtree --keep-empty --preserve-merges --onto files-main main &&
 	verbose test "$(commit_message HEAD~2)" = "topic_4" &&
 	verbose test "$(commit_message HEAD~)" = "files_subtree/topic_5" &&
 	verbose test "$(commit_message HEAD)" = "Empty commit"
@@ -88,7 +88,7 @@ test_expect_failure REBASE_P 'Rebase -Xsubtree --keep-empty --preserve-merges --
 test_expect_success 'Rebase -Xsubtree --empty=ask --onto commit' '
 	reset_rebase &&
 	git checkout -b rebase-onto to-rebase &&
-	test_must_fail git rebase -Xsubtree=files_subtree --empty=ask --onto files-master master &&
+	test_must_fail git rebase -Xsubtree=files_subtree --empty=ask --onto files-main main &&
 	: first pick results in no changes &&
 	git rebase --skip &&
 	verbose test "$(commit_message HEAD~2)" = "topic_4" &&
@@ -99,7 +99,7 @@ test_expect_success 'Rebase -Xsubtree --empty=ask --onto commit' '
 test_expect_success 'Rebase -Xsubtree --empty=ask --rebase-merges --onto commit' '
 	reset_rebase &&
 	git checkout -b rebase-merges-onto to-rebase &&
-	test_must_fail git rebase -Xsubtree=files_subtree --empty=ask --rebase-merges --onto files-master --root &&
+	test_must_fail git rebase -Xsubtree=files_subtree --empty=ask --rebase-merges --onto files-main --root &&
 	: first pick results in no changes &&
 	git rebase --skip &&
 	verbose test "$(commit_message HEAD~2)" = "topic_4" &&
diff --git a/t/t3430-rebase-merges.sh b/t/t3430-rebase-merges.sh
index b454f400eb..3cc99693af 100755
--- a/t/t3430-rebase-merges.sh
+++ b/t/t3430-rebase-merges.sh
@@ -12,7 +12,7 @@ Initial setup:
 
     -- B --                   (first)
    /       \
- A - C - D - E - H            (master)
+ A - C - D - E - H            (main)
    \    \       /
     \    F - G                (second)
      \
@@ -37,7 +37,7 @@ test_expect_success 'setup' '
 	git checkout -b first &&
 	test_commit B &&
 	b=$(git rev-parse --short HEAD) &&
-	git checkout master &&
+	git checkout main &&
 	test_commit C &&
 	c=$(git rev-parse --short HEAD) &&
 	test_commit D &&
@@ -52,7 +52,7 @@ test_expect_success 'setup' '
 	f=$(git rev-parse --short HEAD) &&
 	test_commit G &&
 	g=$(git rev-parse --short HEAD) &&
-	git checkout master &&
+	git checkout main &&
 	git merge --no-commit G &&
 	test_tick &&
 	git commit -m H &&
@@ -82,7 +82,7 @@ test_expect_success 'create completely different structure' '
 	EOF
 	test_config sequence.editor \""$PWD"/replace-editor.sh\" &&
 	test_tick &&
-	git rebase -i -r A master &&
+	git rebase -i -r A main &&
 	test_cmp_graph <<-\EOF
 	*   Merge the topic branch '\''onebranch'\''
 	|\
@@ -183,7 +183,7 @@ test_expect_success 'fast-forward merge -c still rewords' '
 '
 
 test_expect_success 'with a branch tip that was cherry-picked already' '
-	git checkout -b already-upstream master &&
+	git checkout -b already-upstream main &&
 	base="$(git rev-parse --verify HEAD)" &&
 
 	test_commit A1 &&
@@ -211,7 +211,7 @@ test_expect_success 'with a branch tip that was cherry-picked already' '
 '
 
 test_expect_success 'do not rebase cousins unless asked for' '
-	git checkout -b cousins master &&
+	git checkout -b cousins main &&
 	before="$(git rev-parse --verify HEAD)" &&
 	test_tick &&
 	git rebase -r HEAD^ &&
@@ -340,7 +340,7 @@ test_expect_success 'a "merge" into a root commit is a fast-forward' '
 test_expect_success 'A root commit can be a cousin, treat it that way' '
 	git checkout --orphan khnum &&
 	test_commit yama &&
-	git checkout -b asherah master &&
+	git checkout -b asherah main &&
 	test_commit shamkat &&
 	git merge --allow-unrelated-histories khnum &&
 	test_tick &&
@@ -367,7 +367,7 @@ test_expect_success 'labels that are object IDs are rewritten' '
 	git checkout -b third B &&
 	test_commit I &&
 	third=$(git rev-parse HEAD) &&
-	git checkout -b labels master &&
+	git checkout -b labels main &&
 	git merge --no-commit third &&
 	test_tick &&
 	git commit -m "Merge commit '\''$third'\'' into labels" &&
diff --git a/t/t3431-rebase-fork-point.sh b/t/t3431-rebase-fork-point.sh
index 172562789e..d5d9b2304d 100755
--- a/t/t3431-rebase-fork-point.sh
+++ b/t/t3431-rebase-fork-point.sh
@@ -7,11 +7,11 @@ test_description='git rebase --fork-point test'
 
 . ./test-lib.sh
 
-# A---B---D---E    (master)
+# A---B---D---E    (main)
 #      \
 #       C*---F---G (side)
 #
-# C was formerly part of master but master was rewound to remove C
+# C was formerly part of main but main was rewound to remove C
 #
 test_expect_success setup '
 	test_commit A &&
@@ -30,7 +30,7 @@ test_rebase () {
 	expected="$1" &&
 	shift &&
 	test_expect_success "git rebase $*" "
-		git checkout master &&
+		git checkout main &&
 		git reset --hard E &&
 		git checkout side &&
 		git reset --hard G &&
@@ -48,26 +48,26 @@ test_rebase 'G F C E D B A' --no-fork-point
 test_rebase 'G F C D B A' --no-fork-point --onto D
 test_rebase 'G F C B A' --no-fork-point --keep-base
 
-test_rebase 'G F E D B A' --fork-point refs/heads/master
-test_rebase 'G F E D B A' --fork-point master
+test_rebase 'G F E D B A' --fork-point refs/heads/main
+test_rebase 'G F E D B A' --fork-point main
 
-test_rebase 'G F D B A' --fork-point --onto D refs/heads/master
-test_rebase 'G F D B A' --fork-point --onto D master
+test_rebase 'G F D B A' --fork-point --onto D refs/heads/main
+test_rebase 'G F D B A' --fork-point --onto D main
 
-test_rebase 'G F B A' --fork-point --keep-base refs/heads/master
-test_rebase 'G F B A' --fork-point --keep-base master
+test_rebase 'G F B A' --fork-point --keep-base refs/heads/main
+test_rebase 'G F B A' --fork-point --keep-base main
 
-test_rebase 'G F C E D B A' refs/heads/master
-test_rebase 'G F C E D B A' master
+test_rebase 'G F C E D B A' refs/heads/main
+test_rebase 'G F C E D B A' main
 
-test_rebase 'G F C D B A' --onto D refs/heads/master
-test_rebase 'G F C D B A' --onto D master
+test_rebase 'G F C D B A' --onto D refs/heads/main
+test_rebase 'G F C D B A' --onto D main
 
-test_rebase 'G F C B A' --keep-base refs/heads/master
-test_rebase 'G F C B A' --keep-base master
+test_rebase 'G F C B A' --keep-base refs/heads/main
+test_rebase 'G F C B A' --keep-base main
 
 test_expect_success 'git rebase --fork-point with ambigous refname' '
-	git checkout master &&
+	git checkout main &&
 	git checkout -b one &&
 	git checkout side &&
 	git tag one &&
diff --git a/t/t3432-rebase-fast-forward.sh b/t/t3432-rebase-fast-forward.sh
index a29eda87e9..b87537ca7d 100755
--- a/t/t3432-rebase-fast-forward.sh
+++ b/t/t3432-rebase-fast-forward.sh
@@ -84,19 +84,19 @@ test_rebase_same_head_ () {
 
 changes='no changes'
 test_rebase_same_head success noop same success work same
-test_rebase_same_head success noop same success work same master
+test_rebase_same_head success noop same success work same main
 test_rebase_same_head success noop same success work diff --onto B B
 test_rebase_same_head success noop same success work diff --onto B... B
-test_rebase_same_head success noop same success work same --onto master... master
-test_rebase_same_head success noop same success work same --keep-base master
+test_rebase_same_head success noop same success work same --onto main... main
+test_rebase_same_head success noop same success work same --keep-base main
 test_rebase_same_head success noop same success work same --keep-base
 test_rebase_same_head success noop same success work same --no-fork-point
 test_rebase_same_head success noop same success work same --keep-base --no-fork-point
-test_rebase_same_head success noop same success work same --fork-point master
+test_rebase_same_head success noop same success work same --fork-point main
 test_rebase_same_head success noop same success work diff --fork-point --onto B B
 test_rebase_same_head success noop same success work diff --fork-point --onto B... B
-test_rebase_same_head success noop same success work same --fork-point --onto master... master
-test_rebase_same_head success noop same success work same --keep-base --keep-base master
+test_rebase_same_head success noop same success work same --fork-point --onto main... main
+test_rebase_same_head success noop same success work same --keep-base --keep-base main
 
 test_expect_success 'add work same to side' '
 	test_commit E
@@ -104,22 +104,22 @@ test_expect_success 'add work same to side' '
 
 changes='our changes'
 test_rebase_same_head success noop same success work same
-test_rebase_same_head success noop same success work same master
+test_rebase_same_head success noop same success work same main
 test_rebase_same_head success noop same success work diff --onto B B
 test_rebase_same_head success noop same success work diff --onto B... B
-test_rebase_same_head success noop same success work same --onto master... master
-test_rebase_same_head success noop same success work same --keep-base master
+test_rebase_same_head success noop same success work same --onto main... main
+test_rebase_same_head success noop same success work same --keep-base main
 test_rebase_same_head success noop same success work same --keep-base
 test_rebase_same_head success noop same success work same --no-fork-point
 test_rebase_same_head success noop same success work same --keep-base --no-fork-point
-test_rebase_same_head success noop same success work same --fork-point master
+test_rebase_same_head success noop same success work same --fork-point main
 test_rebase_same_head success noop same success work diff --fork-point --onto B B
 test_rebase_same_head success noop same success work diff --fork-point --onto B... B
-test_rebase_same_head success noop same success work same --fork-point --onto master... master
-test_rebase_same_head success noop same success work same --fork-point --keep-base master
+test_rebase_same_head success noop same success work same --fork-point --onto main... main
+test_rebase_same_head success noop same success work same --fork-point --keep-base main
 
 test_expect_success 'add work same to upstream' '
-	git checkout master &&
+	git checkout main &&
 	test_commit F &&
 	git checkout side
 '
@@ -127,12 +127,12 @@ test_expect_success 'add work same to upstream' '
 changes='our and their changes'
 test_rebase_same_head success noop same success work diff --onto B B
 test_rebase_same_head success noop same success work diff --onto B... B
-test_rebase_same_head success noop same success work diff --onto master... master
-test_rebase_same_head success noop same success work diff --keep-base master
+test_rebase_same_head success noop same success work diff --onto main... main
+test_rebase_same_head success noop same success work diff --keep-base main
 test_rebase_same_head success noop same success work diff --keep-base
 test_rebase_same_head failure work same success work diff --fork-point --onto B B
 test_rebase_same_head failure work same success work diff --fork-point --onto B... B
-test_rebase_same_head success noop same success work diff --fork-point --onto master... master
-test_rebase_same_head success noop same success work diff --fork-point --keep-base master
+test_rebase_same_head success noop same success work diff --fork-point --onto main... main
+test_rebase_same_head success noop same success work diff --fork-point --keep-base main
 
 test_done
diff --git a/t/t3434-rebase-i18n.sh b/t/t3434-rebase-i18n.sh
index c7c835cde9..a252908d02 100755
--- a/t/t3434-rebase-i18n.sh
+++ b/t/t3434-rebase-i18n.sh
@@ -7,7 +7,7 @@ test_description='rebase with changing encoding
 
 Initial setup:
 
-1 - 2              master
+1 - 2              main
  \
   3 - 4            first
    \
@@ -41,7 +41,7 @@ test_expect_success 'rebase --rebase-merges update encoding eucJP to UTF-8' '
 	git config i18n.commitencoding eucJP &&
 	git merge -F "$TEST_DIRECTORY/t3434/eucJP.txt" second &&
 	git config i18n.commitencoding UTF-8 &&
-	git rebase --rebase-merges master &&
+	git rebase --rebase-merges main &&
 	compare_msg eucJP.txt eucJP UTF-8
 '
 
@@ -50,7 +50,7 @@ test_expect_success 'rebase --rebase-merges update encoding eucJP to ISO-2022-JP
 	git config i18n.commitencoding eucJP &&
 	git merge -F "$TEST_DIRECTORY/t3434/eucJP.txt" second &&
 	git config i18n.commitencoding ISO-2022-JP &&
-	git rebase --rebase-merges master &&
+	git rebase --rebase-merges main &&
 	compare_msg eucJP.txt eucJP ISO-2022-JP
 '
 
@@ -66,7 +66,7 @@ test_rebase_continue_update_encode () {
 		git config i18n.commitencoding $old &&
 		git commit -F "$TEST_DIRECTORY/t3434/$msgfile" &&
 		git config i18n.commitencoding $new &&
-		test_must_fail git rebase -m master &&
+		test_must_fail git rebase -m main &&
 		test -f .git/rebase-merge/message &&
 		git stripspace <.git/rebase-merge/message >two.t &&
 		git add two.t &&
diff --git a/t/t3435-rebase-gpg-sign.sh b/t/t3435-rebase-gpg-sign.sh
index 54120b09d6..aab2b3aab8 100755
--- a/t/t3435-rebase-gpg-sign.sh
+++ b/t/t3435-rebase-gpg-sign.sh
@@ -46,7 +46,7 @@ test_expect_success 'setup: merge commit' '
 	test_commit fork-point &&
 	git switch -c side &&
 	test_commit three &&
-	git switch master &&
+	git switch main &&
 	git merge --no-ff side &&
 	git tag merged
 '
@@ -64,7 +64,7 @@ test_rebase_gpg_sign   false -i --no-gpg-sign --gpg-sign
 test_expect_failure 'rebase -p --no-gpg-sign override commit.gpgsign' '
 	git reset --hard merged &&
 	git config commit.gpgsign true &&
-	git rebase -p --no-gpg-sign --onto=one fork-point master &&
+	git rebase -p --no-gpg-sign --onto=one fork-point main &&
 	test_must_fail git verify-commit HEAD
 '
 
diff --git a/t/t3436-rebase-more-options.sh b/t/t3436-rebase-more-options.sh
index eaaf4c8d1d..4d106642ba 100755
--- a/t/t3436-rebase-more-options.sh
+++ b/t/t3436-rebase-more-options.sh
@@ -28,7 +28,7 @@ test_expect_success 'setup' '
 	test_commit commit2 foo foo2 &&
 	test_commit commit3 foo foo3 &&
 
-	git checkout --orphan master &&
+	git checkout --orphan main &&
 	rm foo &&
 	test_write_lines "line 1" "        line 2" "line 3" >file &&
 	git commit -am "add file" &&
diff --git a/t/test-lib.sh b/t/test-lib.sh
index c464f8dcc8..4ae87a5c4e 100644
--- a/t/test-lib.sh
+++ b/t/test-lib.sh
@@ -257,7 +257,13 @@ case "$TRASH_DIRECTORY" in
 esac
 
 case "$TEST_NUMBER" in
-[0-2]*|3[0-3]*)
+3404)
+	# Avoid conflicts with patch series that are cooking at the same time
+	# as the patch series changing the default of `init.defaultBranch`.
+	GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+	export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+	;;
+[0-2]*|3[0-4]*)
 	GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 	export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 	;;
-- 
gitgitgadget


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH v2 07/27] t3[5-9]*: adjust the references to the default branch name "main"
  2020-11-17 16:12 ` [PATCH v2 00/27] tests: use " Johannes Schindelin via GitGitGadget
                     ` (5 preceding siblings ...)
  2020-11-17 16:12   ` [PATCH v2 06/27] t34*: adjust the references to the default branch name "main" Johannes Schindelin via GitGitGadget
@ 2020-11-17 16:12   ` Johannes Schindelin via GitGitGadget
  2020-11-17 16:12   ` [PATCH v2 08/27] t4*: " Johannes Schindelin via GitGitGadget
                     ` (21 subsequent siblings)
  28 siblings, 0 replies; 163+ messages in thread
From: Johannes Schindelin via GitGitGadget @ 2020-11-17 16:12 UTC (permalink / raw)
  To: git
  Cc: Felipe Contreras, Ævar Arnfjörð Bjarmason,
	Johannes Schindelin, Jeff King, Johannes Schindelin,
	Johannes Schindelin

From: Johannes Schindelin <johannes.schindelin@gmx.de>

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>
---
 t/t3500-cherry.sh                   | 12 ++++-----
 t/t3501-revert-cherry-pick.sh       |  4 +--
 t/t3502-cherry-pick-merge.sh        |  2 +-
 t/t3503-cherry-pick-root.sh         | 10 ++++----
 t/t3504-cherry-pick-rerere.sh       | 24 ++++++++---------
 t/t3505-cherry-pick-empty.sh        | 24 ++++++++---------
 t/t3506-cherry-pick-ff.sh           |  8 +++---
 t/t3507-cherry-pick-conflict.sh     |  2 +-
 t/t3508-cherry-pick-many-commits.sh | 38 +++++++++++++--------------
 t/t3509-cherry-pick-merge-df.sh     |  2 +-
 t/t3512-cherry-pick-submodule.sh    |  2 +-
 t/t3600-rm.sh                       | 10 ++++----
 t/t3701-add-interactive.sh          |  4 +--
 t/t3901-i18n-patch.sh               | 40 ++++++++++++++---------------
 t/t3903-stash.sh                    | 32 +++++++++++------------
 t/t3910-mac-os-precompose.sh        |  6 ++---
 t/test-lib.sh                       |  2 +-
 17 files changed, 111 insertions(+), 111 deletions(-)

diff --git a/t/t3500-cherry.sh b/t/t3500-cherry.sh
index 2b8d9cb38e..2528e773a6 100755
--- a/t/t3500-cherry.sh
+++ b/t/t3500-cherry.sh
@@ -5,7 +5,7 @@
 
 test_description='git cherry should detect patches integrated upstream
 
-This test cherry-picks one local change of two into master branch, and
+This test cherry-picks one local change of two into main branch, and
 checks that git cherry only returns the second patch in the local branch
 '
 . ./test-lib.sh
@@ -32,7 +32,7 @@ test_expect_success \
      test_tick &&
      git commit -m "Add C." &&
 
-     git checkout -f master &&
+     git checkout -f main &&
      rm -f B C &&
 
      echo Third >> A &&
@@ -40,19 +40,19 @@ test_expect_success \
      test_tick &&
      git commit -m "Modify A." &&
 
-     expr "$(echo $(git cherry master my-topic-branch) )" : "+ [^ ]* + .*"
+     expr "$(echo $(git cherry main my-topic-branch) )" : "+ [^ ]* + .*"
 '
 
 test_expect_success \
     'check that cherry with limit returns only the top patch'\
-    'expr "$(echo $(git cherry master my-topic-branch my-topic-branch^1) )" : "+ [^ ]*"
+    'expr "$(echo $(git cherry main my-topic-branch my-topic-branch^1) )" : "+ [^ ]*"
 '
 
 test_expect_success \
     'cherry-pick one of the 2 patches, and check cherry recognized one and only one as new' \
     'git cherry-pick my-topic-branch^0 &&
-     echo $(git cherry master my-topic-branch) &&
-     expr "$(echo $(git cherry master my-topic-branch) )" : "+ [^ ]* - .*"
+     echo $(git cherry main my-topic-branch) &&
+     expr "$(echo $(git cherry main my-topic-branch) )" : "+ [^ ]* - .*"
 '
 
 test_expect_success 'cherry ignores whitespace' '
diff --git a/t/t3501-revert-cherry-pick.sh b/t/t3501-revert-cherry-pick.sh
index 3669dfb1be..0adfdb4b6c 100755
--- a/t/t3501-revert-cherry-pick.sh
+++ b/t/t3501-revert-cherry-pick.sh
@@ -112,7 +112,7 @@ test_expect_success 'cherry-pick on unborn branch' '
 test_expect_success 'cherry-pick "-" to pick from previous branch' '
 	git checkout unborn &&
 	test_commit to-pick actual content &&
-	git checkout master &&
+	git checkout main &&
 	git cherry-pick - &&
 	echo content >expect &&
 	test_cmp expect actual
@@ -132,7 +132,7 @@ test_expect_success 'cherry-pick "-" is meaningless without checkout' '
 test_expect_success 'cherry-pick "-" works with arguments' '
 	git checkout -b side-branch &&
 	test_commit change actual change &&
-	git checkout master &&
+	git checkout main &&
 	git cherry-pick -s - &&
 	echo "Signed-off-by: C O Mitter <committer@example.com>" >expect &&
 	git cat-file commit HEAD | grep ^Signed-off-by: >signoff &&
diff --git a/t/t3502-cherry-pick-merge.sh b/t/t3502-cherry-pick-merge.sh
index 8b635a196d..4d6ff14eb6 100755
--- a/t/t3502-cherry-pick-merge.sh
+++ b/t/t3502-cherry-pick-merge.sh
@@ -25,7 +25,7 @@ test_expect_success setup '
 	echo new line >B &&
 	git commit -m "add line to B" B &&
 	git tag b &&
-	git checkout master &&
+	git checkout main &&
 	git merge side &&
 	git tag c
 
diff --git a/t/t3503-cherry-pick-root.sh b/t/t3503-cherry-pick-root.sh
index e27f39d1e5..59496a56b7 100755
--- a/t/t3503-cherry-pick-root.sh
+++ b/t/t3503-cherry-pick-root.sh
@@ -30,7 +30,7 @@ test_expect_success setup '
 test_expect_success 'cherry-pick a root commit' '
 
 	git checkout second^0 &&
-	git cherry-pick master &&
+	git cherry-pick main &&
 	echo first >expect &&
 	test_cmp expect file1
 
@@ -38,14 +38,14 @@ test_expect_success 'cherry-pick a root commit' '
 
 test_expect_success 'revert a root commit' '
 
-	git revert master &&
+	git revert main &&
 	test_path_is_missing file1
 
 '
 
 test_expect_success 'cherry-pick a root commit with an external strategy' '
 
-	git cherry-pick --strategy=resolve master &&
+	git cherry-pick --strategy=resolve main &&
 	echo first >expect &&
 	test_cmp expect file1
 
@@ -53,7 +53,7 @@ test_expect_success 'cherry-pick a root commit with an external strategy' '
 
 test_expect_success 'revert a root commit with an external strategy' '
 
-	git revert --strategy=resolve master &&
+	git revert --strategy=resolve main &&
 	test_path_is_missing file1
 
 '
@@ -65,7 +65,7 @@ test_expect_success 'cherry-pick two root commits' '
 	echo third >expect.file3 &&
 
 	git checkout second^0 &&
-	git cherry-pick master third &&
+	git cherry-pick main third &&
 
 	test_cmp expect.file1 file1 &&
 	test_cmp expect.file2 file2 &&
diff --git a/t/t3504-cherry-pick-rerere.sh b/t/t3504-cherry-pick-rerere.sh
index 80a0d08706..3804527e2e 100755
--- a/t/t3504-cherry-pick-rerere.sh
+++ b/t/t3504-cherry-pick-rerere.sh
@@ -6,8 +6,8 @@ test_description='cherry-pick should rerere for conflicts'
 
 test_expect_success setup '
 	test_commit foo &&
-	test_commit foo-master foo &&
-	test_commit bar-master bar &&
+	test_commit foo-main foo &&
+	test_commit bar-main bar &&
 
 	git checkout -b dev foo &&
 	test_commit foo-dev foo &&
@@ -16,7 +16,7 @@ test_expect_success setup '
 '
 
 test_expect_success 'conflicting merge' '
-	test_must_fail git merge master
+	test_must_fail git merge main
 '
 
 test_expect_success 'fixup' '
@@ -29,7 +29,7 @@ test_expect_success 'fixup' '
 '
 
 test_expect_success 'cherry-pick conflict with --rerere-autoupdate' '
-	test_must_fail git cherry-pick --rerere-autoupdate foo..bar-master &&
+	test_must_fail git cherry-pick --rerere-autoupdate foo..bar-main &&
 	test_cmp foo-expect foo &&
 	git diff-files --quiet &&
 	test_must_fail git cherry-pick --continue &&
@@ -41,7 +41,7 @@ test_expect_success 'cherry-pick conflict with --rerere-autoupdate' '
 
 test_expect_success 'cherry-pick conflict repsects rerere.autoUpdate' '
 	test_config rerere.autoUpdate true &&
-	test_must_fail git cherry-pick foo..bar-master &&
+	test_must_fail git cherry-pick foo..bar-main &&
 	test_cmp foo-expect foo &&
 	git diff-files --quiet &&
 	test_must_fail git cherry-pick --continue &&
@@ -53,7 +53,7 @@ test_expect_success 'cherry-pick conflict repsects rerere.autoUpdate' '
 
 test_expect_success 'cherry-pick conflict with --no-rerere-autoupdate' '
 	test_config rerere.autoUpdate true &&
-	test_must_fail git cherry-pick --no-rerere-autoupdate foo..bar-master &&
+	test_must_fail git cherry-pick --no-rerere-autoupdate foo..bar-main &&
 	test_cmp foo-expect foo &&
 	test_must_fail git diff-files --quiet &&
 	git add foo &&
@@ -66,7 +66,7 @@ test_expect_success 'cherry-pick conflict with --no-rerere-autoupdate' '
 '
 
 test_expect_success 'cherry-pick --continue rejects --rerere-autoupdate' '
-	test_must_fail git cherry-pick --rerere-autoupdate foo..bar-master &&
+	test_must_fail git cherry-pick --rerere-autoupdate foo..bar-main &&
 	test_cmp foo-expect foo &&
 	git diff-files --quiet &&
 	test_must_fail git cherry-pick --continue --rerere-autoupdate >actual 2>&1 &&
@@ -79,25 +79,25 @@ test_expect_success 'cherry-pick --continue rejects --rerere-autoupdate' '
 '
 
 test_expect_success 'cherry-pick --rerere-autoupdate more than once' '
-	test_must_fail git cherry-pick --rerere-autoupdate --rerere-autoupdate foo..bar-master &&
+	test_must_fail git cherry-pick --rerere-autoupdate --rerere-autoupdate foo..bar-main &&
 	test_cmp foo-expect foo &&
 	git diff-files --quiet &&
 	git cherry-pick --abort &&
-	test_must_fail git cherry-pick --rerere-autoupdate --no-rerere-autoupdate --rerere-autoupdate foo..bar-master &&
+	test_must_fail git cherry-pick --rerere-autoupdate --no-rerere-autoupdate --rerere-autoupdate foo..bar-main &&
 	test_cmp foo-expect foo &&
 	git diff-files --quiet &&
 	git cherry-pick --abort &&
-	test_must_fail git cherry-pick --rerere-autoupdate --no-rerere-autoupdate foo..bar-master &&
+	test_must_fail git cherry-pick --rerere-autoupdate --no-rerere-autoupdate foo..bar-main &&
 	test_must_fail git diff-files --quiet &&
 	git cherry-pick --abort
 '
 
 test_expect_success 'cherry-pick conflict without rerere' '
 	test_config rerere.enabled false &&
-	test_must_fail git cherry-pick foo-master &&
+	test_must_fail git cherry-pick foo-main &&
 	grep ===== foo &&
 	grep foo-dev foo &&
-	grep foo-master foo
+	grep foo-main foo
 '
 
 test_done
diff --git a/t/t3505-cherry-pick-empty.sh b/t/t3505-cherry-pick-empty.sh
index 5f911bb529..07419a4e4a 100755
--- a/t/t3505-cherry-pick-empty.sh
+++ b/t/t3505-cherry-pick-empty.sh
@@ -17,7 +17,7 @@ test_expect_success setup '
 	test_tick &&
 	git commit --allow-empty-message -m "" &&
 
-	git checkout master &&
+	git checkout main &&
 	git checkout -b empty-change-branch &&
 	test_tick &&
 	git commit --allow-empty -m "empty"
@@ -25,7 +25,7 @@ test_expect_success setup '
 '
 
 test_expect_success 'cherry-pick an empty commit' '
-	git checkout master &&
+	git checkout main &&
 	test_expect_code 1 git cherry-pick empty-change-branch
 '
 
@@ -35,7 +35,7 @@ test_expect_success 'index lockfile was removed' '
 
 test_expect_success 'cherry-pick a commit with an empty message' '
 	test_when_finished "git reset --hard empty-message-branch~1" &&
-	git checkout master &&
+	git checkout main &&
 	git cherry-pick empty-message-branch
 '
 
@@ -44,12 +44,12 @@ test_expect_success 'index lockfile was removed' '
 '
 
 test_expect_success 'cherry-pick a commit with an empty message with --allow-empty-message' '
-	git checkout -f master &&
+	git checkout -f main &&
 	git cherry-pick --allow-empty-message empty-message-branch
 '
 
 test_expect_success 'cherry pick an empty non-ff commit without --allow-empty' '
-	git checkout master &&
+	git checkout main &&
 	echo fourth >>file2 &&
 	git add file2 &&
 	git commit -m "fourth" &&
@@ -57,22 +57,22 @@ test_expect_success 'cherry pick an empty non-ff commit without --allow-empty' '
 '
 
 test_expect_success 'cherry pick an empty non-ff commit with --allow-empty' '
-	git checkout master &&
+	git checkout main &&
 	git cherry-pick --allow-empty empty-change-branch
 '
 
 test_expect_success 'cherry pick with --keep-redundant-commits' '
-	git checkout master &&
+	git checkout main &&
 	git cherry-pick --keep-redundant-commits HEAD^
 '
 
 test_expect_success 'cherry-pick a commit that becomes no-op (prep)' '
-	git checkout master &&
+	git checkout main &&
 	git branch fork &&
 	echo foo >file2 &&
 	git add file2 &&
 	test_tick &&
-	git commit -m "add file2 on master" &&
+	git commit -m "add file2 on main" &&
 
 	git checkout fork &&
 	echo foo >file2 &&
@@ -84,15 +84,15 @@ test_expect_success 'cherry-pick a commit that becomes no-op (prep)' '
 test_expect_success 'cherry-pick a no-op without --keep-redundant' '
 	git reset --hard &&
 	git checkout fork^0 &&
-	test_must_fail git cherry-pick master
+	test_must_fail git cherry-pick main
 '
 
 test_expect_success 'cherry-pick a no-op with --keep-redundant' '
 	git reset --hard &&
 	git checkout fork^0 &&
-	git cherry-pick --keep-redundant-commits master &&
+	git cherry-pick --keep-redundant-commits main &&
 	git show -s --format=%s >actual &&
-	echo "add file2 on master" >expect &&
+	echo "add file2 on main" >expect &&
 	test_cmp expect actual
 '
 
diff --git a/t/t3506-cherry-pick-ff.sh b/t/t3506-cherry-pick-ff.sh
index 9d5adbc130..08b461dfcf 100755
--- a/t/t3506-cherry-pick-ff.sh
+++ b/t/t3506-cherry-pick-ff.sh
@@ -24,7 +24,7 @@ test_expect_success setup '
 '
 
 test_expect_success 'cherry-pick using --ff fast forwards' '
-	git checkout master &&
+	git checkout main &&
 	git reset --hard first &&
 	test_tick &&
 	git cherry-pick --ff second &&
@@ -32,7 +32,7 @@ test_expect_success 'cherry-pick using --ff fast forwards' '
 '
 
 test_expect_success 'cherry-pick not using --ff does not fast forwards' '
-	git checkout master &&
+	git checkout main &&
 	git reset --hard first &&
 	test_tick &&
 	git cherry-pick second &&
@@ -49,7 +49,7 @@ test_expect_success 'cherry-pick not using --ff does not fast forwards' '
 # (This has been taken from t3502-cherry-pick-merge.sh)
 #
 test_expect_success 'merge setup' '
-	git checkout master &&
+	git checkout main &&
 	git reset --hard first &&
 	echo new line >A &&
 	git add A &&
@@ -62,7 +62,7 @@ test_expect_success 'merge setup' '
 	test_tick &&
 	git commit -m "add line to B" B &&
 	git tag B &&
-	git checkout master &&
+	git checkout main &&
 	git merge side &&
 	git tag C &&
 	git checkout -b new A
diff --git a/t/t3507-cherry-pick-conflict.sh b/t/t3507-cherry-pick-conflict.sh
index a21adcf0e4..e0f77ba6ad 100755
--- a/t/t3507-cherry-pick-conflict.sh
+++ b/t/t3507-cherry-pick-conflict.sh
@@ -29,7 +29,7 @@ test_expect_success setup '
 	test_commit redundant-pick foo c redundant &&
 	git commit --allow-empty --allow-empty-message &&
 	git tag empty &&
-	git checkout master &&
+	git checkout main &&
 	git config advice.detachedhead false
 
 '
diff --git a/t/t3508-cherry-pick-many-commits.sh b/t/t3508-cherry-pick-many-commits.sh
index 23070a7b73..bdb995235f 100755
--- a/t/t3508-cherry-pick-many-commits.sh
+++ b/t/t3508-cherry-pick-many-commits.sh
@@ -31,7 +31,7 @@ test_expect_success setup '
 '
 
 test_expect_success 'cherry-pick first..fourth works' '
-	git checkout -f master &&
+	git checkout -f main &&
 	git reset --hard first &&
 	test_tick &&
 	git cherry-pick first..fourth &&
@@ -45,7 +45,7 @@ test_expect_success 'cherry-pick three one two works' '
 	test_commit one &&
 	test_commit two &&
 	test_commit three &&
-	git checkout -f master &&
+	git checkout -f main &&
 	git reset --hard first &&
 	git cherry-pick three one two &&
 	git diff --quiet three &&
@@ -56,28 +56,28 @@ two"
 '
 
 test_expect_success 'cherry-pick three one two: fails' '
-	git checkout -f master &&
+	git checkout -f main &&
 	git reset --hard first &&
 	test_must_fail git cherry-pick three one two:
 '
 
 test_expect_success 'output to keep user entertained during multi-pick' '
 	cat <<-\EOF >expected &&
-	[master OBJID] second
+	[main OBJID] second
 	 Author: A U Thor <author@example.com>
 	 Date: Thu Apr 7 15:14:13 2005 -0700
 	 1 file changed, 1 insertion(+)
-	[master OBJID] third
+	[main OBJID] third
 	 Author: A U Thor <author@example.com>
 	 Date: Thu Apr 7 15:15:13 2005 -0700
 	 1 file changed, 1 insertion(+)
-	[master OBJID] fourth
+	[main OBJID] fourth
 	 Author: A U Thor <author@example.com>
 	 Date: Thu Apr 7 15:16:13 2005 -0700
 	 1 file changed, 1 insertion(+)
 	EOF
 
-	git checkout -f master &&
+	git checkout -f main &&
 	git reset --hard first &&
 	test_tick &&
 	git cherry-pick first..fourth >actual &&
@@ -87,7 +87,7 @@ test_expect_success 'output to keep user entertained during multi-pick' '
 '
 
 test_expect_success 'cherry-pick --strategy resolve first..fourth works' '
-	git checkout -f master &&
+	git checkout -f main &&
 	git reset --hard first &&
 	test_tick &&
 	git cherry-pick --strategy resolve first..fourth &&
@@ -99,23 +99,23 @@ test_expect_success 'cherry-pick --strategy resolve first..fourth works' '
 test_expect_success 'output during multi-pick indicates merge strategy' '
 	cat <<-\EOF >expected &&
 	Trying simple merge.
-	[master OBJID] second
+	[main OBJID] second
 	 Author: A U Thor <author@example.com>
 	 Date: Thu Apr 7 15:14:13 2005 -0700
 	 1 file changed, 1 insertion(+)
 	Trying simple merge.
-	[master OBJID] third
+	[main OBJID] third
 	 Author: A U Thor <author@example.com>
 	 Date: Thu Apr 7 15:15:13 2005 -0700
 	 1 file changed, 1 insertion(+)
 	Trying simple merge.
-	[master OBJID] fourth
+	[main OBJID] fourth
 	 Author: A U Thor <author@example.com>
 	 Date: Thu Apr 7 15:16:13 2005 -0700
 	 1 file changed, 1 insertion(+)
 	EOF
 
-	git checkout -f master &&
+	git checkout -f main &&
 	git reset --hard first &&
 	test_tick &&
 	git cherry-pick --strategy resolve first..fourth >actual &&
@@ -124,7 +124,7 @@ test_expect_success 'output during multi-pick indicates merge strategy' '
 '
 
 test_expect_success 'cherry-pick --ff first..fourth works' '
-	git checkout -f master &&
+	git checkout -f main &&
 	git reset --hard first &&
 	test_tick &&
 	git cherry-pick --ff first..fourth &&
@@ -134,7 +134,7 @@ test_expect_success 'cherry-pick --ff first..fourth works' '
 '
 
 test_expect_success 'cherry-pick -n first..fourth works' '
-	git checkout -f master &&
+	git checkout -f main &&
 	git reset --hard first &&
 	test_tick &&
 	git cherry-pick -n first..fourth &&
@@ -144,7 +144,7 @@ test_expect_success 'cherry-pick -n first..fourth works' '
 '
 
 test_expect_success 'revert first..fourth works' '
-	git checkout -f master &&
+	git checkout -f main &&
 	git reset --hard fourth &&
 	test_tick &&
 	git revert first..fourth &&
@@ -154,7 +154,7 @@ test_expect_success 'revert first..fourth works' '
 '
 
 test_expect_success 'revert ^first fourth works' '
-	git checkout -f master &&
+	git checkout -f main &&
 	git reset --hard fourth &&
 	test_tick &&
 	git revert ^first fourth &&
@@ -164,7 +164,7 @@ test_expect_success 'revert ^first fourth works' '
 '
 
 test_expect_success 'revert fourth fourth~1 fourth~2 works' '
-	git checkout -f master &&
+	git checkout -f main &&
 	git reset --hard fourth &&
 	test_tick &&
 	git revert fourth fourth~1 fourth~2 &&
@@ -174,7 +174,7 @@ test_expect_success 'revert fourth fourth~1 fourth~2 works' '
 '
 
 test_expect_success 'cherry-pick -3 fourth works' '
-	git checkout -f master &&
+	git checkout -f main &&
 	git reset --hard first &&
 	test_tick &&
 	git cherry-pick -3 fourth &&
@@ -184,7 +184,7 @@ test_expect_success 'cherry-pick -3 fourth works' '
 '
 
 test_expect_success 'cherry-pick --stdin works' '
-	git checkout -f master &&
+	git checkout -f main &&
 	git reset --hard first &&
 	test_tick &&
 	git rev-list --reverse first..fourth | git cherry-pick --stdin &&
diff --git a/t/t3509-cherry-pick-merge-df.sh b/t/t3509-cherry-pick-merge-df.sh
index 1e5b3948df..dfc5e9f914 100755
--- a/t/t3509-cherry-pick-merge-df.sh
+++ b/t/t3509-cherry-pick-merge-df.sh
@@ -28,7 +28,7 @@ test_expect_success 'Setup rename across paths each below D/F conflicts' '
 
 test_expect_success 'Cherry-pick succeeds with rename across D/F conflicts' '
 	git reset --hard &&
-	git checkout master^0 &&
+	git checkout main^0 &&
 	git cherry-pick branch
 '
 
diff --git a/t/t3512-cherry-pick-submodule.sh b/t/t3512-cherry-pick-submodule.sh
index 6ece1d8573..ec09d7d8a8 100755
--- a/t/t3512-cherry-pick-submodule.sh
+++ b/t/t3512-cherry-pick-submodule.sh
@@ -35,7 +35,7 @@ test_expect_success 'unrelated submodule/file conflict is ignored' '
 		git add a_file &&
 		git commit -m "modify a file" &&
 
-		git checkout master &&
+		git checkout main &&
 
 		git submodule add ../sub sub &&
 		git submodule update sub &&
diff --git a/t/t3600-rm.sh b/t/t3600-rm.sh
index efec8d13b6..243087d9c6 100755
--- a/t/t3600-rm.sh
+++ b/t/t3600-rm.sh
@@ -483,16 +483,16 @@ test_expect_success 'setup submodule conflict' '
 	echo 1 >nitfol &&
 	git add nitfol &&
 	git commit -m "added nitfol 1" &&
-	git checkout -b branch2 master &&
+	git checkout -b branch2 main &&
 	echo 2 >nitfol &&
 	git add nitfol &&
 	git commit -m "added nitfol 2" &&
-	git checkout -b conflict1 master &&
+	git checkout -b conflict1 main &&
 	git -C submod fetch &&
 	git -C submod checkout branch1 &&
 	git add submod &&
 	git commit -m "submod 1" &&
-	git checkout -b conflict2 master &&
+	git checkout -b conflict2 main &&
 	git -C submod checkout branch2 &&
 	git add submod &&
 	git commit -m "submod 2"
@@ -604,7 +604,7 @@ test_expect_success 'rm of a conflicted unpopulated submodule succeeds' '
 '
 
 test_expect_success 'rm of a populated submodule with a .git directory migrates git dir' '
-	git checkout -f master &&
+	git checkout -f main &&
 	git reset --hard &&
 	git submodule update &&
 	(
@@ -717,7 +717,7 @@ test_expect_success 'checking out a commit after submodule removal needs manual
 	git checkout HEAD^ &&
 	git submodule update &&
 	git checkout -q HEAD^ &&
-	git checkout -q master 2>actual &&
+	git checkout -q main 2>actual &&
 	test_i18ngrep "^warning: unable to rmdir '\''submod'\'':" actual &&
 	git status -s submod >actual &&
 	echo "?? submod/" >expected &&
diff --git a/t/t3701-add-interactive.sh b/t/t3701-add-interactive.sh
index ca04fac417..4abaa9be02 100755
--- a/t/t3701-add-interactive.sh
+++ b/t/t3701-add-interactive.sh
@@ -549,8 +549,8 @@ test_expect_success 'patch mode ignores unmerged entries' '
 	test_commit non-conflict &&
 	git checkout -b side &&
 	test_commit side conflict.t &&
-	git checkout master &&
-	test_commit master conflict.t &&
+	git checkout main &&
+	test_commit main conflict.t &&
 	test_must_fail git merge side &&
 	echo changed >non-conflict.t &&
 	echo y | git add -p >output &&
diff --git a/t/t3901-i18n-patch.sh b/t/t3901-i18n-patch.sh
index 923eb01f0e..6a96959e06 100755
--- a/t/t3901-i18n-patch.sh
+++ b/t/t3901-i18n-patch.sh
@@ -45,7 +45,7 @@ test_expect_success setup '
 
 	# the first commit on the side branch is UTF-8
 	test_tick &&
-	git checkout -b side master^ &&
+	git checkout -b side main^ &&
 	echo Another file >yours &&
 	git add yours &&
 	git commit -s -m "Second on side" &&
@@ -69,7 +69,7 @@ test_expect_success setup '
 test_expect_success 'format-patch output (ISO-8859-1)' '
 	git config i18n.logoutputencoding ISO8859-1 &&
 
-	git format-patch --stdout master..HEAD^ >out-l1 &&
+	git format-patch --stdout main..HEAD^ >out-l1 &&
 	git format-patch --stdout HEAD^ >out-l2 &&
 	grep "^Content-Type: text/plain; charset=ISO8859-1" out-l1 &&
 	grep "^From: =?ISO8859-1?q?=C1=E9=ED=20=F3=FA?=" out-l1 &&
@@ -80,7 +80,7 @@ test_expect_success 'format-patch output (ISO-8859-1)' '
 test_expect_success 'format-patch output (UTF-8)' '
 	git config i18n.logoutputencoding UTF-8 &&
 
-	git format-patch --stdout master..HEAD^ >out-u1 &&
+	git format-patch --stdout main..HEAD^ >out-u1 &&
 	git format-patch --stdout HEAD^ >out-u2 &&
 	grep "^Content-Type: text/plain; charset=UTF-8" out-u1 &&
 	grep "^From: =?UTF-8?q?=C3=81=C3=A9=C3=AD=20=C3=B3=C3=BA?=" out-u1 &&
@@ -102,7 +102,7 @@ test_expect_success 'rebase (U/U)' '
 	# we want UTF-8 encoded name.
 	. "$TEST_DIRECTORY"/t3901/utf8.txt &&
 	git checkout -b test &&
-	git rebase master &&
+	git rebase main &&
 
 	check_encoding 2
 '
@@ -113,7 +113,7 @@ test_expect_success 'rebase (U/L)' '
 	. "$TEST_DIRECTORY"/t3901/utf8.txt &&
 
 	git reset --hard side &&
-	git rebase master &&
+	git rebase main &&
 
 	check_encoding 2
 '
@@ -125,7 +125,7 @@ test_expect_success !MINGW 'rebase (L/L)' '
 	. "$TEST_DIRECTORY"/t3901/8859-1.txt &&
 
 	git reset --hard side &&
-	git rebase master &&
+	git rebase main &&
 
 	check_encoding 2 8859
 '
@@ -138,7 +138,7 @@ test_expect_success !MINGW 'rebase (L/U)' '
 	. "$TEST_DIRECTORY"/t3901/8859-1.txt &&
 
 	git reset --hard side &&
-	git rebase master &&
+	git rebase main &&
 
 	check_encoding 2 8859
 '
@@ -150,7 +150,7 @@ test_expect_success 'cherry-pick(U/U)' '
 	git config i18n.logoutputencoding UTF-8 &&
 	. "$TEST_DIRECTORY"/t3901/utf8.txt &&
 
-	git reset --hard master &&
+	git reset --hard main &&
 	git cherry-pick side^ &&
 	git cherry-pick side &&
 	git revert HEAD &&
@@ -165,7 +165,7 @@ test_expect_success !MINGW 'cherry-pick(L/L)' '
 	git config i18n.logoutputencoding ISO8859-1 &&
 	. "$TEST_DIRECTORY"/t3901/8859-1.txt &&
 
-	git reset --hard master &&
+	git reset --hard main &&
 	git cherry-pick side^ &&
 	git cherry-pick side &&
 	git revert HEAD &&
@@ -180,7 +180,7 @@ test_expect_success 'cherry-pick(U/L)' '
 	git config i18n.logoutputencoding ISO8859-1 &&
 	. "$TEST_DIRECTORY"/t3901/utf8.txt &&
 
-	git reset --hard master &&
+	git reset --hard main &&
 	git cherry-pick side^ &&
 	git cherry-pick side &&
 	git revert HEAD &&
@@ -196,7 +196,7 @@ test_expect_success !MINGW 'cherry-pick(L/U)' '
 	git config i18n.logoutputencoding UTF-8 &&
 	. "$TEST_DIRECTORY"/t3901/8859-1.txt &&
 
-	git reset --hard master &&
+	git reset --hard main &&
 	git cherry-pick side^ &&
 	git cherry-pick side &&
 	git revert HEAD &&
@@ -210,7 +210,7 @@ test_expect_success 'rebase --merge (U/U)' '
 	. "$TEST_DIRECTORY"/t3901/utf8.txt &&
 
 	git reset --hard side &&
-	git rebase --merge master &&
+	git rebase --merge main &&
 
 	check_encoding 2
 '
@@ -221,7 +221,7 @@ test_expect_success 'rebase --merge (U/L)' '
 	. "$TEST_DIRECTORY"/t3901/utf8.txt &&
 
 	git reset --hard side &&
-	git rebase --merge master &&
+	git rebase --merge main &&
 
 	check_encoding 2
 '
@@ -233,7 +233,7 @@ test_expect_success 'rebase --merge (L/L)' '
 	. "$TEST_DIRECTORY"/t3901/8859-1.txt &&
 
 	git reset --hard side &&
-	git rebase --merge master &&
+	git rebase --merge main &&
 
 	check_encoding 2 8859
 '
@@ -246,7 +246,7 @@ test_expect_success 'rebase --merge (L/U)' '
 	. "$TEST_DIRECTORY"/t3901/8859-1.txt &&
 
 	git reset --hard side &&
-	git rebase --merge master &&
+	git rebase --merge main &&
 
 	check_encoding 2 8859
 '
@@ -256,7 +256,7 @@ test_expect_success 'am (U/U)' '
 	git config i18n.commitencoding UTF-8 &&
 	. "$TEST_DIRECTORY"/t3901/utf8.txt &&
 
-	git reset --hard master &&
+	git reset --hard main &&
 	git am out-u1 out-u2 &&
 
 	check_encoding 2
@@ -267,7 +267,7 @@ test_expect_success !MINGW 'am (L/L)' '
 	git config i18n.commitencoding ISO8859-1 &&
 	. "$TEST_DIRECTORY"/t3901/8859-1.txt &&
 
-	git reset --hard master &&
+	git reset --hard main &&
 	git am out-l1 out-l2 &&
 
 	check_encoding 2 8859
@@ -277,7 +277,7 @@ test_expect_success 'am (U/L)' '
 	# Apply ISO-8859-1 patches with UTF-8 commitencoding
 	git config i18n.commitencoding UTF-8 &&
 	. "$TEST_DIRECTORY"/t3901/utf8.txt &&
-	git reset --hard master &&
+	git reset --hard main &&
 
 	# am specifies --utf8 by default.
 	git am out-l1 out-l2 &&
@@ -290,7 +290,7 @@ test_expect_success 'am --no-utf8 (U/L)' '
 	git config i18n.commitencoding UTF-8 &&
 	. "$TEST_DIRECTORY"/t3901/utf8.txt &&
 
-	git reset --hard master &&
+	git reset --hard main &&
 	git am --no-utf8 out-l1 out-l2 2>err &&
 
 	# commit-tree will warn that the commit message does not contain valid UTF-8
@@ -305,7 +305,7 @@ test_expect_success !MINGW 'am (L/U)' '
 	git config i18n.commitencoding ISO8859-1 &&
 	. "$TEST_DIRECTORY"/t3901/8859-1.txt &&
 
-	git reset --hard master &&
+	git reset --hard main &&
 	# mailinfo will re-code the commit message to the charset specified by
 	# i18n.commitencoding
 	git am out-u1 out-u2 &&
diff --git a/t/t3903-stash.sh b/t/t3903-stash.sh
index 9f7ca98967..97374f393a 100755
--- a/t/t3903-stash.sh
+++ b/t/t3903-stash.sh
@@ -220,14 +220,14 @@ test_expect_success 'stash branch' '
 	git commit file -m second &&
 	git stash branch stashbranch &&
 	test refs/heads/stashbranch = $(git symbolic-ref HEAD) &&
-	test $(git rev-parse HEAD) = $(git rev-parse master^) &&
+	test $(git rev-parse HEAD) = $(git rev-parse main^) &&
 	git diff --cached >output &&
 	diff_cmp expect output &&
 	git diff >output &&
 	diff_cmp expect1 output &&
 	git add file &&
 	git commit -m alternate\ second &&
-	git diff master..stashbranch >output &&
+	git diff main..stashbranch >output &&
 	diff_cmp output expect2 &&
 	test 0 = $(git stash list | wc -l)
 '
@@ -520,7 +520,7 @@ test_expect_success 'stash branch - no stashes on stack, stash-like argument' '
 	STASH_ID=$(git stash create) &&
 	git reset --hard &&
 	git stash branch stash-branch ${STASH_ID} &&
-	test_when_finished "git reset --hard HEAD && git checkout master &&
+	test_when_finished "git reset --hard HEAD && git checkout main &&
 	git branch -D stash-branch" &&
 	test $(git ls-files --modified | wc -l) -eq 1
 '
@@ -536,7 +536,7 @@ test_expect_success 'stash branch - stashes on stack, stash-like argument' '
 	STASH_ID=$(git stash create) &&
 	git reset --hard &&
 	git stash branch stash-branch ${STASH_ID} &&
-	test_when_finished "git reset --hard HEAD && git checkout master &&
+	test_when_finished "git reset --hard HEAD && git checkout main &&
 	git branch -D stash-branch" &&
 	test $(git ls-files --modified | wc -l) -eq 1
 '
@@ -738,7 +738,7 @@ test_expect_success 'valid ref of the form "n", n < N' '
 	git stash &&
 	git stash show 0 &&
 	git stash branch tmp 0 &&
-	git checkout master &&
+	git checkout main &&
 	git stash &&
 	git stash apply 0 &&
 	git reset --hard &&
@@ -755,7 +755,7 @@ test_expect_success 'branch: do not drop the stash if the branch exists' '
 	git commit -m initial &&
 	echo bar >file &&
 	git stash &&
-	test_must_fail git stash branch master stash@{0} &&
+	test_must_fail git stash branch main stash@{0} &&
 	git rev-parse stash@{0} --
 '
 
@@ -768,7 +768,7 @@ test_expect_success 'branch: should not drop the stash if the apply fails' '
 	echo bar >file &&
 	git stash &&
 	echo baz >file &&
-	test_when_finished "git checkout master" &&
+	test_when_finished "git checkout main" &&
 	test_must_fail git stash branch new_branch stash@{0} &&
 	git rev-parse stash@{0} --
 '
@@ -902,7 +902,7 @@ test_expect_success 'push -m shows right message' '
 	>foo &&
 	git add foo &&
 	git stash push -m "test message" &&
-	echo "stash@{0}: On master: test message" >expect &&
+	echo "stash@{0}: On main: test message" >expect &&
 	git stash list -1 >actual &&
 	test_cmp expect actual
 '
@@ -911,7 +911,7 @@ test_expect_success 'push -m also works without space' '
 	>foo &&
 	git add foo &&
 	git stash push -m"unspaced test message" &&
-	echo "stash@{0}: On master: unspaced test message" >expect &&
+	echo "stash@{0}: On main: unspaced test message" >expect &&
 	git stash list -1 >actual &&
 	test_cmp expect actual
 '
@@ -968,7 +968,7 @@ test_expect_success 'push -mfoo uses right message' '
 	>foo &&
 	git add foo &&
 	git stash push -m"test mfoo" &&
-	echo "stash@{0}: On master: test mfoo" >expect &&
+	echo "stash@{0}: On main: test mfoo" >expect &&
 	git stash list -1 >actual &&
 	test_cmp expect actual
 '
@@ -977,7 +977,7 @@ test_expect_success 'push --message foo is synonym for -mfoo' '
 	>foo &&
 	git add foo &&
 	git stash push --message "test message foo" &&
-	echo "stash@{0}: On master: test message foo" >expect &&
+	echo "stash@{0}: On main: test message foo" >expect &&
 	git stash list -1 >actual &&
 	test_cmp expect actual
 '
@@ -986,7 +986,7 @@ test_expect_success 'push --message=foo is synonym for -mfoo' '
 	>foo &&
 	git add foo &&
 	git stash push --message="test message=foo" &&
-	echo "stash@{0}: On master: test message=foo" >expect &&
+	echo "stash@{0}: On main: test message=foo" >expect &&
 	git stash list -1 >actual &&
 	test_cmp expect actual
 '
@@ -995,7 +995,7 @@ test_expect_success 'push -m shows right message' '
 	>foo &&
 	git add foo &&
 	git stash push -m "test m foo" &&
-	echo "stash@{0}: On master: test m foo" >expect &&
+	echo "stash@{0}: On main: test m foo" >expect &&
 	git stash list -1 >actual &&
 	test_cmp expect actual
 '
@@ -1004,7 +1004,7 @@ test_expect_success 'create stores correct message' '
 	>foo &&
 	git add foo &&
 	STASH_ID=$(git stash create "create test message") &&
-	echo "On master: create test message" >expect &&
+	echo "On main: create test message" >expect &&
 	git show --pretty=%s -s ${STASH_ID} >actual &&
 	test_cmp expect actual
 '
@@ -1013,13 +1013,13 @@ test_expect_success 'create with multiple arguments for the message' '
 	>foo &&
 	git add foo &&
 	STASH_ID=$(git stash create test untracked) &&
-	echo "On master: test untracked" >expect &&
+	echo "On main: test untracked" >expect &&
 	git show --pretty=%s -s ${STASH_ID} >actual &&
 	test_cmp expect actual
 '
 
 test_expect_success 'create in a detached state' '
-	test_when_finished "git checkout master" &&
+	test_when_finished "git checkout main" &&
 	git checkout HEAD~1 &&
 	>foo &&
 	git add foo &&
diff --git a/t/t3910-mac-os-precompose.sh b/t/t3910-mac-os-precompose.sh
index 54ce19e353..7e03823537 100755
--- a/t/t3910-mac-os-precompose.sh
+++ b/t/t3910-mac-os-precompose.sh
@@ -151,7 +151,7 @@ test_expect_success "git checkout link nfd" '
 	git checkout l.$Odiarnfd
 '
 test_expect_success "setup case mac2" '
-	git checkout master &&
+	git checkout main &&
 	git reset --hard &&
 	git checkout -b mac_os_2
 '
@@ -163,7 +163,7 @@ test_expect_success "commit file d2.Adiarnfd/f.Adiarnfd" '
 	git commit -m "add d2.$Adiarnfd/f.$Adiarnfd" -- d2.$Adiarnfd/f.$Adiarnfd
 '
 test_expect_success "setup for long decomposed filename" '
-	git checkout master &&
+	git checkout main &&
 	git reset --hard &&
 	git checkout -b mac_os_long_nfd_fn
 '
@@ -173,7 +173,7 @@ test_expect_success "Add long decomposed filename" '
 	git commit -m "Long filename"
 '
 test_expect_success "setup for long precomposed filename" '
-	git checkout master &&
+	git checkout main &&
 	git reset --hard &&
 	git checkout -b mac_os_long_nfc_fn
 '
diff --git a/t/test-lib.sh b/t/test-lib.sh
index 4ae87a5c4e..76ab747b53 100644
--- a/t/test-lib.sh
+++ b/t/test-lib.sh
@@ -263,7 +263,7 @@ case "$TEST_NUMBER" in
 	GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
 	export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 	;;
-[0-2]*|3[0-4]*)
+[0-3]*)
 	GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 	export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 	;;
-- 
gitgitgadget


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH v2 08/27] t4*: adjust the references to the default branch name "main"
  2020-11-17 16:12 ` [PATCH v2 00/27] tests: use " Johannes Schindelin via GitGitGadget
                     ` (6 preceding siblings ...)
  2020-11-17 16:12   ` [PATCH v2 07/27] t3[5-9]*: " Johannes Schindelin via GitGitGadget
@ 2020-11-17 16:12   ` Johannes Schindelin via GitGitGadget
  2020-11-17 16:12   ` [PATCH v2 09/27] t5323: prepare centered comment for `master` -> `main` Johannes Schindelin via GitGitGadget
                     ` (20 subsequent siblings)
  28 siblings, 0 replies; 163+ messages in thread
From: Johannes Schindelin via GitGitGadget @ 2020-11-17 16:12 UTC (permalink / raw)
  To: git
  Cc: Felipe Contreras, Ævar Arnfjörð Bjarmason,
	Johannes Schindelin, Jeff King, Johannes Schindelin,
	Johannes Schindelin

From: Johannes Schindelin <johannes.schindelin@gmx.de>

Carefully excluding t4013, which sees independent development elsewhere
at the time of writing, we use `main` as the default branch name in t4*.
This trick was performed via

	$ (cd t &&
	   sed -i -e 's/master/main/g' -e 's/MASTER/MAIN/g' \
		-e 's/Master/Main/g' -- t4*.sh t4211/*.export &&
	   git checkout HEAD -- t4013\*)

This allows us to define `GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main`
for those tests.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
---
 t/t4014-format-patch.sh              | 176 +++++++++++++--------------
 t/t4015-diff-whitespace.sh           |   2 +-
 t/t4017-diff-retval.sh               |   2 +-
 t/t4038-diff-combined.sh             |  14 +--
 t/t4041-diff-submodule-option.sh     |   2 +-
 t/t4048-diff-combined-binary.sh      |  10 +-
 t/t4052-stat-output.sh               |   4 +-
 t/t4056-diff-order.sh                |   2 +-
 t/t4057-diff-combined-paths.sh       |  20 +--
 t/t4061-diff-indent.sh               |  24 ++--
 t/t4066-diff-emit-delay.sh           |   2 +-
 t/t4068-diff-symmetric-merge-base.sh |  48 ++++----
 t/t4103-apply-binary.sh              |  36 +++---
 t/t4108-apply-threeway.sh            |  14 +--
 t/t4121-apply-diffs.sh               |   2 +-
 t/t4122-apply-symlink-inside.sh      |   6 +-
 t/t4150-am.sh                        |  26 ++--
 t/t4200-rerere.sh                    |  20 +--
 t/t4201-shortlog.sh                  |   2 +-
 t/t4202-log.sh                       | 106 ++++++++--------
 t/t4203-mailmap.sh                   |   2 +-
 t/t4204-patch-id.sh                  |  26 ++--
 t/t4207-log-decoration-colors.sh     |   6 +-
 t/t4208-log-magic-pathspec.sh        |   4 +-
 t/t4211/history.export               |   2 +-
 t/t4214-log-graph-octopus.sh         |   2 +-
 t/t4216-log-bloom.sh                 |   4 +-
 t/t4253-am-keep-cr-dos.sh            |  20 +--
 t/t4257-am-interactive.sh            |   2 +-
 t/test-lib.sh                        |   4 +-
 30 files changed, 295 insertions(+), 295 deletions(-)

diff --git a/t/t4014-format-patch.sh b/t/t4014-format-patch.sh
index c5e5e0da3f..636d028b5d 100755
--- a/t/t4014-format-patch.sh
+++ b/t/t4014-format-patch.sh
@@ -32,11 +32,11 @@ test_expect_success setup '
 	test_tick &&
 	git commit -m "Side changes #3 with \\n backslash-n in it." &&
 
-	git checkout master &&
+	git checkout main &&
 	git diff-tree -p C2 >patch &&
 	git apply --index <patch &&
 	test_tick &&
-	git commit -m "Master accepts moral equivalent of #2" &&
+	git commit -m "Main accepts moral equivalent of #2" &&
 
 	git checkout side &&
 	git checkout -b patchid &&
@@ -56,39 +56,39 @@ test_expect_success setup '
 	test_tick &&
 	git commit -m "patchid 3" &&
 
-	git checkout master
+	git checkout main
 '
 
 test_expect_success 'format-patch --ignore-if-in-upstream' '
-	git format-patch --stdout master..side >patch0 &&
+	git format-patch --stdout main..side >patch0 &&
 	grep "^From " patch0 >from0 &&
 	test_line_count = 3 from0
 '
 
 test_expect_success 'format-patch --ignore-if-in-upstream' '
 	git format-patch --stdout \
-		--ignore-if-in-upstream master..side >patch1 &&
+		--ignore-if-in-upstream main..side >patch1 &&
 	grep "^From " patch1 >from1 &&
 	test_line_count = 2 from1
 '
 
 test_expect_success 'format-patch --ignore-if-in-upstream handles tags' '
 	git tag -a v1 -m tag side &&
-	git tag -a v2 -m tag master &&
+	git tag -a v2 -m tag main &&
 	git format-patch --stdout --ignore-if-in-upstream v2..v1 >patch1 &&
 	grep "^From " patch1 >from1 &&
 	test_line_count = 2 from1
 '
 
 test_expect_success "format-patch doesn't consider merge commits" '
-	git checkout -b feature master &&
+	git checkout -b feature main &&
 	echo "Another line" >>file &&
 	test_tick &&
 	git commit -am "Feature branch change #1" &&
 	echo "Yet another line" >>file &&
 	test_tick &&
 	git commit -am "Feature branch change #2" &&
-	git checkout -b merger master &&
+	git checkout -b merger main &&
 	test_tick &&
 	git merge --no-ff feature &&
 	git format-patch -3 --stdout >patch &&
@@ -97,16 +97,16 @@ test_expect_success "format-patch doesn't consider merge commits" '
 '
 
 test_expect_success 'format-patch result applies' '
-	git checkout -b rebuild-0 master &&
+	git checkout -b rebuild-0 main &&
 	git am -3 patch0 &&
-	git rev-list master.. >list &&
+	git rev-list main.. >list &&
 	test_line_count = 2 list
 '
 
 test_expect_success 'format-patch --ignore-if-in-upstream result applies' '
-	git checkout -b rebuild-1 master &&
+	git checkout -b rebuild-1 main &&
 	git am -3 patch1 &&
-	git rev-list master.. >list &&
+	git rev-list main.. >list &&
 	test_line_count = 2 list
 '
 
@@ -130,7 +130,7 @@ test_expect_success 'extra headers' '
 " &&
 	git config --add format.headers "Cc: S E Cipient <scipient@example.com>
 " &&
-	git format-patch --stdout master..side >patch2 &&
+	git format-patch --stdout main..side >patch2 &&
 	sed -e "/^\$/q" patch2 >hdrs2 &&
 	grep "^To: R E Cipient <rcipient@example.com>\$" hdrs2 &&
 	grep "^Cc: S E Cipient <scipient@example.com>\$" hdrs2
@@ -139,7 +139,7 @@ test_expect_success 'extra headers' '
 test_expect_success 'extra headers without newlines' '
 	git config --replace-all format.headers "To: R E Cipient <rcipient@example.com>" &&
 	git config --add format.headers "Cc: S E Cipient <scipient@example.com>" &&
-	git format-patch --stdout master..side >patch3 &&
+	git format-patch --stdout main..side >patch3 &&
 	sed -e "/^\$/q" patch3 >hdrs3 &&
 	grep "^To: R E Cipient <rcipient@example.com>\$" hdrs3 &&
 	grep "^Cc: S E Cipient <scipient@example.com>\$" hdrs3
@@ -148,7 +148,7 @@ test_expect_success 'extra headers without newlines' '
 test_expect_success 'extra headers with multiple To:s' '
 	git config --replace-all format.headers "To: R E Cipient <rcipient@example.com>" &&
 	git config --add format.headers "To: S E Cipient <scipient@example.com>" &&
-	git format-patch --stdout master..side >patch4 &&
+	git format-patch --stdout main..side >patch4 &&
 	sed -e "/^\$/q" patch4 >hdrs4 &&
 	grep "^To: R E Cipient <rcipient@example.com>,\$" hdrs4 &&
 	grep "^ *S E Cipient <scipient@example.com>\$" hdrs4
@@ -156,7 +156,7 @@ test_expect_success 'extra headers with multiple To:s' '
 
 test_expect_success 'additional command line cc (ascii)' '
 	git config --replace-all format.headers "Cc: R E Cipient <rcipient@example.com>" &&
-	git format-patch --cc="S E Cipient <scipient@example.com>" --stdout master..side >patch5 &&
+	git format-patch --cc="S E Cipient <scipient@example.com>" --stdout main..side >patch5 &&
 	sed -e "/^\$/q" patch5 >hdrs5 &&
 	grep "^Cc: R E Cipient <rcipient@example.com>,\$" hdrs5 &&
 	grep "^ *S E Cipient <scipient@example.com>\$" hdrs5
@@ -164,7 +164,7 @@ test_expect_success 'additional command line cc (ascii)' '
 
 test_expect_failure 'additional command line cc (rfc822)' '
 	git config --replace-all format.headers "Cc: R E Cipient <rcipient@example.com>" &&
-	git format-patch --cc="S. E. Cipient <scipient@example.com>" --stdout master..side >patch5 &&
+	git format-patch --cc="S. E. Cipient <scipient@example.com>" --stdout main..side >patch5 &&
 	sed -e "/^\$/q" patch5 >hdrs5 &&
 	grep "^Cc: R E Cipient <rcipient@example.com>,\$" hdrs5 &&
 	grep "^ *\"S. E. Cipient\" <scipient@example.com>\$" hdrs5
@@ -172,14 +172,14 @@ test_expect_failure 'additional command line cc (rfc822)' '
 
 test_expect_success 'command line headers' '
 	git config --unset-all format.headers &&
-	git format-patch --add-header="Cc: R E Cipient <rcipient@example.com>" --stdout master..side >patch6 &&
+	git format-patch --add-header="Cc: R E Cipient <rcipient@example.com>" --stdout main..side >patch6 &&
 	sed -e "/^\$/q" patch6 >hdrs6 &&
 	grep "^Cc: R E Cipient <rcipient@example.com>\$" hdrs6
 '
 
 test_expect_success 'configuration headers and command line headers' '
 	git config --replace-all format.headers "Cc: R E Cipient <rcipient@example.com>" &&
-	git format-patch --add-header="Cc: S E Cipient <scipient@example.com>" --stdout master..side >patch7 &&
+	git format-patch --add-header="Cc: S E Cipient <scipient@example.com>" --stdout main..side >patch7 &&
 	sed -e "/^\$/q" patch7 >hdrs7 &&
 	grep "^Cc: R E Cipient <rcipient@example.com>,\$" hdrs7 &&
 	grep "^ *S E Cipient <scipient@example.com>\$" hdrs7
@@ -187,40 +187,40 @@ test_expect_success 'configuration headers and command line headers' '
 
 test_expect_success 'command line To: header (ascii)' '
 	git config --unset-all format.headers &&
-	git format-patch --to="R E Cipient <rcipient@example.com>" --stdout master..side >patch8 &&
+	git format-patch --to="R E Cipient <rcipient@example.com>" --stdout main..side >patch8 &&
 	sed -e "/^\$/q" patch8 >hdrs8 &&
 	grep "^To: R E Cipient <rcipient@example.com>\$" hdrs8
 '
 
 test_expect_failure 'command line To: header (rfc822)' '
-	git format-patch --to="R. E. Cipient <rcipient@example.com>" --stdout master..side >patch8 &&
+	git format-patch --to="R. E. Cipient <rcipient@example.com>" --stdout main..side >patch8 &&
 	sed -e "/^\$/q" patch8 >hdrs8 &&
 	grep "^To: \"R. E. Cipient\" <rcipient@example.com>\$" hdrs8
 '
 
 test_expect_failure 'command line To: header (rfc2047)' '
-	git format-patch --to="R Ä Cipient <rcipient@example.com>" --stdout master..side >patch8 &&
+	git format-patch --to="R Ä Cipient <rcipient@example.com>" --stdout main..side >patch8 &&
 	sed -e "/^\$/q" patch8 >hdrs8 &&
 	grep "^To: =?UTF-8?q?R=20=C3=84=20Cipient?= <rcipient@example.com>\$" hdrs8
 '
 
 test_expect_success 'configuration To: header (ascii)' '
 	git config format.to "R E Cipient <rcipient@example.com>" &&
-	git format-patch --stdout master..side >patch9 &&
+	git format-patch --stdout main..side >patch9 &&
 	sed -e "/^\$/q" patch9 >hdrs9 &&
 	grep "^To: R E Cipient <rcipient@example.com>\$" hdrs9
 '
 
 test_expect_failure 'configuration To: header (rfc822)' '
 	git config format.to "R. E. Cipient <rcipient@example.com>" &&
-	git format-patch --stdout master..side >patch9 &&
+	git format-patch --stdout main..side >patch9 &&
 	sed -e "/^\$/q" patch9 >hdrs9 &&
 	grep "^To: \"R. E. Cipient\" <rcipient@example.com>\$" hdrs9
 '
 
 test_expect_failure 'configuration To: header (rfc2047)' '
 	git config format.to "R Ä Cipient <rcipient@example.com>" &&
-	git format-patch --stdout master..side >patch9 &&
+	git format-patch --stdout main..side >patch9 &&
 	sed -e "/^\$/q" patch9 >hdrs9 &&
 	grep "^To: =?UTF-8?q?R=20=C3=84=20Cipient?= <rcipient@example.com>\$" hdrs9
 '
@@ -234,35 +234,35 @@ check_patch () {
 }
 
 test_expect_success 'format.from=false' '
-	git -c format.from=false format-patch --stdout master..side >patch &&
+	git -c format.from=false format-patch --stdout main..side >patch &&
 	sed -e "/^\$/q" patch >hdrs &&
 	check_patch patch &&
 	! grep "^From: C O Mitter <committer@example.com>\$" hdrs
 '
 
 test_expect_success 'format.from=true' '
-	git -c format.from=true format-patch --stdout master..side >patch &&
+	git -c format.from=true format-patch --stdout main..side >patch &&
 	sed -e "/^\$/q" patch >hdrs &&
 	check_patch hdrs &&
 	grep "^From: C O Mitter <committer@example.com>\$" hdrs
 '
 
 test_expect_success 'format.from with address' '
-	git -c format.from="F R Om <from@example.com>" format-patch --stdout master..side >patch &&
+	git -c format.from="F R Om <from@example.com>" format-patch --stdout main..side >patch &&
 	sed -e "/^\$/q" patch >hdrs &&
 	check_patch hdrs &&
 	grep "^From: F R Om <from@example.com>\$" hdrs
 '
 
 test_expect_success '--no-from overrides format.from' '
-	git -c format.from="F R Om <from@example.com>" format-patch --no-from --stdout master..side >patch &&
+	git -c format.from="F R Om <from@example.com>" format-patch --no-from --stdout main..side >patch &&
 	sed -e "/^\$/q" patch >hdrs &&
 	check_patch hdrs &&
 	! grep "^From: F R Om <from@example.com>\$" hdrs
 '
 
 test_expect_success '--from overrides format.from' '
-	git -c format.from="F R Om <from@example.com>" format-patch --from --stdout master..side >patch &&
+	git -c format.from="F R Om <from@example.com>" format-patch --from --stdout main..side >patch &&
 	sed -e "/^\$/q" patch >hdrs &&
 	check_patch hdrs &&
 	! grep "^From: F R Om <from@example.com>\$" hdrs
@@ -271,7 +271,7 @@ test_expect_success '--from overrides format.from' '
 test_expect_success '--no-to overrides config.to' '
 	git config --replace-all format.to \
 		"R E Cipient <rcipient@example.com>" &&
-	git format-patch --no-to --stdout master..side >patch10 &&
+	git format-patch --no-to --stdout main..side >patch10 &&
 	sed -e "/^\$/q" patch10 >hdrs10 &&
 	check_patch hdrs10 &&
 	! grep "^To: R E Cipient <rcipient@example.com>\$" hdrs10
@@ -281,7 +281,7 @@ test_expect_success '--no-to and --to replaces config.to' '
 	git config --replace-all format.to \
 		"Someone <someone@out.there>" &&
 	git format-patch --no-to --to="Someone Else <else@out.there>" \
-		--stdout master..side >patch11 &&
+		--stdout main..side >patch11 &&
 	sed -e "/^\$/q" patch11 >hdrs11 &&
 	check_patch hdrs11 &&
 	! grep "^To: Someone <someone@out.there>\$" hdrs11 &&
@@ -291,7 +291,7 @@ test_expect_success '--no-to and --to replaces config.to' '
 test_expect_success '--no-cc overrides config.cc' '
 	git config --replace-all format.cc \
 		"C E Cipient <rcipient@example.com>" &&
-	git format-patch --no-cc --stdout master..side >patch12 &&
+	git format-patch --no-cc --stdout main..side >patch12 &&
 	sed -e "/^\$/q" patch12 >hdrs12 &&
 	check_patch hdrs12 &&
 	! grep "^Cc: C E Cipient <rcipient@example.com>\$" hdrs12
@@ -300,7 +300,7 @@ test_expect_success '--no-cc overrides config.cc' '
 test_expect_success '--no-add-header overrides config.headers' '
 	git config --replace-all format.headers \
 		"Header1: B E Cipient <rcipient@example.com>" &&
-	git format-patch --no-add-header --stdout master..side >patch13 &&
+	git format-patch --no-add-header --stdout main..side >patch13 &&
 	sed -e "/^\$/q" patch13 >hdrs13 &&
 	check_patch hdrs13 &&
 	! grep "^Header1: B E Cipient <rcipient@example.com>\$" hdrs13
@@ -309,7 +309,7 @@ test_expect_success '--no-add-header overrides config.headers' '
 test_expect_success 'multiple files' '
 	rm -rf patches/ &&
 	git checkout side &&
-	git format-patch -o patches/ master &&
+	git format-patch -o patches/ main &&
 	ls patches/0001-Side-changes-1.patch patches/0002-Side-changes-2.patch patches/0003-Side-changes-3-with-n-backslash-n-in-it.patch
 '
 
@@ -369,7 +369,7 @@ test_expect_success 'filename limit applies only to basename' '
 
 test_expect_success 'reroll count' '
 	rm -fr patches &&
-	git format-patch -o patches --cover-letter --reroll-count 4 master..side >list &&
+	git format-patch -o patches --cover-letter --reroll-count 4 main..side >list &&
 	! grep -v "^patches/v4-000[0-3]-" list &&
 	sed -n -e "/^Subject: /p" $(cat list) >subjects &&
 	! grep -v "^Subject: \[PATCH v4 [0-3]/3\] " subjects
@@ -377,7 +377,7 @@ test_expect_success 'reroll count' '
 
 test_expect_success 'reroll count (-v)' '
 	rm -fr patches &&
-	git format-patch -o patches --cover-letter -v4 master..side >list &&
+	git format-patch -o patches --cover-letter -v4 main..side >list &&
 	! grep -v "^patches/v4-000[0-3]-" list &&
 	sed -n -e "/^Subject: /p" $(cat list) >subjects &&
 	! grep -v "^Subject: \[PATCH v4 [0-3]/3\] " subjects
@@ -413,7 +413,7 @@ EOF
 
 test_expect_success 'no threading' '
 	git checkout side &&
-	check_threading expect.no-threading master
+	check_threading expect.no-threading main
 '
 
 cat >expect.thread <<EOF
@@ -430,7 +430,7 @@ References: <0>
 EOF
 
 test_expect_success 'thread' '
-	check_threading expect.thread --thread master
+	check_threading expect.thread --thread main
 '
 
 cat >expect.in-reply-to <<EOF
@@ -450,7 +450,7 @@ EOF
 
 test_expect_success 'thread in-reply-to' '
 	check_threading expect.in-reply-to --in-reply-to="<test.message>" \
-		--thread master
+		--thread main
 '
 
 cat >expect.cover-letter <<EOF
@@ -471,7 +471,7 @@ References: <0>
 EOF
 
 test_expect_success 'thread cover-letter' '
-	check_threading expect.cover-letter --cover-letter --thread master
+	check_threading expect.cover-letter --cover-letter --thread main
 '
 
 cat >expect.cl-irt <<EOF
@@ -498,12 +498,12 @@ EOF
 
 test_expect_success 'thread cover-letter in-reply-to' '
 	check_threading expect.cl-irt --cover-letter \
-		--in-reply-to="<test.message>" --thread master
+		--in-reply-to="<test.message>" --thread main
 '
 
 test_expect_success 'thread explicit shallow' '
 	check_threading expect.cl-irt --cover-letter \
-		--in-reply-to="<test.message>" --thread=shallow master
+		--in-reply-to="<test.message>" --thread=shallow main
 '
 
 cat >expect.deep <<EOF
@@ -521,7 +521,7 @@ References: <0>
 EOF
 
 test_expect_success 'thread deep' '
-	check_threading expect.deep --thread=deep master
+	check_threading expect.deep --thread=deep main
 '
 
 cat >expect.deep-irt <<EOF
@@ -544,7 +544,7 @@ EOF
 
 test_expect_success 'thread deep in-reply-to' '
 	check_threading expect.deep-irt  --thread=deep \
-		--in-reply-to="<test.message>" master
+		--in-reply-to="<test.message>" main
 '
 
 cat >expect.deep-cl <<EOF
@@ -568,7 +568,7 @@ References: <0>
 EOF
 
 test_expect_success 'thread deep cover-letter' '
-	check_threading expect.deep-cl --cover-letter --thread=deep master
+	check_threading expect.deep-cl --cover-letter --thread=deep main
 '
 
 cat >expect.deep-cl-irt <<EOF
@@ -598,27 +598,27 @@ EOF
 
 test_expect_success 'thread deep cover-letter in-reply-to' '
 	check_threading expect.deep-cl-irt --cover-letter \
-		--in-reply-to="<test.message>" --thread=deep master
+		--in-reply-to="<test.message>" --thread=deep main
 '
 
 test_expect_success 'thread via config' '
 	test_config format.thread true &&
-	check_threading expect.thread master
+	check_threading expect.thread main
 '
 
 test_expect_success 'thread deep via config' '
 	test_config format.thread deep &&
-	check_threading expect.deep master
+	check_threading expect.deep main
 '
 
 test_expect_success 'thread config + override' '
 	test_config format.thread deep &&
-	check_threading expect.thread --thread master
+	check_threading expect.thread --thread main
 '
 
 test_expect_success 'thread config + --no-thread' '
 	test_config format.thread deep &&
-	check_threading expect.no-threading --no-thread master
+	check_threading expect.no-threading --no-thread main
 '
 
 test_expect_success 'excessive subject' '
@@ -631,7 +631,7 @@ test_expect_success 'excessive subject' '
 	after=$(git rev-parse --short $after) &&
 	git update-index file &&
 	git commit -m "This is an excessively long subject line for a message due to the habit some projects have of not having a short, one-line subject at the start of the commit message, but rather sticking a whole paragraph right at the start as the only thing in the commit message. It had better not become the filename for the patch." &&
-	git format-patch -o patches/ master..side &&
+	git format-patch -o patches/ main..side &&
 	ls patches/0004-This-is-an-excessively-long-subject-line-for-a-messa.patch
 '
 
@@ -893,13 +893,13 @@ test_expect_success 'options no longer allowed for format-patch' '
 '
 
 test_expect_success 'format-patch --numstat should produce a patch' '
-	git format-patch --numstat --stdout master..side >output &&
+	git format-patch --numstat --stdout main..side >output &&
 	grep "^diff --git a/" output >diff &&
 	test_line_count = 5 diff
 '
 
 test_expect_success 'format-patch -- <path>' '
-	git format-patch master..side -- file 2>error &&
+	git format-patch main..side -- file 2>error &&
 	! grep "Use .--" error
 '
 
@@ -1673,9 +1673,9 @@ test_expect_success 'cover letter with invalid --cover-from-description and conf
 	test_config branch.rebuild-1.description "config subject
 
 body" &&
-	test_must_fail git format-patch --cover-letter --cover-from-description garbage master &&
+	test_must_fail git format-patch --cover-letter --cover-from-description garbage main &&
 	test_config format.coverFromDescription garbage &&
-	test_must_fail git format-patch --cover-letter master
+	test_must_fail git format-patch --cover-letter main
 '
 
 test_expect_success 'cover letter with format.coverFromDescription = default' '
@@ -1684,7 +1684,7 @@ test_expect_success 'cover letter with format.coverFromDescription = default' '
 body" &&
 	test_config format.coverFromDescription default &&
 	git checkout rebuild-1 &&
-	git format-patch --stdout --cover-letter master >actual &&
+	git format-patch --stdout --cover-letter main >actual &&
 	grep "^Subject: \[PATCH 0/2\] \*\*\* SUBJECT HERE \*\*\*$" actual &&
 	! grep "^\*\*\* BLURB HERE \*\*\*$" actual &&
 	grep "^config subject$" actual &&
@@ -1696,7 +1696,7 @@ test_expect_success 'cover letter with --cover-from-description default' '
 
 body" &&
 	git checkout rebuild-1 &&
-	git format-patch --stdout --cover-letter --cover-from-description default master >actual &&
+	git format-patch --stdout --cover-letter --cover-from-description default main >actual &&
 	grep "^Subject: \[PATCH 0/2\] \*\*\* SUBJECT HERE \*\*\*$" actual &&
 	! grep "^\*\*\* BLURB HERE \*\*\*$" actual &&
 	grep "^config subject$" actual &&
@@ -1709,7 +1709,7 @@ test_expect_success 'cover letter with format.coverFromDescription = none' '
 body" &&
 	test_config format.coverFromDescription none &&
 	git checkout rebuild-1 &&
-	git format-patch --stdout --cover-letter master >actual &&
+	git format-patch --stdout --cover-letter main >actual &&
 	grep "^Subject: \[PATCH 0/2\] \*\*\* SUBJECT HERE \*\*\*$" actual &&
 	grep "^\*\*\* BLURB HERE \*\*\*$" actual &&
 	! grep "^config subject$" actual &&
@@ -1721,7 +1721,7 @@ test_expect_success 'cover letter with --cover-from-description none' '
 
 body" &&
 	git checkout rebuild-1 &&
-	git format-patch --stdout --cover-letter --cover-from-description none master >actual &&
+	git format-patch --stdout --cover-letter --cover-from-description none main >actual &&
 	grep "^Subject: \[PATCH 0/2\] \*\*\* SUBJECT HERE \*\*\*$" actual &&
 	grep "^\*\*\* BLURB HERE \*\*\*$" actual &&
 	! grep "^config subject$" actual &&
@@ -1734,7 +1734,7 @@ test_expect_success 'cover letter with format.coverFromDescription = message' '
 body" &&
 	test_config format.coverFromDescription message &&
 	git checkout rebuild-1 &&
-	git format-patch --stdout --cover-letter master >actual &&
+	git format-patch --stdout --cover-letter main >actual &&
 	grep "^Subject: \[PATCH 0/2\] \*\*\* SUBJECT HERE \*\*\*$" actual &&
 	! grep "^\*\*\* BLURB HERE \*\*\*$" actual &&
 	grep "^config subject$" actual &&
@@ -1746,7 +1746,7 @@ test_expect_success 'cover letter with --cover-from-description message' '
 
 body" &&
 	git checkout rebuild-1 &&
-	git format-patch --stdout --cover-letter --cover-from-description message master >actual &&
+	git format-patch --stdout --cover-letter --cover-from-description message main >actual &&
 	grep "^Subject: \[PATCH 0/2\] \*\*\* SUBJECT HERE \*\*\*$" actual &&
 	! grep "^\*\*\* BLURB HERE \*\*\*$" actual &&
 	grep "^config subject$" actual &&
@@ -1759,7 +1759,7 @@ test_expect_success 'cover letter with format.coverFromDescription = subject' '
 body" &&
 	test_config format.coverFromDescription subject &&
 	git checkout rebuild-1 &&
-	git format-patch --stdout --cover-letter master >actual &&
+	git format-patch --stdout --cover-letter main >actual &&
 	grep "^Subject: \[PATCH 0/2\] config subject$" actual &&
 	! grep "^\*\*\* BLURB HERE \*\*\*$" actual &&
 	! grep "^config subject$" actual &&
@@ -1771,7 +1771,7 @@ test_expect_success 'cover letter with --cover-from-description subject' '
 
 body" &&
 	git checkout rebuild-1 &&
-	git format-patch --stdout --cover-letter --cover-from-description subject master >actual &&
+	git format-patch --stdout --cover-letter --cover-from-description subject main >actual &&
 	grep "^Subject: \[PATCH 0/2\] config subject$" actual &&
 	! grep "^\*\*\* BLURB HERE \*\*\*$" actual &&
 	! grep "^config subject$" actual &&
@@ -1784,7 +1784,7 @@ test_expect_success 'cover letter with format.coverFromDescription = auto (short
 body" &&
 	test_config format.coverFromDescription auto &&
 	git checkout rebuild-1 &&
-	git format-patch --stdout --cover-letter master >actual &&
+	git format-patch --stdout --cover-letter main >actual &&
 	grep "^Subject: \[PATCH 0/2\] config subject$" actual &&
 	! grep "^\*\*\* BLURB HERE \*\*\*$" actual &&
 	! grep "^config subject$" actual &&
@@ -1796,7 +1796,7 @@ test_expect_success 'cover letter with --cover-from-description auto (short subj
 
 body" &&
 	git checkout rebuild-1 &&
-	git format-patch --stdout --cover-letter --cover-from-description auto master >actual &&
+	git format-patch --stdout --cover-letter --cover-from-description auto main >actual &&
 	grep "^Subject: \[PATCH 0/2\] config subject$" actual &&
 	! grep "^\*\*\* BLURB HERE \*\*\*$" actual &&
 	! grep "^config subject$" actual &&
@@ -1809,7 +1809,7 @@ test_expect_success 'cover letter with format.coverFromDescription = auto (long
 body" &&
 	test_config format.coverFromDescription auto &&
 	git checkout rebuild-1 &&
-	git format-patch --stdout --cover-letter master >actual &&
+	git format-patch --stdout --cover-letter main >actual &&
 	grep "^Subject: \[PATCH 0/2\] \*\*\* SUBJECT HERE \*\*\*$" actual &&
 	! grep "^\*\*\* BLURB HERE \*\*\*$" actual &&
 	grep "^this is a really long first line and it is over 100 characters long which is the threshold for long subjects$" actual &&
@@ -1821,7 +1821,7 @@ test_expect_success 'cover letter with --cover-from-description auto (long subje
 
 body" &&
 	git checkout rebuild-1 &&
-	git format-patch --stdout --cover-letter --cover-from-description auto master >actual &&
+	git format-patch --stdout --cover-letter --cover-from-description auto main >actual &&
 	grep "^Subject: \[PATCH 0/2\] \*\*\* SUBJECT HERE \*\*\*$" actual &&
 	! grep "^\*\*\* BLURB HERE \*\*\*$" actual &&
 	grep "^this is a really long first line and it is over 100 characters long which is the threshold for long subjects$" actual &&
@@ -1834,7 +1834,7 @@ test_expect_success 'cover letter with command-line --cover-from-description ove
 body" &&
 	test_config format.coverFromDescription none &&
 	git checkout rebuild-1 &&
-	git format-patch --stdout --cover-letter --cover-from-description subject master >actual &&
+	git format-patch --stdout --cover-letter --cover-from-description subject main >actual &&
 	grep "^Subject: \[PATCH 0/2\] config subject$" actual &&
 	! grep "^\*\*\* BLURB HERE \*\*\*$" actual &&
 	! grep "^config subject$" actual &&
@@ -1844,7 +1844,7 @@ body" &&
 test_expect_success 'cover letter using branch description (1)' '
 	git checkout rebuild-1 &&
 	test_config branch.rebuild-1.description hello &&
-	git format-patch --stdout --cover-letter master >actual &&
+	git format-patch --stdout --cover-letter main >actual &&
 	grep hello actual
 '
 
@@ -1858,14 +1858,14 @@ test_expect_success 'cover letter using branch description (2)' '
 test_expect_success 'cover letter using branch description (3)' '
 	git checkout rebuild-1 &&
 	test_config branch.rebuild-1.description hello &&
-	git format-patch --stdout --cover-letter ^master rebuild-1 >actual &&
+	git format-patch --stdout --cover-letter ^main rebuild-1 >actual &&
 	grep hello actual
 '
 
 test_expect_success 'cover letter using branch description (4)' '
 	git checkout rebuild-1 &&
 	test_config branch.rebuild-1.description hello &&
-	git format-patch --stdout --cover-letter master.. >actual &&
+	git format-patch --stdout --cover-letter main.. >actual &&
 	grep hello actual
 '
 
@@ -1932,8 +1932,8 @@ test_expect_success 'From line has expected format' '
 
 test_expect_success 'format-patch -o with no leading directories' '
 	rm -fr patches &&
-	git format-patch -o patches master..side &&
-	count=$(git rev-list --count master..side) &&
+	git format-patch -o patches main..side &&
+	count=$(git rev-list --count main..side) &&
 	ls patches >list &&
 	test_line_count = $count list
 '
@@ -1941,16 +1941,16 @@ test_expect_success 'format-patch -o with no leading directories' '
 test_expect_success 'format-patch -o with leading existing directories' '
 	rm -rf existing-dir &&
 	mkdir existing-dir &&
-	git format-patch -o existing-dir/patches master..side &&
-	count=$(git rev-list --count master..side) &&
+	git format-patch -o existing-dir/patches main..side &&
+	count=$(git rev-list --count main..side) &&
 	ls existing-dir/patches >list &&
 	test_line_count = $count list
 '
 
 test_expect_success 'format-patch -o with leading non-existing directories' '
 	rm -rf non-existing-dir &&
-	git format-patch -o non-existing-dir/patches master..side &&
-	count=$(git rev-list --count master..side) &&
+	git format-patch -o non-existing-dir/patches main..side &&
+	count=$(git rev-list --count main..side) &&
 	test_path_is_dir non-existing-dir &&
 	ls non-existing-dir/patches >list &&
 	test_line_count = $count list
@@ -1959,8 +1959,8 @@ test_expect_success 'format-patch -o with leading non-existing directories' '
 test_expect_success 'format-patch format.outputDirectory option' '
 	test_config format.outputDirectory patches &&
 	rm -fr patches &&
-	git format-patch master..side &&
-	count=$(git rev-list --count master..side) &&
+	git format-patch main..side &&
+	count=$(git rev-list --count main..side) &&
 	ls patches >list &&
 	test_line_count = $count list
 '
@@ -1968,7 +1968,7 @@ test_expect_success 'format-patch format.outputDirectory option' '
 test_expect_success 'format-patch -o overrides format.outputDirectory' '
 	test_config format.outputDirectory patches &&
 	rm -fr patches patchset &&
-	git format-patch master..side -o patchset &&
+	git format-patch main..side -o patchset &&
 	test_path_is_missing patches &&
 	test_path_is_dir patchset
 '
@@ -2065,14 +2065,14 @@ test_expect_success 'format-patch --base errors out when base commit is not ance
 	#	  ------------W
 	#
 	# If "format-patch Z..X" is given, P and Z can not be specified as the base commit
-	git checkout -b topic1 master &&
+	git checkout -b topic1 main &&
 	git rev-parse HEAD >commit-id-base &&
 	test_commit P &&
 	git rev-parse HEAD >commit-id-P &&
 	test_commit Z &&
 	git rev-parse HEAD >commit-id-Z &&
 	test_commit Y &&
-	git checkout -b topic2 master &&
+	git checkout -b topic2 main &&
 	test_commit W &&
 	git merge topic1 &&
 	test_commit X &&
@@ -2085,7 +2085,7 @@ test_expect_success 'format-patch --base errors out when base commit is not ance
 '
 
 test_expect_success 'format-patch --base=auto' '
-	git checkout -b upstream master &&
+	git checkout -b upstream main &&
 	git checkout -b local upstream &&
 	git branch --set-upstream-to=upstream &&
 	test_commit N1 &&
@@ -2106,11 +2106,11 @@ test_expect_success 'format-patch errors out when history involves criss-cross'
 	#  \ / \
 	#   C---M2---E
 	#
-	git checkout master &&
+	git checkout main &&
 	test_commit A &&
-	git checkout -b xb master &&
+	git checkout -b xb main &&
 	test_commit B &&
-	git checkout -b xc master &&
+	git checkout -b xc main &&
 	test_commit C &&
 	git checkout -b xbc xb -- &&
 	git merge xc &&
@@ -2230,7 +2230,7 @@ test_expect_success 'format-patch --pretty=mboxrd' '
 '
 
 test_expect_success 'interdiff: setup' '
-	git checkout -b boop master &&
+	git checkout -b boop main &&
 	test_commit fnorp blorp &&
 	test_commit fleep blorp
 '
diff --git a/t/t4015-diff-whitespace.sh b/t/t4015-diff-whitespace.sh
index 8bdaa0a693..899fad379e 100755
--- a/t/t4015-diff-whitespace.sh
+++ b/t/t4015-diff-whitespace.sh
@@ -883,7 +883,7 @@ test_expect_success 'combined diff with autocrlf conversion' '
 	echo >x goodbye &&
 	git commit -m "the other side" x &&
 	git config core.autocrlf true &&
-	test_must_fail git merge master &&
+	test_must_fail git merge main &&
 
 	git diff >actual.raw &&
 	sed -e "1,/^@@@/d" actual.raw >actual &&
diff --git a/t/t4017-diff-retval.sh b/t/t4017-diff-retval.sh
index 95a7ca7070..484d847749 100755
--- a/t/t4017-diff-retval.sh
+++ b/t/t4017-diff-retval.sh
@@ -111,7 +111,7 @@ test_expect_success 'check detects leftover conflict markers' '
 	git checkout HEAD^ &&
 	echo binary >>b &&
 	git commit -m "side" b &&
-	test_must_fail git merge master &&
+	test_must_fail git merge main &&
 	git add b &&
 	test_expect_code 2 git --no-pager diff --cached --check >test.out &&
 	test 3 = $(grep "conflict marker" test.out | wc -l) &&
diff --git a/t/t4038-diff-combined.sh b/t/t4038-diff-combined.sh
index 94680836ce..5eb36907c1 100755
--- a/t/t4038-diff-combined.sh
+++ b/t/t4038-diff-combined.sh
@@ -115,7 +115,7 @@ test_expect_success 'check --cc --raw with forty trees' '
 '
 
 test_expect_success 'setup combined ignore spaces' '
-	git checkout master &&
+	git checkout main &&
 	>test &&
 	git add test &&
 	git commit -m initial &&
@@ -143,7 +143,7 @@ test_expect_success 'setup combined ignore spaces' '
 	EOF
 	git commit -m "test other space changes" -a &&
 
-	test_must_fail git merge master &&
+	test_must_fail git merge main &&
 	tr -d Q <<-\EOF >test &&
 	eol spaces Q
 	space  change
@@ -404,7 +404,7 @@ test_expect_success 'combine diff missing delete bug' '
 test_expect_success 'combine diff gets tree sorting right' '
 	# create a directory and a file that sort differently in trees
 	# versus byte-wise (implied "/" sorts after ".")
-	git checkout -f master &&
+	git checkout -f main &&
 	mkdir foo &&
 	echo base >foo/one &&
 	echo base >foo/two &&
@@ -414,9 +414,9 @@ test_expect_success 'combine diff gets tree sorting right' '
 
 	# one side modifies a file in the directory, along with the root
 	# file...
-	echo master >foo/one &&
-	echo master >foo.ext &&
-	git commit -a -m master &&
+	echo main >foo/one &&
+	echo main >foo.ext &&
+	git commit -a -m main &&
 
 	# the other side modifies the other file in the directory
 	git checkout -b other HEAD^ &&
@@ -426,7 +426,7 @@ test_expect_success 'combine diff gets tree sorting right' '
 	# And now we merge. The files in the subdirectory will resolve cleanly,
 	# meaning that a combined diff will not find them interesting. But it
 	# will find the tree itself interesting, because it had to be merged.
-	git checkout master &&
+	git checkout main &&
 	git merge other &&
 
 	printf "MM\tfoo\n" >expect &&
diff --git a/t/t4041-diff-submodule-option.sh b/t/t4041-diff-submodule-option.sh
index f852136585..23701e0e8a 100755
--- a/t/t4041-diff-submodule-option.sh
+++ b/t/t4041-diff-submodule-option.sh
@@ -538,7 +538,7 @@ test_expect_success 'diff --submodule with objects referenced by alternates' '
 	(cd super &&
 		(cd sub &&
 			git fetch &&
-			git checkout origin/master
+			git checkout origin/main
 		) &&
 		git diff --submodule > ../actual
 	) &&
diff --git a/t/t4048-diff-combined-binary.sh b/t/t4048-diff-combined-binary.sh
index 7f9ad9fa3d..f23824c2b6 100755
--- a/t/t4048-diff-combined-binary.sh
+++ b/t/t4048-diff-combined-binary.sh
@@ -14,7 +14,7 @@ test_expect_success 'setup binary merge conflict' '
 	echo threeQ3 | q_to_nul >binary &&
 	git commit -a -m three &&
 	three=$(git rev-parse --short HEAD:binary) &&
-	test_must_fail git merge master &&
+	test_must_fail git merge main &&
 	echo resolvedQhooray | q_to_nul >binary &&
 	git commit -a -m resolved &&
 	res=$(git rev-parse --short HEAD:binary)
@@ -62,14 +62,14 @@ test_expect_success 'diff --cc indicates binary-ness' '
 '
 
 test_expect_success 'setup non-binary with binary attribute' '
-	git checkout master &&
+	git checkout main &&
 	test_commit one text &&
 	test_commit two text &&
 	two=$(git rev-parse --short HEAD:text) &&
 	git checkout -b branch-text HEAD^ &&
 	test_commit three text &&
 	three=$(git rev-parse --short HEAD:text) &&
-	test_must_fail git merge master &&
+	test_must_fail git merge main &&
 	test_commit resolved text &&
 	res=$(git rev-parse --short HEAD:text) &&
 	echo text -diff >.gitattributes
@@ -206,11 +206,11 @@ index $three,$two..0000000
  +THREE
 ++=======
 + TWO
-++>>>>>>> MASTER
+++>>>>>>> MAIN
 EOF
 test_expect_success 'diff --cc respects textconv on worktree file' '
 	git reset --hard HEAD^ &&
-	test_must_fail git merge master &&
+	test_must_fail git merge main &&
 	git diff >actual &&
 	test_cmp expect actual
 '
diff --git a/t/t4052-stat-output.sh b/t/t4052-stat-output.sh
index 28c053849a..e747a26cbd 100755
--- a/t/t4052-stat-output.sh
+++ b/t/t4052-stat-output.sh
@@ -353,7 +353,7 @@ cat >expect <<'EOF'
 EOF
 test_expect_success 'merge --stat respects COLUMNS (big change)' '
 	git checkout -b branch HEAD^^ &&
-	COLUMNS=100 git merge --stat --no-ff master^ >output &&
+	COLUMNS=100 git merge --stat --no-ff main^ >output &&
 	grep " | " output >actual &&
 	test_cmp expect actual
 '
@@ -362,7 +362,7 @@ cat >expect <<'EOF'
  aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa | 1000 +++++++++++++++++++++++++++++++++++++++
 EOF
 test_expect_success 'merge --stat respects COLUMNS (long filename)' '
-	COLUMNS=100 git merge --stat --no-ff master >output &&
+	COLUMNS=100 git merge --stat --no-ff main >output &&
 	grep " | " output >actual &&
 	test_cmp expect actual
 '
diff --git a/t/t4056-diff-order.sh b/t/t4056-diff-order.sh
index 43dd474a12..07fcee31f4 100755
--- a/t/t4056-diff-order.sh
+++ b/t/t4056-diff-order.sh
@@ -106,7 +106,7 @@ done
 test_expect_success 'setup for testing combine-diff order' '
 	git checkout -b tmp HEAD~ &&
 	create_files 3 &&
-	git checkout master &&
+	git checkout main &&
 	git merge --no-commit -s ours tmp &&
 	create_files 5
 '
diff --git a/t/t4057-diff-combined-paths.sh b/t/t4057-diff-combined-paths.sh
index 0b78573733..918b86fb63 100755
--- a/t/t4057-diff-combined-paths.sh
+++ b/t/t4057-diff-combined-paths.sh
@@ -24,9 +24,9 @@ test_expect_success 'trivial merge - combine-diff empty' '
 		echo $i/2 >>$i.txt
 	done &&
 	git commit -a -m "side 2-9" &&
-	git checkout master &&
+	git checkout main &&
 	echo 1/2 >1.txt &&
-	git commit -a -m "master 1" &&
+	git commit -a -m "main 1" &&
 	git merge side &&
 	>diffc.expect &&
 	diffc_verify
@@ -41,19 +41,19 @@ test_expect_success 'only one truly conflicting path' '
 	done &&
 	echo "4side" >>4.txt &&
 	git commit -a -m "side 2-9 +4" &&
-	git checkout master &&
+	git checkout main &&
 	for i in $(test_seq 1 9)
 	do
 		echo $i/3 >>$i.txt
 	done &&
-	echo "4master" >>4.txt &&
-	git commit -a -m "master 1-9 +4" &&
+	echo "4main" >>4.txt &&
+	git commit -a -m "main 1-9 +4" &&
 	test_must_fail git merge side &&
 	cat <<-\EOF >4.txt &&
 	4
 	4/2
 	4/3
-	4master
+	4main
 	4side
 	EOF
 	git add 4.txt &&
@@ -69,12 +69,12 @@ test_expect_success 'merge introduces new file' '
 		echo $i/4 >>$i.txt
 	done &&
 	git commit -a -m "side 5-9" &&
-	git checkout master &&
+	git checkout main &&
 	for i in $(test_seq 1 3)
 	do
 		echo $i/4 >>$i.txt
 	done &&
-	git commit -a -m "master 1-3 +4hello" &&
+	git commit -a -m "main 1-3 +4hello" &&
 	git merge side &&
 	echo "Hello World" >4hello.txt &&
 	git add 4hello.txt &&
@@ -90,12 +90,12 @@ test_expect_success 'merge removed a file' '
 		echo $i/5 >>$i.txt
 	done &&
 	git commit -a -m "side 5-9" &&
-	git checkout master &&
+	git checkout main &&
 	for i in $(test_seq 1 3)
 	do
 		echo $i/4 >>$i.txt
 	done &&
-	git commit -a -m "master 1-3" &&
+	git commit -a -m "main 1-3" &&
 	git merge side &&
 	git rm 4.txt &&
 	git commit --amend &&
diff --git a/t/t4061-diff-indent.sh b/t/t4061-diff-indent.sh
index 0f7a6d97a8..5efdc34d51 100755
--- a/t/t4061-diff-indent.sh
+++ b/t/t4061-diff-indent.sh
@@ -266,7 +266,7 @@ test_expect_success 'diff-index: nice spaces with --indent-heuristic' '
 	git reset --soft HEAD~ &&
 	git diff-index --indent-heuristic -p old -- spaces.txt >out-diff-index-compacted &&
 	compare_diff spaces-compacted-expect out-diff-index-compacted &&
-	git checkout -f master
+	git checkout -f main
 '
 
 test_expect_success 'diff-index: nice spaces with diff.indentHeuristic=true' '
@@ -274,7 +274,7 @@ test_expect_success 'diff-index: nice spaces with diff.indentHeuristic=true' '
 	git reset --soft HEAD~ &&
 	git -c diff.indentHeuristic=true diff-index -p old -- spaces.txt >out-diff-index-compacted2 &&
 	compare_diff spaces-compacted-expect out-diff-index-compacted2 &&
-	git checkout -f master
+	git checkout -f main
 '
 
 test_expect_success 'diff-index: ugly spaces with --no-indent-heuristic' '
@@ -282,7 +282,7 @@ test_expect_success 'diff-index: ugly spaces with --no-indent-heuristic' '
 	git reset --soft HEAD~ &&
 	git diff-index --no-indent-heuristic -p old -- spaces.txt >out-diff-index &&
 	compare_diff spaces-expect out-diff-index &&
-	git checkout -f master
+	git checkout -f main
 '
 
 test_expect_success 'diff-index: ugly spaces with diff.indentHeuristic=false' '
@@ -290,7 +290,7 @@ test_expect_success 'diff-index: ugly spaces with diff.indentHeuristic=false' '
 	git reset --soft HEAD~ &&
 	git -c diff.indentHeuristic=false diff-index -p old -- spaces.txt >out-diff-index2 &&
 	compare_diff spaces-expect out-diff-index2 &&
-	git checkout -f master
+	git checkout -f main
 '
 
 test_expect_success 'diff-index: --indent-heuristic overrides config' '
@@ -298,7 +298,7 @@ test_expect_success 'diff-index: --indent-heuristic overrides config' '
 	git reset --soft HEAD~ &&
 	git -c diff.indentHeuristic=false diff-index --indent-heuristic -p old -- spaces.txt >out-diff-index-compacted3 &&
 	compare_diff spaces-compacted-expect out-diff-index-compacted3 &&
-	git checkout -f master
+	git checkout -f main
 '
 
 test_expect_success 'diff-index: --no-indent-heuristic overrides config' '
@@ -306,7 +306,7 @@ test_expect_success 'diff-index: --no-indent-heuristic overrides config' '
 	git reset --soft HEAD~ &&
 	git -c diff.indentHeuristic=true diff-index --no-indent-heuristic -p old -- spaces.txt >out-diff-index3 &&
 	compare_diff spaces-expect out-diff-index3 &&
-	git checkout -f master
+	git checkout -f main
 '
 
 # --- diff-files tests ----------------------------------------------------
@@ -317,7 +317,7 @@ test_expect_success 'diff-files: nice spaces with --indent-heuristic' '
 	git diff-files --indent-heuristic -p spaces.txt >out-diff-files-raw &&
 	grep -v index out-diff-files-raw >out-diff-files-compacted &&
 	compare_diff spaces-compacted-expect out-diff-files-compacted &&
-	git checkout -f master
+	git checkout -f main
 '
 
 test_expect_success 'diff-files: nice spaces with diff.indentHeuristic=true' '
@@ -326,7 +326,7 @@ test_expect_success 'diff-files: nice spaces with diff.indentHeuristic=true' '
 	git -c diff.indentHeuristic=true diff-files -p spaces.txt >out-diff-files-raw2 &&
 	grep -v index out-diff-files-raw2 >out-diff-files-compacted2 &&
 	compare_diff spaces-compacted-expect out-diff-files-compacted2 &&
-	git checkout -f master
+	git checkout -f main
 '
 
 test_expect_success 'diff-files: ugly spaces with --no-indent-heuristic' '
@@ -335,7 +335,7 @@ test_expect_success 'diff-files: ugly spaces with --no-indent-heuristic' '
 	git diff-files --no-indent-heuristic -p spaces.txt >out-diff-files-raw &&
 	grep -v index out-diff-files-raw >out-diff-files &&
 	compare_diff spaces-expect out-diff-files &&
-	git checkout -f master
+	git checkout -f main
 '
 
 test_expect_success 'diff-files: ugly spaces with diff.indentHeuristic=false' '
@@ -344,7 +344,7 @@ test_expect_success 'diff-files: ugly spaces with diff.indentHeuristic=false' '
 	git -c diff.indentHeuristic=false diff-files -p spaces.txt >out-diff-files-raw2 &&
 	grep -v index out-diff-files-raw2 >out-diff-files &&
 	compare_diff spaces-expect out-diff-files &&
-	git checkout -f master
+	git checkout -f main
 '
 
 test_expect_success 'diff-files: --indent-heuristic overrides config' '
@@ -353,7 +353,7 @@ test_expect_success 'diff-files: --indent-heuristic overrides config' '
 	git -c diff.indentHeuristic=false diff-files --indent-heuristic -p spaces.txt >out-diff-files-raw3 &&
 	grep -v index out-diff-files-raw3 >out-diff-files-compacted &&
 	compare_diff spaces-compacted-expect out-diff-files-compacted &&
-	git checkout -f master
+	git checkout -f main
 '
 
 test_expect_success 'diff-files: --no-indent-heuristic overrides config' '
@@ -362,7 +362,7 @@ test_expect_success 'diff-files: --no-indent-heuristic overrides config' '
 	git -c diff.indentHeuristic=true diff-files --no-indent-heuristic -p spaces.txt >out-diff-files-raw4 &&
 	grep -v index out-diff-files-raw4 >out-diff-files &&
 	compare_diff spaces-expect out-diff-files &&
-	git checkout -f master
+	git checkout -f main
 '
 
 test_done
diff --git a/t/t4066-diff-emit-delay.sh b/t/t4066-diff-emit-delay.sh
index 6331f63b12..fcd54fa3eb 100755
--- a/t/t4066-diff-emit-delay.sh
+++ b/t/t4066-diff-emit-delay.sh
@@ -13,7 +13,7 @@ test_expect_success 'set up history with a merge' '
 	test_commit B &&
 	git checkout -b side HEAD^ &&
 	test_commit C &&
-	git merge -m M master &&
+	git merge -m M main &&
 	test_commit D
 '
 
diff --git a/t/t4068-diff-symmetric-merge-base.sh b/t/t4068-diff-symmetric-merge-base.sh
index 03487cc945..ccd4da4fe9 100755
--- a/t/t4068-diff-symmetric-merge-base.sh
+++ b/t/t4068-diff-symmetric-merge-base.sh
@@ -6,10 +6,10 @@ test_description='behavior of diff with symmetric-diff setups and --merge-base'
 
 # build these situations:
 #  - normal merge with one merge base (br1...b2r);
-#  - criss-cross merge ie 2 merge bases (br1...master);
-#  - disjoint subgraph (orphan branch, br3...master).
+#  - criss-cross merge ie 2 merge bases (br1...main);
+#  - disjoint subgraph (orphan branch, br3...main).
 #
-#     B---E   <-- master
+#     B---E   <-- main
 #    / \ /
 #   A   X
 #    \ / \
@@ -32,9 +32,9 @@ test_expect_success setup '
 	git add c &&
 	git commit -m C &&
 	git tag commit-C &&
-	git merge -m D master &&
+	git merge -m D main &&
 	git tag commit-D &&
-	git checkout master &&
+	git checkout main &&
 	git merge -m E commit-C &&
 	git checkout -b br2 commit-C &&
 	echo f >f &&
@@ -58,7 +58,7 @@ test_expect_success 'diff with one merge base' '
 # It should have one of those two, which comes out
 # to seven lines.
 test_expect_success 'diff with two merge bases' '
-	git diff br1...master >tmp 2>err &&
+	git diff br1...main >tmp 2>err &&
 	test_line_count = 7 tmp &&
 	test_line_count = 1 err
 '
@@ -69,22 +69,22 @@ test_expect_success 'diff with no merge bases' '
 '
 
 test_expect_success 'diff with too many symmetric differences' '
-	test_must_fail git diff br1...master br2...br3 2>err &&
+	test_must_fail git diff br1...main br2...br3 2>err &&
 	test_i18ngrep "usage" err
 '
 
 test_expect_success 'diff with symmetric difference and extraneous arg' '
-	test_must_fail git diff master br1...master 2>err &&
+	test_must_fail git diff main br1...main 2>err &&
 	test_i18ngrep "usage" err
 '
 
 test_expect_success 'diff with two ranges' '
-	test_must_fail git diff master br1..master br2..br3 2>err &&
+	test_must_fail git diff main br1..main br2..br3 2>err &&
 	test_i18ngrep "usage" err
 '
 
 test_expect_success 'diff with ranges and extra arg' '
-	test_must_fail git diff master br1..master commit-D 2>err &&
+	test_must_fail git diff main br1..main commit-D 2>err &&
 	test_i18ngrep "usage" err
 '
 
@@ -93,21 +93,21 @@ test_expect_success 'diff --merge-base with no commits' '
 '
 
 test_expect_success 'diff --merge-base with three commits' '
-	test_must_fail git diff --merge-base br1 br2 master 2>err &&
+	test_must_fail git diff --merge-base br1 br2 main 2>err &&
 	test_i18ngrep "usage" err
 '
 
 for cmd in diff-index diff
 do
 	test_expect_success "$cmd --merge-base with one commit" '
-		git checkout master &&
+		git checkout main &&
 		git $cmd commit-C >expect &&
 		git $cmd --merge-base br2 >actual &&
 		test_cmp expect actual
 	'
 
 	test_expect_success "$cmd --merge-base with one commit and unstaged changes" '
-		git checkout master &&
+		git checkout main &&
 		test_when_finished git reset --hard &&
 		echo unstaged >>c &&
 		git $cmd commit-C >expect &&
@@ -116,7 +116,7 @@ do
 	'
 
 	test_expect_success "$cmd --merge-base with one commit and staged and unstaged changes" '
-		git checkout master &&
+		git checkout main &&
 		test_when_finished git reset --hard &&
 		echo staged >>c &&
 		git add c &&
@@ -127,7 +127,7 @@ do
 	'
 
 	test_expect_success "$cmd --merge-base --cached with one commit and staged and unstaged changes" '
-		git checkout master &&
+		git checkout main &&
 		test_when_finished git reset --hard &&
 		echo staged >>c &&
 		git add c &&
@@ -138,19 +138,19 @@ do
 	'
 
 	test_expect_success "$cmd --merge-base with non-commit" '
-		git checkout master &&
-		test_must_fail git $cmd --merge-base master^{tree} 2>err &&
+		git checkout main &&
+		test_must_fail git $cmd --merge-base main^{tree} 2>err &&
 		test_i18ngrep "fatal: --merge-base only works with commits" err
 	'
 
 	test_expect_success "$cmd --merge-base with no merge bases and one commit" '
-		git checkout master &&
+		git checkout main &&
 		test_must_fail git $cmd --merge-base br3 2>err &&
 		test_i18ngrep "fatal: no merge base found" err
 	'
 
 	test_expect_success "$cmd --merge-base with multiple merge bases and one commit" '
-		git checkout master &&
+		git checkout main &&
 		test_must_fail git $cmd --merge-base br1 2>err &&
 		test_i18ngrep "fatal: multiple merge bases found" err
 	'
@@ -159,13 +159,13 @@ done
 for cmd in diff-tree diff
 do
 	test_expect_success "$cmd --merge-base with two commits" '
-		git $cmd commit-C master >expect &&
-		git $cmd --merge-base br2 master >actual &&
+		git $cmd commit-C main >expect &&
+		git $cmd --merge-base br2 main >actual &&
 		test_cmp expect actual
 	'
 
 	test_expect_success "$cmd --merge-base commit and non-commit" '
-		test_must_fail git $cmd --merge-base br2 master^{tree} 2>err &&
+		test_must_fail git $cmd --merge-base br2 main^{tree} 2>err &&
 		test_i18ngrep "fatal: --merge-base only works with commits" err
 	'
 
@@ -175,13 +175,13 @@ do
 	'
 
 	test_expect_success "$cmd --merge-base with multiple merge bases and two commits" '
-		test_must_fail git $cmd --merge-base master br1 2>err &&
+		test_must_fail git $cmd --merge-base main br1 2>err &&
 		test_i18ngrep "fatal: multiple merge bases found" err
 	'
 done
 
 test_expect_success 'diff-tree --merge-base with one commit' '
-	test_must_fail git diff-tree --merge-base master 2>err &&
+	test_must_fail git diff-tree --merge-base main 2>err &&
 	test_i18ngrep "fatal: --merge-base only works with two commits" err
 '
 
diff --git a/t/t4103-apply-binary.sh b/t/t4103-apply-binary.sh
index 1b420e3b5f..b5a68cfe78 100755
--- a/t/t4103-apply-binary.sh
+++ b/t/t4103-apply-binary.sh
@@ -31,64 +31,64 @@ test_expect_success 'setup' '
 	git update-index --add --remove file1 file2 file3 file4 &&
 	git commit -m "Second Version" &&
 
-	git diff-tree -p master binary >B.diff &&
-	git diff-tree -p -C master binary >C.diff &&
+	git diff-tree -p main binary >B.diff &&
+	git diff-tree -p -C main binary >C.diff &&
 
-	git diff-tree -p --binary master binary >BF.diff &&
-	git diff-tree -p --binary -C master binary >CF.diff &&
+	git diff-tree -p --binary main binary >BF.diff &&
+	git diff-tree -p --binary -C main binary >CF.diff &&
 
-	git diff-tree -p --full-index master binary >B-index.diff &&
-	git diff-tree -p -C --full-index master binary >C-index.diff &&
+	git diff-tree -p --full-index main binary >B-index.diff &&
+	git diff-tree -p -C --full-index main binary >C-index.diff &&
 
-	git diff-tree -p --binary --no-prefix master binary -- file3 >B0.diff &&
+	git diff-tree -p --binary --no-prefix main binary -- file3 >B0.diff &&
 
 	git init other-repo &&
 	(
 		cd other-repo &&
-		git fetch .. master &&
+		git fetch .. main &&
 		git reset --hard FETCH_HEAD
 	)
 '
 
 test_expect_success 'stat binary diff -- should not fail.' \
-	'git checkout master &&
+	'git checkout main &&
 	 git apply --stat --summary B.diff'
 
 test_expect_success 'stat binary -p0 diff -- should not fail.' '
-	 git checkout master &&
+	 git checkout main &&
 	 git apply --stat -p0 B0.diff
 '
 
 test_expect_success 'stat binary diff (copy) -- should not fail.' \
-	'git checkout master &&
+	'git checkout main &&
 	 git apply --stat --summary C.diff'
 
 test_expect_success 'check binary diff -- should fail.' \
-	'git checkout master &&
+	'git checkout main &&
 	 test_must_fail git apply --check B.diff'
 
 test_expect_success 'check binary diff (copy) -- should fail.' \
-	'git checkout master &&
+	'git checkout main &&
 	 test_must_fail git apply --check C.diff'
 
 test_expect_success \
 	'check incomplete binary diff with replacement -- should fail.' '
-	git checkout master &&
+	git checkout main &&
 	test_must_fail git apply --check --allow-binary-replacement B.diff
 '
 
 test_expect_success \
     'check incomplete binary diff with replacement (copy) -- should fail.' '
-	 git checkout master &&
+	 git checkout main &&
 	 test_must_fail git apply --check --allow-binary-replacement C.diff
 '
 
 test_expect_success 'check binary diff with replacement.' \
-	'git checkout master &&
+	'git checkout main &&
 	 git apply --check --allow-binary-replacement BF.diff'
 
 test_expect_success 'check binary diff with replacement (copy).' \
-	'git checkout master &&
+	'git checkout main &&
 	 git apply --check --allow-binary-replacement CF.diff'
 
 # Now we start applying them.
@@ -96,7 +96,7 @@ test_expect_success 'check binary diff with replacement (copy).' \
 do_reset () {
 	rm -f file? &&
 	git reset --hard &&
-	git checkout -f master
+	git checkout -f main
 }
 
 test_expect_success 'apply binary diff -- should fail.' \
diff --git a/t/t4108-apply-threeway.sh b/t/t4108-apply-threeway.sh
index d7349ced6b..f073df1792 100755
--- a/t/t4108-apply-threeway.sh
+++ b/t/t4108-apply-threeway.sh
@@ -24,14 +24,14 @@ test_expect_success setup '
 	test_tick &&
 	test_write_lines 1 two 3 4 5 six 7 >one &&
 	test_write_lines 1 two 3 4 5 6 7 >two &&
-	git commit -a -m master &&
+	git commit -a -m main &&
 
 	git checkout side &&
 	test_write_lines 1 2 3 4 five 6 7 >one &&
 	test_write_lines 1 2 3 4 five 6 7 >two &&
 	git commit -a -m side &&
 
-	git checkout master
+	git checkout main
 '
 
 test_expect_success 'apply without --3way' '
@@ -39,7 +39,7 @@ test_expect_success 'apply without --3way' '
 
 	# should fail to apply
 	git reset --hard &&
-	git checkout master^0 &&
+	git checkout main^0 &&
 	test_must_fail git apply --index P.diff &&
 	# should leave things intact
 	git diff-files --exit-code &&
@@ -52,14 +52,14 @@ test_apply_with_3way () {
 
 	# The corresponding conflicted merge
 	git reset --hard &&
-	git checkout master^0 &&
+	git checkout main^0 &&
 	test_must_fail git merge --no-commit side &&
 	git ls-files -s >expect.ls &&
 	print_sanitized_conflicted_diff >expect.diff &&
 
 	# should fail to apply
 	git reset --hard &&
-	git checkout master^0 &&
+	git checkout main^0 &&
 	test_must_fail git apply --index --3way P.diff &&
 	git ls-files -s >actual.ls &&
 	print_sanitized_conflicted_diff >actual.diff &&
@@ -86,7 +86,7 @@ test_expect_success 'apply with --3way with rerere enabled' '
 
 	# The corresponding conflicted merge
 	git reset --hard &&
-	git checkout master^0 &&
+	git checkout main^0 &&
 	test_must_fail git merge --no-commit side &&
 
 	# Manually resolve and record the resolution
@@ -96,7 +96,7 @@ test_expect_success 'apply with --3way with rerere enabled' '
 
 	# should fail to apply
 	git reset --hard &&
-	git checkout master^0 &&
+	git checkout main^0 &&
 	test_must_fail git apply --index --3way P.diff &&
 
 	# but rerere should have replayed the recorded resolution
diff --git a/t/t4121-apply-diffs.sh b/t/t4121-apply-diffs.sh
index 66368effd5..ff2257fef1 100755
--- a/t/t4121-apply-diffs.sh
+++ b/t/t4121-apply-diffs.sh
@@ -23,7 +23,7 @@ test_expect_success 'setup' \
 	git commit -a -q -m 2 &&
 	echo 9 >>file &&
 	git commit -a -q -m 3 &&
-	git checkout master'
+	git checkout main'
 
 test_expect_success \
 	'check if contextually independent diffs for the same file apply' \
diff --git a/t/t4122-apply-symlink-inside.sh b/t/t4122-apply-symlink-inside.sh
index 4acb3f336e..36562677c4 100755
--- a/t/t4122-apply-symlink-inside.sh
+++ b/t/t4122-apply-symlink-inside.sh
@@ -35,11 +35,11 @@ test_expect_success apply '
 
 test_expect_success 'check result' '
 
-	git diff --exit-code master &&
-	git diff --exit-code --cached master &&
+	git diff --exit-code main &&
+	git diff --exit-code --cached main &&
 	test_tick &&
 	git commit -m replay &&
-	T1=$(git rev-parse "master^{tree}") &&
+	T1=$(git rev-parse "main^{tree}") &&
 	T2=$(git rev-parse "HEAD^{tree}") &&
 	test "z$T1" = "z$T2"
 
diff --git a/t/t4150-am.sh b/t/t4150-am.sh
index 3ecbef6f8e..2514341522 100755
--- a/t/t4150-am.sh
+++ b/t/t4150-am.sh
@@ -179,8 +179,8 @@ test_expect_success setup '
 	test_tick &&
 	git commit -m "added another file" &&
 
-	git format-patch --stdout master >lorem-move.patch &&
-	git format-patch --no-prefix --stdout master >lorem-zero.patch &&
+	git format-patch --stdout main >lorem-move.patch &&
+	git format-patch --no-prefix --stdout main >lorem-zero.patch &&
 
 	git checkout -b rename &&
 	git mv file renamed &&
@@ -453,11 +453,11 @@ test_expect_success 'am changes committer and keeps author' '
 	git checkout first &&
 	git am patch2 &&
 	test_path_is_missing .git/rebase-apply &&
-	test "$(git rev-parse master^^)" = "$(git rev-parse HEAD^^)" &&
-	git diff --exit-code master..HEAD &&
-	git diff --exit-code master^..HEAD^ &&
-	compare author master HEAD &&
-	compare author master^ HEAD^ &&
+	test "$(git rev-parse main^^)" = "$(git rev-parse HEAD^^)" &&
+	git diff --exit-code main..HEAD &&
+	git diff --exit-code main^..HEAD^ &&
+	compare author main HEAD &&
+	compare author main^ HEAD^ &&
 	test "$GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL>" = \
 	     "$(git log -1 --pretty=format:"%cn <%ce>" HEAD)"
 '
@@ -759,7 +759,7 @@ test_expect_success 'am takes patches from a Pine mailbox' '
 	git checkout first &&
 	cat pine patch1 | git am &&
 	test_path_is_missing .git/rebase-apply &&
-	git diff --exit-code master^..HEAD
+	git diff --exit-code main^..HEAD
 '
 
 test_expect_success 'am fails on mail without patch' '
@@ -1112,21 +1112,21 @@ test_expect_success 'am and .gitattibutes' '
 		test_commit sixth &&
 
 		git checkout test &&
-		git format-patch --stdout master..HEAD >patches &&
-		git reset --hard master &&
+		git format-patch --stdout main..HEAD >patches &&
+		git reset --hard main &&
 		git am patches &&
 		grep "smudged" a.txt &&
 
 		git checkout removal &&
 		git reset --hard &&
-		git format-patch --stdout master..HEAD >patches &&
-		git reset --hard master &&
+		git format-patch --stdout main..HEAD >patches &&
+		git reset --hard main &&
 		git am patches &&
 		grep "clean" a.txt &&
 
 		git checkout conflict &&
 		git reset --hard &&
-		git format-patch --stdout master..HEAD >patches &&
+		git format-patch --stdout main..HEAD >patches &&
 		git reset --hard fourth &&
 		test_must_fail git am -3 patches &&
 		grep "<<<<<<<<<<" a.txt
diff --git a/t/t4200-rerere.sh b/t/t4200-rerere.sh
index b12b43e9e9..a6222b84bb 100755
--- a/t/t4200-rerere.sh
+++ b/t/t4200-rerere.sh
@@ -8,7 +8,7 @@ test_description='git rerere
 ! [fifth] version1
  ! [first] first
   ! [fourth] version1
-   ! [master] initial
+   ! [main] initial
     ! [second] prefer first over second
      ! [third] version2
 ------
@@ -19,7 +19,7 @@ test_description='git rerere
     -  [second] prefer first over second
  +  +  [first] first
     +  [second^] second
-++++++ [master] initial
+++++++ [main] initial
 '
 
 . ./test-lib.sh
@@ -57,7 +57,7 @@ test_expect_success 'setup' '
 	test_tick &&
 	git commit -q -a -m first &&
 
-	git checkout -b second master &&
+	git checkout -b second main &&
 	git show first:a1 |
 	sed -e "s/To die, t/To die! T/" -e "s/Some title/Some Title/" >a1 &&
 	echo "* END *" >>a1 &&
@@ -168,7 +168,7 @@ test_expect_success 'first postimage wins' '
 
 	oldmtimepost=$(test-tool chmtime --get -60 $rr/postimage) &&
 
-	git checkout -b third master &&
+	git checkout -b third main &&
 	git show second^:a1 | sed "s/To die: t/To die! T/" >a1 &&
 	git commit -q -a -m third &&
 
@@ -580,13 +580,13 @@ test_expect_success 'multiple identical conflicts' '
 test_expect_success 'rerere with unexpected conflict markers does not crash' '
 	git reset --hard &&
 
-	git checkout -b branch-1 master &&
+	git checkout -b branch-1 main &&
 	echo "bar" >test &&
 	git add test &&
 	git commit -q -m two &&
 
 	git reset --hard &&
-	git checkout -b branch-2 master &&
+	git checkout -b branch-2 main &&
 	echo "foo" >test &&
 	git add test &&
 	git commit -q -a -m one &&
@@ -601,7 +601,7 @@ test_expect_success 'rerere with unexpected conflict markers does not crash' '
 test_expect_success 'rerere with inner conflict markers' '
 	git reset --hard &&
 
-	git checkout -b A master &&
+	git checkout -b A main &&
 	echo "bar" >test &&
 	git add test &&
 	git commit -q -m two &&
@@ -610,7 +610,7 @@ test_expect_success 'rerere with inner conflict markers' '
 	git commit -q -m three &&
 
 	git reset --hard &&
-	git checkout -b B master &&
+	git checkout -b B main &&
 	echo "foo" >test &&
 	git add test &&
 	git commit -q -a -m one &&
@@ -651,11 +651,11 @@ test_expect_success 'setup simple stage 1 handling' '
 		git add original &&
 		git commit -m original &&
 
-		git checkout -b A master &&
+		git checkout -b A main &&
 		git mv original A &&
 		git commit -m "rename to A" &&
 
-		git checkout -b B master &&
+		git checkout -b B main &&
 		git mv original B &&
 		git commit -m "rename to B"
 	)
diff --git a/t/t4201-shortlog.sh b/t/t4201-shortlog.sh
index 3d5c4a2086..005fff4c2c 100755
--- a/t/t4201-shortlog.sh
+++ b/t/t4201-shortlog.sh
@@ -191,7 +191,7 @@ test_expect_success 'shortlog with revision pseudo options' '
 '
 
 test_expect_success 'shortlog with --output=<file>' '
-	git shortlog --output=shortlog -1 master >output &&
+	git shortlog --output=shortlog -1 main >output &&
 	test_must_be_empty output &&
 	test_line_count = 3 shortlog
 '
diff --git a/t/t4202-log.sh b/t/t4202-log.sh
index 56d34ed465..93b72ad85e 100755
--- a/t/t4202-log.sh
+++ b/t/t4202-log.sh
@@ -478,7 +478,7 @@ test_expect_success 'set up merge history' '
 	git checkout -b side HEAD~4 &&
 	test_commit side-1 1 1 &&
 	test_commit side-2 2 2 &&
-	git checkout master &&
+	git checkout main &&
 	git merge side
 '
 
@@ -541,17 +541,17 @@ test_expect_success 'log --graph with merge with log.graphColors' '
 '
 
 test_expect_success 'log --raw --graph -m with merge' '
-	git log --raw --graph --oneline -m master | head -n 500 >actual &&
+	git log --raw --graph --oneline -m main | head -n 500 >actual &&
 	grep "initial" actual
 '
 
 test_expect_success 'diff-tree --graph' '
-	git diff-tree --graph master^ | head -n 500 >actual &&
+	git diff-tree --graph main^ | head -n 500 >actual &&
 	grep "one" actual
 '
 
 cat > expect <<\EOF
-*   commit master
+*   commit main
 |\  Merge: A B
 | | Author: A U Thor <author@example.com>
 | |
@@ -567,22 +567,22 @@ cat > expect <<\EOF
 | |
 | |     side-1
 | |
-* | commit master~1
+* | commit main~1
 | | Author: A U Thor <author@example.com>
 | |
 | |     Second
 | |
-* | commit master~2
+* | commit main~2
 | | Author: A U Thor <author@example.com>
 | |
 | |     sixth
 | |
-* | commit master~3
+* | commit main~3
 | | Author: A U Thor <author@example.com>
 | |
 | |     fifth
 | |
-* | commit master~4
+* | commit main~4
 |/  Author: A U Thor <author@example.com>
 |
 |       fourth
@@ -613,19 +613,19 @@ test_expect_success 'log --graph with full output' '
 test_expect_success 'set up more tangled history' '
 	git checkout -b tangle HEAD~6 &&
 	test_commit tangle-a tangle-a a &&
-	git merge master~3 &&
+	git merge main~3 &&
 	git merge side~1 &&
-	git checkout master &&
+	git checkout main &&
 	git merge tangle &&
 	git checkout -b reach &&
 	test_commit reach &&
-	git checkout master &&
+	git checkout main &&
 	git checkout -b octopus-a &&
 	test_commit octopus-a &&
-	git checkout master &&
+	git checkout main &&
 	git checkout -b octopus-b &&
 	test_commit octopus-b &&
-	git checkout master &&
+	git checkout main &&
 	test_commit seventh &&
 	git merge octopus-a octopus-b &&
 	git merge reach
@@ -650,7 +650,7 @@ cat > expect <<\EOF
 |\
 | *   Merge branch 'side' (early part) into tangle
 | |\
-| * \   Merge branch 'master' (early part) into tangle
+| * \   Merge branch 'main' (early part) into tangle
 | |\ \
 | * | | tangle-a
 * | | |   Merge branch 'side'
@@ -794,7 +794,7 @@ test_expect_success 'multiple decorate-refs' '
 
 test_expect_success 'decorate-refs-exclude with glob' '
 	cat >expect.decorate <<-\EOF &&
-	Merge-tag-reach (HEAD -> master)
+	Merge-tag-reach (HEAD -> main)
 	Merge-tags-octopus-a-and-octopus-b
 	seventh (tag: seventh)
 	octopus-b (tag: octopus-b)
@@ -811,7 +811,7 @@ test_expect_success 'decorate-refs-exclude with glob' '
 
 test_expect_success 'decorate-refs-exclude without globs' '
 	cat >expect.decorate <<-\EOF &&
-	Merge-tag-reach (HEAD -> master)
+	Merge-tag-reach (HEAD -> main)
 	Merge-tags-octopus-a-and-octopus-b
 	seventh (tag: seventh)
 	octopus-b (tag: octopus-b, octopus-b)
@@ -828,7 +828,7 @@ test_expect_success 'decorate-refs-exclude without globs' '
 
 test_expect_success 'multiple decorate-refs-exclude' '
 	cat >expect.decorate <<-\EOF &&
-	Merge-tag-reach (HEAD -> master)
+	Merge-tag-reach (HEAD -> main)
 	Merge-tags-octopus-a-and-octopus-b
 	seventh (tag: seventh)
 	octopus-b (tag: octopus-b)
@@ -851,7 +851,7 @@ test_expect_success 'multiple decorate-refs-exclude' '
 
 test_expect_success 'decorate-refs and decorate-refs-exclude' '
 	cat >expect.no-decorate <<-\EOF &&
-	Merge-tag-reach (master)
+	Merge-tag-reach (main)
 	Merge-tags-octopus-a-and-octopus-b
 	seventh
 	octopus-b
@@ -866,7 +866,7 @@ test_expect_success 'decorate-refs and decorate-refs-exclude' '
 
 test_expect_success 'deocrate-refs and log.excludeDecoration' '
 	cat >expect.decorate <<-\EOF &&
-	Merge-tag-reach (master)
+	Merge-tag-reach (main)
 	Merge-tags-octopus-a-and-octopus-b
 	seventh
 	octopus-b (octopus-b)
@@ -881,7 +881,7 @@ test_expect_success 'deocrate-refs and log.excludeDecoration' '
 
 test_expect_success 'decorate-refs-exclude and simplify-by-decoration' '
 	cat >expect.decorate <<-\EOF &&
-	Merge-tag-reach (HEAD -> master)
+	Merge-tag-reach (HEAD -> main)
 	reach (tag: reach, reach)
 	seventh (tag: seventh)
 	Merge-branch-tangle
@@ -1080,7 +1080,7 @@ cat >expect <<\EOF
 | |\ \  Merge: MERGE_PARENTS
 | | | | Author: A U Thor <author@example.com>
 | | | |
-| | | |     Merge branch 'master' (early part) into tangle
+| | | |     Merge branch 'main' (early part) into tangle
 | | | |
 | * | | commit COMMIT_OBJECT_NAME
 | | | | Author: A U Thor <author@example.com>
@@ -1355,7 +1355,7 @@ cat >expect <<\EOF
 *** | |\ \  Merge: MERGE_PARENTS
 *** | | | | Author: A U Thor <author@example.com>
 *** | | | |
-*** | | | |     Merge branch 'master' (early part) into tangle
+*** | | | |     Merge branch 'main' (early part) into tangle
 *** | | | |
 *** | * | | commit COMMIT_OBJECT_NAME
 *** | | | | Author: A U Thor <author@example.com>
@@ -1588,24 +1588,24 @@ test_expect_success 'dotdot is a parent directory' '
 '
 
 test_expect_success GPG 'setup signed branch' '
-	test_when_finished "git reset --hard && git checkout master" &&
-	git checkout -b signed master &&
+	test_when_finished "git reset --hard && git checkout main" &&
+	git checkout -b signed main &&
 	echo foo >foo &&
 	git add foo &&
 	git commit -S -m signed_commit
 '
 
 test_expect_success GPG 'setup signed branch with subkey' '
-	test_when_finished "git reset --hard && git checkout master" &&
-	git checkout -b signed-subkey master &&
+	test_when_finished "git reset --hard && git checkout main" &&
+	git checkout -b signed-subkey main &&
 	echo foo >foo &&
 	git add foo &&
 	git commit -SB7227189 -m signed_commit
 '
 
 test_expect_success GPGSM 'setup signed branch x509' '
-	test_when_finished "git reset --hard && git checkout master" &&
-	git checkout -b signed-x509 master &&
+	test_when_finished "git reset --hard && git checkout main" &&
+	git checkout -b signed-x509 main &&
 	echo foo >foo &&
 	git add foo &&
 	test_config gpg.format x509 &&
@@ -1638,12 +1638,12 @@ test_expect_success GPGSM 'log --graph --show-signature x509' '
 '
 
 test_expect_success GPG 'log --graph --show-signature for merged tag' '
-	test_when_finished "git reset --hard && git checkout master" &&
-	git checkout -b plain master &&
+	test_when_finished "git reset --hard && git checkout main" &&
+	git checkout -b plain main &&
 	echo aaa >bar &&
 	git add bar &&
 	git commit -m bar_commit &&
-	git checkout -b tagged master &&
+	git checkout -b tagged main &&
 	echo bbb >baz &&
 	git add baz &&
 	git commit -m baz_commit &&
@@ -1657,12 +1657,12 @@ test_expect_success GPG 'log --graph --show-signature for merged tag' '
 '
 
 test_expect_success GPG 'log --graph --show-signature for merged tag in shallow clone' '
-	test_when_finished "git reset --hard && git checkout master" &&
-	git checkout -b plain-shallow master &&
+	test_when_finished "git reset --hard && git checkout main" &&
+	git checkout -b plain-shallow main &&
 	echo aaa >bar &&
 	git add bar &&
 	git commit -m bar_commit &&
-	git checkout --detach master &&
+	git checkout --detach main &&
 	echo bbb >baz &&
 	git add baz &&
 	git commit -m baz_commit &&
@@ -1677,12 +1677,12 @@ test_expect_success GPG 'log --graph --show-signature for merged tag in shallow
 '
 
 test_expect_success GPG 'log --graph --show-signature for merged tag with missing key' '
-	test_when_finished "git reset --hard && git checkout master" &&
-	git checkout -b plain-nokey master &&
+	test_when_finished "git reset --hard && git checkout main" &&
+	git checkout -b plain-nokey main &&
 	echo aaa >bar &&
 	git add bar &&
 	git commit -m bar_commit &&
-	git checkout -b tagged-nokey master &&
+	git checkout -b tagged-nokey main &&
 	echo bbb >baz &&
 	git add baz &&
 	git commit -m baz_commit &&
@@ -1696,12 +1696,12 @@ test_expect_success GPG 'log --graph --show-signature for merged tag with missin
 '
 
 test_expect_success GPG 'log --graph --show-signature for merged tag with bad signature' '
-	test_when_finished "git reset --hard && git checkout master" &&
-	git checkout -b plain-bad master &&
+	test_when_finished "git reset --hard && git checkout main" &&
+	git checkout -b plain-bad main &&
 	echo aaa >bar &&
 	git add bar &&
 	git commit -m bar_commit &&
-	git checkout -b tagged-bad master &&
+	git checkout -b tagged-bad main &&
 	echo bbb >baz &&
 	git add baz &&
 	git commit -m baz_commit &&
@@ -1718,12 +1718,12 @@ test_expect_success GPG 'log --graph --show-signature for merged tag with bad si
 '
 
 test_expect_success GPG 'log --show-signature for merged tag with GPG failure' '
-	test_when_finished "git reset --hard && git checkout master" &&
-	git checkout -b plain-fail master &&
+	test_when_finished "git reset --hard && git checkout main" &&
+	git checkout -b plain-fail main &&
 	echo aaa >bar &&
 	git add bar &&
 	git commit -m bar_commit &&
-	git checkout -b tagged-fail master &&
+	git checkout -b tagged-fail main &&
 	echo bbb >baz &&
 	git add baz &&
 	git commit -m baz_commit &&
@@ -1737,14 +1737,14 @@ test_expect_success GPG 'log --show-signature for merged tag with GPG failure' '
 '
 
 test_expect_success GPGSM 'log --graph --show-signature for merged tag x509' '
-	test_when_finished "git reset --hard && git checkout master" &&
+	test_when_finished "git reset --hard && git checkout main" &&
 	test_config gpg.format x509 &&
 	test_config user.signingkey $GIT_COMMITTER_EMAIL &&
-	git checkout -b plain-x509 master &&
+	git checkout -b plain-x509 main &&
 	echo aaa >bar &&
 	git add bar &&
 	git commit -m bar_commit &&
-	git checkout -b tagged-x509 master &&
+	git checkout -b tagged-x509 main &&
 	echo bbb >baz &&
 	git add baz &&
 	git commit -m baz_commit &&
@@ -1758,14 +1758,14 @@ test_expect_success GPGSM 'log --graph --show-signature for merged tag x509' '
 '
 
 test_expect_success GPGSM 'log --graph --show-signature for merged tag x509 missing key' '
-	test_when_finished "git reset --hard && git checkout master" &&
+	test_when_finished "git reset --hard && git checkout main" &&
 	test_config gpg.format x509 &&
 	test_config user.signingkey $GIT_COMMITTER_EMAIL &&
-	git checkout -b plain-x509-nokey master &&
+	git checkout -b plain-x509-nokey main &&
 	echo aaa >bar &&
 	git add bar &&
 	git commit -m bar_commit &&
-	git checkout -b tagged-x509-nokey master &&
+	git checkout -b tagged-x509-nokey main &&
 	echo bbb >baz &&
 	git add baz &&
 	git commit -m baz_commit &&
@@ -1778,14 +1778,14 @@ test_expect_success GPGSM 'log --graph --show-signature for merged tag x509 miss
 '
 
 test_expect_success GPGSM 'log --graph --show-signature for merged tag x509 bad signature' '
-	test_when_finished "git reset --hard && git checkout master" &&
+	test_when_finished "git reset --hard && git checkout main" &&
 	test_config gpg.format x509 &&
 	test_config user.signingkey $GIT_COMMITTER_EMAIL &&
-	git checkout -b plain-x509-bad master &&
+	git checkout -b plain-x509-bad main &&
 	echo aaa >bar &&
 	git add bar &&
 	git commit -m bar_commit &&
-	git checkout -b tagged-x509-bad master &&
+	git checkout -b tagged-x509-bad main &&
 	echo bbb >baz &&
 	git add baz &&
 	git commit -m baz_commit &&
@@ -1835,7 +1835,7 @@ test_expect_success 'log diagnoses bogus HEAD' '
 	git init empty &&
 	test_must_fail git -C empty log 2>stderr &&
 	test_i18ngrep does.not.have.any.commits stderr &&
-	echo 1234abcd >empty/.git/refs/heads/master &&
+	echo 1234abcd >empty/.git/refs/heads/main &&
 	test_must_fail git -C empty log 2>stderr &&
 	test_i18ngrep broken stderr &&
 	echo "ref: refs/heads/invalid.lock" >empty/.git/HEAD &&
diff --git a/t/t4203-mailmap.sh b/t/t4203-mailmap.sh
index 586c3a86b1..2127b1652d 100755
--- a/t/t4203-mailmap.sh
+++ b/t/t4203-mailmap.sh
@@ -194,7 +194,7 @@ test_expect_success 'No mailmap files, but configured' '
 
 test_expect_success 'setup mailmap blob tests' '
 	git checkout -b map &&
-	test_when_finished "git checkout master" &&
+	test_when_finished "git checkout main" &&
 	cat >just-bugs <<- EOF &&
 	Blob Guy <bugs@company.xx>
 	EOF
diff --git a/t/t4204-patch-id.sh b/t/t4204-patch-id.sh
index 8ff8bd84c7..3808dce5c7 100755
--- a/t/t4204-patch-id.sh
+++ b/t/t4204-patch-id.sh
@@ -13,9 +13,9 @@ test_expect_success 'setup' '
 	test_write_lines $as b >foo &&
 	test_write_lines $as b >bar &&
 	git commit -a -m first &&
-	git checkout -b same master &&
+	git checkout -b same main &&
 	git commit --amend -m same-msg &&
-	git checkout -b notsame master &&
+	git checkout -b notsame main &&
 	echo c >foo &&
 	echo c >bar &&
 	git commit --amend -a -m notsame-msg &&
@@ -46,31 +46,31 @@ get_patch_id () {
 }
 
 test_expect_success 'patch-id detects equality' '
-	get_patch_id master &&
+	get_patch_id main &&
 	get_patch_id same &&
-	test_cmp patch-id_master patch-id_same
+	test_cmp patch-id_main patch-id_same
 '
 
 test_expect_success 'patch-id detects inequality' '
-	get_patch_id master &&
+	get_patch_id main &&
 	get_patch_id notsame &&
-	! test_cmp patch-id_master patch-id_notsame
+	! test_cmp patch-id_main patch-id_notsame
 '
 
 test_expect_success 'patch-id supports git-format-patch output' '
-	get_patch_id master &&
+	get_patch_id main &&
 	git checkout same &&
 	git format-patch -1 --stdout | calc_patch_id same &&
-	test_cmp patch-id_master patch-id_same &&
+	test_cmp patch-id_main patch-id_same &&
 	set $(git format-patch -1 --stdout | git patch-id) &&
 	test "$2" = $(git rev-parse HEAD)
 '
 
 test_expect_success 'whitespace is irrelevant in footer' '
-	get_patch_id master &&
+	get_patch_id main &&
 	git checkout same &&
 	git format-patch -1 --stdout | sed "s/ \$//" | calc_patch_id same &&
-	test_cmp patch-id_master patch-id_same
+	test_cmp patch-id_main patch-id_same
 '
 
 cmp_patch_id () {
@@ -88,7 +88,7 @@ test_patch_id_file_order () {
 	shift
 	name="order-${1}-$relevant"
 	shift
-	get_top_diff "master" | calc_patch_id "$name" "$@" &&
+	get_top_diff "main" | calc_patch_id "$name" "$@" &&
 	git checkout same &&
 	git format-patch -1 --stdout -O foo-then-bar |
 		calc_patch_id "ordered-$name" "$@" &&
@@ -137,10 +137,10 @@ test_expect_success '--stable overrides patchid.stable = false' '
 '
 
 test_expect_success 'patch-id supports git-format-patch MIME output' '
-	get_patch_id master &&
+	get_patch_id main &&
 	git checkout same &&
 	git format-patch -1 --attach --stdout | calc_patch_id same &&
-	test_cmp patch-id_master patch-id_same
+	test_cmp patch-id_main patch-id_same
 '
 
 test_expect_success 'patch-id respects config from subdir' '
diff --git a/t/t4207-log-decoration-colors.sh b/t/t4207-log-decoration-colors.sh
index 60f040cab8..b6793064dc 100755
--- a/t/t4207-log-decoration-colors.sh
+++ b/t/t4207-log-decoration-colors.sh
@@ -40,13 +40,13 @@ test_expect_success setup '
 
 cat >expected <<EOF
 ${c_commit}COMMIT_ID${c_reset}${c_commit} (${c_reset}${c_HEAD}HEAD ->\
- ${c_reset}${c_branch}master${c_reset}${c_commit},\
+ ${c_reset}${c_branch}main${c_reset}${c_commit},\
  ${c_reset}${c_tag}tag: v1.0${c_reset}${c_commit},\
  ${c_reset}${c_tag}tag: B${c_reset}${c_commit})${c_reset} B
 ${c_commit}COMMIT_ID${c_reset}${c_commit} (${c_reset}${c_tag}tag: A1${c_reset}${c_commit},\
- ${c_reset}${c_remoteBranch}other/master${c_reset}${c_commit})${c_reset} A1
+ ${c_reset}${c_remoteBranch}other/main${c_reset}${c_commit})${c_reset} A1
 ${c_commit}COMMIT_ID${c_reset}${c_commit} (${c_reset}${c_stash}refs/stash${c_reset}${c_commit})${c_reset}\
- On master: Changes to A.t
+ On main: Changes to A.t
 ${c_commit}COMMIT_ID${c_reset}${c_commit} (${c_reset}${c_tag}tag: A${c_reset}${c_commit})${c_reset} A
 EOF
 
diff --git a/t/t4208-log-magic-pathspec.sh b/t/t4208-log-magic-pathspec.sh
index 6cdbe4747a..58b928dbf3 100755
--- a/t/t4208-log-magic-pathspec.sh
+++ b/t/t4208-log-magic-pathspec.sh
@@ -26,7 +26,7 @@ test_expect_success '"git log :/a -- " should not be ambiguous' '
 '
 
 test_expect_success '"git log :/detached -- " should find a commit only in HEAD' '
-	test_when_finished "git checkout master" &&
+	test_when_finished "git checkout main" &&
 	git checkout --detach &&
 	# Must manually call `test_tick` instead of using `test_commit`,
 	# because the latter additionally creates a tag, which would make
@@ -119,7 +119,7 @@ test_expect_success 'command line pathspec parsing for "git log"' '
 	git checkout HEAD^ &&
 	echo 2 >a &&
 	git commit -a -m "update a to 2" &&
-	test_must_fail git merge master &&
+	test_must_fail git merge main &&
 	git add a &&
 	git log --merge -- a
 '
diff --git a/t/t4211/history.export b/t/t4211/history.export
index f9f41e211e..006972a1f2 100644
--- a/t/t4211/history.export
+++ b/t/t4211/history.export
@@ -316,7 +316,7 @@ long f(long x)
 	return s;
 }
 
-commit refs/heads/master
+commit refs/heads/main
 mark :19
 author Thomas Rast <trast@student.ethz.ch> 1362045024 +0100
 committer Thomas Rast <trast@student.ethz.ch> 1362045024 +0100
diff --git a/t/t4214-log-graph-octopus.sh b/t/t4214-log-graph-octopus.sh
index a080325098..d4e07cb0ba 100755
--- a/t/t4214-log-graph-octopus.sh
+++ b/t/t4214-log-graph-octopus.sh
@@ -17,7 +17,7 @@ test_cmp_colored_graph () {
 test_expect_success 'set up merge history' '
 	test_commit initial &&
 	for i in 1 2 3 4 ; do
-		git checkout master -b $i || return $?
+		git checkout main -b $i || return $?
 		# Make tag name different from branch name, to avoid
 		# ambiguity error when calling checkout.
 		test_commit $i $i $i tag$i || return $?
diff --git a/t/t4216-log-bloom.sh b/t/t4216-log-bloom.sh
index d11040ce41..95a9bae4de 100755
--- a/t/t4216-log-bloom.sh
+++ b/t/t4216-log-bloom.sh
@@ -21,7 +21,7 @@ test_expect_success 'setup test - repo, commits, commit graph, log outputs' '
 	test_commit c10 file_to_be_deleted &&
 	git checkout -b side HEAD~4 &&
 	test_commit side-1 file4 &&
-	git checkout master &&
+	git checkout main &&
 	git merge side &&
 	test_commit c11 file5 &&
 	mv file5 file5_renamed &&
@@ -94,7 +94,7 @@ do
 		      "--topo-order" \
 		      "--date-order" \
 		      "--author-date-order" \
-		      "--ancestry-path side..master"
+		      "--ancestry-path side..main"
 	do
 		test_expect_success "git log option: $option for path: $path" '
 			test_bloom_filters_used "$option -- $path" &&
diff --git a/t/t4253-am-keep-cr-dos.sh b/t/t4253-am-keep-cr-dos.sh
index 6e1b73ec3a..cf51efa2ee 100755
--- a/t/t4253-am-keep-cr-dos.sh
+++ b/t/t4253-am-keep-cr-dos.sh
@@ -43,7 +43,7 @@ test_expect_success 'setup repository with dos files' '
 
 test_expect_success 'am with dos files without --keep-cr' '
 	git checkout -b dosfiles initial &&
-	git format-patch -k initial..master &&
+	git format-patch -k initial..main &&
 	test_must_fail git am -k -3 000*.patch &&
 	git am --abort &&
 	rm -rf .git/rebase-apply 000*.patch
@@ -51,23 +51,23 @@ test_expect_success 'am with dos files without --keep-cr' '
 
 test_expect_success 'am with dos files with --keep-cr' '
 	git checkout -b dosfiles-keep-cr initial &&
-	git format-patch -k --stdout initial..master >output &&
+	git format-patch -k --stdout initial..main >output &&
 	git am --keep-cr -k -3 output &&
-	git diff --exit-code master
+	git diff --exit-code main
 '
 
 test_expect_success 'am with dos files config am.keepcr' '
 	git config am.keepcr 1 &&
 	git checkout -b dosfiles-conf-keepcr initial &&
-	git format-patch -k --stdout initial..master >output &&
+	git format-patch -k --stdout initial..main >output &&
 	git am -k -3 output &&
-	git diff --exit-code master
+	git diff --exit-code main
 '
 
 test_expect_success 'am with dos files config am.keepcr overridden by --no-keep-cr' '
 	git config am.keepcr 1 &&
 	git checkout -b dosfiles-conf-keepcr-override initial &&
-	git format-patch -k initial..master &&
+	git format-patch -k initial..main &&
 	test_must_fail git am -k -3 --no-keep-cr 000*.patch &&
 	git am --abort &&
 	rm -rf .git/rebase-apply 000*.patch
@@ -75,14 +75,14 @@ test_expect_success 'am with dos files config am.keepcr overridden by --no-keep-
 
 test_expect_success 'am with dos files with --keep-cr continue' '
 	git checkout -b dosfiles-keep-cr-continue initial &&
-	git format-patch -k initial..master &&
+	git format-patch -k initial..main &&
 	append_cr <file1a >file &&
 	git commit -m "different patch" file &&
 	test_must_fail git am --keep-cr -k -3 000*.patch &&
 	append_cr <file2 >file &&
 	git add file &&
 	git am -3 --resolved &&
-	git diff --exit-code master
+	git diff --exit-code main
 '
 
 test_expect_success 'am with unix files config am.keepcr overridden by --no-keep-cr' '
@@ -90,9 +90,9 @@ test_expect_success 'am with unix files config am.keepcr overridden by --no-keep
 	git checkout -b unixfiles-conf-keepcr-override initial &&
 	cp -f file1 file &&
 	git commit -m "line ending to unix" file &&
-	git format-patch -k initial..master &&
+	git format-patch -k initial..main &&
 	git am -k -3 --no-keep-cr 000*.patch &&
-	git diff --exit-code -w master
+	git diff --exit-code -w main
 '
 
 test_done
diff --git a/t/t4257-am-interactive.sh b/t/t4257-am-interactive.sh
index 5344bd248a..aed8f4de3d 100755
--- a/t/t4257-am-interactive.sh
+++ b/t/t4257-am-interactive.sh
@@ -10,7 +10,7 @@ test_expect_success 'set up patches to apply' '
 	git format-patch --stdout -2 >mbox &&
 
 	git reset --hard unrelated &&
-	test_commit conflict-master file master base
+	test_commit conflict-main file main base
 '
 
 # Sanity check our setup.
diff --git a/t/test-lib.sh b/t/test-lib.sh
index 76ab747b53..b783629348 100644
--- a/t/test-lib.sh
+++ b/t/test-lib.sh
@@ -257,13 +257,13 @@ case "$TRASH_DIRECTORY" in
 esac
 
 case "$TEST_NUMBER" in
-3404)
+3404|4013)
 	# Avoid conflicts with patch series that are cooking at the same time
 	# as the patch series changing the default of `init.defaultBranch`.
 	GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
 	export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 	;;
-[0-3]*)
+[0-4]*)
 	GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 	export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 	;;
-- 
gitgitgadget


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH v2 09/27] t5323: prepare centered comment for `master` -> `main`
  2020-11-17 16:12 ` [PATCH v2 00/27] tests: use " Johannes Schindelin via GitGitGadget
                     ` (7 preceding siblings ...)
  2020-11-17 16:12   ` [PATCH v2 08/27] t4*: " Johannes Schindelin via GitGitGadget
@ 2020-11-17 16:12   ` Johannes Schindelin via GitGitGadget
  2020-11-17 16:12   ` [PATCH v2 10/27] t5[0-4]*: adjust the references to the default branch name "main" Johannes Schindelin via GitGitGadget
                     ` (19 subsequent siblings)
  28 siblings, 0 replies; 163+ messages in thread
From: Johannes Schindelin via GitGitGadget @ 2020-11-17 16:12 UTC (permalink / raw)
  To: git
  Cc: Felipe Contreras, Ævar Arnfjörð Bjarmason,
	Johannes Schindelin, Jeff King, Johannes Schindelin,
	Johannes Schindelin

From: Johannes Schindelin <johannes.schindelin@gmx.de>

We are about to search-and-replace all mentions of `master` in t5323 by
`main`, which is two characters shorter. To prepare for that, let's add
padding to centered lines that will make them briefly uncentered, but
will be re-centered in the commit that performs that rename.

Doing it this way (instead of padding after replacing) makes it easier
to verify the validity of the patch that replaces `master` by `main`.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
---
 t/t5323-pack-redundant.sh | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/t/t5323-pack-redundant.sh b/t/t5323-pack-redundant.sh
index 6b4d1ca353..3903148926 100755
--- a/t/t5323-pack-redundant.sh
+++ b/t/t5323-pack-redundant.sh
@@ -312,7 +312,7 @@ test_expect_success 'shared: all packs are redundant, but no output without --al
 #############################################################################
 # Chart of packs and objects for this test case
 #
-#     ================ master.git ===============
+#     ================= master.git ================
 #         | T A B C D E F G H I J K L M N O P Q R  <----------+
 #     ----+--------------------------------------             |
 #     P1  | x x x x x x x                       x             |
@@ -394,7 +394,7 @@ test_expect_success 'shared: no redundant without --alt-odb' '
 #############################################################################
 # Chart of packs and objects for this test case
 #
-#     ================ master.git ===============
+#     ================= master.git ================
 #         | T A B C D E F G H I J K L M N O P Q R  <----------------+
 #     ----+--------------------------------------                   |
 #     P1  | x x x x x x x                       x                   |
@@ -426,7 +426,7 @@ test_expect_success 'shared: one pack is redundant with --alt-odb' '
 #############################################################################
 # Chart of packs and objects for this test case
 #
-#     ================ master.git ===============
+#     ================= master.git ================
 #         | T A B C D E F G H I J K L M N O P Q R  <----------------+
 #     ----+--------------------------------------                   |
 #     P1  | x x x x x x x                       x                   |
-- 
gitgitgadget


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH v2 10/27] t5[0-4]*: adjust the references to the default branch name "main"
  2020-11-17 16:12 ` [PATCH v2 00/27] tests: use " Johannes Schindelin via GitGitGadget
                     ` (8 preceding siblings ...)
  2020-11-17 16:12   ` [PATCH v2 09/27] t5323: prepare centered comment for `master` -> `main` Johannes Schindelin via GitGitGadget
@ 2020-11-17 16:12   ` Johannes Schindelin via GitGitGadget
  2020-11-17 16:12   ` [PATCH v2 11/27] t5503: prepare aligned comment for replacing `master` with `main` Johannes Schindelin via GitGitGadget
                     ` (18 subsequent siblings)
  28 siblings, 0 replies; 163+ messages in thread
From: Johannes Schindelin via GitGitGadget @ 2020-11-17 16:12 UTC (permalink / raw)
  To: git
  Cc: Felipe Contreras, Ævar Arnfjörð Bjarmason,
	Johannes Schindelin, Jeff King, Johannes Schindelin,
	Johannes Schindelin

From: Johannes Schindelin <johannes.schindelin@gmx.de>

Carefully excluding t5310, which is developed independently of the
current patch series at the time of writing, we now use `main` as
default branch in t5[0-4]*. 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[0-4]*.sh &&
	   git checkout HEAD -- t5310\*)

This allows us to define `GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main`
for those tests.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
---
 t/t5150-request-pull.sh                | 34 ++++++-------
 t/t5304-prune.sh                       |  2 +-
 t/t5305-include-tag.sh                 |  2 +-
 t/t5312-prune-corruption.sh            | 16 +++----
 t/t5317-pack-objects-filter-objects.sh |  2 +-
 t/t5322-pack-objects-sparse.sh         |  2 +-
 t/t5323-pack-redundant.sh              | 66 +++++++++++++-------------
 t/t5400-send-pack.sh                   | 60 +++++++++++------------
 t/t5401-update-hooks.sh                | 24 +++++-----
 t/t5402-post-merge-hook.sh             |  2 +-
 t/t5403-post-checkout-hook.sh          |  6 +--
 t/t5404-tracking-branches.sh           |  8 ++--
 t/t5405-send-pack-rewind.sh            |  6 +--
 t/t5407-post-rewrite-hook.sh           |  2 +-
 t/t5410-receive-pack-alternates.sh     |  4 +-
 t/test-lib.sh                          |  4 +-
 16 files changed, 120 insertions(+), 120 deletions(-)

diff --git a/t/t5150-request-pull.sh b/t/t5150-request-pull.sh
index c1811ea0f4..4fa71961a6 100755
--- a/t/t5150-request-pull.sh
+++ b/t/t5150-request-pull.sh
@@ -31,13 +31,13 @@ test_expect_success 'setup' '
 		test_tick &&
 		git commit -m "\"Thirty days\", a reminder of month lengths" &&
 		git tag -m "version 1" -a initial &&
-		git push --tags origin master
+		git push --tags origin main
 	) &&
 	(
 		cd local &&
 		git remote add upstream "$trash_url/upstream.git" &&
 		git fetch upstream &&
-		git pull upstream master &&
+		git pull upstream main &&
 		cat <<-\EOT >>mnemonic.txt &&
 		Of twyecescore-eightt is but eine,
 		And all the remnante be thrycescore-eine.
@@ -59,7 +59,7 @@ test_expect_success 'setup' '
 		git commit -a -m "Adapt to use modern, simpler English
 
 But keep the old version, too, in case some people prefer it." &&
-		git checkout master
+		git checkout main
 	)
 
 '
@@ -129,7 +129,7 @@ test_expect_success 'pull request when forgot to push' '
 	(
 		cd local &&
 		git checkout initial &&
-		git merge --ff-only master &&
+		git merge --ff-only main &&
 		test_must_fail git request-pull initial "$downstream_url" \
 			2>../err
 	) &&
@@ -145,9 +145,9 @@ test_expect_success 'pull request after push' '
 	(
 		cd local &&
 		git checkout initial &&
-		git merge --ff-only master &&
-		git push origin master:for-upstream &&
-		git request-pull initial origin master:for-upstream >../request
+		git merge --ff-only main &&
+		git push origin main:for-upstream &&
+		git request-pull initial origin main:for-upstream >../request
 	) &&
 	sed -nf read-request.sed <request >digest &&
 	{
@@ -172,9 +172,9 @@ test_expect_success 'request asks HEAD to be pulled' '
 	(
 		cd local &&
 		git checkout initial &&
-		git merge --ff-only master &&
-		git push --tags origin master simplify &&
-		git push origin master:for-upstream &&
+		git merge --ff-only main &&
+		git push --tags origin main simplify &&
+		git push origin main:for-upstream &&
 		git request-pull initial "$downstream_url" >../request
 	) &&
 	sed -nf read-request.sed <request >digest &&
@@ -215,7 +215,7 @@ test_expect_success 'pull request format' '
 	(
 		cd local &&
 		git checkout initial &&
-		git merge --ff-only master &&
+		git merge --ff-only main &&
 		git push origin tags/full &&
 		git request-pull initial "$downstream_url" tags/full >../request
 	) &&
@@ -243,9 +243,9 @@ test_expect_success 'request-pull ignores OPTIONS_KEEPDASHDASH poison' '
 		OPTIONS_KEEPDASHDASH=Yes &&
 		export OPTIONS_KEEPDASHDASH &&
 		git checkout initial &&
-		git merge --ff-only master &&
-		git push origin master:for-upstream &&
-		git request-pull -- initial "$downstream_url" master:for-upstream >../request
+		git merge --ff-only main &&
+		git push origin main:for-upstream &&
+		git request-pull -- initial "$downstream_url" main:for-upstream >../request
 	)
 
 '
@@ -257,7 +257,7 @@ test_expect_success 'request-pull quotes regex metacharacters properly' '
 	(
 		cd local &&
 		git checkout initial &&
-		git merge --ff-only master &&
+		git merge --ff-only main &&
 		git tag -mrelease v2.0 &&
 		git push origin refs/tags/v2.0:refs/tags/v2-0 &&
 		test_must_fail git request-pull initial "$downstream_url" tags/v2.0 \
@@ -275,7 +275,7 @@ test_expect_success 'pull request with mismatched object' '
 	(
 		cd local &&
 		git checkout initial &&
-		git merge --ff-only master &&
+		git merge --ff-only main &&
 		git push origin HEAD:refs/tags/full &&
 		test_must_fail git request-pull initial "$downstream_url" tags/full \
 			2>../err
@@ -292,7 +292,7 @@ test_expect_success 'pull request with stale object' '
 	(
 		cd local &&
 		git checkout initial &&
-		git merge --ff-only master &&
+		git merge --ff-only main &&
 		git push origin refs/tags/full &&
 		git tag -f -m"Thirty-one days" full &&
 		test_must_fail git request-pull initial "$downstream_url" tags/full \
diff --git a/t/t5304-prune.sh b/t/t5304-prune.sh
index df60f18fb8..7391f95c7e 100755
--- a/t/t5304-prune.sh
+++ b/t/t5304-prune.sh
@@ -119,7 +119,7 @@ test_expect_success 'prune: do not prune detached HEAD with no reflog' '
 test_expect_success 'prune: prune former HEAD after checking out branch' '
 
 	head_oid=$(git rev-parse HEAD) &&
-	git checkout --quiet master &&
+	git checkout --quiet main &&
 	git prune -v >prune_actual &&
 	grep "$head_oid" prune_actual
 
diff --git a/t/t5305-include-tag.sh b/t/t5305-include-tag.sh
index a5eca210b8..69233574b8 100755
--- a/t/t5305-include-tag.sh
+++ b/t/t5305-include-tag.sh
@@ -111,7 +111,7 @@ test_expect_success 'check unpacked result (have all objects)' '
 
 test_expect_success 'single-branch clone can transfer tag' '
 	rm -rf clone.git &&
-	git clone --no-local --single-branch -b master . clone.git &&
+	git clone --no-local --single-branch -b main . clone.git &&
 	git -C clone.git fsck
 '
 
diff --git a/t/t5312-prune-corruption.sh b/t/t5312-prune-corruption.sh
index da9d59940d..8ca3823f23 100755
--- a/t/t5312-prune-corruption.sh
+++ b/t/t5312-prune-corruption.sh
@@ -16,7 +16,7 @@ test_expect_success 'disable reflogs' '
 '
 
 test_expect_success 'create history reachable only from a bogus-named ref' '
-	test_tick && git commit --allow-empty -m master &&
+	test_tick && git commit --allow-empty -m main &&
 	base=$(git rev-parse HEAD) &&
 	test_tick && git commit --allow-empty -m bogus &&
 	bogus=$(git rev-parse HEAD) &&
@@ -51,7 +51,7 @@ test_expect_success 'clean up bogus ref' '
 '
 
 # We create two new objects here, "one" and "two". Our
-# master branch points to "two", which is deleted,
+# main branch points to "two", which is deleted,
 # corrupting the repository. But we'd like to make sure
 # that the otherwise unreachable "one" is not pruned
 # (since it is the user's best bet for recovering
@@ -81,7 +81,7 @@ test_expect_success 'pruning with a corrupted tip does not drop history' '
 test_expect_success 'pack-refs does not silently delete broken loose ref' '
 	git pack-refs --all --prune &&
 	echo $missing >expect &&
-	git rev-parse refs/heads/master >actual &&
+	git rev-parse refs/heads/main >actual &&
 	test_cmp expect actual
 '
 
@@ -89,25 +89,25 @@ test_expect_success 'pack-refs does not silently delete broken loose ref' '
 # actually pack it, as it is perfectly reasonable to
 # skip processing a broken ref
 test_expect_success 'create packed-refs file with broken ref' '
-	rm -f .git/refs/heads/master &&
+	rm -f .git/refs/heads/main &&
 	cat >.git/packed-refs <<-EOF &&
-	$missing refs/heads/master
+	$missing refs/heads/main
 	$recoverable refs/heads/other
 	EOF
 	echo $missing >expect &&
-	git rev-parse refs/heads/master >actual &&
+	git rev-parse refs/heads/main >actual &&
 	test_cmp expect actual
 '
 
 test_expect_success 'pack-refs does not silently delete broken packed ref' '
 	git pack-refs --all --prune &&
-	git rev-parse refs/heads/master >actual &&
+	git rev-parse refs/heads/main >actual &&
 	test_cmp expect actual
 '
 
 test_expect_success 'pack-refs does not drop broken refs during deletion' '
 	git update-ref -d refs/heads/other &&
-	git rev-parse refs/heads/master >actual &&
+	git rev-parse refs/heads/main >actual &&
 	test_cmp expect actual
 '
 
diff --git a/t/t5317-pack-objects-filter-objects.sh b/t/t5317-pack-objects-filter-objects.sh
index dc0446574b..6ee66d58ce 100755
--- a/t/t5317-pack-objects-filter-objects.sh
+++ b/t/t5317-pack-objects-filter-objects.sh
@@ -382,7 +382,7 @@ test_expect_success 'verify sparse:oid=oid-ish' '
 	awk -f print_2.awk ls_files_result |
 	sort >expected &&
 
-	git -C r4 pack-objects --revs --stdout --filter=sparse:oid=master:pattern >filter.pack <<-EOF &&
+	git -C r4 pack-objects --revs --stdout --filter=sparse:oid=main:pattern >filter.pack <<-EOF &&
 	HEAD
 	EOF
 	git -C r4 index-pack ../filter.pack &&
diff --git a/t/t5322-pack-objects-sparse.sh b/t/t5322-pack-objects-sparse.sh
index a581eaf529..99bdab0610 100755
--- a/t/t5322-pack-objects-sparse.sh
+++ b/t/t5322-pack-objects-sparse.sh
@@ -18,7 +18,7 @@ test_expect_success 'setup repo' '
 	git commit -m "Initialized trees" &&
 	for i in $(test_seq 1 3)
 	do
-		git checkout -b topic$i master &&
+		git checkout -b topic$i main &&
 		echo change-$i >f$i/f$i/data.txt &&
 		git commit -a -m "Changed f$i/f$i/data.txt"
 	done &&
diff --git a/t/t5323-pack-redundant.sh b/t/t5323-pack-redundant.sh
index 3903148926..89c8688647 100755
--- a/t/t5323-pack-redundant.sh
+++ b/t/t5323-pack-redundant.sh
@@ -6,7 +6,7 @@
 test_description='Test git pack-redundant
 
 In order to test git-pack-redundant, we will create a number of objects and
-packs in the repository `master.git`. The relationship between packs (P1-P8)
+packs in the repository `main.git`. The relationship between packs (P1-P8)
 and objects (T, A-R) is showed in the following chart. Objects of a pack will
 be marked with letter x, while objects of redundant packs will be marked with
 exclamation point, and redundant pack itself will be marked with asterisk.
@@ -25,7 +25,7 @@ exclamation point, and redundant pack itself will be marked with asterisk.
     ALL | x x x x x x x x x x x x x x x x x x x
 
 Another repository `shared.git` has unique objects (X-Z), while other objects
-(marked with letter s) are shared through alt-odb (of `master.git`). The
+(marked with letter s) are shared through alt-odb (of `main.git`). The
 relationship between packs and objects is as follows:
 
 	| T A B C D E F G H I J K L M N O P Q R   X Y Z
@@ -36,7 +36,7 @@ relationship between packs and objects is as follows:
 
 . ./test-lib.sh
 
-master_repo=master.git
+main_repo=main.git
 shared_repo=shared.git
 
 # Create commits in <repo> and assign each commit's oid to shell variables
@@ -69,7 +69,7 @@ create_commits_in () {
 		shift ||
 		return 1
 	done &&
-	git -C "$repo" update-ref refs/heads/master $oid
+	git -C "$repo" update-ref refs/heads/main $oid
 }
 
 # Create pack in <repo> and assign pack id to variable given in the 2nd argument
@@ -107,9 +107,9 @@ format_packfiles () {
 	sort
 }
 
-test_expect_success 'setup master repo' '
-	git init --bare "$master_repo" &&
-	create_commits_in "$master_repo" A B C D E F G H I J K L M N O P Q R
+test_expect_success 'setup main repo' '
+	git init --bare "$main_repo" &&
+	create_commits_in "$main_repo" A B C D E F G H I J K L M N O P Q R
 '
 
 #############################################################################
@@ -124,8 +124,8 @@ test_expect_success 'setup master repo' '
 #     ALL | x x x x x x x x x x x x x x         x
 #
 #############################################################################
-test_expect_success 'master: no redundant for pack 1, 2, 3' '
-	create_pack_in "$master_repo" P1 <<-EOF &&
+test_expect_success 'main: no redundant for pack 1, 2, 3' '
+	create_pack_in "$main_repo" P1 <<-EOF &&
 		$T
 		$A
 		$B
@@ -135,7 +135,7 @@ test_expect_success 'master: no redundant for pack 1, 2, 3' '
 		$F
 		$R
 		EOF
-	create_pack_in "$master_repo" P2 <<-EOF &&
+	create_pack_in "$main_repo" P2 <<-EOF &&
 		$B
 		$C
 		$D
@@ -144,7 +144,7 @@ test_expect_success 'master: no redundant for pack 1, 2, 3' '
 		$H
 		$I
 		EOF
-	create_pack_in "$master_repo" P3 <<-EOF &&
+	create_pack_in "$main_repo" P3 <<-EOF &&
 		$F
 		$I
 		$J
@@ -153,7 +153,7 @@ test_expect_success 'master: no redundant for pack 1, 2, 3' '
 		$M
 		EOF
 	(
-		cd "$master_repo" &&
+		cd "$main_repo" &&
 		git pack-redundant --all >out &&
 		test_must_be_empty out
 	)
@@ -173,22 +173,22 @@ test_expect_success 'master: no redundant for pack 1, 2, 3' '
 #     ALL | x x x x x x x x x x x x x x x x x   x
 #
 #############################################################################
-test_expect_success 'master: one of pack-2/pack-3 is redundant' '
-	create_pack_in "$master_repo" P4 <<-EOF &&
+test_expect_success 'main: one of pack-2/pack-3 is redundant' '
+	create_pack_in "$main_repo" P4 <<-EOF &&
 		$J
 		$K
 		$L
 		$M
 		$P
 		EOF
-	create_pack_in "$master_repo" P5 <<-EOF &&
+	create_pack_in "$main_repo" P5 <<-EOF &&
 		$G
 		$H
 		$N
 		$O
 		EOF
 	(
-		cd "$master_repo" &&
+		cd "$main_repo" &&
 		cat >expect <<-EOF &&
 			P3:$P3
 			EOF
@@ -214,18 +214,18 @@ test_expect_success 'master: one of pack-2/pack-3 is redundant' '
 #     ALL | x x x x x x x x x x x x x x x x x x x
 #
 #############################################################################
-test_expect_success 'master: pack 2, 4, and 6 are redundant' '
-	create_pack_in "$master_repo" P6 <<-EOF &&
+test_expect_success 'main: pack 2, 4, and 6 are redundant' '
+	create_pack_in "$main_repo" P6 <<-EOF &&
 		$N
 		$O
 		$Q
 		EOF
-	create_pack_in "$master_repo" P7 <<-EOF &&
+	create_pack_in "$main_repo" P7 <<-EOF &&
 		$P
 		$Q
 		EOF
 	(
-		cd "$master_repo" &&
+		cd "$main_repo" &&
 		cat >expect <<-EOF &&
 			P2:$P2
 			P4:$P4
@@ -254,12 +254,12 @@ test_expect_success 'master: pack 2, 4, and 6 are redundant' '
 #     ALL | x x x x x x x x x x x x x x x x x x x
 #
 #############################################################################
-test_expect_success 'master: pack-8 (subset of pack-1) is also redundant' '
-	create_pack_in "$master_repo" P8 <<-EOF &&
+test_expect_success 'main: pack-8 (subset of pack-1) is also redundant' '
+	create_pack_in "$main_repo" P8 <<-EOF &&
 		$A
 		EOF
 	(
-		cd "$master_repo" &&
+		cd "$main_repo" &&
 		cat >expect <<-EOF &&
 			P2:$P2
 			P4:$P4
@@ -272,18 +272,18 @@ test_expect_success 'master: pack-8 (subset of pack-1) is also redundant' '
 	)
 '
 
-test_expect_success 'master: clean loose objects' '
+test_expect_success 'main: clean loose objects' '
 	(
-		cd "$master_repo" &&
+		cd "$main_repo" &&
 		git prune-packed &&
 		find objects -type f | sed -e "/objects\/pack\//d" >out &&
 		test_must_be_empty out
 	)
 '
 
-test_expect_success 'master: remove redundant packs and pass fsck' '
+test_expect_success 'main: remove redundant packs and pass fsck' '
 	(
-		cd "$master_repo" &&
+		cd "$main_repo" &&
 		git pack-redundant --all | xargs rm &&
 		git fsck &&
 		git pack-redundant --all >out &&
@@ -292,12 +292,12 @@ test_expect_success 'master: remove redundant packs and pass fsck' '
 '
 
 # The following test cases will execute inside `shared.git`, instead of
-# inside `master.git`.
+# inside `main.git`.
 test_expect_success 'setup shared.git' '
-	git clone --mirror "$master_repo" "$shared_repo" &&
+	git clone --mirror "$main_repo" "$shared_repo" &&
 	(
 		cd "$shared_repo" &&
-		printf "../../$master_repo/objects\n" >objects/info/alternates
+		printf "../../$main_repo/objects\n" >objects/info/alternates
 	)
 '
 
@@ -312,7 +312,7 @@ test_expect_success 'shared: all packs are redundant, but no output without --al
 #############################################################################
 # Chart of packs and objects for this test case
 #
-#     ================= master.git ================
+#     ================= main.git ================
 #         | T A B C D E F G H I J K L M N O P Q R  <----------+
 #     ----+--------------------------------------             |
 #     P1  | x x x x x x x                       x             |
@@ -394,7 +394,7 @@ test_expect_success 'shared: no redundant without --alt-odb' '
 #############################################################################
 # Chart of packs and objects for this test case
 #
-#     ================= master.git ================
+#     ================= main.git ================
 #         | T A B C D E F G H I J K L M N O P Q R  <----------------+
 #     ----+--------------------------------------                   |
 #     P1  | x x x x x x x                       x                   |
@@ -426,7 +426,7 @@ test_expect_success 'shared: one pack is redundant with --alt-odb' '
 #############################################################################
 # Chart of packs and objects for this test case
 #
-#     ================= master.git ================
+#     ================= main.git ================
 #         | T A B C D E F G H I J K L M N O P Q R  <----------------+
 #     ----+--------------------------------------                   |
 #     P1  | x x x x x x x                       x                   |
diff --git a/t/t5400-send-pack.sh b/t/t5400-send-pack.sh
index cc86ef213e..e50ca0d8c6 100755
--- a/t/t5400-send-pack.sh
+++ b/t/t5400-send-pack.sh
@@ -66,20 +66,20 @@ test_expect_success 'pack the destination repository' '
 '
 
 test_expect_success 'refuse pushing rewound head without --force' '
-	pushed_head=$(git rev-parse --verify master) &&
-	victim_orig=$(cd victim && git rev-parse --verify master) &&
-	test_must_fail git send-pack ./victim master &&
-	victim_head=$(cd victim && git rev-parse --verify master) &&
+	pushed_head=$(git rev-parse --verify main) &&
+	victim_orig=$(cd victim && git rev-parse --verify main) &&
+	test_must_fail git send-pack ./victim main &&
+	victim_head=$(cd victim && git rev-parse --verify main) &&
 	test "$victim_head" = "$victim_orig" &&
 	# this should update
-	git send-pack --force ./victim master &&
-	victim_head=$(cd victim && git rev-parse --verify master) &&
+	git send-pack --force ./victim main &&
+	victim_head=$(cd victim && git rev-parse --verify main) &&
 	test "$victim_head" = "$pushed_head"
 '
 
 test_expect_success 'push can be used to delete a ref' '
-	( cd victim && git branch extra master ) &&
-	git send-pack ./victim :extra master &&
+	( cd victim && git branch extra main ) &&
+	git send-pack ./victim :extra main &&
 	( cd victim &&
 	  test_must_fail git rev-parse --verify extra )
 '
@@ -89,9 +89,9 @@ test_expect_success 'refuse deleting push with denyDeletes' '
 		cd victim &&
 		test_might_fail git branch -D extra &&
 		git config receive.denyDeletes true &&
-		git branch extra master
+		git branch extra main
 	) &&
-	test_must_fail git send-pack ./victim :extra master
+	test_must_fail git send-pack ./victim :extra main
 '
 
 test_expect_success 'cannot override denyDeletes with git -c send-pack' '
@@ -99,10 +99,10 @@ test_expect_success 'cannot override denyDeletes with git -c send-pack' '
 		cd victim &&
 		test_might_fail git branch -D extra &&
 		git config receive.denyDeletes true &&
-		git branch extra master
+		git branch extra main
 	) &&
 	test_must_fail git -c receive.denyDeletes=false \
-					send-pack ./victim :extra master
+					send-pack ./victim :extra main
 '
 
 test_expect_success 'override denyDeletes with git -c receive-pack' '
@@ -110,11 +110,11 @@ test_expect_success 'override denyDeletes with git -c receive-pack' '
 		cd victim &&
 		test_might_fail git branch -D extra &&
 		git config receive.denyDeletes true &&
-		git branch extra master
+		git branch extra main
 	) &&
 	git send-pack \
 		--receive-pack="git -c receive.denyDeletes=false receive-pack" \
-		./victim :extra master
+		./victim :extra main
 '
 
 test_expect_success 'denyNonFastforwards trumps --force' '
@@ -123,9 +123,9 @@ test_expect_success 'denyNonFastforwards trumps --force' '
 		test_might_fail git branch -D extra &&
 		git config receive.denyNonFastforwards true
 	) &&
-	victim_orig=$(cd victim && git rev-parse --verify master) &&
-	test_must_fail git send-pack --force ./victim master^:master &&
-	victim_head=$(cd victim && git rev-parse --verify master) &&
+	victim_orig=$(cd victim && git rev-parse --verify main) &&
+	test_must_fail git send-pack --force ./victim main^:main &&
+	victim_head=$(cd victim && git rev-parse --verify main) &&
 	test "$victim_orig" = "$victim_head"
 '
 
@@ -210,41 +210,41 @@ rewound_push_setup() {
 
 test_expect_success 'pushing explicit refspecs respects forcing' '
 	rewound_push_setup &&
-	parent_orig=$(cd parent && git rev-parse --verify master) &&
+	parent_orig=$(cd parent && git rev-parse --verify main) &&
 	(
 		cd child &&
 		test_must_fail git send-pack ../parent \
-			refs/heads/master:refs/heads/master
+			refs/heads/main:refs/heads/main
 	) &&
-	parent_head=$(cd parent && git rev-parse --verify master) &&
+	parent_head=$(cd parent && git rev-parse --verify main) &&
 	test "$parent_orig" = "$parent_head" &&
 	(
 		cd child &&
 		git send-pack ../parent \
-			+refs/heads/master:refs/heads/master
+			+refs/heads/main:refs/heads/main
 	) &&
-	parent_head=$(cd parent && git rev-parse --verify master) &&
-	child_head=$(cd child && git rev-parse --verify master) &&
+	parent_head=$(cd parent && git rev-parse --verify main) &&
+	child_head=$(cd child && git rev-parse --verify main) &&
 	test "$parent_head" = "$child_head"
 '
 
 test_expect_success 'pushing wildcard refspecs respects forcing' '
 	rewound_push_setup &&
-	parent_orig=$(cd parent && git rev-parse --verify master) &&
+	parent_orig=$(cd parent && git rev-parse --verify main) &&
 	(
 		cd child &&
 		test_must_fail git send-pack ../parent \
 			"refs/heads/*:refs/heads/*"
 	) &&
-	parent_head=$(cd parent && git rev-parse --verify master) &&
+	parent_head=$(cd parent && git rev-parse --verify main) &&
 	test "$parent_orig" = "$parent_head" &&
 	(
 		cd child &&
 		git send-pack ../parent \
 			"+refs/heads/*:refs/heads/*"
 	) &&
-	parent_head=$(cd parent && git rev-parse --verify master) &&
-	child_head=$(cd child && git rev-parse --verify master) &&
+	parent_head=$(cd parent && git rev-parse --verify main) &&
+	child_head=$(cd child && git rev-parse --verify main) &&
 	test "$parent_head" = "$child_head"
 '
 
@@ -252,7 +252,7 @@ test_expect_success 'deny pushing to delete current branch' '
 	rewound_push_setup &&
 	(
 		cd child &&
-		test_must_fail git send-pack ../parent :refs/heads/master 2>errs
+		test_must_fail git send-pack ../parent :refs/heads/main 2>errs
 	)
 '
 
@@ -283,9 +283,9 @@ test_expect_success 'receive-pack de-dupes .have lines' '
 	local=$(git -C fork rev-parse HEAD) &&
 	shared=$(git -C shared rev-parse only-shared) &&
 	cat >expect <<-EOF &&
-	$local refs/heads/master
+	$local refs/heads/main
 	$local refs/remotes/origin/HEAD
-	$local refs/remotes/origin/master
+	$local refs/remotes/origin/main
 	$shared .have
 	EOF
 
diff --git a/t/t5401-update-hooks.sh b/t/t5401-update-hooks.sh
index 956d69f5b1..6012cc8172 100755
--- a/t/t5401-update-hooks.sh
+++ b/t/t5401-update-hooks.sh
@@ -15,11 +15,11 @@ test_expect_success setup '
 	git update-index a &&
 	tree1=$(git write-tree) &&
 	commit1=$(echo modify | git commit-tree $tree1 -p $commit0) &&
-	git update-ref refs/heads/master $commit0 &&
+	git update-ref refs/heads/main $commit0 &&
 	git update-ref refs/heads/tofail $commit1 &&
 	git clone --bare ./. victim.git &&
 	GIT_DIR=victim.git git update-ref refs/heads/tofail $commit1 &&
-	git update-ref refs/heads/master $commit1 &&
+	git update-ref refs/heads/main $commit1 &&
 	git update-ref refs/heads/tofail $commit0
 '
 
@@ -38,7 +38,7 @@ echo "$@" >>$GIT_DIR/update.args
 read x; printf %s "$x" >$GIT_DIR/update.stdin
 echo STDOUT update $1
 echo STDERR update $1 >&2
-test "$1" = refs/heads/master || exit
+test "$1" = refs/heads/main || exit
 EOF
 chmod u+x victim.git/hooks/update
 
@@ -62,11 +62,11 @@ chmod u+x victim.git/hooks/post-update
 
 test_expect_success push '
 	test_must_fail git send-pack --force ./victim.git \
-		master tofail >send.out 2>send.err
+		main tofail >send.out 2>send.err
 '
 
 test_expect_success 'updated as expected' '
-	test $(GIT_DIR=victim.git git rev-parse master) = $commit1 &&
+	test $(GIT_DIR=victim.git git rev-parse main) = $commit1 &&
 	test $(GIT_DIR=victim.git git rev-parse tofail) = $commit1
 '
 
@@ -82,24 +82,24 @@ test_expect_success 'hooks ran' '
 '
 
 test_expect_success 'pre-receive hook input' '
-	(echo $commit0 $commit1 refs/heads/master &&
+	(echo $commit0 $commit1 refs/heads/main &&
 	 echo $commit1 $commit0 refs/heads/tofail
 	) | test_cmp - victim.git/pre-receive.stdin
 '
 
 test_expect_success 'update hook arguments' '
-	(echo refs/heads/master $commit0 $commit1 &&
+	(echo refs/heads/main $commit0 $commit1 &&
 	 echo refs/heads/tofail $commit1 $commit0
 	) | test_cmp - victim.git/update.args
 '
 
 test_expect_success 'post-receive hook input' '
-	echo $commit0 $commit1 refs/heads/master |
+	echo $commit0 $commit1 refs/heads/main |
 	test_cmp - victim.git/post-receive.stdin
 '
 
 test_expect_success 'post-update hook arguments' '
-	echo refs/heads/master |
+	echo refs/heads/main |
 	test_cmp - victim.git/post-update.args
 '
 
@@ -120,8 +120,8 @@ test_expect_success 'send-pack produced no output' '
 cat <<EOF >expect
 remote: STDOUT pre-receive
 remote: STDERR pre-receive
-remote: STDOUT update refs/heads/master
-remote: STDERR update refs/heads/master
+remote: STDOUT update refs/heads/main
+remote: STDERR update refs/heads/main
 remote: STDOUT update refs/heads/tofail
 remote: STDERR update refs/heads/tofail
 remote: error: hook declined to update refs/heads/tofail
@@ -143,7 +143,7 @@ test_expect_success 'pre-receive hook that forgets to read its input' '
 
 	for v in $(test_seq 100 999)
 	do
-		git branch branch_$v master || return
+		git branch branch_$v main || return
 	done &&
 	git push ./victim.git "+refs/heads/*:refs/heads/*"
 '
diff --git a/t/t5402-post-merge-hook.sh b/t/t5402-post-merge-hook.sh
index 4aeea8f5b7..26c800e60b 100755
--- a/t/t5402-post-merge-hook.sh
+++ b/t/t5402-post-merge-hook.sh
@@ -15,7 +15,7 @@ test_expect_success setup '
 	git update-index a &&
 	tree1=$(git write-tree) &&
 	commit1=$(echo modify | git commit-tree $tree1 -p $commit0) &&
-	git update-ref refs/heads/master $commit0 &&
+	git update-ref refs/heads/main $commit0 &&
 	git clone ./. clone1 &&
 	GIT_DIR=clone1/.git git update-index --add a &&
 	git clone ./. clone2 &&
diff --git a/t/t5403-post-checkout-hook.sh b/t/t5403-post-checkout-hook.sh
index a39b3b5c78..867dec8862 100755
--- a/t/t5403-post-checkout-hook.sh
+++ b/t/t5403-post-checkout-hook.sh
@@ -20,7 +20,7 @@ test_expect_success setup '
 
 test_expect_success 'post-checkout receives the right arguments with HEAD unchanged ' '
 	test_when_finished "rm -f .git/post-checkout.args" &&
-	git checkout master &&
+	git checkout main &&
 	read old new flag <.git/post-checkout.args &&
 	test $old = $new && test $flag = 1
 '
@@ -41,14 +41,14 @@ test_expect_success 'post-checkout receives the right args with HEAD changed ' '
 
 test_expect_success 'post-checkout receives the right args when not switching branches ' '
 	test_when_finished "rm -f .git/post-checkout.args" &&
-	git checkout master -- three.t &&
+	git checkout main -- three.t &&
 	read old new flag <.git/post-checkout.args &&
 	test $old = $new && test $flag = 0
 '
 
 test_expect_success 'post-checkout is triggered on rebase' '
 	test_when_finished "rm -f .git/post-checkout.args" &&
-	git checkout -b rebase-test master &&
+	git checkout -b rebase-test main &&
 	rm -f .git/post-checkout.args &&
 	git rebase rebase-on-me &&
 	read old new flag <.git/post-checkout.args &&
diff --git a/t/t5404-tracking-branches.sh b/t/t5404-tracking-branches.sh
index 2762f420bc..83751e68d0 100755
--- a/t/t5404-tracking-branches.sh
+++ b/t/t5404-tracking-branches.sh
@@ -30,9 +30,9 @@ test_expect_success 'prepare pushable branches' '
 	git checkout -b b2 origin/b2 &&
 	echo aa-b2 >>file &&
 	git commit -a -m aa-b2 &&
-	git checkout master &&
-	echo aa-master >>file &&
-	git commit -a -m aa-master
+	git checkout main &&
+	echo aa-main >>file &&
+	git commit -a -m aa-main
 '
 
 test_expect_success 'mixed-success push returns error' '
@@ -40,7 +40,7 @@ test_expect_success 'mixed-success push returns error' '
 '
 
 test_expect_success 'check tracking branches updated correctly after push' '
-	test "$(git rev-parse origin/master)" = "$(git rev-parse master)"
+	test "$(git rev-parse origin/main)" = "$(git rev-parse main)"
 '
 
 test_expect_success 'check tracking branches not updated for failed refs' '
diff --git a/t/t5405-send-pack-rewind.sh b/t/t5405-send-pack-rewind.sh
index 235fb7686a..8792e74682 100755
--- a/t/t5405-send-pack-rewind.sh
+++ b/t/t5405-send-pack-rewind.sh
@@ -13,7 +13,7 @@ test_expect_success setup '
 	mkdir another && (
 		cd another &&
 		git init &&
-		git fetch --update-head-ok .. master:master
+		git fetch --update-head-ok .. main:main
 	) &&
 
 	>file2 && git add file2 && test_tick &&
@@ -25,7 +25,7 @@ test_expect_success 'non forced push should die not segfault' '
 
 	(
 		cd another &&
-		test_must_fail git push .. master:master
+		test_must_fail git push .. main:main
 	)
 
 '
@@ -34,7 +34,7 @@ test_expect_success 'forced push should succeed' '
 
 	(
 		cd another &&
-		git push .. +master:master
+		git push .. +main:main
 	)
 
 '
diff --git a/t/t5407-post-rewrite-hook.sh b/t/t5407-post-rewrite-hook.sh
index 80750a817e..27bc159acf 100755
--- a/t/t5407-post-rewrite-hook.sh
+++ b/t/t5407-post-rewrite-hook.sh
@@ -14,7 +14,7 @@ test_expect_success 'setup' '
 	git checkout A^0 &&
 	test_commit E bar E &&
 	test_commit F foo F &&
-	git checkout master
+	git checkout main
 '
 
 mkdir .git/hooks
diff --git a/t/t5410-receive-pack-alternates.sh b/t/t5410-receive-pack-alternates.sh
index f00d0da860..cb6fffe611 100755
--- a/t/t5410-receive-pack-alternates.sh
+++ b/t/t5410-receive-pack-alternates.sh
@@ -7,9 +7,9 @@ test_description='git receive-pack with alternate ref filtering'
 test_expect_success 'setup' '
 	test_commit base &&
 	git clone -s --bare . fork &&
-	git checkout -b public/branch master &&
+	git checkout -b public/branch main &&
 	test_commit public &&
-	git checkout -b private/branch master &&
+	git checkout -b private/branch main &&
 	test_commit private
 '
 
diff --git a/t/test-lib.sh b/t/test-lib.sh
index b783629348..155bfad454 100644
--- a/t/test-lib.sh
+++ b/t/test-lib.sh
@@ -257,13 +257,13 @@ case "$TRASH_DIRECTORY" in
 esac
 
 case "$TEST_NUMBER" in
-3404|4013)
+3404|4013|5310)
 	# Avoid conflicts with patch series that are cooking at the same time
 	# as the patch series changing the default of `init.defaultBranch`.
 	GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
 	export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 	;;
-[0-4]*)
+[0-4]*|5[0-4]*)
 	GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 	export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 	;;
-- 
gitgitgadget


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH v2 11/27] t5503: prepare aligned comment for replacing `master` with `main`
  2020-11-17 16:12 ` [PATCH v2 00/27] tests: use " Johannes Schindelin via GitGitGadget
                     ` (9 preceding siblings ...)
  2020-11-17 16:12   ` [PATCH v2 10/27] t5[0-4]*: adjust the references to the default branch name "main" Johannes Schindelin via GitGitGadget
@ 2020-11-17 16:12   ` Johannes Schindelin via GitGitGadget
  2020-11-17 16:12   ` [PATCH v2 12/27] t550*: adjust the references to the default branch name "main" Johannes Schindelin via GitGitGadget
                     ` (17 subsequent siblings)
  28 siblings, 0 replies; 163+ messages in thread
From: Johannes Schindelin via GitGitGadget @ 2020-11-17 16:12 UTC (permalink / raw)
  To: git
  Cc: Felipe Contreras, Ævar Arnfjörð Bjarmason,
	Johannes Schindelin, Jeff King, Johannes Schindelin,
	Johannes Schindelin

From: Johannes Schindelin <johannes.schindelin@gmx.de>

In an upcoming commit, we will use `main` as the default branch name in
t5503 instead of `master`. This will require extra padding in ASCII-art
commit graphs, which we hereby add preemptively.

By doing this preemptively rather than after the commit applying the
search-and-replace, it is more obvious that we caught all aligned
comments that are affected by the latter commit.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
---
 t/t5503-tagfollow.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/t/t5503-tagfollow.sh b/t/t5503-tagfollow.sh
index 6041a4dd32..6dafbe4543 100755
--- a/t/t5503-tagfollow.sh
+++ b/t/t5503-tagfollow.sh
@@ -11,7 +11,7 @@ test_description='test automatic tag following'
 #   L - A ------ O ------ B
 #    \   \                 \
 #     \   C - origin/cat    \
-#      origin/master         master
+#      origin/master           master
 
 test_expect_success setup '
 	test_tick &&
-- 
gitgitgadget


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH v2 12/27] t550*: adjust the references to the default branch name "main"
  2020-11-17 16:12 ` [PATCH v2 00/27] tests: use " Johannes Schindelin via GitGitGadget
                     ` (10 preceding siblings ...)
  2020-11-17 16:12   ` [PATCH v2 11/27] t5503: prepare aligned comment for replacing `master` with `main` Johannes Schindelin via GitGitGadget
@ 2020-11-17 16:12   ` Johannes Schindelin via GitGitGadget
  2020-11-17 16:12   ` [PATCH v2 13/27] t551*: " Johannes Schindelin via GitGitGadget
                     ` (16 subsequent siblings)
  28 siblings, 0 replies; 163+ messages in thread
From: Johannes Schindelin via GitGitGadget @ 2020-11-17 16:12 UTC (permalink / raw)
  To: git
  Cc: Felipe Contreras, Ævar Arnfjörð Bjarmason,
	Johannes Schindelin, Jeff King, Johannes Schindelin,
	Johannes Schindelin

From: Johannes Schindelin <johannes.schindelin@gmx.de>

This trick was performed via

	$ (cd t &&
	   sed -i -e 's/master/main/g' -e 's/MASTER/MAIN/g' \
		-e 's/Master/Main/g' -- t550*.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>
---
 t/t5500-fetch-pack.sh            |  28 +++----
 t/t5501-fetch-push-alternates.sh |   4 +-
 t/t5502-quickfetch.sh            |   6 +-
 t/t5503-tagfollow.sh             |  12 +--
 t/t5504-fetch-receive-strict.sh  |  20 ++---
 t/t5505-remote.sh                | 140 +++++++++++++++----------------
 t/t5506-remote-groups.sh         |   4 +-
 t/t5509-fetch-push-namespaces.sh |  30 +++----
 t/test-lib.sh                    |   2 +-
 9 files changed, 123 insertions(+), 123 deletions(-)

diff --git a/t/t5500-fetch-pack.sh b/t/t5500-fetch-pack.sh
index 3557374312..70e41ada01 100755
--- a/t/t5500-fetch-pack.sh
+++ b/t/t5500-fetch-pack.sh
@@ -407,14 +407,14 @@ test_expect_success 'in_vain resetted upon ACK' '
 	rm -rf myserver myclient &&
 	git init myserver &&
 
-	# Linked list of commits on master. The first is common; the rest are
+	# Linked list of commits on main. The first is common; the rest are
 	# not.
-	test_commit -C myserver first_master_commit &&
+	test_commit -C myserver first_main_commit &&
 	git clone "file://$(pwd)/myserver" myclient &&
 	test_commit_bulk -C myclient 255 &&
 
 	# Another linked list of commits on anotherbranch with no connection to
-	# master. The first is common; the rest are not.
+	# main. The first is common; the rest are not.
 	git -C myserver checkout --orphan anotherbranch &&
 	test_commit -C myserver first_anotherbranch_commit &&
 	git -C myclient fetch origin anotherbranch:refs/heads/anotherbranch &&
@@ -422,14 +422,14 @@ test_expect_success 'in_vain resetted upon ACK' '
 	test_commit_bulk -C myclient 255 &&
 
 	# The new commit that the client wants to fetch.
-	git -C myserver checkout master &&
+	git -C myserver checkout main &&
 	test_commit -C myserver to_fetch &&
 
 	# The client will send (as "have"s) all 256 commits in anotherbranch
 	# first. The 256th commit is common between the client and the server,
 	# and should reset in_vain. This allows negotiation to continue until
 	# the client reports that first_anotherbranch_commit is common.
-	git -C myclient fetch --progress origin master 2>log &&
+	git -C myclient fetch --progress origin main 2>log &&
 	test_i18ngrep "Total 3 " log
 '
 
@@ -637,7 +637,7 @@ test_expect_success 'shallow fetch with tags does not break the repository' '
 		mkdir repo2 &&
 		cd repo2 &&
 		git init &&
-		git fetch --depth=2 ../.git master:branch &&
+		git fetch --depth=2 ../.git main:branch &&
 		git fsck
 	)
 '
@@ -662,7 +662,7 @@ test_expect_success 'fetch-pack can fetch a raw sha1 that is advertised as a ref
 
 	git init client &&
 	git -C client fetch-pack ../server \
-		$(git -C server rev-parse refs/heads/master)
+		$(git -C server rev-parse refs/heads/main)
 '
 
 test_expect_success 'fetch-pack can fetch a raw sha1 overlapping a named ref' '
@@ -688,7 +688,7 @@ test_expect_success 'fetch-pack cannot fetch a raw sha1 that is not advertised a
 	# Some protocol versions (e.g. 2) support fetching
 	# unadvertised objects, so restrict this test to v0.
 	test_must_fail env GIT_TEST_PROTOCOL_VERSION=0 git -C client fetch-pack ../server \
-		$(git -C server rev-parse refs/heads/master^) 2>err &&
+		$(git -C server rev-parse refs/heads/main^) 2>err &&
 	test_i18ngrep "Server does not allow request for unadvertised object" err
 '
 
@@ -822,7 +822,7 @@ test_expect_success 'clone shallow since ...' '
 
 test_expect_success 'fetch shallow since ...' '
 	git -C shallow11 fetch --shallow-since "200000000 +0700" origin &&
-	git -C shallow11 log --pretty=tformat:%s origin/master >actual &&
+	git -C shallow11 log --pretty=tformat:%s origin/main >actual &&
 	cat >expected <<-\EOF &&
 	three
 	two
@@ -863,7 +863,7 @@ test_expect_success 'shallow since with commit graph and already-seen commit' '
 	(
 	cd shallow-since-graph &&
 	test_commit base &&
-	test_commit master &&
+	test_commit main &&
 	git checkout -b other HEAD^ &&
 	test_commit other &&
 	git commit-graph write --reachable &&
@@ -874,7 +874,7 @@ test_expect_success 'shallow since with commit graph and already-seen commit' '
 	$(echo "object-format=$(test_oid algo)" | packetize)
 	00010013deepen-since 1
 	$(echo "want $(git rev-parse other)" | packetize)
-	$(echo "have $(git rev-parse master)" | packetize)
+	$(echo "have $(git rev-parse main)" | packetize)
 	0000
 	EOF
 	)
@@ -896,7 +896,7 @@ test_expect_success 'shallow clone exclude tag two' '
 
 test_expect_success 'fetch exclude tag one' '
 	git -C shallow12 fetch --shallow-exclude one origin &&
-	git -C shallow12 log --pretty=tformat:%s origin/master >actual &&
+	git -C shallow12 log --pretty=tformat:%s origin/main >actual &&
 	test_write_lines three two >expected &&
 	test_cmp expected actual
 '
@@ -910,11 +910,11 @@ test_expect_success 'fetching deepen' '
 	test_commit three &&
 	git clone --depth 1 "file://$(pwd)/." deepen &&
 	test_commit four &&
-	git -C deepen log --pretty=tformat:%s master >actual &&
+	git -C deepen log --pretty=tformat:%s main >actual &&
 	echo three >expected &&
 	test_cmp expected actual &&
 	git -C deepen fetch --deepen=1 &&
-	git -C deepen log --pretty=tformat:%s origin/master >actual &&
+	git -C deepen log --pretty=tformat:%s origin/main >actual &&
 	cat >expected <<-\EOF &&
 	four
 	three
diff --git a/t/t5501-fetch-push-alternates.sh b/t/t5501-fetch-push-alternates.sh
index 1bc57ac03f..0054163ce4 100755
--- a/t/t5501-fetch-push-alternates.sh
+++ b/t/t5501-fetch-push-alternates.sh
@@ -45,7 +45,7 @@ test_expect_success setup '
 test_expect_success 'pushing into a repository with the same alternate' '
 	(
 		cd one &&
-		git push ../receiver master:refs/heads/it
+		git push ../receiver main:refs/heads/it
 	) &&
 	(
 		cd receiver &&
@@ -57,7 +57,7 @@ test_expect_success 'pushing into a repository with the same alternate' '
 test_expect_success 'fetching from a repository with the same alternate' '
 	(
 		cd fetcher &&
-		git fetch ../one master:refs/heads/it &&
+		git fetch ../one main:refs/heads/it &&
 		count_objects >../fetcher.count
 	) &&
 	test_cmp one.count fetcher.count
diff --git a/t/t5502-quickfetch.sh b/t/t5502-quickfetch.sh
index 7a46cbdbe6..b163787a05 100755
--- a/t/t5502-quickfetch.sh
+++ b/t/t5502-quickfetch.sh
@@ -108,14 +108,14 @@ test_expect_success 'quickfetch should not copy from alternate' '
 				q
 			}"
 	) ) &&
-	origin_master=$( (
+	origin_main=$( (
 		cd quickclone &&
-		git rev-parse origin/master
+		git rev-parse origin/main
 	) ) &&
 	echo "loose objects: $obj_cnt, packfiles: $pck_cnt" &&
 	test $obj_cnt -eq 0 &&
 	test $pck_cnt -eq 0 &&
-	test z$origin_master = z$(git rev-parse master)
+	test z$origin_main = z$(git rev-parse main)
 
 '
 
diff --git a/t/t5503-tagfollow.sh b/t/t5503-tagfollow.sh
index 6dafbe4543..b3e5f810e0 100755
--- a/t/t5503-tagfollow.sh
+++ b/t/t5503-tagfollow.sh
@@ -11,7 +11,7 @@ test_description='test automatic tag following'
 #   L - A ------ O ------ B
 #    \   \                 \
 #     \   C - origin/cat    \
-#      origin/master           master
+#      origin/main           main
 
 test_expect_success setup '
 	test_tick &&
@@ -57,7 +57,7 @@ test_expect_success 'fetch A (new commit : 1 connection)' '
 	(
 		cd cloned &&
 		GIT_TRACE_PACKET=$UPATH git fetch &&
-		test $A = $(git rev-parse --verify origin/master)
+		test $A = $(git rev-parse --verify origin/main)
 	) &&
 	get_needs $U >actual &&
 	test_cmp expect actual
@@ -72,7 +72,7 @@ test_expect_success "create tag T on A, create C on branch cat" '
 	git add file &&
 	git commit -m C &&
 	C=$(git rev-parse --verify HEAD) &&
-	git checkout master
+	git checkout main
 '
 
 test_expect_success 'setup expect' '
@@ -123,7 +123,7 @@ test_expect_success 'fetch B, S (commit and tag : 1 connection)' '
 	(
 		cd cloned &&
 		GIT_TRACE_PACKET=$UPATH git fetch &&
-		test $B = $(git rev-parse --verify origin/master) &&
+		test $B = $(git rev-parse --verify origin/main) &&
 		test $B = $(git rev-parse --verify tag2^0) &&
 		test $S = $(git rev-parse --verify tag2)
 	) &&
@@ -138,7 +138,7 @@ want $S
 EOF
 '
 
-test_expect_success 'new clone fetch master and tags' '
+test_expect_success 'new clone fetch main and tags' '
 	test_might_fail git branch -D cat &&
 	rm -f $U &&
 	(
@@ -147,7 +147,7 @@ test_expect_success 'new clone fetch master and tags' '
 		git init &&
 		git remote add origin .. &&
 		GIT_TRACE_PACKET=$UPATH git fetch &&
-		test $B = $(git rev-parse --verify origin/master) &&
+		test $B = $(git rev-parse --verify origin/main) &&
 		test $S = $(git rev-parse --verify tag2) &&
 		test $B = $(git rev-parse --verify tag2^0) &&
 		test $T = $(git rev-parse --verify tag1) &&
diff --git a/t/t5504-fetch-receive-strict.sh b/t/t5504-fetch-receive-strict.sh
index 1a16ac4c0d..d2ba19ce68 100755
--- a/t/t5504-fetch-receive-strict.sh
+++ b/t/t5504-fetch-receive-strict.sh
@@ -25,7 +25,7 @@ test_expect_success 'fetch without strict' '
 		cd dst &&
 		git config fetch.fsckobjects false &&
 		git config transfer.fsckobjects false &&
-		test_must_fail git fetch ../.git master
+		test_must_fail git fetch ../.git main
 	)
 '
 
@@ -36,7 +36,7 @@ test_expect_success 'fetch with !fetch.fsckobjects' '
 		cd dst &&
 		git config fetch.fsckobjects false &&
 		git config transfer.fsckobjects true &&
-		test_must_fail git fetch ../.git master
+		test_must_fail git fetch ../.git main
 	)
 '
 
@@ -47,7 +47,7 @@ test_expect_success 'fetch with fetch.fsckobjects' '
 		cd dst &&
 		git config fetch.fsckobjects true &&
 		git config transfer.fsckobjects false &&
-		test_must_fail git fetch ../.git master
+		test_must_fail git fetch ../.git main
 	)
 '
 
@@ -57,13 +57,13 @@ test_expect_success 'fetch with transfer.fsckobjects' '
 	(
 		cd dst &&
 		git config transfer.fsckobjects true &&
-		test_must_fail git fetch ../.git master
+		test_must_fail git fetch ../.git main
 	)
 '
 
 cat >exp <<EOF
 To dst
-!	refs/heads/master:refs/heads/test	[remote rejected] (missing necessary objects)
+!	refs/heads/main:refs/heads/test	[remote rejected] (missing necessary objects)
 Done
 EOF
 
@@ -75,7 +75,7 @@ test_expect_success 'push without strict' '
 		git config fetch.fsckobjects false &&
 		git config transfer.fsckobjects false
 	) &&
-	test_must_fail git push --porcelain dst master:refs/heads/test >act &&
+	test_must_fail git push --porcelain dst main:refs/heads/test >act &&
 	test_cmp exp act
 '
 
@@ -87,13 +87,13 @@ test_expect_success 'push with !receive.fsckobjects' '
 		git config receive.fsckobjects false &&
 		git config transfer.fsckobjects true
 	) &&
-	test_must_fail git push --porcelain dst master:refs/heads/test >act &&
+	test_must_fail git push --porcelain dst main:refs/heads/test >act &&
 	test_cmp exp act
 '
 
 cat >exp <<EOF
 To dst
-!	refs/heads/master:refs/heads/test	[remote rejected] (unpacker error)
+!	refs/heads/main:refs/heads/test	[remote rejected] (unpacker error)
 EOF
 
 test_expect_success 'push with receive.fsckobjects' '
@@ -104,7 +104,7 @@ test_expect_success 'push with receive.fsckobjects' '
 		git config receive.fsckobjects true &&
 		git config transfer.fsckobjects false
 	) &&
-	test_must_fail git push --porcelain dst master:refs/heads/test >act &&
+	test_must_fail git push --porcelain dst main:refs/heads/test >act &&
 	test_cmp exp act
 '
 
@@ -115,7 +115,7 @@ test_expect_success 'push with transfer.fsckobjects' '
 		cd dst &&
 		git config transfer.fsckobjects true
 	) &&
-	test_must_fail git push --porcelain dst master:refs/heads/test >act &&
+	test_must_fail git push --porcelain dst main:refs/heads/test >act &&
 	test_cmp exp act
 '
 
diff --git a/t/t5505-remote.sh b/t/t5505-remote.sh
index eaa6e90220..540d65aa22 100755
--- a/t/t5505-remote.sh
+++ b/t/t5505-remote.sh
@@ -17,7 +17,7 @@ setup_repository () {
 	git add elif &&
 	test_tick &&
 	git commit -m "Second" &&
-	git checkout master
+	git checkout main
 	)
 }
 
@@ -60,8 +60,8 @@ test_expect_success C_LOCALE_OUTPUT 'remote information for the origin' '
 	(
 		cd test &&
 		tokens_match origin "$(git remote)" &&
-		check_remote_track origin master side &&
-		check_tracking_branch origin HEAD master side
+		check_remote_track origin main side &&
+		check_tracking_branch origin HEAD main side
 	)
 '
 
@@ -70,7 +70,7 @@ test_expect_success 'add another remote' '
 		cd test &&
 		git remote add -f second ../two &&
 		tokens_match "origin second" "$(git remote)" &&
-		check_tracking_branch second master side another &&
+		check_tracking_branch second main side another &&
 		git for-each-ref "--format=%(refname)" refs/remotes |
 		sed -e "/^refs\/remotes\/origin\//d" \
 		    -e "/^refs\/remotes\/second\//d" >actual &&
@@ -81,8 +81,8 @@ test_expect_success 'add another remote' '
 test_expect_success C_LOCALE_OUTPUT 'check remote-tracking' '
 	(
 		cd test &&
-		check_remote_track origin master side &&
-		check_remote_track second master side another
+		check_remote_track origin main side &&
+		check_remote_track second main side another
 	)
 '
 
@@ -99,7 +99,7 @@ test_expect_success 'remote forces tracking branches' '
 test_expect_success 'remove remote' '
 	(
 		cd test &&
-		git symbolic-ref refs/remotes/second/HEAD refs/remotes/second/master &&
+		git symbolic-ref refs/remotes/second/HEAD refs/remotes/second/main &&
 		git remote rm second
 	)
 '
@@ -108,7 +108,7 @@ test_expect_success C_LOCALE_OUTPUT 'remove remote' '
 	(
 		cd test &&
 		tokens_match origin "$(git remote)" &&
-		check_remote_track origin master side &&
+		check_remote_track origin main side &&
 		git for-each-ref "--format=%(refname)" refs/remotes |
 		sed -e "/^refs\/remotes\/origin\//d" >actual &&
 		test_must_be_empty actual
@@ -121,13 +121,13 @@ test_expect_success 'remove remote protects local branches' '
 		cat >expect1 <<-\EOF &&
 		Note: A branch outside the refs/remotes/ hierarchy was not removed;
 		to delete it, use:
-		  git branch -d master
+		  git branch -d main
 		EOF
 		cat >expect2 <<-\EOF &&
 		Note: Some branches outside the refs/remotes/ hierarchy were not removed;
 		to delete them, use:
 		  git branch -d foobranch
-		  git branch -d master
+		  git branch -d main
 		EOF
 		git tag footag &&
 		git config --add remote.oops.fetch "+refs/*:refs/*" &&
@@ -153,7 +153,7 @@ test_expect_success 'remove errors out early when deleting non-existent branch'
 
 test_expect_success 'remove remote with a branch without configured merge' '
 	test_when_finished "(
-		git -C test checkout master;
+		git -C test checkout main;
 		git -C test branch -D two;
 		git -C test config --remove-section remote.two;
 		git -C test config --remove-section branch.second;
@@ -163,9 +163,9 @@ test_expect_success 'remove remote with a branch without configured merge' '
 		cd test &&
 		git remote add two ../two &&
 		git fetch two &&
-		git checkout -b second two/master^0 &&
+		git checkout -b second two/main^0 &&
 		git config branch.second.remote two &&
-		git checkout master &&
+		git checkout main &&
 		git remote rm two
 	)
 '
@@ -211,7 +211,7 @@ cat >test/expect <<EOF
 * remote origin
   Fetch URL: $(pwd)/one
   Push  URL: $(pwd)/one
-  HEAD branch: master
+  HEAD branch: main
   Remote branches:
     main new (next fetch will store in remotes/origin)
     side tracked
@@ -221,14 +221,14 @@ cat >test/expect <<EOF
     octopus  merges with remote topic-a
                 and with remote topic-b
                 and with remote topic-c
-    rebase  rebases onto remote master
+    rebase  rebases onto remote main
   Local refs configured for 'git push':
     main pushes to main     (local out of date)
     main pushes to upstream (create)
 * remote two
   Fetch URL: ../two
   Push  URL: ../three
-  HEAD branch: master
+  HEAD branch: main
   Local refs configured for 'git push':
     ahead forces to main    (fast-forwardable)
     main  pushes to another (up to date)
@@ -237,16 +237,16 @@ EOF
 test_expect_success PREPARE_FOR_MAIN_BRANCH 'show' '
 	(
 		cd test &&
-		git config --add remote.origin.fetch refs/heads/master:refs/heads/upstream &&
+		git config --add remote.origin.fetch refs/heads/main:refs/heads/upstream &&
 		git fetch &&
-		git checkout -b ahead origin/master &&
+		git checkout -b ahead origin/main &&
 		echo 1 >>file &&
 		test_tick &&
 		git commit -m update file &&
-		git checkout master &&
-		git branch --track octopus origin/master &&
-		git branch --track rebase origin/master &&
-		git branch -d -r origin/master &&
+		git checkout main &&
+		git branch --track octopus origin/main &&
+		git branch --track rebase origin/main &&
+		git branch -d -r origin/main &&
 		git config --add remote.two.url ../two &&
 		git config --add remote.two.pushurl ../three &&
 		git config branch.rebase.rebase true &&
@@ -258,10 +258,10 @@ test_expect_success PREPARE_FOR_MAIN_BRANCH 'show' '
 			git commit -m update file
 		) &&
 		git config --add remote.origin.push : &&
-		git config --add remote.origin.push refs/heads/master:refs/heads/upstream &&
+		git config --add remote.origin.push refs/heads/main:refs/heads/upstream &&
 		git config --add remote.origin.push +refs/tags/lastbackup &&
-		git config --add remote.two.push +refs/heads/ahead:refs/heads/master &&
-		git config --add remote.two.push refs/heads/master:refs/heads/another &&
+		git config --add remote.two.push +refs/heads/ahead:refs/heads/main &&
+		git config --add remote.two.push refs/heads/main:refs/heads/another &&
 		git remote show origin two >output &&
 		git branch -d rebase octopus &&
 		test_i18ncmp expect output
@@ -274,7 +274,7 @@ cat >test/expect <<EOF
   Push  URL: $(pwd)/one
   HEAD branch: (not queried)
   Remote branches: (status not queried)
-    master
+    main
     side
   Local branches configured for 'git pull':
     ahead merges with remote main
@@ -322,7 +322,7 @@ test_expect_success 'set-head --auto' '
 	(
 		cd test &&
 		git remote set-head --auto origin &&
-		echo refs/remotes/origin/master >expect &&
+		echo refs/remotes/origin/main >expect &&
 		git symbolic-ref refs/remotes/origin/HEAD >output &&
 		test_cmp expect output
 	)
@@ -333,7 +333,7 @@ test_expect_success PREPARE_FOR_MAIN_BRANCH 'set-head --auto has no problem w/mu
 		cd test &&
 		git fetch two "refs/heads/*:refs/remotes/two/*" &&
 		git remote set-head --auto two >output 2>&1 &&
-		echo "two/HEAD set to master" >expect &&
+		echo "two/HEAD set to main" >expect &&
 		test_i18ncmp expect output
 	)
 '
@@ -347,7 +347,7 @@ test_expect_success 'set-head explicit' '
 		cd test &&
 		git remote set-head origin side2 &&
 		git symbolic-ref refs/remotes/origin/HEAD >output &&
-		git remote set-head origin master &&
+		git remote set-head origin main &&
 		test_cmp expect output
 	)
 '
@@ -410,7 +410,7 @@ test_expect_success 'fetch mirrors act as mirrors during fetch' '
 	(
 		cd mirror-fetch/parent &&
 		git branch new &&
-		git branch -m master renamed
+		git branch -m main renamed
 	) &&
 	(
 		cd mirror-fetch/child &&
@@ -424,7 +424,7 @@ test_expect_success 'fetch mirrors can prune' '
 	(
 		cd mirror-fetch/child &&
 		git remote prune parent &&
-		test_must_fail git rev-parse --verify refs/heads/master
+		test_must_fail git rev-parse --verify refs/heads/main
 	)
 '
 
@@ -477,14 +477,14 @@ test_expect_success 'push mirrors act as mirrors during push' '
 	(
 		cd mirror-push/private &&
 		git branch new &&
-		git branch -m master renamed &&
+		git branch -m main renamed &&
 		git push public
 	) &&
 	(
 		cd mirror-push/private &&
 		git rev-parse --verify refs/heads/new &&
 		git rev-parse --verify refs/heads/renamed &&
-		test_must_fail git rev-parse --verify refs/heads/master
+		test_must_fail git rev-parse --verify refs/heads/main
 	)
 '
 
@@ -610,10 +610,10 @@ test_expect_success 'reject --no-no-tags' '
 '
 
 cat >one/expect <<\EOF
-  apis/master
+  apis/main
   apis/side
   drosophila/another
-  drosophila/master
+  drosophila/main
   drosophila/side
 EOF
 
@@ -630,11 +630,11 @@ test_expect_success 'update' '
 
 cat >one/expect <<\EOF
   drosophila/another
-  drosophila/master
+  drosophila/main
   drosophila/side
-  manduca/master
+  manduca/main
   manduca/side
-  megaloprepus/master
+  megaloprepus/main
   megaloprepus/side
 EOF
 
@@ -673,11 +673,11 @@ test_expect_success 'update --prune' '
 '
 
 cat >one/expect <<-\EOF
-  apis/master
+  apis/main
   apis/side
-  manduca/master
+  manduca/main
   manduca/side
-  megaloprepus/master
+  megaloprepus/main
   megaloprepus/side
 EOF
 
@@ -697,7 +697,7 @@ test_expect_success 'update default' '
 
 cat >one/expect <<\EOF
   drosophila/another
-  drosophila/master
+  drosophila/main
   drosophila/side
 EOF
 
@@ -751,14 +751,14 @@ test_expect_success 'rename a remote' '
 	git clone one four &&
 	(
 		cd four &&
-		git config branch.master.pushRemote origin &&
+		git config branch.main.pushRemote origin &&
 		git remote rename origin upstream &&
 		test -z "$(git for-each-ref refs/remotes/origin)" &&
-		test "$(git symbolic-ref refs/remotes/upstream/HEAD)" = "refs/remotes/upstream/master" &&
-		test "$(git rev-parse upstream/master)" = "$(git rev-parse master)" &&
+		test "$(git symbolic-ref refs/remotes/upstream/HEAD)" = "refs/remotes/upstream/main" &&
+		test "$(git rev-parse upstream/main)" = "$(git rev-parse main)" &&
 		test "$(git config remote.upstream.fetch)" = "+refs/heads/*:refs/remotes/upstream/*" &&
-		test "$(git config branch.master.remote)" = "upstream" &&
-		test "$(git config branch.master.pushRemote)" = "upstream" &&
+		test "$(git config branch.main.remote)" = "upstream" &&
+		test "$(git config branch.main.pushRemote)" = "upstream" &&
 		test "$(git config --global remote.pushDefault)" = "origin"
 	)
 '
@@ -804,7 +804,7 @@ test_expect_success 'rename does not update a non-default fetch refspec' '
 		git config remote.origin.fetch +refs/heads/*:refs/heads/origin/* &&
 		git remote rename origin upstream &&
 		test "$(git config remote.upstream.fetch)" = "+refs/heads/*:refs/heads/origin/*" &&
-		git rev-parse -q origin/master
+		git rev-parse -q origin/main
 	)
 '
 
@@ -824,7 +824,7 @@ test_expect_success 'rename a remote with name prefix of other remote' '
 		cd four.three &&
 		git remote add o git://example.com/repo.git &&
 		git remote rename o upstream &&
-		test "$(git rev-parse origin/master)" = "$(git rev-parse master)"
+		test "$(git rev-parse origin/main)" = "$(git rev-parse main)"
 	)
 '
 
@@ -840,11 +840,11 @@ test_expect_success 'remove a remote' '
 	git clone one four.five &&
 	(
 		cd four.five &&
-		git config branch.master.pushRemote origin &&
+		git config branch.main.pushRemote origin &&
 		git remote remove origin &&
 		test -z "$(git for-each-ref refs/remotes/origin)" &&
-		test_must_fail git config branch.master.remote &&
-		test_must_fail git config branch.master.pushRemote &&
+		test_must_fail git config branch.main.remote &&
+		test_must_fail git config branch.main.pushRemote &&
 		test "$(git config --global remote.pushDefault)" = "origin"
 	)
 '
@@ -885,9 +885,9 @@ test_expect_success 'remove a remote removes repo remote.pushDefault but keeps g
 
 cat >remotes_origin <<EOF
 URL: $(pwd)/one
-Push: refs/heads/master:refs/heads/upstream
+Push: refs/heads/main:refs/heads/upstream
 Push: refs/heads/next:refs/heads/upstream2
-Pull: refs/heads/master:refs/heads/origin
+Pull: refs/heads/main:refs/heads/origin
 Pull: refs/heads/next:refs/heads/origin2
 EOF
 
@@ -903,11 +903,11 @@ test_expect_success 'migrate a remote from named file in $GIT_DIR/remotes' '
 		test_path_is_missing .git/remotes/origin &&
 		test "$(git config remote.origin.url)" = "$origin_url" &&
 		cat >push_expected <<-\EOF &&
-		refs/heads/master:refs/heads/upstream
+		refs/heads/main:refs/heads/upstream
 		refs/heads/next:refs/heads/upstream2
 		EOF
 		cat >fetch_expected <<-\EOF &&
-		refs/heads/master:refs/heads/origin
+		refs/heads/main:refs/heads/origin
 		refs/heads/next:refs/heads/origin2
 		EOF
 		git config --get-all remote.origin.push >push_actual &&
@@ -927,8 +927,8 @@ test_expect_success 'migrate a remote from named file in $GIT_DIR/branches' '
 		git remote rename origin origin &&
 		test_path_is_missing .git/branches/origin &&
 		test "$(git config remote.origin.url)" = "$origin_url" &&
-		test "$(git config remote.origin.fetch)" = "refs/heads/master:refs/heads/origin" &&
-		test "$(git config remote.origin.push)" = "HEAD:refs/heads/master"
+		test "$(git config remote.origin.fetch)" = "refs/heads/main:refs/heads/origin" &&
+		test "$(git config remote.origin.push)" = "HEAD:refs/heads/main"
 	)
 '
 
@@ -951,7 +951,7 @@ test_expect_success 'remote prune to cause a dangling symref' '
 	(
 		cd one &&
 		git checkout side2 &&
-		git branch -D master
+		git branch -D main
 	) &&
 	(
 		cd eight &&
@@ -994,22 +994,22 @@ test_expect_success 'remote set-branches' '
 	EOF
 	sort <<-\EOF >expect.replace &&
 	+refs/heads/maint:refs/remotes/scratch/maint
-	+refs/heads/master:refs/remotes/scratch/master
+	+refs/heads/main:refs/remotes/scratch/main
 	+refs/heads/next:refs/remotes/scratch/next
 	EOF
 	sort <<-\EOF >expect.add-two &&
 	+refs/heads/maint:refs/remotes/scratch/maint
-	+refs/heads/master:refs/remotes/scratch/master
+	+refs/heads/main:refs/remotes/scratch/main
 	+refs/heads/next:refs/remotes/scratch/next
 	+refs/heads/seen:refs/remotes/scratch/seen
 	+refs/heads/t/topic:refs/remotes/scratch/t/topic
 	EOF
 	sort <<-\EOF >expect.setup-ffonly &&
-	refs/heads/master:refs/remotes/scratch/master
+	refs/heads/main:refs/remotes/scratch/main
 	+refs/heads/next:refs/remotes/scratch/next
 	EOF
 	sort <<-\EOF >expect.respect-ffonly &&
-	refs/heads/master:refs/remotes/scratch/master
+	refs/heads/main:refs/remotes/scratch/main
 	+refs/heads/next:refs/remotes/scratch/next
 	+refs/heads/seen:refs/remotes/scratch/seen
 	EOF
@@ -1025,7 +1025,7 @@ test_expect_success 'remote set-branches' '
 		git config --get-all remote.scratch.fetch >config-result &&
 		sort <config-result >../actual.add &&
 
-		git remote set-branches scratch maint master next &&
+		git remote set-branches scratch maint main next &&
 		git config --get-all remote.scratch.fetch >config-result &&
 		sort <config-result >../actual.replace &&
 
@@ -1035,7 +1035,7 @@ test_expect_success 'remote set-branches' '
 
 		git config --unset-all remote.scratch.fetch &&
 		git config remote.scratch.fetch \
-			refs/heads/master:refs/remotes/scratch/master &&
+			refs/heads/main:refs/remotes/scratch/main &&
 		git config --add remote.scratch.fetch \
 			+refs/heads/next:refs/remotes/scratch/next &&
 		git config --get-all remote.scratch.fetch >config-result &&
@@ -1055,14 +1055,14 @@ test_expect_success 'remote set-branches' '
 
 test_expect_success 'remote set-branches with --mirror' '
 	echo "+refs/*:refs/*" >expect.initial &&
-	echo "+refs/heads/master:refs/heads/master" >expect.replace &&
+	echo "+refs/heads/main:refs/heads/main" >expect.replace &&
 	git clone --mirror .git/ setbranches-mirror &&
 	(
 		cd setbranches-mirror &&
 		git remote rename origin scratch &&
 		git config --get-all remote.scratch.fetch >../actual.initial &&
 
-		git remote set-branches scratch heads/master &&
+		git remote set-branches scratch heads/main &&
 		git config --get-all remote.scratch.fetch >../actual.replace
 	) &&
 	test_cmp expect.initial actual.initial &&
@@ -1308,7 +1308,7 @@ test_extra_arg () {
 test_extra_arg add nick url
 test_extra_arg rename origin newname
 test_extra_arg remove origin
-test_extra_arg set-head origin master
+test_extra_arg set-head origin main
 # set-branches takes any number of args
 test_extra_arg get-url origin newurl
 test_extra_arg set-url origin newurl oldurl
@@ -1325,7 +1325,7 @@ test_expect_success 'unqualified <dst> refspec DWIM and advice' '
 	test_when_finished "(cd test && git tag -d some-tag)" &&
 	(
 		cd test &&
-		git tag -a -m "Some tag" some-tag master &&
+		git tag -a -m "Some tag" some-tag main &&
 		exit_with=true &&
 		for type in commit tag tree blob
 		do
@@ -1351,7 +1351,7 @@ test_expect_success 'unqualified <dst> refspec DWIM and advice' '
 test_expect_success PREPARE_FOR_MAIN_BRANCH 'refs/remotes/* <src> refspec and unqualified <dst> DWIM and advice' '
 	(
 		cd two &&
-		git tag -a -m "Some tag" my-tag master &&
+		git tag -a -m "Some tag" my-tag main &&
 		git update-ref refs/trees/my-head-tree HEAD^{tree} &&
 		git update-ref refs/blobs/my-file-blob HEAD:file
 	) &&
diff --git a/t/t5506-remote-groups.sh b/t/t5506-remote-groups.sh
index 83d5558c0e..f2df3944e0 100755
--- a/t/t5506-remote-groups.sh
+++ b/t/t5506-remote-groups.sh
@@ -31,8 +31,8 @@ repo_fetched() {
 test_expect_success 'setup' '
 	mkdir one && (cd one && git init) &&
 	mkdir two && (cd two && git init) &&
-	git remote add -m master one one &&
-	git remote add -m master two two
+	git remote add -m main one one &&
+	git remote add -m main two two
 '
 
 test_expect_success 'no group updates all' '
diff --git a/t/t5509-fetch-push-namespaces.sh b/t/t5509-fetch-push-namespaces.sh
index a67f792adf..ad4a3f5c6e 100755
--- a/t/t5509-fetch-push-namespaces.sh
+++ b/t/t5509-fetch-push-namespaces.sh
@@ -27,9 +27,9 @@ test_expect_success setup '
 test_expect_success 'pushing into a repository using a ref namespace' '
 	(
 		cd original &&
-		git push pushee-namespaced master &&
+		git push pushee-namespaced main &&
 		git ls-remote pushee-namespaced >actual &&
-		printf "$commit1\trefs/heads/master\n" >expected &&
+		printf "$commit1\trefs/heads/main\n" >expected &&
 		test_cmp expected actual &&
 		git push pushee-namespaced --tags &&
 		git ls-remote pushee-namespaced >actual &&
@@ -56,7 +56,7 @@ test_expect_success 'pulling from a repository using a ref namespace' '
 		cd puller &&
 		git remote add -f pushee-namespaced "ext::git --namespace=namespace %s ../pushee" &&
 		git for-each-ref refs/ >actual &&
-		printf "$commit1 commit\trefs/remotes/pushee-namespaced/master\n" >expected &&
+		printf "$commit1 commit\trefs/remotes/pushee-namespaced/main\n" >expected &&
 		printf "$commit0 commit\trefs/tags/0\n" >>expected &&
 		printf "$commit1 commit\trefs/tags/1\n" >>expected &&
 		test_cmp expected actual
@@ -76,7 +76,7 @@ test_expect_success 'mirroring a repository using a ref namespace' '
 	(
 		cd mirror &&
 		git for-each-ref refs/ >actual &&
-		printf "$commit1 commit\trefs/namespaces/namespace/refs/heads/master\n" >expected &&
+		printf "$commit1 commit\trefs/namespaces/namespace/refs/heads/main\n" >expected &&
 		printf "$commit0 commit\trefs/namespaces/namespace/refs/tags/0\n" >>expected &&
 		printf "$commit1 commit\trefs/namespaces/namespace/refs/tags/1\n" >>expected &&
 		test_cmp expected actual
@@ -87,7 +87,7 @@ test_expect_success 'hide namespaced refs with transfer.hideRefs' '
 	GIT_NAMESPACE=namespace \
 		git -C pushee -c transfer.hideRefs=refs/tags \
 		ls-remote "ext::git %s ." >actual &&
-	printf "$commit1\trefs/heads/master\n" >expected &&
+	printf "$commit1\trefs/heads/main\n" >expected &&
 	test_cmp expected actual
 '
 
@@ -95,7 +95,7 @@ test_expect_success 'check that transfer.hideRefs does not match unstripped refs
 	GIT_NAMESPACE=namespace \
 		git -C pushee -c transfer.hideRefs=refs/namespaces/namespace/refs/tags \
 		ls-remote "ext::git %s ." >actual &&
-	printf "$commit1\trefs/heads/master\n" >expected &&
+	printf "$commit1\trefs/heads/main\n" >expected &&
 	printf "$commit0\trefs/tags/0\n" >>expected &&
 	printf "$commit1\trefs/tags/1\n" >>expected &&
 	test_cmp expected actual
@@ -105,23 +105,23 @@ test_expect_success 'hide full refs with transfer.hideRefs' '
 	GIT_NAMESPACE=namespace \
 		git -C pushee -c transfer.hideRefs="^refs/namespaces/namespace/refs/tags" \
 		ls-remote "ext::git %s ." >actual &&
-	printf "$commit1\trefs/heads/master\n" >expected &&
+	printf "$commit1\trefs/heads/main\n" >expected &&
 	test_cmp expected actual
 '
 
 test_expect_success 'try to update a hidden ref' '
-	test_config -C pushee transfer.hideRefs refs/heads/master &&
-	test_must_fail git -C original push pushee-namespaced master
+	test_config -C pushee transfer.hideRefs refs/heads/main &&
+	test_must_fail git -C original push pushee-namespaced main
 '
 
 test_expect_success 'try to update a ref that is not hidden' '
-	test_config -C pushee transfer.hideRefs refs/namespaces/namespace/refs/heads/master &&
-	git -C original push pushee-namespaced master
+	test_config -C pushee transfer.hideRefs refs/namespaces/namespace/refs/heads/main &&
+	git -C original push pushee-namespaced main
 '
 
 test_expect_success 'try to update a hidden full ref' '
-	test_config -C pushee transfer.hideRefs "^refs/namespaces/namespace/refs/heads/master" &&
-	test_must_fail git -C original push pushee-namespaced master
+	test_config -C pushee transfer.hideRefs "^refs/namespaces/namespace/refs/heads/main" &&
+	test_must_fail git -C original push pushee-namespaced main
 '
 
 test_expect_success 'set up ambiguous HEAD' '
@@ -157,9 +157,9 @@ test_expect_success 'denyCurrentBranch and unborn branch with ref namespace' '
 		cd original &&
 		git init unborn &&
 		git remote add unborn-namespaced "ext::git --namespace=namespace %s unborn" &&
-		test_must_fail git push unborn-namespaced HEAD:master &&
+		test_must_fail git push unborn-namespaced HEAD:main &&
 		git -C unborn config receive.denyCurrentBranch updateInstead &&
-		git push unborn-namespaced HEAD:master
+		git push unborn-namespaced HEAD:main
 	)
 '
 
diff --git a/t/test-lib.sh b/t/test-lib.sh
index 155bfad454..ca86f666e6 100644
--- a/t/test-lib.sh
+++ b/t/test-lib.sh
@@ -263,7 +263,7 @@ case "$TEST_NUMBER" in
 	GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
 	export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 	;;
-[0-4]*|5[0-4]*)
+[0-4]*|5[0-4]*|550*)
 	GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 	export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 	;;
-- 
gitgitgadget


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH v2 13/27] t551*: adjust the references to the default branch name "main"
  2020-11-17 16:12 ` [PATCH v2 00/27] tests: use " Johannes Schindelin via GitGitGadget
                     ` (11 preceding siblings ...)
  2020-11-17 16:12   ` [PATCH v2 12/27] t550*: adjust the references to the default branch name "main" Johannes Schindelin via GitGitGadget
@ 2020-11-17 16:12   ` Johannes Schindelin via GitGitGadget
  2020-11-17 16:12   ` [PATCH v2 14/27] t55[23]*: " Johannes Schindelin via GitGitGadget
                     ` (15 subsequent siblings)
  28 siblings, 0 replies; 163+ messages in thread
From: Johannes Schindelin via GitGitGadget @ 2020-11-17 16:12 UTC (permalink / raw)
  To: git
  Cc: Felipe Contreras, Ævar Arnfjörð Bjarmason,
	Johannes Schindelin, Jeff King, Johannes Schindelin,
	Johannes Schindelin

From: Johannes Schindelin <johannes.schindelin@gmx.de>

This trick was performed via

	$ (cd t &&
	   sed -i -e 's/master/main/g' -e 's/MASTER/MAIN/g' \
		-e 's/Master/Main/g' -- t551*.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>
---
 t/t5510-fetch.sh             | 158 +++++------
 t/t5511-refspec.sh           |  12 +-
 t/t5512-ls-remote.sh         |  26 +-
 t/t5514-fetch-multiple.sh    |  30 +--
 t/t5516-fetch-push.sh        | 500 +++++++++++++++++------------------
 t/t5517-push-mirror.sh       | 124 ++++-----
 t/t5518-fetch-exit-status.sh |   6 +-
 t/t5519-push-alternates.sh   |  12 +-
 t/test-lib.sh                |   2 +-
 9 files changed, 435 insertions(+), 435 deletions(-)

diff --git a/t/t5510-fetch.sh b/t/t5510-fetch.sh
index 5d673358f9..206e3be695 100755
--- a/t/t5510-fetch.sh
+++ b/t/t5510-fetch.sh
@@ -37,19 +37,19 @@ test_expect_success "clone and setup child repos" '
 	git clone . two &&
 	(
 		cd two &&
-		git config branch.master.remote one &&
+		git config branch.main.remote one &&
 		git config remote.one.url ../one/.git/ &&
-		git config remote.one.fetch refs/heads/master:refs/heads/one
+		git config remote.one.fetch refs/heads/main:refs/heads/one
 	) &&
 	git clone . three &&
 	(
 		cd three &&
-		git config branch.master.remote two &&
-		git config branch.master.merge refs/heads/one &&
+		git config branch.main.remote two &&
+		git config branch.main.merge refs/heads/one &&
 		mkdir -p .git/remotes &&
 		{
 			echo "URL: ../two/.git/"
-			echo "Pull: refs/heads/master:refs/heads/two"
+			echo "Pull: refs/heads/main:refs/heads/two"
 			echo "Pull: refs/heads/one:refs/heads/one"
 		} >.git/remotes/two
 	) &&
@@ -65,7 +65,7 @@ test_expect_success "fetch test" '
 	git fetch &&
 	git rev-parse --verify refs/heads/one &&
 	mine=$(git rev-parse refs/heads/one) &&
-	his=$(cd ../one && git rev-parse refs/heads/master) &&
+	his=$(cd ../one && git rev-parse refs/heads/main) &&
 	test "z$mine" = "z$his"
 '
 
@@ -75,11 +75,11 @@ test_expect_success "fetch test for-merge" '
 	git fetch &&
 	git rev-parse --verify refs/heads/two &&
 	git rev-parse --verify refs/heads/one &&
-	master_in_two=$(cd ../two && git rev-parse master) &&
+	main_in_two=$(cd ../two && git rev-parse main) &&
 	one_in_two=$(cd ../two && git rev-parse one) &&
 	{
 		echo "$one_in_two	"
-		echo "$master_in_two	not-for-merge"
+		echo "$main_in_two	not-for-merge"
 	} >expected &&
 	cut -f -2 .git/FETCH_HEAD >actual &&
 	test_cmp expected actual'
@@ -88,7 +88,7 @@ test_expect_success 'fetch --prune on its own works as expected' '
 	cd "$D" &&
 	git clone . prune &&
 	cd prune &&
-	git update-ref refs/remotes/origin/extrabranch master &&
+	git update-ref refs/remotes/origin/extrabranch main &&
 
 	git fetch --prune origin &&
 	test_must_fail git rev-parse origin/extrabranch
@@ -98,9 +98,9 @@ test_expect_success 'fetch --prune with a branch name keeps branches' '
 	cd "$D" &&
 	git clone . prune-branch &&
 	cd prune-branch &&
-	git update-ref refs/remotes/origin/extrabranch master &&
+	git update-ref refs/remotes/origin/extrabranch main &&
 
-	git fetch --prune origin master &&
+	git fetch --prune origin main &&
 	git rev-parse origin/extrabranch
 '
 
@@ -110,18 +110,18 @@ test_expect_success 'fetch --prune with a namespace keeps other namespaces' '
 	cd prune-namespace &&
 
 	git fetch --prune origin refs/heads/a/*:refs/remotes/origin/a/* &&
-	git rev-parse origin/master
+	git rev-parse origin/main
 '
 
 test_expect_success 'fetch --prune handles overlapping refspecs' '
 	cd "$D" &&
-	git update-ref refs/pull/42/head master &&
+	git update-ref refs/pull/42/head main &&
 	git clone . prune-overlapping &&
 	cd prune-overlapping &&
 	git config --add remote.origin.fetch refs/pull/*/head:refs/remotes/origin/pr/* &&
 
 	git fetch --prune origin &&
-	git rev-parse origin/master &&
+	git rev-parse origin/main &&
 	git rev-parse origin/pr/42 &&
 
 	git config --unset-all remote.origin.fetch &&
@@ -129,7 +129,7 @@ test_expect_success 'fetch --prune handles overlapping refspecs' '
 	git config --add remote.origin.fetch refs/heads/*:refs/remotes/origin/* &&
 
 	git fetch --prune origin &&
-	git rev-parse origin/master &&
+	git rev-parse origin/main &&
 	git rev-parse origin/pr/42
 '
 
@@ -137,13 +137,13 @@ test_expect_success 'fetch --prune --tags prunes branches but not tags' '
 	cd "$D" &&
 	git clone . prune-tags &&
 	cd prune-tags &&
-	git tag sometag master &&
+	git tag sometag main &&
 	# Create what looks like a remote-tracking branch from an earlier
 	# fetch that has since been deleted from the remote:
-	git update-ref refs/remotes/origin/fake-remote master &&
+	git update-ref refs/remotes/origin/fake-remote main &&
 
 	git fetch --prune --tags origin &&
-	git rev-parse origin/master &&
+	git rev-parse origin/main &&
 	test_must_fail git rev-parse origin/fake-remote &&
 	git rev-parse sometag
 '
@@ -152,10 +152,10 @@ test_expect_success 'fetch --prune --tags with branch does not prune other thing
 	cd "$D" &&
 	git clone . prune-tags-branch &&
 	cd prune-tags-branch &&
-	git tag sometag master &&
-	git update-ref refs/remotes/origin/extrabranch master &&
+	git tag sometag main &&
+	git update-ref refs/remotes/origin/extrabranch main &&
 
-	git fetch --prune --tags origin master &&
+	git fetch --prune --tags origin main &&
 	git rev-parse origin/extrabranch &&
 	git rev-parse sometag
 '
@@ -164,9 +164,9 @@ test_expect_success 'fetch --prune --tags with refspec prunes based on refspec'
 	cd "$D" &&
 	git clone . prune-tags-refspec &&
 	cd prune-tags-refspec &&
-	git tag sometag master &&
-	git update-ref refs/remotes/origin/foo/otherbranch master &&
-	git update-ref refs/remotes/origin/extrabranch master &&
+	git tag sometag main &&
+	git update-ref refs/remotes/origin/foo/otherbranch main &&
+	git update-ref refs/remotes/origin/extrabranch main &&
 
 	git fetch --prune --tags origin refs/heads/foo/*:refs/remotes/origin/foo/* &&
 	test_must_fail git rev-parse refs/remotes/origin/foo/otherbranch &&
@@ -177,20 +177,20 @@ test_expect_success 'fetch --prune --tags with refspec prunes based on refspec'
 test_expect_success '--refmap="" ignores configured refspec' '
 	cd "$TRASH_DIRECTORY" &&
 	git clone "$D" remote-refs &&
-	git -C remote-refs rev-parse remotes/origin/master >old &&
-	git -C remote-refs update-ref refs/remotes/origin/master master~1 &&
-	git -C remote-refs rev-parse remotes/origin/master >new &&
+	git -C remote-refs rev-parse remotes/origin/main >old &&
+	git -C remote-refs update-ref refs/remotes/origin/main main~1 &&
+	git -C remote-refs rev-parse remotes/origin/main >new &&
 	git -C remote-refs fetch --refmap= origin "+refs/heads/*:refs/hidden/origin/*" &&
-	git -C remote-refs rev-parse remotes/origin/master >actual &&
+	git -C remote-refs rev-parse remotes/origin/main >actual &&
 	test_cmp new actual &&
 	git -C remote-refs fetch origin &&
-	git -C remote-refs rev-parse remotes/origin/master >actual &&
+	git -C remote-refs rev-parse remotes/origin/main >actual &&
 	test_cmp old actual
 '
 
 test_expect_success '--refmap="" and --prune' '
-	git -C remote-refs update-ref refs/remotes/origin/foo/otherbranch master &&
-	git -C remote-refs update-ref refs/hidden/foo/otherbranch master &&
+	git -C remote-refs update-ref refs/remotes/origin/foo/otherbranch main &&
+	git -C remote-refs update-ref refs/hidden/foo/otherbranch main &&
 	git -C remote-refs fetch --prune --refmap="" origin +refs/heads/*:refs/hidden/* &&
 	git -C remote-refs rev-parse remotes/origin/foo/otherbranch &&
 	test_must_fail git -C remote-refs rev-parse refs/hidden/foo/otherbranch &&
@@ -250,7 +250,7 @@ test_expect_success 'fetch uses remote ref names to describe new refs' '
 		test_i18ngrep "new tag.* -> descriptive-tag$" actual &&
 		test_i18ngrep "new ref.* -> crazy$" actual
 	) &&
-	git checkout master
+	git checkout main
 '
 
 test_expect_success 'fetch must not resolve short tag name' '
@@ -281,7 +281,7 @@ test_expect_success 'create bundle 1' '
 	cd "$D" &&
 	echo >file updated again by origin &&
 	git commit -a -m "tip" &&
-	git bundle create --version=3 bundle1 master^..master
+	git bundle create --version=3 bundle1 main^..main
 '
 
 test_expect_success 'header of bundle looks right' '
@@ -289,7 +289,7 @@ test_expect_success 'header of bundle looks right' '
 	# v3 git bundle
 	@object-format=$(test_oid algo)
 	-OID updated by origin
-	OID refs/heads/master
+	OID refs/heads/main
 
 	EOF
 	sed -e "s/$OID_REGEX/OID/g" -e "5q" "$D"/bundle1 >actual &&
@@ -298,13 +298,13 @@ test_expect_success 'header of bundle looks right' '
 
 test_expect_success 'create bundle 2' '
 	cd "$D" &&
-	git bundle create bundle2 master~2..master
+	git bundle create bundle2 main~2..main
 '
 
 test_expect_success 'unbundle 1' '
 	cd "$D/bundle" &&
 	git checkout -b some-branch &&
-	test_must_fail git fetch "$D/bundle1" master:master
+	test_must_fail git fetch "$D/bundle1" main:main
 '
 
 
@@ -317,8 +317,8 @@ test_expect_success 'bundle 1 has only 3 files ' '
 
 test_expect_success 'unbundle 2' '
 	cd "$D/bundle" &&
-	git fetch ../bundle2 master:master &&
-	test "tip" = "$(git log -1 --pretty=oneline master | cut -d" " -f2)"
+	git fetch ../bundle2 main:main &&
+	test "tip" = "$(git log -1 --pretty=oneline main | cut -d" " -f2)"
 '
 
 test_expect_success 'bundle does not prerequisite objects' '
@@ -335,14 +335,14 @@ test_expect_success 'bundle does not prerequisite objects' '
 test_expect_success 'bundle should be able to create a full history' '
 
 	cd "$D" &&
-	git tag -a -m "1.0" v1.0 master &&
+	git tag -a -m "1.0" v1.0 main &&
 	git bundle create bundle4 v1.0
 
 '
 
 test_expect_success 'fetch with a non-applying branch.<name>.merge' '
-	git config branch.master.remote yeti &&
-	git config branch.master.merge refs/heads/bigfoot &&
+	git config branch.main.remote yeti &&
+	git config branch.main.merge refs/heads/bigfoot &&
 	git config remote.blub.url one &&
 	git config remote.blub.fetch "refs/heads/*:refs/remotes/one/*" &&
 	git fetch blub
@@ -362,8 +362,8 @@ test_expect_success 'fetch from GIT URL with a non-applying branch.<name>.merge
 # the merge spec matches the branch the remote HEAD points to
 test_expect_success 'fetch from GIT URL with a non-applying branch.<name>.merge [2]' '
 	one_ref=$(cd one && git symbolic-ref HEAD) &&
-	git config branch.master.remote blub &&
-	git config branch.master.merge "$one_ref" &&
+	git config branch.main.remote blub &&
+	git config branch.main.merge "$one_ref" &&
 	git update-ref -d FETCH_HEAD &&
 	git fetch one &&
 	test $one_head = "$(git rev-parse --verify FETCH_HEAD)" &&
@@ -373,7 +373,7 @@ test_expect_success 'fetch from GIT URL with a non-applying branch.<name>.merge
 # URL supplied to fetch matches the url of the configured branch's remote, but
 # the merge spec does not match the branch the remote HEAD points to
 test_expect_success 'fetch from GIT URL with a non-applying branch.<name>.merge [3]' '
-	git config branch.master.merge "${one_ref}_not" &&
+	git config branch.main.merge "${one_ref}_not" &&
 	git update-ref -d FETCH_HEAD &&
 	git fetch one &&
 	test $one_head = "$(git rev-parse --verify FETCH_HEAD)" &&
@@ -389,9 +389,9 @@ test_expect_success 'quoting of a strangely named repo' '
 test_expect_success 'bundle should record HEAD correctly' '
 
 	cd "$D" &&
-	git bundle create bundle5 HEAD master &&
+	git bundle create bundle5 HEAD main &&
 	git bundle list-heads bundle5 >actual &&
-	for h in HEAD refs/heads/master
+	for h in HEAD refs/heads/main
 	do
 		echo "$(git rev-parse --verify $h) $h"
 	done >expect &&
@@ -399,10 +399,10 @@ test_expect_success 'bundle should record HEAD correctly' '
 
 '
 
-test_expect_success 'mark initial state of origin/master' '
+test_expect_success 'mark initial state of origin/main' '
 	(
 		cd three &&
-		git tag base-origin-master refs/remotes/origin/master
+		git tag base-origin-main refs/remotes/origin/main
 	)
 '
 
@@ -412,10 +412,10 @@ test_expect_success 'explicit fetch should update tracking' '
 	git branch -f side &&
 	(
 		cd three &&
-		git update-ref refs/remotes/origin/master base-origin-master &&
-		o=$(git rev-parse --verify refs/remotes/origin/master) &&
-		git fetch origin master &&
-		n=$(git rev-parse --verify refs/remotes/origin/master) &&
+		git update-ref refs/remotes/origin/main base-origin-main &&
+		o=$(git rev-parse --verify refs/remotes/origin/main) &&
+		git fetch origin main &&
+		n=$(git rev-parse --verify refs/remotes/origin/main) &&
 		test "$o" != "$n" &&
 		test_must_fail git rev-parse --verify refs/remotes/origin/side
 	)
@@ -427,10 +427,10 @@ test_expect_success 'explicit pull should update tracking' '
 	git branch -f side &&
 	(
 		cd three &&
-		git update-ref refs/remotes/origin/master base-origin-master &&
-		o=$(git rev-parse --verify refs/remotes/origin/master) &&
-		git pull origin master &&
-		n=$(git rev-parse --verify refs/remotes/origin/master) &&
+		git update-ref refs/remotes/origin/main base-origin-main &&
+		o=$(git rev-parse --verify refs/remotes/origin/main) &&
+		git pull origin main &&
+		n=$(git rev-parse --verify refs/remotes/origin/main) &&
 		test "$o" != "$n" &&
 		test_must_fail git rev-parse --verify refs/remotes/origin/side
 	)
@@ -449,13 +449,13 @@ test_expect_success 'explicit --refmap option overrides remote.*.fetch' '
 	git branch -f side &&
 	(
 		cd three &&
-		git update-ref refs/remotes/origin/master base-origin-master &&
-		o=$(git rev-parse --verify refs/remotes/origin/master) &&
-		git fetch --refmap="refs/heads/*:refs/remotes/other/*" origin master &&
-		n=$(git rev-parse --verify refs/remotes/origin/master) &&
+		git update-ref refs/remotes/origin/main base-origin-main &&
+		o=$(git rev-parse --verify refs/remotes/origin/main) &&
+		git fetch --refmap="refs/heads/*:refs/remotes/other/*" origin main &&
+		n=$(git rev-parse --verify refs/remotes/origin/main) &&
 		test "$o" = "$n" &&
 		test_must_fail git rev-parse --verify refs/remotes/origin/side &&
-		git rev-parse --verify refs/remotes/other/master
+		git rev-parse --verify refs/remotes/other/main
 	)
 '
 
@@ -464,10 +464,10 @@ test_expect_success 'explicitly empty --refmap option disables remote.*.fetch' '
 	git branch -f side &&
 	(
 		cd three &&
-		git update-ref refs/remotes/origin/master base-origin-master &&
-		o=$(git rev-parse --verify refs/remotes/origin/master) &&
-		git fetch --refmap="" origin master &&
-		n=$(git rev-parse --verify refs/remotes/origin/master) &&
+		git update-ref refs/remotes/origin/main base-origin-main &&
+		o=$(git rev-parse --verify refs/remotes/origin/main) &&
+		git fetch --refmap="" origin main &&
+		n=$(git rev-parse --verify refs/remotes/origin/main) &&
 		test "$o" = "$n" &&
 		test_must_fail git rev-parse --verify refs/remotes/origin/side
 	)
@@ -479,10 +479,10 @@ test_expect_success 'configured fetch updates tracking' '
 	git branch -f side &&
 	(
 		cd three &&
-		git update-ref refs/remotes/origin/master base-origin-master &&
-		o=$(git rev-parse --verify refs/remotes/origin/master) &&
+		git update-ref refs/remotes/origin/main base-origin-main &&
+		o=$(git rev-parse --verify refs/remotes/origin/main) &&
 		git fetch origin &&
-		n=$(git rev-parse --verify refs/remotes/origin/master) &&
+		n=$(git rev-parse --verify refs/remotes/origin/main) &&
 		test "$o" != "$n" &&
 		git rev-parse --verify refs/remotes/origin/side
 	)
@@ -493,12 +493,12 @@ test_expect_success 'non-matching refspecs do not confuse tracking update' '
 	git update-ref refs/odd/location HEAD &&
 	(
 		cd three &&
-		git update-ref refs/remotes/origin/master base-origin-master &&
+		git update-ref refs/remotes/origin/main base-origin-main &&
 		git config --add remote.origin.fetch \
 			refs/odd/location:refs/remotes/origin/odd &&
-		o=$(git rev-parse --verify refs/remotes/origin/master) &&
-		git fetch origin master &&
-		n=$(git rev-parse --verify refs/remotes/origin/master) &&
+		o=$(git rev-parse --verify refs/remotes/origin/main) &&
+		git fetch origin main &&
+		n=$(git rev-parse --verify refs/remotes/origin/main) &&
 		test "$o" != "$n" &&
 		test_must_fail git rev-parse --verify refs/remotes/origin/odd
 	)
@@ -524,7 +524,7 @@ test_expect_success 'auto tag following fetches minimum' '
 			git tag -a -m $i excess-$i || exit 1
 		done
 	) &&
-	git checkout master &&
+	git checkout main &&
 	(
 		cd follow &&
 		git fetch
@@ -533,13 +533,13 @@ test_expect_success 'auto tag following fetches minimum' '
 
 test_expect_success 'refuse to fetch into the current branch' '
 
-	test_must_fail git fetch . side:master
+	test_must_fail git fetch . side:main
 
 '
 
 test_expect_success 'fetch into the current branch with --update-head-ok' '
 
-	git fetch --update-head-ok . side:master
+	git fetch --update-head-ok . side:main
 
 '
 
@@ -568,7 +568,7 @@ test_expect_success "should be able to fetch with duplicate refspecs" '
 	(
 		cd dups &&
 		git init &&
-		git config branch.master.remote three &&
+		git config branch.main.remote three &&
 		git config remote.three.url ../three/.git &&
 		git config remote.three.fetch +refs/heads/*:refs/remotes/origin/* &&
 		git config --add remote.three.fetch +refs/heads/*:refs/remotes/origin/* &&
@@ -877,11 +877,11 @@ test_expect_success 'all boundary commits are excluded' '
 	test_commit oneside &&
 	git checkout HEAD^ &&
 	test_commit otherside &&
-	git checkout master &&
+	git checkout main &&
 	test_tick &&
 	git merge otherside &&
 	ad=$(git log --no-walk --format=%ad HEAD) &&
-	git bundle create twoside-boundary.bdl master --since="$ad" &&
+	git bundle create twoside-boundary.bdl main --since="$ad" &&
 	convert_bundle_to_pack <twoside-boundary.bdl >twoside-boundary.pack &&
 	pack=$(git index-pack --fix-thin --stdin <twoside-boundary.pack) &&
 	test_bundle_object_count .git/objects/pack/pack-${pack##pack	}.pack 3
@@ -1017,7 +1017,7 @@ setup_negotiation_tip () {
 	fi &&
 
 	test_commit -C "$SERVER" beta_s &&
-	git -C "$SERVER" checkout master &&
+	git -C "$SERVER" checkout main &&
 	test_commit -C "$SERVER" alpha_s &&
 	git -C "$SERVER" tag -d alpha_1 alpha_2 beta_1 beta_2
 }
diff --git a/t/t5511-refspec.sh b/t/t5511-refspec.sh
index f541f30bc2..847a9d4c27 100755
--- a/t/t5511-refspec.sh
+++ b/t/t5511-refspec.sh
@@ -33,7 +33,7 @@ test_refspec fetch '::'						invalid
 test_refspec push 'refs/heads/*:refs/remotes/frotz/*'
 test_refspec push 'refs/heads/*:refs/remotes/frotz'		invalid
 test_refspec push 'refs/heads:refs/remotes/frotz/*'		invalid
-test_refspec push 'refs/heads/master:refs/remotes/frotz/xyzzy'
+test_refspec push 'refs/heads/main:refs/remotes/frotz/xyzzy'
 
 
 # These have invalid LHS, but we do not have a formal "valid sha-1
@@ -41,18 +41,18 @@ test_refspec push 'refs/heads/master:refs/remotes/frotz/xyzzy'
 # code.  They will be caught downstream anyway, but we may want to
 # have tighter check later...
 
-: test_refspec push 'refs/heads/master::refs/remotes/frotz/xyzzy'	invalid
+: test_refspec push 'refs/heads/main::refs/remotes/frotz/xyzzy'	invalid
 : test_refspec push 'refs/heads/maste :refs/remotes/frotz/xyzzy'	invalid
 
 test_refspec fetch 'refs/heads/*:refs/remotes/frotz/*'
 test_refspec fetch 'refs/heads/*:refs/remotes/frotz'		invalid
 test_refspec fetch 'refs/heads:refs/remotes/frotz/*'		invalid
-test_refspec fetch 'refs/heads/master:refs/remotes/frotz/xyzzy'
-test_refspec fetch 'refs/heads/master::refs/remotes/frotz/xyzzy'	invalid
+test_refspec fetch 'refs/heads/main:refs/remotes/frotz/xyzzy'
+test_refspec fetch 'refs/heads/main::refs/remotes/frotz/xyzzy'	invalid
 test_refspec fetch 'refs/heads/maste :refs/remotes/frotz/xyzzy'	invalid
 
-test_refspec push 'master~1:refs/remotes/frotz/backup'
-test_refspec fetch 'master~1:refs/remotes/frotz/backup'		invalid
+test_refspec push 'main~1:refs/remotes/frotz/backup'
+test_refspec fetch 'main~1:refs/remotes/frotz/backup'		invalid
 test_refspec push 'HEAD~4:refs/remotes/frotz/new'
 test_refspec fetch 'HEAD~4:refs/remotes/frotz/new'		invalid
 
diff --git a/t/t5512-ls-remote.sh b/t/t5512-ls-remote.sh
index e98c3a0174..fb122fb7b8 100755
--- a/t/t5512-ls-remote.sh
+++ b/t/t5512-ls-remote.sh
@@ -118,7 +118,7 @@ test_expect_success 'use branch.<name>.remote if possible' '
 	echo "From $URL" >exp_err &&
 
 	git remote add other $URL &&
-	git config branch.master.remote other &&
+	git config branch.main.remote other &&
 
 	git ls-remote 2>actual_err >actual &&
 	test_cmp exp_err actual_err &&
@@ -129,9 +129,9 @@ test_expect_success 'confuses pattern as remote when no remote specified' '
 	if test_have_prereq MINGW
 	then
 		# Windows does not like asterisks in pathname
-		does_not_exist=master
+		does_not_exist=main
 	else
-		does_not_exist="refs*master"
+		does_not_exist="refs*main"
 	fi &&
 	cat >exp <<-EOF &&
 	fatal: '\''$does_not_exist'\'' does not appear to be a git repository
@@ -144,7 +144,7 @@ test_expect_success 'confuses pattern as remote when no remote specified' '
 	# Do not expect "git ls-remote <pattern>" to work; ls-remote needs
 	# <remote> if you want to feed <pattern>, just like you cannot say
 	# fetch <branch>.
-	# We could just as easily have used "master"; the "*" emphasizes its
+	# We could just as easily have used "main"; the "*" emphasizes its
 	# role as a pattern.
 	test_must_fail git ls-remote "$does_not_exist" >actual 2>&1 &&
 	test_i18ncmp exp actual
@@ -217,14 +217,14 @@ test_expect_success 'protocol v2 supports hiderefs' '
 
 test_expect_success 'ls-remote --symref' '
 	git fetch origin &&
-	echo "ref: refs/heads/master	HEAD" >expect &&
+	echo "ref: refs/heads/main	HEAD" >expect &&
 	generate_references \
 		HEAD \
-		refs/heads/master >>expect &&
+		refs/heads/main >>expect &&
 	oid=$(git rev-parse HEAD) &&
 	echo "$oid	refs/remotes/origin/HEAD" >>expect &&
 	generate_references \
-		refs/remotes/origin/master \
+		refs/remotes/origin/main \
 		refs/tags/mark \
 		refs/tags/mark1.1 \
 		refs/tags/mark1.10 \
@@ -238,7 +238,7 @@ test_expect_success 'ls-remote --symref' '
 test_expect_success 'ls-remote with filtered symref (refname)' '
 	rev=$(git rev-parse HEAD) &&
 	cat >expect <<-EOF &&
-	ref: refs/heads/master	HEAD
+	ref: refs/heads/main	HEAD
 	$rev	HEAD
 	EOF
 	# Protocol v2 supports sending symrefs for refs other than HEAD, so use
@@ -252,7 +252,7 @@ test_expect_failure 'ls-remote with filtered symref (--heads)' '
 	cat >expect <<-EOF &&
 	ref: refs/tags/mark	refs/heads/foo
 	$rev	refs/heads/foo
-	$rev	refs/heads/master
+	$rev	refs/heads/main
 	EOF
 	# Protocol v2 supports sending symrefs for refs other than HEAD, so use
 	# protocol v0 here.
@@ -263,7 +263,7 @@ test_expect_failure 'ls-remote with filtered symref (--heads)' '
 test_expect_success 'ls-remote --symref omits filtered-out matches' '
 	cat >expect <<-EOF &&
 	$rev	refs/heads/foo
-	$rev	refs/heads/master
+	$rev	refs/heads/main
 	EOF
 	# Protocol v2 supports sending symrefs for refs other than HEAD, so use
 	# protocol v0 here.
@@ -330,10 +330,10 @@ test_expect_success 'ls-remote --sort fails gracefully outside repository' '
 
 test_expect_success 'ls-remote patterns work with all protocol versions' '
 	git for-each-ref --format="%(objectname)	%(refname)" \
-		refs/heads/master refs/remotes/origin/master >expect &&
-	git -c protocol.version=1 ls-remote . master >actual.v1 &&
+		refs/heads/main refs/remotes/origin/main >expect &&
+	git -c protocol.version=1 ls-remote . main >actual.v1 &&
 	test_cmp expect actual.v1 &&
-	git -c protocol.version=2 ls-remote . master >actual.v2 &&
+	git -c protocol.version=2 ls-remote . main >actual.v2 &&
 	test_cmp expect actual.v2
 '
 
diff --git a/t/t5514-fetch-multiple.sh b/t/t5514-fetch-multiple.sh
index bd202ec6f3..1b0560f901 100755
--- a/t/t5514-fetch-multiple.sh
+++ b/t/t5514-fetch-multiple.sh
@@ -17,7 +17,7 @@ setup_repository () {
 	git add elif &&
 	test_tick &&
 	git commit -m "Second" &&
-	git checkout master
+	git checkout main
 	)
 }
 
@@ -32,16 +32,16 @@ test_expect_success setup '
 '
 
 cat > test/expect << EOF
-  one/master
+  one/main
   one/side
-  origin/HEAD -> origin/master
-  origin/master
+  origin/HEAD -> origin/main
+  origin/main
   origin/side
   three/another
-  three/master
+  three/main
   three/side
   two/another
-  two/master
+  two/main
   two/side
 EOF
 
@@ -70,15 +70,15 @@ test_expect_success 'git fetch --all should continue if a remote has errors' '
 test_expect_success 'git fetch --all does not allow non-option arguments' '
 	(cd test &&
 	 test_must_fail git fetch --all origin &&
-	 test_must_fail git fetch --all origin master)
+	 test_must_fail git fetch --all origin main)
 '
 
 cat > expect << EOF
-  origin/HEAD -> origin/master
-  origin/master
+  origin/HEAD -> origin/main
+  origin/main
   origin/side
   three/another
-  three/master
+  three/main
   three/side
 EOF
 
@@ -92,10 +92,10 @@ test_expect_success 'git fetch --multiple (but only one remote)' '
 '
 
 cat > expect << EOF
-  one/master
+  one/main
   one/side
   two/another
-  two/master
+  two/main
   two/side
 EOF
 
@@ -133,13 +133,13 @@ test_expect_success 'git fetch --all (skipFetchAll)' '
 '
 
 cat > expect << EOF
-  one/master
+  one/main
   one/side
   three/another
-  three/master
+  three/main
   three/side
   two/another
-  two/master
+  two/main
   two/side
 EOF
 
diff --git a/t/t5516-fetch-push.sh b/t/t5516-fetch-push.sh
index d11382f769..522cee7aa6 100755
--- a/t/t5516-fetch-push.sh
+++ b/t/t5516-fetch-push.sh
@@ -120,13 +120,13 @@ test_expect_success setup '
 	git add path1 &&
 	test_tick &&
 	git commit -a -m repo &&
-	the_first_commit=$(git show-ref -s --verify refs/heads/master) &&
+	the_first_commit=$(git show-ref -s --verify refs/heads/main) &&
 
 	>path2 &&
 	git add path2 &&
 	test_tick &&
 	git commit -a -m second &&
-	the_commit=$(git show-ref -s --verify refs/heads/master)
+	the_commit=$(git show-ref -s --verify refs/heads/main)
 
 '
 
@@ -134,9 +134,9 @@ test_expect_success 'fetch without wildcard' '
 	mk_empty testrepo &&
 	(
 		cd testrepo &&
-		git fetch .. refs/heads/master:refs/remotes/origin/master &&
+		git fetch .. refs/heads/main:refs/remotes/origin/main &&
 
-		echo "$the_commit commit	refs/remotes/origin/master" >expect &&
+		echo "$the_commit commit	refs/remotes/origin/main" >expect &&
 		git for-each-ref refs/remotes/origin >actual &&
 		test_cmp expect actual
 	)
@@ -150,7 +150,7 @@ test_expect_success 'fetch with wildcard' '
 		git config remote.up.fetch "refs/heads/*:refs/remotes/origin/*" &&
 		git fetch up &&
 
-		echo "$the_commit commit	refs/remotes/origin/master" >expect &&
+		echo "$the_commit commit	refs/remotes/origin/main" >expect &&
 		git for-each-ref refs/remotes/origin >actual &&
 		test_cmp expect actual
 	)
@@ -166,7 +166,7 @@ test_expect_success 'fetch with insteadOf' '
 		git config remote.up.fetch "refs/heads/*:refs/remotes/origin/*" &&
 		git fetch up &&
 
-		echo "$the_commit commit	refs/remotes/origin/master" >expect &&
+		echo "$the_commit commit	refs/remotes/origin/main" >expect &&
 		git for-each-ref refs/remotes/origin >actual &&
 		test_cmp expect actual
 	)
@@ -182,7 +182,7 @@ test_expect_success 'fetch with pushInsteadOf (should not rewrite)' '
 		git config remote.up.fetch "refs/heads/*:refs/remotes/origin/*" &&
 		git fetch up &&
 
-		echo "$the_commit commit	refs/remotes/origin/master" >expect &&
+		echo "$the_commit commit	refs/remotes/origin/main" >expect &&
 		git for-each-ref refs/remotes/origin >actual &&
 		test_cmp expect actual
 	)
@@ -191,10 +191,10 @@ test_expect_success 'fetch with pushInsteadOf (should not rewrite)' '
 test_expect_success 'push without wildcard' '
 	mk_empty testrepo &&
 
-	git push testrepo refs/heads/master:refs/remotes/origin/master &&
+	git push testrepo refs/heads/main:refs/remotes/origin/main &&
 	(
 		cd testrepo &&
-		echo "$the_commit commit	refs/remotes/origin/master" >expect &&
+		echo "$the_commit commit	refs/remotes/origin/main" >expect &&
 		git for-each-ref refs/remotes/origin >actual &&
 		test_cmp expect actual
 	)
@@ -206,7 +206,7 @@ test_expect_success 'push with wildcard' '
 	git push testrepo "refs/heads/*:refs/remotes/origin/*" &&
 	(
 		cd testrepo &&
-		echo "$the_commit commit	refs/remotes/origin/master" >expect &&
+		echo "$the_commit commit	refs/remotes/origin/main" >expect &&
 		git for-each-ref refs/remotes/origin >actual &&
 		test_cmp expect actual
 	)
@@ -216,10 +216,10 @@ test_expect_success 'push with insteadOf' '
 	mk_empty testrepo &&
 	TRASH="$(pwd)/" &&
 	test_config "url.$TRASH.insteadOf" trash/ &&
-	git push trash/testrepo refs/heads/master:refs/remotes/origin/master &&
+	git push trash/testrepo refs/heads/main:refs/remotes/origin/main &&
 	(
 		cd testrepo &&
-		echo "$the_commit commit	refs/remotes/origin/master" >expect &&
+		echo "$the_commit commit	refs/remotes/origin/main" >expect &&
 		git for-each-ref refs/remotes/origin >actual &&
 		test_cmp expect actual
 	)
@@ -229,10 +229,10 @@ test_expect_success 'push with pushInsteadOf' '
 	mk_empty testrepo &&
 	TRASH="$(pwd)/" &&
 	test_config "url.$TRASH.pushInsteadOf" trash/ &&
-	git push trash/testrepo refs/heads/master:refs/remotes/origin/master &&
+	git push trash/testrepo refs/heads/main:refs/remotes/origin/main &&
 	(
 		cd testrepo &&
-		echo "$the_commit commit	refs/remotes/origin/master" >expect &&
+		echo "$the_commit commit	refs/remotes/origin/main" >expect &&
 		git for-each-ref refs/remotes/origin >actual &&
 		test_cmp expect actual
 	)
@@ -244,10 +244,10 @@ test_expect_success 'push with pushInsteadOf and explicit pushurl (pushInsteadOf
 	test_config "url.trash3/.pushInsteadOf" trash/wrong &&
 	test_config remote.r.url trash/wrong &&
 	test_config remote.r.pushurl "testrepo/" &&
-	git push r refs/heads/master:refs/remotes/origin/master &&
+	git push r refs/heads/main:refs/remotes/origin/main &&
 	(
 		cd testrepo &&
-		echo "$the_commit commit	refs/remotes/origin/master" >expect &&
+		echo "$the_commit commit	refs/remotes/origin/main" >expect &&
 		git for-each-ref refs/remotes/origin >actual &&
 		test_cmp expect actual
 	)
@@ -255,101 +255,101 @@ test_expect_success 'push with pushInsteadOf and explicit pushurl (pushInsteadOf
 
 test_expect_success 'push with matching heads' '
 
-	mk_test testrepo heads/master &&
+	mk_test testrepo heads/main &&
 	git push testrepo : &&
-	check_push_result testrepo $the_commit heads/master
+	check_push_result testrepo $the_commit heads/main
 
 '
 
 test_expect_success 'push with matching heads on the command line' '
 
-	mk_test testrepo heads/master &&
+	mk_test testrepo heads/main &&
 	git push testrepo : &&
-	check_push_result testrepo $the_commit heads/master
+	check_push_result testrepo $the_commit heads/main
 
 '
 
 test_expect_success 'failed (non-fast-forward) push with matching heads' '
 
-	mk_test testrepo heads/master &&
+	mk_test testrepo heads/main &&
 	git push testrepo : &&
 	git commit --amend -massaged &&
 	test_must_fail git push testrepo &&
-	check_push_result testrepo $the_commit heads/master &&
+	check_push_result testrepo $the_commit heads/main &&
 	git reset --hard $the_commit
 
 '
 
 test_expect_success 'push --force with matching heads' '
 
-	mk_test testrepo heads/master &&
+	mk_test testrepo heads/main &&
 	git push testrepo : &&
 	git commit --amend -massaged &&
 	git push --force testrepo : &&
-	! check_push_result testrepo $the_commit heads/master &&
+	! check_push_result testrepo $the_commit heads/main &&
 	git reset --hard $the_commit
 
 '
 
 test_expect_success 'push with matching heads and forced update' '
 
-	mk_test testrepo heads/master &&
+	mk_test testrepo heads/main &&
 	git push testrepo : &&
 	git commit --amend -massaged &&
 	git push testrepo +: &&
-	! check_push_result testrepo $the_commit heads/master &&
+	! check_push_result testrepo $the_commit heads/main &&
 	git reset --hard $the_commit
 
 '
 
 test_expect_success 'push with no ambiguity (1)' '
 
-	mk_test testrepo heads/master &&
-	git push testrepo master:master &&
-	check_push_result testrepo $the_commit heads/master
+	mk_test testrepo heads/main &&
+	git push testrepo main:main &&
+	check_push_result testrepo $the_commit heads/main
 
 '
 
 test_expect_success 'push with no ambiguity (2)' '
 
-	mk_test testrepo remotes/origin/master &&
-	git push testrepo master:origin/master &&
-	check_push_result testrepo $the_commit remotes/origin/master
+	mk_test testrepo remotes/origin/main &&
+	git push testrepo main:origin/main &&
+	check_push_result testrepo $the_commit remotes/origin/main
 
 '
 
 test_expect_success 'push with colon-less refspec, no ambiguity' '
 
-	mk_test testrepo heads/master heads/t/master &&
-	git branch -f t/master master &&
-	git push testrepo master &&
-	check_push_result testrepo $the_commit heads/master &&
-	check_push_result testrepo $the_first_commit heads/t/master
+	mk_test testrepo heads/main heads/t/main &&
+	git branch -f t/main main &&
+	git push testrepo main &&
+	check_push_result testrepo $the_commit heads/main &&
+	check_push_result testrepo $the_first_commit heads/t/main
 
 '
 
 test_expect_success 'push with weak ambiguity (1)' '
 
-	mk_test testrepo heads/master remotes/origin/master &&
-	git push testrepo master:master &&
-	check_push_result testrepo $the_commit heads/master &&
-	check_push_result testrepo $the_first_commit remotes/origin/master
+	mk_test testrepo heads/main remotes/origin/main &&
+	git push testrepo main:main &&
+	check_push_result testrepo $the_commit heads/main &&
+	check_push_result testrepo $the_first_commit remotes/origin/main
 
 '
 
 test_expect_success 'push with weak ambiguity (2)' '
 
-	mk_test testrepo heads/master remotes/origin/master remotes/another/master &&
-	git push testrepo master:master &&
-	check_push_result testrepo $the_commit heads/master &&
-	check_push_result testrepo $the_first_commit remotes/origin/master remotes/another/master
+	mk_test testrepo heads/main remotes/origin/main remotes/another/main &&
+	git push testrepo main:main &&
+	check_push_result testrepo $the_commit heads/main &&
+	check_push_result testrepo $the_first_commit remotes/origin/main remotes/another/main
 
 '
 
 test_expect_success 'push with ambiguity' '
 
 	mk_test testrepo heads/frotz tags/frotz &&
-	test_must_fail git push testrepo master:frotz &&
+	test_must_fail git push testrepo main:frotz &&
 	check_push_result testrepo $the_first_commit heads/frotz tags/frotz
 
 '
@@ -357,7 +357,7 @@ test_expect_success 'push with ambiguity' '
 test_expect_success 'push with colon-less refspec (1)' '
 
 	mk_test testrepo heads/frotz tags/frotz &&
-	git branch -f frotz master &&
+	git branch -f frotz main &&
 	git push testrepo frotz &&
 	check_push_result testrepo $the_commit heads/frotz &&
 	check_push_result testrepo $the_first_commit tags/frotz
@@ -385,7 +385,7 @@ test_expect_success 'push with colon-less refspec (3)' '
 	then
 		git tag -d frotz
 	fi &&
-	git branch -f frotz master &&
+	git branch -f frotz main &&
 	git push testrepo frotz &&
 	check_push_result testrepo $the_commit heads/frotz &&
 	test 1 = $( cd testrepo && git show-ref | wc -l )
@@ -408,7 +408,7 @@ test_expect_success 'push with colon-less refspec (4)' '
 test_expect_success 'push head with non-existent, incomplete dest' '
 
 	mk_test testrepo &&
-	git push testrepo master:branch &&
+	git push testrepo main:branch &&
 	check_push_result testrepo $the_commit heads/branch
 
 '
@@ -425,42 +425,42 @@ test_expect_success 'push tag with non-existent, incomplete dest' '
 test_expect_success 'push sha1 with non-existent, incomplete dest' '
 
 	mk_test testrepo &&
-	test_must_fail git push testrepo $(git rev-parse master):foo
+	test_must_fail git push testrepo $(git rev-parse main):foo
 
 '
 
 test_expect_success 'push ref expression with non-existent, incomplete dest' '
 
 	mk_test testrepo &&
-	test_must_fail git push testrepo master^:branch
+	test_must_fail git push testrepo main^:branch
 
 '
 
 test_expect_success 'push with HEAD' '
 
-	mk_test testrepo heads/master &&
-	git checkout master &&
+	mk_test testrepo heads/main &&
+	git checkout main &&
 	git push testrepo HEAD &&
-	check_push_result testrepo $the_commit heads/master
+	check_push_result testrepo $the_commit heads/main
 
 '
 
 test_expect_success 'push with HEAD nonexisting at remote' '
 
-	mk_test testrepo heads/master &&
-	git checkout -b local master &&
+	mk_test testrepo heads/main &&
+	git checkout -b local main &&
 	git push testrepo HEAD &&
 	check_push_result testrepo $the_commit heads/local
 '
 
 test_expect_success 'push with +HEAD' '
 
-	mk_test testrepo heads/master &&
-	git checkout master &&
+	mk_test testrepo heads/main &&
+	git checkout main &&
 	git branch -D local &&
 	git checkout -b local &&
-	git push testrepo master local &&
-	check_push_result testrepo $the_commit heads/master &&
+	git push testrepo main local &&
+	check_push_result testrepo $the_commit heads/main &&
 	check_push_result testrepo $the_commit heads/local &&
 
 	# Without force rewinding should fail
@@ -477,7 +477,7 @@ test_expect_success 'push with +HEAD' '
 test_expect_success 'push HEAD with non-existent, incomplete dest' '
 
 	mk_test testrepo &&
-	git checkout master &&
+	git checkout main &&
 	git push testrepo HEAD:branch &&
 	check_push_result testrepo $the_commit heads/branch
 
@@ -486,7 +486,7 @@ test_expect_success 'push HEAD with non-existent, incomplete dest' '
 test_expect_success 'push with config remote.*.push = HEAD' '
 
 	mk_test testrepo heads/local &&
-	git checkout master &&
+	git checkout main &&
 	git branch -f local $the_commit &&
 	(
 		cd testrepo &&
@@ -495,166 +495,166 @@ test_expect_success 'push with config remote.*.push = HEAD' '
 	) &&
 	test_config remote.there.url testrepo &&
 	test_config remote.there.push HEAD &&
-	test_config branch.master.remote there &&
+	test_config branch.main.remote there &&
 	git push &&
-	check_push_result testrepo $the_commit heads/master &&
+	check_push_result testrepo $the_commit heads/main &&
 	check_push_result testrepo $the_first_commit heads/local
 '
 
 test_expect_success 'push with remote.pushdefault' '
-	mk_test up_repo heads/master &&
-	mk_test down_repo heads/master &&
+	mk_test up_repo heads/main &&
+	mk_test down_repo heads/main &&
 	test_config remote.up.url up_repo &&
 	test_config remote.down.url down_repo &&
-	test_config branch.master.remote up &&
+	test_config branch.main.remote up &&
 	test_config remote.pushdefault down &&
 	test_config push.default matching &&
 	git push &&
-	check_push_result up_repo $the_first_commit heads/master &&
-	check_push_result down_repo $the_commit heads/master
+	check_push_result up_repo $the_first_commit heads/main &&
+	check_push_result down_repo $the_commit heads/main
 '
 
 test_expect_success 'push with config remote.*.pushurl' '
 
-	mk_test testrepo heads/master &&
-	git checkout master &&
+	mk_test testrepo heads/main &&
+	git checkout main &&
 	test_config remote.there.url test2repo &&
 	test_config remote.there.pushurl testrepo &&
 	git push there : &&
-	check_push_result testrepo $the_commit heads/master
+	check_push_result testrepo $the_commit heads/main
 '
 
 test_expect_success 'push with config branch.*.pushremote' '
-	mk_test up_repo heads/master &&
-	mk_test side_repo heads/master &&
-	mk_test down_repo heads/master &&
+	mk_test up_repo heads/main &&
+	mk_test side_repo heads/main &&
+	mk_test down_repo heads/main &&
 	test_config remote.up.url up_repo &&
 	test_config remote.pushdefault side_repo &&
 	test_config remote.down.url down_repo &&
-	test_config branch.master.remote up &&
-	test_config branch.master.pushremote down &&
+	test_config branch.main.remote up &&
+	test_config branch.main.pushremote down &&
 	test_config push.default matching &&
 	git push &&
-	check_push_result up_repo $the_first_commit heads/master &&
-	check_push_result side_repo $the_first_commit heads/master &&
-	check_push_result down_repo $the_commit heads/master
+	check_push_result up_repo $the_first_commit heads/main &&
+	check_push_result side_repo $the_first_commit heads/main &&
+	check_push_result down_repo $the_commit heads/main
 '
 
 test_expect_success 'branch.*.pushremote config order is irrelevant' '
-	mk_test one_repo heads/master &&
-	mk_test two_repo heads/master &&
+	mk_test one_repo heads/main &&
+	mk_test two_repo heads/main &&
 	test_config remote.one.url one_repo &&
 	test_config remote.two.url two_repo &&
-	test_config branch.master.pushremote two_repo &&
+	test_config branch.main.pushremote two_repo &&
 	test_config remote.pushdefault one_repo &&
 	test_config push.default matching &&
 	git push &&
-	check_push_result one_repo $the_first_commit heads/master &&
-	check_push_result two_repo $the_commit heads/master
+	check_push_result one_repo $the_first_commit heads/main &&
+	check_push_result two_repo $the_commit heads/main
 '
 
 test_expect_success 'push with dry-run' '
 
-	mk_test testrepo heads/master &&
-	old_commit=$(git -C testrepo show-ref -s --verify refs/heads/master) &&
+	mk_test testrepo heads/main &&
+	old_commit=$(git -C testrepo show-ref -s --verify refs/heads/main) &&
 	git push --dry-run testrepo : &&
-	check_push_result testrepo $old_commit heads/master
+	check_push_result testrepo $old_commit heads/main
 '
 
 test_expect_success 'push updates local refs' '
 
-	mk_test testrepo heads/master &&
+	mk_test testrepo heads/main &&
 	mk_child testrepo child &&
 	(
 		cd child &&
-		git pull .. master &&
+		git pull .. main &&
 		git push &&
-		test $(git rev-parse master) = \
-			$(git rev-parse remotes/origin/master)
+		test $(git rev-parse main) = \
+			$(git rev-parse remotes/origin/main)
 	)
 
 '
 
 test_expect_success 'push updates up-to-date local refs' '
 
-	mk_test testrepo heads/master &&
+	mk_test testrepo heads/main &&
 	mk_child testrepo child1 &&
 	mk_child testrepo child2 &&
-	(cd child1 && git pull .. master && git push) &&
+	(cd child1 && git pull .. main && git push) &&
 	(
 		cd child2 &&
-		git pull ../child1 master &&
+		git pull ../child1 main &&
 		git push &&
-		test $(git rev-parse master) = \
-			$(git rev-parse remotes/origin/master)
+		test $(git rev-parse main) = \
+			$(git rev-parse remotes/origin/main)
 	)
 
 '
 
 test_expect_success 'push preserves up-to-date packed refs' '
 
-	mk_test testrepo heads/master &&
+	mk_test testrepo heads/main &&
 	mk_child testrepo child &&
 	(
 		cd child &&
 		git push &&
-		! test -f .git/refs/remotes/origin/master
+		! test -f .git/refs/remotes/origin/main
 	)
 
 '
 
 test_expect_success 'push does not update local refs on failure' '
 
-	mk_test testrepo heads/master &&
+	mk_test testrepo heads/main &&
 	mk_child testrepo child &&
 	mkdir testrepo/.git/hooks &&
 	echo "#!/no/frobnication/today" >testrepo/.git/hooks/pre-receive &&
 	chmod +x testrepo/.git/hooks/pre-receive &&
 	(
 		cd child &&
-		git pull .. master &&
+		git pull .. main &&
 		test_must_fail git push &&
-		test $(git rev-parse master) != \
-			$(git rev-parse remotes/origin/master)
+		test $(git rev-parse main) != \
+			$(git rev-parse remotes/origin/main)
 	)
 
 '
 
 test_expect_success 'allow deleting an invalid remote ref' '
 
-	mk_test testrepo heads/master &&
+	mk_test testrepo heads/main &&
 	rm -f testrepo/.git/objects/??/* &&
-	git push testrepo :refs/heads/master &&
-	(cd testrepo && test_must_fail git rev-parse --verify refs/heads/master)
+	git push testrepo :refs/heads/main &&
+	(cd testrepo && test_must_fail git rev-parse --verify refs/heads/main)
 
 '
 
 test_expect_success 'pushing valid refs triggers post-receive and post-update hooks' '
-	mk_test_with_hooks testrepo heads/master heads/next &&
-	orgmaster=$(cd testrepo && git show-ref -s --verify refs/heads/master) &&
-	newmaster=$(git show-ref -s --verify refs/heads/master) &&
+	mk_test_with_hooks testrepo heads/main heads/next &&
+	orgmain=$(cd testrepo && git show-ref -s --verify refs/heads/main) &&
+	newmain=$(git show-ref -s --verify refs/heads/main) &&
 	orgnext=$(cd testrepo && git show-ref -s --verify refs/heads/next) &&
 	newnext=$ZERO_OID &&
-	git push testrepo refs/heads/master:refs/heads/master :refs/heads/next &&
+	git push testrepo refs/heads/main:refs/heads/main :refs/heads/next &&
 	(
 		cd testrepo/.git &&
 		cat >pre-receive.expect <<-EOF &&
-		$orgmaster $newmaster refs/heads/master
+		$orgmain $newmain refs/heads/main
 		$orgnext $newnext refs/heads/next
 		EOF
 
 		cat >update.expect <<-EOF &&
-		refs/heads/master $orgmaster $newmaster
+		refs/heads/main $orgmain $newmain
 		refs/heads/next $orgnext $newnext
 		EOF
 
 		cat >post-receive.expect <<-EOF &&
-		$orgmaster $newmaster refs/heads/master
+		$orgmain $newmain refs/heads/main
 		$orgnext $newnext refs/heads/next
 		EOF
 
 		cat >post-update.expect <<-EOF &&
-		refs/heads/master
+		refs/heads/main
 		refs/heads/next
 		EOF
 
@@ -666,25 +666,25 @@ test_expect_success 'pushing valid refs triggers post-receive and post-update ho
 '
 
 test_expect_success 'deleting dangling ref triggers hooks with correct args' '
-	mk_test_with_hooks testrepo heads/master &&
+	mk_test_with_hooks testrepo heads/main &&
 	rm -f testrepo/.git/objects/??/* &&
-	git push testrepo :refs/heads/master &&
+	git push testrepo :refs/heads/main &&
 	(
 		cd testrepo/.git &&
 		cat >pre-receive.expect <<-EOF &&
-		$ZERO_OID $ZERO_OID refs/heads/master
+		$ZERO_OID $ZERO_OID refs/heads/main
 		EOF
 
 		cat >update.expect <<-EOF &&
-		refs/heads/master $ZERO_OID $ZERO_OID
+		refs/heads/main $ZERO_OID $ZERO_OID
 		EOF
 
 		cat >post-receive.expect <<-EOF &&
-		$ZERO_OID $ZERO_OID refs/heads/master
+		$ZERO_OID $ZERO_OID refs/heads/main
 		EOF
 
 		cat >post-update.expect <<-EOF &&
-		refs/heads/master
+		refs/heads/main
 		EOF
 
 		test_cmp pre-receive.expect pre-receive.actual &&
@@ -695,28 +695,28 @@ test_expect_success 'deleting dangling ref triggers hooks with correct args' '
 '
 
 test_expect_success 'deletion of a non-existent ref is not fed to post-receive and post-update hooks' '
-	mk_test_with_hooks testrepo heads/master &&
-	orgmaster=$(cd testrepo && git show-ref -s --verify refs/heads/master) &&
-	newmaster=$(git show-ref -s --verify refs/heads/master) &&
-	git push testrepo master :refs/heads/nonexistent &&
+	mk_test_with_hooks testrepo heads/main &&
+	orgmain=$(cd testrepo && git show-ref -s --verify refs/heads/main) &&
+	newmain=$(git show-ref -s --verify refs/heads/main) &&
+	git push testrepo main :refs/heads/nonexistent &&
 	(
 		cd testrepo/.git &&
 		cat >pre-receive.expect <<-EOF &&
-		$orgmaster $newmaster refs/heads/master
+		$orgmain $newmain refs/heads/main
 		$ZERO_OID $ZERO_OID refs/heads/nonexistent
 		EOF
 
 		cat >update.expect <<-EOF &&
-		refs/heads/master $orgmaster $newmaster
+		refs/heads/main $orgmain $newmain
 		refs/heads/nonexistent $ZERO_OID $ZERO_OID
 		EOF
 
 		cat >post-receive.expect <<-EOF &&
-		$orgmaster $newmaster refs/heads/master
+		$orgmain $newmain refs/heads/main
 		EOF
 
 		cat >post-update.expect <<-EOF &&
-		refs/heads/master
+		refs/heads/main
 		EOF
 
 		test_cmp pre-receive.expect pre-receive.actual &&
@@ -727,7 +727,7 @@ test_expect_success 'deletion of a non-existent ref is not fed to post-receive a
 '
 
 test_expect_success 'deletion of a non-existent ref alone does trigger post-receive and post-update hooks' '
-	mk_test_with_hooks testrepo heads/master &&
+	mk_test_with_hooks testrepo heads/main &&
 	git push testrepo :refs/heads/nonexistent &&
 	(
 		cd testrepo/.git &&
@@ -747,40 +747,40 @@ test_expect_success 'deletion of a non-existent ref alone does trigger post-rece
 '
 
 test_expect_success 'mixed ref updates, deletes, invalid deletes trigger hooks with correct input' '
-	mk_test_with_hooks testrepo heads/master heads/next heads/seen &&
-	orgmaster=$(cd testrepo && git show-ref -s --verify refs/heads/master) &&
-	newmaster=$(git show-ref -s --verify refs/heads/master) &&
+	mk_test_with_hooks testrepo heads/main heads/next heads/seen &&
+	orgmain=$(cd testrepo && git show-ref -s --verify refs/heads/main) &&
+	newmain=$(git show-ref -s --verify refs/heads/main) &&
 	orgnext=$(cd testrepo && git show-ref -s --verify refs/heads/next) &&
 	newnext=$ZERO_OID &&
 	orgseen=$(cd testrepo && git show-ref -s --verify refs/heads/seen) &&
-	newseen=$(git show-ref -s --verify refs/heads/master) &&
-	git push testrepo refs/heads/master:refs/heads/master \
-	    refs/heads/master:refs/heads/seen :refs/heads/next \
+	newseen=$(git show-ref -s --verify refs/heads/main) &&
+	git push testrepo refs/heads/main:refs/heads/main \
+	    refs/heads/main:refs/heads/seen :refs/heads/next \
 	    :refs/heads/nonexistent &&
 	(
 		cd testrepo/.git &&
 		cat >pre-receive.expect <<-EOF &&
-		$orgmaster $newmaster refs/heads/master
+		$orgmain $newmain refs/heads/main
 		$orgnext $newnext refs/heads/next
 		$orgseen $newseen refs/heads/seen
 		$ZERO_OID $ZERO_OID refs/heads/nonexistent
 		EOF
 
 		cat >update.expect <<-EOF &&
-		refs/heads/master $orgmaster $newmaster
+		refs/heads/main $orgmain $newmain
 		refs/heads/next $orgnext $newnext
 		refs/heads/seen $orgseen $newseen
 		refs/heads/nonexistent $ZERO_OID $ZERO_OID
 		EOF
 
 		cat >post-receive.expect <<-EOF &&
-		$orgmaster $newmaster refs/heads/master
+		$orgmain $newmain refs/heads/main
 		$orgnext $newnext refs/heads/next
 		$orgseen $newseen refs/heads/seen
 		EOF
 
 		cat >post-update.expect <<-EOF &&
-		refs/heads/master
+		refs/heads/main
 		refs/heads/next
 		refs/heads/seen
 		EOF
@@ -793,15 +793,15 @@ test_expect_success 'mixed ref updates, deletes, invalid deletes trigger hooks w
 '
 
 test_expect_success 'allow deleting a ref using --delete' '
-	mk_test testrepo heads/master &&
+	mk_test testrepo heads/main &&
 	(cd testrepo && git config receive.denyDeleteCurrent warn) &&
-	git push testrepo --delete master &&
-	(cd testrepo && test_must_fail git rev-parse --verify refs/heads/master)
+	git push testrepo --delete main &&
+	(cd testrepo && test_must_fail git rev-parse --verify refs/heads/main)
 '
 
 test_expect_success 'allow deleting a tag using --delete' '
-	mk_test testrepo heads/master &&
-	git tag -a -m dummy_message deltag heads/master &&
+	mk_test testrepo heads/main &&
+	git tag -a -m dummy_message deltag heads/main &&
 	git push testrepo --tags &&
 	(cd testrepo && git rev-parse --verify -q refs/tags/deltag) &&
 	git push testrepo --delete tag deltag &&
@@ -809,56 +809,56 @@ test_expect_success 'allow deleting a tag using --delete' '
 '
 
 test_expect_success 'push --delete without args aborts' '
-	mk_test testrepo heads/master &&
+	mk_test testrepo heads/main &&
 	test_must_fail git push testrepo --delete
 '
 
 test_expect_success 'push --delete refuses src:dest refspecs' '
-	mk_test testrepo heads/master &&
-	test_must_fail git push testrepo --delete master:foo
+	mk_test testrepo heads/main &&
+	test_must_fail git push testrepo --delete main:foo
 '
 
 test_expect_success 'warn on push to HEAD of non-bare repository' '
-	mk_test testrepo heads/master &&
+	mk_test testrepo heads/main &&
 	(
 		cd testrepo &&
-		git checkout master &&
+		git checkout main &&
 		git config receive.denyCurrentBranch warn
 	) &&
-	git push testrepo master 2>stderr &&
+	git push testrepo main 2>stderr &&
 	grep "warning: updating the current branch" stderr
 '
 
 test_expect_success 'deny push to HEAD of non-bare repository' '
-	mk_test testrepo heads/master &&
+	mk_test testrepo heads/main &&
 	(
 		cd testrepo &&
-		git checkout master &&
+		git checkout main &&
 		git config receive.denyCurrentBranch true
 	) &&
-	test_must_fail git push testrepo master
+	test_must_fail git push testrepo main
 '
 
 test_expect_success 'allow push to HEAD of bare repository (bare)' '
-	mk_test testrepo heads/master &&
+	mk_test testrepo heads/main &&
 	(
 		cd testrepo &&
-		git checkout master &&
+		git checkout main &&
 		git config receive.denyCurrentBranch true &&
 		git config core.bare true
 	) &&
-	git push testrepo master 2>stderr &&
+	git push testrepo main 2>stderr &&
 	! grep "warning: updating the current branch" stderr
 '
 
 test_expect_success 'allow push to HEAD of non-bare repository (config)' '
-	mk_test testrepo heads/master &&
+	mk_test testrepo heads/main &&
 	(
 		cd testrepo &&
-		git checkout master &&
+		git checkout main &&
 		git config receive.denyCurrentBranch false
 	) &&
-	git push testrepo master 2>stderr &&
+	git push testrepo main 2>stderr &&
 	! grep "warning: updating the current branch" stderr
 '
 
@@ -874,7 +874,7 @@ test_expect_success 'fetch with branches' '
 		git for-each-ref refs/heads >actual &&
 		test_cmp expect actual
 	) &&
-	git checkout master
+	git checkout main
 '
 
 test_expect_success 'fetch with branches containing #' '
@@ -887,7 +887,7 @@ test_expect_success 'fetch with branches containing #' '
 		git for-each-ref refs/heads >actual &&
 		test_cmp expect actual
 	) &&
-	git checkout master
+	git checkout main
 '
 
 test_expect_success 'push with branches' '
@@ -897,7 +897,7 @@ test_expect_success 'push with branches' '
 	git push branch1 &&
 	(
 		cd testrepo &&
-		echo "$the_first_commit commit	refs/heads/master" >expect &&
+		echo "$the_first_commit commit	refs/heads/main" >expect &&
 		git for-each-ref refs/heads >actual &&
 		test_cmp expect actual
 	)
@@ -913,11 +913,11 @@ test_expect_success 'push with branches containing #' '
 		git for-each-ref refs/heads >actual &&
 		test_cmp expect actual
 	) &&
-	git checkout master
+	git checkout main
 '
 
 test_expect_success 'push into aliased refs (consistent)' '
-	mk_test testrepo heads/master &&
+	mk_test testrepo heads/main &&
 	mk_child testrepo child1 &&
 	mk_child testrepo child2 &&
 	(
@@ -939,7 +939,7 @@ test_expect_success 'push into aliased refs (consistent)' '
 '
 
 test_expect_success 'push into aliased refs (inconsistent)' '
-	mk_test testrepo heads/master &&
+	mk_test testrepo heads/main &&
 	mk_child testrepo child1 &&
 	mk_child testrepo child2 &&
 	(
@@ -970,7 +970,7 @@ test_force_push_tag () {
 	tag_args=$2
 
 	test_expect_success "force pushing required to update $tag_type_description" "
-		mk_test testrepo heads/master &&
+		mk_test testrepo heads/main &&
 		mk_child testrepo child1 &&
 		mk_child testrepo child2 &&
 		(
@@ -1016,7 +1016,7 @@ test_force_fetch_tag () {
 	tag_args=$2
 
 	test_expect_success "fetch will not clobber an existing $tag_type_description without --force" "
-		mk_test testrepo heads/master &&
+		mk_test testrepo heads/main &&
 		mk_child testrepo child1 &&
 		mk_child testrepo child2 &&
 		(
@@ -1039,12 +1039,12 @@ test_force_fetch_tag "annotated tag" "-f -a -m'tag message'"
 test_expect_success 'push --porcelain' '
 	mk_empty testrepo &&
 	echo >.git/foo  "To testrepo" &&
-	echo >>.git/foo "*	refs/heads/master:refs/remotes/origin/master	[new reference]"  &&
+	echo >>.git/foo "*	refs/heads/main:refs/remotes/origin/main	[new reference]"  &&
 	echo >>.git/foo "Done" &&
-	git push >.git/bar --porcelain  testrepo refs/heads/master:refs/remotes/origin/master &&
+	git push >.git/bar --porcelain  testrepo refs/heads/main:refs/remotes/origin/main &&
 	(
 		cd testrepo &&
-		echo "$the_commit commit	refs/remotes/origin/master" >expect &&
+		echo "$the_commit commit	refs/remotes/origin/main" >expect &&
 		git for-each-ref refs/remotes/origin >actual &&
 		test_cmp expect actual
 	) &&
@@ -1053,52 +1053,52 @@ test_expect_success 'push --porcelain' '
 
 test_expect_success 'push --porcelain bad url' '
 	mk_empty testrepo &&
-	test_must_fail git push >.git/bar --porcelain asdfasdfasd refs/heads/master:refs/remotes/origin/master &&
+	test_must_fail git push >.git/bar --porcelain asdfasdfasd refs/heads/main:refs/remotes/origin/main &&
 	! grep -q Done .git/bar
 '
 
 test_expect_success 'push --porcelain rejected' '
 	mk_empty testrepo &&
-	git push testrepo refs/heads/master:refs/remotes/origin/master &&
+	git push testrepo refs/heads/main:refs/remotes/origin/main &&
 	(cd testrepo &&
-		git reset --hard origin/master^ &&
+		git reset --hard origin/main^ &&
 		git config receive.denyCurrentBranch true) &&
 
 	echo >.git/foo  "To testrepo"  &&
-	echo >>.git/foo "!	refs/heads/master:refs/heads/master	[remote rejected] (branch is currently checked out)" &&
+	echo >>.git/foo "!	refs/heads/main:refs/heads/main	[remote rejected] (branch is currently checked out)" &&
 	echo >>.git/foo "Done" &&
 
-	test_must_fail git push >.git/bar --porcelain  testrepo refs/heads/master:refs/heads/master &&
+	test_must_fail git push >.git/bar --porcelain  testrepo refs/heads/main:refs/heads/main &&
 	test_cmp .git/foo .git/bar
 '
 
 test_expect_success 'push --porcelain --dry-run rejected' '
 	mk_empty testrepo &&
-	git push testrepo refs/heads/master:refs/remotes/origin/master &&
+	git push testrepo refs/heads/main:refs/remotes/origin/main &&
 	(cd testrepo &&
-		git reset --hard origin/master &&
+		git reset --hard origin/main &&
 		git config receive.denyCurrentBranch true) &&
 
 	echo >.git/foo  "To testrepo"  &&
-	echo >>.git/foo "!	refs/heads/master^:refs/heads/master	[rejected] (non-fast-forward)" &&
+	echo >>.git/foo "!	refs/heads/main^:refs/heads/main	[rejected] (non-fast-forward)" &&
 	echo >>.git/foo "Done" &&
 
-	test_must_fail git push >.git/bar --porcelain  --dry-run testrepo refs/heads/master^:refs/heads/master &&
+	test_must_fail git push >.git/bar --porcelain  --dry-run testrepo refs/heads/main^:refs/heads/main &&
 	test_cmp .git/foo .git/bar
 '
 
 test_expect_success 'push --prune' '
-	mk_test testrepo heads/master heads/second heads/foo heads/bar &&
+	mk_test testrepo heads/main heads/second heads/foo heads/bar &&
 	git push --prune testrepo : &&
-	check_push_result testrepo $the_commit heads/master &&
+	check_push_result testrepo $the_commit heads/main &&
 	check_push_result testrepo $the_first_commit heads/second &&
 	! check_push_result testrepo $the_first_commit heads/foo heads/bar
 '
 
 test_expect_success 'push --prune refspec' '
-	mk_test testrepo tmp/master tmp/second tmp/foo tmp/bar &&
+	mk_test testrepo tmp/main tmp/second tmp/foo tmp/bar &&
 	git push --prune testrepo "refs/heads/*:refs/tmp/*" &&
-	check_push_result testrepo $the_commit tmp/master &&
+	check_push_result testrepo $the_commit tmp/main &&
 	check_push_result testrepo $the_first_commit tmp/second &&
 	! check_push_result testrepo $the_first_commit tmp/foo tmp/bar
 '
@@ -1106,18 +1106,18 @@ test_expect_success 'push --prune refspec' '
 for configsection in transfer receive
 do
 	test_expect_success "push to update a ref hidden by $configsection.hiderefs" '
-		mk_test testrepo heads/master hidden/one hidden/two hidden/three &&
+		mk_test testrepo heads/main hidden/one hidden/two hidden/three &&
 		(
 			cd testrepo &&
 			git config $configsection.hiderefs refs/hidden
 		) &&
 
 		# push to unhidden ref succeeds normally
-		git push testrepo master:refs/heads/master &&
-		check_push_result testrepo $the_commit heads/master &&
+		git push testrepo main:refs/heads/main &&
+		check_push_result testrepo $the_commit heads/main &&
 
 		# push to update a hidden ref should fail
-		test_must_fail git push testrepo master:refs/hidden/one &&
+		test_must_fail git push testrepo main:refs/hidden/one &&
 		check_push_result testrepo $the_first_commit hidden/one &&
 
 		# push to delete a hidden ref should fail
@@ -1131,8 +1131,8 @@ do
 done
 
 test_expect_success 'fetch exact SHA1' '
-	mk_test testrepo heads/master hidden/one &&
-	git push testrepo master:refs/hidden/one &&
+	mk_test testrepo heads/main hidden/one &&
+	git push testrepo main:refs/hidden/one &&
 	(
 		cd testrepo &&
 		git config transfer.hiderefs refs/hidden
@@ -1163,7 +1163,7 @@ test_expect_success 'fetch exact SHA1' '
 			git config uploadpack.allowtipsha1inwant true
 		) &&
 
-		git fetch -v ../testrepo $the_commit:refs/heads/copy master:refs/heads/extra &&
+		git fetch -v ../testrepo $the_commit:refs/heads/copy main:refs/heads/extra &&
 		cat >expect <<-EOF &&
 		$the_commit
 		$the_first_commit
@@ -1177,8 +1177,8 @@ test_expect_success 'fetch exact SHA1' '
 '
 
 test_expect_success 'fetch exact SHA1 in protocol v2' '
-	mk_test testrepo heads/master hidden/one &&
-	git push testrepo master:refs/hidden/one &&
+	mk_test testrepo heads/main hidden/one &&
+	git push testrepo main:refs/hidden/one &&
 	git -C testrepo config transfer.hiderefs refs/hidden &&
 	check_push_result testrepo $the_commit hidden/one &&
 
@@ -1260,17 +1260,17 @@ do
 done
 
 test_expect_success 'fetch follows tags by default' '
-	mk_test testrepo heads/master &&
+	mk_test testrepo heads/main &&
 	rm -fr src dst &&
 	git init src &&
 	(
 		cd src &&
-		git pull ../testrepo master &&
+		git pull ../testrepo main &&
 		git tag -m "annotated" tag &&
 		git for-each-ref >tmp1 &&
 		(
 			cat tmp1
-			sed -n "s|refs/heads/master$|refs/remotes/origin/master|p" tmp1
+			sed -n "s|refs/heads/main$|refs/remotes/origin/main|p" tmp1
 		) |
 		sort -k 3 >../expect
 	) &&
@@ -1278,8 +1278,8 @@ test_expect_success 'fetch follows tags by default' '
 	(
 		cd dst &&
 		git remote add origin ../src &&
-		git config branch.master.remote origin &&
-		git config branch.master.merge refs/heads/master &&
+		git config branch.main.remote origin &&
+		git config branch.main.merge refs/heads/main &&
 		git pull &&
 		git for-each-ref >../actual
 	) &&
@@ -1298,74 +1298,74 @@ test_expect_success 'peeled advertisements are not considered ref tips' '
 '
 
 test_expect_success 'pushing a specific ref applies remote.$name.push as refmap' '
-	mk_test testrepo heads/master &&
+	mk_test testrepo heads/main &&
 	rm -fr src dst &&
 	git init src &&
 	git init --bare dst &&
 	(
 		cd src &&
-		git pull ../testrepo master &&
+		git pull ../testrepo main &&
 		git branch next &&
 		git config remote.dst.url ../dst &&
 		git config remote.dst.push "+refs/heads/*:refs/remotes/src/*" &&
-		git push dst master &&
-		git show-ref refs/heads/master |
+		git push dst main &&
+		git show-ref refs/heads/main |
 		sed -e "s|refs/heads/|refs/remotes/src/|" >../dst/expect
 	) &&
 	(
 		cd dst &&
 		test_must_fail git show-ref refs/heads/next &&
-		test_must_fail git show-ref refs/heads/master &&
-		git show-ref refs/remotes/src/master >actual
+		test_must_fail git show-ref refs/heads/main &&
+		git show-ref refs/remotes/src/main >actual
 	) &&
 	test_cmp dst/expect dst/actual
 '
 
 test_expect_success 'with no remote.$name.push, it is not used as refmap' '
-	mk_test testrepo heads/master &&
+	mk_test testrepo heads/main &&
 	rm -fr src dst &&
 	git init src &&
 	git init --bare dst &&
 	(
 		cd src &&
-		git pull ../testrepo master &&
+		git pull ../testrepo main &&
 		git branch next &&
 		git config remote.dst.url ../dst &&
 		git config push.default matching &&
-		git push dst master &&
-		git show-ref refs/heads/master >../dst/expect
+		git push dst main &&
+		git show-ref refs/heads/main >../dst/expect
 	) &&
 	(
 		cd dst &&
 		test_must_fail git show-ref refs/heads/next &&
-		git show-ref refs/heads/master >actual
+		git show-ref refs/heads/main >actual
 	) &&
 	test_cmp dst/expect dst/actual
 '
 
 test_expect_success 'with no remote.$name.push, upstream mapping is used' '
-	mk_test testrepo heads/master &&
+	mk_test testrepo heads/main &&
 	rm -fr src dst &&
 	git init src &&
 	git init --bare dst &&
 	(
 		cd src &&
-		git pull ../testrepo master &&
+		git pull ../testrepo main &&
 		git branch next &&
 		git config remote.dst.url ../dst &&
 		git config remote.dst.fetch "+refs/heads/*:refs/remotes/dst/*" &&
 		git config push.default upstream &&
 
-		git config branch.master.merge refs/heads/trunk &&
-		git config branch.master.remote dst &&
+		git config branch.main.merge refs/heads/trunk &&
+		git config branch.main.remote dst &&
 
-		git push dst master &&
-		git show-ref refs/heads/master |
-		sed -e "s|refs/heads/master|refs/heads/trunk|" >../dst/expect
+		git push dst main &&
+		git show-ref refs/heads/main |
+		sed -e "s|refs/heads/main|refs/heads/trunk|" >../dst/expect
 	) &&
 	(
 		cd dst &&
-		test_must_fail git show-ref refs/heads/master &&
+		test_must_fail git show-ref refs/heads/main &&
 		test_must_fail git show-ref refs/heads/next &&
 		git show-ref refs/heads/trunk >actual
 	) &&
@@ -1373,20 +1373,20 @@ test_expect_success 'with no remote.$name.push, upstream mapping is used' '
 '
 
 test_expect_success 'push does not follow tags by default' '
-	mk_test testrepo heads/master &&
+	mk_test testrepo heads/main &&
 	rm -fr src dst &&
 	git init src &&
 	git init --bare dst &&
 	(
 		cd src &&
-		git pull ../testrepo master &&
+		git pull ../testrepo main &&
 		git tag -m "annotated" tag &&
 		git checkout -b another &&
 		git commit --allow-empty -m "future commit" &&
 		git tag -m "future" future &&
-		git checkout master &&
-		git for-each-ref refs/heads/master >../expect &&
-		git push ../dst master
+		git checkout main &&
+		git for-each-ref refs/heads/main >../expect &&
+		git push ../dst main
 	) &&
 	(
 		cd dst &&
@@ -1396,20 +1396,20 @@ test_expect_success 'push does not follow tags by default' '
 '
 
 test_expect_success 'push --follow-tags only pushes relevant tags' '
-	mk_test testrepo heads/master &&
+	mk_test testrepo heads/main &&
 	rm -fr src dst &&
 	git init src &&
 	git init --bare dst &&
 	(
 		cd src &&
-		git pull ../testrepo master &&
+		git pull ../testrepo main &&
 		git tag -m "annotated" tag &&
 		git checkout -b another &&
 		git commit --allow-empty -m "future commit" &&
 		git tag -m "future" future &&
-		git checkout master &&
-		git for-each-ref refs/heads/master refs/tags/tag >../expect &&
-		git push --follow-tags ../dst master
+		git checkout main &&
+		git for-each-ref refs/heads/main refs/tags/tag >../expect &&
+		git push --follow-tags ../dst main
 	) &&
 	(
 		cd dst &&
@@ -1427,12 +1427,12 @@ EOF
 	git commit -am initial &&
 	git init no-thin &&
 	git --git-dir=no-thin/.git config receive.unpacklimit 0 &&
-	git push no-thin/.git refs/heads/master:refs/heads/foo &&
+	git push no-thin/.git refs/heads/main:refs/heads/foo &&
 	echo modified >> path1 &&
 	git commit -am modified &&
 	git repack -adf &&
 	rcvpck="git receive-pack --reject-thin-pack-for-testing" &&
-	git push --no-thin --receive-pack="$rcvpck" no-thin/.git refs/heads/master:refs/heads/foo
+	git push --no-thin --receive-pack="$rcvpck" no-thin/.git refs/heads/main:refs/heads/foo
 '
 
 test_expect_success 'pushing a tag pushes the tagged object' '
@@ -1455,12 +1455,12 @@ test_expect_success 'push into bare respects core.logallrefupdates' '
 
 	# double push to test both with and without
 	# the actual pack transfer
-	git push dst.git master:one &&
+	git push dst.git main:one &&
 	echo "one@{0} push" >expect &&
 	git -C dst.git log -g --format="%gd %gs" one >actual &&
 	test_cmp expect actual &&
 
-	git push dst.git master:two &&
+	git push dst.git main:two &&
 	echo "two@{0} push" >expect &&
 	git -C dst.git log -g --format="%gd %gs" two >actual &&
 	test_cmp expect actual
@@ -1475,20 +1475,20 @@ test_expect_success 'fetch into bare respects core.logallrefupdates' '
 
 		# as above, we double-fetch to test both
 		# with and without pack transfer
-		git fetch .. master:one &&
-		echo "one@{0} fetch .. master:one: storing head" >expect &&
+		git fetch .. main:one &&
+		echo "one@{0} fetch .. main:one: storing head" >expect &&
 		git log -g --format="%gd %gs" one >actual &&
 		test_cmp expect actual &&
 
-		git fetch .. master:two &&
-		echo "two@{0} fetch .. master:two: storing head" >expect &&
+		git fetch .. main:two &&
+		echo "two@{0} fetch .. main:two: storing head" >expect &&
 		git log -g --format="%gd %gs" two >actual &&
 		test_cmp expect actual
 	)
 '
 
 test_expect_success 'receive.denyCurrentBranch = updateInstead' '
-	git push testrepo master &&
+	git push testrepo main &&
 	(
 		cd testrepo &&
 		git reset --hard &&
@@ -1497,7 +1497,7 @@ test_expect_success 'receive.denyCurrentBranch = updateInstead' '
 	test_commit third path2 &&
 
 	# Try pushing into a repository with pristine working tree
-	git push testrepo master &&
+	git push testrepo main &&
 	(
 		cd testrepo &&
 		git update-index -q --refresh &&
@@ -1514,7 +1514,7 @@ test_expect_success 'receive.denyCurrentBranch = updateInstead' '
 		test $(git -C .. rev-parse HEAD^) = $(git rev-parse HEAD) &&
 		test-tool chmtime +100 path1
 	) &&
-	git push testrepo master &&
+	git push testrepo main &&
 	(
 		cd testrepo &&
 		git update-index -q --refresh &&
@@ -1534,7 +1534,7 @@ test_expect_success 'receive.denyCurrentBranch = updateInstead' '
 		cd testrepo &&
 		echo changed >path1
 	) &&
-	test_must_fail git push testrepo master &&
+	test_must_fail git push testrepo main &&
 	(
 		cd testrepo &&
 		test $(git -C .. rev-parse HEAD^) = $(git rev-parse HEAD) &&
@@ -1548,7 +1548,7 @@ test_expect_success 'receive.denyCurrentBranch = updateInstead' '
 		echo changed >path1 &&
 		git add path1
 	) &&
-	test_must_fail git push testrepo master &&
+	test_must_fail git push testrepo main &&
 	(
 		cd testrepo &&
 		test $(git -C .. rev-parse HEAD^) = $(git rev-parse HEAD) &&
@@ -1565,7 +1565,7 @@ test_expect_success 'receive.denyCurrentBranch = updateInstead' '
 		git reset --hard &&
 		echo changed >path3
 	) &&
-	test_must_fail git push testrepo master &&
+	test_must_fail git push testrepo main &&
 	(
 		cd testrepo &&
 		test $(git -C .. rev-parse HEAD^^) = $(git rev-parse HEAD) &&
@@ -1581,7 +1581,7 @@ test_expect_success 'receive.denyCurrentBranch = updateInstead' '
 		echo fifth >path3 &&
 		git add path3
 	) &&
-	test_must_fail git push testrepo master &&
+	test_must_fail git push testrepo main &&
 	(
 		cd testrepo &&
 		test $(git -C .. rev-parse HEAD^^) = $(git rev-parse HEAD) &&
@@ -1596,17 +1596,17 @@ test_expect_success 'receive.denyCurrentBranch = updateInstead' '
 		cd void &&
 		git config receive.denyCurrentBranch updateInstead
 	) &&
-	git push void master &&
+	git push void main &&
 	(
 		cd void &&
-		test $(git -C .. rev-parse master) = $(git rev-parse HEAD) &&
+		test $(git -C .. rev-parse main) = $(git rev-parse HEAD) &&
 		git diff --quiet &&
 		git diff --cached --quiet
 	) &&
 
 	# (6) updateInstead intervened by fast-forward check
-	test_must_fail git push void master^:master &&
-	test $(git -C void rev-parse HEAD) = $(git rev-parse master) &&
+	test_must_fail git push void main^:main &&
+	test $(git -C void rev-parse HEAD) = $(git rev-parse main) &&
 	git -C void diff --quiet &&
 	git -C void diff --cached --quiet
 '
@@ -1616,7 +1616,7 @@ test_expect_success 'updateInstead with push-to-checkout hook' '
 	git init testrepo &&
 	(
 		cd testrepo &&
-		git pull .. master &&
+		git pull .. main &&
 		git reset --hard HEAD^^ &&
 		git tag initial &&
 		git config receive.denyCurrentBranch updateInstead &&
@@ -1634,7 +1634,7 @@ test_expect_success 'updateInstead with push-to-checkout hook' '
 	) &&
 
 	# Try pushing into a pristine
-	git push testrepo master &&
+	git push testrepo main &&
 	(
 		cd testrepo &&
 		git diff --quiet &&
@@ -1648,7 +1648,7 @@ test_expect_success 'updateInstead with push-to-checkout hook' '
 		git reset --hard initial &&
 		echo conflicting >path2
 	) &&
-	test_must_fail git push testrepo master &&
+	test_must_fail git push testrepo main &&
 	(
 		cd testrepo &&
 		test $(git rev-parse initial) = $(git rev-parse HEAD) &&
@@ -1664,7 +1664,7 @@ test_expect_success 'updateInstead with push-to-checkout hook' '
 		echo irrelevant >path5 &&
 		git add path5
 	) &&
-	git push testrepo master &&
+	git push testrepo main &&
 	(
 		cd testrepo &&
 		test "$(cat path1)" = unrelated &&
@@ -1704,7 +1704,7 @@ test_expect_success 'updateInstead with push-to-checkout hook' '
 		EOF
 	) &&
 
-	git push void master &&
+	git push void main &&
 	(
 		cd void &&
 		git diff --quiet &&
diff --git a/t/t5517-push-mirror.sh b/t/t5517-push-mirror.sh
index e4edd56404..a4b11495c6 100755
--- a/t/t5517-push-mirror.sh
+++ b/t/t5517-push-mirror.sh
@@ -15,16 +15,16 @@ invert () {
 }
 
 mk_repo_pair () {
-	rm -rf master mirror &&
+	rm -rf main mirror &&
 	mkdir mirror &&
 	(
 		cd mirror &&
 		git init &&
 		git config receive.denyCurrentBranch warn
 	) &&
-	mkdir master &&
+	mkdir main &&
 	(
-		cd master &&
+		cd main &&
 		git init &&
 		git remote add $1 up ../mirror
 	)
@@ -36,13 +36,13 @@ test_expect_success 'push mirror creates new branches' '
 
 	mk_repo_pair &&
 	(
-		cd master &&
+		cd main &&
 		echo one >foo && git add foo && git commit -m one &&
 		git push --mirror up
 	) &&
-	master_master=$(cd master && git show-ref -s --verify refs/heads/master) &&
-	mirror_master=$(cd mirror && git show-ref -s --verify refs/heads/master) &&
-	test "$master_master" = "$mirror_master"
+	main_main=$(cd main && git show-ref -s --verify refs/heads/main) &&
+	mirror_main=$(cd mirror && git show-ref -s --verify refs/heads/main) &&
+	test "$main_main" = "$mirror_main"
 
 '
 
@@ -50,15 +50,15 @@ test_expect_success 'push mirror updates existing branches' '
 
 	mk_repo_pair &&
 	(
-		cd master &&
+		cd main &&
 		echo one >foo && git add foo && git commit -m one &&
 		git push --mirror up &&
 		echo two >foo && git add foo && git commit -m two &&
 		git push --mirror up
 	) &&
-	master_master=$(cd master && git show-ref -s --verify refs/heads/master) &&
-	mirror_master=$(cd mirror && git show-ref -s --verify refs/heads/master) &&
-	test "$master_master" = "$mirror_master"
+	main_main=$(cd main && git show-ref -s --verify refs/heads/main) &&
+	mirror_main=$(cd mirror && git show-ref -s --verify refs/heads/main) &&
+	test "$main_main" = "$mirror_main"
 
 '
 
@@ -66,7 +66,7 @@ test_expect_success 'push mirror force updates existing branches' '
 
 	mk_repo_pair &&
 	(
-		cd master &&
+		cd main &&
 		echo one >foo && git add foo && git commit -m one &&
 		git push --mirror up &&
 		echo two >foo && git add foo && git commit -m two &&
@@ -74,9 +74,9 @@ test_expect_success 'push mirror force updates existing branches' '
 		git reset --hard HEAD^ &&
 		git push --mirror up
 	) &&
-	master_master=$(cd master && git show-ref -s --verify refs/heads/master) &&
-	mirror_master=$(cd mirror && git show-ref -s --verify refs/heads/master) &&
-	test "$master_master" = "$mirror_master"
+	main_main=$(cd main && git show-ref -s --verify refs/heads/main) &&
+	mirror_main=$(cd mirror && git show-ref -s --verify refs/heads/main) &&
+	test "$main_main" = "$mirror_main"
 
 '
 
@@ -84,9 +84,9 @@ test_expect_success 'push mirror removes branches' '
 
 	mk_repo_pair &&
 	(
-		cd master &&
+		cd main &&
 		echo one >foo && git add foo && git commit -m one &&
-		git branch remove master &&
+		git branch remove main &&
 		git push --mirror up &&
 		git branch -D remove &&
 		git push --mirror up
@@ -102,21 +102,21 @@ test_expect_success 'push mirror adds, updates and removes branches together' '
 
 	mk_repo_pair &&
 	(
-		cd master &&
+		cd main &&
 		echo one >foo && git add foo && git commit -m one &&
-		git branch remove master &&
+		git branch remove main &&
 		git push --mirror up &&
 		git branch -D remove &&
-		git branch add master &&
+		git branch add main &&
 		echo two >foo && git add foo && git commit -m two &&
 		git push --mirror up
 	) &&
-	master_master=$(cd master && git show-ref -s --verify refs/heads/master) &&
-	master_add=$(cd master && git show-ref -s --verify refs/heads/add) &&
-	mirror_master=$(cd mirror && git show-ref -s --verify refs/heads/master) &&
+	main_main=$(cd main && git show-ref -s --verify refs/heads/main) &&
+	main_add=$(cd main && git show-ref -s --verify refs/heads/add) &&
+	mirror_main=$(cd mirror && git show-ref -s --verify refs/heads/main) &&
 	mirror_add=$(cd mirror && git show-ref -s --verify refs/heads/add) &&
-	test "$master_master" = "$mirror_master" &&
-	test "$master_add" = "$mirror_add" &&
+	test "$main_main" = "$mirror_main" &&
+	test "$main_add" = "$mirror_add" &&
 	(
 		cd mirror &&
 		invert git show-ref -s --verify refs/heads/remove
@@ -130,14 +130,14 @@ test_expect_success 'push mirror creates new tags' '
 
 	mk_repo_pair &&
 	(
-		cd master &&
+		cd main &&
 		echo one >foo && git add foo && git commit -m one &&
-		git tag -f tmaster master &&
+		git tag -f tmain main &&
 		git push --mirror up
 	) &&
-	master_master=$(cd master && git show-ref -s --verify refs/tags/tmaster) &&
-	mirror_master=$(cd mirror && git show-ref -s --verify refs/tags/tmaster) &&
-	test "$master_master" = "$mirror_master"
+	main_main=$(cd main && git show-ref -s --verify refs/tags/tmain) &&
+	mirror_main=$(cd mirror && git show-ref -s --verify refs/tags/tmain) &&
+	test "$main_main" = "$mirror_main"
 
 '
 
@@ -145,17 +145,17 @@ test_expect_success 'push mirror updates existing tags' '
 
 	mk_repo_pair &&
 	(
-		cd master &&
+		cd main &&
 		echo one >foo && git add foo && git commit -m one &&
-		git tag -f tmaster master &&
+		git tag -f tmain main &&
 		git push --mirror up &&
 		echo two >foo && git add foo && git commit -m two &&
-		git tag -f tmaster master &&
+		git tag -f tmain main &&
 		git push --mirror up
 	) &&
-	master_master=$(cd master && git show-ref -s --verify refs/tags/tmaster) &&
-	mirror_master=$(cd mirror && git show-ref -s --verify refs/tags/tmaster) &&
-	test "$master_master" = "$mirror_master"
+	main_main=$(cd main && git show-ref -s --verify refs/tags/tmain) &&
+	mirror_main=$(cd mirror && git show-ref -s --verify refs/tags/tmain) &&
+	test "$main_main" = "$mirror_main"
 
 '
 
@@ -163,20 +163,20 @@ test_expect_success 'push mirror force updates existing tags' '
 
 	mk_repo_pair &&
 	(
-		cd master &&
+		cd main &&
 		echo one >foo && git add foo && git commit -m one &&
-		git tag -f tmaster master &&
+		git tag -f tmain main &&
 		git push --mirror up &&
 		echo two >foo && git add foo && git commit -m two &&
-		git tag -f tmaster master &&
+		git tag -f tmain main &&
 		git push --mirror up &&
 		git reset --hard HEAD^ &&
-		git tag -f tmaster master &&
+		git tag -f tmain main &&
 		git push --mirror up
 	) &&
-	master_master=$(cd master && git show-ref -s --verify refs/tags/tmaster) &&
-	mirror_master=$(cd mirror && git show-ref -s --verify refs/tags/tmaster) &&
-	test "$master_master" = "$mirror_master"
+	main_main=$(cd main && git show-ref -s --verify refs/tags/tmain) &&
+	mirror_main=$(cd mirror && git show-ref -s --verify refs/tags/tmain) &&
+	test "$main_main" = "$mirror_main"
 
 '
 
@@ -184,9 +184,9 @@ test_expect_success 'push mirror removes tags' '
 
 	mk_repo_pair &&
 	(
-		cd master &&
+		cd main &&
 		echo one >foo && git add foo && git commit -m one &&
-		git tag -f tremove master &&
+		git tag -f tremove main &&
 		git push --mirror up &&
 		git tag -d tremove &&
 		git push --mirror up
@@ -202,23 +202,23 @@ test_expect_success 'push mirror adds, updates and removes tags together' '
 
 	mk_repo_pair &&
 	(
-		cd master &&
+		cd main &&
 		echo one >foo && git add foo && git commit -m one &&
-		git tag -f tmaster master &&
-		git tag -f tremove master &&
+		git tag -f tmain main &&
+		git tag -f tremove main &&
 		git push --mirror up &&
 		git tag -d tremove &&
-		git tag tadd master &&
+		git tag tadd main &&
 		echo two >foo && git add foo && git commit -m two &&
-		git tag -f tmaster master &&
+		git tag -f tmain main &&
 		git push --mirror up
 	) &&
-	master_master=$(cd master && git show-ref -s --verify refs/tags/tmaster) &&
-	master_add=$(cd master && git show-ref -s --verify refs/tags/tadd) &&
-	mirror_master=$(cd mirror && git show-ref -s --verify refs/tags/tmaster) &&
+	main_main=$(cd main && git show-ref -s --verify refs/tags/tmain) &&
+	main_add=$(cd main && git show-ref -s --verify refs/tags/tadd) &&
+	mirror_main=$(cd mirror && git show-ref -s --verify refs/tags/tmain) &&
 	mirror_add=$(cd mirror && git show-ref -s --verify refs/tags/tadd) &&
-	test "$master_master" = "$mirror_master" &&
-	test "$master_add" = "$mirror_add" &&
+	test "$main_main" = "$mirror_main" &&
+	test "$main_add" = "$mirror_add" &&
 	(
 		cd mirror &&
 		invert git show-ref -s --verify refs/tags/tremove
@@ -230,10 +230,10 @@ test_expect_success 'remote.foo.mirror adds and removes branches' '
 
 	mk_repo_pair --mirror &&
 	(
-		cd master &&
+		cd main &&
 		echo one >foo && git add foo && git commit -m one &&
-		git branch keep master &&
-		git branch remove master &&
+		git branch keep main &&
+		git branch remove main &&
 		git push up &&
 		git branch -D remove &&
 		git push up
@@ -250,10 +250,10 @@ test_expect_success 'remote.foo.mirror=no has no effect' '
 
 	mk_repo_pair &&
 	(
-		cd master &&
+		cd main &&
 		echo one >foo && git add foo && git commit -m one &&
 		git config --add remote.up.mirror no &&
-		git branch keep master &&
+		git branch keep main &&
 		git push --mirror up &&
 		git branch -D keep &&
 		git push up :
@@ -268,10 +268,10 @@ test_expect_success 'remote.foo.mirror=no has no effect' '
 test_expect_success 'push to mirrored repository with refspec fails' '
 	mk_repo_pair &&
 	(
-		cd master &&
+		cd main &&
 		echo one >foo && git add foo && git commit -m one &&
 		git config --add remote.up.mirror true &&
-		test_must_fail git push up master
+		test_must_fail git push up main
 	)
 '
 
diff --git a/t/t5518-fetch-exit-status.sh b/t/t5518-fetch-exit-status.sh
index c2060bb870..78ba5c290a 100755
--- a/t/t5518-fetch-exit-status.sh
+++ b/t/t5518-fetch-exit-status.sh
@@ -17,20 +17,20 @@ test_expect_success setup '
 	echo side >file &&
 	git commit -a -m side &&
 
-	git checkout master &&
+	git checkout main &&
 	echo next >file &&
 	git commit -a -m next
 '
 
 test_expect_success 'non-fast-forward fetch' '
 
-	test_must_fail git fetch . master:side
+	test_must_fail git fetch . main:side
 
 '
 
 test_expect_success 'forced update' '
 
-	git fetch . +master:side
+	git fetch . +main:side
 
 '
 
diff --git a/t/t5519-push-alternates.sh b/t/t5519-push-alternates.sh
index 11fcd37700..1696eb5125 100755
--- a/t/t5519-push-alternates.sh
+++ b/t/t5519-push-alternates.sh
@@ -17,7 +17,7 @@ test_expect_success setup '
 		>file &&
 		git add . &&
 		git commit -m initial &&
-		git push ../alice-pub master
+		git push ../alice-pub main
 	) &&
 
 	# Project Bob is a fork of project Alice
@@ -31,7 +31,7 @@ test_expect_success setup '
 	git clone alice-pub bob-work &&
 	(
 		cd bob-work &&
-		git push ../bob-pub master
+		git push ../bob-pub main
 	)
 '
 
@@ -54,7 +54,7 @@ test_expect_success 'bob fetches from alice, works and pushes' '
 		# has at her public repository are available to it
 		# via its alternates.
 		cd bob-work &&
-		git pull ../alice-pub master &&
+		git pull ../alice-pub main &&
 		echo more bob >file &&
 		git commit -a -m third &&
 		git push ../bob-pub :
@@ -93,7 +93,7 @@ test_expect_success 'alice works and pushes again' '
 test_expect_success 'bob works and pushes' '
 	(
 		# This time Bob does not pull from Alice, and
-		# the master branch at her public repository points
+		# the main branch at her public repository points
 		# at a commit Bob does not know about.  This should
 		# not prevent the push by Bob from succeeding.
 		cd bob-work &&
@@ -122,11 +122,11 @@ test_expect_success 'alice works and pushes yet again' '
 test_expect_success 'bob works and pushes again' '
 	(
 		cd alice-pub &&
-		git cat-file commit master >../bob-work/commit
+		git cat-file commit main >../bob-work/commit
 	) &&
 	(
 		# This time Bob does not pull from Alice, and
-		# the master branch at her public repository points
+		# the main branch at her public repository points
 		# at a commit Bob does not fully know about, but
 		# he happens to have the commit object (but not the
 		# necessary tree) in his repository from Alice.
diff --git a/t/test-lib.sh b/t/test-lib.sh
index ca86f666e6..a12a1993d0 100644
--- a/t/test-lib.sh
+++ b/t/test-lib.sh
@@ -263,7 +263,7 @@ case "$TEST_NUMBER" in
 	GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
 	export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 	;;
-[0-4]*|5[0-4]*|550*)
+[0-4]*|5[0-4]*|55[01]*)
 	GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 	export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 	;;
-- 
gitgitgadget


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH v2 14/27] t55[23]*: adjust the references to the default branch name "main"
  2020-11-17 16:12 ` [PATCH v2 00/27] tests: use " Johannes Schindelin via GitGitGadget
                     ` (12 preceding siblings ...)
  2020-11-17 16:12   ` [PATCH v2 13/27] t551*: " Johannes Schindelin via GitGitGadget
@ 2020-11-17 16:12   ` Johannes Schindelin via GitGitGadget
  2020-11-17 16:12   ` [PATCH v2 15/27] t55[4-9]*: " Johannes Schindelin via GitGitGadget
                     ` (14 subsequent siblings)
  28 siblings, 0 replies; 163+ messages in thread
From: Johannes Schindelin via GitGitGadget @ 2020-11-17 16:12 UTC (permalink / raw)
  To: git
  Cc: Felipe Contreras, Ævar Arnfjörð Bjarmason,
	Johannes Schindelin, Jeff King, Johannes Schindelin,
	Johannes Schindelin

From: Johannes Schindelin <johannes.schindelin@gmx.de>

Carefully excluding t5526, which sees independent development elsewhere
at the time of writing, we use `main` as the default branch name in
t55[23]*. This trick was performed via

	$ (cd t &&
	   sed -i -e 's/master/main/g' -e 's/MASTER/MAIN/g' \
		-e 's/Master/Main/g' -e 's/naster/nain/g' -- \
		t55[23]*.sh &&
	   git checkout HEAD -- t5526\*)

Note that t5533 contains a variation of the name `master` (`naster`)
that we rename here, too.

This commit allows us to define
`GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main` for that range of tests.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
---
 t/t5520-pull.sh                |  30 +++---
 t/t5521-pull-options.sh        |  16 +--
 t/t5523-push-upstream.sh       |  30 +++---
 t/t5527-fetch-odd-refs.sh      |  14 +--
 t/t5528-push-default.sh        |  98 ++++++++---------
 t/t5529-push-errors.sh         |   2 +-
 t/t5530-upload-pack-error.sh   |   2 +-
 t/t5531-deep-submodule-push.sh | 188 ++++++++++++++++-----------------
 t/t5533-push-cas.sh            | 142 ++++++++++++-------------
 t/t5534-push-signed.sh         |   4 +-
 t/t5537-fetch-shallow.sh       |  30 +++---
 t/t5538-push-shallow.sh        |  22 ++--
 t/t5539-fetch-http-shallow.sh  |  14 +--
 t/test-lib.sh                  |   4 +-
 14 files changed, 298 insertions(+), 298 deletions(-)

diff --git a/t/t5520-pull.sh b/t/t5520-pull.sh
index 9fae07cdfa..3be99df66d 100755
--- a/t/t5520-pull.sh
+++ b/t/t5520-pull.sh
@@ -48,11 +48,11 @@ test_expect_success 'pulling into void' '
 	test_cmp file cloned/file
 '
 
-test_expect_success 'pulling into void using master:master' '
+test_expect_success 'pulling into void using main:main' '
 	git init cloned-uho &&
 	(
 		cd cloned-uho &&
-		git pull .. master:master
+		git pull .. main:main
 	) &&
 	test_path_is_file file &&
 	test_path_is_file cloned-uho/file &&
@@ -64,7 +64,7 @@ test_expect_success 'pulling into void does not overwrite untracked files' '
 	(
 		cd cloned-untracked &&
 		echo untracked >file &&
-		test_must_fail git pull .. master &&
+		test_must_fail git pull .. main &&
 		echo untracked >expect &&
 		test_cmp expect file
 	)
@@ -76,7 +76,7 @@ test_expect_success 'pulling into void does not overwrite staged files' '
 		cd cloned-staged-colliding &&
 		echo "alternate content" >file &&
 		git add file &&
-		test_must_fail git pull .. master &&
+		test_must_fail git pull .. main &&
 		echo "alternate content" >expect &&
 		test_cmp expect file &&
 		git cat-file blob :file >file.index &&
@@ -90,7 +90,7 @@ test_expect_success 'pulling into void does not remove new staged files' '
 		cd cloned-staged-new &&
 		echo "new tracked file" >newfile &&
 		git add newfile &&
-		git pull .. master &&
+		git pull .. main &&
 		echo "new tracked file" >expect &&
 		test_cmp expect newfile &&
 		git cat-file blob :newfile >newfile.index &&
@@ -102,15 +102,15 @@ test_expect_success 'pulling into void must not create an octopus' '
 	git init cloned-octopus &&
 	(
 		cd cloned-octopus &&
-		test_must_fail git pull .. master master &&
+		test_must_fail git pull .. main main &&
 		test_path_is_missing file
 	)
 '
 
 test_expect_success 'test . as a remote' '
-	git branch copy master &&
+	git branch copy main &&
 	git config branch.copy.remote . &&
-	git config branch.copy.merge refs/heads/master &&
+	git config branch.copy.merge refs/heads/main &&
 	echo updated >file &&
 	git commit -a -m updated &&
 	git checkout copy &&
@@ -126,7 +126,7 @@ test_expect_success 'test . as a remote' '
 '
 
 test_expect_success 'the default remote . should not break explicit pull' '
-	git checkout -b second master^ &&
+	git checkout -b second main^ &&
 	echo modified >file &&
 	git commit -a -m modified &&
 	git checkout copy &&
@@ -361,7 +361,7 @@ test_expect_success 'failed --rebase shows advice' '
 
 test_expect_success '--rebase fails with multiple branches' '
 	git reset --hard before-rebase &&
-	test_must_fail git pull --rebase . copy master 2>err &&
+	test_must_fail git pull --rebase . copy main 2>err &&
 	test_cmp_rev HEAD before-rebase &&
 	test_i18ngrep "Cannot rebase onto multiple branches" err &&
 	echo modified >expect &&
@@ -500,7 +500,7 @@ test_expect_success 'pull --rebase does not warn on --no-verify-signatures' '
 	test_i18ngrep ! "verify-signatures" err
 '
 
-# add a feature branch, keep-merge, that is merged into master, so the
+# add a feature branch, keep-merge, that is merged into main, so the
 # test can try preserving the merge commit (or not) with various
 # --rebase flags/pull.rebase settings.
 test_expect_success 'preserve merge setup' '
@@ -699,12 +699,12 @@ test_expect_success 'pull --rebase dies early with dirty working directory' '
 '
 
 test_expect_success 'pull --rebase works on branch yet to be born' '
-	git rev-parse master >expect &&
+	git rev-parse main >expect &&
 	mkdir empty_repo &&
 	(
 		cd empty_repo &&
 		git init &&
-		git pull --rebase .. master &&
+		git pull --rebase .. main &&
 		git rev-parse HEAD >../actual
 	) &&
 	test_cmp expect actual
@@ -720,7 +720,7 @@ test_expect_success 'pull --rebase fails on unborn branch with staged changes' '
 		echo staged-file >expect &&
 		git ls-files >actual &&
 		test_cmp expect actual &&
-		test_must_fail git pull --rebase .. master 2>err &&
+		test_must_fail git pull --rebase .. main 2>err &&
 		git ls-files >actual &&
 		test_cmp expect actual &&
 		git show :staged-file >actual &&
@@ -779,7 +779,7 @@ test_expect_success 'setup for avoiding reapplying old patches' '
 	(
 		cd dst &&
 		test_might_fail git rebase --abort &&
-		git reset --hard origin/master
+		git reset --hard origin/main
 	) &&
 	git clone --bare src src-replace.git &&
 	rm -rf src &&
diff --git a/t/t5521-pull-options.sh b/t/t5521-pull-options.sh
index db1a381cd9..ae80aaa480 100755
--- a/t/t5521-pull-options.sh
+++ b/t/t5521-pull-options.sh
@@ -99,13 +99,13 @@ test_expect_success 'git pull --force' '
 	cat >>.git/config <<-\EOF &&
 	[remote "one"]
 		url = ../parent
-		fetch = refs/heads/master:refs/heads/mirror
+		fetch = refs/heads/main:refs/heads/mirror
 	[remote "two"]
 		url = ../parent
-		fetch = refs/heads/master:refs/heads/origin
-	[branch "master"]
+		fetch = refs/heads/main:refs/heads/origin
+	[branch "main"]
 		remote = two
-		merge = refs/heads/master
+		merge = refs/heads/main
 	EOF
 	git pull two &&
 	test_commit A &&
@@ -124,9 +124,9 @@ test_expect_success 'git pull --all' '
 	[remote "two"]
 		url = ../parent
 		fetch = refs/heads/*:refs/remotes/two/*
-	[branch "master"]
+	[branch "main"]
 		remote = one
-		merge = refs/heads/master
+		merge = refs/heads/main
 	EOF
 	git pull --all
 	)
@@ -139,7 +139,7 @@ test_expect_success 'git pull --dry-run' '
 		cd clonedry &&
 		git pull --dry-run ../parent &&
 		test_path_is_missing .git/FETCH_HEAD &&
-		test_path_is_missing .git/refs/heads/master &&
+		test_path_is_missing .git/refs/heads/main &&
 		test_path_is_missing .git/index &&
 		test_path_is_missing file
 	)
@@ -153,7 +153,7 @@ test_expect_success 'git pull --all --dry-run' '
 		git remote add origin ../parent &&
 		git pull --all --dry-run &&
 		test_path_is_missing .git/FETCH_HEAD &&
-		test_path_is_missing .git/refs/remotes/origin/master &&
+		test_path_is_missing .git/refs/remotes/origin/main &&
 		test_path_is_missing .git/index &&
 		test_path_is_missing file
 	)
diff --git a/t/t5523-push-upstream.sh b/t/t5523-push-upstream.sh
index e47b5db5d6..a2eaa877a2 100755
--- a/t/t5523-push-upstream.sh
+++ b/t/t5523-push-upstream.sh
@@ -26,19 +26,19 @@ check_config() {
 	test_cmp expect.$1 actual.$1
 }
 
-test_expect_success 'push -u master:master' '
-	git push -u upstream master:master &&
-	check_config master upstream refs/heads/master
+test_expect_success 'push -u main:main' '
+	git push -u upstream main:main &&
+	check_config main upstream refs/heads/main
 '
 
-test_expect_success 'push -u master:other' '
-	git push -u upstream master:other &&
-	check_config master upstream refs/heads/other
+test_expect_success 'push -u main:other' '
+	git push -u upstream main:other &&
+	check_config main upstream refs/heads/other
 '
 
-test_expect_success 'push -u --dry-run master:otherX' '
-	git push -u --dry-run upstream master:otherX &&
-	check_config master upstream refs/heads/other
+test_expect_success 'push -u --dry-run main:otherX' '
+	git push -u --dry-run upstream main:otherX &&
+	check_config main upstream refs/heads/other
 '
 
 test_expect_success 'push -u topic_2:topic_2' '
@@ -74,7 +74,7 @@ test_expect_success 'push -u HEAD' '
 test_expect_success TTY 'progress messages go to tty' '
 	ensure_fresh_upstream &&
 
-	test_terminal git push -u upstream master >out 2>err &&
+	test_terminal git push -u upstream main >out 2>err &&
 	test_i18ngrep "Writing objects" err
 '
 
@@ -82,7 +82,7 @@ test_expect_success 'progress messages do not go to non-tty' '
 	ensure_fresh_upstream &&
 
 	# skip progress messages, since stderr is non-tty
-	git push -u upstream master >out 2>err &&
+	git push -u upstream main >out 2>err &&
 	test_i18ngrep ! "Writing objects" err
 '
 
@@ -90,21 +90,21 @@ test_expect_success 'progress messages go to non-tty (forced)' '
 	ensure_fresh_upstream &&
 
 	# force progress messages to stderr, even though it is non-tty
-	git push -u --progress upstream master >out 2>err &&
+	git push -u --progress upstream main >out 2>err &&
 	test_i18ngrep "Writing objects" err
 '
 
 test_expect_success TTY 'push -q suppresses progress' '
 	ensure_fresh_upstream &&
 
-	test_terminal git push -u -q upstream master >out 2>err &&
+	test_terminal git push -u -q upstream main >out 2>err &&
 	test_i18ngrep ! "Writing objects" err
 '
 
 test_expect_success TTY 'push --no-progress suppresses progress' '
 	ensure_fresh_upstream &&
 
-	test_terminal git push -u --no-progress upstream master >out 2>err &&
+	test_terminal git push -u --no-progress upstream main >out 2>err &&
 	test_i18ngrep ! "Unpacking objects" err &&
 	test_i18ngrep ! "Writing objects" err
 '
@@ -112,7 +112,7 @@ test_expect_success TTY 'push --no-progress suppresses progress' '
 test_expect_success TTY 'quiet push' '
 	ensure_fresh_upstream &&
 
-	test_terminal git push --quiet --no-progress upstream master 2>&1 | tee output &&
+	test_terminal git push --quiet --no-progress upstream main 2>&1 | tee output &&
 	test_must_be_empty output
 '
 
diff --git a/t/t5527-fetch-odd-refs.sh b/t/t5527-fetch-odd-refs.sh
index 3b0cb98422..c6a4db4c59 100755
--- a/t/t5527-fetch-odd-refs.sh
+++ b/t/t5527-fetch-odd-refs.sh
@@ -5,13 +5,13 @@ test_description='test fetching of oddly-named refs'
 
 # afterwards we will have:
 #  HEAD - two
-#  refs/for/refs/heads/master - one
-#  refs/heads/master - three
+#  refs/for/refs/heads/main - one
+#  refs/heads/main - three
 test_expect_success 'setup repo with odd suffix ref' '
 	echo content >file &&
 	git add . &&
 	git commit -m one &&
-	git update-ref refs/for/refs/heads/master HEAD &&
+	git update-ref refs/for/refs/heads/main HEAD &&
 	echo content >>file &&
 	git commit -a -m two &&
 	echo content >>file &&
@@ -22,7 +22,7 @@ test_expect_success 'setup repo with odd suffix ref' '
 test_expect_success 'suffix ref is ignored during fetch' '
 	git clone --bare file://"$PWD" suffix &&
 	echo three >expect &&
-	git --git-dir=suffix log -1 --format=%s refs/heads/master >actual &&
+	git --git-dir=suffix log -1 --format=%s refs/heads/main >actual &&
 	test_cmp expect actual
 '
 
@@ -33,7 +33,7 @@ test_expect_success 'try to create repo with absurdly long refname' '
 	(
 		cd long &&
 		test_commit long &&
-		test_commit master
+		test_commit main
 	) &&
 	if git -C long update-ref refs/heads/$ref1440 long; then
 		test_set_prereq LONG_REF
@@ -46,7 +46,7 @@ test_expect_success LONG_REF 'fetch handles extremely long refname' '
 	git fetch long refs/heads/*:refs/remotes/long/* &&
 	cat >expect <<-\EOF &&
 	long
-	master
+	main
 	EOF
 	git for-each-ref --format="%(subject)" refs/remotes/long >actual &&
 	test_cmp expect actual
@@ -55,7 +55,7 @@ test_expect_success LONG_REF 'fetch handles extremely long refname' '
 test_expect_success LONG_REF 'push handles extremely long refname' '
 	git push long :refs/heads/$ref1440 &&
 	git -C long for-each-ref --format="%(subject)" refs/heads >actual &&
-	echo master >expect &&
+	echo main >expect &&
 	test_cmp expect actual
 '
 
diff --git a/t/t5528-push-default.sh b/t/t5528-push-default.sh
index f0a287d97d..b6d1776c98 100755
--- a/t/t5528-push-default.sh
+++ b/t/t5528-push-default.sh
@@ -41,7 +41,7 @@ test_push_failure () {
 
 # $1 = success or failure
 # $2 = push.default value
-# $3 = branch to check for actual output (master or foo)
+# $3 = branch to check for actual output (main or foo)
 # $4 = [optional] switch to triangular workflow
 test_pushdefault_workflow () {
 	workflow=central
@@ -51,8 +51,8 @@ test_pushdefault_workflow () {
 		pushdefault=parent2
 	fi
 	test_expect_success "push.default = $2 $1 in $workflow workflows" "
-		test_config branch.master.remote parent1 &&
-		test_config branch.master.merge refs/heads/foo &&
+		test_config branch.main.remote parent1 &&
+		test_config branch.main.merge refs/heads/foo &&
 		test_config remote.pushdefault $pushdefault &&
 		test_commit commit-for-$2${4+-triangular} &&
 		test_push_$1 $2 $3 ${4+repo2}
@@ -60,32 +60,32 @@ test_pushdefault_workflow () {
 }
 
 test_expect_success '"upstream" pushes to configured upstream' '
-	git checkout master &&
-	test_config branch.master.remote parent1 &&
-	test_config branch.master.merge refs/heads/foo &&
+	git checkout main &&
+	test_config branch.main.remote parent1 &&
+	test_config branch.main.merge refs/heads/foo &&
 	test_commit two &&
 	test_push_success upstream foo
 '
 
 test_expect_success '"upstream" does not push on unconfigured remote' '
-	git checkout master &&
-	test_unconfig branch.master.remote &&
+	git checkout main &&
+	test_unconfig branch.main.remote &&
 	test_commit three &&
 	test_push_failure upstream
 '
 
 test_expect_success '"upstream" does not push on unconfigured branch' '
-	git checkout master &&
-	test_config branch.master.remote parent1 &&
-	test_unconfig branch.master.merge &&
+	git checkout main &&
+	test_config branch.main.remote parent1 &&
+	test_unconfig branch.main.merge &&
 	test_commit four &&
 	test_push_failure upstream
 '
 
 test_expect_success '"upstream" does not push when remotes do not match' '
-	git checkout master &&
-	test_config branch.master.remote parent1 &&
-	test_config branch.master.merge refs/heads/foo &&
+	git checkout main &&
+	test_config branch.main.remote parent1 &&
+	test_config branch.main.merge refs/heads/foo &&
 	test_config push.default upstream &&
 	test_commit five &&
 	test_must_fail git push parent2
@@ -121,99 +121,99 @@ test_expect_success 'push from/to new branch with current creates remote branch'
 '
 
 test_expect_success 'push to existing branch, with no upstream configured' '
-	test_config branch.master.remote repo1 &&
-	git checkout master &&
+	test_config branch.main.remote repo1 &&
+	git checkout main &&
 	test_push_failure simple &&
 	test_push_failure upstream
 '
 
 test_expect_success 'push to existing branch, upstream configured with same name' '
-	test_config branch.master.remote repo1 &&
-	test_config branch.master.merge refs/heads/master &&
-	git checkout master &&
+	test_config branch.main.remote repo1 &&
+	test_config branch.main.merge refs/heads/main &&
+	git checkout main &&
 	test_commit six &&
-	test_push_success upstream master &&
+	test_push_success upstream main &&
 	test_commit seven &&
-	test_push_success simple master
+	test_push_success simple main
 '
 
 test_expect_success 'push to existing branch, upstream configured with different name' '
-	test_config branch.master.remote repo1 &&
-	test_config branch.master.merge refs/heads/other-name &&
-	git checkout master &&
+	test_config branch.main.remote repo1 &&
+	test_config branch.main.merge refs/heads/other-name &&
+	git checkout main &&
 	test_commit eight &&
 	test_push_success upstream other-name &&
 	test_commit nine &&
 	test_push_failure simple &&
 	git --git-dir=repo1 log -1 --format="%h %s" "other-name" >expect-other-name &&
-	test_push_success current master &&
+	test_push_success current main &&
 	git --git-dir=repo1 log -1 --format="%h %s" "other-name" >actual-other-name &&
 	test_cmp expect-other-name actual-other-name
 '
 
-# We are on 'master', which integrates with 'foo' from parent1
+# We are on 'main', which integrates with 'foo' from parent1
 # remote (set in test_pushdefault_workflow helper).  Push to
 # parent1 in centralized, and push to parent2 in triangular workflow.
-# The parent1 repository has 'master' and 'foo' branches, while
-# the parent2 repository has only 'master' branch.
+# The parent1 repository has 'main' and 'foo' branches, while
+# the parent2 repository has only 'main' branch.
 #
 # test_pushdefault_workflow() arguments:
 # $1 = success or failure
 # $2 = push.default value
-# $3 = branch to check for actual output (master or foo)
+# $3 = branch to check for actual output (main or foo)
 # $4 = [optional] switch to triangular workflow
 
-# update parent1's master (which is not our upstream)
-test_pushdefault_workflow success current master
+# update parent1's main (which is not our upstream)
+test_pushdefault_workflow success current main
 
 # update parent1's foo (which is our upstream)
 test_pushdefault_workflow success upstream foo
 
 # upstream is foo which is not the name of the current branch
-test_pushdefault_workflow failure simple master
+test_pushdefault_workflow failure simple main
 
-# master and foo are updated
-test_pushdefault_workflow success matching master
+# main and foo are updated
+test_pushdefault_workflow success matching main
 
-# master is updated
-test_pushdefault_workflow success current master triangular
+# main is updated
+test_pushdefault_workflow success current main triangular
 
 # upstream mode cannot be used in triangular
 test_pushdefault_workflow failure upstream foo triangular
 
 # in triangular, 'simple' works as 'current' and update the branch
 # with the same name.
-test_pushdefault_workflow success simple master triangular
+test_pushdefault_workflow success simple main triangular
 
-# master is updated (parent2 does not have foo)
-test_pushdefault_workflow success matching master triangular
+# main is updated (parent2 does not have foo)
+test_pushdefault_workflow success matching main triangular
 
 # default tests, when no push-default is specified. This
 # should behave the same as "simple" in non-triangular
 # settings, and as "current" otherwise.
 
 test_expect_success 'default behavior allows "simple" push' '
-	test_config branch.master.remote parent1 &&
-	test_config branch.master.merge refs/heads/master &&
+	test_config branch.main.remote parent1 &&
+	test_config branch.main.merge refs/heads/main &&
 	test_config remote.pushdefault parent1 &&
-	test_commit default-master-master &&
-	test_push_success "" master
+	test_commit default-main-main &&
+	test_push_success "" main
 '
 
 test_expect_success 'default behavior rejects non-simple push' '
-	test_config branch.master.remote parent1 &&
-	test_config branch.master.merge refs/heads/foo &&
+	test_config branch.main.remote parent1 &&
+	test_config branch.main.merge refs/heads/foo &&
 	test_config remote.pushdefault parent1 &&
-	test_commit default-master-foo &&
+	test_commit default-main-foo &&
 	test_push_failure ""
 '
 
 test_expect_success 'default triangular behavior acts like "current"' '
-	test_config branch.master.remote parent1 &&
-	test_config branch.master.merge refs/heads/foo &&
+	test_config branch.main.remote parent1 &&
+	test_config branch.main.merge refs/heads/foo &&
 	test_config remote.pushdefault parent2 &&
 	test_commit default-triangular &&
-	test_push_success "" master repo2
+	test_push_success "" main repo2
 '
 
 test_done
diff --git a/t/t5529-push-errors.sh b/t/t5529-push-errors.sh
index 9871307fd4..ce85fd30ad 100755
--- a/t/t5529-push-errors.sh
+++ b/t/t5529-push-errors.sh
@@ -32,7 +32,7 @@ test_expect_success 'detect missing branches early' '
 test_expect_success 'detect missing sha1 expressions early' '
 	echo no >rp-ran &&
 	echo no >expect &&
-	test_must_fail git push origin master~2:master &&
+	test_must_fail git push origin main~2:main &&
 	test_cmp expect rp-ran
 '
 
diff --git a/t/t5530-upload-pack-error.sh b/t/t5530-upload-pack-error.sh
index 9dd2d2457a..7c1460eaa9 100755
--- a/t/t5530-upload-pack-error.sh
+++ b/t/t5530-upload-pack-error.sh
@@ -115,7 +115,7 @@ test_expect_success 'create empty repository' '
 
 test_expect_success 'fetch fails' '
 
-	test_must_fail git fetch .. master
+	test_must_fail git fetch .. main
 
 '
 
diff --git a/t/t5531-deep-submodule-push.sh b/t/t5531-deep-submodule-push.sh
index 4ad059e6be..afc0cd79f6 100755
--- a/t/t5531-deep-submodule-push.sh
+++ b/t/t5531-deep-submodule-push.sh
@@ -30,7 +30,7 @@ test_expect_success setup '
 test_expect_success 'push works with recorded gitlink' '
 	(
 		cd work &&
-		git push ../pub.git master
+		git push ../pub.git main
 	)
 '
 
@@ -45,7 +45,7 @@ test_expect_success 'push if submodule has no remote' '
 		cd work &&
 		git add gar/bage &&
 		git commit -m "Second commit for gar/bage" &&
-		git push --recurse-submodules=check ../pub.git master
+		git push --recurse-submodules=check ../pub.git main
 	)
 '
 
@@ -66,21 +66,21 @@ test_expect_success 'push fails if submodule commit not on remote' '
 		git commit -m "Third commit for gar/bage" &&
 		# the push should fail with --recurse-submodules=check
 		# on the command line...
-		test_must_fail git push --recurse-submodules=check ../pub.git master &&
+		test_must_fail git push --recurse-submodules=check ../pub.git main &&
 
 		# ...or if specified in the configuration..
-		test_must_fail git -c push.recurseSubmodules=check push ../pub.git master
+		test_must_fail git -c push.recurseSubmodules=check push ../pub.git main
 	)
 '
 
 test_expect_success 'push succeeds after commit was pushed to remote' '
 	(
 		cd work/gar/bage &&
-		git push origin master
+		git push origin main
 	) &&
 	(
 		cd work &&
-		git push --recurse-submodules=check ../pub.git master
+		git push --recurse-submodules=check ../pub.git main
 	)
 '
 
@@ -95,13 +95,13 @@ test_expect_success 'push succeeds if submodule commit not on remote but using o
 		cd work &&
 		git add gar/bage &&
 		git commit -m "Recurse on-demand on command line for gar/bage" &&
-		git push --recurse-submodules=on-demand ../pub.git master &&
+		git push --recurse-submodules=on-demand ../pub.git main &&
 		# Check that the supermodule commit got there
 		git fetch ../pub.git &&
-		git diff --quiet FETCH_HEAD master &&
+		git diff --quiet FETCH_HEAD main &&
 		# Check that the submodule commit got there too
 		cd gar/bage &&
-		git diff --quiet origin/master master
+		git diff --quiet origin/main main
 	)
 '
 
@@ -116,13 +116,13 @@ test_expect_success 'push succeeds if submodule commit not on remote but using o
 		cd work &&
 		git add gar/bage &&
 		git commit -m "Recurse on-demand from config for gar/bage" &&
-		git -c push.recurseSubmodules=on-demand push ../pub.git master &&
+		git -c push.recurseSubmodules=on-demand push ../pub.git main &&
 		# Check that the supermodule commit got there
 		git fetch ../pub.git &&
-		git diff --quiet FETCH_HEAD master &&
+		git diff --quiet FETCH_HEAD main &&
 		# Check that the submodule commit got there too
 		cd gar/bage &&
-		git diff --quiet origin/master master
+		git diff --quiet origin/main main
 	)
 '
 
@@ -137,13 +137,13 @@ test_expect_success 'push succeeds if submodule commit not on remote but using a
 		cd work &&
 		git add gar/bage &&
 		git commit -m "Recurse submodule.recurse from config for gar/bage" &&
-		git -c submodule.recurse push ../pub.git master &&
+		git -c submodule.recurse push ../pub.git main &&
 		# Check that the supermodule commit got there
 		git fetch ../pub.git &&
-		git diff --quiet FETCH_HEAD master &&
+		git diff --quiet FETCH_HEAD main &&
 		# Check that the submodule commit got there too
 		cd gar/bage &&
-		git diff --quiet origin/master master
+		git diff --quiet origin/main main
 	)
 '
 
@@ -161,34 +161,34 @@ test_expect_success 'push recurse-submodules on command line overrides config' '
 
 		# Ensure that we can override on-demand in the config
 		# to just check submodules
-		test_must_fail git -c push.recurseSubmodules=on-demand push --recurse-submodules=check ../pub.git master &&
+		test_must_fail git -c push.recurseSubmodules=on-demand push --recurse-submodules=check ../pub.git main &&
 		# Check that the supermodule commit did not get there
 		git fetch ../pub.git &&
-		git diff --quiet FETCH_HEAD master^ &&
+		git diff --quiet FETCH_HEAD main^ &&
 		# Check that the submodule commit did not get there
-		(cd gar/bage && git diff --quiet origin/master master^) &&
+		(cd gar/bage && git diff --quiet origin/main main^) &&
 
 		# Ensure that we can override check in the config to
 		# disable submodule recursion entirely
-		(cd gar/bage && git diff --quiet origin/master master^) &&
-		git -c push.recurseSubmodules=on-demand push --recurse-submodules=no ../pub.git master &&
+		(cd gar/bage && git diff --quiet origin/main main^) &&
+		git -c push.recurseSubmodules=on-demand push --recurse-submodules=no ../pub.git main &&
 		git fetch ../pub.git &&
-		git diff --quiet FETCH_HEAD master &&
-		(cd gar/bage && git diff --quiet origin/master master^) &&
+		git diff --quiet FETCH_HEAD main &&
+		(cd gar/bage && git diff --quiet origin/main main^) &&
 
 		# Ensure that we can override check in the config to
 		# disable submodule recursion entirely (alternative form)
-		git -c push.recurseSubmodules=on-demand push --no-recurse-submodules ../pub.git master &&
+		git -c push.recurseSubmodules=on-demand push --no-recurse-submodules ../pub.git main &&
 		git fetch ../pub.git &&
-		git diff --quiet FETCH_HEAD master &&
-		(cd gar/bage && git diff --quiet origin/master master^) &&
+		git diff --quiet FETCH_HEAD main &&
+		(cd gar/bage && git diff --quiet origin/main main^) &&
 
 		# Ensure that we can override check in the config to
 		# push the submodule too
-		git -c push.recurseSubmodules=check push --recurse-submodules=on-demand ../pub.git master &&
+		git -c push.recurseSubmodules=check push --recurse-submodules=on-demand ../pub.git main &&
 		git fetch ../pub.git &&
-		git diff --quiet FETCH_HEAD master &&
-		(cd gar/bage && git diff --quiet origin/master master)
+		git diff --quiet FETCH_HEAD main &&
+		(cd gar/bage && git diff --quiet origin/main main)
 	)
 '
 
@@ -205,31 +205,31 @@ test_expect_success 'push recurse-submodules last one wins on command line' '
 		git commit -m "Recurse on command-line overriding earlier command-line for gar/bage" &&
 
 		# should result in "check"
-		test_must_fail git push --recurse-submodules=on-demand --recurse-submodules=check ../pub.git master &&
+		test_must_fail git push --recurse-submodules=on-demand --recurse-submodules=check ../pub.git main &&
 		# Check that the supermodule commit did not get there
 		git fetch ../pub.git &&
-		git diff --quiet FETCH_HEAD master^ &&
+		git diff --quiet FETCH_HEAD main^ &&
 		# Check that the submodule commit did not get there
-		(cd gar/bage && git diff --quiet origin/master master^) &&
+		(cd gar/bage && git diff --quiet origin/main main^) &&
 
 		# should result in "no"
-		git push --recurse-submodules=on-demand --recurse-submodules=no ../pub.git master &&
+		git push --recurse-submodules=on-demand --recurse-submodules=no ../pub.git main &&
 		# Check that the supermodule commit did get there
 		git fetch ../pub.git &&
-		git diff --quiet FETCH_HEAD master &&
+		git diff --quiet FETCH_HEAD main &&
 		# Check that the submodule commit did not get there
-		(cd gar/bage && git diff --quiet origin/master master^) &&
+		(cd gar/bage && git diff --quiet origin/main main^) &&
 
 		# should result in "no"
-		git push --recurse-submodules=on-demand --no-recurse-submodules ../pub.git master &&
+		git push --recurse-submodules=on-demand --no-recurse-submodules ../pub.git main &&
 		# Check that the submodule commit did not get there
-		(cd gar/bage && git diff --quiet origin/master master^) &&
+		(cd gar/bage && git diff --quiet origin/main main^) &&
 
 		# But the options in the other order should push the submodule
-		git push --recurse-submodules=check --recurse-submodules=on-demand ../pub.git master &&
+		git push --recurse-submodules=check --recurse-submodules=on-demand ../pub.git main &&
 		# Check that the submodule commit did get there
 		git fetch ../pub.git &&
-		(cd gar/bage && git diff --quiet origin/master master)
+		(cd gar/bage && git diff --quiet origin/main main)
 	)
 '
 
@@ -244,13 +244,13 @@ test_expect_success 'push succeeds if submodule commit not on remote using on-de
 		cd work &&
 		git add gar/bage &&
 		git commit -m "Recurse on-demand on command-line overriding config for gar/bage" &&
-		git -c push.recurseSubmodules=check push --recurse-submodules=on-demand ../pub.git master &&
+		git -c push.recurseSubmodules=check push --recurse-submodules=on-demand ../pub.git main &&
 		# Check that the supermodule commit got there
 		git fetch ../pub.git &&
-		git diff --quiet FETCH_HEAD master &&
+		git diff --quiet FETCH_HEAD main &&
 		# Check that the submodule commit got there
 		cd gar/bage &&
-		git diff --quiet origin/master master
+		git diff --quiet origin/main main
 	)
 '
 
@@ -265,14 +265,14 @@ test_expect_success 'push succeeds if submodule commit disabling recursion from
 		cd work &&
 		git add gar/bage &&
 		git commit -m "Recurse disable on command-line overriding config for gar/bage" &&
-		git -c push.recurseSubmodules=check push --recurse-submodules=no ../pub.git master &&
+		git -c push.recurseSubmodules=check push --recurse-submodules=no ../pub.git main &&
 		# Check that the supermodule commit got there
 		git fetch ../pub.git &&
-		git diff --quiet FETCH_HEAD master &&
+		git diff --quiet FETCH_HEAD main &&
 		# But that the submodule commit did not
-		( cd gar/bage && git diff --quiet origin/master master^ ) &&
+		( cd gar/bage && git diff --quiet origin/main main^ ) &&
 		# Now push it to avoid confusing future tests
-		git push --recurse-submodules=on-demand ../pub.git master
+		git push --recurse-submodules=on-demand ../pub.git main
 	)
 '
 
@@ -287,14 +287,14 @@ test_expect_success 'push succeeds if submodule commit disabling recursion from
 		cd work &&
 		git add gar/bage &&
 		git commit -m "Recurse disable on command-line alternative overriding config for gar/bage" &&
-		git -c push.recurseSubmodules=check push --no-recurse-submodules ../pub.git master &&
+		git -c push.recurseSubmodules=check push --no-recurse-submodules ../pub.git main &&
 		# Check that the supermodule commit got there
 		git fetch ../pub.git &&
-		git diff --quiet FETCH_HEAD master &&
+		git diff --quiet FETCH_HEAD main &&
 		# But that the submodule commit did not
-		( cd gar/bage && git diff --quiet origin/master master^ ) &&
+		( cd gar/bage && git diff --quiet origin/main main^ ) &&
 		# Now push it to avoid confusing future tests
-		git push --recurse-submodules=on-demand ../pub.git master
+		git push --recurse-submodules=on-demand ../pub.git main
 	)
 '
 
@@ -304,7 +304,7 @@ test_expect_success 'submodule entry pointing at a tag is error' '
 	git -C work update-index --cacheinfo 160000 "$tag" gar/bage &&
 	git -C work commit -m "bad commit" &&
 	test_when_finished "git -C work reset --hard HEAD^" &&
-	test_must_fail git -C work push --recurse-submodules=on-demand ../pub.git master 2>err &&
+	test_must_fail git -C work push --recurse-submodules=on-demand ../pub.git main 2>err &&
 	test_i18ngrep "is a tag, not a commit" err
 '
 
@@ -319,9 +319,9 @@ test_expect_success 'push fails if recurse submodules option passed as yes' '
 		cd work &&
 		git add gar/bage &&
 		git commit -m "Recurse push fails if recurse submodules option passed as yes for gar/bage" &&
-		test_must_fail git push --recurse-submodules=yes ../pub.git master &&
-		test_must_fail git -c push.recurseSubmodules=yes push ../pub.git master &&
-		git push --recurse-submodules=on-demand ../pub.git master
+		test_must_fail git push --recurse-submodules=yes ../pub.git main &&
+		test_must_fail git -c push.recurseSubmodules=yes push ../pub.git main &&
+		git push --recurse-submodules=on-demand ../pub.git main
 	)
 '
 
@@ -363,7 +363,7 @@ test_expect_success 'push succeeds if submodule has no remote and is on the firs
 		) &&
 		git add b &&
 		git commit -m "added submodule" &&
-		git push --recurse-submodules=check origin master
+		git push --recurse-submodules=check origin main
 	)
 '
 
@@ -372,21 +372,21 @@ test_expect_success 'push unpushed submodules when not needed' '
 		cd work &&
 		(
 			cd gar/bage &&
-			git checkout master &&
+			git checkout main &&
 			>junk5 &&
 			git add junk5 &&
 			git commit -m "Fifth junk" &&
 			git push &&
-			git rev-parse origin/master >../../../expected
+			git rev-parse origin/main >../../../expected
 		) &&
-		git checkout master &&
+		git checkout main &&
 		git add gar/bage &&
 		git commit -m "Fifth commit for gar/bage" &&
-		git push --recurse-submodules=on-demand ../pub.git master
+		git push --recurse-submodules=on-demand ../pub.git main
 	) &&
 	(
 		cd submodule.git &&
-		git rev-parse master >../actual
+		git rev-parse main >../actual
 	) &&
 	test_cmp expected actual
 '
@@ -394,7 +394,7 @@ test_expect_success 'push unpushed submodules when not needed' '
 test_expect_success 'push unpushed submodules when not needed 2' '
 	(
 		cd submodule.git &&
-		git rev-parse master >../expected
+		git rev-parse main >../expected
 	) &&
 	(
 		cd work &&
@@ -407,11 +407,11 @@ test_expect_success 'push unpushed submodules when not needed 2' '
 		>junk2 &&
 		git add junk2 &&
 		git commit -m "Second junk for work" &&
-		git push --recurse-submodules=on-demand ../pub.git master
+		git push --recurse-submodules=on-demand ../pub.git main
 	) &&
 	(
 		cd submodule.git &&
-		git rev-parse master >../actual
+		git rev-parse main >../actual
 	) &&
 	test_cmp expected actual
 '
@@ -421,20 +421,20 @@ test_expect_success 'push unpushed submodules recursively' '
 		cd work &&
 		(
 			cd gar/bage &&
-			git checkout master &&
+			git checkout main &&
 			> junk7 &&
 			git add junk7 &&
 			git commit -m "Seventh junk" &&
-			git rev-parse master >../../../expected
+			git rev-parse main >../../../expected
 		) &&
-		git checkout master &&
+		git checkout main &&
 		git add gar/bage &&
 		git commit -m "Seventh commit for gar/bage" &&
-		git push --recurse-submodules=on-demand ../pub.git master
+		git push --recurse-submodules=on-demand ../pub.git main
 	) &&
 	(
 		cd submodule.git &&
-		git rev-parse master >../actual
+		git rev-parse main >../actual
 	) &&
 	test_cmp expected actual
 '
@@ -444,64 +444,64 @@ test_expect_success 'push unpushable submodule recursively fails' '
 		cd work &&
 		(
 			cd gar/bage &&
-			git rev-parse origin/master >../../../expected &&
-			git checkout master~0 &&
+			git rev-parse origin/main >../../../expected &&
+			git checkout main~0 &&
 			> junk8 &&
 			git add junk8 &&
 			git commit -m "Eighth junk"
 		) &&
 		git add gar/bage &&
 		git commit -m "Eighth commit for gar/bage" &&
-		test_must_fail git push --recurse-submodules=on-demand ../pub.git master
+		test_must_fail git push --recurse-submodules=on-demand ../pub.git main
 	) &&
 	(
 		cd submodule.git &&
-		git rev-parse master >../actual
+		git rev-parse main >../actual
 	) &&
-	test_when_finished git -C work reset --hard master^ &&
+	test_when_finished git -C work reset --hard main^ &&
 	test_cmp expected actual
 '
 
 test_expect_success 'push --dry-run does not recursively update submodules' '
 	(
 		cd work/gar/bage &&
-		git checkout master &&
-		git rev-parse master >../../../expected_submodule &&
+		git checkout main &&
+		git rev-parse main >../../../expected_submodule &&
 		> junk9 &&
 		git add junk9 &&
 		git commit -m "Ninth junk" &&
 
 		# Go up to 'work' directory
 		cd ../.. &&
-		git checkout master &&
-		git rev-parse master >../expected_pub &&
+		git checkout main &&
+		git rev-parse main >../expected_pub &&
 		git add gar/bage &&
 		git commit -m "Ninth commit for gar/bage" &&
-		git push --dry-run --recurse-submodules=on-demand ../pub.git master
+		git push --dry-run --recurse-submodules=on-demand ../pub.git main
 	) &&
-	git -C submodule.git rev-parse master >actual_submodule &&
-	git -C pub.git rev-parse master >actual_pub &&
+	git -C submodule.git rev-parse main >actual_submodule &&
+	git -C pub.git rev-parse main >actual_pub &&
 	test_cmp expected_pub actual_pub &&
 	test_cmp expected_submodule actual_submodule
 '
 
 test_expect_success 'push --dry-run does not recursively update submodules' '
-	git -C work push --dry-run --recurse-submodules=only ../pub.git master &&
+	git -C work push --dry-run --recurse-submodules=only ../pub.git main &&
 
-	git -C submodule.git rev-parse master >actual_submodule &&
-	git -C pub.git rev-parse master >actual_pub &&
+	git -C submodule.git rev-parse main >actual_submodule &&
+	git -C pub.git rev-parse main >actual_pub &&
 	test_cmp expected_pub actual_pub &&
 	test_cmp expected_submodule actual_submodule
 '
 
 test_expect_success 'push only unpushed submodules recursively' '
-	git -C work/gar/bage rev-parse master >expected_submodule &&
-	git -C pub.git rev-parse master >expected_pub &&
+	git -C work/gar/bage rev-parse main >expected_submodule &&
+	git -C pub.git rev-parse main >expected_pub &&
 
-	git -C work push --recurse-submodules=only ../pub.git master &&
+	git -C work push --recurse-submodules=only ../pub.git main &&
 
-	git -C submodule.git rev-parse master >actual_submodule &&
-	git -C pub.git rev-parse master >actual_pub &&
+	git -C submodule.git rev-parse main >actual_submodule &&
+	git -C pub.git rev-parse main >actual_pub &&
 	test_cmp expected_submodule actual_submodule &&
 	test_cmp expected_pub actual_pub
 '
@@ -517,14 +517,14 @@ test_expect_success 'push propagating the remotes name to a submodule' '
 	git -C work commit -m "Tenth junk added to gar/bage" &&
 
 	# Fails when submodule does not have a matching remote
-	test_must_fail git -C work push --recurse-submodules=on-demand pub master &&
+	test_must_fail git -C work push --recurse-submodules=on-demand pub main &&
 	# Succeeds when submodules has matching remote and refspec
-	git -C work push --recurse-submodules=on-demand origin master &&
+	git -C work push --recurse-submodules=on-demand origin main &&
 
-	git -C submodule.git rev-parse master >actual_submodule &&
-	git -C pub.git rev-parse master >actual_pub &&
-	git -C work/gar/bage rev-parse master >expected_submodule &&
-	git -C work rev-parse master >expected_pub &&
+	git -C submodule.git rev-parse main >actual_submodule &&
+	git -C pub.git rev-parse main >actual_pub &&
+	git -C work/gar/bage rev-parse main >expected_submodule &&
+	git -C work rev-parse main >expected_pub &&
 	test_cmp expected_submodule actual_submodule &&
 	test_cmp expected_pub actual_pub
 '
@@ -548,7 +548,7 @@ test_expect_success 'push propagating refspec to a submodule' '
 	test_must_fail git -C work push --recurse-submodules=on-demand origin \
 		HEAD:refs/heads/branch2 &&
 
-	git -C work/gar/bage branch branch2 master &&
+	git -C work/gar/bage branch branch2 main &&
 	git -C work push --recurse-submodules=on-demand origin branch2 &&
 
 	git -C submodule.git rev-parse branch2 >actual_submodule &&
diff --git a/t/t5533-push-cas.sh b/t/t5533-push-cas.sh
index 7813e8470e..9fcec604c3 100755
--- a/t/t5533-push-cas.sh
+++ b/t/t5533-push-cas.sh
@@ -29,22 +29,22 @@ setup_src_dup_dst () {
 	(
 		cd dup &&
 		git fetch &&
-		git merge origin/master &&
-		git switch -c branch master~2 &&
+		git merge origin/main &&
+		git switch -c branch main~2 &&
 		test_commit D &&
 		test_commit E &&
 		git push origin --all
 	) &&
 	(
 		cd src &&
-		git switch master &&
+		git switch main &&
 		git fetch --all &&
 		git branch branch --track origin/branch &&
-		git rebase origin/master
+		git rebase origin/main
 	) &&
 	(
 		cd dup &&
-		git switch master &&
+		git switch main &&
 		test_commit F &&
 		test_commit G &&
 		git switch branch &&
@@ -65,11 +65,11 @@ test_expect_success 'push to update (protected)' '
 	(
 		cd dst &&
 		test_commit D &&
-		test_must_fail git push --force-with-lease=master:master origin master 2>err &&
+		test_must_fail git push --force-with-lease=main:main origin main 2>err &&
 		grep "stale info" err
 	) &&
-	git ls-remote . refs/heads/master >expect &&
-	git ls-remote src refs/heads/master >actual &&
+	git ls-remote . refs/heads/main >expect &&
+	git ls-remote src refs/heads/main >actual &&
 	test_cmp expect actual
 '
 
@@ -78,11 +78,11 @@ test_expect_success 'push to update (protected, forced)' '
 	(
 		cd dst &&
 		test_commit D &&
-		git push --force --force-with-lease=master:master origin master 2>err &&
+		git push --force --force-with-lease=main:main origin main 2>err &&
 		grep "forced update" err
 	) &&
-	git ls-remote dst refs/heads/master >expect &&
-	git ls-remote src refs/heads/master >actual &&
+	git ls-remote dst refs/heads/main >expect &&
+	git ls-remote src refs/heads/main >actual &&
 	test_cmp expect actual
 '
 
@@ -90,20 +90,20 @@ test_expect_success 'push to update (protected, tracking)' '
 	setup_srcdst_basic &&
 	(
 		cd src &&
-		git checkout master &&
+		git checkout main &&
 		test_commit D &&
 		git checkout HEAD^0
 	) &&
-	git ls-remote src refs/heads/master >expect &&
+	git ls-remote src refs/heads/main >expect &&
 	(
 		cd dst &&
 		test_commit E &&
-		git ls-remote . refs/remotes/origin/master >expect &&
-		test_must_fail git push --force-with-lease=master origin master &&
-		git ls-remote . refs/remotes/origin/master >actual &&
+		git ls-remote . refs/remotes/origin/main >expect &&
+		test_must_fail git push --force-with-lease=main origin main &&
+		git ls-remote . refs/remotes/origin/main >actual &&
 		test_cmp expect actual
 	) &&
-	git ls-remote src refs/heads/master >actual &&
+	git ls-remote src refs/heads/main >actual &&
 	test_cmp expect actual
 '
 
@@ -111,18 +111,18 @@ test_expect_success 'push to update (protected, tracking, forced)' '
 	setup_srcdst_basic &&
 	(
 		cd src &&
-		git checkout master &&
+		git checkout main &&
 		test_commit D &&
 		git checkout HEAD^0
 	) &&
 	(
 		cd dst &&
 		test_commit E &&
-		git ls-remote . refs/remotes/origin/master >expect &&
-		git push --force --force-with-lease=master origin master
+		git ls-remote . refs/remotes/origin/main >expect &&
+		git push --force --force-with-lease=main origin main
 	) &&
-	git ls-remote dst refs/heads/master >expect &&
-	git ls-remote src refs/heads/master >actual &&
+	git ls-remote dst refs/heads/main >expect &&
+	git ls-remote src refs/heads/main >actual &&
 	test_cmp expect actual
 '
 
@@ -131,10 +131,10 @@ test_expect_success 'push to update (allowed)' '
 	(
 		cd dst &&
 		test_commit D &&
-		git push --force-with-lease=master:master^ origin master
+		git push --force-with-lease=main:main^ origin main
 	) &&
-	git ls-remote dst refs/heads/master >expect &&
-	git ls-remote src refs/heads/master >actual &&
+	git ls-remote dst refs/heads/main >expect &&
+	git ls-remote src refs/heads/main >actual &&
 	test_cmp expect actual
 '
 
@@ -143,11 +143,11 @@ test_expect_success 'push to update (allowed, tracking)' '
 	(
 		cd dst &&
 		test_commit D &&
-		git push --force-with-lease=master origin master 2>err &&
+		git push --force-with-lease=main origin main 2>err &&
 		! grep "forced update" err
 	) &&
-	git ls-remote dst refs/heads/master >expect &&
-	git ls-remote src refs/heads/master >actual &&
+	git ls-remote dst refs/heads/main >expect &&
+	git ls-remote src refs/heads/main >actual &&
 	test_cmp expect actual
 '
 
@@ -157,22 +157,22 @@ test_expect_success 'push to update (allowed even though no-ff)' '
 		cd dst &&
 		git reset --hard HEAD^ &&
 		test_commit D &&
-		git push --force-with-lease=master origin master 2>err &&
+		git push --force-with-lease=main origin main 2>err &&
 		grep "forced update" err
 	) &&
-	git ls-remote dst refs/heads/master >expect &&
-	git ls-remote src refs/heads/master >actual &&
+	git ls-remote dst refs/heads/main >expect &&
+	git ls-remote src refs/heads/main >actual &&
 	test_cmp expect actual
 '
 
 test_expect_success 'push to delete (protected)' '
 	setup_srcdst_basic &&
-	git ls-remote src refs/heads/master >expect &&
+	git ls-remote src refs/heads/main >expect &&
 	(
 		cd dst &&
-		test_must_fail git push --force-with-lease=master:master^ origin :master
+		test_must_fail git push --force-with-lease=main:main^ origin :main
 	) &&
-	git ls-remote src refs/heads/master >actual &&
+	git ls-remote src refs/heads/main >actual &&
 	test_cmp expect actual
 '
 
@@ -180,9 +180,9 @@ test_expect_success 'push to delete (protected, forced)' '
 	setup_srcdst_basic &&
 	(
 		cd dst &&
-		git push --force --force-with-lease=master:master^ origin :master
+		git push --force --force-with-lease=main:main^ origin :main
 	) &&
-	git ls-remote src refs/heads/master >actual &&
+	git ls-remote src refs/heads/main >actual &&
 	test_must_be_empty actual
 '
 
@@ -190,10 +190,10 @@ test_expect_success 'push to delete (allowed)' '
 	setup_srcdst_basic &&
 	(
 		cd dst &&
-		git push --force-with-lease=master origin :master 2>err &&
+		git push --force-with-lease=main origin :main 2>err &&
 		grep deleted err
 	) &&
-	git ls-remote src refs/heads/master >actual &&
+	git ls-remote src refs/heads/main >actual &&
 	test_must_be_empty actual
 '
 
@@ -201,12 +201,12 @@ test_expect_success 'cover everything with default force-with-lease (protected)'
 	setup_srcdst_basic &&
 	(
 		cd src &&
-		git branch naster master^
+		git branch nain main^
 	) &&
 	git ls-remote src refs/heads/\* >expect &&
 	(
 		cd dst &&
-		test_must_fail git push --force-with-lease origin master master:naster
+		test_must_fail git push --force-with-lease origin main main:nain
 	) &&
 	git ls-remote src refs/heads/\* >actual &&
 	test_cmp expect actual
@@ -216,16 +216,16 @@ test_expect_success 'cover everything with default force-with-lease (allowed)' '
 	setup_srcdst_basic &&
 	(
 		cd src &&
-		git branch naster master^
+		git branch nain main^
 	) &&
 	(
 		cd dst &&
 		git fetch &&
-		git push --force-with-lease origin master master:naster
+		git push --force-with-lease origin main main:nain
 	) &&
-	git ls-remote dst refs/heads/master |
-	sed -e "s/master/naster/" >expect &&
-	git ls-remote src refs/heads/naster >actual &&
+	git ls-remote dst refs/heads/main |
+	sed -e "s/main/nain/" >expect &&
+	git ls-remote src refs/heads/nain >actual &&
 	test_cmp expect actual
 '
 
@@ -233,7 +233,7 @@ test_expect_success 'new branch covered by force-with-lease' '
 	setup_srcdst_basic &&
 	(
 		cd dst &&
-		git branch branch master &&
+		git branch branch main &&
 		git push --force-with-lease=branch origin branch
 	) &&
 	git ls-remote dst refs/heads/branch >expect &&
@@ -245,7 +245,7 @@ test_expect_success 'new branch covered by force-with-lease (explicit)' '
 	setup_srcdst_basic &&
 	(
 		cd dst &&
-		git branch branch master &&
+		git branch branch main &&
 		git push --force-with-lease=branch: origin branch
 	) &&
 	git ls-remote dst refs/heads/branch >expect &&
@@ -257,12 +257,12 @@ test_expect_success 'new branch already exists' '
 	setup_srcdst_basic &&
 	(
 		cd src &&
-		git checkout -b branch master &&
+		git checkout -b branch main &&
 		test_commit F
 	) &&
 	(
 		cd dst &&
-		git branch branch master &&
+		git branch branch main &&
 		test_must_fail git push --force-with-lease=branch: origin branch
 	)
 '
@@ -277,7 +277,7 @@ test_expect_success 'background updates of REMOTE can be mitigated with a non-up
 		cd dst &&
 		test_commit G &&
 		git remote add origin-push ../src.bare &&
-		git push origin-push master:master
+		git push origin-push main:main
 	) &&
 	git clone --no-local src.bare dst2 &&
 	test_when_finished "rm -rf dst2" &&
@@ -299,58 +299,58 @@ test_expect_success 'background updates of REMOTE can be mitigated with a non-up
 test_expect_success 'background updates to remote can be mitigated with "--force-if-includes"' '
 	setup_src_dup_dst &&
 	test_when_finished "rm -fr dst src dup" &&
-	git ls-remote dst refs/heads/master >expect.master &&
+	git ls-remote dst refs/heads/main >expect.main &&
 	git ls-remote dst refs/heads/branch >expect.branch &&
 	(
 		cd src &&
 		git switch branch &&
 		test_commit I &&
-		git switch master &&
+		git switch main &&
 		test_commit J &&
 		git fetch --all &&
 		test_must_fail git push --force-with-lease --force-if-includes --all
 	) &&
-	git ls-remote dst refs/heads/master >actual.master &&
+	git ls-remote dst refs/heads/main >actual.main &&
 	git ls-remote dst refs/heads/branch >actual.branch &&
-	test_cmp expect.master actual.master &&
+	test_cmp expect.main actual.main &&
 	test_cmp expect.branch actual.branch
 '
 
 test_expect_success 'background updates to remote can be mitigated with "push.useForceIfIncludes"' '
 	setup_src_dup_dst &&
 	test_when_finished "rm -fr dst src dup" &&
-	git ls-remote dst refs/heads/master >expect.master &&
+	git ls-remote dst refs/heads/main >expect.main &&
 	(
 		cd src &&
 		git switch branch &&
 		test_commit I &&
-		git switch master &&
+		git switch main &&
 		test_commit J &&
 		git fetch --all &&
 		git config --local push.useForceIfIncludes true &&
-		test_must_fail git push --force-with-lease=master origin master
+		test_must_fail git push --force-with-lease=main origin main
 	) &&
-	git ls-remote dst refs/heads/master >actual.master &&
-	test_cmp expect.master actual.master
+	git ls-remote dst refs/heads/main >actual.main &&
+	test_cmp expect.main actual.main
 '
 
 test_expect_success '"--force-if-includes" should be disabled for --force-with-lease="<refname>:<expect>"' '
 	setup_src_dup_dst &&
 	test_when_finished "rm -fr dst src dup" &&
-	git ls-remote dst refs/heads/master >expect.master &&
+	git ls-remote dst refs/heads/main >expect.main &&
 	(
 		cd src &&
 		git switch branch &&
 		test_commit I &&
-		git switch master &&
+		git switch main &&
 		test_commit J &&
-		remote_head="$(git rev-parse refs/remotes/origin/master)" &&
+		remote_head="$(git rev-parse refs/remotes/origin/main)" &&
 		git fetch --all &&
-		test_must_fail git push --force-if-includes --force-with-lease="master:$remote_head" 2>err &&
+		test_must_fail git push --force-if-includes --force-with-lease="main:$remote_head" 2>err &&
 		grep "stale info" err
 	) &&
-	git ls-remote dst refs/heads/master >actual.master &&
-	test_cmp expect.master actual.master
+	git ls-remote dst refs/heads/main >actual.main &&
+	test_cmp expect.main actual.main
 '
 
 test_expect_success '"--force-if-includes" should allow forced update after a rebase ("pull --rebase")' '
@@ -360,10 +360,10 @@ test_expect_success '"--force-if-includes" should allow forced update after a re
 		cd src &&
 		git switch branch &&
 		test_commit I &&
-		git switch master &&
+		git switch main &&
 		test_commit J &&
-		git pull --rebase origin master &&
-		git push --force-if-includes --force-with-lease="master"
+		git pull --rebase origin main &&
+		git push --force-if-includes --force-with-lease="main"
 	)
 '
 
@@ -374,11 +374,11 @@ test_expect_success '"--force-if-includes" should allow forced update after a re
 		cd src &&
 		git switch branch &&
 		test_commit I &&
-		git switch master &&
+		git switch main &&
 		test_commit J &&
-		git pull --rebase origin master &&
+		git pull --rebase origin main &&
 		git rebase --onto HEAD~4 HEAD~1 &&
-		git push --force-if-includes --force-with-lease="master"
+		git push --force-if-includes --force-with-lease="main"
 	)
 '
 
diff --git a/t/t5534-push-signed.sh b/t/t5534-push-signed.sh
index af0385fb89..0e850a76de 100755
--- a/t/t5534-push-signed.sh
+++ b/t/t5534-push-signed.sh
@@ -9,11 +9,11 @@ prepare_dst () {
 	rm -fr dst &&
 	test_create_repo dst &&
 
-	git push dst master:noop master:ff master:noff
+	git push dst main:noop main:ff main:noff
 }
 
 test_expect_success setup '
-	# master, ff and noff branches pointing at the same commit
+	# main, ff and noff branches pointing at the same commit
 	test_tick &&
 	git commit --allow-empty -m initial &&
 
diff --git a/t/t5537-fetch-shallow.sh b/t/t5537-fetch-shallow.sh
index a55202d2d3..01071f2306 100755
--- a/t/t5537-fetch-shallow.sh
+++ b/t/t5537-fetch-shallow.sh
@@ -49,7 +49,7 @@ test_expect_success 'fetch from shallow clone' '
 	cd shallow2 &&
 	git fetch &&
 	git fsck &&
-	git log --format=%s origin/master >actual &&
+	git log --format=%s origin/main >actual &&
 	test_write_lines 5 4 3 >expect &&
 	test_cmp expect actual
 	)
@@ -64,7 +64,7 @@ test_expect_success 'fetch --depth from shallow clone' '
 	cd shallow2 &&
 	git fetch --depth=2 &&
 	git fsck &&
-	git log --format=%s origin/master >actual &&
+	git log --format=%s origin/main >actual &&
 	test_write_lines 6 5 >expect &&
 	test_cmp expect actual
 	)
@@ -75,7 +75,7 @@ test_expect_success 'fetch --unshallow from shallow clone' '
 	cd shallow2 &&
 	git fetch --unshallow &&
 	git fsck &&
-	git log --format=%s origin/master >actual &&
+	git log --format=%s origin/main >actual &&
 	test_write_lines 6 5 4 3 >expect &&
 	test_cmp expect actual
 	)
@@ -89,7 +89,7 @@ test_expect_success 'fetch --unshallow from a full clone' '
 	test_write_lines 4 3 >expect &&
 	test_cmp expect actual &&
 	git -c fetch.writeCommitGraph fetch --unshallow &&
-	git log origin/master --format=%s >actual &&
+	git log origin/main --format=%s >actual &&
 	test_write_lines 4 3 2 1 >expect &&
 	test_cmp expect actual
 	)
@@ -104,9 +104,9 @@ test_expect_success 'fetch something upstream has but hidden by clients shallow
 	git commit -m add-1-back &&
 	(
 	cd shallow2 &&
-	git fetch ../.git +refs/heads/master:refs/remotes/top/master &&
+	git fetch ../.git +refs/heads/main:refs/remotes/top/main &&
 	git fsck &&
-	git log --format=%s top/master >actual &&
+	git log --format=%s top/main >actual &&
 	test_write_lines add-1-back 4 3 >expect &&
 	test_cmp expect actual
 	) &&
@@ -135,7 +135,7 @@ test_expect_success 'fetch that requires changes in .git/shallow is filtered' '
 test_expect_success 'fetch --update-shallow' '
 	(
 	cd shallow &&
-	git checkout master &&
+	git checkout main &&
 	commit 7 &&
 	git tag -m foo heavy-tag HEAD^ &&
 	git tag light-tag HEAD^:tracked
@@ -146,13 +146,13 @@ test_expect_success 'fetch --update-shallow' '
 	git fsck &&
 	git for-each-ref --sort=refname --format="%(refname)" >actual.refs &&
 	cat <<-\EOF >expect.refs &&
-	refs/remotes/shallow/master
+	refs/remotes/shallow/main
 	refs/remotes/shallow/no-shallow
 	refs/tags/heavy-tag
 	refs/tags/light-tag
 	EOF
 	test_cmp expect.refs actual.refs &&
-	git log --format=%s shallow/master >actual &&
+	git log --format=%s shallow/main >actual &&
 	test_write_lines 7 6 5 4 3 >expect &&
 	test_cmp expect actual
 	)
@@ -161,7 +161,7 @@ test_expect_success 'fetch --update-shallow' '
 test_expect_success 'fetch --update-shallow (with fetch.writeCommitGraph)' '
 	(
 	cd shallow &&
-	git checkout master &&
+	git checkout main &&
 	commit 8 &&
 	git tag -m foo heavy-tag-for-graph HEAD^ &&
 	git tag light-tag-for-graph HEAD^:tracked
@@ -173,7 +173,7 @@ test_expect_success 'fetch --update-shallow (with fetch.writeCommitGraph)' '
 	git fsck &&
 	git for-each-ref --sort=refname --format="%(refname)" >actual.refs &&
 	cat <<-EOF >expect.refs &&
-	refs/remotes/shallow/master
+	refs/remotes/shallow/main
 	refs/remotes/shallow/no-shallow
 	refs/tags/heavy-tag
 	refs/tags/heavy-tag-for-graph
@@ -181,7 +181,7 @@ test_expect_success 'fetch --update-shallow (with fetch.writeCommitGraph)' '
 	refs/tags/light-tag-for-graph
 	EOF
 	test_cmp expect.refs actual.refs &&
-	git log --format=%s shallow/master >actual &&
+	git log --format=%s shallow/main >actual &&
 	test_write_lines 8 7 6 5 4 3 >expect &&
 	test_cmp expect actual
 	)
@@ -206,7 +206,7 @@ test_expect_success '.git/shallow is edited by repack' '
 	test_commit -C shallow-server E &&
 	test_commit -C shallow-server D &&
 	d="$(git -C shallow-server rev-parse --verify D^0)" &&
-	git -C shallow-server checkout master &&
+	git -C shallow-server checkout main &&
 
 	git clone --depth=1 --no-tags --no-single-branch \
 		"file://$PWD/shallow-server" shallow-client &&
@@ -244,7 +244,7 @@ test_expect_success 'shallow fetches check connectivity before writing shallow f
 	git -C "$REPO" config protocol.version 2 &&
 	git -C client config protocol.version 2 &&
 
-	git -C client fetch --depth=2 "$HTTPD_URL/one_time_perl/repo" master:a_branch &&
+	git -C client fetch --depth=2 "$HTTPD_URL/one_time_perl/repo" main:a_branch &&
 
 	# Craft a situation in which the server sends back an unshallow request
 	# with an empty packfile. This is done by refetching with a shorter
@@ -256,7 +256,7 @@ test_expect_success 'shallow fetches check connectivity before writing shallow f
 	       >"$HTTPD_ROOT_PATH/one-time-perl" &&
 	test_must_fail env GIT_TEST_SIDEBAND_ALL=0 git -C client \
 		fetch --depth=1 "$HTTPD_URL/one_time_perl/repo" \
-		master:a_branch &&
+		main:a_branch &&
 
 	# Ensure that the one-time-perl script was used.
 	! test -e "$HTTPD_ROOT_PATH/one-time-perl" &&
diff --git a/t/t5538-push-shallow.sh b/t/t5538-push-shallow.sh
index ecbf84d21c..9d3e946bf1 100755
--- a/t/t5538-push-shallow.sh
+++ b/t/t5538-push-shallow.sh
@@ -44,9 +44,9 @@ test_expect_success 'push from shallow clone' '
 	(
 	cd shallow &&
 	commit 5 &&
-	git push ../.git +master:refs/remotes/shallow/master
+	git push ../.git +main:refs/remotes/shallow/main
 	) &&
-	git log --format=%s shallow/master >actual &&
+	git log --format=%s shallow/main >actual &&
 	git fsck &&
 	cat <<EOF >expect &&
 5
@@ -61,10 +61,10 @@ EOF
 test_expect_success 'push from shallow clone, with grafted roots' '
 	(
 	cd shallow2 &&
-	test_must_fail git push ../.git +master:refs/remotes/shallow2/master 2>err &&
-	grep "shallow2/master.*shallow update not allowed" err
+	test_must_fail git push ../.git +main:refs/remotes/shallow2/main 2>err &&
+	grep "shallow2/main.*shallow update not allowed" err
 	) &&
-	test_must_fail git rev-parse shallow2/master &&
+	test_must_fail git rev-parse shallow2/main &&
 	git fsck
 '
 
@@ -72,9 +72,9 @@ test_expect_success 'add new shallow root with receive.updateshallow on' '
 	test_config receive.shallowupdate true &&
 	(
 	cd shallow2 &&
-	git push ../.git +master:refs/remotes/shallow2/master
+	git push ../.git +main:refs/remotes/shallow2/main
 	) &&
-	git log --format=%s shallow2/master >actual &&
+	git log --format=%s shallow2/main >actual &&
 	git fsck &&
 	cat <<EOF >expect &&
 c
@@ -87,12 +87,12 @@ test_expect_success 'push from shallow to shallow' '
 	(
 	cd shallow &&
 	git --git-dir=../shallow2/.git config receive.shallowupdate true &&
-	git push ../shallow2/.git +master:refs/remotes/shallow/master &&
+	git push ../shallow2/.git +main:refs/remotes/shallow/main &&
 	git --git-dir=../shallow2/.git config receive.shallowupdate false
 	) &&
 	(
 	cd shallow2 &&
-	git log --format=%s shallow/master >actual &&
+	git log --format=%s shallow/main >actual &&
 	git fsck &&
 	cat <<EOF >expect &&
 5
@@ -106,10 +106,10 @@ EOF
 test_expect_success 'push from full to shallow' '
 	! git --git-dir=shallow2/.git cat-file blob $(echo 1|git hash-object --stdin) &&
 	commit 1 &&
-	git push shallow2/.git +master:refs/remotes/top/master &&
+	git push shallow2/.git +main:refs/remotes/top/main &&
 	(
 	cd shallow2 &&
-	git log --format=%s top/master >actual &&
+	git log --format=%s top/main >actual &&
 	git fsck &&
 	cat <<EOF >expect &&
 1
diff --git a/t/t5539-fetch-http-shallow.sh b/t/t5539-fetch-http-shallow.sh
index 82aa99ae87..4397197829 100755
--- a/t/t5539-fetch-http-shallow.sh
+++ b/t/t5539-fetch-http-shallow.sh
@@ -32,7 +32,7 @@ test_expect_success 'clone http repository' '
 	(
 	cd clone &&
 	git fsck &&
-	git log --format=%s origin/master >actual &&
+	git log --format=%s origin/main >actual &&
 	cat <<EOF >expect &&
 7
 6
@@ -60,9 +60,9 @@ test_expect_success 'no shallow lines after receiving ACK ready' '
 				refs/heads/unrelated$i:refs/heads/unrelated$i ||
 			exit 1
 		done &&
-		git checkout master &&
+		git checkout main &&
 		test_commit new &&
-		git push  "$HTTPD_DOCUMENT_ROOT_PATH/repo.git" master
+		git push  "$HTTPD_DOCUMENT_ROOT_PATH/repo.git" main
 	) &&
 	(
 		cd clone &&
@@ -95,7 +95,7 @@ test_expect_success 'clone shallow since ...' '
 
 test_expect_success 'fetch shallow since ...' '
 	git -C shallow11 fetch --shallow-since "200000000 +0700" origin &&
-	git -C shallow11 log --pretty=tformat:%s origin/master >actual &&
+	git -C shallow11 log --pretty=tformat:%s origin/main >actual &&
 	cat >expected <<-\EOF &&
 	three
 	two
@@ -120,7 +120,7 @@ test_expect_success 'shallow clone exclude tag two' '
 
 test_expect_success 'fetch exclude tag one' '
 	git -C shallow12 fetch --shallow-exclude one origin &&
-	git -C shallow12 log --pretty=tformat:%s origin/master >actual &&
+	git -C shallow12 log --pretty=tformat:%s origin/main >actual &&
 	test_write_lines three two >expected &&
 	test_cmp expected actual
 '
@@ -136,12 +136,12 @@ test_expect_success 'fetching deepen' '
 	git clone --depth 1 $HTTPD_URL/smart/shallow-deepen.git deepen &&
 	mv "$HTTPD_DOCUMENT_ROOT_PATH/shallow-deepen.git" .git &&
 	test_commit four &&
-	git -C deepen log --pretty=tformat:%s master >actual &&
+	git -C deepen log --pretty=tformat:%s main >actual &&
 	echo three >expected &&
 	test_cmp expected actual &&
 	mv .git "$HTTPD_DOCUMENT_ROOT_PATH/shallow-deepen.git" &&
 	git -C deepen fetch --deepen=1 &&
-	git -C deepen log --pretty=tformat:%s origin/master >actual &&
+	git -C deepen log --pretty=tformat:%s origin/main >actual &&
 	cat >expected <<-\EOF &&
 	four
 	three
diff --git a/t/test-lib.sh b/t/test-lib.sh
index a12a1993d0..381416825c 100644
--- a/t/test-lib.sh
+++ b/t/test-lib.sh
@@ -257,13 +257,13 @@ case "$TRASH_DIRECTORY" in
 esac
 
 case "$TEST_NUMBER" in
-3404|4013|5310)
+3404|4013|5310|5526)
 	# Avoid conflicts with patch series that are cooking at the same time
 	# as the patch series changing the default of `init.defaultBranch`.
 	GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
 	export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 	;;
-[0-4]*|5[0-4]*|55[01]*)
+[0-4]*|5[0-4]*|55[0-3]*)
 	GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 	export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 	;;
-- 
gitgitgadget


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH v2 15/27] t55[4-9]*: adjust the references to the default branch name "main"
  2020-11-17 16:12 ` [PATCH v2 00/27] tests: use " Johannes Schindelin via GitGitGadget
                     ` (13 preceding siblings ...)
  2020-11-17 16:12   ` [PATCH v2 14/27] t55[23]*: " Johannes Schindelin via GitGitGadget
@ 2020-11-17 16:12   ` Johannes Schindelin via GitGitGadget
  2020-11-17 16:12   ` [PATCH v2 16/27] t5[6-9]*: " Johannes Schindelin via GitGitGadget
                     ` (13 subsequent siblings)
  28 siblings, 0 replies; 163+ messages in thread
From: Johannes Schindelin via GitGitGadget @ 2020-11-17 16:12 UTC (permalink / raw)
  To: git
  Cc: Felipe Contreras, Ævar Arnfjörð Bjarmason,
	Johannes Schindelin, Jeff King, Johannes Schindelin,
	Johannes Schindelin

From: Johannes Schindelin <johannes.schindelin@gmx.de>

This trick was performed via

	$ (cd t &&
	   sed -i -e 's/master/main/g' -e 's/MASTER/MAIN/g' \
		-e 's/Master/Main/g' -e 's/retsam/niam/g' \
		-- t55[4-9]*.sh t556x*)

This allows us to define `GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main`
for those tests.

Note that t5541 uses the reversed `master` name: `retsam`. We replace it
by the equivalent for `main`: `niam`.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
---
 t/t5540-http-push-webdav.sh          |  8 +--
 t/t5541-http-push-smart.sh           | 40 +++++++-------
 t/t5542-push-http-shallow.sh         |  8 +--
 t/t5543-atomic-push.sh               | 80 +++++++++++++--------------
 t/t5545-push-options.sh              | 62 ++++++++++-----------
 t/t5548-push-porcelain.sh            | 64 +++++++++++-----------
 t/t5550-http-fetch-dumb.sh           | 20 +++----
 t/t5551-http-fetch-smart.sh          | 20 +++----
 t/t5552-skipping-fetch-negotiator.sh |  2 +-
 t/t5553-set-upstream.sh              | 82 ++++++++++++++--------------
 t/t5561-http-backend.sh              |  4 +-
 t/t556x_common                       |  8 +--
 t/t5570-git-daemon.sh                | 16 +++---
 t/t5571-pre-push-hook.sh             |  4 +-
 t/t5572-pull-submodule.sh            |  4 +-
 t/t5580-unc-paths.sh                 |  2 +-
 t/t5581-http-curl-verbose.sh         |  2 +-
 t/t5582-fetch-negative-refspec.sh    | 22 ++++----
 t/test-lib.sh                        |  2 +-
 19 files changed, 225 insertions(+), 225 deletions(-)

diff --git a/t/t5540-http-push-webdav.sh b/t/t5540-http-push-webdav.sh
index 450321fddb..1973d8bb32 100755
--- a/t/t5540-http-push-webdav.sh
+++ b/t/t5540-http-push-webdav.sh
@@ -71,7 +71,7 @@ test_expect_success 'push already up-to-date' '
 test_expect_success 'push to remote repository with unpacked refs' '
 	(cd "$HTTPD_DOCUMENT_ROOT_PATH"/test_repo.git &&
 	 rm packed-refs &&
-	 git update-ref refs/heads/master $ORIG_HEAD &&
+	 git update-ref refs/heads/main $ORIG_HEAD &&
 	 git --bare update-server-info) &&
 	git push &&
 	(cd "$HTTPD_DOCUMENT_ROOT_PATH"/test_repo.git &&
@@ -91,7 +91,7 @@ test_expect_success 'http-push fetches unpacked objects' '
 	 git remote rm origin &&
 	 git reflog expire --expire=0 --all &&
 	 git prune &&
-	 git push -f -v $HTTPD_URL/dumb/test_repo_unpacked.git master)
+	 git push -f -v $HTTPD_URL/dumb/test_repo_unpacked.git main)
 '
 
 test_expect_success 'http-push fetches packed objects' '
@@ -111,7 +111,7 @@ test_expect_success 'http-push fetches packed objects' '
 	 git remote remove origin &&
 	 git reflog expire --expire=0 --all &&
 	 git prune &&
-	 git push -f -v $HTTPD_URL/dumb/test_repo_packed.git master)
+	 git push -f -v $HTTPD_URL/dumb/test_repo_packed.git main)
 '
 
 test_expect_success 'create and delete remote branch' '
@@ -163,7 +163,7 @@ test_expect_success 'PUT and MOVE sends object to URLs with SHA-1 hash suffix' '
 '
 
 test_http_push_nonff "$HTTPD_DOCUMENT_ROOT_PATH"/test_repo.git \
-	"$ROOT_PATH"/test_repo_clone master
+	"$ROOT_PATH"/test_repo_clone main
 
 test_expect_success 'push to password-protected repository (user in URL)' '
 	test_commit pw-user &&
diff --git a/t/t5541-http-push-smart.sh b/t/t5541-http-push-smart.sh
index 187454f5dd..ae90ed230b 100755
--- a/t/t5541-http-push-smart.sh
+++ b/t/t5541-http-push-smart.sh
@@ -142,23 +142,23 @@ test_expect_success 'used receive-pack service' '
 '
 
 test_http_push_nonff "$HTTPD_DOCUMENT_ROOT_PATH"/test_repo.git \
-	"$ROOT_PATH"/test_repo_clone master 		success
+	"$ROOT_PATH"/test_repo_clone main 		success
 
 test_expect_success 'push fails for non-fast-forward refs unmatched by remote helper' '
 	# create a dissimilarly-named remote ref so that git is unable to match the
 	# two refs (viz. local, remote) unless an explicit refspec is provided.
-	git push origin master:retsam &&
+	git push origin main:niam &&
 
 	echo "change changed" > path2 &&
 	git commit -a -m path2 --amend &&
 
-	# push master too; this ensures there is at least one '"'push'"' command to
+	# push main too; this ensures there is at least one '"'push'"' command to
 	# the remote helper and triggers interaction with the helper.
-	test_must_fail git push -v origin +master master:retsam >output 2>&1'
+	test_must_fail git push -v origin +main main:niam >output 2>&1'
 
 test_expect_success 'push fails for non-fast-forward refs unmatched by remote helper: remote output' '
-	grep "^ + [a-f0-9]*\.\.\.[a-f0-9]* *master -> master (forced update)$" output &&
-	grep "^ ! \[rejected\] *master -> retsam (non-fast-forward)$" output
+	grep "^ + [a-f0-9]*\.\.\.[a-f0-9]* *main -> main (forced update)$" output &&
+	grep "^ ! \[rejected\] *main -> niam (non-fast-forward)$" output
 '
 
 test_expect_success 'push fails for non-fast-forward refs unmatched by remote helper: our output' '
@@ -167,7 +167,7 @@ test_expect_success 'push fails for non-fast-forward refs unmatched by remote he
 '
 
 test_expect_success 'push (chunked)' '
-	git checkout master &&
+	git checkout main &&
 	test_commit commit path3 &&
 	HEAD=$(git rev-parse --verify HEAD) &&
 	test_config http.postbuffer 4 &&
@@ -177,9 +177,9 @@ test_expect_success 'push (chunked)' '
 	 test $HEAD = $(git rev-parse --verify HEAD))
 '
 
-## References of remote: atomic1(1)            master(2) collateral(2) other(2)
-## References of local :            atomic2(2) master(1) collateral(3) other(2) collateral1(3) atomic(1)
-## Atomic push         :                       master(1) collateral(3)                         atomic(1)
+## References of remote: atomic1(1)            main(2) collateral(2) other(2)
+## References of local :            atomic2(2) main(1) collateral(3) other(2) collateral1(3) atomic(1)
+## Atomic push         :                       main(1) collateral(3)                         atomic(1)
 test_expect_success 'push --atomic also prevents branch creation, reports collateral' '
 	# Setup upstream repo - empty for now
 	d=$HTTPD_DOCUMENT_ROOT_PATH/atomic-branches.git &&
@@ -192,15 +192,15 @@ test_expect_success 'push --atomic also prevents branch creation, reports collat
 	test_commit atomic2 &&
 	git branch collateral &&
 	git branch other &&
-	git push "$up" atomic1 master collateral other &&
+	git push "$up" atomic1 main collateral other &&
 	git tag -d atomic1 &&
 
 	# collateral is a valid push, but should be failed by atomic push
 	git checkout collateral &&
 	test_commit collateral1 &&
 
-	# Make master incompatible with upstream to provoke atomic
-	git checkout master &&
+	# Make main incompatible with upstream to provoke atomic
+	git checkout main &&
 	git reset --hard HEAD^ &&
 
 	# Add a new branch which should be failed by atomic push. This is a
@@ -208,7 +208,7 @@ test_expect_success 'push --atomic also prevents branch creation, reports collat
 	git branch atomic &&
 
 	# --atomic should cause entire push to be rejected
-	test_must_fail git push --atomic "$up" master atomic collateral 2>output &&
+	test_must_fail git push --atomic "$up" main atomic collateral 2>output &&
 
 	# the new branch should not have been created upstream
 	test_must_fail git -C "$d" show-ref --verify refs/heads/atomic &&
@@ -216,15 +216,15 @@ test_expect_success 'push --atomic also prevents branch creation, reports collat
 	# upstream should still reflect atomic2, the last thing we pushed
 	# successfully
 	git rev-parse atomic2 >expected &&
-	# on master...
-	git -C "$d" rev-parse refs/heads/master >actual &&
+	# on main...
+	git -C "$d" rev-parse refs/heads/main >actual &&
 	test_cmp expected actual &&
 	# ...and collateral.
 	git -C "$d" rev-parse refs/heads/collateral >actual &&
 	test_cmp expected actual &&
 
 	# the failed refs should be indicated to the user
-	grep "^ ! .*rejected.* master -> master" output &&
+	grep "^ ! .*rejected.* main -> main" output &&
 
 	# the collateral failure refs should be indicated to the user
 	grep "^ ! .*rejected.* atomic -> atomic .*atomic push failed" output &&
@@ -472,9 +472,9 @@ test_expect_success 'clone/fetch scrubs password from reflogs' '
 	test_commit prepare-for-force-fetch &&
 	git switch -c away &&
 	git fetch "$HTTPD_URL_USER_PASS/smart/test_repo.git" \
-		+master:master &&
+		+main:main &&
 	# should have been scrubbed down to vanilla URL
-	git log -g master >reflog &&
+	git log -g main >reflog &&
 	grep "$HTTPD_URL" reflog &&
 	! grep "$HTTPD_URL_USER_PASS" reflog
 '
@@ -498,7 +498,7 @@ test_expect_success 'colorize errors/hints' '
 	cd "$ROOT_PATH"/test_repo_clone &&
 	test_must_fail git -c color.transport=always -c color.advice=always \
 		-c color.push=always \
-		push origin origin/master^:master 2>act &&
+		push origin origin/main^:main 2>act &&
 	test_decode_color <act >decoded &&
 	test_i18ngrep "<RED>.*rejected.*<RESET>" decoded &&
 	test_i18ngrep "<RED>error: failed to push some refs" decoded &&
diff --git a/t/t5542-push-http-shallow.sh b/t/t5542-push-http-shallow.sh
index ddc1db722d..0d8f5219da 100755
--- a/t/t5542-push-http-shallow.sh
+++ b/t/t5542-push-http-shallow.sh
@@ -51,12 +51,12 @@ test_expect_success 'push to shallow repo via http' '
 	(
 	cd full &&
 	commit 9 &&
-	git push $HTTPD_URL/smart/repo.git +master:refs/remotes/top/master
+	git push $HTTPD_URL/smart/repo.git +main:refs/remotes/top/main
 	) &&
 	(
 	cd "$HTTPD_DOCUMENT_ROOT_PATH/repo.git" &&
 	git fsck &&
-	git log --format=%s top/master >actual &&
+	git log --format=%s top/main >actual &&
 	cat <<EOF >expect &&
 9
 4
@@ -74,11 +74,11 @@ test_expect_success 'push from shallow repo via http' '
 	git config http.receivepack true
 	) &&
 	commit 10 &&
-	git push $HTTPD_URL/smart/repo.git +master:refs/remotes/top/master &&
+	git push $HTTPD_URL/smart/repo.git +main:refs/remotes/top/main &&
 	(
 	cd "$HTTPD_DOCUMENT_ROOT_PATH/repo.git" &&
 	git fsck &&
-	git log --format=%s top/master >actual &&
+	git log --format=%s top/main >actual &&
 	cat <<EOF >expect &&
 10
 4
diff --git a/t/t5543-atomic-push.sh b/t/t5543-atomic-push.sh
index 620c30d58f..01a9a6e9e0 100755
--- a/t/t5543-atomic-push.sh
+++ b/t/t5543-atomic-push.sh
@@ -40,9 +40,9 @@ test_expect_success 'atomic push works for a single branch' '
 		test_commit one &&
 		git push --mirror up &&
 		test_commit two &&
-		git push --atomic up master
+		git push --atomic up main
 	) &&
-	test_refs master master
+	test_refs main main
 '
 
 test_expect_success 'atomic push works for two branches' '
@@ -55,9 +55,9 @@ test_expect_success 'atomic push works for two branches' '
 		test_commit two &&
 		git checkout second &&
 		test_commit three &&
-		git push --atomic up master second
+		git push --atomic up main second
 	) &&
-	test_refs master master &&
+	test_refs main main &&
 	test_refs second second
 '
 
@@ -70,7 +70,7 @@ test_expect_success 'atomic push works in combination with --mirror' '
 		test_commit two &&
 		git push --atomic --mirror up
 	) &&
-	test_refs master master &&
+	test_refs main main &&
 	test_refs second second
 '
 
@@ -79,7 +79,7 @@ test_expect_success 'atomic push works in combination with --force' '
 	(
 		cd workbench &&
 		test_commit one &&
-		git branch second master &&
+		git branch second main &&
 		test_commit two_a &&
 		git checkout second &&
 		test_commit two_b &&
@@ -87,36 +87,36 @@ test_expect_success 'atomic push works in combination with --force' '
 		test_commit four &&
 		git push --mirror up &&
 		# The actual test is below
-		git checkout master &&
+		git checkout main &&
 		test_commit three_a &&
 		git checkout second &&
 		git reset --hard HEAD^ &&
-		git push --force --atomic up master second
+		git push --force --atomic up main second
 	) &&
-	test_refs master master &&
+	test_refs main main &&
 	test_refs second second
 '
 
-# set up two branches where master can be pushed but second can not
+# set up two branches where main can be pushed but second can not
 # (non-fast-forward). Since second can not be pushed the whole operation
-# will fail and leave master untouched.
+# will fail and leave main untouched.
 test_expect_success 'atomic push fails if one branch fails' '
 	mk_repo_pair &&
 	(
 		cd workbench &&
 		test_commit one &&
-		git checkout -b second master &&
+		git checkout -b second main &&
 		test_commit two &&
 		test_commit three &&
 		test_commit four &&
 		git push --mirror up &&
 		git reset --hard HEAD~2 &&
 		test_commit five &&
-		git checkout master &&
+		git checkout main &&
 		test_commit six &&
 		test_must_fail git push --atomic --all up
 	) &&
-	test_refs master HEAD@{7} &&
+	test_refs main HEAD@{7} &&
 	test_refs second HEAD@{4}
 '
 
@@ -126,7 +126,7 @@ test_expect_success 'atomic push fails if one tag fails remotely' '
 	(
 		cd workbench &&
 		test_commit one &&
-		git checkout -b second master &&
+		git checkout -b second main &&
 		test_commit two &&
 		git push --mirror up
 	) &&
@@ -139,14 +139,14 @@ test_expect_success 'atomic push fails if one tag fails remotely' '
 	# see if we can now push both branches.
 	(
 		cd workbench &&
-		git checkout master &&
+		git checkout main &&
 		test_commit three &&
 		git checkout second &&
 		test_commit four &&
 		git tag test_tag &&
-		test_must_fail git push --tags --atomic up master second
+		test_must_fail git push --tags --atomic up main second
 	) &&
-	test_refs master HEAD@{3} &&
+	test_refs main HEAD@{3} &&
 	test_refs second HEAD@{1}
 '
 
@@ -155,7 +155,7 @@ test_expect_success 'atomic push obeys update hook preventing a branch to be pus
 	(
 		cd workbench &&
 		test_commit one &&
-		git checkout -b second master &&
+		git checkout -b second main &&
 		test_commit two &&
 		git push --mirror up
 	) &&
@@ -165,19 +165,19 @@ test_expect_success 'atomic push obeys update hook preventing a branch to be pus
 		HOOK="$HOOKDIR/update" &&
 		mkdir -p "$HOOKDIR" &&
 		write_script "$HOOK" <<-\EOF
-			# only allow update to master from now on
-			test "$1" = "refs/heads/master"
+			# only allow update to main from now on
+			test "$1" = "refs/heads/main"
 		EOF
 	) &&
 	(
 		cd workbench &&
-		git checkout master &&
+		git checkout main &&
 		test_commit three &&
 		git checkout second &&
 		test_commit four &&
-		test_must_fail git push --atomic up master second
+		test_must_fail git push --atomic up main second
 	) &&
-	test_refs master HEAD@{3} &&
+	test_refs main HEAD@{3} &&
 	test_refs second HEAD@{1}
 '
 
@@ -192,21 +192,21 @@ test_expect_success 'atomic push is not advertised if configured' '
 		test_commit one &&
 		git push --mirror up &&
 		test_commit two &&
-		test_must_fail git push --atomic up master
+		test_must_fail git push --atomic up main
 	) &&
-	test_refs master HEAD@{1}
+	test_refs main HEAD@{1}
 '
 
-# References in upstream : master(1) one(1) foo(1)
-# References in workbench: master(2)        foo(1) two(2) bar(2)
-# Atomic push            : master(2)               two(2) bar(2)
+# References in upstream : main(1) one(1) foo(1)
+# References in workbench: main(2)        foo(1) two(2) bar(2)
+# Atomic push            : main(2)               two(2) bar(2)
 test_expect_success 'atomic push reports (reject by update hook)' '
 	mk_repo_pair &&
 	(
 		cd workbench &&
 		test_commit one &&
 		git branch foo &&
-		git push up master one foo &&
+		git push up main one foo &&
 		git tag -d one
 	) &&
 	(
@@ -228,19 +228,19 @@ test_expect_success 'atomic push reports (reject by update hook)' '
 		git branch bar
 	) &&
 	test_must_fail git -C workbench \
-		push --atomic up master two bar >out 2>&1 &&
+		push --atomic up main two bar >out 2>&1 &&
 	fmt_status_report <out >actual &&
 	cat >expect <<-EOF &&
 	To ../upstream
-	 ! [remote rejected] master -> master (atomic push failure)
+	 ! [remote rejected] main -> main (atomic push failure)
 	 ! [remote rejected] two -> two (atomic push failure)
 	 ! [remote rejected] bar -> bar (hook declined)
 	EOF
 	test_cmp expect actual
 '
 
-# References in upstream : master(1) one(1) foo(1)
-# References in workbench: master(2)        foo(1) two(2) bar(2)
+# References in upstream : main(1) one(1) foo(1)
+# References in workbench: main(2)        foo(1) two(2) bar(2)
 test_expect_success 'atomic push reports (mirror, but reject by update hook)' '
 	(
 		cd workbench &&
@@ -252,7 +252,7 @@ test_expect_success 'atomic push reports (mirror, but reject by update hook)' '
 	fmt_status_report <out >actual &&
 	cat >expect <<-EOF &&
 	To ../upstream
-	 ! [remote rejected] master -> master (atomic push failure)
+	 ! [remote rejected] main -> main (atomic push failure)
 	 ! [remote rejected] one (atomic push failure)
 	 ! [remote rejected] bar -> bar (hook declined)
 	 ! [remote rejected] two -> two (atomic push failure)
@@ -260,21 +260,21 @@ test_expect_success 'atomic push reports (mirror, but reject by update hook)' '
 	test_cmp expect actual
 '
 
-# References in upstream : master(2) one(1) foo(1)
-# References in workbench: master(1)        foo(1) two(2) bar(2)
+# References in upstream : main(2) one(1) foo(1)
+# References in workbench: main(1)        foo(1) two(2) bar(2)
 test_expect_success 'atomic push reports (reject by non-ff)' '
 	rm upstream/.git/hooks/update &&
 	(
 		cd workbench &&
-		git push up master &&
+		git push up main &&
 		git reset --hard HEAD^
 	) &&
 	test_must_fail git -C workbench \
-		push --atomic up master foo bar >out 2>&1 &&
+		push --atomic up main foo bar >out 2>&1 &&
 	fmt_status_report <out >actual &&
 	cat >expect <<-EOF &&
 	To ../upstream
-	 ! [rejected] master -> master (non-fast-forward)
+	 ! [rejected] main -> main (non-fast-forward)
 	 ! [rejected] bar -> bar (atomic push failed)
 	EOF
 	test_cmp expect actual
diff --git a/t/t5545-push-options.sh b/t/t5545-push-options.sh
index 38e6f7340e..a1276bbc33 100755
--- a/t/t5545-push-options.sh
+++ b/t/t5545-push-options.sh
@@ -63,9 +63,9 @@ test_expect_success 'one push option works for a single branch' '
 		test_commit one &&
 		git push --mirror up &&
 		test_commit two &&
-		git push --push-option=asdf up master
+		git push --push-option=asdf up main
 	) &&
-	test_refs master master &&
+	test_refs main main &&
 	echo "asdf" >expect &&
 	test_cmp expect upstream/.git/hooks/pre-receive.push_options &&
 	test_cmp expect upstream/.git/hooks/post-receive.push_options
@@ -79,9 +79,9 @@ test_expect_success 'push option denied by remote' '
 		test_commit one &&
 		git push --mirror up &&
 		test_commit two &&
-		test_must_fail git push --push-option=asdf up master
+		test_must_fail git push --push-option=asdf up main
 	) &&
-	test_refs master HEAD@{1}
+	test_refs main HEAD@{1}
 '
 
 test_expect_success 'two push options work' '
@@ -92,9 +92,9 @@ test_expect_success 'two push options work' '
 		test_commit one &&
 		git push --mirror up &&
 		test_commit two &&
-		git push --push-option=asdf --push-option="more structured text" up master
+		git push --push-option=asdf --push-option="more structured text" up main
 	) &&
-	test_refs master master &&
+	test_refs main main &&
 	printf "asdf\nmore structured text\n" >expect &&
 	test_cmp expect upstream/.git/hooks/pre-receive.push_options &&
 	test_cmp expect upstream/.git/hooks/post-receive.push_options
@@ -123,14 +123,14 @@ test_expect_success 'push options and submodules' '
 
 	git -C parent push \
 		--push-option=asdf --push-option="more structured text" \
-		--recurse-submodules=on-demand up master &&
+		--recurse-submodules=on-demand up main &&
 
-	git -C upstream rev-parse --verify master >expect &&
-	git -C parent/workbench rev-parse --verify master >actual &&
+	git -C upstream rev-parse --verify main >expect &&
+	git -C parent/workbench rev-parse --verify main >actual &&
 	test_cmp expect actual &&
 
-	git -C parent_upstream rev-parse --verify master >expect &&
-	git -C parent rev-parse --verify master >actual &&
+	git -C parent_upstream rev-parse --verify main >expect &&
+	git -C parent rev-parse --verify main >actual &&
 	test_cmp expect actual &&
 
 	printf "asdf\nmore structured text\n" >expect &&
@@ -148,9 +148,9 @@ test_expect_success 'default push option' '
 		test_commit one &&
 		git push --mirror up &&
 		test_commit two &&
-		git -c push.pushOption=default push up master
+		git -c push.pushOption=default push up main
 	) &&
-	test_refs master master &&
+	test_refs main main &&
 	echo "default" >expect &&
 	test_cmp expect upstream/.git/hooks/pre-receive.push_options &&
 	test_cmp expect upstream/.git/hooks/post-receive.push_options
@@ -164,9 +164,9 @@ test_expect_success 'two default push options' '
 		test_commit one &&
 		git push --mirror up &&
 		test_commit two &&
-		git -c push.pushOption=default1 -c push.pushOption=default2 push up master
+		git -c push.pushOption=default1 -c push.pushOption=default2 push up main
 	) &&
-	test_refs master master &&
+	test_refs main main &&
 	printf "default1\ndefault2\n" >expect &&
 	test_cmp expect upstream/.git/hooks/pre-receive.push_options &&
 	test_cmp expect upstream/.git/hooks/post-receive.push_options
@@ -180,9 +180,9 @@ test_expect_success 'push option from command line overrides from-config push op
 		test_commit one &&
 		git push --mirror up &&
 		test_commit two &&
-		git -c push.pushOption=default push --push-option=manual up master
+		git -c push.pushOption=default push --push-option=manual up main
 	) &&
-	test_refs master master &&
+	test_refs main main &&
 	echo "manual" >expect &&
 	test_cmp expect upstream/.git/hooks/pre-receive.push_options &&
 	test_cmp expect upstream/.git/hooks/post-receive.push_options
@@ -196,9 +196,9 @@ test_expect_success 'empty value of push.pushOption in config clears the list' '
 		test_commit one &&
 		git push --mirror up &&
 		test_commit two &&
-		git -c push.pushOption=default1 -c push.pushOption= -c push.pushOption=default2 push up master
+		git -c push.pushOption=default1 -c push.pushOption= -c push.pushOption=default2 push up main
 	) &&
-	test_refs master master &&
+	test_refs main main &&
 	echo "default2" >expect &&
 	test_cmp expect upstream/.git/hooks/pre-receive.push_options &&
 	test_cmp expect upstream/.git/hooks/post-receive.push_options
@@ -212,16 +212,16 @@ test_expect_success 'invalid push option in config' '
 		test_commit one &&
 		git push --mirror up &&
 		test_commit two &&
-		test_must_fail git -c push.pushOption push up master
+		test_must_fail git -c push.pushOption push up main
 	) &&
-	test_refs master HEAD@{1}
+	test_refs main HEAD@{1}
 '
 
 test_expect_success 'push options keep quoted characters intact (direct)' '
 	mk_repo_pair &&
 	git -C upstream config receive.advertisePushOptions true &&
 	test_commit -C workbench one &&
-	git -C workbench push --push-option="\"embedded quotes\"" up master &&
+	git -C workbench push --push-option="\"embedded quotes\"" up main &&
 	echo "\"embedded quotes\"" >expect &&
 	test_cmp expect upstream/.git/hooks/pre-receive.push_options
 '
@@ -244,28 +244,28 @@ mk_http_pair () {
 test_expect_success 'push option denied properly by http server' '
 	mk_http_pair false &&
 	test_commit -C test_http_clone one &&
-	test_must_fail git -C test_http_clone push --push-option=asdf origin master 2>actual &&
+	test_must_fail git -C test_http_clone push --push-option=asdf origin main 2>actual &&
 	test_i18ngrep "the receiving end does not support push options" actual &&
-	git -C test_http_clone push origin master
+	git -C test_http_clone push origin main
 '
 
 test_expect_success 'push options work properly across http' '
 	mk_http_pair true &&
 
 	test_commit -C test_http_clone one &&
-	git -C test_http_clone push origin master &&
-	git -C "$HTTPD_DOCUMENT_ROOT_PATH"/upstream.git rev-parse --verify master >expect &&
-	git -C test_http_clone rev-parse --verify master >actual &&
+	git -C test_http_clone push origin main &&
+	git -C "$HTTPD_DOCUMENT_ROOT_PATH"/upstream.git rev-parse --verify main >expect &&
+	git -C test_http_clone rev-parse --verify main >actual &&
 	test_cmp expect actual &&
 
 	test_commit -C test_http_clone two &&
-	git -C test_http_clone push --push-option=asdf --push-option="more structured text" origin master &&
+	git -C test_http_clone push --push-option=asdf --push-option="more structured text" origin main &&
 	printf "asdf\nmore structured text\n" >expect &&
 	test_cmp expect "$HTTPD_DOCUMENT_ROOT_PATH"/upstream.git/hooks/pre-receive.push_options &&
 	test_cmp expect "$HTTPD_DOCUMENT_ROOT_PATH"/upstream.git/hooks/post-receive.push_options &&
 
-	git -C "$HTTPD_DOCUMENT_ROOT_PATH"/upstream.git rev-parse --verify master >expect &&
-	git -C test_http_clone rev-parse --verify master >actual &&
+	git -C "$HTTPD_DOCUMENT_ROOT_PATH"/upstream.git rev-parse --verify main >expect &&
+	git -C test_http_clone rev-parse --verify main >actual &&
 	test_cmp expect actual
 '
 
@@ -273,7 +273,7 @@ test_expect_success 'push options keep quoted characters intact (http)' '
 	mk_http_pair true &&
 
 	test_commit -C test_http_clone one &&
-	git -C test_http_clone push --push-option="\"embedded quotes\"" origin master &&
+	git -C test_http_clone push --push-option="\"embedded quotes\"" origin main &&
 	echo "\"embedded quotes\"" >expect &&
 	test_cmp expect "$HTTPD_DOCUMENT_ROOT_PATH"/upstream.git/hooks/pre-receive.push_options
 '
diff --git a/t/t5548-push-porcelain.sh b/t/t5548-push-porcelain.sh
index 1b19b3ef55..5a761f3642 100755
--- a/t/t5548-push-porcelain.sh
+++ b/t/t5548-push-porcelain.sh
@@ -36,7 +36,7 @@ create_commits_in () {
 		shift ||
 		return 1
 	done &&
-	git -C "$repo" update-ref refs/heads/master $oid
+	git -C "$repo" update-ref refs/heads/main $oid
 }
 
 # Format the output of git-push, git-show-ref and other commands to make a
@@ -57,8 +57,8 @@ make_user_friendly_and_stable_output () {
 }
 
 setup_upstream_and_workbench () {
-	# Upstream  after setup : master(B)  foo(A)  bar(A)  baz(A)
-	# Workbench after setup : master(A)
+	# Upstream  after setup : main(B)  foo(A)  bar(A)  baz(A)
+	# Workbench after setup : main(A)
 	test_expect_success "setup upstream repository and workbench" '
 		rm -rf upstream.git workbench &&
 		git init --bare upstream.git &&
@@ -70,9 +70,9 @@ setup_upstream_and_workbench () {
 			# this fixed-width oid will be replaced with "<OID>".
 			git config core.abbrev 7 &&
 			git remote add origin ../upstream.git &&
-			git update-ref refs/heads/master $A &&
+			git update-ref refs/heads/main $A &&
 			git push origin \
-				$B:refs/heads/master \
+				$B:refs/heads/main \
 				$A:refs/heads/foo \
 				$A:refs/heads/bar \
 				$A:refs/heads/baz
@@ -94,17 +94,17 @@ run_git_push_porcelain_output_test() {
 		;;
 	esac
 
-	# Refs of upstream : master(B)  foo(A)  bar(A)  baz(A)
-	# Refs of workbench: master(A)                  baz(A)  next(A)
-	# git-push         : master(A)  NULL    (B)     baz(A)  next(A)
+	# Refs of upstream : main(B)  foo(A)  bar(A)  baz(A)
+	# Refs of workbench: main(A)                  baz(A)  next(A)
+	# git-push         : main(A)  NULL    (B)     baz(A)  next(A)
 	test_expect_success "porcelain output of successful git-push ($PROTOCOL)" '
 		(
 			cd workbench &&
-			git update-ref refs/heads/master $A &&
+			git update-ref refs/heads/main $A &&
 			git update-ref refs/heads/baz $A &&
 			git update-ref refs/heads/next $A &&
 			git push --porcelain --force origin \
-				master \
+				main \
 				:refs/heads/foo \
 				$B:bar \
 				baz \
@@ -116,7 +116,7 @@ run_git_push_porcelain_output_test() {
 		=    refs/heads/baz:refs/heads/baz    [up to date]
 		     <COMMIT-B>:refs/heads/bar    <OID-A>..<OID-B>
 		-    :refs/heads/foo    [deleted]
-		+    refs/heads/master:refs/heads/master    <OID-B>...<OID-A> (forced update)
+		+    refs/heads/main:refs/heads/main    <OID-B>...<OID-A> (forced update)
 		*    refs/heads/next:refs/heads/next    [new branch]
 		Done
 		EOF
@@ -127,22 +127,22 @@ run_git_push_porcelain_output_test() {
 		cat >expect <<-EOF &&
 		<COMMIT-B> refs/heads/bar
 		<COMMIT-A> refs/heads/baz
-		<COMMIT-A> refs/heads/master
+		<COMMIT-A> refs/heads/main
 		<COMMIT-A> refs/heads/next
 		EOF
 		test_cmp expect actual
 	'
 
-	# Refs of upstream : master(A)  bar(B)  baz(A)  next(A)
-	# Refs of workbench: master(B)  bar(A)  baz(A)  next(A)
-	# git-push         : master(B)  bar(A)  NULL    next(A)
+	# Refs of upstream : main(A)  bar(B)  baz(A)  next(A)
+	# Refs of workbench: main(B)  bar(A)  baz(A)  next(A)
+	# git-push         : main(B)  bar(A)  NULL    next(A)
 	test_expect_success "atomic push failed ($PROTOCOL)" '
 		(
 			cd workbench &&
-			git update-ref refs/heads/master $B &&
+			git update-ref refs/heads/main $B &&
 			git update-ref refs/heads/bar $A &&
 			test_must_fail git push --atomic --porcelain origin \
-				master \
+				main \
 				bar \
 				:baz \
 				next
@@ -153,7 +153,7 @@ run_git_push_porcelain_output_test() {
 		=    refs/heads/next:refs/heads/next    [up to date]
 		!    refs/heads/bar:refs/heads/bar    [rejected] (non-fast-forward)
 		!    (delete):refs/heads/baz    [rejected] (atomic push failed)
-		!    refs/heads/master:refs/heads/master    [rejected] (atomic push failed)
+		!    refs/heads/main:refs/heads/main    [rejected] (atomic push failed)
 		Done
 		EOF
 		test_cmp expect actual &&
@@ -163,7 +163,7 @@ run_git_push_porcelain_output_test() {
 		cat >expect <<-EOF &&
 		<COMMIT-B> refs/heads/bar
 		<COMMIT-A> refs/heads/baz
-		<COMMIT-A> refs/heads/master
+		<COMMIT-A> refs/heads/main
 		<COMMIT-A> refs/heads/next
 		EOF
 		test_cmp expect actual
@@ -174,16 +174,16 @@ run_git_push_porcelain_output_test() {
 		EOF
 	'
 
-	# Refs of upstream : master(A)  bar(B)  baz(A)  next(A)
-	# Refs of workbench: master(B)  bar(A)  baz(A)  next(A)
-	# git-push         : master(B)  bar(A)  NULL    next(A)
+	# Refs of upstream : main(A)  bar(B)  baz(A)  next(A)
+	# Refs of workbench: main(B)  bar(A)  baz(A)  next(A)
+	# git-push         : main(B)  bar(A)  NULL    next(A)
 	test_expect_success "pre-receive hook declined ($PROTOCOL)" '
 		(
 			cd workbench &&
-			git update-ref refs/heads/master $B &&
+			git update-ref refs/heads/main $B &&
 			git update-ref refs/heads/bar $A &&
 			test_must_fail git push --porcelain --force origin \
-				master \
+				main \
 				bar \
 				:baz \
 				next
@@ -194,7 +194,7 @@ run_git_push_porcelain_output_test() {
 		=    refs/heads/next:refs/heads/next    [up to date]
 		!    refs/heads/bar:refs/heads/bar    [remote rejected] (pre-receive hook declined)
 		!    :refs/heads/baz    [remote rejected] (pre-receive hook declined)
-		!    refs/heads/master:refs/heads/master    [remote rejected] (pre-receive hook declined)
+		!    refs/heads/main:refs/heads/main    [remote rejected] (pre-receive hook declined)
 		Done
 		EOF
 		test_cmp expect actual &&
@@ -204,7 +204,7 @@ run_git_push_porcelain_output_test() {
 		cat >expect <<-EOF &&
 		<COMMIT-B> refs/heads/bar
 		<COMMIT-A> refs/heads/baz
-		<COMMIT-A> refs/heads/master
+		<COMMIT-A> refs/heads/main
 		<COMMIT-A> refs/heads/next
 		EOF
 		test_cmp expect actual
@@ -214,14 +214,14 @@ run_git_push_porcelain_output_test() {
 		rm "$upstream/hooks/pre-receive"
 	'
 
-	# Refs of upstream : master(A)  bar(B)  baz(A)  next(A)
-	# Refs of workbench: master(B)  bar(A)  baz(A)  next(A)
-	# git-push         : master(B)  bar(A)  NULL    next(A)
+	# Refs of upstream : main(A)  bar(B)  baz(A)  next(A)
+	# Refs of workbench: main(B)  bar(A)  baz(A)  next(A)
+	# git-push         : main(B)  bar(A)  NULL    next(A)
 	test_expect_success "non-fastforward push ($PROTOCOL)" '
 		(
 			cd workbench &&
 			test_must_fail git push --porcelain origin \
-				master \
+				main \
 				bar \
 				:baz \
 				next
@@ -231,7 +231,7 @@ run_git_push_porcelain_output_test() {
 		To <URL/of/upstream.git>
 		=    refs/heads/next:refs/heads/next    [up to date]
 		-    :refs/heads/baz    [deleted]
-		     refs/heads/master:refs/heads/master    <OID-A>..<OID-B>
+		     refs/heads/main:refs/heads/main    <OID-A>..<OID-B>
 		!    refs/heads/bar:refs/heads/bar    [rejected] (non-fast-forward)
 		Done
 		EOF
@@ -241,7 +241,7 @@ run_git_push_porcelain_output_test() {
 		make_user_friendly_and_stable_output <out >actual &&
 		cat >expect <<-EOF &&
 		<COMMIT-B> refs/heads/bar
-		<COMMIT-B> refs/heads/master
+		<COMMIT-B> refs/heads/main
 		<COMMIT-A> refs/heads/next
 		EOF
 		test_cmp expect actual
diff --git a/t/t5550-http-fetch-dumb.sh b/t/t5550-http-fetch-dumb.sh
index 483578b2d7..6fdcd0c036 100755
--- a/t/t5550-http-fetch-dumb.sh
+++ b/t/t5550-http-fetch-dumb.sh
@@ -26,7 +26,7 @@ test_expect_success 'create http-accessible bare repository with loose objects'
 	 hooks/post-update
 	) &&
 	git remote add public "$HTTPD_DOCUMENT_ROOT_PATH/repo.git" &&
-	git push public master:master
+	git push public main:main
 '
 
 test_expect_success 'clone http repository' '
@@ -37,8 +37,8 @@ test_expect_success 'clone http repository' '
 
 test_expect_success 'list refs from outside any repository' '
 	cat >expect <<-EOF &&
-	$(git rev-parse master)	HEAD
-	$(git rev-parse master)	refs/heads/master
+	$(git rev-parse main)	HEAD
+	$(git rev-parse main)	refs/heads/main
 	EOF
 	nongit git ls-remote "$HTTPD_URL/dumb/repo.git" >actual &&
 	test_cmp expect actual
@@ -181,8 +181,8 @@ test_expect_success 'fetch changes via manual http-fetch' '
 
 	HEAD=$(git rev-parse --verify HEAD) &&
 	(cd clone2 &&
-	 git http-fetch -a -w heads/master-new $HEAD $(git config remote.origin.url) &&
-	 git checkout master-new &&
+	 git http-fetch -a -w heads/main-new $HEAD $(git config remote.origin.url) &&
+	 git checkout main-new &&
 	 test $HEAD = $(git rev-parse --verify HEAD)) &&
 	test_cmp file clone2/file
 '
@@ -192,19 +192,19 @@ test_expect_success 'manual http-fetch without -a works just as well' '
 
 	HEAD=$(git rev-parse --verify HEAD) &&
 	(cd clone3 &&
-	 git http-fetch -w heads/master-new $HEAD $(git config remote.origin.url) &&
-	 git checkout master-new &&
+	 git http-fetch -w heads/main-new $HEAD $(git config remote.origin.url) &&
+	 git checkout main-new &&
 	 test $HEAD = $(git rev-parse --verify HEAD)) &&
 	test_cmp file clone3/file
 '
 
 test_expect_success 'http remote detects correct HEAD' '
-	git push public master:other &&
+	git push public main:other &&
 	(cd clone &&
 	 git remote set-head origin -d &&
 	 git remote set-head origin -a &&
 	 git symbolic-ref refs/remotes/origin/HEAD > output &&
-	 echo refs/remotes/origin/master > expect &&
+	 echo refs/remotes/origin/main > expect &&
 	 test_cmp expect output
 	)
 '
@@ -416,7 +416,7 @@ test_expect_success 'set up evil alternates scheme' '
 	evil=$HTTPD_DOCUMENT_ROOT_PATH/evil.git &&
 	git init --bare "$evil" &&
 	# do this by hand to avoid object existence check
-	printf "%s\\t%s\\n" $sha1 refs/heads/master >"$evil/info/refs"
+	printf "%s\\t%s\\n" $sha1 refs/heads/main >"$evil/info/refs"
 '
 
 # Here we'll just redirect via HTTP. In a real-world attack these would be on
diff --git a/t/t5551-http-fetch-smart.sh b/t/t5551-http-fetch-smart.sh
index e40e9ed52f..2215bbcce7 100755
--- a/t/t5551-http-fetch-smart.sh
+++ b/t/t5551-http-fetch-smart.sh
@@ -18,7 +18,7 @@ test_expect_success 'create http-accessible bare repository' '
 	 git --bare init
 	) &&
 	git remote add public "$HTTPD_DOCUMENT_ROOT_PATH/repo.git" &&
-	git push public master:master
+	git push public main:main
 '
 
 setup_askpass_helper
@@ -238,9 +238,9 @@ test_expect_success 'invalid Content-Type rejected' '
 
 test_expect_success 'create namespaced refs' '
 	test_commit namespaced &&
-	git push public HEAD:refs/namespaces/ns/refs/heads/master &&
+	git push public HEAD:refs/namespaces/ns/refs/heads/main &&
 	git --git-dir="$HTTPD_DOCUMENT_ROOT_PATH/repo.git" \
-		symbolic-ref refs/namespaces/ns/HEAD refs/namespaces/ns/refs/heads/master
+		symbolic-ref refs/namespaces/ns/HEAD refs/namespaces/ns/refs/heads/main
 '
 
 test_expect_success 'smart clone respects namespace' '
@@ -271,7 +271,7 @@ test_expect_success 'cookies stored in http.cookiefile when http.savecookies set
 	EOF
 	git config http.cookiefile cookies.txt &&
 	git config http.savecookies true &&
-	git ls-remote $HTTPD_URL/smart_cookies/repo.git master &&
+	git ls-remote $HTTPD_URL/smart_cookies/repo.git main &&
 
 	# NEEDSWORK: If the overspecification of the expected result is reduced, we
 	# might be able to run this test in all protocol versions.
@@ -344,12 +344,12 @@ test_expect_success 'large fetch-pack requests can be sent using chunked encodin
 test_expect_success 'test allowreachablesha1inwant' '
 	test_when_finished "rm -rf test_reachable.git" &&
 	server="$HTTPD_DOCUMENT_ROOT_PATH/repo.git" &&
-	master_sha=$(git -C "$server" rev-parse refs/heads/master) &&
+	main_sha=$(git -C "$server" rev-parse refs/heads/main) &&
 	git -C "$server" config uploadpack.allowreachablesha1inwant 1 &&
 
 	git init --bare test_reachable.git &&
 	git -C test_reachable.git remote add origin "$HTTPD_URL/smart/repo.git" &&
-	git -C test_reachable.git fetch origin "$master_sha"
+	git -C test_reachable.git fetch origin "$main_sha"
 '
 
 test_expect_success 'test allowreachablesha1inwant with unreachable' '
@@ -363,7 +363,7 @@ test_expect_success 'test allowreachablesha1inwant with unreachable' '
 	git push public :refs/heads/doomed &&
 
 	server="$HTTPD_DOCUMENT_ROOT_PATH/repo.git" &&
-	master_sha=$(git -C "$server" rev-parse refs/heads/master) &&
+	main_sha=$(git -C "$server" rev-parse refs/heads/main) &&
 	git -C "$server" config uploadpack.allowreachablesha1inwant 1 &&
 
 	git init --bare test_reachable.git &&
@@ -385,7 +385,7 @@ test_expect_success 'test allowanysha1inwant with unreachable' '
 	git push public :refs/heads/doomed &&
 
 	server="$HTTPD_DOCUMENT_ROOT_PATH/repo.git" &&
-	master_sha=$(git -C "$server" rev-parse refs/heads/master) &&
+	main_sha=$(git -C "$server" rev-parse refs/heads/main) &&
 	git -C "$server" config uploadpack.allowreachablesha1inwant 1 &&
 
 	git init --bare test_reachable.git &&
@@ -444,8 +444,8 @@ test_expect_success 'using fetch command in remote-curl updates refs' '
 	test_commit -C "$SERVER" bar &&
 	git -C client -c protocol.version=0 fetch &&
 
-	git -C "$SERVER" rev-parse master >expect &&
-	git -C client rev-parse origin/master >actual &&
+	git -C "$SERVER" rev-parse main >expect &&
+	git -C client rev-parse origin/main >actual &&
 	test_cmp expect actual
 '
 
diff --git a/t/t5552-skipping-fetch-negotiator.sh b/t/t5552-skipping-fetch-negotiator.sh
index 156c704040..7b9fb4ff02 100755
--- a/t/t5552-skipping-fetch-negotiator.sh
+++ b/t/t5552-skipping-fetch-negotiator.sh
@@ -100,7 +100,7 @@ test_expect_success 'use ref advertisement to filter out commits' '
 	git -C server checkout --orphan anotherbranch &&
 	test_commit -C server to_fetch &&
 
-	# The server advertising "c3" (as "refs/heads/master") means that we do
+	# The server advertising "c3" (as "refs/heads/main") means that we do
 	# not need to send any ancestors of "c3", but we still need to send "c3"
 	# itself.
 	test_config -C client fetch.negotiationalgorithm skipping &&
diff --git a/t/t5553-set-upstream.sh b/t/t5553-set-upstream.sh
index 7622981cbf..0e6574f526 100755
--- a/t/t5553-set-upstream.sh
+++ b/t/t5553-set-upstream.sh
@@ -32,9 +32,9 @@ test_expect_success 'setup bare parent fetch' '
 	git remote add upstream parent
 '
 
-test_expect_success 'setup commit on master and other fetch' '
+test_expect_success 'setup commit on main and other fetch' '
 	test_commit one &&
-	git push upstream master &&
+	git push upstream main &&
 	git checkout -b other &&
 	test_commit two &&
 	git push upstream other
@@ -43,38 +43,38 @@ test_expect_success 'setup commit on master and other fetch' '
 # tests for fetch --set-upstream
 
 test_expect_success 'fetch --set-upstream does not set upstream w/o branch' '
-	clear_config master other &&
-	git checkout master &&
+	clear_config main other &&
+	git checkout main &&
 	git fetch --set-upstream upstream &&
-	check_config_missing master &&
+	check_config_missing main &&
 	check_config_missing other
 '
 
-test_expect_success 'fetch --set-upstream upstream master sets branch master but not other' '
-	clear_config master other &&
-	git fetch --set-upstream upstream master &&
-	check_config master upstream refs/heads/master &&
+test_expect_success 'fetch --set-upstream upstream main sets branch main but not other' '
+	clear_config main other &&
+	git fetch --set-upstream upstream main &&
+	check_config main upstream refs/heads/main &&
 	check_config_missing other
 '
 
 test_expect_success 'fetch --set-upstream upstream other sets branch other' '
-	clear_config master other &&
+	clear_config main other &&
 	git fetch --set-upstream upstream other &&
-	check_config master upstream refs/heads/other &&
+	check_config main upstream refs/heads/other &&
 	check_config_missing other
 '
 
-test_expect_success 'fetch --set-upstream master:other does not set the branch other2' '
+test_expect_success 'fetch --set-upstream main:other does not set the branch other2' '
 	clear_config other2 &&
-	git fetch --set-upstream upstream master:other2 &&
+	git fetch --set-upstream upstream main:other2 &&
 	check_config_missing other2
 '
 
 test_expect_success 'fetch --set-upstream http://nosuchdomain.example.com fails with invalid url' '
-	# master explicitly not cleared, we check that it is not touched from previous value
+	# main explicitly not cleared, we check that it is not touched from previous value
 	clear_config other other2 &&
 	test_must_fail git fetch --set-upstream http://nosuchdomain.example.com &&
-	check_config master upstream refs/heads/other &&
+	check_config main upstream refs/heads/other &&
 	check_config_missing other &&
 	check_config_missing other2
 '
@@ -83,7 +83,7 @@ test_expect_success 'fetch --set-upstream with valid URL sets upstream to URL' '
 	clear_config other other2 &&
 	url="file://$PWD" &&
 	git fetch --set-upstream "$url" &&
-	check_config master "$url" HEAD &&
+	check_config main "$url" HEAD &&
 	check_config_missing other &&
 	check_config_missing other2
 '
@@ -96,30 +96,30 @@ test_expect_success 'setup bare parent pull' '
 	git remote add upstream parent
 '
 
-test_expect_success 'setup commit on master and other pull' '
+test_expect_success 'setup commit on main and other pull' '
 	test_commit three &&
-	git push --tags upstream master &&
+	git push --tags upstream main &&
 	test_commit four &&
 	git push upstream other
 '
 
-test_expect_success 'pull --set-upstream upstream master sets branch master but not other' '
-	clear_config master other &&
-	git pull --set-upstream upstream master &&
-	check_config master upstream refs/heads/master &&
+test_expect_success 'pull --set-upstream upstream main sets branch main but not other' '
+	clear_config main other &&
+	git pull --set-upstream upstream main &&
+	check_config main upstream refs/heads/main &&
 	check_config_missing other
 '
 
-test_expect_success 'pull --set-upstream master:other2 does not set the branch other2' '
+test_expect_success 'pull --set-upstream main:other2 does not set the branch other2' '
 	clear_config other2 &&
-	git pull --set-upstream upstream master:other2 &&
+	git pull --set-upstream upstream main:other2 &&
 	check_config_missing other2
 '
 
-test_expect_success 'pull --set-upstream upstream other sets branch master' '
-	clear_config master other &&
+test_expect_success 'pull --set-upstream upstream other sets branch main' '
+	clear_config main other &&
 	git pull --set-upstream upstream other &&
-	check_config master upstream refs/heads/other &&
+	check_config main upstream refs/heads/other &&
 	check_config_missing other
 '
 
@@ -130,47 +130,47 @@ test_expect_success 'pull --set-upstream upstream tag does not set the tag' '
 '
 
 test_expect_success 'pull --set-upstream http://nosuchdomain.example.com fails with invalid url' '
-	# master explicitly not cleared, we check that it is not touched from previous value
+	# main explicitly not cleared, we check that it is not touched from previous value
 	clear_config other other2 three &&
 	test_must_fail git pull --set-upstream http://nosuchdomain.example.com &&
-	check_config master upstream refs/heads/other &&
+	check_config main upstream refs/heads/other &&
 	check_config_missing other &&
 	check_config_missing other2 &&
 	check_config_missing three
 '
 
 test_expect_success 'pull --set-upstream upstream HEAD sets branch HEAD' '
-	clear_config master other &&
+	clear_config main other &&
 	git pull --set-upstream upstream HEAD &&
-	check_config master upstream HEAD &&
+	check_config main upstream HEAD &&
 	git checkout other &&
 	git pull --set-upstream upstream HEAD &&
 	check_config other upstream HEAD
 '
 
 test_expect_success 'pull --set-upstream upstream with more than one branch does nothing' '
-	clear_config master three &&
-	git pull --set-upstream upstream master three &&
-	check_config_missing master &&
+	clear_config main three &&
+	git pull --set-upstream upstream main three &&
+	check_config_missing main &&
 	check_config_missing three
 '
 
 test_expect_success 'pull --set-upstream with valid URL sets upstream to URL' '
-	clear_config master other other2 &&
-	git checkout master &&
+	clear_config main other other2 &&
+	git checkout main &&
 	url="file://$PWD" &&
 	git pull --set-upstream "$url" &&
-	check_config master "$url" HEAD &&
+	check_config main "$url" HEAD &&
 	check_config_missing other &&
 	check_config_missing other2
 '
 
 test_expect_success 'pull --set-upstream with valid URL and branch sets branch' '
-	clear_config master other other2 &&
-	git checkout master &&
+	clear_config main other other2 &&
+	git checkout main &&
 	url="file://$PWD" &&
-	git pull --set-upstream "$url" master &&
-	check_config master "$url" refs/heads/master &&
+	git pull --set-upstream "$url" main &&
+	check_config main "$url" refs/heads/main &&
 	check_config_missing other &&
 	check_config_missing other2
 '
diff --git a/t/t5561-http-backend.sh b/t/t5561-http-backend.sh
index 6eb0294978..c8a9f7f9bb 100755
--- a/t/t5561-http-backend.sh
+++ b/t/t5561-http-backend.sh
@@ -39,9 +39,9 @@ POST() {
 
 grep '^[^#]' >exp <<EOF
 
-###  refs/heads/master
+###  refs/heads/main
 ###
-GET  /smart/repo.git/refs/heads/master HTTP/1.1 404 -
+GET  /smart/repo.git/refs/heads/main HTTP/1.1 404 -
 
 ###  getanyfile default
 ###
diff --git a/t/t556x_common b/t/t556x_common
index 359fcfe32b..670fb89477 100755
--- a/t/t556x_common
+++ b/t/t556x_common
@@ -22,7 +22,7 @@ test_expect_success 'setup repository' '
 	 : >objects/info/http-alternates
 	) &&
 	git remote add public "$HTTPD_DOCUMENT_ROOT_PATH/repo.git" &&
-	git push public master:master &&
+	git push public main:main &&
 
 	(cd "$HTTPD_DOCUMENT_ROOT_PATH/repo.git" &&
 	 git repack -a -d
@@ -31,7 +31,7 @@ test_expect_success 'setup repository' '
 	echo other >file &&
 	git add file &&
 	git commit -m two &&
-	git push public master:master &&
+	git push public main:main &&
 
 	LOOSE_URL=$(find_file objects/??) &&
 	PACK_URL=$(find_file objects/pack/*.pack) &&
@@ -51,8 +51,8 @@ get_static_files() {
 
 SMART=smart
 GIT_HTTP_EXPORT_ALL=1 && export GIT_HTTP_EXPORT_ALL
-test_expect_success 'direct refs/heads/master not found' '
-	GET refs/heads/master "404 Not Found"
+test_expect_success 'direct refs/heads/main not found' '
+	GET refs/heads/main "404 Not Found"
 '
 test_expect_success 'static file is ok' '
 	get_static_files "200 OK"
diff --git a/t/t5570-git-daemon.sh b/t/t5570-git-daemon.sh
index 8f69a7854f..864d5c985c 100755
--- a/t/t5570-git-daemon.sh
+++ b/t/t5570-git-daemon.sh
@@ -26,7 +26,7 @@ test_expect_success 'create git-accessible bare repository' '
 	 : >git-daemon-export-ok
 	) &&
 	git remote add public "$GIT_DAEMON_DOCUMENT_ROOT_PATH/repo.git" &&
-	git push public master:master
+	git push public main:main
 '
 
 test_expect_success 'clone git repository' '
@@ -55,12 +55,12 @@ test_expect_success 'no-op fetch without "-v" is quiet' '
 '
 
 test_expect_success 'remote detects correct HEAD' '
-	git push public master:other &&
+	git push public main:other &&
 	(cd clone &&
 	 git remote set-head -d origin &&
 	 git remote set-head -a origin &&
 	 git symbolic-ref refs/remotes/origin/HEAD > output &&
-	 echo refs/remotes/origin/master > expect &&
+	 echo refs/remotes/origin/main > expect &&
 	 test_cmp expect output
 	)
 '
@@ -148,7 +148,7 @@ test_remote_error()
 
 msg="access denied or repository not exported"
 test_expect_success 'clone non-existent' "test_remote_error    '$msg' clone nowhere.git"
-test_expect_success 'push disabled'      "test_remote_error    '$msg' push  repo.git master"
+test_expect_success 'push disabled'      "test_remote_error    '$msg' push  repo.git main"
 test_expect_success 'read access denied' "test_remote_error -x '$msg' fetch repo.git"
 test_expect_success 'not exported'       "test_remote_error -n '$msg' fetch repo.git"
 
@@ -156,7 +156,7 @@ stop_git_daemon
 start_git_daemon --informative-errors
 
 test_expect_success 'clone non-existent' "test_remote_error    'no such repository'      clone nowhere.git"
-test_expect_success 'push disabled'      "test_remote_error    'service not enabled'     push  repo.git master"
+test_expect_success 'push disabled'      "test_remote_error    'service not enabled'     push  repo.git main"
 test_expect_success 'read access denied' "test_remote_error -x 'no such repository'      fetch repo.git"
 test_expect_success 'not exported'       "test_remote_error -n 'repository not exported' fetch repo.git"
 
@@ -192,10 +192,10 @@ test_expect_success FAKENC 'hostname interpolation works after LF-stripping' '
 	fake_nc "$GIT_DAEMON_HOST_PORT" <input >output &&
 	depacketize <output >output.raw &&
 
-	# just pick out the value of master, which avoids any protocol
+	# just pick out the value of main, which avoids any protocol
 	# particulars
-	perl -lne "print \$1 if m{^(\\S+) refs/heads/master}" <output.raw >actual &&
-	git -C "$repo" rev-parse master >expect &&
+	perl -lne "print \$1 if m{^(\\S+) refs/heads/main}" <output.raw >actual &&
+	git -C "$repo" rev-parse main >expect &&
 	test_cmp expect actual
 '
 
diff --git a/t/t5571-pre-push-hook.sh b/t/t5571-pre-push-hook.sh
index ac53d63869..891f03cd59 100755
--- a/t/t5571-pre-push-hook.sh
+++ b/t/t5571-pre-push-hook.sh
@@ -48,11 +48,11 @@ EOF
 cat >expected <<EOF
 parent1
 repo1
-refs/heads/master $COMMIT2 refs/heads/foreign $COMMIT1
+refs/heads/main $COMMIT2 refs/heads/foreign $COMMIT1
 EOF
 
 test_expect_success 'push with hook' '
-	git push parent1 master:foreign &&
+	git push parent1 main:foreign &&
 	diff expected actual
 '
 
diff --git a/t/t5572-pull-submodule.sh b/t/t5572-pull-submodule.sh
index 1d75e3b12b..d6a75964d8 100755
--- a/t/t5572-pull-submodule.sh
+++ b/t/t5572-pull-submodule.sh
@@ -148,8 +148,8 @@ test_expect_success 'branch has no merge base with remote-tracking counterpart'
 
 	git clone parent child &&
 
-	# Reset master so that it has no merge base with
-	# refs/remotes/origin/master.
+	# Reset main so that it has no merge base with
+	# refs/remotes/origin/main.
 	OTHER=$(git -C child commit-tree -m bar \
 		$(git -C child rev-parse HEAD^{tree})) &&
 	git -C child reset --hard "$OTHER" &&
diff --git a/t/t5580-unc-paths.sh b/t/t5580-unc-paths.sh
index cf768b3a27..511c1ba51d 100755
--- a/t/t5580-unc-paths.sh
+++ b/t/t5580-unc-paths.sh
@@ -53,7 +53,7 @@ test_expect_success fetch '
 	git init to-fetch &&
 	(
 		cd to-fetch &&
-		git fetch "$UNCPATH" master
+		git fetch "$UNCPATH" main
 	)
 '
 
diff --git a/t/t5581-http-curl-verbose.sh b/t/t5581-http-curl-verbose.sh
index 927aad0820..0c6e3b7665 100755
--- a/t/t5581-http-curl-verbose.sh
+++ b/t/t5581-http-curl-verbose.sh
@@ -13,7 +13,7 @@ test_expect_success 'setup repository' '
 	git add file &&
 	git commit -m one &&
 	git remote add public "$HTTPD_DOCUMENT_ROOT_PATH/repo.git" &&
-	git push public master:master
+	git push public main:main
 '
 
 test_expect_success 'failure in git-upload-pack is shown' '
diff --git a/t/t5582-fetch-negative-refspec.sh b/t/t5582-fetch-negative-refspec.sh
index 8c61e28fec..9c2b19cae2 100755
--- a/t/t5582-fetch-negative-refspec.sh
+++ b/t/t5582-fetch-negative-refspec.sh
@@ -22,12 +22,12 @@ test_expect_success "clone and setup child repos" '
 		git switch -c alternate &&
 		echo >file updated again by one &&
 		git commit -a -m "updated by one again" &&
-		git switch master
+		git switch main
 	) &&
 	git clone . two &&
 	(
 		cd two &&
-		git config branch.master.remote one &&
+		git config branch.main.remote one &&
 		git config remote.one.url ../one/.git/ &&
 		git config remote.one.fetch +refs/heads/*:refs/remotes/one/* &&
 		git config --add remote.one.fetch ^refs/heads/alternate
@@ -43,9 +43,9 @@ test_expect_success "fetch one" '
 		test_must_fail git rev-parse --verify refs/remotes/one/alternate &&
 		git fetch one &&
 		test_must_fail git rev-parse --verify refs/remotes/one/alternate &&
-		git rev-parse --verify refs/remotes/one/master &&
-		mine=$(git rev-parse refs/remotes/one/master) &&
-		his=$(cd ../one && git rev-parse refs/heads/master) &&
+		git rev-parse --verify refs/remotes/one/main &&
+		mine=$(git rev-parse refs/remotes/one/main) &&
+		his=$(cd ../one && git rev-parse refs/heads/main) &&
 		test "z$mine" = "z$his"
 	)
 '
@@ -57,7 +57,7 @@ test_expect_success "fetch with negative refspec on commandline" '
 		cd three &&
 		alternate_in_one=$(cd ../one && git rev-parse refs/heads/alternate) &&
 		echo $alternate_in_one >expect &&
-		git fetch ../one/.git refs/heads/*:refs/remotes/one/* ^refs/heads/master &&
+		git fetch ../one/.git refs/heads/*:refs/remotes/one/* ^refs/heads/main &&
 		cut -f -1 .git/FETCH_HEAD >actual &&
 		test_cmp expect actual
 	)
@@ -68,8 +68,8 @@ test_expect_success "fetch with negative sha1 refspec fails" '
 	git commit -a -m "updated by origin yet again" &&
 	(
 		cd three &&
-		master_in_one=$(cd ../one && git rev-parse refs/heads/master) &&
-		test_must_fail git fetch ../one/.git refs/heads/*:refs/remotes/one/* ^$master_in_one
+		main_in_one=$(cd ../one && git rev-parse refs/heads/main) &&
+		test_must_fail git fetch ../one/.git refs/heads/*:refs/remotes/one/* ^$main_in_one
 	)
 '
 
@@ -92,10 +92,10 @@ test_expect_success "fetch with negative pattern refspec does not expand prefix"
 	(
 		cd three &&
 		alternate_in_one=$(cd ../one && git rev-parse refs/heads/alternate) &&
-		master_in_one=$(cd ../one && git rev-parse refs/heads/master) &&
+		main_in_one=$(cd ../one && git rev-parse refs/heads/main) &&
 		echo $alternate_in_one >expect &&
-		echo $master_in_one >>expect &&
-		git fetch ../one/.git refs/heads/*:refs/remotes/one/* ^master &&
+		echo $main_in_one >>expect &&
+		git fetch ../one/.git refs/heads/*:refs/remotes/one/* ^main &&
 		cut -f -1 .git/FETCH_HEAD >actual &&
 		test_cmp expect actual
 	)
diff --git a/t/test-lib.sh b/t/test-lib.sh
index 381416825c..3e0c9413f1 100644
--- a/t/test-lib.sh
+++ b/t/test-lib.sh
@@ -263,7 +263,7 @@ case "$TEST_NUMBER" in
 	GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
 	export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 	;;
-[0-4]*|5[0-4]*|55[0-3]*)
+[0-4]*|5[0-5]*)
 	GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 	export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 	;;
-- 
gitgitgadget


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH v2 16/27] t5[6-9]*: adjust the references to the default branch name "main"
  2020-11-17 16:12 ` [PATCH v2 00/27] tests: use " Johannes Schindelin via GitGitGadget
                     ` (14 preceding siblings ...)
  2020-11-17 16:12   ` [PATCH v2 15/27] t55[4-9]*: " Johannes Schindelin via GitGitGadget
@ 2020-11-17 16:12   ` Johannes Schindelin via GitGitGadget
  2020-11-17 16:12   ` [PATCH v2 17/27] t6[0-3]*: " Johannes Schindelin via GitGitGadget
                     ` (12 subsequent siblings)
  28 siblings, 0 replies; 163+ messages in thread
From: Johannes Schindelin via GitGitGadget @ 2020-11-17 16:12 UTC (permalink / raw)
  To: git
  Cc: Felipe Contreras, Ævar Arnfjörð Bjarmason,
	Johannes Schindelin, Jeff King, Johannes Schindelin,
	Johannes Schindelin

From: Johannes Schindelin <johannes.schindelin@gmx.de>

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>
---
 t/t5601-clone.sh                    |  4 +-
 t/t5604-clone-reference.sh          | 12 +++---
 t/t5605-clone-local.sh              | 10 ++---
 t/t5606-clone-options.sh            |  8 ++--
 t/t5607-clone-bundle.sh             | 14 +++----
 t/t5608-clone-2gb.sh                |  2 +-
 t/t5609-clone-branch.sh             |  6 +--
 t/t5610-clone-detached.sh           |  4 +-
 t/t5611-clone-config.sh             | 16 ++++----
 t/t5612-clone-refspec.sh            | 42 ++++++++++-----------
 t/t5614-clone-submodules-shallow.sh |  2 +-
 t/t5616-partial-clone.sh            | 50 ++++++++++++-------------
 t/t5617-clone-submodules-remote.sh  |  6 +--
 t/t5700-protocol-v1.sh              | 16 ++++----
 t/t5701-git-serve.sh                | 16 ++++----
 t/t5702-protocol-v2.sh              | 50 ++++++++++++-------------
 t/t5703-upload-pack-ref-in-want.sh  | 58 ++++++++++++++---------------
 t/t5801-remote-helpers.sh           | 24 ++++++------
 t/test-lib.sh                       |  2 +-
 19 files changed, 171 insertions(+), 171 deletions(-)

diff --git a/t/t5601-clone.sh b/t/t5601-clone.sh
index 7df3c5373a..f5058be718 100755
--- a/t/t5601-clone.sh
+++ b/t/t5601-clone.sh
@@ -217,7 +217,7 @@ test_expect_success 'clone respects global branch.autosetuprebase' '
 		rm -fr dst &&
 		git clone src dst &&
 		cd dst &&
-		actual="z$(git config branch.master.rebase)" &&
+		actual="z$(git config branch.main.rebase)" &&
 		test ztrue = $actual
 	)
 '
@@ -591,7 +591,7 @@ test_expect_success 'clone from a repository with two identical branches' '
 
 	(
 		cd src &&
-		git checkout -b another master
+		git checkout -b another main
 	) &&
 	git clone src target-11 &&
 	test "z$( cd target-11 && git symbolic-ref HEAD )" = zrefs/heads/another
diff --git a/t/t5604-clone-reference.sh b/t/t5604-clone-reference.sh
index 2f7be23044..db86a84af9 100755
--- a/t/t5604-clone-reference.sh
+++ b/t/t5604-clone-reference.sh
@@ -49,7 +49,7 @@ test_expect_success 'existence of info/alternates' '
 '
 
 test_expect_success 'pulling from reference' '
-	git -C C pull ../B master
+	git -C C pull ../B main
 '
 
 test_expect_success 'that reference gets used' '
@@ -70,7 +70,7 @@ test_expect_success 'existence of info/alternates' '
 '
 
 test_expect_success 'pulling from reference' '
-	git -C D pull ../B master
+	git -C D pull ../B main
 '
 
 test_expect_success 'that reference gets used' '
@@ -136,11 +136,11 @@ test_expect_success 'prepare branched repository' '
 	git clone A J &&
 	(
 		cd J &&
-		git checkout -b other master^ &&
+		git checkout -b other main^ &&
 		echo other >otherfile &&
 		git add otherfile &&
 		git commit -m other &&
-		git checkout master
+		git checkout main
 	)
 '
 
@@ -152,9 +152,9 @@ test_expect_success 'fetch with incomplete alternates' '
 		git remote add J "file://$base_dir/J" &&
 		GIT_TRACE_PACKET=$U.K git fetch J
 	) &&
-	master_object=$(cd A && git for-each-ref --format="%(objectname)" refs/heads/master) &&
+	main_object=$(cd A && git for-each-ref --format="%(objectname)" refs/heads/main) &&
 	test -s "$U.K" &&
-	! grep " want $master_object" "$U.K" &&
+	! grep " want $main_object" "$U.K" &&
 	tag_object=$(cd A && git for-each-ref --format="%(objectname)" refs/tags/HEAD) &&
 	! grep " want $tag_object" "$U.K"
 '
diff --git a/t/t5605-clone-local.sh b/t/t5605-clone-local.sh
index af23419ebf..a7756e9622 100755
--- a/t/t5605-clone-local.sh
+++ b/t/t5605-clone-local.sh
@@ -15,7 +15,7 @@ test_expect_success 'preparing origin repository' '
 	test "$(cd a.git && git config --bool core.bare)" = true &&
 	test "$(cd x && git config --bool core.bare)" = true &&
 	git bundle create b1.bundle --all &&
-	git bundle create b2.bundle master &&
+	git bundle create b2.bundle main &&
 	mkdir dir &&
 	cp b1.bundle dir/b3 &&
 	cp b1.bundle b4
@@ -84,7 +84,7 @@ test_expect_success 'bundle clone with nonexistent HEAD' '
 	git clone b2.bundle b2 &&
 	(cd b2 &&
 	git fetch &&
-	test_must_fail git rev-parse --verify refs/heads/master)
+	test_must_fail git rev-parse --verify refs/heads/main)
 '
 
 test_expect_success 'clone empty repository' '
@@ -98,9 +98,9 @@ test_expect_success 'clone empty repository' '
 	 echo "content" >> foo &&
 	 git add foo &&
 	 git commit -m "Initial commit" &&
-	 git push origin master &&
-	 expected=$(git rev-parse master) &&
-	 actual=$(git --git-dir=../empty/.git rev-parse master) &&
+	 git push origin main &&
+	 expected=$(git rev-parse main) &&
+	 actual=$(git --git-dir=../empty/.git rev-parse main) &&
 	 test $actual = $expected)
 '
 
diff --git a/t/t5606-clone-options.sh b/t/t5606-clone-options.sh
index 7f082fb23b..80caff9266 100755
--- a/t/t5606-clone-options.sh
+++ b/t/t5606-clone-options.sh
@@ -15,7 +15,7 @@ test_expect_success 'setup' '
 test_expect_success 'clone -o' '
 
 	git clone -o foo parent clone-o &&
-	git -C clone-o rev-parse --verify refs/remotes/foo/master
+	git -C clone-o rev-parse --verify refs/remotes/foo/main
 
 '
 
@@ -45,7 +45,7 @@ test_expect_success 'disallows --bare with --separate-git-dir' '
 test_expect_success 'uses "origin" for default remote name' '
 
 	git clone parent clone-default-origin &&
-	git -C clone-default-origin rev-parse --verify refs/remotes/origin/master
+	git -C clone-default-origin rev-parse --verify refs/remotes/origin/main
 
 '
 
@@ -74,14 +74,14 @@ test_expect_success 'prefers config "clone.defaultRemoteName" over default' '
 
 	test_config_global clone.defaultRemoteName from_config &&
 	git clone parent clone-config-origin &&
-	git -C clone-config-origin rev-parse --verify refs/remotes/from_config/master
+	git -C clone-config-origin rev-parse --verify refs/remotes/from_config/main
 
 '
 
 test_expect_success 'prefers --origin over -c config' '
 
 	git clone -c clone.defaultRemoteName=inline --origin from_option parent clone-o-and-inline-config &&
-	git -C clone-o-and-inline-config rev-parse --verify refs/remotes/from_option/master
+	git -C clone-o-and-inline-config rev-parse --verify refs/remotes/from_option/main
 
 '
 
diff --git a/t/t5607-clone-bundle.sh b/t/t5607-clone-bundle.sh
index 26985f4b44..4f2db37981 100755
--- a/t/t5607-clone-bundle.sh
+++ b/t/t5607-clone-bundle.sh
@@ -19,7 +19,7 @@ test_expect_success 'setup' '
 '
 
 test_expect_success '"verify" needs a worktree' '
-	git bundle create tip.bundle -1 master &&
+	git bundle create tip.bundle -1 main &&
 	nongit test_must_fail git bundle verify ../tip.bundle 2>err &&
 	test_i18ngrep "need a repository" err
 '
@@ -39,15 +39,15 @@ test_expect_success 'die if bundle file cannot be created' '
 '
 
 test_expect_failure 'bundle --stdin' '
-	echo master | git bundle create stdin-bundle.bdl --stdin &&
+	echo main | git bundle create stdin-bundle.bdl --stdin &&
 	git ls-remote stdin-bundle.bdl >output &&
-	grep master output
+	grep main output
 '
 
 test_expect_failure 'bundle --stdin <rev-list options>' '
-	echo master | git bundle create hybrid-bundle.bdl --stdin tag &&
+	echo main | git bundle create hybrid-bundle.bdl --stdin tag &&
 	git ls-remote hybrid-bundle.bdl >output &&
-	grep master output
+	grep main output
 '
 
 test_expect_success 'empty bundle file is rejected' '
@@ -83,14 +83,14 @@ test_expect_success 'prerequisites with an empty commit message' '
 
 test_expect_success 'failed bundle creation does not leave cruft' '
 	# This fails because the bundle would be empty.
-	test_must_fail git bundle create fail.bundle master..master &&
+	test_must_fail git bundle create fail.bundle main..main &&
 	test_path_is_missing fail.bundle.lock
 '
 
 test_expect_success 'fetch SHA-1 from bundle' '
 	test_create_repo foo &&
 	test_commit -C foo x &&
-	git -C foo bundle create tip.bundle -1 master &&
+	git -C foo bundle create tip.bundle -1 main &&
 	git -C foo rev-parse HEAD >hash &&
 
 	# Exercise to ensure that fetching a SHA-1 from a bundle works with no
diff --git a/t/t5608-clone-2gb.sh b/t/t5608-clone-2gb.sh
index 4c476d2fa1..87a8cd9f98 100755
--- a/t/t5608-clone-2gb.sh
+++ b/t/t5608-clone-2gb.sh
@@ -26,7 +26,7 @@ test_expect_success 'setup' '
 		i=$(($i+1)) ||
 		echo $? > exit-status
 	 done &&
-	 echo "commit refs/heads/master" &&
+	 echo "commit refs/heads/main" &&
 	 echo "author A U Thor <author@email.com> 123456789 +0000" &&
 	 echo "committer C O Mitter <committer@email.com> 123456789 +0000" &&
 	 echo "data 5" &&
diff --git a/t/t5609-clone-branch.sh b/t/t5609-clone-branch.sh
index 6e7a7be052..2652dbe4e4 100755
--- a/t/t5609-clone-branch.sh
+++ b/t/t5609-clone-branch.sh
@@ -20,7 +20,7 @@ test_expect_success 'setup' '
 	 echo one >file && git add file && git commit -m one &&
 	 git checkout -b two &&
 	 echo two >file && git add file && git commit -m two &&
-	 git checkout master) &&
+	 git checkout main) &&
 	mkdir empty &&
 	(cd empty && git init)
 '
@@ -28,7 +28,7 @@ test_expect_success 'setup' '
 test_expect_success 'vanilla clone chooses HEAD' '
 	git clone parent clone &&
 	(cd clone &&
-	 check_HEAD master &&
+	 check_HEAD main &&
 	 check_file one
 	)
 '
@@ -53,7 +53,7 @@ test_expect_success 'clone -b sets up tracking' '
 
 test_expect_success 'clone -b does not munge remotes/origin/HEAD' '
 	(cd clone-two &&
-	 echo refs/remotes/origin/master >expect &&
+	 echo refs/remotes/origin/main >expect &&
 	 git symbolic-ref refs/remotes/origin/HEAD >actual &&
 	 test_cmp expect actual
 	)
diff --git a/t/t5610-clone-detached.sh b/t/t5610-clone-detached.sh
index 8b0d607df1..985f0d7303 100755
--- a/t/t5610-clone-detached.sh
+++ b/t/t5610-clone-detached.sh
@@ -20,7 +20,7 @@ test_expect_success 'setup' '
 '
 
 test_expect_success 'clone repo (detached HEAD points to branch)' '
-	git checkout master^0 &&
+	git checkout main^0 &&
 	git clone "file://$PWD" detached-branch
 '
 test_expect_success 'cloned HEAD matches' '
@@ -59,7 +59,7 @@ test_expect_success 'cloned HEAD is detached' '
 '
 
 test_expect_success 'clone repo (orphan detached HEAD)' '
-	git checkout master^0 &&
+	git checkout main^0 &&
 	echo four >file &&
 	git commit -a -m four &&
 	git clone "file://$PWD" detached-orphan
diff --git a/t/t5611-clone-config.sh b/t/t5611-clone-config.sh
index 8e0fd39823..6e10ac9a9f 100755
--- a/t/t5611-clone-config.sh
+++ b/t/t5611-clone-config.sh
@@ -47,16 +47,16 @@ test_expect_success 'clone -c config is available during clone' '
 
 test_expect_success 'clone -c remote.origin.fetch=<refspec> works' '
 	rm -rf child &&
-	git update-ref refs/grab/it refs/heads/master &&
-	git update-ref refs/leave/out refs/heads/master &&
+	git update-ref refs/grab/it refs/heads/main &&
+	git update-ref refs/leave/out refs/heads/main &&
 	git clone -c "remote.origin.fetch=+refs/grab/*:refs/grab/*" . child &&
 	git -C child for-each-ref --format="%(refname)" >actual &&
 
 	cat >expect <<-\EOF &&
 	refs/grab/it
-	refs/heads/master
+	refs/heads/main
 	refs/remotes/origin/HEAD
-	refs/remotes/origin/master
+	refs/remotes/origin/main
 	EOF
 	test_cmp expect actual
 '
@@ -68,9 +68,9 @@ test_expect_success 'git -c remote.origin.fetch=<refspec> clone works' '
 
 	cat >expect <<-\EOF &&
 	refs/grab/it
-	refs/heads/master
+	refs/heads/main
 	refs/remotes/origin/HEAD
-	refs/remotes/origin/master
+	refs/remotes/origin/main
 	EOF
 	test_cmp expect actual
 '
@@ -85,9 +85,9 @@ test_expect_success 'clone -c remote.<remote>.fetch=<refspec> --origin=<name>' '
 
 	cat >expect <<-\EOF &&
 	refs/grab/it
-	refs/heads/master
+	refs/heads/main
 	refs/remotes/upstream/HEAD
-	refs/remotes/upstream/master
+	refs/remotes/upstream/main
 	EOF
 	test_cmp expect actual
 '
diff --git a/t/t5612-clone-refspec.sh b/t/t5612-clone-refspec.sh
index e3b436d8ae..c045aba0fd 100755
--- a/t/t5612-clone-refspec.sh
+++ b/t/t5612-clone-refspec.sh
@@ -4,7 +4,7 @@ test_description='test refspec written by clone-command'
 . ./test-lib.sh
 
 test_expect_success 'setup' '
-	# Make two branches, "master" and "side"
+	# Make two branches, "main" and "side"
 	echo one >file &&
 	git add file &&
 	git commit -m one &&
@@ -16,7 +16,7 @@ test_expect_success 'setup' '
 	git checkout -b side &&
 	echo four >file &&
 	git commit -a -m four &&
-	git checkout master &&
+	git checkout main &&
 	git tag five &&
 
 	# default clone
@@ -25,18 +25,18 @@ test_expect_success 'setup' '
 	# default clone --no-tags
 	git clone --no-tags . dir_all_no_tags &&
 
-	# default --single that follows HEAD=master
-	git clone --single-branch . dir_master &&
+	# default --single that follows HEAD=main
+	git clone --single-branch . dir_main &&
 
-	# default --single that follows HEAD=master with no tags
-	git clone --single-branch --no-tags . dir_master_no_tags &&
+	# default --single that follows HEAD=main with no tags
+	git clone --single-branch --no-tags . dir_main_no_tags &&
 
 	# default --single that follows HEAD=side
 	git checkout side &&
 	git clone --single-branch . dir_side &&
 
 	# explicit --single that follows side
-	git checkout master &&
+	git checkout main &&
 	git clone --single-branch --branch side . dir_side2 &&
 
 	# default --single with --mirror
@@ -55,11 +55,11 @@ test_expect_success 'setup' '
 	# explicit --single with tag and --no-tags
 	git clone --single-branch --no-tags --branch two . dir_tag_no_tags &&
 
-	# advance both "master" and "side" branches
+	# advance both "main" and "side" branches
 	git checkout side &&
 	echo five >file &&
 	git commit -a -m five &&
-	git checkout master &&
+	git checkout main &&
 	echo six >file &&
 	git commit -a -m six &&
 
@@ -75,7 +75,7 @@ test_expect_success 'by default all branches will be kept updated' '
 		sed -e "/HEAD$/d" \
 		    -e "s|/remotes/origin/|/heads/|" refs >../actual
 	) &&
-	# follow both master and side
+	# follow both main and side
 	git for-each-ref refs/heads >expect &&
 	test_cmp expect actual
 '
@@ -100,20 +100,20 @@ test_expect_success 'clone with --no-tags' '
 	test_must_be_empty actual
 '
 
-test_expect_success '--single-branch while HEAD pointing at master' '
+test_expect_success '--single-branch while HEAD pointing at main' '
 	(
-		cd dir_master &&
+		cd dir_main &&
 		git fetch --force &&
 		git for-each-ref refs/remotes/origin >refs &&
 		sed -e "/HEAD$/d" \
 		    -e "s|/remotes/origin/|/heads/|" refs >../actual
 	) &&
-	# only follow master
-	git for-each-ref refs/heads/master >expect &&
+	# only follow main
+	git for-each-ref refs/heads/main >expect &&
 	# get & check latest tags
 	test_cmp expect actual &&
 	(
-		cd dir_master &&
+		cd dir_main &&
 		git fetch --tags --force &&
 		git for-each-ref refs/tags >../actual
 	) &&
@@ -122,20 +122,20 @@ test_expect_success '--single-branch while HEAD pointing at master' '
 	test_line_count = 2 actual
 '
 
-test_expect_success '--single-branch while HEAD pointing at master and --no-tags' '
+test_expect_success '--single-branch while HEAD pointing at main and --no-tags' '
 	(
-		cd dir_master_no_tags &&
+		cd dir_main_no_tags &&
 		git fetch &&
 		git for-each-ref refs/remotes/origin >refs &&
 		sed -e "/HEAD$/d" \
 		    -e "s|/remotes/origin/|/heads/|" refs >../actual
 	) &&
-	# only follow master
-	git for-each-ref refs/heads/master >expect &&
+	# only follow main
+	git for-each-ref refs/heads/main >expect &&
 	test_cmp expect actual &&
 	# get tags (noop)
 	(
-		cd dir_master_no_tags &&
+		cd dir_main_no_tags &&
 		git fetch &&
 		git for-each-ref refs/tags >../actual
 	) &&
@@ -143,7 +143,7 @@ test_expect_success '--single-branch while HEAD pointing at master and --no-tags
 	test_line_count = 0 actual &&
 	# get tags with --tags overrides tagOpt
 	(
-		cd dir_master_no_tags &&
+		cd dir_main_no_tags &&
 		git fetch --tags &&
 		git for-each-ref refs/tags >../actual
 	) &&
diff --git a/t/t5614-clone-submodules-shallow.sh b/t/t5614-clone-submodules-shallow.sh
index e4e6ea4d52..5504b519c7 100755
--- a/t/t5614-clone-submodules-shallow.sh
+++ b/t/t5614-clone-submodules-shallow.sh
@@ -7,7 +7,7 @@ test_description='Test shallow cloning of repos with submodules'
 pwd=$(pwd)
 
 test_expect_success 'setup' '
-	git checkout -b master &&
+	git checkout -b main &&
 	test_commit commit1 &&
 	test_commit commit2 &&
 	mkdir sub &&
diff --git a/t/t5616-partial-clone.sh b/t/t5616-partial-clone.sh
index f4d49d8335..273c0183e2 100755
--- a/t/t5616-partial-clone.sh
+++ b/t/t5616-partial-clone.sh
@@ -51,14 +51,14 @@ test_expect_success 'verify that .promisor file contains refs fetched' '
 	test_line_count = 1 promisorlist &&
 	git -C srv.bare rev-parse --verify HEAD >headhash &&
 	grep "$(cat headhash) HEAD" $(cat promisorlist) &&
-	grep "$(cat headhash) refs/heads/master" $(cat promisorlist)
+	grep "$(cat headhash) refs/heads/main" $(cat promisorlist)
 '
 
-# checkout master to force dynamic object fetch of blobs at HEAD.
+# checkout main to force dynamic object fetch of blobs at HEAD.
 test_expect_success 'verify checkout with dynamic object fetch' '
 	git -C pc1 rev-list --quiet --objects --missing=print HEAD >observed &&
 	test_line_count = 4 observed &&
-	git -C pc1 checkout master &&
+	git -C pc1 checkout main &&
 	git -C pc1 rev-list --quiet --objects --missing=print HEAD >observed &&
 	test_line_count = 0 observed
 '
@@ -73,8 +73,8 @@ test_expect_success 'push new commits to server' '
 		git -C src add file.1.txt
 		git -C src commit -m "mod $x"
 	done &&
-	git -C src blame master -- file.1.txt >expect.blame &&
-	git -C src push -u srv master
+	git -C src blame main -- file.1.txt >expect.blame &&
+	git -C src push -u srv main
 '
 
 # (partial) fetch in the partial clone repo from the promisor remote.
@@ -83,26 +83,26 @@ test_expect_success 'push new commits to server' '
 test_expect_success 'partial fetch inherits filter settings' '
 	git -C pc1 fetch origin &&
 	git -C pc1 rev-list --quiet --objects --missing=print \
-		master..origin/master >observed &&
+		main..origin/main >observed &&
 	test_line_count = 5 observed
 '
 
 # force dynamic object fetch using diff.
-# we should only get 1 new blob (for the file in origin/master).
+# we should only get 1 new blob (for the file in origin/main).
 test_expect_success 'verify diff causes dynamic object fetch' '
-	git -C pc1 diff master..origin/master -- file.1.txt &&
+	git -C pc1 diff main..origin/main -- file.1.txt &&
 	git -C pc1 rev-list --quiet --objects --missing=print \
-		 master..origin/master >observed &&
+		 main..origin/main >observed &&
 	test_line_count = 4 observed
 '
 
 # force full dynamic object fetch of the file's history using blame.
 # we should get the intermediate blobs for the file.
 test_expect_success 'verify blame causes dynamic object fetch' '
-	git -C pc1 blame origin/master -- file.1.txt >observed.blame &&
+	git -C pc1 blame origin/main -- file.1.txt >observed.blame &&
 	test_cmp expect.blame observed.blame &&
 	git -C pc1 rev-list --quiet --objects --missing=print \
-		master..origin/master >observed &&
+		main..origin/main >observed &&
 	test_line_count = 0 observed
 '
 
@@ -115,7 +115,7 @@ test_expect_success 'push new commits to server for file.2.txt' '
 		git -C src add file.2.txt
 		git -C src commit -m "mod $x"
 	done &&
-	git -C src push -u srv master
+	git -C src push -u srv main
 '
 
 # Do FULL fetch by disabling inherited filter-spec using --no-filter.
@@ -123,7 +123,7 @@ test_expect_success 'push new commits to server for file.2.txt' '
 test_expect_success 'override inherited filter-spec using --no-filter' '
 	git -C pc1 fetch --no-filter origin &&
 	git -C pc1 rev-list --quiet --objects --missing=print \
-		master..origin/master >observed &&
+		main..origin/main >observed &&
 	test_line_count = 0 observed
 '
 
@@ -136,7 +136,7 @@ test_expect_success 'push new commits to server for file.3.txt' '
 		git -C src add file.3.txt
 		git -C src commit -m "mod $x"
 	done &&
-	git -C src push -u srv master
+	git -C src push -u srv main
 '
 
 # Do a partial fetch and then try to manually fetch the missing objects.
@@ -146,7 +146,7 @@ test_expect_success 'manual prefetch of missing objects' '
 	git -C pc1 fetch --filter=blob:none origin &&
 
 	git -C pc1 rev-list --quiet --objects --missing=print \
-		 master..origin/master >revs &&
+		 main..origin/main >revs &&
 	awk -f print_1.awk revs |
 	sed "s/?//" |
 	sort >observed.oids &&
@@ -155,7 +155,7 @@ test_expect_success 'manual prefetch of missing objects' '
 	git -C pc1 fetch-pack --stdin "file://$(pwd)/srv.bare" <observed.oids &&
 
 	git -C pc1 rev-list --quiet --objects --missing=print \
-		master..origin/master >revs &&
+		main..origin/main >revs &&
 	awk -f print_1.awk revs |
 	sed "s/?//" |
 	sort >observed.oids &&
@@ -196,7 +196,7 @@ test_expect_success 'use fsck before and after manually fetching a missing subtr
 	echo "in dir" >src/dir/file.txt &&
 	git -C src add dir/file.txt &&
 	git -C src commit -m "file in dir" &&
-	git -C src push -u srv master &&
+	git -C src push -u srv main &&
 	SUBTREE=$(git -C src rev-parse HEAD:dir) &&
 
 	rm -rf dst &&
@@ -204,7 +204,7 @@ test_expect_success 'use fsck before and after manually fetching a missing subtr
 	git -C dst fsck &&
 
 	# Make sure we only have commits, and all trees and blobs are missing.
-	git -C dst rev-list --missing=allow-any --objects master \
+	git -C dst rev-list --missing=allow-any --objects main \
 		>fetched_objects &&
 	awk -f print_1.awk fetched_objects |
 	xargs -n1 git -C dst cat-file -t >fetched_types &&
@@ -221,7 +221,7 @@ test_expect_success 'use fsck before and after manually fetching a missing subtr
 	git -C dst fsck &&
 
 	# Auto-fetch all remaining trees and blobs with --missing=error
-	git -C dst rev-list --missing=error --objects master >fetched_objects &&
+	git -C dst rev-list --missing=error --objects main >fetched_objects &&
 	test_line_count = 70 fetched_objects &&
 
 	awk -f print_1.awk fetched_objects |
@@ -331,7 +331,7 @@ test_expect_success 'setup src repo for sparse filter' '
 test_expect_success 'partial clone with sparse filter succeeds' '
 	rm -rf dst.git &&
 	git clone --no-local --bare \
-		  --filter=sparse:oid=master:only-one \
+		  --filter=sparse:oid=main:only-one \
 		  sparse-src dst.git &&
 	(
 		cd dst.git &&
@@ -344,11 +344,11 @@ test_expect_success 'partial clone with sparse filter succeeds' '
 test_expect_success 'partial clone with unresolvable sparse filter fails cleanly' '
 	rm -rf dst.git &&
 	test_must_fail git clone --no-local --bare \
-				 --filter=sparse:oid=master:no-such-name \
+				 --filter=sparse:oid=main:no-such-name \
 				 sparse-src dst.git 2>err &&
-	test_i18ngrep "unable to access sparse blob in .master:no-such-name" err &&
+	test_i18ngrep "unable to access sparse blob in .main:no-such-name" err &&
 	test_must_fail git clone --no-local --bare \
-				 --filter=sparse:oid=master \
+				 --filter=sparse:oid=main \
 				 sparse-src dst.git 2>err &&
 	test_i18ngrep "unable to parse sparse filter data in" err
 '
@@ -403,7 +403,7 @@ test_expect_success 'fetch lazy-fetches only to resolve deltas' '
 	# promisor remote other than for the big tree (because it needs to
 	# resolve the delta).
 	GIT_TRACE_PACKET="$(pwd)/trace" git -C client \
-		fetch "file://$(pwd)/server" master &&
+		fetch "file://$(pwd)/server" main &&
 
 	# Verify the assumption that the client needed to fetch the delta base
 	# to resolve the delta.
@@ -422,7 +422,7 @@ test_expect_success 'fetch lazy-fetches only to resolve deltas, protocol v2' '
 	# promisor remote other than for the big blob (because it needs to
 	# resolve the delta).
 	GIT_TRACE_PACKET="$(pwd)/trace" git -C client \
-		fetch "file://$(pwd)/server" master &&
+		fetch "file://$(pwd)/server" main &&
 
 	# Verify that protocol version 2 was used.
 	grep "fetch< version 2" trace &&
diff --git a/t/t5617-clone-submodules-remote.sh b/t/t5617-clone-submodules-remote.sh
index 1a041df10b..abab358119 100755
--- a/t/t5617-clone-submodules-remote.sh
+++ b/t/t5617-clone-submodules-remote.sh
@@ -7,7 +7,7 @@ test_description='Test cloning repos with submodules using remote-tracking branc
 pwd=$(pwd)
 
 test_expect_success 'setup' '
-	git checkout -b master &&
+	git checkout -b main &&
 	test_commit commit1 &&
 	mkdir sub &&
 	(
@@ -39,7 +39,7 @@ test_expect_success 'clone with --remote-submodules' '
 	git clone --recurse-submodules --remote-submodules "file://$pwd/." super_clone &&
 	(
 		cd super_clone/sub &&
-		git diff --exit-code remotes/origin/master
+		git diff --exit-code remotes/origin/main
 	)
 '
 
@@ -57,7 +57,7 @@ test_expect_success 'clone with --single-branch' '
 	git clone --recurse-submodules --single-branch "file://$pwd/." super_clone &&
 	(
 		cd super_clone/sub &&
-		git rev-parse --verify origin/master &&
+		git rev-parse --verify origin/main &&
 		test_must_fail git rev-parse --verify origin/other
 	)
 '
diff --git a/t/t5700-protocol-v1.sh b/t/t5700-protocol-v1.sh
index 022901b9eb..bfa7e3379a 100755
--- a/t/t5700-protocol-v1.sh
+++ b/t/t5700-protocol-v1.sh
@@ -41,7 +41,7 @@ test_expect_success 'fetch with git:// using protocol v1' '
 	GIT_TRACE_PACKET=1 git -C daemon_child -c protocol.version=1 \
 		fetch 2>log &&
 
-	git -C daemon_child log -1 --format=%s origin/master >actual &&
+	git -C daemon_child log -1 --format=%s origin/main >actual &&
 	git -C "$daemon_parent" log -1 --format=%s >expect &&
 	test_cmp expect actual &&
 
@@ -69,7 +69,7 @@ test_expect_success 'push with git:// using protocol v1' '
 	test_commit -C daemon_child three &&
 
 	# Push to another branch, as the target repository has the
-	# master branch checked out and we cannot push into it.
+	# main branch checked out and we cannot push into it.
 	GIT_TRACE_PACKET=1 git -C daemon_child -c protocol.version=1 \
 		push origin HEAD:client_branch 2>log &&
 
@@ -110,7 +110,7 @@ test_expect_success 'fetch with file:// using protocol v1' '
 	GIT_TRACE_PACKET=1 git -C file_child -c protocol.version=1 \
 		fetch 2>log &&
 
-	git -C file_child log -1 --format=%s origin/master >actual &&
+	git -C file_child log -1 --format=%s origin/main >actual &&
 	git -C file_parent log -1 --format=%s >expect &&
 	test_cmp expect actual &&
 
@@ -134,7 +134,7 @@ test_expect_success 'push with file:// using protocol v1' '
 	test_commit -C file_child three &&
 
 	# Push to another branch, as the target repository has the
-	# master branch checked out and we cannot push into it.
+	# main branch checked out and we cannot push into it.
 	GIT_TRACE_PACKET=1 git -C file_child -c protocol.version=1 \
 		push origin HEAD:client_branch 2>log &&
 
@@ -188,7 +188,7 @@ test_expect_success 'fetch with ssh:// using protocol v1' '
 		fetch 2>log &&
 	expect_ssh git-upload-pack &&
 
-	git -C ssh_child log -1 --format=%s origin/master >actual &&
+	git -C ssh_child log -1 --format=%s origin/main >actual &&
 	git -C ssh_parent log -1 --format=%s >expect &&
 	test_cmp expect actual &&
 
@@ -213,7 +213,7 @@ test_expect_success 'push with ssh:// using protocol v1' '
 	test_commit -C ssh_child three &&
 
 	# Push to another branch, as the target repository has the
-	# master branch checked out and we cannot push into it.
+	# main branch checked out and we cannot push into it.
 	GIT_TRACE_PACKET=1 git -C ssh_child -c protocol.version=1 \
 		push origin HEAD:client_branch 2>log &&
 	expect_ssh git-receive-pack &&
@@ -257,7 +257,7 @@ test_expect_success 'fetch with http:// using protocol v1' '
 	GIT_TRACE_PACKET=1 git -C http_child -c protocol.version=1 \
 		fetch 2>log &&
 
-	git -C http_child log -1 --format=%s origin/master >actual &&
+	git -C http_child log -1 --format=%s origin/main >actual &&
 	git -C "$HTTPD_DOCUMENT_ROOT_PATH/http_parent" log -1 --format=%s >expect &&
 	test_cmp expect actual &&
 
@@ -281,7 +281,7 @@ test_expect_success 'push with http:// using protocol v1' '
 	test_commit -C http_child three &&
 
 	# Push to another branch, as the target repository has the
-	# master branch checked out and we cannot push into it.
+	# main branch checked out and we cannot push into it.
 	GIT_TRACE_PACKET=1 git -C http_child -c protocol.version=1 \
 		push origin HEAD:client_branch && #2>log &&
 
diff --git a/t/t5701-git-serve.sh b/t/t5701-git-serve.sh
index a1f5fdc9fd..3a04a56c2c 100755
--- a/t/t5701-git-serve.sh
+++ b/t/t5701-git-serve.sh
@@ -83,9 +83,9 @@ test_expect_success 'wrong object-format' '
 #
 test_expect_success 'setup some refs and tags' '
 	test_commit one &&
-	git branch dev master &&
+	git branch dev main &&
 	test_commit two &&
-	git symbolic-ref refs/heads/release refs/heads/master &&
+	git symbolic-ref refs/heads/release refs/heads/main &&
 	git tag -a -m "annotated tag" annotated-tag
 '
 
@@ -99,7 +99,7 @@ test_expect_success 'basics of ls-refs' '
 	cat >expect <<-EOF &&
 	$(git rev-parse HEAD) HEAD
 	$(git rev-parse refs/heads/dev) refs/heads/dev
-	$(git rev-parse refs/heads/master) refs/heads/master
+	$(git rev-parse refs/heads/main) refs/heads/main
 	$(git rev-parse refs/heads/release) refs/heads/release
 	$(git rev-parse refs/tags/annotated-tag) refs/tags/annotated-tag
 	$(git rev-parse refs/tags/one) refs/tags/one
@@ -117,13 +117,13 @@ test_expect_success 'basic ref-prefixes' '
 	command=ls-refs
 	object-format=$(test_oid algo)
 	0001
-	ref-prefix refs/heads/master
+	ref-prefix refs/heads/main
 	ref-prefix refs/tags/one
 	0000
 	EOF
 
 	cat >expect <<-EOF &&
-	$(git rev-parse refs/heads/master) refs/heads/master
+	$(git rev-parse refs/heads/main) refs/heads/main
 	$(git rev-parse refs/tags/one) refs/tags/one
 	0000
 	EOF
@@ -144,7 +144,7 @@ test_expect_success 'refs/heads prefix' '
 
 	cat >expect <<-EOF &&
 	$(git rev-parse refs/heads/dev) refs/heads/dev
-	$(git rev-parse refs/heads/master) refs/heads/master
+	$(git rev-parse refs/heads/main) refs/heads/main
 	$(git rev-parse refs/heads/release) refs/heads/release
 	0000
 	EOF
@@ -188,8 +188,8 @@ test_expect_success 'symrefs parameter' '
 
 	cat >expect <<-EOF &&
 	$(git rev-parse refs/heads/dev) refs/heads/dev
-	$(git rev-parse refs/heads/master) refs/heads/master
-	$(git rev-parse refs/heads/release) refs/heads/release symref-target:refs/heads/master
+	$(git rev-parse refs/heads/main) refs/heads/main
+	$(git rev-parse refs/heads/release) refs/heads/release symref-target:refs/heads/main
 	0000
 	EOF
 
diff --git a/t/t5702-protocol-v2.sh b/t/t5702-protocol-v2.sh
index 7d5b17909b..1aeb6b6dd7 100755
--- a/t/t5702-protocol-v2.sh
+++ b/t/t5702-protocol-v2.sh
@@ -36,10 +36,10 @@ test_expect_success 'ref advertisement is filtered with ls-remote using protocol
 	test_when_finished "rm -f log" &&
 
 	GIT_TRACE_PACKET="$(pwd)/log" git -c protocol.version=2 \
-		ls-remote "$GIT_DAEMON_URL/parent" master >actual &&
+		ls-remote "$GIT_DAEMON_URL/parent" main >actual &&
 
 	cat >expect <<-EOF &&
-	$(git -C "$daemon_parent" rev-parse refs/heads/master)$(printf "\t")refs/heads/master
+	$(git -C "$daemon_parent" rev-parse refs/heads/main)$(printf "\t")refs/heads/main
 	EOF
 
 	test_cmp expect actual
@@ -69,7 +69,7 @@ test_expect_success 'fetch with git:// using protocol v2' '
 	GIT_TRACE_PACKET="$(pwd)/log" git -C daemon_child -c protocol.version=2 \
 		fetch &&
 
-	git -C daemon_child log -1 --format=%s origin/master >actual &&
+	git -C daemon_child log -1 --format=%s origin/main >actual &&
 	git -C "$daemon_parent" log -1 --format=%s >expect &&
 	test_cmp expect actual &&
 
@@ -118,7 +118,7 @@ test_expect_success 'push with git:// and a config of v2 does not request v2' '
 	test_commit -C daemon_child three &&
 
 	# Push to another branch, as the target repository has the
-	# master branch checked out and we cannot push into it.
+	# main branch checked out and we cannot push into it.
 	GIT_TRACE_PACKET="$(pwd)/log" git -C daemon_child -c protocol.version=2 \
 		push origin HEAD:client_branch &&
 
@@ -158,10 +158,10 @@ test_expect_success 'ref advertisement is filtered with ls-remote using protocol
 	test_when_finished "rm -f log" &&
 
 	GIT_TRACE_PACKET="$(pwd)/log" git -c protocol.version=2 \
-		ls-remote "file://$(pwd)/file_parent" master >actual &&
+		ls-remote "file://$(pwd)/file_parent" main >actual &&
 
 	cat >expect <<-EOF &&
-	$(git -C file_parent rev-parse refs/heads/master)$(printf "\t")refs/heads/master
+	$(git -C file_parent rev-parse refs/heads/main)$(printf "\t")refs/heads/main
 	EOF
 
 	test_cmp expect actual
@@ -171,10 +171,10 @@ test_expect_success 'server-options are sent when using ls-remote' '
 	test_when_finished "rm -f log" &&
 
 	GIT_TRACE_PACKET="$(pwd)/log" git -c protocol.version=2 \
-		ls-remote -o hello -o world "file://$(pwd)/file_parent" master >actual &&
+		ls-remote -o hello -o world "file://$(pwd)/file_parent" main >actual &&
 
 	cat >expect <<-EOF &&
-	$(git -C file_parent rev-parse refs/heads/master)$(printf "\t")refs/heads/master
+	$(git -C file_parent rev-parse refs/heads/main)$(printf "\t")refs/heads/main
 	EOF
 
 	test_cmp expect actual &&
@@ -184,7 +184,7 @@ test_expect_success 'server-options are sent when using ls-remote' '
 
 test_expect_success 'warn if using server-option with ls-remote with legacy protocol' '
 	test_must_fail env GIT_TEST_PROTOCOL_VERSION=0 git -c protocol.version=0 \
-		ls-remote -o hello -o world "file://$(pwd)/file_parent" master 2>err &&
+		ls-remote -o hello -o world "file://$(pwd)/file_parent" main 2>err &&
 
 	test_i18ngrep "see protocol.version in" err &&
 	test_i18ngrep "server options require protocol version 2 or later" err
@@ -217,7 +217,7 @@ test_expect_success 'fetch with file:// using protocol v2' '
 	GIT_TRACE_PACKET="$(pwd)/log" git -C file_child -c protocol.version=2 \
 		fetch origin &&
 
-	git -C file_child log -1 --format=%s origin/master >actual &&
+	git -C file_child log -1 --format=%s origin/main >actual &&
 	git -C file_parent log -1 --format=%s >expect &&
 	test_cmp expect actual &&
 
@@ -232,13 +232,13 @@ test_expect_success 'ref advertisement is filtered during fetch using protocol v
 	git -C file_parent branch unwanted-branch three &&
 
 	GIT_TRACE_PACKET="$(pwd)/log" git -C file_child -c protocol.version=2 \
-		fetch origin master &&
+		fetch origin main &&
 
-	git -C file_child log -1 --format=%s origin/master >actual &&
+	git -C file_child log -1 --format=%s origin/main >actual &&
 	git -C file_parent log -1 --format=%s >expect &&
 	test_cmp expect actual &&
 
-	grep "refs/heads/master" log &&
+	grep "refs/heads/main" log &&
 	! grep "refs/heads/unwanted-branch" log
 '
 
@@ -248,9 +248,9 @@ test_expect_success 'server-options are sent when fetching' '
 	test_commit -C file_parent four &&
 
 	GIT_TRACE_PACKET="$(pwd)/log" git -C file_child -c protocol.version=2 \
-		fetch -o hello -o world origin master &&
+		fetch -o hello -o world origin main &&
 
-	git -C file_child log -1 --format=%s origin/master >actual &&
+	git -C file_child log -1 --format=%s origin/main >actual &&
 	git -C file_parent log -1 --format=%s >expect &&
 	test_cmp expect actual &&
 
@@ -264,7 +264,7 @@ test_expect_success 'warn if using server-option with fetch with legacy protocol
 	git init temp_child &&
 
 	test_must_fail env GIT_TEST_PROTOCOL_VERSION=0 git -C temp_child -c protocol.version=0 \
-		fetch -o hello -o world "file://$(pwd)/file_parent" master 2>err &&
+		fetch -o hello -o world "file://$(pwd)/file_parent" main 2>err &&
 
 	test_i18ngrep "see protocol.version in" err &&
 	test_i18ngrep "server options require protocol version 2 or later" err
@@ -325,7 +325,7 @@ test_expect_success 'partial clone' '
 	grep "version 2" trace &&
 
 	# Ensure that the old version of the file is missing
-	git -C client rev-list --quiet --objects --missing=print master \
+	git -C client rev-list --quiet --objects --missing=print main \
 		>observed.oids &&
 	grep "$(git -C server rev-parse message1:a.txt)" observed.oids &&
 
@@ -350,7 +350,7 @@ test_expect_success 'partial fetch' '
 	SERVER="file://$(pwd)/server" &&
 
 	GIT_TRACE_PACKET="$(pwd)/trace" git -C client -c protocol.version=2 \
-		fetch --filter=blob:none "$SERVER" master:refs/heads/other &&
+		fetch --filter=blob:none "$SERVER" main:refs/heads/other &&
 	grep "version 2" trace &&
 
 	# Ensure that the old version of the file is missing
@@ -395,7 +395,7 @@ test_expect_success 'even with handcrafted request, filter does not work if not
 	command=fetch
 	object-format=$(test_oid algo)
 	0001
-	want $(git -C server rev-parse master)
+	want $(git -C server rev-parse main)
 	filter blob:none
 	0000
 	EOF
@@ -539,7 +539,7 @@ test_expect_success 'deepen-relative' '
 	test_commit -C server four &&
 
 	# Sanity check that only "three" is downloaded
-	git -C client log --pretty=tformat:%s master >actual &&
+	git -C client log --pretty=tformat:%s main >actual &&
 	echo three >expected &&
 	test_cmp expected actual &&
 
@@ -548,7 +548,7 @@ test_expect_success 'deepen-relative' '
 	# Ensure that protocol v2 is used
 	grep "fetch< version 2" trace &&
 
-	git -C client log --pretty=tformat:%s origin/master >actual &&
+	git -C client log --pretty=tformat:%s origin/main >actual &&
 	cat >expected <<-\EOF &&
 	four
 	three
@@ -670,7 +670,7 @@ test_expect_success 'fetch with http:// using protocol v2' '
 	GIT_TRACE_PACKET="$(pwd)/log" git -C http_child -c protocol.version=2 \
 		fetch &&
 
-	git -C http_child log -1 --format=%s origin/master >actual &&
+	git -C http_child log -1 --format=%s origin/main >actual &&
 	git -C "$HTTPD_DOCUMENT_ROOT_PATH/http_parent" log -1 --format=%s >expect &&
 	test_cmp expect actual &&
 
@@ -698,11 +698,11 @@ test_expect_success 'fetch from namespaced repo respects namespaces' '
 	test_commit -C "$HTTPD_DOCUMENT_ROOT_PATH/nsrepo" one &&
 	test_commit -C "$HTTPD_DOCUMENT_ROOT_PATH/nsrepo" two &&
 	git -C "$HTTPD_DOCUMENT_ROOT_PATH/nsrepo" \
-		update-ref refs/namespaces/ns/refs/heads/master one &&
+		update-ref refs/namespaces/ns/refs/heads/main one &&
 
 	GIT_TRACE_PACKET="$(pwd)/log" git -C http_child -c protocol.version=2 \
 		fetch "$HTTPD_URL/smart_namespace/nsrepo" \
-		refs/heads/master:refs/heads/theirs &&
+		refs/heads/main:refs/heads/theirs &&
 
 	# Server responded using protocol v2
 	grep "fetch< version 2" log &&
@@ -733,7 +733,7 @@ test_expect_success 'push with http:// and a config of v2 does not request v2' '
 	test_commit -C http_child three &&
 
 	# Push to another branch, as the target repository has the
-	# master branch checked out and we cannot push into it.
+	# main branch checked out and we cannot push into it.
 	GIT_TRACE_PACKET="$(pwd)/log" git -C http_child -c protocol.version=2 \
 		push origin HEAD:client_branch &&
 
diff --git a/t/t5703-upload-pack-ref-in-want.sh b/t/t5703-upload-pack-ref-in-want.sh
index b46940b725..bbf03a8f66 100755
--- a/t/t5703-upload-pack-ref-in-want.sh
+++ b/t/t5703-upload-pack-ref-in-want.sh
@@ -38,7 +38,7 @@ write_command () {
 
 # c(o/foo) d(o/bar)
 #        \ /
-#         b   e(baz)  f(master)
+#         b   e(baz)  f(main)
 #          \__  |  __/
 #             \ | /
 #               a
@@ -51,7 +51,7 @@ test_expect_success 'setup repository' '
 	test_commit d &&
 	git checkout -b baz a &&
 	test_commit e &&
-	git checkout master &&
+	git checkout main &&
 	test_commit f
 '
 
@@ -88,7 +88,7 @@ test_expect_success 'invalid want-ref line' '
 test_expect_success 'basic want-ref' '
 	oid=$(git rev-parse f) &&
 	cat >expected_refs <<-EOF &&
-	$oid refs/heads/master
+	$oid refs/heads/main
 	EOF
 	git rev-parse f >expected_commits &&
 
@@ -97,7 +97,7 @@ test_expect_success 'basic want-ref' '
 	$(write_command fetch)
 	0001
 	no-progress
-	want-ref refs/heads/master
+	want-ref refs/heads/main
 	have $oid
 	done
 	0000
@@ -135,7 +135,7 @@ test_expect_success 'multiple want-ref lines' '
 test_expect_success 'mix want and want-ref' '
 	oid=$(git rev-parse f) &&
 	cat >expected_refs <<-EOF &&
-	$oid refs/heads/master
+	$oid refs/heads/main
 	EOF
 	git rev-parse e f >expected_commits &&
 
@@ -143,7 +143,7 @@ test_expect_success 'mix want and want-ref' '
 	$(write_command fetch)
 	0001
 	no-progress
-	want-ref refs/heads/master
+	want-ref refs/heads/main
 	want $(git rev-parse e)
 	have $(git rev-parse a)
 	done
@@ -182,7 +182,7 @@ LOCAL_PRISTINE="$(pwd)/local_pristine"
 # $REPO
 # c(o/foo) d(o/bar)
 #        \ /
-#         b   e(baz)  f(master)
+#         b   e(baz)  f(main)
 #          \__  |  __/
 #             \ | /
 #               a
@@ -193,7 +193,7 @@ LOCAL_PRISTINE="$(pwd)/local_pristine"
 #		.
 #		.
 #		|
-#		a(master)
+#		a(main)
 test_expect_success 'setup repos for fetching with ref-in-want tests' '
 	(
 		git init "$REPO" &&
@@ -209,7 +209,7 @@ test_expect_success 'setup repos for fetching with ref-in-want tests' '
 		test_commit_bulk --id=s 33 &&
 
 		# Add novel commits to upstream
-		git checkout master &&
+		git checkout main &&
 		cd "$REPO" &&
 		git checkout -b o/foo &&
 		test_commit b &&
@@ -218,7 +218,7 @@ test_expect_success 'setup repos for fetching with ref-in-want tests' '
 		test_commit d &&
 		git checkout -b baz a &&
 		test_commit e &&
-		git checkout master &&
+		git checkout main &&
 		test_commit f
 	) &&
 	git -C "$REPO" config uploadpack.allowRefInWant true &&
@@ -245,12 +245,12 @@ test_expect_success 'fetching multiple refs' '
 
 	rm -rf local &&
 	cp -r "$LOCAL_PRISTINE" local &&
-	GIT_TRACE_PACKET="$(pwd)/log" git -C local fetch origin master baz &&
+	GIT_TRACE_PACKET="$(pwd)/log" git -C local fetch origin main baz &&
 
-	git -C "$REPO" rev-parse "master" "baz" >expected &&
-	git -C local rev-parse refs/remotes/origin/master refs/remotes/origin/baz >actual &&
+	git -C "$REPO" rev-parse "main" "baz" >expected &&
+	git -C local rev-parse refs/remotes/origin/main refs/remotes/origin/baz >actual &&
 	test_cmp expected actual &&
-	grep "want-ref refs/heads/master" log &&
+	grep "want-ref refs/heads/main" log &&
 	grep "want-ref refs/heads/baz" log
 '
 
@@ -261,13 +261,13 @@ test_expect_success 'fetching ref and exact OID' '
 	cp -r "$LOCAL_PRISTINE" local &&
 	oid=$(git -C "$REPO" rev-parse b) &&
 	GIT_TRACE_PACKET="$(pwd)/log" git -C local fetch origin \
-		master "$oid":refs/heads/actual &&
+		main "$oid":refs/heads/actual &&
 
-	git -C "$REPO" rev-parse "master" "b" >expected &&
-	git -C local rev-parse refs/remotes/origin/master refs/heads/actual >actual &&
+	git -C "$REPO" rev-parse "main" "b" >expected &&
+	git -C local rev-parse refs/remotes/origin/main refs/heads/actual >actual &&
 	test_cmp expected actual &&
 	grep "want $oid" log &&
-	grep "want-ref refs/heads/master" log
+	grep "want-ref refs/heads/main" log
 '
 
 test_expect_success 'fetching with wildcard that does not match any refs' '
@@ -316,7 +316,7 @@ test_expect_success 'setup repos for change-while-negotiating test' '
 		test_commit_bulk --id=s 33 &&
 
 		# Add novel commits to upstream
-		git checkout master &&
+		git checkout main &&
 		cd "$REPO" &&
 		test_commit m2 &&
 		test_commit m3 &&
@@ -342,7 +342,7 @@ test_expect_success 'server is initially ahead - no ref in want' '
 	git -C "$REPO" config uploadpack.allowRefInWant false &&
 	rm -rf local &&
 	cp -r "$LOCAL_PRISTINE" local &&
-	inconsistency master $(test_oid numeric) &&
+	inconsistency main $(test_oid numeric) &&
 	test_must_fail git -C local fetch 2>err &&
 	test_i18ngrep "fatal: remote error: upload-pack: not our ref" err
 '
@@ -351,11 +351,11 @@ test_expect_success 'server is initially ahead - ref in want' '
 	git -C "$REPO" config uploadpack.allowRefInWant true &&
 	rm -rf local &&
 	cp -r "$LOCAL_PRISTINE" local &&
-	inconsistency master $(test_oid numeric) &&
+	inconsistency main $(test_oid numeric) &&
 	git -C local fetch &&
 
-	git -C "$REPO" rev-parse --verify master >expected &&
-	git -C local rev-parse --verify refs/remotes/origin/master >actual &&
+	git -C "$REPO" rev-parse --verify main >expected &&
+	git -C local rev-parse --verify refs/remotes/origin/main >actual &&
 	test_cmp expected actual
 '
 
@@ -363,11 +363,11 @@ test_expect_success 'server is initially behind - no ref in want' '
 	git -C "$REPO" config uploadpack.allowRefInWant false &&
 	rm -rf local &&
 	cp -r "$LOCAL_PRISTINE" local &&
-	inconsistency master "master^" &&
+	inconsistency main "main^" &&
 	git -C local fetch &&
 
-	git -C "$REPO" rev-parse --verify "master^" >expected &&
-	git -C local rev-parse --verify refs/remotes/origin/master >actual &&
+	git -C "$REPO" rev-parse --verify "main^" >expected &&
+	git -C local rev-parse --verify refs/remotes/origin/main >actual &&
 	test_cmp expected actual
 '
 
@@ -375,11 +375,11 @@ test_expect_success 'server is initially behind - ref in want' '
 	git -C "$REPO" config uploadpack.allowRefInWant true &&
 	rm -rf local &&
 	cp -r "$LOCAL_PRISTINE" local &&
-	inconsistency master "master^" &&
+	inconsistency main "main^" &&
 	git -C local fetch &&
 
-	git -C "$REPO" rev-parse --verify "master" >expected &&
-	git -C local rev-parse --verify refs/remotes/origin/master >actual &&
+	git -C "$REPO" rev-parse --verify "main" >expected &&
+	git -C local rev-parse --verify refs/remotes/origin/main >actual &&
 	test_cmp expected actual
 '
 
diff --git a/t/t5801-remote-helpers.sh b/t/t5801-remote-helpers.sh
index 0f04b6cddb..306fe9e5e1 100755
--- a/t/t5801-remote-helpers.sh
+++ b/t/t5801-remote-helpers.sh
@@ -71,18 +71,18 @@ test_expect_success 'fetch multiple branches' '
 	(cd local &&
 	 git fetch
 	) &&
-	compare_refs server master local refs/remotes/origin/master &&
+	compare_refs server main local refs/remotes/origin/main &&
 	compare_refs server new local refs/remotes/origin/new
 '
 
 test_expect_success 'push when remote has extra refs' '
 	(cd local &&
-	 git reset --hard origin/master &&
+	 git reset --hard origin/main &&
 	 echo content >>file &&
 	 git commit -a -m six &&
 	 git push
 	) &&
-	compare_refs local master server master
+	compare_refs local main server main
 '
 
 test_expect_success 'push new branch by name' '
@@ -174,7 +174,7 @@ test_expect_failure 'pushing without marks' '
 
 test_expect_success 'push all with existing object' '
 	(cd local &&
-	git branch dup2 master &&
+	git branch dup2 main &&
 	git push origin --all
 	) &&
 	compare_refs local dup2 server dup2
@@ -182,7 +182,7 @@ test_expect_success 'push all with existing object' '
 
 test_expect_success 'push ref with existing object' '
 	(cd local &&
-	git branch dup master &&
+	git branch dup main &&
 	git push origin dup
 	) &&
 	compare_refs local dup server dup
@@ -190,7 +190,7 @@ test_expect_success 'push ref with existing object' '
 
 test_expect_success GPG 'push signed tag' '
 	(cd local &&
-	git checkout master &&
+	git checkout main &&
 	git tag -s -m signed-tag signed-tag &&
 	git push origin signed-tag
 	) &&
@@ -200,7 +200,7 @@ test_expect_success GPG 'push signed tag' '
 
 test_expect_success GPG 'push signed tag with signed-tags capability' '
 	(cd local &&
-	git checkout master &&
+	git checkout main &&
 	git tag -s -m signed-tag signed-tag-2 &&
 	GIT_REMOTE_TESTGIT_SIGNED_TAGS=1 git push origin signed-tag-2
 	) &&
@@ -209,7 +209,7 @@ test_expect_success GPG 'push signed tag with signed-tags capability' '
 
 test_expect_success 'push update refs' '
 	(cd local &&
-	git checkout -b update master &&
+	git checkout -b update main &&
 	echo update >>file &&
 	git commit -a -m update &&
 	git push origin update &&
@@ -260,7 +260,7 @@ test_expect_success 'proper failure checks for fetching' '
 test_expect_success 'proper failure checks for pushing' '
 	test_when_finished "rm -rf local/git.marks local/testgit.marks" &&
 	(cd local &&
-	git checkout -b crash master &&
+	git checkout -b crash main &&
 	echo crash >>file &&
 	git commit -a -m crash &&
 	test_must_fail env GIT_REMOTE_TESTGIT_FAILURE=1 git push --all &&
@@ -272,7 +272,7 @@ test_expect_success 'proper failure checks for pushing' '
 
 test_expect_success 'push messages' '
 	(cd local &&
-	git checkout -b new_branch master &&
+	git checkout -b new_branch main &&
 	echo new >>file &&
 	git commit -a -m new &&
 	git push origin new_branch &&
@@ -286,7 +286,7 @@ test_expect_success 'push messages' '
 
 test_expect_success 'fetch HEAD' '
 	(cd server &&
-	git checkout master &&
+	git checkout main &&
 	echo more >>file &&
 	git commit -a -m more
 	) &&
@@ -298,7 +298,7 @@ test_expect_success 'fetch HEAD' '
 
 test_expect_success 'fetch url' '
 	(cd server &&
-	git checkout master &&
+	git checkout main &&
 	echo more >>file &&
 	git commit -a -m more
 	) &&
diff --git a/t/test-lib.sh b/t/test-lib.sh
index 3e0c9413f1..11e02d615a 100644
--- a/t/test-lib.sh
+++ b/t/test-lib.sh
@@ -263,7 +263,7 @@ case "$TEST_NUMBER" in
 	GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
 	export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 	;;
-[0-4]*|5[0-5]*)
+[0-5]*)
 	GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 	export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 	;;
-- 
gitgitgadget


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH v2 17/27] t6[0-3]*: adjust the references to the default branch name "main"
  2020-11-17 16:12 ` [PATCH v2 00/27] tests: use " Johannes Schindelin via GitGitGadget
                     ` (15 preceding siblings ...)
  2020-11-17 16:12   ` [PATCH v2 16/27] t5[6-9]*: " Johannes Schindelin via GitGitGadget
@ 2020-11-17 16:12   ` Johannes Schindelin via GitGitGadget
  2020-11-17 16:12   ` [PATCH v2 18/27] t64*: preemptively adjust alignment to prepare for `master` -> `main` Johannes Schindelin via GitGitGadget
                     ` (11 subsequent siblings)
  28 siblings, 0 replies; 163+ messages in thread
From: Johannes Schindelin via GitGitGadget @ 2020-11-17 16:12 UTC (permalink / raw)
  To: git
  Cc: Felipe Contreras, Ævar Arnfjörð Bjarmason,
	Johannes Schindelin, Jeff King, Johannes Schindelin,
	Johannes Schindelin

From: Johannes Schindelin <johannes.schindelin@gmx.de>

Carefully excluding t6300, which sees independent development elsewhere
at the time of writing, we use `main` as the default branch name in
t6[0-3]*. This trick was performed via

	$ (cd t &&
	   sed -i -e 's/master/main/g' -e 's/MASTER/MAIN/g' \
		-e 's/Master/Main/g' -- t6[0-3]*.sh &&
	   git checkout HEAD -- t6300\*)

This allows us to define `GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main`
for those tests.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
---
 t/t6000-rev-list-misc.sh                   |  2 +-
 t/t6001-rev-list-graft.sh                  |  2 +-
 t/t6004-rev-list-path-optim.sh             | 14 +++---
 t/t6006-rev-list-format.sh                 | 14 +++---
 t/t6007-rev-list-cherry-pick-file.sh       |  4 +-
 t/t6008-rev-list-submodule.sh              |  2 +-
 t/t6009-rev-list-parent.sh                 |  6 +--
 t/t6012-rev-list-simplify.sh               |  8 ++--
 t/t6013-rev-list-reverse-parents.sh        | 10 ++--
 t/t6016-rev-list-graph-simplify-history.sh |  2 +-
 t/t6017-rev-list-stdin.sh                  |  8 ++--
 t/t6018-rev-list-glob.sh                   | 50 ++++++++++----------
 t/t6019-rev-list-ancestry-path.sh          |  6 +--
 t/t6030-bisect-porcelain.sh                | 10 ++--
 t/t6040-tracking-info.sh                   | 54 +++++++++++-----------
 t/t6050-replace.sh                         | 10 ++--
 t/t6101-rev-parse-parents.sh               |  2 +-
 t/t6110-rev-list-sparse.sh                 |  2 +-
 t/t6111-rev-list-treesame.sh               |  6 +--
 t/t6112-rev-list-filters-objects.sh        | 14 +++---
 t/t6120-describe.sh                        | 20 ++++----
 t/t6200-fmt-merge-msg.sh                   | 50 ++++++++++----------
 t/t6302-for-each-ref-filter.sh             | 46 +++++++++---------
 t/test-lib.sh                              |  4 +-
 24 files changed, 173 insertions(+), 173 deletions(-)

diff --git a/t/t6000-rev-list-misc.sh b/t/t6000-rev-list-misc.sh
index fc4d55dcb2..dc40a39fce 100755
--- a/t/t6000-rev-list-misc.sh
+++ b/t/t6000-rev-list-misc.sh
@@ -85,7 +85,7 @@ test_expect_success 'propagate uninteresting flag down correctly' '
 '
 
 test_expect_success 'symleft flag bit is propagated down from tag' '
-	git log --format="%m %s" --left-right v1.0...master >actual &&
+	git log --format="%m %s" --left-right v1.0...main >actual &&
 	cat >expect <<-\EOF &&
 	< another
 	< that
diff --git a/t/t6001-rev-list-graft.sh b/t/t6001-rev-list-graft.sh
index 7504ba4751..4490981352 100755
--- a/t/t6001-rev-list-graft.sh
+++ b/t/t6001-rev-list-graft.sh
@@ -20,7 +20,7 @@ test_expect_success setup '
 	git commit -a -m "Third in one history." &&
 	A2=$(git rev-parse --verify HEAD) &&
 
-	rm -f .git/refs/heads/master .git/index &&
+	rm -f .git/refs/heads/main .git/index &&
 
 	echo >fileA fileA again &&
 	echo >subdir/fileB fileB again &&
diff --git a/t/t6004-rev-list-path-optim.sh b/t/t6004-rev-list-path-optim.sh
index 3e8c42ee0b..81d1b57ced 100755
--- a/t/t6004-rev-list-path-optim.sh
+++ b/t/t6004-rev-list-path-optim.sh
@@ -4,7 +4,7 @@ test_description='git rev-list trivial path optimization test
 
    d/z1
    b0                             b1
-   o------------------------*----o master
+   o------------------------*----o main
   /                        /
  o---------o----o----o----o side
  a0        c0   c1   a1   c2
@@ -55,18 +55,18 @@ test_expect_success 'further setup' '
 	git add c &&
 	test_tick &&
 	git commit -m "Side makes yet another irrelevant commit" &&
-	git checkout master &&
+	git checkout main &&
 	echo Another >b &&
 	echo Munged >d/z &&
 	git add b d/z &&
 	test_tick &&
-	git commit -m "Master touches b" &&
-	git tag master_b0 &&
+	git commit -m "Main touches b" &&
+	git tag main_b0 &&
 	git merge side &&
 	echo Touched >b &&
 	git add b &&
 	test_tick &&
-	git commit -m "Master touches b again"
+	git commit -m "Main touches b again"
 '
 
 test_expect_success 'path optimization 2' '
@@ -76,13 +76,13 @@ test_expect_success 'path optimization 2' '
 '
 
 test_expect_success 'pathspec with leading path' '
-	git rev-parse master^ master_b0 side_c0 initial >expected &&
+	git rev-parse main^ main_b0 side_c0 initial >expected &&
 	git rev-list HEAD -- d >actual &&
 	test_cmp expected actual
 '
 
 test_expect_success 'pathspec with glob (1)' '
-	git rev-parse master^ master_b0 side_c0 initial >expected &&
+	git rev-parse main^ main_b0 side_c0 initial >expected &&
 	git rev-list HEAD -- "d/*" >actual &&
 	test_cmp expected actual
 '
diff --git a/t/t6006-rev-list-format.sh b/t/t6006-rev-list-format.sh
index 99a1eaf332..8cc54a5a50 100755
--- a/t/t6006-rev-list-format.sh
+++ b/t/t6006-rev-list-format.sh
@@ -53,7 +53,7 @@ test_expect_success 'setup' '
 test_format () {
 	cat >expect.$1
 	test_expect_${3:-success} "format $1" "
-		git rev-list --pretty=format:'$2' master >output.$1 &&
+		git rev-list --pretty=format:'$2' main >output.$1 &&
 		test_cmp expect.$1 output.$1
 	"
 }
@@ -184,13 +184,13 @@ test_expect_success 'basic colors' '
 	<RED>foo<GREEN>bar<BLUE>baz<RESET>xyzzy
 	EOF
 	format="%Credfoo%Cgreenbar%Cbluebaz%Cresetxyzzy" &&
-	git rev-list --color --format="$format" -1 master >actual.raw &&
+	git rev-list --color --format="$format" -1 main >actual.raw &&
 	test_decode_color <actual.raw >actual &&
 	test_cmp expect actual
 '
 
 test_expect_success '%S is not a placeholder for rev-list yet' '
-	git rev-list --format="%S" -1 master | grep "%S"
+	git rev-list --format="%S" -1 main | grep "%S"
 '
 
 test_expect_success 'advanced colors' '
@@ -199,7 +199,7 @@ test_expect_success 'advanced colors' '
 	<BOLD;RED;BYELLOW>foo<RESET>
 	EOF
 	format="%C(red yellow bold)foo%C(reset)" &&
-	git rev-list --color --format="$format" -1 master >actual.raw &&
+	git rev-list --color --format="$format" -1 main >actual.raw &&
 	test_decode_color <actual.raw >actual &&
 	test_cmp expect actual
 '
@@ -406,7 +406,7 @@ test_expect_success '%x00 shows NUL' '
 
 test_expect_success '%ad respects --date=' '
 	echo 2005-04-07 >expect.ad-short &&
-	git log -1 --date=short --pretty=tformat:%ad >output.ad-short master &&
+	git log -1 --date=short --pretty=tformat:%ad >output.ad-short main &&
 	test_cmp expect.ad-short output.ad-short
 '
 
@@ -494,8 +494,8 @@ test_expect_success '"%h %gD: %gs" is same as git-reflog (with --abbrev)' '
 '
 
 test_expect_success '%gd shortens ref name' '
-	echo "master@{0}" >expect.gd-short &&
-	git log -g -1 --format=%gd refs/heads/master >actual.gd-short &&
+	echo "main@{0}" >expect.gd-short &&
+	git log -g -1 --format=%gd refs/heads/main >actual.gd-short &&
 	test_cmp expect.gd-short actual.gd-short
 '
 
diff --git a/t/t6007-rev-list-cherry-pick-file.sh b/t/t6007-rev-list-cherry-pick-file.sh
index f0268372d2..e689959593 100755
--- a/t/t6007-rev-list-cherry-pick-file.sh
+++ b/t/t6007-rev-list-cherry-pick-file.sh
@@ -31,7 +31,7 @@ test_expect_success setup '
 	test_tick &&
 	git commit -m "E" &&
 	git tag E &&
-	git checkout master &&
+	git checkout main &&
 	git checkout branch foo &&
 	test_tick &&
 	git commit -m "B" &&
@@ -233,7 +233,7 @@ test_expect_success '--cherry-pick with independent, but identical branches' '
 	test_tick &&
 	git commit -m "independent, too" foo &&
 	test -z "$(git rev-list --left-right --cherry-pick \
-		HEAD...master -- foo)"
+		HEAD...main -- foo)"
 '
 
 cat >expect <<EOF
diff --git a/t/t6008-rev-list-submodule.sh b/t/t6008-rev-list-submodule.sh
index c4af9ca0a7..39762aa6ff 100755
--- a/t/t6008-rev-list-submodule.sh
+++ b/t/t6008-rev-list-submodule.sh
@@ -36,7 +36,7 @@ test_expect_success 'setup' '
 '
 
 test_expect_success "Ilari's test" '
-	git rev-list --objects super master ^super^
+	git rev-list --objects super main ^super^
 '
 
 test_done
diff --git a/t/t6009-rev-list-parent.sh b/t/t6009-rev-list-parent.sh
index 916d9692bc..7dedceb472 100755
--- a/t/t6009-rev-list-parent.sh
+++ b/t/t6009-rev-list-parent.sh
@@ -45,7 +45,7 @@ test_expect_success 'setup roots, merges and octopuses' '
 	test_commit seven &&
 	git checkout -b yetanotherbranch four &&
 	test_commit eight &&
-	git checkout master &&
+	git checkout main &&
 	test_tick &&
 	git merge --allow-unrelated-histories -m normalmerge newroot &&
 	git tag normalmerge &&
@@ -56,7 +56,7 @@ test_expect_success 'setup roots, merges and octopuses' '
 	test_tick &&
 	git merge -m tetrapus sidebranch anotherbranch yetanotherbranch &&
 	git tag tetrapus &&
-	git checkout master
+	git checkout main
 '
 
 test_expect_success 'rev-list roots' '
@@ -123,7 +123,7 @@ test_expect_success 'dodecapus' '
 		roots="$roots root$i" ||
 		return
 	done &&
-	git checkout master &&
+	git checkout main &&
 	test_tick &&
 	git merge -m dodecapus $roots &&
 	git tag dodecapus &&
diff --git a/t/t6012-rev-list-simplify.sh b/t/t6012-rev-list-simplify.sh
index fd202fcb94..1b5f54a3f5 100755
--- a/t/t6012-rev-list-simplify.sh
+++ b/t/t6012-rev-list-simplify.sh
@@ -43,7 +43,7 @@ test_expect_success setup '
 	git add side &&
 	test_tick && git commit -m "Side root" &&
 	note J &&
-	git checkout master &&
+	git checkout main &&
 
 	echo "Hello" >file &&
 	echo "second" >lost &&
@@ -65,7 +65,7 @@ test_expect_success setup '
 	note D &&
 
 	test_tick &&
-	test_must_fail git merge -m "merge" master &&
+	test_must_fail git merge -m "merge" main &&
 	>lost && git commit -a -m "merge" &&
 	note E &&
 
@@ -74,7 +74,7 @@ test_expect_success setup '
 	test_tick && git commit -m "Irrelevant change" &&
 	note F &&
 
-	git checkout master &&
+	git checkout main &&
 	echo "Yet another" >elif &&
 	git add elif &&
 	test_tick && git commit -m "Another irrelevant change" &&
@@ -87,7 +87,7 @@ test_expect_success setup '
 	test_tick && git commit -a -m "Final change" &&
 	note I &&
 
-	git checkout master &&
+	git checkout main &&
 	test_tick && git merge --allow-unrelated-histories -m "Coolest" unrelated &&
 	note K &&
 
diff --git a/t/t6013-rev-list-reverse-parents.sh b/t/t6013-rev-list-reverse-parents.sh
index 89458d370f..e6caf80d7e 100755
--- a/t/t6013-rev-list-reverse-parents.sh
+++ b/t/t6013-rev-list-reverse-parents.sh
@@ -18,24 +18,24 @@ test_expect_success 'set up --reverse example' '
 	commit two &&
 	git checkout -b side HEAD^ &&
 	commit three &&
-	git checkout master &&
+	git checkout main &&
 	git merge -s ours side &&
 	commit five
 	'
 
 test_expect_success '--reverse --parents --full-history combines correctly' '
-	git rev-list --parents --full-history master -- foo |
+	git rev-list --parents --full-history main -- foo |
 		perl -e "print reverse <>" > expected &&
-	git rev-list --reverse --parents --full-history master -- foo \
+	git rev-list --reverse --parents --full-history main -- foo \
 		> actual &&
 	test_cmp expected actual
 	'
 
 test_expect_success '--boundary does too' '
-	git rev-list --boundary --parents --full-history master ^root -- foo |
+	git rev-list --boundary --parents --full-history main ^root -- foo |
 		perl -e "print reverse <>" > expected &&
 	git rev-list --boundary --reverse --parents --full-history \
-		master ^root -- foo > actual &&
+		main ^root -- foo > actual &&
 	test_cmp expected actual
 	'
 
diff --git a/t/t6016-rev-list-graph-simplify-history.sh b/t/t6016-rev-list-graph-simplify-history.sh
index f5e6e92f5b..c341e6ecb4 100755
--- a/t/t6016-rev-list-graph-simplify-history.sh
+++ b/t/t6016-rev-list-graph-simplify-history.sh
@@ -14,7 +14,7 @@ test_expect_success 'set up rev-list --graph test' '
 	test_commit A1 foo.txt &&
 	test_commit A2 bar.txt &&
 	test_commit A3 bar.txt &&
-	git branch -m master A &&
+	git branch -m main A &&
 
 	# 2 commits on branch B, started from A1
 	git checkout -b B A1 &&
diff --git a/t/t6017-rev-list-stdin.sh b/t/t6017-rev-list-stdin.sh
index 667b37564e..6b72f100cb 100755
--- a/t/t6017-rev-list-stdin.sh
+++ b/t/t6017-rev-list-stdin.sh
@@ -40,7 +40,7 @@ test_expect_success setup '
 		done &&
 		for i in $them
 		do
-			git checkout -b side-$i master~$i &&
+			git checkout -b side-$i main~$i &&
 			echo updated $i >file-$i &&
 			git add file-$i &&
 			test_tick &&
@@ -49,7 +49,7 @@ test_expect_success setup '
 	)
 '
 
-check master
+check main
 check side-1 ^side-4
 check side-1 ^side-7 --
 check side-1 ^side-7 -- file-1
@@ -66,11 +66,11 @@ test_expect_success 'not only --stdin' '
 	file-2
 	EOF
 	cat >input <<-EOF &&
-	^master^
+	^main^
 	--
 	file-2
 	EOF
-	git log --pretty=tformat:%s --name-only --stdin master -- file-1 \
+	git log --pretty=tformat:%s --name-only --stdin main -- file-1 \
 		<input >actual &&
 	test_cmp expect actual
 '
diff --git a/t/t6018-rev-list-glob.sh b/t/t6018-rev-list-glob.sh
index fe2f3cec3d..ac030b9a7c 100755
--- a/t/t6018-rev-list-glob.sh
+++ b/t/t6018-rev-list-glob.sh
@@ -20,22 +20,22 @@ compare () {
 
 test_expect_success 'setup' '
 
-	commit master &&
-	git checkout -b subspace/one master &&
+	commit main &&
+	git checkout -b subspace/one main &&
 	commit one &&
-	git checkout -b subspace/two master &&
+	git checkout -b subspace/two main &&
 	commit two &&
-	git checkout -b subspace-x master &&
+	git checkout -b subspace-x main &&
 	commit subspace-x &&
-	git checkout -b other/three master &&
+	git checkout -b other/three main &&
 	commit three &&
-	git checkout -b someref master &&
+	git checkout -b someref main &&
 	commit some &&
-	git checkout master &&
+	git checkout main &&
 	commit topic_2 &&
-	git tag foo/bar master &&
+	git tag foo/bar main &&
 	commit topic_3 &&
-	git update-ref refs/remotes/foo/baz master &&
+	git update-ref refs/remotes/foo/baz main &&
 	commit topic_4 &&
 	git update-ref refs/remotes/upstream/one subspace/one &&
 	git update-ref refs/remotes/upstream/two subspace/two &&
@@ -83,7 +83,7 @@ test_expect_failure 'rev-parse accepts --glob as detached option' '
 
 test_expect_failure 'rev-parse is not confused by option-like glob' '
 
-	compare rev-parse "master" "--glob --symbolic master"
+	compare rev-parse "main" "--glob --symbolic main"
 
 '
 
@@ -111,15 +111,15 @@ test_expect_success 'rev-parse --glob=heads/subspace/* --glob=heads/other/*' '
 
 '
 
-test_expect_success 'rev-parse --glob=heads/someref/* master' '
+test_expect_success 'rev-parse --glob=heads/someref/* main' '
 
-	compare rev-parse "master" "--glob=heads/someref/* master"
+	compare rev-parse "main" "--glob=heads/someref/* main"
 
 '
 
 test_expect_success 'rev-parse --glob=heads/*' '
 
-	compare rev-parse "master other/three someref subspace-x subspace/one subspace/two" "--glob=heads/*"
+	compare rev-parse "main other/three someref subspace-x subspace/one subspace/two" "--glob=heads/*"
 
 '
 
@@ -136,7 +136,7 @@ test_expect_success 'rev-parse --remotes=foo' '
 '
 
 test_expect_success 'rev-parse --exclude with --branches' '
-	compare rev-parse "--exclude=*/* --branches" "master someref subspace-x"
+	compare rev-parse "--exclude=*/* --branches" "main someref subspace-x"
 '
 
 test_expect_success 'rev-parse --exclude with --all' '
@@ -221,7 +221,7 @@ test_expect_success 'rev-list --glob refs/heads/subspace/*' '
 
 test_expect_success 'rev-list not confused by option-like --glob arg' '
 
-	compare rev-list "master" "--glob -0 master"
+	compare rev-list "main" "--glob -0 main"
 
 '
 
@@ -269,13 +269,13 @@ test_expect_success 'rev-list --branches=subspace' '
 
 test_expect_success 'rev-list --branches' '
 
-	compare rev-list "master subspace-x someref other/three subspace/one subspace/two" "--branches"
+	compare rev-list "main subspace-x someref other/three subspace/one subspace/two" "--branches"
 
 '
 
-test_expect_success 'rev-list --glob=heads/someref/* master' '
+test_expect_success 'rev-list --glob=heads/someref/* main' '
 
-	compare rev-list "master" "--glob=heads/someref/* master"
+	compare rev-list "main" "--glob=heads/someref/* main"
 
 '
 
@@ -287,7 +287,7 @@ test_expect_success 'rev-list --glob=heads/subspace/* --glob=heads/other/*' '
 
 test_expect_success 'rev-list --glob=heads/*' '
 
-	compare rev-list "master other/three someref subspace-x subspace/one subspace/two" "--glob=heads/*"
+	compare rev-list "main other/three someref subspace-x subspace/one subspace/two" "--glob=heads/*"
 
 '
 
@@ -310,7 +310,7 @@ test_expect_success 'rev-list --remotes=foo' '
 '
 
 test_expect_success 'rev-list --exclude with --branches' '
-	compare rev-list "--exclude=*/* --branches" "master someref subspace-x"
+	compare rev-list "--exclude=*/* --branches" "main someref subspace-x"
 '
 
 test_expect_success 'rev-list --exclude with --all' '
@@ -354,13 +354,13 @@ test_expect_success 'shortlog accepts --glob/--tags/--remotes' '
 
 	compare shortlog "subspace/one subspace/two" --branches=subspace &&
 	compare shortlog \
-	  "master subspace-x someref other/three subspace/one subspace/two" \
+	  "main subspace-x someref other/three subspace/one subspace/two" \
 	  --branches &&
-	compare shortlog master "--glob=heads/someref/* master" &&
+	compare shortlog main "--glob=heads/someref/* main" &&
 	compare shortlog "subspace/one subspace/two other/three" \
 	  "--glob=heads/subspace/* --glob=heads/other/*" &&
 	compare shortlog \
-	  "master other/three someref subspace-x subspace/one subspace/two" \
+	  "main other/three someref subspace-x subspace/one subspace/two" \
 	  "--glob=heads/*" &&
 	compare shortlog foo/bar --tags=foo &&
 	compare shortlog "foo/bar qux/one qux/two qux/x" --tags &&
@@ -371,14 +371,14 @@ test_expect_success 'shortlog accepts --glob/--tags/--remotes' '
 test_expect_failure 'shortlog accepts --glob as detached option' '
 
 	compare shortlog \
-	  "master other/three someref subspace-x subspace/one subspace/two" \
+	  "main other/three someref subspace-x subspace/one subspace/two" \
 	  "--glob heads/*"
 
 '
 
 test_expect_failure 'shortlog --glob is not confused by option-like argument' '
 
-	compare shortlog master "--glob -e master"
+	compare shortlog main "--glob -e main"
 
 '
 
diff --git a/t/t6019-rev-list-ancestry-path.sh b/t/t6019-rev-list-ancestry-path.sh
index 353f84313f..c664d66773 100755
--- a/t/t6019-rev-list-ancestry-path.sh
+++ b/t/t6019-rev-list-ancestry-path.sh
@@ -128,15 +128,15 @@ test_expect_success 'setup criss-cross' '
 	(cd criss-cross &&
 	 git init &&
 	 test_commit A &&
-	 git checkout -b xb master &&
+	 git checkout -b xb main &&
 	 test_commit B &&
-	 git checkout -b xc master &&
+	 git checkout -b xc main &&
 	 test_commit C &&
 	 git checkout -b xbc xb -- &&
 	 git merge xc &&
 	 git checkout -b xcb xc -- &&
 	 git merge xb &&
-	 git checkout master)
+	 git checkout main)
 '
 
 # no commits in bc descend from cb
diff --git a/t/t6030-bisect-porcelain.sh b/t/t6030-bisect-porcelain.sh
index aa226381be..386841f7b7 100755
--- a/t/t6030-bisect-porcelain.sh
+++ b/t/t6030-bisect-porcelain.sh
@@ -89,9 +89,9 @@ test_expect_success 'bisect start without -- takes unknown arg as pathspec' '
 	grep bar ".git/BISECT_NAMES"
 '
 
-test_expect_success 'bisect reset: back in the master branch' '
+test_expect_success 'bisect reset: back in the main branch' '
 	git bisect reset &&
-	echo "* master" > branch.expect &&
+	echo "* main" > branch.expect &&
 	git branch > branch.output &&
 	cmp branch.expect branch.output
 '
@@ -102,7 +102,7 @@ test_expect_success 'bisect reset: back in another branch' '
 	git bisect good $HASH1 &&
 	git bisect bad $HASH3 &&
 	git bisect reset &&
-	echo "  master" > branch.expect &&
+	echo "  main" > branch.expect &&
 	echo "* other" >> branch.expect &&
 	git branch > branch.output &&
 	cmp branch.expect branch.output
@@ -348,7 +348,7 @@ test_expect_success 'bisect skip many ranges' '
 
 test_expect_success 'bisect starting with a detached HEAD' '
 	git bisect reset &&
-	git checkout master^ &&
+	git checkout main^ &&
 	HEAD=$(git rev-parse --verify HEAD) &&
 	git bisect start &&
 	test $HEAD = $(cat .git/BISECT_START) &&
@@ -716,7 +716,7 @@ test_expect_success 'bisect: --no-checkout - target after breakage' '
 test_expect_success 'bisect: demonstrate identification of damage boundary' "
 	git bisect reset &&
 	git checkout broken &&
-	git bisect start broken master --no-checkout &&
+	git bisect start broken main --no-checkout &&
 	test_must_fail git bisect run \"\$SHELL_PATH\" -c '
 		GOOD=\$(git for-each-ref \"--format=%(objectname)\" refs/bisect/good-*) &&
 		git rev-list --objects BISECT_HEAD --not \$GOOD >tmp.\$\$ &&
diff --git a/t/t6040-tracking-info.sh b/t/t6040-tracking-info.sh
index 50a934e1b2..8ad1390511 100755
--- a/t/t6040-tracking-info.sh
+++ b/t/t6040-tracking-info.sh
@@ -34,7 +34,7 @@ test_expect_success setup '
 		git branch -d brokenbase &&
 		git checkout -b b6 origin
 	) &&
-	git checkout -b follower --track master &&
+	git checkout -b follower --track main &&
 	advance h
 '
 
@@ -58,12 +58,12 @@ test_expect_success 'branch -v' '
 '
 
 cat >expect <<\EOF
-b1 [origin/master: ahead 1, behind 1] d
-b2 [origin/master: ahead 1, behind 1] d
-b3 [origin/master: behind 1] b
-b4 [origin/master: ahead 2] f
+b1 [origin/main: ahead 1, behind 1] d
+b2 [origin/main: ahead 1, behind 1] d
+b3 [origin/main: behind 1] b
+b4 [origin/main: ahead 2] f
 b5 [brokenbase: gone] g
-b6 [origin/master] c
+b6 [origin/main] c
 EOF
 
 test_expect_success 'branch -vv' '
@@ -83,7 +83,7 @@ test_expect_success 'checkout (diverged from upstream)' '
 '
 
 test_expect_success 'checkout with local tracked branch' '
-	git checkout master &&
+	git checkout main &&
 	git checkout follower >actual &&
 	test_i18ngrep "is ahead of" actual
 '
@@ -100,7 +100,7 @@ test_expect_success 'checkout (up-to-date with upstream)' '
 	(
 		cd test && git checkout b6
 	) >actual &&
-	test_i18ngrep "Your branch is up to date with .origin/master" actual
+	test_i18ngrep "Your branch is up to date with .origin/main" actual
 '
 
 test_expect_success 'status (diverged from upstream)' '
@@ -130,11 +130,11 @@ test_expect_success 'status (up-to-date with upstream)' '
 		# reports nothing to commit
 		test_must_fail git commit --dry-run
 	) >actual &&
-	test_i18ngrep "Your branch is up to date with .origin/master" actual
+	test_i18ngrep "Your branch is up to date with .origin/main" actual
 '
 
 cat >expect <<\EOF
-## b1...origin/master [ahead 1, behind 1]
+## b1...origin/main [ahead 1, behind 1]
 EOF
 
 test_expect_success 'status -s -b (diverged from upstream)' '
@@ -147,7 +147,7 @@ test_expect_success 'status -s -b (diverged from upstream)' '
 '
 
 cat >expect <<\EOF
-## b1...origin/master [different]
+## b1...origin/main [different]
 EOF
 
 test_expect_success 'status -s -b --no-ahead-behind (diverged from upstream)' '
@@ -160,7 +160,7 @@ test_expect_success 'status -s -b --no-ahead-behind (diverged from upstream)' '
 '
 
 cat >expect <<\EOF
-## b1...origin/master [different]
+## b1...origin/main [different]
 EOF
 
 test_expect_success 'status.aheadbehind=false status -s -b (diverged from upstream)' '
@@ -174,7 +174,7 @@ test_expect_success 'status.aheadbehind=false status -s -b (diverged from upstre
 
 cat >expect <<\EOF
 On branch b1
-Your branch and 'origin/master' have diverged,
+Your branch and 'origin/main' have diverged,
 and have 1 and 1 different commits each, respectively.
 EOF
 
@@ -198,7 +198,7 @@ test_expect_success 'status --long --branch' '
 
 cat >expect <<\EOF
 On branch b1
-Your branch and 'origin/master' refer to different commits.
+Your branch and 'origin/main' refer to different commits.
 EOF
 
 test_expect_success 'status --long --branch --no-ahead-behind' '
@@ -233,7 +233,7 @@ test_expect_success 'status -s -b (upstream is gone)' '
 '
 
 cat >expect <<\EOF
-## b6...origin/master
+## b6...origin/main
 EOF
 
 test_expect_success 'status -s -b (up-to-date with upstream)' '
@@ -246,7 +246,7 @@ test_expect_success 'status -s -b (up-to-date with upstream)' '
 '
 
 test_expect_success 'fail to track lightweight tags' '
-	git checkout master &&
+	git checkout main &&
 	git tag light &&
 	test_must_fail git branch --track lighttrack light >actual &&
 	test_i18ngrep ! "set up to track" actual &&
@@ -254,7 +254,7 @@ test_expect_success 'fail to track lightweight tags' '
 '
 
 test_expect_success 'fail to track annotated tags' '
-	git checkout master &&
+	git checkout main &&
 	git tag -m heavy heavy &&
 	test_must_fail git branch --track heavytrack heavy >actual &&
 	test_i18ngrep ! "set up to track" actual &&
@@ -262,17 +262,17 @@ test_expect_success 'fail to track annotated tags' '
 '
 
 test_expect_success '--set-upstream-to does not change branch' '
-	git branch from-master master &&
-	git branch --set-upstream-to master from-master &&
-	git branch from-topic_2 master &&
+	git branch from-main main &&
+	git branch --set-upstream-to main from-main &&
+	git branch from-topic_2 main &&
 	test_must_fail git config branch.from-topic_2.merge > actual &&
 	git rev-list from-topic_2 &&
 	git update-ref refs/heads/from-topic_2 from-topic_2^ &&
 	git rev-parse from-topic_2 >expect2 &&
-	git branch --set-upstream-to master from-topic_2 &&
-	git config branch.from-master.merge > actual &&
+	git branch --set-upstream-to main from-topic_2 &&
+	git config branch.from-main.merge > actual &&
 	git rev-parse from-topic_2 >actual2 &&
-	grep -q "^refs/heads/master$" actual &&
+	grep -q "^refs/heads/main$" actual &&
 	cmp expect2 actual2
 '
 
@@ -280,11 +280,11 @@ test_expect_success '--set-upstream-to @{-1}' '
 	git checkout follower &&
 	git checkout from-topic_2 &&
 	git config branch.from-topic_2.merge > expect2 &&
-	git branch --set-upstream-to @{-1} from-master &&
-	git config branch.from-master.merge > actual &&
+	git branch --set-upstream-to @{-1} from-main &&
+	git config branch.from-main.merge > actual &&
 	git config branch.from-topic_2.merge > actual2 &&
-	git branch --set-upstream-to follower from-master &&
-	git config branch.from-master.merge > expect &&
+	git branch --set-upstream-to follower from-main &&
+	git config branch.from-main.merge > expect &&
 	test_cmp expect2 actual2 &&
 	test_cmp expect actual
 '
diff --git a/t/t6050-replace.sh b/t/t6050-replace.sh
index c80dc10b8f..56cf4ceb90 100755
--- a/t/t6050-replace.sh
+++ b/t/t6050-replace.sh
@@ -133,9 +133,9 @@ test_expect_success 'tag replaced commit' '
 '
 
 test_expect_success '"git fsck" works' '
-     git fsck master >fsck_master.out &&
-     test_i18ngrep "dangling commit $R" fsck_master.out &&
-     test_i18ngrep "dangling tag $(git show-ref -s refs/tags/mytag)" fsck_master.out &&
+     git fsck main >fsck_main.out &&
+     test_i18ngrep "dangling commit $R" fsck_main.out &&
+     test_i18ngrep "dangling tag $(git show-ref -s refs/tags/mytag)" fsck_main.out &&
      test -z "$(git fsck)"
 '
 
@@ -218,7 +218,7 @@ test_expect_success 'create parallel branch without the bug' '
      git cherry-pick $HASH6 &&
      PARA6=$(git rev-parse --verify HEAD) &&
      git replace $HASH6 $PARA6 &&
-     git checkout master &&
+     git checkout main &&
      cur=$(git rev-parse --verify HEAD) &&
      test "$cur" = "$HASH7" &&
      git log --pretty=oneline | grep $PARA2 &&
@@ -461,7 +461,7 @@ test_expect_success GPG 'set up a merge commit with a mergetag' '
 	git commit -m "hello: 2 more lines from a test branch" &&
 	HASH9=$(git rev-parse --verify HEAD) &&
 	git tag -s -m "tag for testing with a mergetag" test_tag HEAD &&
-	git checkout master &&
+	git checkout main &&
 	git merge -s ours test_tag &&
 	HASH10=$(git rev-parse --verify HEAD) &&
 	git cat-file commit $HASH10 | grep "^mergetag object"
diff --git a/t/t6101-rev-parse-parents.sh b/t/t6101-rev-parse-parents.sh
index 7531262a5e..288a75c02b 100755
--- a/t/t6101-rev-parse-parents.sh
+++ b/t/t6101-rev-parse-parents.sh
@@ -18,7 +18,7 @@ test_expect_success 'setup' '
 	test_commit second &&
 	git checkout --orphan tmp &&
 	test_commit start2 &&
-	git checkout master &&
+	git checkout main &&
 	git merge -m next --allow-unrelated-histories start2 &&
 	test_commit final &&
 
diff --git a/t/t6110-rev-list-sparse.sh b/t/t6110-rev-list-sparse.sh
index 656ac7fe9d..093536fd85 100755
--- a/t/t6110-rev-list-sparse.sh
+++ b/t/t6110-rev-list-sparse.sh
@@ -10,7 +10,7 @@ test_expect_success setup '
 	git checkout -b side HEAD^ &&
 	test_commit D &&
 	test_commit E &&
-	git merge master
+	git merge main
 '
 
 test_expect_success 'rev-list --first-parent --boundary' '
diff --git a/t/t6111-rev-list-treesame.sh b/t/t6111-rev-list-treesame.sh
index 4244638285..90c8630e34 100755
--- a/t/t6111-rev-list-treesame.sh
+++ b/t/t6111-rev-list-treesame.sh
@@ -33,13 +33,13 @@ test_expect_success setup '
 	git checkout other-branch &&
 	test_commit "Added other" other "Hello" C &&
 
-	git checkout master &&
+	git checkout main &&
 	test_merge D other-branch &&
 
 	git checkout third-branch &&
 	test_commit "Third file" third "Nothing" E &&
 
-	git checkout master &&
+	git checkout main &&
 	test_commit "file=Blah" file "Blah" F &&
 
 	test_tick && git merge --no-commit third-branch &&
@@ -56,7 +56,7 @@ test_expect_success setup '
 
 	test_tick && git revert I && note J &&
 
-	git checkout master &&
+	git checkout main &&
 	test_tick && git merge --no-ff fiddler-branch &&
 	note K &&
 
diff --git a/t/t6112-rev-list-filters-objects.sh b/t/t6112-rev-list-filters-objects.sh
index de0e5a5d36..c6729320ea 100755
--- a/t/t6112-rev-list-filters-objects.sh
+++ b/t/t6112-rev-list-filters-objects.sh
@@ -223,7 +223,7 @@ test_expect_success 'verify sparse:oid=oid-ish omits top-level files' '
 	sort >expected &&
 
 	git -C r3 rev-list --quiet --objects --filter-print-omitted \
-		--filter=sparse:oid=master:pattern HEAD >revs &&
+		--filter=sparse:oid=main:pattern HEAD >revs &&
 	awk -f print_1.awk revs |
 	sed "s/~//" |
 	sort >observed &&
@@ -436,7 +436,7 @@ test_expect_success 'add sparse pattern blobs whose paths have reserved chars' '
 
 test_expect_success 'combine:... with more than two sub-filters' '
 	git -C r3 rev-list --objects \
-		--filter=combine:tree:3+blob:limit=40+sparse:oid=master:pattern \
+		--filter=combine:tree:3+blob:limit=40+sparse:oid=main:pattern \
 		HEAD >actual &&
 
 	expect_has HEAD "" &&
@@ -454,7 +454,7 @@ test_expect_success 'combine:... with more than two sub-filters' '
 	cp actual expect &&
 
 	git -C r3 rev-list --objects \
-		--filter=combine:tree:3+blob:limit=40+sparse:oid=master:pattern1%2brenamed%25 \
+		--filter=combine:tree:3+blob:limit=40+sparse:oid=main:pattern1%2brenamed%25 \
 		HEAD >actual &&
 	test_cmp expect actual &&
 
@@ -464,23 +464,23 @@ test_expect_success 'combine:... with more than two sub-filters' '
 	test_when_finished "rm -f trace1" &&
 	GIT_TRACE=$(pwd)/trace1 git -C r3 rev-list --objects \
 		--filter=tree:3 --filter=blob:limit=40 \
-		--filter=sparse:oid="master:p;at%ter+n" \
+		--filter=sparse:oid="main:p;at%ter+n" \
 		HEAD >actual &&
 
 	test_cmp expect actual &&
-	grep "Add to combine filter-spec: sparse:oid=master:p%3bat%25ter%2bn" \
+	grep "Add to combine filter-spec: sparse:oid=main:p%3bat%25ter%2bn" \
 		trace1 &&
 
 	# Repeat the above test, but this time, the characters to encode are in
 	# the LHS of the combined filter.
 	test_when_finished "rm -f trace2" &&
 	GIT_TRACE=$(pwd)/trace2 git -C r3 rev-list --objects \
-		--filter=sparse:oid=master:^~pattern \
+		--filter=sparse:oid=main:^~pattern \
 		--filter=tree:3 --filter=blob:limit=40 \
 		HEAD >actual &&
 
 	test_cmp expect actual &&
-	grep "Add to combine filter-spec: sparse:oid=master:%5e%7epattern" \
+	grep "Add to combine filter-spec: sparse:oid=main:%5e%7epattern" \
 		trace2
 '
 
diff --git a/t/t6120-describe.sh b/t/t6120-describe.sh
index f822d5d328..53617c9da9 100755
--- a/t/t6120-describe.sh
+++ b/t/t6120-describe.sh
@@ -102,7 +102,7 @@ check_describe c-* --tags HEAD^^2
 check_describe B --tags HEAD^^2^
 check_describe e --tags HEAD^^^
 
-check_describe heads/master --all HEAD
+check_describe heads/main --all HEAD
 check_describe tags/c-* --all HEAD^
 check_describe tags/e --all HEAD^^^
 
@@ -403,15 +403,15 @@ test_expect_success ULIMIT_STACK_SIZE 'name-rev works in a deep repo' '
 	i=1 &&
 	while test $i -lt 8000
 	do
-		echo "commit refs/heads/master
+		echo "commit refs/heads/main
 committer A U Thor <author@example.com> $((1000000000 + $i * 100)) +0200
 data <<EOF
 commit #$i
 EOF"
-		test $i = 1 && echo "from refs/heads/master^0"
+		test $i = 1 && echo "from refs/heads/main^0"
 		i=$(($i + 1))
 	done | git fast-import &&
-	git checkout master &&
+	git checkout main &&
 	git tag far-far-away HEAD^ &&
 	echo "HEAD~4000 tags/far-far-away~3999" >expect &&
 	git name-rev HEAD~4000 >actual &&
@@ -442,7 +442,7 @@ test_expect_success 'describe complains about missing object' '
 '
 
 test_expect_success 'name-rev a rev shortly after epoch' '
-	test_when_finished "git checkout master" &&
+	test_when_finished "git checkout main" &&
 
 	git checkout --orphan no-timestamp-underflow &&
 	# Any date closer to epoch than the CUTOFF_DATE_SLOP constant
@@ -456,7 +456,7 @@ test_expect_success 'name-rev a rev shortly after epoch' '
 	test_cmp expect actual
 '
 
-# A--------------master
+# A--------------main
 #  \            /
 #   \----------M2
 #    \        /
@@ -487,10 +487,10 @@ test_expect_success 'name-rev covers all conditions while looking at parents' '
 		git checkout $A &&
 		git merge --no-ff HEAD@{1} && # M2
 
-		git checkout master &&
+		git checkout main &&
 		git merge --no-ff HEAD@{1} &&
 
-		echo "$B master^2^2~1^2" >expect &&
+		echo "$B main^2^2~1^2" >expect &&
 		git name-rev $B >actual &&
 
 		test_cmp expect actual
@@ -516,7 +516,7 @@ test_expect_success 'describe commits with disjoint bases' '
 		git checkout --orphan branch && rm file &&
 		echo B > file2 && git add file2 && git commit -m B &&
 		git tag B -a -m B &&
-		git merge --no-ff --allow-unrelated-histories master -m x &&
+		git merge --no-ff --allow-unrelated-histories main -m x &&
 
 		check_describe "A-3-*" HEAD
 	)
@@ -542,7 +542,7 @@ test_expect_success 'describe commits with disjoint bases 2' '
 		echo o >> file2 && git add file2 && GIT_COMMITTER_DATE="2020-01-01 15:01" git commit -m o &&
 		echo B >> file2 && git add file2 && GIT_COMMITTER_DATE="2020-01-01 15:02" git commit -m B &&
 		git tag B -a -m B &&
-		git merge --no-ff --allow-unrelated-histories master -m x &&
+		git merge --no-ff --allow-unrelated-histories main -m x &&
 
 		check_describe "B-3-*" HEAD
 	)
diff --git a/t/t6200-fmt-merge-msg.sh b/t/t6200-fmt-merge-msg.sh
index f3e66eaf9b..8be07ce902 100755
--- a/t/t6200-fmt-merge-msg.sh
+++ b/t/t6200-fmt-merge-msg.sh
@@ -81,7 +81,7 @@ test_expect_success GPG 'set up a signed tag' '
 test_expect_success 'message for merging local branch' '
 	echo "Merge branch ${apos}left${apos}" >expected &&
 
-	git checkout master &&
+	git checkout main &&
 	git fetch . left &&
 
 	git fmt-merge-msg <.git/FETCH_HEAD >actual &&
@@ -89,7 +89,7 @@ test_expect_success 'message for merging local branch' '
 '
 
 test_expect_success GPG 'message for merging local tag signed by good key' '
-	git checkout master &&
+	git checkout main &&
 	git fetch . signed-good-tag &&
 	git fmt-merge-msg <.git/FETCH_HEAD >actual 2>&1 &&
 	grep "^Merge tag ${apos}signed-good-tag${apos}" actual &&
@@ -98,7 +98,7 @@ test_expect_success GPG 'message for merging local tag signed by good key' '
 '
 
 test_expect_success GPG 'message for merging local tag signed by unknown key' '
-	git checkout master &&
+	git checkout main &&
 	git fetch . signed-good-tag &&
 	GNUPGHOME=. git fmt-merge-msg <.git/FETCH_HEAD >actual 2>&1 &&
 	grep "^Merge tag ${apos}signed-good-tag${apos}" actual &&
@@ -109,7 +109,7 @@ test_expect_success GPG 'message for merging local tag signed by unknown key' '
 test_expect_success 'message for merging external branch' '
 	echo "Merge branch ${apos}left${apos} of $(pwd)" >expected &&
 
-	git checkout master &&
+	git checkout main &&
 	git fetch "$(pwd)" left &&
 
 	git fmt-merge-msg <.git/FETCH_HEAD >actual &&
@@ -133,7 +133,7 @@ test_expect_success '[merge] summary/log configuration' '
 	test_config merge.log true &&
 	test_unconfig merge.summary &&
 
-	git checkout master &&
+	git checkout main &&
 	test_tick &&
 	git fetch . left &&
 
@@ -142,7 +142,7 @@ test_expect_success '[merge] summary/log configuration' '
 	test_unconfig merge.log &&
 	test_config merge.summary true &&
 
-	git checkout master &&
+	git checkout main &&
 	test_tick &&
 	git fetch . left &&
 
@@ -153,7 +153,7 @@ test_expect_success '[merge] summary/log configuration' '
 '
 
 test_expect_success 'setup FETCH_HEAD' '
-	git checkout master &&
+	git checkout main &&
 	test_tick &&
 	git fetch . left
 '
@@ -281,7 +281,7 @@ test_expect_success 'fmt-merge-msg -m' '
 
 	test_unconfig merge.log &&
 	test_unconfig merge.summary &&
-	git checkout master &&
+	git checkout main &&
 	git fetch "$(pwd)" left &&
 	git fmt-merge-msg -m "Sync with left" <.git/FETCH_HEAD >actual &&
 	git fmt-merge-msg --log -m "Sync with left" \
@@ -323,28 +323,28 @@ test_expect_success 'setup: expected shortlog for two branches' '
 test_expect_success 'shortlog for two branches' '
 	test_config merge.log true &&
 	test_unconfig merge.summary &&
-	git checkout master &&
+	git checkout main &&
 	test_tick &&
 	git fetch . left right &&
 	git fmt-merge-msg <.git/FETCH_HEAD >actual1 &&
 
 	test_unconfig merge.log &&
 	test_config merge.summary true &&
-	git checkout master &&
+	git checkout main &&
 	test_tick &&
 	git fetch . left right &&
 	git fmt-merge-msg <.git/FETCH_HEAD >actual2 &&
 
 	test_config merge.log yes &&
 	test_unconfig merge.summary &&
-	git checkout master &&
+	git checkout main &&
 	test_tick &&
 	git fetch . left right &&
 	git fmt-merge-msg <.git/FETCH_HEAD >actual3 &&
 
 	test_unconfig merge.log &&
 	test_config merge.summary yes &&
-	git checkout master &&
+	git checkout main &&
 	test_tick &&
 	git fetch . left right &&
 	git fmt-merge-msg <.git/FETCH_HEAD >actual4 &&
@@ -358,7 +358,7 @@ test_expect_success 'shortlog for two branches' '
 test_expect_success 'merge-msg -F' '
 	test_unconfig merge.log &&
 	test_config merge.summary yes &&
-	git checkout master &&
+	git checkout main &&
 	test_tick &&
 	git fetch . left right &&
 	git fmt-merge-msg -F .git/FETCH_HEAD >actual &&
@@ -368,7 +368,7 @@ test_expect_success 'merge-msg -F' '
 test_expect_success 'merge-msg -F in subdirectory' '
 	test_unconfig merge.log &&
 	test_config merge.summary yes &&
-	git checkout master &&
+	git checkout main &&
 	test_tick &&
 	git fetch . left right &&
 	mkdir sub &&
@@ -408,7 +408,7 @@ test_expect_success 'merge-msg tag' '
 	test_unconfig merge.log &&
 	test_config merge.summary yes &&
 
-	git checkout master &&
+	git checkout main &&
 	test_tick &&
 	git fetch . tag tag-r3 &&
 
@@ -438,7 +438,7 @@ test_expect_success 'merge-msg two tags' '
 	test_unconfig merge.log &&
 	test_config merge.summary yes &&
 
-	git checkout master &&
+	git checkout main &&
 	test_tick &&
 	git fetch . tag tag-r3 tag tag-l5 &&
 
@@ -468,7 +468,7 @@ test_expect_success 'merge-msg tag and branch' '
 	test_unconfig merge.log &&
 	test_config merge.summary yes &&
 
-	git checkout master &&
+	git checkout main &&
 	test_tick &&
 	git fetch . tag tag-r3 left &&
 
@@ -495,7 +495,7 @@ test_expect_success 'merge-msg lots of commits' '
 
 	test_config merge.summary yes &&
 
-	git checkout master &&
+	git checkout main &&
 	test_tick &&
 	git fetch . long &&
 
@@ -506,11 +506,11 @@ test_expect_success 'merge-msg lots of commits' '
 test_expect_success 'merge-msg with "merging" an annotated tag' '
 	test_config merge.log true &&
 
-	git checkout master^0 &&
+	git checkout main^0 &&
 	git commit --allow-empty -m "One step ahead" &&
 	git tag -a -m "An annotated one" annote HEAD &&
 
-	git checkout master &&
+	git checkout main &&
 	git fetch . annote &&
 
 	git fmt-merge-msg <.git/FETCH_HEAD >actual &&
@@ -543,23 +543,23 @@ test_expect_success 'merge-msg with "merging" an annotated tag' '
 '
 
 test_expect_success 'merge.suppressDest configuration' '
-	git checkout -B side master &&
+	git checkout -B side main &&
 	git commit --allow-empty -m "One step ahead" &&
-	git checkout master &&
+	git checkout main &&
 	git fetch . side &&
 
 	git -c merge.suppressDest="" fmt-merge-msg <.git/FETCH_HEAD >full.1 &&
 	head -n1 full.1 >actual &&
-	grep -e "Merge branch .side. into master" actual &&
+	grep -e "Merge branch .side. into main" actual &&
 
 	git -c merge.suppressDest="mast" fmt-merge-msg <.git/FETCH_HEAD >full.2 &&
 	head -n1 full.2 >actual &&
-	grep -e "Merge branch .side. into master$" actual &&
+	grep -e "Merge branch .side. into main$" actual &&
 
 	git -c merge.suppressDest="ma?*[rn]" fmt-merge-msg <.git/FETCH_HEAD >full.3 &&
 	head -n1 full.3 >actual &&
 	grep -e "Merge branch .side." actual &&
-	! grep -e " into master$" actual
+	! grep -e " into main$" actual
 '
 
 test_done
diff --git a/t/t6302-for-each-ref-filter.sh b/t/t6302-for-each-ref-filter.sh
index 0a21669f56..f5a55c1991 100755
--- a/t/t6302-for-each-ref-filter.sh
+++ b/t/t6302-for-each-ref-filter.sh
@@ -26,17 +26,17 @@ test_expect_success 'setup some history and refs' '
 	git tag $sign -m "A signed tag" signed-tag &&
 	git tag $sign -m "Signed doubly" doubly-signed-tag signed-tag &&
 
-	git checkout master &&
-	git update-ref refs/odd/spot master
+	git checkout main &&
+	git update-ref refs/odd/spot main
 '
 
 test_expect_success 'filtering with --points-at' '
 	cat >expect <<-\EOF &&
-	refs/heads/master
+	refs/heads/main
 	refs/odd/spot
 	refs/tags/three
 	EOF
-	git for-each-ref --format="%(refname)" --points-at=master >actual &&
+	git for-each-ref --format="%(refname)" --points-at=main >actual &&
 	test_cmp expect actual
 '
 
@@ -53,13 +53,13 @@ test_expect_success 'check signed tags with --points-at' '
 
 test_expect_success 'filtering with --merged' '
 	cat >expect <<-\EOF &&
-	refs/heads/master
+	refs/heads/main
 	refs/odd/spot
 	refs/tags/one
 	refs/tags/three
 	refs/tags/two
 	EOF
-	git for-each-ref --format="%(refname)" --merged=master >actual &&
+	git for-each-ref --format="%(refname)" --merged=main >actual &&
 	test_cmp expect actual
 '
 
@@ -72,13 +72,13 @@ test_expect_success 'filtering with --no-merged' '
 	refs/tags/four
 	refs/tags/signed-tag
 	EOF
-	git for-each-ref --format="%(refname)" --no-merged=master >actual &&
+	git for-each-ref --format="%(refname)" --no-merged=main >actual &&
 	test_cmp expect actual
 '
 
 test_expect_success 'filtering with --contains' '
 	cat >expect <<-\EOF &&
-	refs/heads/master
+	refs/heads/main
 	refs/heads/side
 	refs/odd/spot
 	refs/tags/annotated-tag
@@ -251,7 +251,7 @@ test_expect_success PREPARE_FOR_MAIN_BRANCH 'nested alignment with quote formatt
 
 test_expect_success 'check `%(contents:lines=1)`' '
 	cat >expect <<-\EOF &&
-	master |three
+	main |three
 	side |four
 	odd/spot |three
 	annotated-tag |An annotated tag
@@ -269,7 +269,7 @@ test_expect_success 'check `%(contents:lines=1)`' '
 
 test_expect_success 'check `%(contents:lines=0)`' '
 	cat >expect <<-\EOF &&
-	master |
+	main |
 	side |
 	odd/spot |
 	annotated-tag |
@@ -287,7 +287,7 @@ test_expect_success 'check `%(contents:lines=0)`' '
 
 test_expect_success 'check `%(contents:lines=99999)`' '
 	cat >expect <<-\EOF &&
-	master |three
+	main |three
 	side |four
 	odd/spot |three
 	annotated-tag |An annotated tag
@@ -360,7 +360,7 @@ test_expect_success 'improper usage of %(if), %(then), %(else) and %(end) atoms'
 test_expect_success 'check %(if)...%(then)...%(end) atoms' '
 	git for-each-ref --format="%(refname)%(if)%(authorname)%(then) Author: %(authorname)%(end)" >actual &&
 	cat >expect <<-\EOF &&
-	refs/heads/master Author: A U Thor
+	refs/heads/main Author: A U Thor
 	refs/heads/side Author: A U Thor
 	refs/odd/spot Author: A U Thor
 	refs/tags/annotated-tag
@@ -381,7 +381,7 @@ test_expect_success 'check %(if)...%(then)...%(end) atoms' '
 test_expect_success 'check %(if)...%(then)...%(else)...%(end) atoms' '
 	git for-each-ref --format="%(if)%(authorname)%(then)%(authorname)%(else)No author%(end): %(refname)" >actual &&
 	cat >expect <<-\EOF &&
-	A U Thor: refs/heads/master
+	A U Thor: refs/heads/main
 	A U Thor: refs/heads/side
 	A U Thor: refs/odd/spot
 	No author: refs/tags/annotated-tag
@@ -401,7 +401,7 @@ test_expect_success 'check %(if)...%(then)...%(else)...%(end) atoms' '
 test_expect_success 'ignore spaces in %(if) atom usage' '
 	git for-each-ref --format="%(refname:short): %(if)%(HEAD)%(then)Head ref%(else)Not Head ref%(end)" >actual &&
 	cat >expect <<-\EOF &&
-	master: Head ref
+	main: Head ref
 	side: Not Head ref
 	odd/spot: Not Head ref
 	annotated-tag: Not Head ref
@@ -420,19 +420,19 @@ test_expect_success 'ignore spaces in %(if) atom usage' '
 '
 
 test_expect_success 'check %(if:equals=<string>)' '
-	git for-each-ref --format="%(if:equals=master)%(refname:short)%(then)Found master%(else)Not master%(end)" refs/heads/ >actual &&
+	git for-each-ref --format="%(if:equals=main)%(refname:short)%(then)Found main%(else)Not main%(end)" refs/heads/ >actual &&
 	cat >expect <<-\EOF &&
-	Found master
-	Not master
+	Found main
+	Not main
 	EOF
 	test_cmp expect actual
 '
 
 test_expect_success 'check %(if:notequals=<string>)' '
-	git for-each-ref --format="%(if:notequals=master)%(refname:short)%(then)Not master%(else)Found master%(end)" refs/heads/ >actual &&
+	git for-each-ref --format="%(if:notequals=main)%(refname:short)%(then)Not main%(else)Found main%(end)" refs/heads/ >actual &&
 	cat >expect <<-\EOF &&
-	Found master
-	Not master
+	Found main
+	Not main
 	EOF
 	test_cmp expect actual
 '
@@ -443,11 +443,11 @@ test_expect_success '--merged is compatible with --no-merged' '
 
 test_expect_success 'validate worktree atom' '
 	cat >expect <<-EOF &&
-	master: $(pwd)
-	master_worktree: $(pwd)/worktree_dir
+	main: $(pwd)
+	main_worktree: $(pwd)/worktree_dir
 	side: not checked out
 	EOF
-	git worktree add -b master_worktree worktree_dir master &&
+	git worktree add -b main_worktree worktree_dir main &&
 	git for-each-ref --format="%(refname:short): %(if)%(worktreepath)%(then)%(worktreepath)%(else)not checked out%(end)" refs/heads/ >actual &&
 	rm -r worktree_dir &&
 	git worktree prune &&
diff --git a/t/test-lib.sh b/t/test-lib.sh
index 11e02d615a..255eb24e5d 100644
--- a/t/test-lib.sh
+++ b/t/test-lib.sh
@@ -257,13 +257,13 @@ case "$TRASH_DIRECTORY" in
 esac
 
 case "$TEST_NUMBER" in
-3404|4013|5310|5526)
+3404|4013|5310|5526|6300)
 	# Avoid conflicts with patch series that are cooking at the same time
 	# as the patch series changing the default of `init.defaultBranch`.
 	GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
 	export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 	;;
-[0-5]*)
+[0-5]*|6[0-3]*)
 	GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 	export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 	;;
-- 
gitgitgadget


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH v2 18/27] t64*: preemptively adjust alignment to prepare for `master` -> `main`
  2020-11-17 16:12 ` [PATCH v2 00/27] tests: use " Johannes Schindelin via GitGitGadget
                     ` (16 preceding siblings ...)
  2020-11-17 16:12   ` [PATCH v2 17/27] t6[0-3]*: " Johannes Schindelin via GitGitGadget
@ 2020-11-17 16:12   ` Johannes Schindelin via GitGitGadget
  2020-11-17 16:12   ` [PATCH v2 19/27] t6[4-9]*: adjust the references to the default branch name "main" Johannes Schindelin via GitGitGadget
                     ` (10 subsequent siblings)
  28 siblings, 0 replies; 163+ messages in thread
From: Johannes Schindelin via GitGitGadget @ 2020-11-17 16:12 UTC (permalink / raw)
  To: git
  Cc: Felipe Contreras, Ævar Arnfjörð Bjarmason,
	Johannes Schindelin, Jeff King, Johannes Schindelin,
	Johannes Schindelin

From: Johannes Schindelin <johannes.schindelin@gmx.de>

We are in the process of renaming the default branch name to `main`,
which is two characters shorter than `master`. Therefore, some lines
need to be adjusted in t6416, t6422 and t6427 that want to align text
involving the default branch name.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
---
 t/t6416-recursive-corner-cases.sh    | 8 ++++----
 t/t6422-merge-rename-corner-cases.sh | 4 ++--
 t/t6427-diff3-conflict-markers.sh    | 4 ++--
 3 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/t/t6416-recursive-corner-cases.sh b/t/t6416-recursive-corner-cases.sh
index 887c2195a9..dbccc3158a 100755
--- a/t/t6416-recursive-corner-cases.sh
+++ b/t/t6416-recursive-corner-cases.sh
@@ -385,7 +385,7 @@ test_expect_success 'git detects conflict merging criss-cross+modify/delete' '
 		test_line_count = 2 out &&
 
 		git rev-parse >expect       \
-			master:file  B:file &&
+			master:file    B:file &&
 		git rev-parse   >actual      \
 			:1:file      :2:file &&
 		test_cmp expect actual
@@ -407,7 +407,7 @@ test_expect_success 'git detects conflict merging criss-cross+modify/delete, rev
 		test_line_count = 2 out &&
 
 		git rev-parse >expect       \
-			master:file  B:file &&
+			master:file    B:file &&
 		git rev-parse   >actual      \
 			:1:file      :3:file &&
 		test_cmp expect actual
@@ -1553,7 +1553,7 @@ test_expect_failure 'check conflicting modes for regular file' '
 # Setup:
 #          L1---L2
 #         /  \ /  \
-#   master    X    ?
+#     master    X    ?
 #         \  / \  /
 #          R1---R2
 #
@@ -1748,7 +1748,7 @@ test_expect_success 'check nested conflicts' '
 # Setup:
 #          L1---L2---L3
 #         /  \ /  \ /  \
-#   master    X1   X2   ?
+#     master    X1   X2   ?
 #         \  / \  / \  /
 #          R1---R2---R3
 #
diff --git a/t/t6422-merge-rename-corner-cases.sh b/t/t6422-merge-rename-corner-cases.sh
index 78bfaf17f0..e40a1b686f 100755
--- a/t/t6422-merge-rename-corner-cases.sh
+++ b/t/t6422-merge-rename-corner-cases.sh
@@ -1130,7 +1130,7 @@ test_conflicts_with_adds_and_renames() {
 	# Setup:
 	#          L
 	#         / \
-	#   master   ?
+	#     master   ?
 	#         \ /
 	#          R
 	#
@@ -1290,7 +1290,7 @@ test_conflicts_with_adds_and_renames add    add
 # Setup:
 #          L
 #         / \
-#   master   ?
+#     master   ?
 #         \ /
 #          R
 #
diff --git a/t/t6427-diff3-conflict-markers.sh b/t/t6427-diff3-conflict-markers.sh
index f4655bb358..f7620e677c 100755
--- a/t/t6427-diff3-conflict-markers.sh
+++ b/t/t6427-diff3-conflict-markers.sh
@@ -43,7 +43,7 @@ test_expect_success 'check no merge base' '
 # Setup:
 #          L1
 #         /  \
-#   master    ?
+#     master    ?
 #         \  /
 #          R1
 #
@@ -101,7 +101,7 @@ test_expect_success 'check unique merge base' '
 # Setup:
 #          L1---L2--L3
 #         /  \ /      \
-#   master    X1       ?
+#     master    X1       ?
 #         \  / \      /
 #          R1---R2--R3
 #
-- 
gitgitgadget


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH v2 19/27] t6[4-9]*: adjust the references to the default branch name "main"
  2020-11-17 16:12 ` [PATCH v2 00/27] tests: use " Johannes Schindelin via GitGitGadget
                     ` (17 preceding siblings ...)
  2020-11-17 16:12   ` [PATCH v2 18/27] t64*: preemptively adjust alignment to prepare for `master` -> `main` Johannes Schindelin via GitGitGadget
@ 2020-11-17 16:12   ` Johannes Schindelin via GitGitGadget
  2020-11-17 16:12   ` [PATCH v2 20/27] t7[0-4]*: " Johannes Schindelin via GitGitGadget
                     ` (9 subsequent siblings)
  28 siblings, 0 replies; 163+ messages in thread
From: Johannes Schindelin via GitGitGadget @ 2020-11-17 16:12 UTC (permalink / raw)
  To: git
  Cc: Felipe Contreras, Ævar Arnfjörð Bjarmason,
	Johannes Schindelin, Jeff King, Johannes Schindelin,
	Johannes Schindelin

From: Johannes Schindelin <johannes.schindelin@gmx.de>

This trick was performed via

	$ (cd t &&
	   sed -i -e 's/master/main/g' -e 's/MASTER/MAIN/g' \
		-e 's/Master/Main/g' -- t6[4-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>
---
 t/t6400-merge-df.sh                       |  6 +--
 t/t6402-merge-rename.sh                   | 46 +++++++++++------------
 t/t6404-recursive-merge.sh                |  4 +-
 t/t6405-merge-symlinks.sh                 | 14 +++----
 t/t6406-merge-attr.sh                     | 24 ++++++------
 t/t6407-merge-binary.sh                   |  6 +--
 t/t6409-merge-subtree.sh                  | 16 ++++----
 t/t6411-merge-filemode.sh                 | 10 ++---
 t/t6412-merge-large-rename.sh             |  6 +--
 t/t6413-merge-crlf.sh                     |  2 +-
 t/t6414-merge-rename-nocruft.sh           |  2 +-
 t/t6415-merge-dir-to-symlink.sh           | 22 +++++------
 t/t6416-recursive-corner-cases.sh         | 28 +++++++-------
 t/t6417-merge-ours-theirs.sh              | 28 +++++++-------
 t/t6418-merge-text-auto.sh                | 12 +++---
 t/t6419-merge-ignorecase.sh               | 10 ++---
 t/t6422-merge-rename-corner-cases.sh      | 12 +++---
 t/t6425-merge-rename-delete.sh            |  2 +-
 t/t6427-diff3-conflict-markers.sh         | 14 +++----
 t/t6430-merge-recursive.sh                | 18 ++++-----
 t/t6432-merge-recursive-space-options.sh  |  6 +--
 t/t6433-merge-toplevel.sh                 |  8 ++--
 t/t6434-merge-recursive-rename-options.sh |  6 +--
 t/t6436-merge-overwrite.sh                |  2 +-
 t/t6437-submodule-merge.sh                | 14 +++----
 t/t6439-merge-co-error-msgs.sh            |  6 +--
 t/t6501-freshen-objects.sh                |  2 +-
 t/test-lib.sh                             |  2 +-
 28 files changed, 164 insertions(+), 164 deletions(-)

diff --git a/t/t6400-merge-df.sh b/t/t6400-merge-df.sh
index 9da0838216..f7907df3af 100755
--- a/t/t6400-merge-df.sh
+++ b/t/t6400-merge-df.sh
@@ -24,12 +24,12 @@ test_expect_success 'prepare repository' '
 '
 
 test_expect_success 'Merge with d/f conflicts' '
-	test_expect_code 1 git merge -m "merge msg" master
+	test_expect_code 1 git merge -m "merge msg" main
 '
 
 test_expect_success 'F/D conflict' '
 	git reset --hard &&
-	git checkout master &&
+	git checkout main &&
 	rm .git/index &&
 
 	mkdir before &&
@@ -47,7 +47,7 @@ test_expect_success 'F/D conflict' '
 	git add . &&
 	git commit -m para &&
 
-	git merge master
+	git merge main
 '
 
 test_expect_success 'setup modify/delete + directory/file conflict' '
diff --git a/t/t6402-merge-rename.sh b/t/t6402-merge-rename.sh
index 3f64f62224..82b1b00d5b 100755
--- a/t/t6402-merge-rename.sh
+++ b/t/t6402-merge-rename.sh
@@ -54,9 +54,9 @@ test_expect_success 'setup' '
 	git branch change &&
 	git branch change+rename &&
 
-	sed -e "/^g /s/.*/g : master changes a line/" <A >A+ &&
+	sed -e "/^g /s/.*/g : main changes a line/" <A >A+ &&
 	mv A+ A &&
-	git commit -a -m "master updates A" &&
+	git commit -a -m "main updates A" &&
 
 	git checkout yellow &&
 	rm -f M &&
@@ -94,7 +94,7 @@ test_expect_success 'setup' '
 	git update-index --add B &&
 	git commit -q -a -m "changed and renamed" &&
 
-	git checkout master
+	git checkout main
 '
 
 test_expect_success 'pull renaming branch into unrenaming one' \
@@ -109,7 +109,7 @@ test_expect_success 'pull renaming branch into unrenaming one' \
 	sed -ne "/^g/{
 	p
 	q
-	}" B | grep master &&
+	}" B | grep main &&
 	git diff --exit-code white N
 '
 
@@ -134,7 +134,7 @@ test_expect_success 'pull unrenaming branch into renaming one' \
 '
 	git reset --hard &&
 	git show-branch &&
-	test_expect_code 1 git pull . master &&
+	test_expect_code 1 git pull . main &&
 	git ls-files -u B >b.stages &&
 	test_line_count = 3 b.stages &&
 	git ls-files -s N >n.stages &&
@@ -187,7 +187,7 @@ test_expect_success 'interference with untracked working tree file' '
 test_expect_success 'interference with untracked working tree file' '
 	git reset --hard &&
 	rm -f A M &&
-	git checkout -f master &&
+	git checkout -f main &&
 	git tag -f anchor &&
 	git show-branch &&
 	git pull . yellow &&
@@ -198,7 +198,7 @@ test_expect_success 'interference with untracked working tree file' '
 test_expect_success 'updated working tree file should prevent the merge' '
 	git reset --hard &&
 	rm -f A M &&
-	git checkout -f master &&
+	git checkout -f main &&
 	git tag -f anchor &&
 	git show-branch &&
 	echo >>M one line addition &&
@@ -211,7 +211,7 @@ test_expect_success 'updated working tree file should prevent the merge' '
 test_expect_success 'updated working tree file should prevent the merge' '
 	git reset --hard &&
 	rm -f A M &&
-	git checkout -f master &&
+	git checkout -f main &&
 	git tag -f anchor &&
 	git show-branch &&
 	echo >>M one line addition &&
@@ -229,7 +229,7 @@ test_expect_success 'interference with untracked working tree file' '
 	git tag -f anchor &&
 	git show-branch &&
 	echo >M this file should not matter &&
-	git pull . master &&
+	git pull . main &&
 	test_path_is_file M &&
 	! {
 		git ls-files -s |
@@ -764,7 +764,7 @@ test_expect_success 'setup avoid unnecessary update, dir->(file,nothing)' '
 	git rm -rf df &&
 	git commit -mB &&
 
-	git checkout master &&
+	git checkout main &&
 	git rm -rf df &&
 	echo bla >df &&
 	git add -A &&
@@ -772,7 +772,7 @@ test_expect_success 'setup avoid unnecessary update, dir->(file,nothing)' '
 '
 
 test_expect_success 'avoid unnecessary update, dir->(file,nothing)' '
-	git checkout -q master^0 &&
+	git checkout -q main^0 &&
 	test-tool chmtime --get -3600 df >expect &&
 	git merge side &&
 	test-tool chmtime --get df >actual &&
@@ -794,14 +794,14 @@ test_expect_success 'setup avoid unnecessary update, modify/delete' '
 	git rm -f file &&
 	git commit -m "Delete file" &&
 
-	git checkout master &&
+	git checkout main &&
 	echo bla >file &&
 	git add -A &&
 	git commit -m "Modify file"
 '
 
 test_expect_success 'avoid unnecessary update, modify/delete' '
-	git checkout -q master^0 &&
+	git checkout -q main^0 &&
 	test-tool chmtime --get -3600 file >expect &&
 	test_must_fail git merge side &&
 	test-tool chmtime --get file >actual &&
@@ -823,13 +823,13 @@ test_expect_success 'setup avoid unnecessary update, rename/add-dest' '
 	git add -A &&
 	git commit -m "Add file copy" &&
 
-	git checkout master &&
+	git checkout main &&
 	git mv file newfile &&
 	git commit -m "Rename file"
 '
 
 test_expect_success 'avoid unnecessary update, rename/add-dest' '
-	git checkout -q master^0 &&
+	git checkout -q main^0 &&
 	test-tool chmtime --get -3600 newfile >expect &&
 	git merge side &&
 	test-tool chmtime --get newfile >actual &&
@@ -879,15 +879,15 @@ test_expect_success 'setup for use of extended merge markers' '
 	git mv original_file renamed_file &&
 	git commit -mB &&
 
-	git checkout master &&
+	git checkout main &&
 	echo 8.5 >>original_file &&
 	git add original_file &&
 	git commit -mC
 '
 
-test_expect_success 'merge master into rename has correct extended markers' '
+test_expect_success 'merge main into rename has correct extended markers' '
 	git checkout rename^0 &&
-	test_must_fail git merge -s recursive master^0 &&
+	test_must_fail git merge -s recursive main^0 &&
 
 	cat >expected <<-\EOF &&
 	1
@@ -902,14 +902,14 @@ test_expect_success 'merge master into rename has correct extended markers' '
 	9
 	=======
 	8.5
-	>>>>>>> master^0:original_file
+	>>>>>>> main^0:original_file
 	EOF
 	test_cmp expected renamed_file
 '
 
-test_expect_success 'merge rename into master has correct extended markers' '
+test_expect_success 'merge rename into main has correct extended markers' '
 	git reset --hard &&
-	git checkout master^0 &&
+	git checkout main^0 &&
 	test_must_fail git merge -s recursive rename^0 &&
 
 	cat >expected <<-\EOF &&
@@ -945,13 +945,13 @@ test_expect_success 'setup spurious "refusing to lose untracked" message' '
 	git mv original_file renamed_file &&
 	git commit -mB &&
 
-	git checkout master &&
+	git checkout main &&
 	git rm original_file &&
 	git commit -mC
 '
 
 test_expect_success 'no spurious "refusing to lose untracked" message' '
-	git checkout master^0 &&
+	git checkout main^0 &&
 	test_must_fail git merge rename^0 2>errors.txt &&
 	! grep "refusing to lose untracked file" errors.txt
 '
diff --git a/t/t6404-recursive-merge.sh b/t/t6404-recursive-merge.sh
index b1c3d4dda4..410a17865b 100755
--- a/t/t6404-recursive-merge.sh
+++ b/t/t6404-recursive-merge.sh
@@ -19,11 +19,11 @@ test_expect_success 'setup tests' '
 	git add a1 &&
 	GIT_AUTHOR_DATE="2006-12-12 23:00:00" git commit -m 1 a1 &&
 
-	git checkout -b A master &&
+	git checkout -b A main &&
 	echo A >a1 &&
 	GIT_AUTHOR_DATE="2006-12-12 23:00:01" git commit -m A a1 &&
 
-	git checkout -b B master &&
+	git checkout -b B main &&
 	echo B >a1 &&
 	GIT_AUTHOR_DATE="2006-12-12 23:00:02" git commit -m B a1 &&
 
diff --git a/t/t6405-merge-symlinks.sh b/t/t6405-merge-symlinks.sh
index 6c0a90d044..160c2c10f6 100755
--- a/t/t6405-merge-symlinks.sh
+++ b/t/t6405-merge-symlinks.sh
@@ -19,7 +19,7 @@ test_expect_success 'setup' '
 	git branch b-file &&
 	l=$(printf file | git hash-object -t blob -w --stdin) &&
 	echo "120000 $l	symlink" | git update-index --index-info &&
-	git commit -m master &&
+	git commit -m main &&
 	git checkout b-symlink &&
 	l=$(printf file-different | git hash-object -t blob -w --stdin) &&
 	echo "120000 $l	symlink" | git update-index --index-info &&
@@ -30,28 +30,28 @@ test_expect_success 'setup' '
 	git commit -m b-file
 '
 
-test_expect_success 'merge master into b-symlink, which has a different symbolic link' '
+test_expect_success 'merge main into b-symlink, which has a different symbolic link' '
 	git checkout b-symlink &&
-	test_must_fail git merge master
+	test_must_fail git merge main
 '
 
 test_expect_success 'the merge result must be a file' '
 	test_path_is_file symlink
 '
 
-test_expect_success 'merge master into b-file, which has a file instead of a symbolic link' '
+test_expect_success 'merge main into b-file, which has a file instead of a symbolic link' '
 	git reset --hard &&
 	git checkout b-file &&
-	test_must_fail git merge master
+	test_must_fail git merge main
 '
 
 test_expect_success 'the merge result must be a file' '
 	test_path_is_file symlink
 '
 
-test_expect_success 'merge b-file, which has a file instead of a symbolic link, into master' '
+test_expect_success 'merge b-file, which has a file instead of a symbolic link, into main' '
 	git reset --hard &&
-	git checkout master &&
+	git checkout main &&
 	test_must_fail git merge b-file
 '
 
diff --git a/t/t6406-merge-attr.sh b/t/t6406-merge-attr.sh
index 76a55f838c..c559b5a3e6 100755
--- a/t/t6406-merge-attr.sh
+++ b/t/t6406-merge-attr.sh
@@ -19,10 +19,10 @@ test_expect_success setup '
 	git branch side &&
 	for f in text binary union
 	do
-		echo Master >>$f && git add $f || return 1
+		echo Main >>$f && git add $f || return 1
 	done &&
 	test_tick &&
-	git commit -m Master &&
+	git commit -m Main &&
 
 	git checkout side &&
 	for f in text binary union
@@ -64,7 +64,7 @@ test_expect_success merge '
 		echo "union merge=union"
 	} >.gitattributes &&
 
-	if git merge master
+	if git merge main
 	then
 		echo Gaah, should have conflicted
 		false
@@ -87,7 +87,7 @@ test_expect_success 'check merge result in working tree' '
 	grep "<<<<<<<" text &&
 	cmp binary-orig binary &&
 	! grep "<<<<<<<" union &&
-	grep Master union &&
+	grep Main union &&
 	grep Side union
 
 '
@@ -115,13 +115,13 @@ test_expect_success 'custom merge backend' '
 	git config --replace-all \
 	merge.custom.name "custom merge driver for testing" &&
 
-	git merge master &&
+	git merge main &&
 
 	cmp binary union &&
 	sed -e 1,3d text >check-1 &&
-	o=$(git unpack-file master^:text) &&
+	o=$(git unpack-file main^:text) &&
 	a=$(git unpack-file side^:text) &&
-	b=$(git unpack-file master:text) &&
+	b=$(git unpack-file main:text) &&
 	sh -c "./custom-merge $o $a $b 0 text" &&
 	sed -e 1,3d $a >check-2 &&
 	cmp check-1 check-2 &&
@@ -136,7 +136,7 @@ test_expect_success 'custom merge backend' '
 	git config --replace-all \
 	merge.custom.name "custom merge driver for testing" &&
 
-	if git merge master
+	if git merge main
 	then
 		echo "Eh? should have conflicted"
 		false
@@ -146,9 +146,9 @@ test_expect_success 'custom merge backend' '
 
 	cmp binary union &&
 	sed -e 1,3d text >check-1 &&
-	o=$(git unpack-file master^:text) &&
+	o=$(git unpack-file main^:text) &&
 	a=$(git unpack-file anchor:text) &&
-	b=$(git unpack-file master:text) &&
+	b=$(git unpack-file main:text) &&
 	sh -c "./custom-merge $o $a $b 0 text" &&
 	sed -e 1,3d $a >check-2 &&
 	cmp check-1 check-2 &&
@@ -176,7 +176,7 @@ test_expect_success 'up-to-date merge without common ancestor' '
 	test_tick &&
 	(
 		cd repo1 &&
-		git fetch ../repo2 master &&
+		git fetch ../repo2 main &&
 		git merge --allow-unrelated-histories FETCH_HEAD
 	)
 '
@@ -201,7 +201,7 @@ test_expect_success 'custom merge does not lock index' '
 	# By packaging the command in test_when_finished, we get both
 	# the correctness check and the clean-up.
 	test_when_finished "kill \$(cat sleep.pid)" &&
-	git merge master
+	git merge main
 '
 
 test_done
diff --git a/t/t6407-merge-binary.sh b/t/t6407-merge-binary.sh
index 4e6c7cb77e..a76c85ec1e 100755
--- a/t/t6407-merge-binary.sh
+++ b/t/t6407-merge-binary.sh
@@ -20,7 +20,7 @@ test_expect_success setup '
 	git ls-files -s a >E0 &&
 	git ls-files -s m | sed -e "s/ 0	/ 3	/" >E3 &&
 	test_tick &&
-	git commit -m "master adds some" &&
+	git commit -m "main adds some" &&
 
 	git checkout side &&
 	echo rezrov >>m &&
@@ -39,7 +39,7 @@ test_expect_success resolve '
 	rm -f a* m* &&
 	git reset --hard anchor &&
 
-	if git merge -s resolve master
+	if git merge -s resolve main
 	then
 		echo Oops, should not have succeeded
 		false
@@ -54,7 +54,7 @@ test_expect_success recursive '
 	rm -f a* m* &&
 	git reset --hard anchor &&
 
-	if git merge -s recursive master
+	if git merge -s recursive main
 	then
 		echo Oops, should not have succeeded
 		false
diff --git a/t/t6409-merge-subtree.sh b/t/t6409-merge-subtree.sh
index b8e8b6f642..55ae58584a 100755
--- a/t/t6409-merge-subtree.sh
+++ b/t/t6409-merge-subtree.sh
@@ -14,10 +14,10 @@ test_expect_success setup '
 	echo >>hello world &&
 	git add hello &&
 	git commit -m second &&
-	git checkout master &&
+	git checkout main &&
 	for i in mundo $s; do echo $i; done >hello &&
 	git add hello &&
-	git commit -m master
+	git commit -m main
 
 '
 
@@ -36,7 +36,7 @@ test_expect_success 'setup branch sub' '
 '
 
 test_expect_success 'setup topic branch' '
-	git checkout -b topic master &&
+	git checkout -b topic main &&
 	git merge -s ours --no-commit --allow-unrelated-histories sub &&
 	git read-tree --prefix=dir/ -u sub &&
 	git commit -m "initial merge of sub into topic" &&
@@ -77,8 +77,8 @@ test_expect_success 'setup' '
 
 test_expect_success 'initial merge' '
 	git remote add -f gui ../git-gui &&
-	git merge -s ours --no-commit --allow-unrelated-histories gui/master &&
-	git read-tree --prefix=git-gui/ -u gui/master &&
+	git merge -s ours --no-commit --allow-unrelated-histories gui/main &&
+	git read-tree --prefix=git-gui/ -u gui/main &&
 	git commit -m "Merge git-gui as our subdirectory" &&
 	git checkout -b work &&
 	git ls-files -s >actual &&
@@ -108,10 +108,10 @@ test_expect_success 'merge update' '
 
 test_expect_success 'initial ambiguous subtree' '
 	cd ../git &&
-	git reset --hard master &&
+	git reset --hard main &&
 	git checkout -b topic_2 &&
-	git merge -s ours --no-commit gui/master &&
-	git read-tree --prefix=git-gui2/ -u gui/master &&
+	git merge -s ours --no-commit gui/main &&
+	git read-tree --prefix=git-gui2/ -u gui/main &&
 	git commit -m "Merge git-gui2 as our subdirectory" &&
 	git checkout -b work2 &&
 	git ls-files -s >actual &&
diff --git a/t/t6411-merge-filemode.sh b/t/t6411-merge-filemode.sh
index 87741efad3..7ded226de4 100755
--- a/t/t6411-merge-filemode.sh
+++ b/t/t6411-merge-filemode.sh
@@ -7,11 +7,11 @@ test_expect_success 'set up mode change in one branch' '
 	: >file1 &&
 	git add file1 &&
 	git commit -m initial &&
-	git checkout -b a1 master &&
+	git checkout -b a1 main &&
 	: >dummy &&
 	git add dummy &&
 	git commit -m a &&
-	git checkout -b b1 master &&
+	git checkout -b b1 main &&
 	test_chmod +x file1 &&
 	git add file1 &&
 	git commit -m b1
@@ -39,12 +39,12 @@ do_one_mode resolve b1 a1
 
 test_expect_success 'set up mode change in both branches' '
 	git reset --hard HEAD &&
-	git checkout -b a2 master &&
+	git checkout -b a2 main &&
 	: >file2 &&
 	H=$(git hash-object file2) &&
 	test_chmod +x file2 &&
 	git commit -m a2 &&
-	git checkout -b b2 master &&
+	git checkout -b b2 main &&
 	: >file2 &&
 	git add file2 &&
 	git commit -m b2 &&
@@ -76,7 +76,7 @@ do_both_modes resolve
 
 test_expect_success 'set up delete/modechange scenario' '
 	git reset --hard &&
-	git checkout -b deletion master &&
+	git checkout -b deletion main &&
 	git rm file1 &&
 	git commit -m deletion
 '
diff --git a/t/t6412-merge-large-rename.sh b/t/t6412-merge-large-rename.sh
index 80777386dc..489ebd9bb7 100755
--- a/t/t6412-merge-large-rename.sh
+++ b/t/t6412-merge-large-rename.sh
@@ -30,7 +30,7 @@ test_rename() {
 	test_expect_success "rename ($1, $2)" '
 	n='$1' &&
 	expect='$2' &&
-	git checkout -f master &&
+	git checkout -f main &&
 	test_might_fail git branch -D test$n &&
 	git reset --hard initial &&
 	for i in $(count $n); do
@@ -50,8 +50,8 @@ test_rename() {
 	git add . &&
 	git commit -m change+rename=$n &&
 	case "$expect" in
-		ok) git merge master ;;
-		 *) test_must_fail git merge master ;;
+		ok) git merge main ;;
+		 *) test_must_fail git merge main ;;
 	esac
 	'
 }
diff --git a/t/t6413-merge-crlf.sh b/t/t6413-merge-crlf.sh
index e8d65eefb5..feaf9ef1a0 100755
--- a/t/t6413-merge-crlf.sh
+++ b/t/t6413-merge-crlf.sh
@@ -24,7 +24,7 @@ test_expect_success setup '
 	echo line from b | append_cr >file &&
 	git commit -m "add line from b" file &&
 	git tag b &&
-	git checkout master
+	git checkout main
 '
 
 test_expect_success 'Check "ours" is CRLF' '
diff --git a/t/t6414-merge-rename-nocruft.sh b/t/t6414-merge-rename-nocruft.sh
index a25e730460..81fa89331c 100755
--- a/t/t6414-merge-rename-nocruft.sh
+++ b/t/t6414-merge-rename-nocruft.sh
@@ -65,7 +65,7 @@ test_expect_success 'setup' '
 	git update-index A &&
 	git commit -m "blue modify A" &&
 
-	git checkout master
+	git checkout main
 '
 
 # This test broke in 65ac6e9c3f47807cb603af07a6a9e1a43bc119ae
diff --git a/t/t6415-merge-dir-to-symlink.sh b/t/t6415-merge-dir-to-symlink.sh
index 2eddcc7664..3bbabbee49 100755
--- a/t/t6415-merge-dir-to-symlink.sh
+++ b/t/t6415-merge-dir-to-symlink.sh
@@ -19,7 +19,7 @@ test_expect_success 'create a commit where dir a/b changed to symlink' '
 
 test_expect_success 'checkout does not clobber untracked symlink' '
 	git checkout HEAD^0 &&
-	git reset --hard master &&
+	git reset --hard main &&
 	git rm --cached a/b &&
 	git commit -m "untracked symlink remains" &&
 	test_must_fail git checkout start^0
@@ -27,7 +27,7 @@ test_expect_success 'checkout does not clobber untracked symlink' '
 
 test_expect_success 'a/b-2/c/d is kept when clobbering symlink b' '
 	git checkout HEAD^0 &&
-	git reset --hard master &&
+	git reset --hard main &&
 	git rm --cached a/b &&
 	git commit -m "untracked symlink remains" &&
 	git checkout -f start^0 &&
@@ -36,7 +36,7 @@ test_expect_success 'a/b-2/c/d is kept when clobbering symlink b' '
 
 test_expect_success 'checkout should not have deleted a/b-2/c/d' '
 	git checkout HEAD^0 &&
-	git reset --hard master &&
+	git reset --hard main &&
 	 git checkout start^0 &&
 	 test_path_is_file a/b-2/c/d
 '
@@ -53,7 +53,7 @@ test_expect_success 'setup for merge test' '
 test_expect_success 'Handle D/F conflict, do not lose a/b-2/c/d in merge (resolve)' '
 	git reset --hard &&
 	git checkout baseline^0 &&
-	git merge -s resolve master &&
+	git merge -s resolve main &&
 	test_path_is_file a/b-2/c/d
 '
 
@@ -64,7 +64,7 @@ test_expect_success SYMLINKS 'a/b was resolved as symlink' '
 test_expect_success 'Handle D/F conflict, do not lose a/b-2/c/d in merge (recursive)' '
 	git reset --hard &&
 	git checkout baseline^0 &&
-	git merge -s recursive master &&
+	git merge -s recursive main &&
 	test_path_is_file a/b-2/c/d
 '
 
@@ -74,7 +74,7 @@ test_expect_success SYMLINKS 'a/b was resolved as symlink' '
 
 test_expect_success 'Handle F/D conflict, do not lose a/b-2/c/d in merge (resolve)' '
 	git reset --hard &&
-	git checkout master^0 &&
+	git checkout main^0 &&
 	git merge -s resolve baseline^0 &&
 	test_path_is_file a/b-2/c/d
 '
@@ -85,7 +85,7 @@ test_expect_success SYMLINKS 'a/b was resolved as symlink' '
 
 test_expect_success 'Handle F/D conflict, do not lose a/b-2/c/d in merge (recursive)' '
 	git reset --hard &&
-	git checkout master^0 &&
+	git checkout main^0 &&
 	git merge -s recursive baseline^0 &&
 	test_path_is_file a/b-2/c/d
 '
@@ -98,7 +98,7 @@ test_expect_failure 'do not lose untracked in merge (resolve)' '
 	git reset --hard &&
 	git checkout baseline^0 &&
 	>a/b/c/e &&
-	test_must_fail git merge -s resolve master &&
+	test_must_fail git merge -s resolve main &&
 	test_path_is_file a/b/c/e &&
 	test_path_is_file a/b-2/c/d
 '
@@ -107,7 +107,7 @@ test_expect_success 'do not lose untracked in merge (recursive)' '
 	git reset --hard &&
 	git checkout baseline^0 &&
 	>a/b/c/e &&
-	test_must_fail git merge -s recursive master &&
+	test_must_fail git merge -s recursive main &&
 	test_path_is_file a/b/c/e &&
 	test_path_is_file a/b-2/c/d
 '
@@ -116,14 +116,14 @@ test_expect_success 'do not lose modifications in merge (resolve)' '
 	git reset --hard &&
 	git checkout baseline^0 &&
 	echo more content >>a/b/c/d &&
-	test_must_fail git merge -s resolve master
+	test_must_fail git merge -s resolve main
 '
 
 test_expect_success 'do not lose modifications in merge (recursive)' '
 	git reset --hard &&
 	git checkout baseline^0 &&
 	echo more content >>a/b/c/d &&
-	test_must_fail git merge -s recursive master
+	test_must_fail git merge -s recursive main
 '
 
 test_expect_success 'setup a merge where dir a/b-2 changed to symlink' '
diff --git a/t/t6416-recursive-corner-cases.sh b/t/t6416-recursive-corner-cases.sh
index dbccc3158a..b43ecb38b7 100755
--- a/t/t6416-recursive-corner-cases.sh
+++ b/t/t6416-recursive-corner-cases.sh
@@ -385,7 +385,7 @@ test_expect_success 'git detects conflict merging criss-cross+modify/delete' '
 		test_line_count = 2 out &&
 
 		git rev-parse >expect       \
-			master:file    B:file &&
+			main:file    B:file &&
 		git rev-parse   >actual      \
 			:1:file      :2:file &&
 		test_cmp expect actual
@@ -407,7 +407,7 @@ test_expect_success 'git detects conflict merging criss-cross+modify/delete, rev
 		test_line_count = 2 out &&
 
 		git rev-parse >expect       \
-			master:file    B:file &&
+			main:file    B:file &&
 		git rev-parse   >actual      \
 			:1:file      :3:file &&
 		test_cmp expect actual
@@ -1553,12 +1553,12 @@ test_expect_failure 'check conflicting modes for regular file' '
 # Setup:
 #          L1---L2
 #         /  \ /  \
-#     master    X    ?
+#     main    X    ?
 #         \  / \  /
 #          R1---R2
 #
 # Where:
-#   master has two files, named 'b' and 'a'
+#   main has two files, named 'b' and 'a'
 #   branches L1 and R1 both modify each of the two files in conflicting ways
 #
 #   L2 is a merge of R1 into L1; more on it later.
@@ -1663,7 +1663,7 @@ test_expect_success 'check nested conflicts' '
 		cd nested_conflicts &&
 
 		git clean -f &&
-		MASTER=$(git rev-parse --short master) &&
+		MAIN=$(git rev-parse --short main) &&
 		git checkout L2^0 &&
 
 		# Merge must fail; there is a conflict
@@ -1679,24 +1679,24 @@ test_expect_success 'check nested conflicts' '
 		test_line_count = 1 out &&
 
 		# Create a and b from virtual merge base X
-		git cat-file -p master:a >base &&
+		git cat-file -p main:a >base &&
 		git cat-file -p L1:a >ours &&
 		git cat-file -p R1:a >theirs &&
 		test_must_fail git merge-file --diff3 \
 			-L "Temporary merge branch 1" \
-			-L "$MASTER"  \
+			-L "$MAIN"  \
 			-L "Temporary merge branch 2" \
 			ours  \
 			base  \
 			theirs &&
 		sed -e "s/^\([<|=>]\)/\1\1/" ours >vmb_a &&
 
-		git cat-file -p master:b >base &&
+		git cat-file -p main:b >base &&
 		git cat-file -p L1:b >ours &&
 		git cat-file -p R1:b >theirs &&
 		test_must_fail git merge-file --diff3 \
 			-L "Temporary merge branch 1" \
-			-L "$MASTER"  \
+			-L "$MAIN"  \
 			-L "Temporary merge branch 2" \
 			ours  \
 			base  \
@@ -1748,12 +1748,12 @@ test_expect_success 'check nested conflicts' '
 # Setup:
 #          L1---L2---L3
 #         /  \ /  \ /  \
-#     master    X1   X2   ?
+#     main    X1   X2   ?
 #         \  / \  / \  /
 #          R1---R2---R3
 #
 # Where:
-#   master has one file named 'content'
+#   main has one file named 'content'
 #   branches L1 and R1 both modify each of the two files in conflicting ways
 #
 #   L<n> (n>1) is a merge of R<n-1> into L<n-1>
@@ -1834,7 +1834,7 @@ test_expect_success 'check virtual merge base with nested conflicts' '
 	(
 		cd virtual_merge_base_has_nested_conflicts &&
 
-		MASTER=$(git rev-parse --short master) &&
+		MAIN=$(git rev-parse --short main) &&
 		git checkout L3^0 &&
 
 		# Merge must fail; there is a conflict
@@ -1857,13 +1857,13 @@ test_expect_success 'check virtual merge base with nested conflicts' '
 		# Imitate X1 merge base, except without long enough conflict
 		# markers because a subsequent sed will modify them.  Put
 		# result into vmb.
-		git cat-file -p master:content >base &&
+		git cat-file -p main:content >base &&
 		git cat-file -p L:content >left &&
 		git cat-file -p R:content >right &&
 		cp left merged-once &&
 		test_must_fail git merge-file --diff3 \
 			-L "Temporary merge branch 1" \
-			-L "$MASTER"  \
+			-L "$MAIN"  \
 			-L "Temporary merge branch 2" \
 			merged-once \
 			base        \
diff --git a/t/t6417-merge-ours-theirs.sh b/t/t6417-merge-ours-theirs.sh
index 0aebc6c028..4bb77b9779 100755
--- a/t/t6417-merge-ours-theirs.sh
+++ b/t/t6417-merge-ours-theirs.sh
@@ -20,11 +20,11 @@ test_expect_success setup '
 	sed -e "s/9/nueve/" >file <elif &&
 	git commit -a -m theirs &&
 
-	git checkout master^0
+	git checkout main^0
 '
 
 test_expect_success 'plain recursive - should conflict' '
-	git reset --hard master &&
+	git reset --hard main &&
 	test_must_fail git merge -s recursive side &&
 	grep nine file &&
 	grep nueve file &&
@@ -34,7 +34,7 @@ test_expect_success 'plain recursive - should conflict' '
 '
 
 test_expect_success 'recursive favouring theirs' '
-	git reset --hard master &&
+	git reset --hard main &&
 	git merge -s recursive -Xtheirs side &&
 	! grep nine file &&
 	grep nueve file &&
@@ -44,7 +44,7 @@ test_expect_success 'recursive favouring theirs' '
 '
 
 test_expect_success 'recursive favouring ours' '
-	git reset --hard master &&
+	git reset --hard main &&
 	git merge -s recursive -X ours side &&
 	grep nine file &&
 	! grep nueve file &&
@@ -56,26 +56,26 @@ test_expect_success 'recursive favouring ours' '
 test_expect_success 'binary file with -Xours/-Xtheirs' '
 	echo file binary >.gitattributes &&
 
-	git reset --hard master &&
+	git reset --hard main &&
 	git merge -s recursive -X theirs side &&
 	git diff --exit-code side HEAD -- file &&
 
-	git reset --hard master &&
+	git reset --hard main &&
 	git merge -s recursive -X ours side &&
-	git diff --exit-code master HEAD -- file
+	git diff --exit-code main HEAD -- file
 '
 
 test_expect_success 'pull passes -X to underlying merge' '
-	git reset --hard master && git pull -s recursive -Xours . side &&
-	git reset --hard master && git pull -s recursive -X ours . side &&
-	git reset --hard master && git pull -s recursive -Xtheirs . side &&
-	git reset --hard master && git pull -s recursive -X theirs . side &&
-	git reset --hard master && test_must_fail git pull -s recursive -X bork . side
+	git reset --hard main && git pull -s recursive -Xours . side &&
+	git reset --hard main && git pull -s recursive -X ours . side &&
+	git reset --hard main && git pull -s recursive -Xtheirs . side &&
+	git reset --hard main && git pull -s recursive -X theirs . side &&
+	git reset --hard main && test_must_fail git pull -s recursive -X bork . side
 '
 
 test_expect_success SYMLINKS 'symlink with -Xours/-Xtheirs' '
-	git reset --hard master &&
-	git checkout -b two master &&
+	git reset --hard main &&
+	git checkout -b two main &&
 	ln -s target-zero link &&
 	git add link &&
 	git commit -m "add link pointing to zero" &&
diff --git a/t/t6418-merge-text-auto.sh b/t/t6418-merge-text-auto.sh
index 30983d18b1..b8df80d2df 100755
--- a/t/t6418-merge-text-auto.sh
+++ b/t/t6418-merge-text-auto.sh
@@ -2,13 +2,13 @@
 
 test_description='CRLF merge conflict across text=auto change
 
-* [master] remove .gitattributes
+* [main] remove .gitattributes
  ! [side] add line from b
 --
  + [side] add line from b
-*  [master] remove .gitattributes
-*  [master^] add line from a
-*  [master~2] normalize file
+*  [main] remove .gitattributes
+*  [main^] add line from a
+*  [main~2] normalize file
 *+ [side^] Initial
 '
 
@@ -64,7 +64,7 @@ test_expect_success setup '
 	git commit -m "add line from b" &&
 	git tag b &&
 
-	git checkout master
+	git checkout main
 '
 
 test_expect_success 'set up fuzz_conflict() helper' '
@@ -195,7 +195,7 @@ test_expect_success 'Test delete/normalize conflict' '
 	git reset --hard initial &&
 	git rm file &&
 	git commit -m "remove file" &&
-	git checkout master &&
+	git checkout main &&
 	git reset --hard a^ &&
 	git merge side &&
 	test_path_is_missing file
diff --git a/t/t6419-merge-ignorecase.sh b/t/t6419-merge-ignorecase.sh
index 531850d834..d32bbb3359 100755
--- a/t/t6419-merge-ignorecase.sh
+++ b/t/t6419-merge-ignorecase.sh
@@ -20,18 +20,18 @@ test_expect_success 'merge with case-changing rename' '
 	>foo &&
 	git add foo &&
 	git commit -m "intervening commit" &&
-	git checkout master &&
+	git checkout main &&
 	git rm TestCase &&
 	>testcase &&
 	git add testcase &&
 	git commit -m "rename to testcase" &&
 	git checkout with-camel &&
-	git merge master -m "merge" &&
+	git merge main -m "merge" &&
 	test_path_is_file testcase
 '
 
 test_expect_success 'merge with case-changing rename on both sides' '
-	git checkout master &&
+	git checkout main &&
 	git reset --hard baseline &&
 	git branch -D with-camel &&
 	git checkout -b with-camel &&
@@ -40,13 +40,13 @@ test_expect_success 'merge with case-changing rename on both sides' '
 	>foo &&
 	git add foo &&
 	git commit -m "intervening commit" &&
-	git checkout master &&
+	git checkout main &&
 	git rm TestCase &&
 	>testcase &&
 	git add testcase &&
 	git commit -m "rename to testcase" &&
 	git checkout with-camel &&
-	git merge master -m "merge" &&
+	git merge main -m "merge" &&
 	test_path_is_file testcase
 '
 
diff --git a/t/t6422-merge-rename-corner-cases.sh b/t/t6422-merge-rename-corner-cases.sh
index e40a1b686f..21c64b51be 100755
--- a/t/t6422-merge-rename-corner-cases.sh
+++ b/t/t6422-merge-rename-corner-cases.sh
@@ -1130,7 +1130,7 @@ test_conflicts_with_adds_and_renames() {
 	# Setup:
 	#          L
 	#         / \
-	#     master   ?
+	#     main   ?
 	#         \ /
 	#          R
 	#
@@ -1260,7 +1260,7 @@ test_conflicts_with_adds_and_renames() {
 				:2:three           \
 				:3:three           &&
 			git rev-parse >expected        \
-				master:irrelevant_file \
+				main:irrelevant_file \
 				file_v2                \
 				file_v4                &&
 			test_cmp expected actual &&
@@ -1290,12 +1290,12 @@ test_conflicts_with_adds_and_renames add    add
 # Setup:
 #          L
 #         / \
-#     master   ?
+#     main   ?
 #         \ /
 #          R
 #
 # Where:
-#   master has two files, named 'one' and 'two'.
+#   main has two files, named 'one' and 'two'.
 #   branches L and R both modify 'one', in conflicting ways.
 #   branches L and R both modify 'two', in conflicting ways.
 #   branch L also renames 'one' to 'three'.
@@ -1376,7 +1376,7 @@ test_expect_success 'check nested conflicts from rename/rename(2to1)' '
 		test_line_count = 1 out &&
 
 		# Compare :2:three to expected values
-		git cat-file -p master:one >base &&
+		git cat-file -p main:one >base &&
 		git cat-file -p L:three >ours &&
 		git cat-file -p R:one >theirs &&
 		test_must_fail git merge-file    \
@@ -1387,7 +1387,7 @@ test_expect_success 'check nested conflicts from rename/rename(2to1)' '
 		test_cmp expect L-three &&
 
 		# Compare :2:three to expected values
-		git cat-file -p master:two >base &&
+		git cat-file -p main:two >base &&
 		git cat-file -p L:two >ours &&
 		git cat-file -p R:three >theirs &&
 		test_must_fail git merge-file    \
diff --git a/t/t6425-merge-rename-delete.sh b/t/t6425-merge-rename-delete.sh
index f79d021590..2d39bf630e 100755
--- a/t/t6425-merge-rename-delete.sh
+++ b/t/t6425-merge-rename-delete.sh
@@ -12,7 +12,7 @@ test_expect_success 'rename/delete' '
 	git mv A B &&
 	git commit -m "rename" &&
 
-	git checkout master &&
+	git checkout main &&
 	git rm A &&
 	git commit -m "delete" &&
 
diff --git a/t/t6427-diff3-conflict-markers.sh b/t/t6427-diff3-conflict-markers.sh
index f7620e677c..b28966d0f4 100755
--- a/t/t6427-diff3-conflict-markers.sh
+++ b/t/t6427-diff3-conflict-markers.sh
@@ -43,7 +43,7 @@ test_expect_success 'check no merge base' '
 # Setup:
 #          L1
 #         /  \
-#     master    ?
+#     main    ?
 #         \  /
 #          R1
 #
@@ -90,18 +90,18 @@ test_expect_success 'check unique merge base' '
 		cd unique_merge_base &&
 
 		git checkout L^0 &&
-		MASTER=$(git rev-parse --short master) &&
+		MAIN=$(git rev-parse --short main) &&
 
 		test_must_fail git -c merge.conflictstyle=diff3 merge -s recursive R^0 &&
 
-		grep "|||||| $MASTER:content" renamed
+		grep "|||||| $MAIN:content" renamed
 	)
 '
 
 # Setup:
 #          L1---L2--L3
 #         /  \ /      \
-#     master    X1       ?
+#     main    X1       ?
 #         \  / \      /
 #          R1---R2--R3
 #
@@ -191,10 +191,10 @@ test_expect_success 'rebase --merge describes parent of commit being picked' '
 	(
 		cd rebase &&
 		test_commit base file &&
-		test_commit master file &&
+		test_commit main file &&
 		git checkout -b side HEAD^ &&
 		test_commit side file &&
-		test_must_fail git -c merge.conflictstyle=diff3 rebase --merge master &&
+		test_must_fail git -c merge.conflictstyle=diff3 rebase --merge main &&
 		grep "||||||| parent of" file
 	)
 '
@@ -203,7 +203,7 @@ test_expect_success 'rebase --apply describes fake ancestor base' '
 	(
 		cd rebase &&
 		git rebase --abort &&
-		test_must_fail git -c merge.conflictstyle=diff3 rebase --apply master &&
+		test_must_fail git -c merge.conflictstyle=diff3 rebase --apply main &&
 		grep "||||||| constructed merge base" file
 	)
 '
diff --git a/t/t6430-merge-recursive.sh b/t/t6430-merge-recursive.sh
index 9c08e63af2..4bc8cc764b 100755
--- a/t/t6430-merge-recursive.sh
+++ b/t/t6430-merge-recursive.sh
@@ -35,7 +35,7 @@ test_expect_success 'setup 1' '
 	git add a d/e &&
 
 	test_tick &&
-	git commit -m "master modifies a and d/e" &&
+	git commit -m "main modifies a and d/e" &&
 	c1=$(git rev-parse --verify HEAD) &&
 	( git ls-tree -r HEAD && git ls-files -s ) >actual &&
 	(
@@ -466,7 +466,7 @@ test_expect_success SYMLINKS 'dir in working tree with symlink ancestor does not
 		git checkout -b branch1 &&
 		git commit --allow-empty -m "empty commit" &&
 
-		git checkout master &&
+		git checkout main &&
 		git rm foo &&
 		mkdir foo &&
 		>foo/bar &&
@@ -475,7 +475,7 @@ test_expect_success SYMLINKS 'dir in working tree with symlink ancestor does not
 
 		git checkout branch1 &&
 
-		git cherry-pick master &&
+		git cherry-pick main &&
 		test_path_is_dir foo &&
 		test_path_is_file foo/bar
 	)
@@ -490,8 +490,8 @@ test_expect_success 'reset and 3-way merge' '
 
 test_expect_success 'reset and bind merge' '
 
-	git reset --hard master &&
-	git read-tree --prefix=M/ master &&
+	git reset --hard main &&
+	git read-tree --prefix=M/ main &&
 	git ls-files -s >actual &&
 	(
 		echo "100644 $o1 0	M/a" &&
@@ -505,7 +505,7 @@ test_expect_success 'reset and bind merge' '
 	) >expected &&
 	test_cmp expected actual &&
 
-	git read-tree --prefix=a1/ master &&
+	git read-tree --prefix=a1/ main &&
 	git ls-files -s >actual &&
 	(
 		echo "100644 $o1 0	M/a" &&
@@ -523,7 +523,7 @@ test_expect_success 'reset and bind merge' '
 	) >expected &&
 	test_cmp expected actual &&
 
-	git read-tree --prefix=z/ master &&
+	git read-tree --prefix=z/ main &&
 	git ls-files -s >actual &&
 	(
 		echo "100644 $o1 0	M/a" &&
@@ -599,11 +599,11 @@ test_expect_success 'merge-recursive w/ empty work tree - theirs has rename' '
 
 test_expect_success 'merge removes empty directories' '
 
-	git reset --hard master &&
+	git reset --hard main &&
 	git checkout -b rm &&
 	git rm d/e &&
 	git commit -mremoved-d/e &&
-	git checkout master &&
+	git checkout main &&
 	git merge -s recursive rm &&
 	test_path_is_missing d
 '
diff --git a/t/t6432-merge-recursive-space-options.sh b/t/t6432-merge-recursive-space-options.sh
index b56180ee4a..4eda1dd444 100755
--- a/t/t6432-merge-recursive-space-options.sh
+++ b/t/t6432-merge-recursive-space-options.sh
@@ -2,11 +2,11 @@
 
 test_description='merge-recursive space options
 
-* [master] Clarify
+* [main] Clarify
  ! [remote] Remove cruft
 --
  + [remote] Remove cruft
-*  [master] Clarify
+*  [main] Clarify
 *+ [remote^] Initial revision
 *   ok 1: setup
 '
@@ -87,7 +87,7 @@ test_expect_success 'setup' '
 	mv text.txt+ text.txt &&
 	git commit -a -m "Remove cruft" &&
 
-	git checkout master &&
+	git checkout main &&
 	sed -e "
 			s/\(not in his right mind\),\(.*\)/\1;\2Q/
 			s/Quite correct\(.*\)/It is too correct\1Q/
diff --git a/t/t6433-merge-toplevel.sh b/t/t6433-merge-toplevel.sh
index e29c284b9b..fdbd095cde 100755
--- a/t/t6433-merge-toplevel.sh
+++ b/t/t6433-merge-toplevel.sh
@@ -5,7 +5,7 @@ test_description='"git merge" top-level frontend'
 . ./test-lib.sh
 
 t3033_reset () {
-	git checkout -B master two &&
+	git checkout -B main two &&
 	git branch -f left three &&
 	git branch -f right four
 }
@@ -21,7 +21,7 @@ test_expect_success setup '
 	test_commit four &&
 	git checkout --orphan newroot &&
 	test_commit five &&
-	git checkout master
+	git checkout main
 '
 
 # Local branches
@@ -61,7 +61,7 @@ test_expect_success 'merge octopus, non-fast-forward (ff)' '
 test_expect_success 'merge octopus, fast-forward (does not ff)' '
 	t3033_reset &&
 	git merge left right &&
-	# two (master) is not an ancestor of three (left) and four (right)
+	# two (main) is not an ancestor of three (left) and four (right)
 	test_must_fail git rev-parse --verify HEAD^4 &&
 	git rev-parse HEAD^1 HEAD^2 HEAD^3 | sort >actual &&
 	git rev-parse two three four | sort >expect &&
@@ -118,7 +118,7 @@ test_expect_success 'merge FETCH_HEAD octopus fast-forward (does not ff)' '
 	t3033_reset &&
 	git fetch . left right &&
 	git merge FETCH_HEAD &&
-	# two (master) is not an ancestor of three (left) and four (right)
+	# two (main) is not an ancestor of three (left) and four (right)
 	test_must_fail git rev-parse --verify HEAD^4 &&
 	git rev-parse HEAD^1 HEAD^2 HEAD^3 | sort >actual &&
 	git rev-parse two three four | sort >expect &&
diff --git a/t/t6434-merge-recursive-rename-options.sh b/t/t6434-merge-recursive-rename-options.sh
index 3d9fae68c4..1203984101 100755
--- a/t/t6434-merge-recursive-rename-options.sh
+++ b/t/t6434-merge-recursive-rename-options.sh
@@ -5,11 +5,11 @@ test_description='merge-recursive rename options
 Test rename detection by examining rename/delete conflicts.
 
 * (HEAD -> rename) rename
-| * (master) delete
+| * (main) delete
 |/
 * base
 
-git diff --name-status base master
+git diff --name-status base main
 D	0-old
 D	1-old
 D	2-old
@@ -118,7 +118,7 @@ test_expect_success 'setup repo' '
 	get_expected_stages 2 &&
 	get_expected_stages 3 &&
 	check_50="false" &&
-	tail="HEAD^ -- HEAD master"
+	tail="HEAD^ -- HEAD main"
 '
 
 test_expect_success 'setup thresholds' '
diff --git a/t/t6436-merge-overwrite.sh b/t/t6436-merge-overwrite.sh
index dd9376842f..8efe96dc8c 100755
--- a/t/t6436-merge-overwrite.sh
+++ b/t/t6436-merge-overwrite.sh
@@ -193,7 +193,7 @@ test_expect_success 'set up unborn branch and content' '
 '
 
 test_expect_success 'will not clobber WT/index when merging into unborn' '
-	git merge master &&
+	git merge main &&
 	grep foo tracked-file &&
 	git show :tracked-file >expect &&
 	grep foo expect &&
diff --git a/t/t6437-submodule-merge.sh b/t/t6437-submodule-merge.sh
index 3ead2b726f..d71e9410b9 100755
--- a/t/t6437-submodule-merge.sh
+++ b/t/t6437-submodule-merge.sh
@@ -27,7 +27,7 @@ test_expect_success setup '
 	test_tick &&
 	git commit -m root &&
 
-	git checkout -b a master &&
+	git checkout -b a main &&
 	(cd sub &&
 	 echo A > file &&
 	 git add file &&
@@ -37,7 +37,7 @@ test_expect_success setup '
 	test_tick &&
 	git commit -m a &&
 
-	git checkout -b b master &&
+	git checkout -b b main &&
 	(cd sub &&
 	 echo B > file &&
 	 git add file &&
@@ -254,22 +254,22 @@ test_expect_success 'setup for recursive merge with submodule' '
 	 (cd sub &&
 	  git init &&
 	  test_commit a &&
-	  git checkout -b sub-b master &&
+	  git checkout -b sub-b main &&
 	  test_commit b &&
-	  git checkout -b sub-c master &&
+	  git checkout -b sub-c main &&
 	  test_commit c &&
 	  git checkout -b sub-bc sub-b &&
 	  git merge sub-c &&
 	  git checkout -b sub-cb sub-c &&
 	  git merge sub-b &&
-	  git checkout master) &&
+	  git checkout main) &&
 	 git add sub &&
 	 git commit -m a &&
-	 git checkout -b top-b master &&
+	 git checkout -b top-b main &&
 	 (cd sub && git checkout sub-b) &&
 	 git add sub &&
 	 git commit -m b &&
-	 git checkout -b top-c master &&
+	 git checkout -b top-c main &&
 	 (cd sub && git checkout sub-c) &&
 	 git add sub &&
 	 git commit -m c &&
diff --git a/t/t6439-merge-co-error-msgs.sh b/t/t6439-merge-co-error-msgs.sh
index 5c8894d94f..cd87fe6dd4 100755
--- a/t/t6439-merge-co-error-msgs.sh
+++ b/t/t6439-merge-co-error-msgs.sh
@@ -18,7 +18,7 @@ test_expect_success 'setup' '
 	git add two three four five &&
 	git commit -m Second &&
 
-	git checkout master &&
+	git checkout main &&
 	echo other >two &&
 	echo other >three &&
 	echo other >four &&
@@ -83,7 +83,7 @@ test_expect_success 'cannot switch branches because of local changes' '
 	echo two >rep/two &&
 	git add rep/one rep/two &&
 	git commit -m Fourth &&
-	git checkout master &&
+	git checkout main &&
 	echo uno >rep/one &&
 	echo dos >rep/two &&
 	test_must_fail git checkout branch 2>out &&
@@ -128,7 +128,7 @@ test_expect_success 'not_uptodate_dir porcelain checkout error' '
 	>rep2 &&
 	git add rep rep2 &&
 	git commit -m "added test as a file" &&
-	git checkout master &&
+	git checkout main &&
 	>rep/untracked-file &&
 	>rep2/untracked-file &&
 	test_must_fail git checkout branch 2>out &&
diff --git a/t/t6501-freshen-objects.sh b/t/t6501-freshen-objects.sh
index 8a3bb4105b..2f2b89f229 100755
--- a/t/t6501-freshen-objects.sh
+++ b/t/t6501-freshen-objects.sh
@@ -67,7 +67,7 @@ for repack in '' true; do
 		git checkout -b experiment &&
 		commit abandon &&
 		maybe_repack &&
-		git checkout master &&
+		git checkout main &&
 		git branch -D experiment
 	'
 
diff --git a/t/test-lib.sh b/t/test-lib.sh
index 255eb24e5d..2f9c584fab 100644
--- a/t/test-lib.sh
+++ b/t/test-lib.sh
@@ -263,7 +263,7 @@ case "$TEST_NUMBER" in
 	GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
 	export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 	;;
-[0-5]*|6[0-3]*)
+[0-6]*)
 	GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 	export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 	;;
-- 
gitgitgadget


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH v2 20/27] t7[0-4]*: adjust the references to the default branch name "main"
  2020-11-17 16:12 ` [PATCH v2 00/27] tests: use " Johannes Schindelin via GitGitGadget
                     ` (18 preceding siblings ...)
  2020-11-17 16:12   ` [PATCH v2 19/27] t6[4-9]*: adjust the references to the default branch name "main" Johannes Schindelin via GitGitGadget
@ 2020-11-17 16:12   ` Johannes Schindelin via GitGitGadget
  2020-11-17 16:12   ` [PATCH v2 21/27] t7[5-9]*: " Johannes Schindelin via GitGitGadget
                     ` (8 subsequent siblings)
  28 siblings, 0 replies; 163+ messages in thread
From: Johannes Schindelin via GitGitGadget @ 2020-11-17 16:12 UTC (permalink / raw)
  To: git
  Cc: Felipe Contreras, Ævar Arnfjörð Bjarmason,
	Johannes Schindelin, Jeff King, Johannes Schindelin,
	Johannes Schindelin

From: Johannes Schindelin <johannes.schindelin@gmx.de>

Carefully excluding t7064, which sees independent development elsewhere
at the time of writing, we use `main` as the default branch name in
t7[0-4]*. This trick was performed via

	$ (cd t &&
	   sed -i -e 's/master/main/g' -e 's/MASTER/MAIN/g' \
		-e 's/Master/Main/g' -- t7[0-4]*.sh &&
	   git checkout HEAD -- t7064\*)

This allows us to define `GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main`
for those tests.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
---
 t/t7003-filter-branch.sh                |  40 ++++-----
 t/t7004-tag.sh                          |   8 +-
 t/t7030-verify-tag.sh                   |   2 +-
 t/t7060-wtstatus.sh                     |  26 +++---
 t/t7063-status-untracked-cache.sh       |  14 +--
 t/t7102-reset.sh                        |   6 +-
 t/t7113-post-index-change-hook.sh       |   2 +-
 t/t7201-co.sh                           | 110 ++++++++++++------------
 t/t7400-submodule-basic.sh              |  20 ++---
 t/t7403-submodule-sync.sh               |  10 +--
 t/t7406-submodule-update.sh             |  38 ++++----
 t/t7407-submodule-foreach.sh            |  24 +++---
 t/t7409-submodule-detached-work-tree.sh |   8 +-
 t/t7417-submodule-path-url.sh           |   2 +-
 t/test-lib.sh                           |   4 +-
 15 files changed, 157 insertions(+), 157 deletions(-)

diff --git a/t/t7003-filter-branch.sh b/t/t7003-filter-branch.sh
index 36477cb1f4..e8df682c8d 100755
--- a/t/t7003-filter-branch.sh
+++ b/t/t7003-filter-branch.sh
@@ -13,7 +13,7 @@ test_expect_success 'setup' '
 	mkdir dir &&
 	test_commit dir/D &&
 	test_commit E &&
-	git checkout master &&
+	git checkout main &&
 	test_commit C &&
 	git checkout branch &&
 	git merge C &&
@@ -25,7 +25,7 @@ test_expect_success 'setup' '
 # * G
 # *   Merge commit 'C' into branch
 # |\
-# | * (master) C
+# | * (main) C
 # * | E
 # * | dir/D
 # * | D
@@ -162,15 +162,15 @@ test_expect_success 'subdirectory filter result looks okay' '
 '
 
 test_expect_success 'more setup' '
-	git checkout master &&
+	git checkout main &&
 	mkdir subdir &&
 	echo A > subdir/new &&
 	git add subdir/new &&
 	test_tick &&
-	git commit -m "subdir on master" subdir/new &&
+	git commit -m "subdir on main" subdir/new &&
 	git rm A.t &&
 	test_tick &&
-	git commit -m "again subdir on master" &&
+	git commit -m "again subdir on main" &&
 	git merge branch
 '
 
@@ -199,7 +199,7 @@ test_expect_success 'author information is preserved' '
 	git branch preserved-author &&
 	(sane_unset GIT_AUTHOR_NAME &&
 	 git filter-branch -f --msg-filter "cat; \
-			test \$GIT_COMMIT != $(git rev-parse master) || \
+			test \$GIT_COMMIT != $(git rev-parse main) || \
 			echo Hallo" \
 		preserved-author) &&
 	git rev-list --author="B V Uips" preserved-author >actual &&
@@ -218,7 +218,7 @@ test_expect_success "remove a certain author's commits" '
 		else\
 			git commit-tree \"\$@\";\
 		fi" removed-author &&
-	cnt1=$(git rev-list master | wc -l) &&
+	cnt1=$(git rev-list main | wc -l) &&
 	cnt2=$(git rev-list removed-author | wc -l) &&
 	test $cnt1 -eq $(($cnt2 + 1)) &&
 	git rev-list --author="B V Uips" removed-author >actual &&
@@ -226,7 +226,7 @@ test_expect_success "remove a certain author's commits" '
 '
 
 test_expect_success 'barf on invalid name' '
-	test_must_fail git filter-branch -f master xy-problem &&
+	test_must_fail git filter-branch -f main xy-problem &&
 	test_must_fail git filter-branch -f HEAD^
 '
 
@@ -236,8 +236,8 @@ test_expect_success '"map" works in commit filter' '
 		mapped=\$(map \$parent) &&
 		actual=\$(echo \"\$@\" | sed \"s/^.*-p //\") &&
 		test \$mapped = \$actual &&
-		git commit-tree \"\$@\";" master~2..master &&
-	git rev-parse --verify master
+		git commit-tree \"\$@\";" main~2..main &&
+	git rev-parse --verify main
 '
 
 test_expect_success 'Name needing quotes' '
@@ -256,7 +256,7 @@ test_expect_success 'Name needing quotes' '
 
 test_expect_success 'Subdirectory filter with disappearing trees' '
 	git reset --hard &&
-	git checkout master &&
+	git checkout main &&
 
 	mkdir foo &&
 	touch foo/bar &&
@@ -275,7 +275,7 @@ test_expect_success 'Subdirectory filter with disappearing trees' '
 	git commit -m "Re-adding foo" &&
 
 	git filter-branch -f --subdirectory-filter foo &&
-	git rev-list master >actual &&
+	git rev-list main >actual &&
 	test_line_count = 3 actual
 '
 
@@ -332,7 +332,7 @@ test_expect_success 'Tag name filtering allows slashes in tag names' '
 	test_cmp expect actual
 '
 test_expect_success 'setup --prune-empty comparisons' '
-	git checkout --orphan master-no-a &&
+	git checkout --orphan main-no-a &&
 	git rm -rf . &&
 	unset test_tick &&
 	test_tick &&
@@ -343,7 +343,7 @@ test_expect_success 'setup --prune-empty comparisons' '
 	mkdir dir &&
 	test_commit dir/D dir/D.t dir/D dir/Dx &&
 	test_commit E E.t E Ex &&
-	git checkout master-no-a &&
+	git checkout main-no-a &&
 	test_commit C C.t C Cx &&
 	git checkout branch-no-a &&
 	git merge Cx -m "Merge tag '\''C'\'' into branch" &&
@@ -397,7 +397,7 @@ test_expect_success '--prune-empty is able to prune entire branch' '
 '
 
 test_expect_success '--remap-to-ancestor with filename filters' '
-	git checkout master &&
+	git checkout main &&
 	git reset --hard A &&
 	test_commit add-foo foo 1 &&
 	git branch moved-foo &&
@@ -407,15 +407,15 @@ test_expect_success '--remap-to-ancestor with filename filters' '
 	git branch moved-bar &&
 	test_commit change-foo foo 2 &&
 	git filter-branch -f --remap-to-ancestor \
-		moved-foo moved-bar A..master \
+		moved-foo moved-bar A..main \
 		-- -- foo &&
 	test $(git rev-parse moved-foo) = $(git rev-parse moved-bar) &&
-	test $(git rev-parse moved-foo) = $(git rev-parse master^) &&
+	test $(git rev-parse moved-foo) = $(git rev-parse main^) &&
 	test $orig_invariant = $(git rev-parse invariant)
 '
 
 test_expect_success 'automatic remapping to ancestor with filename filters' '
-	git checkout master &&
+	git checkout main &&
 	git reset --hard A &&
 	test_commit add-foo2 foo 1 &&
 	git branch moved-foo2 &&
@@ -425,10 +425,10 @@ test_expect_success 'automatic remapping to ancestor with filename filters' '
 	git branch moved-bar2 &&
 	test_commit change-foo2 foo 2 &&
 	git filter-branch -f \
-		moved-foo2 moved-bar2 A..master \
+		moved-foo2 moved-bar2 A..main \
 		-- -- foo &&
 	test $(git rev-parse moved-foo2) = $(git rev-parse moved-bar2) &&
-	test $(git rev-parse moved-foo2) = $(git rev-parse master^) &&
+	test $(git rev-parse moved-foo2) = $(git rev-parse main^) &&
 	test $orig_invariant = $(git rev-parse invariant2)
 '
 
diff --git a/t/t7004-tag.sh b/t/t7004-tag.sh
index 05f411c821..630fcde90b 100755
--- a/t/t7004-tag.sh
+++ b/t/t7004-tag.sh
@@ -1583,7 +1583,7 @@ test_expect_success 'checking that branch head with --no-contains lists all but
 "
 
 test_expect_success 'merging original branch into this branch' '
-	git merge --strategy=ours master &&
+	git merge --strategy=ours main &&
         git tag v4.0
 '
 
@@ -1944,15 +1944,15 @@ test_expect_success ULIMIT_STACK_SIZE '--contains and --no-contains work in a de
 	i=1 &&
 	while test $i -lt 8000
 	do
-		echo "commit refs/heads/master
+		echo "commit refs/heads/main
 committer A U Thor <author@example.com> $((1000000000 + $i * 100)) +0200
 data <<EOF
 commit #$i
 EOF"
-		test $i = 1 && echo "from refs/heads/master^0"
+		test $i = 1 && echo "from refs/heads/main^0"
 		i=$(($i + 1))
 	done | git fast-import &&
-	git checkout master &&
+	git checkout main &&
 	git tag far-far-away HEAD^ &&
 	run_with_limited_stack git tag --contains HEAD >actual &&
 	test_must_be_empty actual &&
diff --git a/t/t7030-verify-tag.sh b/t/t7030-verify-tag.sh
index 5c5bc32ccb..7a70df79a2 100755
--- a/t/t7030-verify-tag.sh
+++ b/t/t7030-verify-tag.sh
@@ -17,7 +17,7 @@ test_expect_success GPG 'create signed tags' '
 	echo 3 >elif && git add elif &&
 	test_tick && git commit -m "third on side" &&
 
-	git checkout master &&
+	git checkout main &&
 	test_tick && git merge -S side &&
 	git tag -s -m merge merge &&
 
diff --git a/t/t7060-wtstatus.sh b/t/t7060-wtstatus.sh
index d5218743e9..cb4e104e4b 100755
--- a/t/t7060-wtstatus.sh
+++ b/t/t7060-wtstatus.sh
@@ -51,7 +51,7 @@ EOF
 		git checkout -b side HEAD^ &&
 		git rm foo &&
 		git commit -m delete &&
-		test_must_fail git merge master &&
+		test_must_fail git merge main &&
 		test_must_fail git commit --dry-run >../actual &&
 		test_i18ncmp ../expect ../actual &&
 		git status >../actual &&
@@ -124,18 +124,18 @@ test_expect_success 'git diff-index --cached -C shows 2 copies + 1 unmerged' '
 
 test_expect_success 'status when conflicts with add and rm advice (deleted by them)' '
 	git reset --hard &&
-	git checkout master &&
+	git checkout main &&
 	test_commit init main.txt init &&
 	git checkout -b second_branch &&
 	git rm main.txt &&
 	git commit -m "main.txt deleted on second_branch" &&
 	test_commit second conflict.txt second &&
-	git checkout master &&
+	git checkout main &&
 	test_commit on_second main.txt on_second &&
-	test_commit master conflict.txt master &&
+	test_commit main conflict.txt main &&
 	test_must_fail git merge second_branch &&
 	cat >expected <<\EOF &&
-On branch master
+On branch main
 You have unmerged paths.
   (fix conflicts and run "git commit")
   (use "git merge --abort" to abort the merge)
@@ -157,8 +157,8 @@ test_expect_success 'prepare for conflicts' '
 	git checkout -b conflict &&
 	test_commit one main.txt one &&
 	git branch conflict_second &&
-	git mv main.txt sub_master.txt &&
-	git commit -m "main.txt renamed in sub_master.txt" &&
+	git mv main.txt sub_main.txt &&
+	git commit -m "main.txt renamed in sub_main.txt" &&
 	git checkout conflict_second &&
 	git mv main.txt sub_second.txt &&
 	git commit -m "main.txt renamed in sub_second.txt"
@@ -176,7 +176,7 @@ You have unmerged paths.
 Unmerged paths:
   (use "git add/rm <file>..." as appropriate to mark resolution)
 	both deleted:    main.txt
-	added by them:   sub_master.txt
+	added by them:   sub_main.txt
 	added by us:     sub_second.txt
 
 no changes added to commit (use "git add" and/or "git commit -a")
@@ -189,7 +189,7 @@ EOF
 test_expect_success 'status when conflicts with only rm advice (both deleted)' '
 	git reset --hard conflict_second &&
 	test_must_fail git merge conflict &&
-	git add sub_master.txt &&
+	git add sub_main.txt &&
 	git add sub_second.txt &&
 	cat >expected <<\EOF &&
 On branch conflict_second
@@ -198,7 +198,7 @@ You have unmerged paths.
   (use "git merge --abort" to abort the merge)
 
 Changes to be committed:
-	new file:   sub_master.txt
+	new file:   sub_main.txt
 
 Unmerged paths:
   (use "git rm <file>..." to mark resolution)
@@ -209,12 +209,12 @@ EOF
 	git status --untracked-files=no >actual &&
 	test_i18ncmp expected actual &&
 	git reset --hard &&
-	git checkout master
+	git checkout main
 '
 
 test_expect_success 'status --branch with detached HEAD' '
 	git reset --hard &&
-	git checkout master^0 &&
+	git checkout main^0 &&
 	git status --branch --porcelain >actual &&
 	cat >expected <<-EOF &&
 	## HEAD (no branch)
@@ -230,7 +230,7 @@ test_expect_success 'status --branch with detached HEAD' '
 ## Duplicate the above test and verify --porcelain=v1 arg parsing.
 test_expect_success 'status --porcelain=v1 --branch with detached HEAD' '
 	git reset --hard &&
-	git checkout master^0 &&
+	git checkout main^0 &&
 	git status --branch --porcelain=v1 >actual &&
 	cat >expected <<-EOF &&
 	## HEAD (no branch)
diff --git a/t/t7063-status-untracked-cache.sh b/t/t7063-status-untracked-cache.sh
index a682a3d826..3b41d563d5 100755
--- a/t/t7063-status-untracked-cache.sh
+++ b/t/t7063-status-untracked-cache.sh
@@ -475,7 +475,7 @@ EOF
 test_expect_success 'set up sparse checkout' '
 	echo "done/[a-z]*" >.git/info/sparse-checkout &&
 	test_config core.sparsecheckout true &&
-	git checkout master &&
+	git checkout main &&
 	git update-index --force-untracked-cache &&
 	git status --porcelain >/dev/null && # prime the cache
 	test_path_is_missing done/.gitignore &&
@@ -734,13 +734,13 @@ test_expect_success 'test ident field is working' '
 test_expect_success 'untracked cache survives a checkout' '
 	git commit --allow-empty -m empty &&
 	test-tool dump-untracked-cache >../before &&
-	test_when_finished  "git checkout master" &&
+	test_when_finished  "git checkout main" &&
 	git checkout -b other_branch &&
 	test-tool dump-untracked-cache >../after &&
 	test_cmp ../before ../after &&
 	test_commit test &&
 	test-tool dump-untracked-cache >../before &&
-	git checkout master &&
+	git checkout main &&
 	test-tool dump-untracked-cache >../after &&
 	test_cmp ../before ../after
 '
@@ -775,7 +775,7 @@ test_expect_success SYMLINKS '"status" after symlink replacement should be clean
 	git checkout HEAD~ &&
 	status_is_clean &&
 	status_is_clean &&
-	git checkout master &&
+	git checkout main &&
 	avoid_racy &&
 	status_is_clean &&
 	status_is_clean
@@ -786,7 +786,7 @@ test_expect_success SYMLINKS '"status" after symlink replacement should be clean
 	git checkout HEAD~ &&
 	status_is_clean &&
 	status_is_clean &&
-	git checkout master &&
+	git checkout main &&
 	avoid_racy &&
 	status_is_clean &&
 	status_is_clean
@@ -810,7 +810,7 @@ test_expect_success '"status" after file replacement should be clean with UC=tru
 	git checkout HEAD~ &&
 	status_is_clean &&
 	status_is_clean &&
-	git checkout master &&
+	git checkout main &&
 	avoid_racy &&
 	status_is_clean &&
 	test-tool dump-untracked-cache >../actual &&
@@ -828,7 +828,7 @@ test_expect_success '"status" after file replacement should be clean with UC=fal
 	git checkout HEAD~ &&
 	status_is_clean &&
 	status_is_clean &&
-	git checkout master &&
+	git checkout main &&
 	avoid_racy &&
 	status_is_clean &&
 	status_is_clean
diff --git a/t/t7102-reset.sh b/t/t7102-reset.sh
index b1affb001f..9dfed50354 100755
--- a/t/t7102-reset.sh
+++ b/t/t7102-reset.sh
@@ -145,7 +145,7 @@ test_expect_success 'trying to do reset --soft with pending merge should fail' '
 	printf "1st line 2nd file\n2nd line 2nd file\n3rd line" >secondfile &&
 	git commit -a -m "the change in branch2" &&
 
-	git checkout master &&
+	git checkout main &&
 	git branch -D branch1 branch2 &&
 	check_changes $head5
 '
@@ -167,7 +167,7 @@ test_expect_success 'trying to do reset --soft with pending checkout merge shoul
 	printf "1st line 2nd file\n2nd line 2nd file\n3rd line" >secondfile &&
 	git commit -a -m "the line in branch3" &&
 
-	git checkout master &&
+	git checkout main &&
 	git branch -D branch3 branch4 &&
 	check_changes $head5
 '
@@ -380,7 +380,7 @@ test_expect_success '--hard reset to ORIG_HEAD should clear a fast-forward merge
 	git reset --hard ORIG_HEAD &&
 	check_changes $head5 &&
 
-	git checkout master &&
+	git checkout main &&
 	git branch -D branch1 branch2 &&
 	check_changes $head5
 '
diff --git a/t/t7113-post-index-change-hook.sh b/t/t7113-post-index-change-hook.sh
index f011ad7eec..2e38428176 100755
--- a/t/t7113-post-index-change-hook.sh
+++ b/t/t7113-post-index-change-hook.sh
@@ -85,7 +85,7 @@ test_expect_success 'test checkout and reset trigger the hook' '
 	EOF
 	: force index to be dirty &&
 	test-tool chmtime +60 dir1/file1.txt &&
-	git checkout master &&
+	git checkout main &&
 	test_path_is_file testsuccess && rm -f testsuccess &&
 	test_path_is_missing testfailure &&
 	test-tool chmtime +60 dir1/file1.txt &&
diff --git a/t/t7201-co.sh b/t/t7201-co.sh
index b36a93056f..3ab219a04e 100755
--- a/t/t7201-co.sh
+++ b/t/t7201-co.sh
@@ -5,10 +5,10 @@
 
 test_description='git checkout tests.
 
-Creates master, forks renamer and side branches from it.
+Creates main, forks renamer and side branches from it.
 Test switching across them.
 
-  ! [master] Initial A one, A two
+  ! [main] Initial A one, A two
    * [renamer] Renamer R one->uno, M two
     ! [side] Side M one, D two, A three
      ! [simple] Simple D one, M two
@@ -16,7 +16,7 @@ Test switching across them.
      + [simple] Simple D one, M two
     +  [side] Side M one, D two, A three
    *   [renamer] Renamer R one->uno, M two
-  +*++ [master] Initial A one, A two
+  +*++ [main] Initial A one, A two
 
 '
 
@@ -46,27 +46,27 @@ test_expect_success setup '
 	fill a b c d e f >two &&
 	git commit -a -m "Renamer R one->uno, M two" &&
 
-	git checkout -b side master &&
+	git checkout -b side main &&
 	fill 1 2 3 4 5 6 7 >one &&
 	fill A B C D E >three &&
 	rm -f two &&
 	git update-index --add --remove one two three &&
 	git commit -m "Side M one, D two, A three" &&
 
-	git checkout -b simple master &&
+	git checkout -b simple main &&
 	rm -f one &&
 	fill a c e >two &&
 	git commit -a -m "Simple D one, M two" &&
 
-	git checkout master
+	git checkout main
 '
 
 test_expect_success 'checkout from non-existing branch' '
-	git checkout -b delete-me master &&
+	git checkout -b delete-me main &&
 	git update-ref -d --no-deref refs/heads/delete-me &&
 	test refs/heads/delete-me = "$(git symbolic-ref HEAD)" &&
-	git checkout master &&
-	test refs/heads/master = "$(git symbolic-ref HEAD)"
+	git checkout main &&
+	test refs/heads/main = "$(git symbolic-ref HEAD)"
 '
 
 test_expect_success 'checkout with dirty tree without -m' '
@@ -81,7 +81,7 @@ test_expect_success 'checkout with dirty tree without -m' '
 '
 
 test_expect_success 'checkout with unrelated dirty tree without -m' '
-	git checkout -f master &&
+	git checkout -f main &&
 	fill 0 1 2 3 4 5 6 7 8 >same &&
 	cp same kept &&
 	git checkout side >messages &&
@@ -91,7 +91,7 @@ test_expect_success 'checkout with unrelated dirty tree without -m' '
 '
 
 test_expect_success 'checkout -m with dirty tree' '
-	git checkout -f master &&
+	git checkout -f main &&
 	git clean -f &&
 
 	fill 0 1 2 3 4 5 6 7 8 >one &&
@@ -102,9 +102,9 @@ test_expect_success 'checkout -m with dirty tree' '
 	printf "M\t%s\n" one >expect.messages &&
 	test_cmp expect.messages messages &&
 
-	fill "M	one" "A	three" "D	two" >expect.master &&
-	git diff --name-status master >current.master &&
-	test_cmp expect.master current.master &&
+	fill "M	one" "A	three" "D	two" >expect.main &&
+	git diff --name-status main >current.main &&
+	test_cmp expect.main current.main &&
 
 	fill "M	one" >expect.side &&
 	git diff --name-status side >current.side &&
@@ -115,7 +115,7 @@ test_expect_success 'checkout -m with dirty tree' '
 '
 
 test_expect_success 'checkout -m with dirty tree, renamed' '
-	git checkout -f master && git clean -f &&
+	git checkout -f main && git clean -f &&
 
 	fill 1 2 3 4 5 7 8 >one &&
 	if git checkout renamer
@@ -135,7 +135,7 @@ test_expect_success 'checkout -m with dirty tree, renamed' '
 '
 
 test_expect_success 'checkout -m with merge conflict' '
-	git checkout -f master && git clean -f &&
+	git checkout -f main && git clean -f &&
 
 	fill 1 T 3 4 5 6 S 8 >one &&
 	if git checkout renamer
@@ -148,7 +148,7 @@ test_expect_success 'checkout -m with merge conflict' '
 
 	git checkout -m renamer &&
 
-	git diff master:one :3:uno |
+	git diff main:one :3:uno |
 	sed -e "1,/^@@/d" -e "/^ /d" -e "s/^-/d/" -e "s/^+/a/" >current &&
 	fill d2 aT d7 aS >expect &&
 	test_cmp expect current &&
@@ -157,7 +157,7 @@ test_expect_success 'checkout -m with merge conflict' '
 '
 
 test_expect_success 'format of merge conflict from checkout -m' '
-	git checkout -f master &&
+	git checkout -f main &&
 	git clean -f &&
 
 	fill b d >two &&
@@ -181,7 +181,7 @@ test_expect_success 'format of merge conflict from checkout -m' '
 '
 
 test_expect_success 'checkout --merge --conflict=diff3 <branch>' '
-	git checkout -f master &&
+	git checkout -f main &&
 	git reset --hard &&
 	git clean -f &&
 
@@ -193,7 +193,7 @@ test_expect_success 'checkout --merge --conflict=diff3 <branch>' '
 	a
 	c
 	e
-	||||||| master
+	||||||| main
 	a
 	b
 	c
@@ -208,7 +208,7 @@ test_expect_success 'checkout --merge --conflict=diff3 <branch>' '
 '
 
 test_expect_success 'switch to another branch while carrying a deletion' '
-	git checkout -f master &&
+	git checkout -f main &&
 	git reset --hard &&
 	git clean -f &&
 	git rm two &&
@@ -229,7 +229,7 @@ test_expect_success 'checkout to detach HEAD (with advice declined)' '
 	test_i18ngrep "HEAD is now at $rev" messages &&
 	test_line_count = 1 messages &&
 	H=$(git rev-parse --verify HEAD) &&
-	M=$(git show-ref -s --verify refs/heads/master) &&
+	M=$(git show-ref -s --verify refs/heads/main) &&
 	test "z$H" = "z$M" &&
 	if git symbolic-ref HEAD >/dev/null 2>&1
 	then
@@ -249,7 +249,7 @@ test_expect_success 'checkout to detach HEAD' '
 	grep "HEAD is now at $rev" messages &&
 	test_line_count -gt 1 messages &&
 	H=$(git rev-parse --verify HEAD) &&
-	M=$(git show-ref -s --verify refs/heads/master) &&
+	M=$(git show-ref -s --verify refs/heads/main) &&
 	test "z$H" = "z$M" &&
 	if git symbolic-ref HEAD >/dev/null 2>&1
 	then
@@ -261,11 +261,11 @@ test_expect_success 'checkout to detach HEAD' '
 '
 
 test_expect_success 'checkout to detach HEAD with branchname^' '
-	git checkout -f master &&
+	git checkout -f main &&
 	git clean -f &&
 	git checkout renamer^ &&
 	H=$(git rev-parse --verify HEAD) &&
-	M=$(git show-ref -s --verify refs/heads/master) &&
+	M=$(git show-ref -s --verify refs/heads/main) &&
 	test "z$H" = "z$M" &&
 	if git symbolic-ref HEAD >/dev/null 2>&1
 	then
@@ -277,11 +277,11 @@ test_expect_success 'checkout to detach HEAD with branchname^' '
 '
 
 test_expect_success 'checkout to detach HEAD with :/message' '
-	git checkout -f master &&
+	git checkout -f main &&
 	git clean -f &&
 	git checkout ":/Initial" &&
 	H=$(git rev-parse --verify HEAD) &&
-	M=$(git show-ref -s --verify refs/heads/master) &&
+	M=$(git show-ref -s --verify refs/heads/main) &&
 	test "z$H" = "z$M" &&
 	if git symbolic-ref HEAD >/dev/null 2>&1
 	then
@@ -293,11 +293,11 @@ test_expect_success 'checkout to detach HEAD with :/message' '
 '
 
 test_expect_success 'checkout to detach HEAD with HEAD^0' '
-	git checkout -f master &&
+	git checkout -f main &&
 	git clean -f &&
 	git checkout HEAD^0 &&
 	H=$(git rev-parse --verify HEAD) &&
-	M=$(git show-ref -s --verify refs/heads/master) &&
+	M=$(git show-ref -s --verify refs/heads/main) &&
 	test "z$H" = "z$M" &&
 	if git symbolic-ref HEAD >/dev/null 2>&1
 	then
@@ -310,13 +310,13 @@ test_expect_success 'checkout to detach HEAD with HEAD^0' '
 
 test_expect_success 'checkout with ambiguous tag/branch names' '
 	git tag both side &&
-	git branch both master &&
+	git branch both main &&
 	git reset --hard &&
-	git checkout master &&
+	git checkout main &&
 
 	git checkout both &&
 	H=$(git rev-parse --verify HEAD) &&
-	M=$(git show-ref -s --verify refs/heads/master) &&
+	M=$(git show-ref -s --verify refs/heads/main) &&
 	test "z$H" = "z$M" &&
 	name=$(git symbolic-ref HEAD 2>/dev/null) &&
 	test "z$name" = zrefs/heads/both
@@ -324,12 +324,12 @@ test_expect_success 'checkout with ambiguous tag/branch names' '
 
 test_expect_success 'checkout with ambiguous tag/branch names' '
 	git reset --hard &&
-	git checkout master &&
+	git checkout main &&
 
 	git tag frotz side &&
-	git branch frotz master &&
+	git branch frotz main &&
 	git reset --hard &&
-	git checkout master &&
+	git checkout main &&
 
 	git checkout tags/frotz &&
 	H=$(git rev-parse --verify HEAD) &&
@@ -346,7 +346,7 @@ test_expect_success 'checkout with ambiguous tag/branch names' '
 
 test_expect_success 'switch branches while in subdirectory' '
 	git reset --hard &&
-	git checkout master &&
+	git checkout main &&
 
 	mkdir subs &&
 	git -C subs checkout side &&
@@ -362,7 +362,7 @@ test_expect_success 'checkout specific path while in subdirectory' '
 	git add subs/bero &&
 	git commit -m "add subs/bero" &&
 
-	git checkout master &&
+	git checkout main &&
 	mkdir -p subs &&
 	git -C subs checkout side -- bero &&
 	test -f subs/bero
@@ -370,7 +370,7 @@ test_expect_success 'checkout specific path while in subdirectory' '
 
 test_expect_success 'checkout w/--track sets up tracking' '
     git config branch.autosetupmerge false &&
-    git checkout master &&
+    git checkout main &&
     git checkout --track -b track1 &&
     test "$(git config branch.track1.remote)" &&
     test "$(git config branch.track1.merge)"
@@ -379,40 +379,40 @@ test_expect_success 'checkout w/--track sets up tracking' '
 test_expect_success 'checkout w/autosetupmerge=always sets up tracking' '
     test_when_finished git config branch.autosetupmerge false &&
     git config branch.autosetupmerge always &&
-    git checkout master &&
+    git checkout main &&
     git checkout -b track2 &&
     test "$(git config branch.track2.remote)" &&
     test "$(git config branch.track2.merge)"
 '
 
 test_expect_success 'checkout w/--track from non-branch HEAD fails' '
-    git checkout master^0 &&
+    git checkout main^0 &&
     test_must_fail git symbolic-ref HEAD &&
     test_must_fail git checkout --track -b track &&
     test_must_fail git rev-parse --verify track &&
     test_must_fail git symbolic-ref HEAD &&
-    test "z$(git rev-parse master^0)" = "z$(git rev-parse HEAD)"
+    test "z$(git rev-parse main^0)" = "z$(git rev-parse HEAD)"
 '
 
 test_expect_success 'checkout w/--track from tag fails' '
-    git checkout master^0 &&
+    git checkout main^0 &&
     test_must_fail git symbolic-ref HEAD &&
     test_must_fail git checkout --track -b track frotz &&
     test_must_fail git rev-parse --verify track &&
     test_must_fail git symbolic-ref HEAD &&
-    test "z$(git rev-parse master^0)" = "z$(git rev-parse HEAD)"
+    test "z$(git rev-parse main^0)" = "z$(git rev-parse HEAD)"
 '
 
 test_expect_success 'detach a symbolic link HEAD' '
-    git checkout master &&
+    git checkout main &&
     git config --bool core.prefersymlinkrefs yes &&
     git checkout side &&
-    git checkout master &&
+    git checkout main &&
     it=$(git symbolic-ref HEAD) &&
-    test "z$it" = zrefs/heads/master &&
-    here=$(git rev-parse --verify refs/heads/master) &&
+    test "z$it" = zrefs/heads/main &&
+    here=$(git rev-parse --verify refs/heads/main) &&
     git checkout side^ &&
-    test "z$(git rev-parse --verify refs/heads/master)" = "z$here"
+    test "z$(git rev-parse --verify refs/heads/main)" = "z$here"
 '
 
 test_expect_success 'checkout with --track fakes a sensible -b <name>' '
@@ -423,13 +423,13 @@ test_expect_success 'checkout with --track fakes a sensible -b <name>' '
     test "refs/heads/koala/bear" = "$(git symbolic-ref HEAD)" &&
     test "$(git rev-parse HEAD)" = "$(git rev-parse renamer)" &&
 
-    git checkout master && git branch -D koala/bear &&
+    git checkout main && git branch -D koala/bear &&
 
     git checkout --track refs/remotes/origin/koala/bear &&
     test "refs/heads/koala/bear" = "$(git symbolic-ref HEAD)" &&
     test "$(git rev-parse HEAD)" = "$(git rev-parse renamer)" &&
 
-    git checkout master && git branch -D koala/bear &&
+    git checkout main && git branch -D koala/bear &&
 
     git checkout --track remotes/origin/koala/bear &&
     test "refs/heads/koala/bear" = "$(git symbolic-ref HEAD)" &&
@@ -582,17 +582,17 @@ test_expect_success 'checkout --conflict=diff3' '
 '
 
 test_expect_success 'failing checkout -b should not break working tree' '
-	git reset --hard master &&
-	git symbolic-ref HEAD refs/heads/master &&
+	git reset --hard main &&
+	git symbolic-ref HEAD refs/heads/main &&
 	test_must_fail git checkout -b renamer side^ &&
-	test $(git symbolic-ref HEAD) = refs/heads/master &&
+	test $(git symbolic-ref HEAD) = refs/heads/main &&
 	git diff --exit-code &&
 	git diff --cached --exit-code
 '
 
 test_expect_success 'switch out of non-branch' '
-	git reset --hard master &&
-	git checkout master^0 &&
+	git reset --hard main &&
+	git checkout main^0 &&
 	echo modified >one &&
 	test_must_fail git checkout renamer 2>error.log &&
 	! grep "^Previous HEAD" error.log
diff --git a/t/t7400-submodule-basic.sh b/t/t7400-submodule-basic.sh
index fec7e0299d..ce320807d4 100755
--- a/t/t7400-submodule-basic.sh
+++ b/t/t7400-submodule-basic.sh
@@ -124,7 +124,7 @@ inspect() {
 }
 
 test_expect_success 'submodule add' '
-	echo "refs/heads/master" >expect &&
+	echo "refs/heads/main" >expect &&
 
 	(
 		cd addtest &&
@@ -223,7 +223,7 @@ test_expect_success 'submodule add --branch' '
 	echo "refs/heads/initial" >expect-head &&
 	cat <<-\EOF >expect-heads &&
 	refs/heads/initial
-	refs/heads/master
+	refs/heads/main
 	EOF
 
 	(
@@ -241,7 +241,7 @@ test_expect_success 'submodule add --branch' '
 '
 
 test_expect_success 'submodule add with ./ in path' '
-	echo "refs/heads/master" >expect &&
+	echo "refs/heads/main" >expect &&
 
 	(
 		cd addtest &&
@@ -257,7 +257,7 @@ test_expect_success 'submodule add with ./ in path' '
 '
 
 test_expect_success 'submodule add with /././ in path' '
-	echo "refs/heads/master" >expect &&
+	echo "refs/heads/main" >expect &&
 
 	(
 		cd addtest &&
@@ -273,7 +273,7 @@ test_expect_success 'submodule add with /././ in path' '
 '
 
 test_expect_success 'submodule add with // in path' '
-	echo "refs/heads/master" >expect &&
+	echo "refs/heads/main" >expect &&
 
 	(
 		cd addtest &&
@@ -289,7 +289,7 @@ test_expect_success 'submodule add with // in path' '
 '
 
 test_expect_success 'submodule add with /.. in path' '
-	echo "refs/heads/master" >expect &&
+	echo "refs/heads/main" >expect &&
 
 	(
 		cd addtest &&
@@ -305,7 +305,7 @@ test_expect_success 'submodule add with /.. in path' '
 '
 
 test_expect_success 'submodule add with ./, /.. and // in path' '
-	echo "refs/heads/master" >expect &&
+	echo "refs/heads/main" >expect &&
 
 	(
 		cd addtest &&
@@ -335,7 +335,7 @@ test_expect_success !CYGWIN 'submodule add with \\ in path' '
 '
 
 test_expect_success 'submodule add in subdirectory' '
-	echo "refs/heads/master" >expect &&
+	echo "refs/heads/main" >expect &&
 
 	mkdir addtest/sub &&
 	(
@@ -557,7 +557,7 @@ test_expect_success 'status should be "up-to-date" after update' '
 
 test_expect_success 'checkout superproject with subproject already present' '
 	git checkout initial &&
-	git checkout master
+	git checkout main
 '
 
 test_expect_success 'apply submodule diff' '
@@ -574,7 +574,7 @@ test_expect_success 'apply submodule diff' '
 	git checkout second &&
 	git apply --index P.diff &&
 
-	git diff --cached master >staged &&
+	git diff --cached main >staged &&
 	test_must_be_empty staged
 '
 
diff --git a/t/t7403-submodule-sync.sh b/t/t7403-submodule-sync.sh
index 0726799e74..848d4e7db7 100755
--- a/t/t7403-submodule-sync.sh
+++ b/t/t7403-submodule-sync.sh
@@ -78,7 +78,7 @@ test_expect_success 'change submodule url' '
 	(
 		cd super &&
 		cd submodule &&
-		git checkout master &&
+		git checkout main &&
 		git pull
 	) &&
 	mv submodule moved-submodule &&
@@ -112,7 +112,7 @@ test_expect_success '"git submodule sync" should update submodule URLs' '
 	)" &&
 	(
 		cd super-clone/submodule &&
-		git checkout master &&
+		git checkout main &&
 		git pull
 	) &&
 	(
@@ -140,7 +140,7 @@ test_expect_success '"git submodule sync --recursive" should update all submodul
 	)" &&
 	(
 		cd super-clone/submodule/sub-submodule &&
-		git checkout master &&
+		git checkout main &&
 		git pull
 	)
 '
@@ -168,7 +168,7 @@ test_expect_success '"git submodule sync" should update submodule URLs - subdire
 	)" &&
 	(
 		cd super-clone/submodule &&
-		git checkout master &&
+		git checkout main &&
 		git pull
 	) &&
 	(
@@ -199,7 +199,7 @@ test_expect_success '"git submodule sync --recursive" should update all submodul
 	)" &&
 	(
 		cd super-clone/submodule/sub-submodule &&
-		git checkout master &&
+		git checkout main &&
 		git pull
 	)
 '
diff --git a/t/t7406-submodule-update.sh b/t/t7406-submodule-update.sh
index acb8766ac2..87097846cb 100755
--- a/t/t7406-submodule-update.sh
+++ b/t/t7406-submodule-update.sh
@@ -14,10 +14,10 @@ submodule and "git submodule update --rebase/--merge" does not detach the HEAD.
 
 compare_head()
 {
-    sha_master=$(git rev-list --max-count=1 master)
+    sha_main=$(git rev-list --max-count=1 main)
     sha_head=$(git rev-list --max-count=1 HEAD)
 
-    test "$sha_master" = "$sha_head"
+    test "$sha_main" = "$sha_head"
 }
 
 
@@ -262,14 +262,14 @@ test_expect_success 'submodule update --remote should fetch upstream changes wit
 		cd super &&
 		git submodule update --remote --force submodule &&
 		git -C submodule log -1 --oneline >actual &&
-		git -C ../submodule log -1 --oneline master >expect &&
+		git -C ../submodule log -1 --oneline main >expect &&
 		test_cmp expect actual &&
 		git checkout -b test-branch &&
 		git submodule update --remote --force submodule &&
 		git -C submodule log -1 --oneline >actual &&
 		git -C ../submodule log -1 --oneline test-branch >expect &&
 		test_cmp expect actual &&
-		git checkout master &&
+		git checkout main &&
 		git branch -d test-branch &&
 		git reset --hard HEAD^
 	)
@@ -282,7 +282,7 @@ test_expect_success 'local config should override .gitmodules branch' '
 	 git add file &&
 	 test_tick &&
 	 git commit -m "upstream line5" &&
-	 git checkout master
+	 git checkout main
 	) &&
 	(cd super &&
 	 git config submodule.submodule.branch test-branch &&
@@ -292,9 +292,9 @@ test_expect_success 'local config should override .gitmodules branch' '
 	)
 '
 
-test_expect_success 'submodule update --rebase staying on master' '
+test_expect_success 'submodule update --rebase staying on main' '
 	(cd super/submodule &&
-	  git checkout master
+	  git checkout main
 	) &&
 	(cd super &&
 	 (cd submodule &&
@@ -306,7 +306,7 @@ test_expect_success 'submodule update --rebase staying on master' '
 	)
 '
 
-test_expect_success 'submodule update --merge staying on master' '
+test_expect_success 'submodule update --merge staying on main' '
 	(cd super/submodule &&
 	  git reset --hard HEAD~1
 	) &&
@@ -609,7 +609,7 @@ test_expect_success 'submodule update - update=none in .git/config' '
 	(cd super &&
 	 git config submodule.submodule.update none &&
 	 (cd submodule &&
-	  git checkout master &&
+	  git checkout main &&
 	  compare_head
 	 ) &&
 	 git diff --name-only >out &&
@@ -629,7 +629,7 @@ test_expect_success 'submodule update - update=none in .git/config but --checkou
 	(cd super &&
 	 git config submodule.submodule.update none &&
 	 (cd submodule &&
-	  git checkout master &&
+	  git checkout main &&
 	  compare_head
 	 ) &&
 	 git diff --name-only >out &&
@@ -689,7 +689,7 @@ test_expect_success 'submodule update continues after checkout error' '
 test_expect_success 'submodule update continues after recursive checkout error' '
 	(cd super &&
 	 git reset --hard HEAD &&
-	 git checkout master &&
+	 git checkout main &&
 	 git submodule update &&
 	 (cd submodule &&
 	  git submodule add ../submodule subsubmodule &&
@@ -733,7 +733,7 @@ test_expect_success 'submodule update continues after recursive checkout error'
 
 test_expect_success 'submodule update exit immediately in case of merge conflict' '
 	(cd super &&
-	 git checkout master &&
+	 git checkout main &&
 	 git reset --hard HEAD &&
 	 (cd submodule &&
 	  (cd subsubmodule &&
@@ -751,7 +751,7 @@ test_expect_success 'submodule update exit immediately in case of merge conflict
 	 git add submodule2 &&
 	 git commit -m "two_new_submodule_commits" &&
 	 (cd submodule &&
-	  git checkout master &&
+	  git checkout main &&
 	  test_commit "conflict" file &&
 	  echo "conflict" > file
 	 ) &&
@@ -770,7 +770,7 @@ test_expect_success 'submodule update exit immediately in case of merge conflict
 
 test_expect_success 'submodule update exit immediately after recursive rebase error' '
 	(cd super &&
-	 git checkout master &&
+	 git checkout main &&
 	 git reset --hard HEAD &&
 	 (cd submodule &&
 	  git reset --hard HEAD &&
@@ -786,7 +786,7 @@ test_expect_success 'submodule update exit immediately after recursive rebase er
 	 git add submodule2 &&
 	 git commit -m "two_new_submodule_commits" &&
 	 (cd submodule &&
-	  git checkout master &&
+	  git checkout main &&
 	  test_commit "conflict2" file &&
 	  echo "conflict" > file
 	 ) &&
@@ -878,21 +878,21 @@ test_expect_success 'submodule update places git-dir in superprojects git-dir re
 	git clone subsubsuper_update_r subsubsuper_update_r2 &&
 	(cd subsubsuper_update_r2 &&
 	 test_commit "update_subsubsuper" file &&
-	 git push origin master
+	 git push origin main
 	) &&
 	git clone subsuper_update_r subsuper_update_r2 &&
 	(cd subsuper_update_r2 &&
 	 test_commit "update_subsuper" file &&
 	 git submodule add ../subsubsuper_update_r subsubmodule &&
 	 git commit -am "subsubmodule" &&
-	 git push origin master
+	 git push origin main
 	) &&
 	git clone super_update_r super_update_r2 &&
 	(cd super_update_r2 &&
 	 test_commit "update_super" file &&
 	 git submodule add ../subsuper_update_r submodule &&
 	 git commit -am "submodule" &&
-	 git push origin master
+	 git push origin main
 	) &&
 	rm -rf super_update_r2 &&
 	git clone super_update_r super_update_r2 &&
@@ -911,7 +911,7 @@ test_expect_success 'submodule update places git-dir in superprojects git-dir re
 
 test_expect_success 'submodule add properly re-creates deeper level submodules' '
 	(cd super &&
-	 git reset --hard master &&
+	 git reset --hard main &&
 	 rm -rf deeper/ &&
 	 git submodule add --force ../submodule deeper/submodule
 	)
diff --git a/t/t7407-submodule-foreach.sh b/t/t7407-submodule-foreach.sh
index 6b2aa917e1..8ebcaa3694 100755
--- a/t/t7407-submodule-foreach.sh
+++ b/t/t7407-submodule-foreach.sh
@@ -277,13 +277,13 @@ sub1sha1_short=$(cd clone3/sub1 && git rev-parse --short HEAD)
 sub2sha1_short=$(cd clone3/sub2 && git rev-parse --short HEAD)
 
 cat > expect <<EOF
- $nested1sha1 nested1 (heads/master)
- $nested2sha1 nested1/nested2 (heads/master)
- $nested3sha1 nested1/nested2/nested3 (heads/master)
- $submodulesha1 nested1/nested2/nested3/submodule (heads/master)
+ $nested1sha1 nested1 (heads/main)
+ $nested2sha1 nested1/nested2 (heads/main)
+ $nested3sha1 nested1/nested2/nested3 (heads/main)
+ $submodulesha1 nested1/nested2/nested3/submodule (heads/main)
  $sub1sha1 sub1 ($sub1sha1_short)
  $sub2sha1 sub2 ($sub2sha1_short)
- $sub3sha1 sub3 (heads/master)
+ $sub3sha1 sub3 (heads/main)
 EOF
 
 test_expect_success 'test "status --recursive"' '
@@ -295,10 +295,10 @@ test_expect_success 'test "status --recursive"' '
 '
 
 cat > expect <<EOF
- $nested1sha1 nested1 (heads/master)
+ $nested1sha1 nested1 (heads/main)
 +$nested2sha1 nested1/nested2 (file2~1)
- $nested3sha1 nested1/nested2/nested3 (heads/master)
- $submodulesha1 nested1/nested2/nested3/submodule (heads/master)
+ $nested3sha1 nested1/nested2/nested3 (heads/main)
+ $submodulesha1 nested1/nested2/nested3/submodule (heads/main)
 EOF
 
 test_expect_success 'ensure "status --cached --recursive" preserves the --cached flag' '
@@ -316,13 +316,13 @@ test_expect_success 'ensure "status --cached --recursive" preserves the --cached
 nested2sha1=$(git -C clone3/nested1/nested2 rev-parse HEAD)
 
 cat > expect <<EOF
- $nested1sha1 ../nested1 (heads/master)
+ $nested1sha1 ../nested1 (heads/main)
 +$nested2sha1 ../nested1/nested2 (file2)
- $nested3sha1 ../nested1/nested2/nested3 (heads/master)
- $submodulesha1 ../nested1/nested2/nested3/submodule (heads/master)
+ $nested3sha1 ../nested1/nested2/nested3 (heads/main)
+ $submodulesha1 ../nested1/nested2/nested3/submodule (heads/main)
  $sub1sha1 ../sub1 ($sub1sha1_short)
  $sub2sha1 ../sub2 ($sub2sha1_short)
- $sub3sha1 ../sub3 (heads/master)
+ $sub3sha1 ../sub3 (heads/main)
 EOF
 
 test_expect_success 'test "status --recursive" from sub directory' '
diff --git a/t/t7409-submodule-detached-work-tree.sh b/t/t7409-submodule-detached-work-tree.sh
index fc018e3638..727490eb15 100755
--- a/t/t7409-submodule-detached-work-tree.sh
+++ b/t/t7409-submodule-detached-work-tree.sh
@@ -35,7 +35,7 @@ test_expect_success 'submodule on detached working tree' '
 			git rev-parse --verify HEAD >actual &&
 			test_cmp ../../../../expect actual
 		) &&
-		git push origin master
+		git push origin main
 	) &&
 	mkdir home2 &&
 	(
@@ -44,7 +44,7 @@ test_expect_success 'submodule on detached working tree' '
 		GIT_WORK_TREE="$(pwd)" &&
 		GIT_DIR="$(pwd)/.dotfiles" &&
 		export GIT_WORK_TREE GIT_DIR &&
-		git checkout master &&
+		git checkout main &&
 		git submodule update --init &&
 		(
 			unset GIT_WORK_TREE GIT_DIR &&
@@ -64,10 +64,10 @@ test_expect_success 'submodule on detached working pointed by core.worktree' '
 		git clone --bare ../remote "$GIT_DIR" &&
 		git config core.bare false &&
 		git config core.worktree .. &&
-		git checkout master &&
+		git checkout main &&
 		git submodule add ../bundle1 .vim/bundle/dupe &&
 		test_commit "dupe" &&
-		git push origin master
+		git push origin main
 	) &&
 	(
 		cd home &&
diff --git a/t/t7417-submodule-path-url.sh b/t/t7417-submodule-path-url.sh
index f7e7e94d7b..1c9181aee7 100755
--- a/t/t7417-submodule-path-url.sh
+++ b/t/t7417-submodule-path-url.sh
@@ -36,7 +36,7 @@ test_expect_success MINGW 'submodule paths disallows trailing spaces' '
 	sed "s/sub/sub /" <tree >tree.new &&
 	tree=$(git -C super mktree <tree.new) &&
 	commit=$(echo with space | git -C super commit-tree $tree) &&
-	git -C super update-ref refs/heads/master $commit &&
+	git -C super update-ref refs/heads/main $commit &&
 
 	test_must_fail git clone --recurse-submodules super dst 2>err &&
 	test_i18ngrep "sub " err
diff --git a/t/test-lib.sh b/t/test-lib.sh
index 2f9c584fab..056d9591aa 100644
--- a/t/test-lib.sh
+++ b/t/test-lib.sh
@@ -257,13 +257,13 @@ case "$TRASH_DIRECTORY" in
 esac
 
 case "$TEST_NUMBER" in
-3404|4013|5310|5526|6300)
+3404|4013|5310|5526|6300|7064)
 	# Avoid conflicts with patch series that are cooking at the same time
 	# as the patch series changing the default of `init.defaultBranch`.
 	GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
 	export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 	;;
-[0-6]*)
+[0-6]*|7[0-4]*)
 	GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 	export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 	;;
-- 
gitgitgadget


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH v2 21/27] t7[5-9]*: adjust the references to the default branch name "main"
  2020-11-17 16:12 ` [PATCH v2 00/27] tests: use " Johannes Schindelin via GitGitGadget
                     ` (19 preceding siblings ...)
  2020-11-17 16:12   ` [PATCH v2 20/27] t7[0-4]*: " Johannes Schindelin via GitGitGadget
@ 2020-11-17 16:12   ` Johannes Schindelin via GitGitGadget
  2020-11-17 16:12   ` [PATCH v2 22/27] t8*: " Johannes Schindelin via GitGitGadget
                     ` (7 subsequent siblings)
  28 siblings, 0 replies; 163+ messages in thread
From: Johannes Schindelin via GitGitGadget @ 2020-11-17 16:12 UTC (permalink / raw)
  To: git
  Cc: Felipe Contreras, Ævar Arnfjörð Bjarmason,
	Johannes Schindelin, Jeff King, Johannes Schindelin,
	Johannes Schindelin

From: Johannes Schindelin <johannes.schindelin@gmx.de>

Excluding t7817, which is added in an unrelated patch series at the time
of writing, this adjusts t7[5-9]*. This trick was performed via

	$ (cd t &&
	   sed -i -e 's/master/main/g' -e 's/MASTER/MAIN/g' \
		-e 's/Master/Main/g' -- t7[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>
---
 t/t7501-commit-basic-functionality.sh         |   2 +-
 t/t7502-commit-porcelain.sh                   |  12 +-
 ...3-pre-commit-and-pre-merge-commit-hooks.sh |  42 ++---
 t/t7504-commit-msg-hook.sh                    |  24 +--
 t/t7505-prepare-commit-msg-hook.sh            |  20 +-
 t/t7508-status.sh                             |  58 +++---
 t/t7510-signed-commit.sh                      |   2 +-
 t/t7512-status-help.sh                        |  40 ++--
 t/t7517-per-repo-email.sh                     |  12 +-
 t/t7600-merge.sh                              |  44 ++---
 t/t7606-merge-custom.sh                       |   2 +-
 t/t7608-merge-messages.sh                     |  36 ++--
 t/t7610-mergetool.sh                          | 174 +++++++++---------
 t/t7611-merge-abort.sh                        |   4 +-
 t/t7612-merge-verify-signatures.sh            |   2 +-
 t/t7614-merge-signoff.sh                      |  24 +--
 t/t7701-repack-unpack-unreachable.sh          |   2 +-
 t/t7800-difftool.sh                           |  38 ++--
 t/t7810-grep.sh                               |  28 +--
 t/test-lib.sh                                 |   4 +-
 20 files changed, 285 insertions(+), 285 deletions(-)

diff --git a/t/t7501-commit-basic-functionality.sh b/t/t7501-commit-basic-functionality.sh
index 110b4bf459..72c9031934 100755
--- a/t/t7501-commit-basic-functionality.sh
+++ b/t/t7501-commit-basic-functionality.sh
@@ -603,7 +603,7 @@ test_expect_success 'same tree (merge and amend merge)' '
 	echo zero >zero &&
 	git add zero &&
 	git commit -m "add zero" &&
-	git checkout master &&
+	git checkout main &&
 
 	git merge -s ours side -m "empty ok" &&
 	git diff HEAD^ HEAD >actual &&
diff --git a/t/t7502-commit-porcelain.sh b/t/t7502-commit-porcelain.sh
index 14c92e4c25..3956dcc237 100755
--- a/t/t7502-commit-porcelain.sh
+++ b/t/t7502-commit-porcelain.sh
@@ -76,7 +76,7 @@ test_expect_success 'output summary format for merges' '
 
 output_tests_cleanup() {
 	# this is needed for "do not fire editor in the presence of conflicts"
-	git checkout master &&
+	git checkout main &&
 
 	# this is needed for the "partial removal" test to pass
 	git rm file1 &&
@@ -440,7 +440,7 @@ test_expect_success 'do not fire editor in the presence of conflicts' '
 	git add g &&
 	git commit -m "add g" &&
 	git branch second &&
-	echo master >g &&
+	echo main >g &&
 	echo g >h &&
 	git add g h &&
 	git commit -m "modify g and add h" &&
@@ -449,7 +449,7 @@ test_expect_success 'do not fire editor in the presence of conflicts' '
 	git add g &&
 	git commit -m second &&
 	# Must fail due to conflict
-	test_must_fail git cherry-pick -n master &&
+	test_must_fail git cherry-pick -n main &&
 	echo "editor not started" >.git/result &&
 	(
 		GIT_EDITOR="\"$(pwd)/.git/FAKE_EDITOR\"" &&
@@ -478,9 +478,9 @@ git reset -q --hard
 
 test_expect_success 'Hand committing of a redundant merge removes dups' '
 
-	git rev-parse second master >expect &&
-	test_must_fail git merge second master &&
-	git checkout master g &&
+	git rev-parse second main >expect &&
+	test_must_fail git merge second main &&
+	git checkout main g &&
 	EDITOR=: git commit -a &&
 	git cat-file commit HEAD >raw &&
 	sed -n -e "s/^parent //p" -e "/^$/q" raw >actual &&
diff --git a/t/t7503-pre-commit-and-pre-merge-commit-hooks.sh b/t/t7503-pre-commit-and-pre-merge-commit-hooks.sh
index b3485450a2..6ac12726d6 100755
--- a/t/t7503-pre-commit-and-pre-merge-commit-hooks.sh
+++ b/t/t7503-pre-commit-and-pre-merge-commit-hooks.sh
@@ -44,16 +44,16 @@ test_expect_success 'root commit' '
 	git add foo &&
 	git commit -m "make it non-ff" &&
 	git branch side-orig side &&
-	git checkout master
+	git checkout main
 '
 
 test_expect_success 'setup conflicting branches' '
-	test_when_finished "git checkout master" &&
-	git checkout -b conflicting-a master &&
+	test_when_finished "git checkout main" &&
+	git checkout -b conflicting-a main &&
 	echo a >conflicting &&
 	git add conflicting &&
 	git commit -m conflicting-a &&
-	git checkout -b conflicting-b master &&
+	git checkout -b conflicting-b main &&
 	echo b >conflicting &&
 	git add conflicting &&
 	git commit -m conflicting-b
@@ -71,8 +71,8 @@ test_expect_success 'with no hook (merge)' '
 	test_when_finished "rm -f actual_hooks" &&
 	git branch -f side side-orig &&
 	git checkout side &&
-	git merge -m "merge master" master &&
-	git checkout master &&
+	git merge -m "merge main" main &&
+	git checkout main &&
 	test_path_is_missing actual_hooks
 '
 
@@ -88,8 +88,8 @@ test_expect_success '--no-verify with no hook (merge)' '
 	test_when_finished "rm -f actual_hooks" &&
 	git branch -f side side-orig &&
 	git checkout side &&
-	git merge --no-verify -m "merge master" master &&
-	git checkout master &&
+	git merge --no-verify -m "merge main" main &&
+	git checkout main &&
 	test_path_is_missing actual_hooks
 '
 
@@ -108,15 +108,15 @@ test_expect_success 'with succeeding hook (merge)' '
 	cp "$HOOKDIR/success.sample" "$PREMERGE" &&
 	echo "$PREMERGE" >expected_hooks &&
 	git checkout side &&
-	git merge -m "merge master" master &&
-	git checkout master &&
+	git merge -m "merge main" main &&
+	git checkout main &&
 	test_cmp expected_hooks actual_hooks
 '
 
 test_expect_success 'automatic merge fails; both hooks are available' '
 	test_when_finished "rm -f \"$PREMERGE\" \"$PRECOMMIT\"" &&
 	test_when_finished "rm -f expected_hooks actual_hooks" &&
-	test_when_finished "git checkout master" &&
+	test_when_finished "git checkout main" &&
 	cp "$HOOKDIR/success.sample" "$PREMERGE" &&
 	cp "$HOOKDIR/success.sample" "$PRECOMMIT" &&
 
@@ -145,8 +145,8 @@ test_expect_success '--no-verify with succeeding hook (merge)' '
 	cp "$HOOKDIR/success.sample" "$PREMERGE" &&
 	git branch -f side side-orig &&
 	git checkout side &&
-	git merge --no-verify -m "merge master" master &&
-	git checkout master &&
+	git merge --no-verify -m "merge main" main &&
+	git checkout main &&
 	test_path_is_missing actual_hooks
 '
 
@@ -174,8 +174,8 @@ test_expect_success 'with failing hook (merge)' '
 	cp "$HOOKDIR/fail.sample" "$PREMERGE" &&
 	echo "$PREMERGE" >expected_hooks &&
 	git checkout side &&
-	test_must_fail git merge -m "merge master" master &&
-	git checkout master &&
+	test_must_fail git merge -m "merge main" main &&
+	git checkout main &&
 	test_cmp expected_hooks actual_hooks
 '
 
@@ -184,8 +184,8 @@ test_expect_success '--no-verify with failing hook (merge)' '
 	cp "$HOOKDIR/fail.sample" "$PREMERGE" &&
 	git branch -f side side-orig &&
 	git checkout side &&
-	git merge --no-verify -m "merge master" master &&
-	git checkout master &&
+	git merge --no-verify -m "merge main" main &&
+	git checkout main &&
 	test_path_is_missing actual_hooks
 '
 
@@ -212,8 +212,8 @@ test_expect_success POSIXPERM 'with non-executable hook (merge)' '
 	cp "$HOOKDIR/non-exec.sample" "$PREMERGE" &&
 	git branch -f side side-orig &&
 	git checkout side &&
-	git merge -m "merge master" master &&
-	git checkout master &&
+	git merge -m "merge main" main &&
+	git checkout main &&
 	test_path_is_missing actual_hooks
 '
 
@@ -222,8 +222,8 @@ test_expect_success POSIXPERM '--no-verify with non-executable hook (merge)' '
 	cp "$HOOKDIR/non-exec.sample" "$PREMERGE" &&
 	git branch -f side side-orig &&
 	git checkout side &&
-	git merge --no-verify -m "merge master" master &&
-	git checkout master &&
+	git merge --no-verify -m "merge main" main &&
+	git checkout main &&
 	test_path_is_missing actual_hooks
 '
 
diff --git a/t/t7504-commit-msg-hook.sh b/t/t7504-commit-msg-hook.sh
index 31b9c6a2c1..2547362a39 100755
--- a/t/t7504-commit-msg-hook.sh
+++ b/t/t7504-commit-msg-hook.sh
@@ -142,12 +142,12 @@ test_expect_success '--no-verify with failing hook (editor)' '
 test_expect_success 'merge fails with failing hook' '
 
 	test_when_finished "git branch -D newbranch" &&
-	test_when_finished "git checkout -f master" &&
+	test_when_finished "git checkout -f main" &&
 	git checkout --orphan newbranch &&
 	: >file2 &&
 	git add file2 &&
 	git commit --no-verify file2 -m in-side-branch &&
-	test_must_fail git merge --allow-unrelated-histories master &&
+	test_must_fail git merge --allow-unrelated-histories main &&
 	commit_msg_is "in-side-branch" # HEAD before merge
 
 '
@@ -155,14 +155,14 @@ test_expect_success 'merge fails with failing hook' '
 test_expect_success 'merge bypasses failing hook with --no-verify' '
 
 	test_when_finished "git branch -D newbranch" &&
-	test_when_finished "git checkout -f master" &&
+	test_when_finished "git checkout -f main" &&
 	git checkout --orphan newbranch &&
 	git rm -f file &&
 	: >file2 &&
 	git add file2 &&
 	git commit --no-verify file2 -m in-side-branch &&
-	git merge --no-verify --allow-unrelated-histories master &&
-	commit_msg_is "Merge branch '\''master'\'' into newbranch"
+	git merge --no-verify --allow-unrelated-histories main &&
+	commit_msg_is "Merge branch '\''main'\'' into newbranch"
 '
 
 
@@ -248,28 +248,28 @@ test_expect_success "hook doesn't edit commit message (editor)" '
 
 test_expect_success 'hook called in git-merge picks up commit message' '
 	test_when_finished "git branch -D newbranch" &&
-	test_when_finished "git checkout -f master" &&
+	test_when_finished "git checkout -f main" &&
 	git checkout --orphan newbranch &&
 	git rm -f file &&
 	: >file2 &&
 	git add file2 &&
 	git commit --no-verify file2 -m in-side-branch &&
-	git merge --allow-unrelated-histories master &&
+	git merge --allow-unrelated-histories main &&
 	commit_msg_is "new message"
 '
 
 test_expect_failure 'merge --continue remembers --no-verify' '
 	test_when_finished "git branch -D newbranch" &&
-	test_when_finished "git checkout -f master" &&
-	git checkout master &&
+	test_when_finished "git checkout -f main" &&
+	git checkout main &&
 	echo a >file2 &&
 	git add file2 &&
-	git commit --no-verify -m "add file2 to master" &&
-	git checkout -b newbranch master^ &&
+	git commit --no-verify -m "add file2 to main" &&
+	git checkout -b newbranch main^ &&
 	echo b >file2 &&
 	git add file2 &&
 	git commit --no-verify file2 -m in-side-branch &&
-	git merge --no-verify -m not-rewritten-by-hook master &&
+	git merge --no-verify -m not-rewritten-by-hook main &&
 	# resolve conflict:
 	echo c >file2 &&
 	git add file2 &&
diff --git a/t/t7505-prepare-commit-msg-hook.sh b/t/t7505-prepare-commit-msg-hook.sh
index 94f85cdf83..20b49629cd 100755
--- a/t/t7505-prepare-commit-msg-hook.sh
+++ b/t/t7505-prepare-commit-msg-hook.sh
@@ -15,7 +15,7 @@ test_expect_success 'set up commits for rebasing' '
 	do
 		test_commit rebase-$i c $i
 	done &&
-	git checkout master &&
+	git checkout main &&
 
 	cat >rebase-todo <<-EOF
 	pick $(git rev-parse rebase-a)
@@ -190,7 +190,7 @@ test_expect_success 'with hook (-c)' '
 
 test_expect_success 'with hook (merge)' '
 
-	test_when_finished "git checkout -f master" &&
+	test_when_finished "git checkout -f main" &&
 	git checkout -B other HEAD@{1} &&
 	echo "more" >>file &&
 	git add file &&
@@ -202,7 +202,7 @@ test_expect_success 'with hook (merge)' '
 
 test_expect_success 'with hook and editor (merge)' '
 
-	test_when_finished "git checkout -f master" &&
+	test_when_finished "git checkout -f main" &&
 	git checkout -B other HEAD@{1} &&
 	echo "more" >>file &&
 	git add file &&
@@ -218,7 +218,7 @@ test_rebase () {
 	test_expect_$expect C_LOCALE_OUTPUT "with hook (rebase ${mode:--i})" '
 		test_when_finished "\
 			git rebase --abort
-			git checkout -f master
+			git checkout -f main
 			git branch -D tmp" &&
 		git checkout -b tmp rebase-me &&
 		GIT_SEQUENCE_EDITOR="cp rebase-todo" &&
@@ -250,14 +250,14 @@ test_rebase success
 test_have_prereq !REBASE_P || test_rebase success -p
 
 test_expect_success 'with hook (cherry-pick)' '
-	test_when_finished "git checkout -f master" &&
+	test_when_finished "git checkout -f main" &&
 	git checkout -B other b &&
 	git cherry-pick rebase-1 &&
 	test "$(git log -1 --pretty=format:%s)" = "message (no editor)"
 '
 
 test_expect_success 'with hook and editor (cherry-pick)' '
-	test_when_finished "git checkout -f master" &&
+	test_when_finished "git checkout -f main" &&
 	git checkout -B other b &&
 	git cherry-pick -e rebase-1 &&
 	test "$(git log -1 --pretty=format:%s)" = merge
@@ -270,7 +270,7 @@ EOF
 
 test_expect_success 'with failing hook' '
 
-	test_when_finished "git checkout -f master" &&
+	test_when_finished "git checkout -f main" &&
 	head=$(git rev-parse HEAD) &&
 	echo "more" >> file &&
 	git add file &&
@@ -280,7 +280,7 @@ test_expect_success 'with failing hook' '
 
 test_expect_success 'with failing hook (--no-verify)' '
 
-	test_when_finished "git checkout -f master" &&
+	test_when_finished "git checkout -f main" &&
 	head=$(git rev-parse HEAD) &&
 	echo "more" >> file &&
 	git add file &&
@@ -290,7 +290,7 @@ test_expect_success 'with failing hook (--no-verify)' '
 
 test_expect_success 'with failing hook (merge)' '
 
-	test_when_finished "git checkout -f master" &&
+	test_when_finished "git checkout -f main" &&
 	git checkout -B other HEAD@{1} &&
 	echo "more" >> file &&
 	git add file &&
@@ -305,7 +305,7 @@ test_expect_success 'with failing hook (merge)' '
 '
 
 test_expect_success C_LOCALE_OUTPUT 'with failing hook (cherry-pick)' '
-	test_when_finished "git checkout -f master" &&
+	test_when_finished "git checkout -f main" &&
 	git checkout -B other b &&
 	test_must_fail git cherry-pick rebase-1 2>actual &&
 	test $(grep -c prepare-commit-msg actual) = 1
diff --git a/t/t7508-status.sh b/t/t7508-status.sh
index 963fed6821..d01aacb66b 100755
--- a/t/t7508-status.sh
+++ b/t/t7508-status.sh
@@ -37,11 +37,11 @@ test_expect_success 'create upstream branch' '
 	git checkout -b upstream &&
 	test_commit upstream1 &&
 	test_commit upstream2 &&
-	# leave the first commit on master as root because several
+	# leave the first commit on main as root because several
 	# tests depend on this case; for our upstream we only
 	# care about commit counts anyway, so a totally divergent
 	# history is OK
-	git checkout --orphan master
+	git checkout --orphan main
 '
 
 test_expect_success 'setup' '
@@ -88,7 +88,7 @@ EOF
 
 test_expect_success 'status --column' '
 	cat >expect <<\EOF &&
-# On branch master
+# On branch main
 # Your branch and '\''upstream'\'' have diverged,
 # and have 1 and 2 different commits each, respectively.
 #   (use "git pull" to merge the remote branch into yours)
@@ -119,7 +119,7 @@ test_expect_success 'status --column status.displayCommentPrefix=false' '
 '
 
 cat >expect <<\EOF
-# On branch master
+# On branch main
 # Your branch and 'upstream' have diverged,
 # and have 1 and 2 different commits each, respectively.
 #   (use "git pull" to merge the remote branch into yours)
@@ -193,7 +193,7 @@ test_expect_success 'commit ignores status.displayCommentPrefix=false in COMMIT_
 '
 
 cat >expect <<\EOF
-On branch master
+On branch main
 Your branch and 'upstream' have diverged,
 and have 1 and 2 different commits each, respectively.
 
@@ -266,7 +266,7 @@ test_expect_success 'status with gitignore' '
 	test_cmp expect output &&
 
 	cat >expect <<\EOF &&
-On branch master
+On branch main
 Your branch and '\''upstream'\'' have diverged,
 and have 1 and 2 different commits each, respectively.
   (use "git pull" to merge the remote branch into yours)
@@ -331,7 +331,7 @@ test_expect_success 'status with gitignore (nothing untracked)' '
 	test_cmp expect output &&
 
 	cat >expect <<\EOF &&
-On branch master
+On branch main
 Your branch and '\''upstream'\'' have diverged,
 and have 1 and 2 different commits each, respectively.
   (use "git pull" to merge the remote branch into yours)
@@ -368,7 +368,7 @@ output*
 EOF
 
 cat >expect <<\EOF
-## master...upstream [ahead 1, behind 2]
+## main...upstream [ahead 1, behind 2]
  M dir1/modified
 A  dir2/added
 ?? dir1/untracked
@@ -401,7 +401,7 @@ test_expect_success 'setup dir3' '
 
 test_expect_success 'status -uno' '
 	cat >expect <<EOF &&
-On branch master
+On branch main
 Your branch and '\''upstream'\'' have diverged,
 and have 1 and 2 different commits each, respectively.
   (use "git pull" to merge the remote branch into yours)
@@ -429,7 +429,7 @@ test_expect_success 'status (status.showUntrackedFiles no)' '
 
 test_expect_success 'status -uno (advice.statusHints false)' '
 	cat >expect <<EOF &&
-On branch master
+On branch main
 Your branch and '\''upstream'\'' have diverged,
 and have 1 and 2 different commits each, respectively.
 
@@ -463,7 +463,7 @@ test_expect_success 'status -s (status.showUntrackedFiles no)' '
 
 test_expect_success 'status -unormal' '
 	cat >expect <<EOF &&
-On branch master
+On branch main
 Your branch and '\''upstream'\'' have diverged,
 and have 1 and 2 different commits each, respectively.
   (use "git pull" to merge the remote branch into yours)
@@ -518,7 +518,7 @@ test_expect_success 'status -s (status.showUntrackedFiles normal)' '
 
 test_expect_success 'status -uall' '
 	cat >expect <<EOF &&
-On branch master
+On branch main
 Your branch and '\''upstream'\'' have diverged,
 and have 1 and 2 different commits each, respectively.
   (use "git pull" to merge the remote branch into yours)
@@ -578,7 +578,7 @@ test_expect_success 'status -s (status.showUntrackedFiles all)' '
 
 test_expect_success 'status with relative paths' '
 	cat >expect <<\EOF &&
-On branch master
+On branch main
 Your branch and '\''upstream'\'' have diverged,
 and have 1 and 2 different commits each, respectively.
   (use "git pull" to merge the remote branch into yours)
@@ -646,7 +646,7 @@ test_expect_success 'setup unique colors' '
 
 test_expect_success TTY 'status with color.ui' '
 	cat >expect <<\EOF &&
-On branch <GREEN>master<RESET>
+On branch <GREEN>main<RESET>
 Your branch and '\''upstream'\'' have diverged,
 and have 1 and 2 different commits each, respectively.
   (use "git pull" to merge the remote branch into yours)
@@ -706,7 +706,7 @@ test_expect_success TTY 'status -s with color.status' '
 '
 
 cat >expect <<\EOF
-## <YELLOW>master<RESET>...<CYAN>upstream<RESET> [ahead <YELLOW>1<RESET>, behind <CYAN>2<RESET>]
+## <YELLOW>main<RESET>...<CYAN>upstream<RESET> [ahead <YELLOW>1<RESET>, behind <CYAN>2<RESET>]
  <RED>M<RESET> dir1/modified
 <GREEN>A<RESET>  dir2/added
 <BLUE>??<RESET> dir1/untracked
@@ -757,7 +757,7 @@ test_expect_success 'status --porcelain respects -b' '
 
 	git status --porcelain -b >output &&
 	{
-		echo "## master...upstream [ahead 1, behind 2]" &&
+		echo "## main...upstream [ahead 1, behind 2]" &&
 		cat expect
 	} >tmp &&
 	mv tmp expect &&
@@ -769,7 +769,7 @@ test_expect_success 'status --porcelain respects -b' '
 
 test_expect_success 'status without relative paths' '
 	cat >expect <<\EOF &&
-On branch master
+On branch main
 Your branch and '\''upstream'\'' have diverged,
 and have 1 and 2 different commits each, respectively.
   (use "git pull" to merge the remote branch into yours)
@@ -843,7 +843,7 @@ test_expect_success 'status -s without relative paths' '
 
 test_expect_success 'dry-run of partial commit excluding new file in index' '
 	cat >expect <<EOF &&
-On branch master
+On branch main
 Your branch and '\''upstream'\'' have diverged,
 and have 1 and 2 different commits each, respectively.
   (use "git pull" to merge the remote branch into yours)
@@ -897,7 +897,7 @@ test_expect_success 'setup status submodule summary' '
 
 test_expect_success 'status submodule summary is disabled by default' '
 	cat >expect <<EOF &&
-On branch master
+On branch main
 Your branch and '\''upstream'\'' have diverged,
 and have 1 and 2 different commits each, respectively.
   (use "git pull" to merge the remote branch into yours)
@@ -954,7 +954,7 @@ head=$(cd sm && git rev-parse --short=7 --verify HEAD)
 
 test_expect_success 'status submodule summary' '
 	cat >expect <<EOF &&
-On branch master
+On branch main
 Your branch and '\''upstream'\'' have diverged,
 and have 1 and 2 different commits each, respectively.
   (use "git pull" to merge the remote branch into yours)
@@ -1013,7 +1013,7 @@ test_expect_success 'status -s submodule summary' '
 
 test_expect_success 'status submodule summary (clean submodule): commit' '
 	cat >expect <<EOF &&
-On branch master
+On branch main
 Your branch and '\''upstream'\'' have diverged,
 and have 2 and 2 different commits each, respectively.
   (use "git pull" to merge the remote branch into yours)
@@ -1061,7 +1061,7 @@ test_expect_success 'status -z implies porcelain' '
 
 test_expect_success 'commit --dry-run submodule summary (--amend)' '
 	cat >expect <<EOF &&
-On branch master
+On branch main
 Your branch and '\''upstream'\'' have diverged,
 and have 2 and 2 different commits each, respectively.
   (use "git pull" to merge the remote branch into yours)
@@ -1113,7 +1113,7 @@ touch .gitmodules
 
 test_expect_success '--ignore-submodules=untracked suppresses submodules with untracked content' '
 	cat > expect << EOF &&
-On branch master
+On branch main
 Your branch and '\''upstream'\'' have diverged,
 and have 2 and 2 different commits each, respectively.
   (use "git pull" to merge the remote branch into yours)
@@ -1222,7 +1222,7 @@ test_expect_success '.git/config ignore=dirty suppresses submodules with modifie
 
 test_expect_success "--ignore-submodules=untracked doesn't suppress submodules with modified content" '
 	cat > expect << EOF &&
-On branch master
+On branch main
 Your branch and '\''upstream'\'' have diverged,
 and have 2 and 2 different commits each, respectively.
   (use "git pull" to merge the remote branch into yours)
@@ -1279,7 +1279,7 @@ head2=$(cd sm && git commit -q -m "2nd commit" foo && git rev-parse --short=7 --
 
 test_expect_success "--ignore-submodules=untracked doesn't suppress submodule summary" '
 	cat > expect << EOF &&
-On branch master
+On branch main
 Your branch and '\''upstream'\'' have diverged,
 and have 2 and 2 different commits each, respectively.
   (use "git pull" to merge the remote branch into yours)
@@ -1360,7 +1360,7 @@ test_expect_success ".git/config ignore=dirty doesn't suppress submodule summary
 '
 
 cat > expect << EOF
-; On branch master
+; On branch main
 ; Your branch and 'upstream' have diverged,
 ; and have 2 and 2 different commits each, respectively.
 ;   (use "git pull" to merge the remote branch into yours)
@@ -1408,7 +1408,7 @@ test_expect_success "status (core.commentchar with two chars with submodule summ
 
 test_expect_success "--ignore-submodules=all suppresses submodule summary" '
 	cat > expect << EOF &&
-On branch master
+On branch main
 Your branch and '\''upstream'\'' have diverged,
 and have 2 and 2 different commits each, respectively.
   (use "git pull" to merge the remote branch into yours)
@@ -1434,7 +1434,7 @@ EOF
 
 test_expect_success '.gitmodules ignore=all suppresses unstaged submodule summary' '
 	cat > expect << EOF &&
-On branch master
+On branch main
 Your branch and '\''upstream'\'' have diverged,
 and have 2 and 2 different commits each, respectively.
   (use "git pull" to merge the remote branch into yours)
@@ -1554,7 +1554,7 @@ test_expect_success 'git commit --dry-run will show a staged but ignored submodu
 	git reset HEAD^ &&
 	git add sm &&
 	cat >expect << EOF &&
-On branch master
+On branch main
 Your branch and '\''upstream'\'' have diverged,
 and have 2 and 2 different commits each, respectively.
   (use "git pull" to merge the remote branch into yours)
diff --git a/t/t7510-signed-commit.sh b/t/t7510-signed-commit.sh
index 6baaa1ad91..0653fdcd02 100755
--- a/t/t7510-signed-commit.sh
+++ b/t/t7510-signed-commit.sh
@@ -25,7 +25,7 @@ test_expect_success GPG 'create signed commits' '
 	echo 3 >elif && git add elif &&
 	test_tick && git commit -m "third on side" &&
 
-	git checkout master &&
+	git checkout main &&
 	test_tick && git merge -S side &&
 	git tag merge &&
 
diff --git a/t/t7512-status-help.sh b/t/t7512-status-help.sh
index 29518e0949..29aa9adcfd 100755
--- a/t/t7512-status-help.sh
+++ b/t/t7512-status-help.sh
@@ -17,14 +17,14 @@ test_expect_success 'prepare for conflicts' '
 	git config --global advice.statusuoption false &&
 	test_commit init main.txt init &&
 	git branch conflicts &&
-	test_commit on_master main.txt on_master &&
+	test_commit on_main main.txt on_main &&
 	git checkout conflicts &&
 	test_commit on_conflicts main.txt on_conflicts
 '
 
 
 test_expect_success 'status when conflicts unresolved' '
-	test_must_fail git merge master &&
+	test_must_fail git merge main &&
 	cat >expected <<\EOF &&
 On branch conflicts
 You have unmerged paths.
@@ -44,7 +44,7 @@ EOF
 
 test_expect_success 'status when conflicts resolved before commit' '
 	git reset --hard conflicts &&
-	test_must_fail git merge master &&
+	test_must_fail git merge main &&
 	echo one >main.txt &&
 	git add main.txt &&
 	cat >expected <<\EOF &&
@@ -63,7 +63,7 @@ EOF
 
 
 test_expect_success 'prepare for rebase conflicts' '
-	git reset --hard master &&
+	git reset --hard main &&
 	git checkout -b rebase_conflicts &&
 	test_commit one_rebase main.txt one &&
 	test_commit two_rebase main.txt two &&
@@ -118,11 +118,11 @@ EOF
 
 
 test_expect_success 'prepare for rebase_i_conflicts' '
-	git reset --hard master &&
+	git reset --hard main &&
 	git checkout -b rebase_i_conflicts &&
 	test_commit one_unmerge main.txt one_unmerge &&
 	git branch rebase_i_conflicts_second &&
-	test_commit one_master main.txt one_master &&
+	test_commit one_main main.txt one_main &&
 	git checkout rebase_i_conflicts_second &&
 	test_commit one_second main.txt one_second
 '
@@ -182,7 +182,7 @@ EOF
 
 
 test_expect_success 'status when rebasing -i in edit mode' '
-	git reset --hard master &&
+	git reset --hard main &&
 	git checkout -b rebase_i_edit &&
 	test_commit one_rebase_i main.txt one &&
 	test_commit two_rebase_i main.txt two &&
@@ -212,7 +212,7 @@ EOF
 
 
 test_expect_success 'status when splitting a commit' '
-	git reset --hard master &&
+	git reset --hard main &&
 	git checkout -b split_commit &&
 	test_commit one_split main.txt one &&
 	test_commit two_split main.txt two &&
@@ -251,7 +251,7 @@ EOF
 
 
 test_expect_success 'status after editing the last commit with --amend during a rebase -i' '
-	git reset --hard master &&
+	git reset --hard main &&
 	git checkout -b amend_last &&
 	test_commit one_amend main.txt one &&
 	test_commit two_amend main.txt two &&
@@ -284,7 +284,7 @@ EOF
 
 
 test_expect_success 'prepare for several edits' '
-	git reset --hard master &&
+	git reset --hard main &&
 	git checkout -b several_edits &&
 	test_commit one_edits main.txt one &&
 	test_commit two_edits main.txt two &&
@@ -593,7 +593,7 @@ EOF
 
 
 test_expect_success 'prepare am_session' '
-	git reset --hard master &&
+	git reset --hard main &&
 	git checkout -b am_session &&
 	test_commit one_am one.txt "one" &&
 	test_commit two_am two.txt "two" &&
@@ -666,7 +666,7 @@ EOF
 
 
 test_expect_success 'status when bisecting' '
-	git reset --hard master &&
+	git reset --hard main &&
 	git checkout -b bisect &&
 	test_commit one_bisect main.txt one &&
 	test_commit two_bisect main.txt two &&
@@ -689,7 +689,7 @@ EOF
 
 
 test_expect_success 'status when rebase --apply conflicts with statushints disabled' '
-	git reset --hard master &&
+	git reset --hard main &&
 	git checkout -b statushints_disabled &&
 	test_when_finished "git config --local advice.statushints true" &&
 	git config --local advice.statushints false &&
@@ -714,7 +714,7 @@ EOF
 
 
 test_expect_success 'prepare for cherry-pick conflicts' '
-	git reset --hard master &&
+	git reset --hard main &&
 	git checkout -b cherry_branch &&
 	test_commit one_cherry main.txt one &&
 	test_commit two_cherries main.txt two &&
@@ -825,7 +825,7 @@ EOF
 '
 
 test_expect_success 'status while reverting commit (conflicts)' '
-	git checkout master &&
+	git checkout main &&
 	echo before >to-revert.txt &&
 	test_commit before to-revert.txt &&
 	echo old >to-revert.txt &&
@@ -835,7 +835,7 @@ test_expect_success 'status while reverting commit (conflicts)' '
 	TO_REVERT=$(git rev-parse --short HEAD^) &&
 	test_must_fail git revert $TO_REVERT &&
 	cat >expected <<EOF &&
-On branch master
+On branch main
 You are currently reverting commit $TO_REVERT.
   (fix conflicts and run "git revert --continue")
   (use "git revert --skip" to skip this patch)
@@ -856,7 +856,7 @@ test_expect_success 'status while reverting commit (conflicts resolved)' '
 	echo reverted >to-revert.txt &&
 	git add to-revert.txt &&
 	cat >expected <<EOF &&
-On branch master
+On branch main
 You are currently reverting commit $TO_REVERT.
   (all conflicts fixed: run "git revert --continue")
   (use "git revert --skip" to skip this patch)
@@ -875,7 +875,7 @@ EOF
 test_expect_success 'status after reverting commit' '
 	git revert --continue &&
 	cat >expected <<\EOF &&
-On branch master
+On branch main
 nothing to commit (use -u to show untracked files)
 EOF
 	git status --untracked-files=no >actual &&
@@ -889,7 +889,7 @@ test_expect_success 'status while reverting after committing conflict resolution
 	echo reverted >to-revert.txt &&
 	git commit -a &&
 	cat >expected <<EOF &&
-On branch master
+On branch main
 Revert currently in progress.
   (run "git revert --continue" to continue)
   (use "git revert --skip" to skip this patch)
@@ -902,7 +902,7 @@ EOF
 '
 
 test_expect_success 'prepare for different number of commits rebased' '
-	git reset --hard master &&
+	git reset --hard main &&
 	git checkout -b several_commits &&
 	test_commit one_commit main.txt one &&
 	test_commit two_commit main.txt two &&
diff --git a/t/t7517-per-repo-email.sh b/t/t7517-per-repo-email.sh
index b2401cec3e..3a7723d16b 100755
--- a/t/t7517-per-repo-email.sh
+++ b/t/t7517-per-repo-email.sh
@@ -47,24 +47,24 @@ test_expect_success 'set up rebase scenarios' '
 
 test_expect_success 'fast-forward rebase does not care about ident' '
 	git checkout -B tmp side-without-commit &&
-	git rebase master
+	git rebase main
 '
 
 test_expect_success 'non-fast-forward rebase refuses to write commits' '
 	test_when_finished "git rebase --abort || true" &&
 	git checkout -B tmp side-with-commit &&
-	test_must_fail git rebase master
+	test_must_fail git rebase main
 '
 
 test_expect_success 'fast-forward rebase does not care about ident (interactive)' '
 	git checkout -B tmp side-without-commit &&
-	git rebase -i master
+	git rebase -i main
 '
 
 test_expect_success 'non-fast-forward rebase refuses to write commits (interactive)' '
 	test_when_finished "git rebase --abort || true" &&
 	git checkout -B tmp side-with-commit &&
-	test_must_fail git rebase -i master
+	test_must_fail git rebase -i main
 '
 
 test_expect_success 'noop interactive rebase does not care about ident' '
@@ -75,14 +75,14 @@ test_expect_success 'noop interactive rebase does not care about ident' '
 test_expect_success REBASE_P \
 	'fast-forward rebase does not care about ident (preserve)' '
 	git checkout -B tmp side-without-commit &&
-	git rebase -p master
+	git rebase -p main
 '
 
 test_expect_success REBASE_P \
 	'non-fast-forward rebase refuses to write commits (preserve)' '
 	test_when_finished "git rebase --abort || true" &&
 	git checkout -B tmp side-with-commit &&
-	test_must_fail git rebase -p master
+	test_must_fail git rebase -p main
 '
 
 test_expect_success 'author.name overrides user.name' '
diff --git a/t/t7600-merge.sh b/t/t7600-merge.sh
index 1c85f75555..6feb8895f3 100755
--- a/t/t7600-merge.sh
+++ b/t/t7600-merge.sh
@@ -14,9 +14,9 @@ Testing basic merge operations/option parsing.
     ! [c4] c4
      ! [c5] c5
       ! [c6] c6
-       * [master] Merge commit 'c1'
+       * [main] Merge commit 'c1'
 --------
-       - [master] Merge commit 'c1'
+       - [main] Merge commit 'c1'
  +     * [c1] commit 1
       +  [c6] c6
      +   [c5] c5
@@ -203,13 +203,13 @@ test_expect_success 'merge c0 with c1 with --ff-only' '
 test_debug 'git log --graph --decorate --oneline --all'
 
 test_expect_success 'merge from unborn branch' '
-	git checkout -f master &&
+	git checkout -f main &&
 	test_might_fail git branch -D kid &&
 
 	echo "OBJID HEAD@{0}: initial pull" >reflog.expected &&
 
 	git checkout --orphan kid &&
-	test_when_finished "git checkout -f master" &&
+	test_when_finished "git checkout -f main" &&
 	git rm -fr . &&
 	test_tick &&
 	git merge --ff-only c1 &&
@@ -413,7 +413,7 @@ test_debug 'git log --graph --decorate --oneline --all'
 
 test_expect_success 'merge c1 with c2 (no-commit in config)' '
 	git reset --hard c1 &&
-	test_config branch.master.mergeoptions "--no-commit" &&
+	test_config branch.main.mergeoptions "--no-commit" &&
 	git merge c2 &&
 	verify_merge file result.1-5 &&
 	verify_head $c1 &&
@@ -427,7 +427,7 @@ test_expect_success 'merge c1 with c2 (log in config)' '
 	git merge --log c2 &&
 	git show -s --pretty=tformat:%s%n%b >expect &&
 
-	test_config branch.master.mergeoptions "--log" &&
+	test_config branch.main.mergeoptions "--log" &&
 	git reset --hard c1 &&
 	git merge c2 &&
 	git show -s --pretty=tformat:%s%n%b >actual &&
@@ -440,7 +440,7 @@ test_expect_success 'merge c1 with c2 (log in config gets overridden)' '
 	git merge c2 &&
 	git show -s --pretty=tformat:%s%n%b >expect &&
 
-	test_config branch.master.mergeoptions "--no-log" &&
+	test_config branch.main.mergeoptions "--no-log" &&
 	test_config merge.log "true" &&
 	git reset --hard c1 &&
 	git merge c2 &&
@@ -451,7 +451,7 @@ test_expect_success 'merge c1 with c2 (log in config gets overridden)' '
 
 test_expect_success 'merge c1 with c2 (squash in config)' '
 	git reset --hard c1 &&
-	test_config branch.master.mergeoptions "--squash" &&
+	test_config branch.main.mergeoptions "--squash" &&
 	git merge c2 &&
 	verify_merge file result.1-5 &&
 	verify_head $c1 &&
@@ -463,7 +463,7 @@ test_debug 'git log --graph --decorate --oneline --all'
 
 test_expect_success 'override config option -n with --summary' '
 	git reset --hard c1 &&
-	test_config branch.master.mergeoptions "-n" &&
+	test_config branch.main.mergeoptions "-n" &&
 	test_tick &&
 	git merge --summary c2 >diffstat.txt &&
 	verify_merge file result.1-5 msg.1-5 &&
@@ -477,7 +477,7 @@ test_expect_success 'override config option -n with --summary' '
 
 test_expect_success 'override config option -n with --stat' '
 	git reset --hard c1 &&
-	test_config branch.master.mergeoptions "-n" &&
+	test_config branch.main.mergeoptions "-n" &&
 	test_tick &&
 	git merge --stat c2 >diffstat.txt &&
 	verify_merge file result.1-5 msg.1-5 &&
@@ -493,7 +493,7 @@ test_debug 'git log --graph --decorate --oneline --all'
 
 test_expect_success 'override config option --stat' '
 	git reset --hard c1 &&
-	test_config branch.master.mergeoptions "--stat" &&
+	test_config branch.main.mergeoptions "--stat" &&
 	test_tick &&
 	git merge -n c2 >diffstat.txt &&
 	verify_merge file result.1-5 msg.1-5 &&
@@ -509,7 +509,7 @@ test_debug 'git log --graph --decorate --oneline --all'
 
 test_expect_success 'merge c1 with c2 (override --no-commit)' '
 	git reset --hard c1 &&
-	test_config branch.master.mergeoptions "--no-commit" &&
+	test_config branch.main.mergeoptions "--no-commit" &&
 	test_tick &&
 	git merge --commit c2 &&
 	verify_merge file result.1-5 msg.1-5 &&
@@ -520,7 +520,7 @@ test_debug 'git log --graph --decorate --oneline --all'
 
 test_expect_success 'merge c1 with c2 (override --squash)' '
 	git reset --hard c1 &&
-	test_config branch.master.mergeoptions "--squash" &&
+	test_config branch.main.mergeoptions "--squash" &&
 	test_tick &&
 	git merge --no-squash c2 &&
 	verify_merge file result.1-5 msg.1-5 &&
@@ -549,9 +549,9 @@ test_expect_success 'merge c0 with c1 (merge.ff=false)' '
 '
 test_debug 'git log --graph --decorate --oneline --all'
 
-test_expect_success 'combine branch.master.mergeoptions with merge.ff' '
+test_expect_success 'combine branch.main.mergeoptions with merge.ff' '
 	git reset --hard c0 &&
-	test_config branch.master.mergeoptions "--ff" &&
+	test_config branch.main.mergeoptions "--ff" &&
 	test_config merge.ff "false" &&
 	test_tick &&
 	git merge c1 &&
@@ -593,7 +593,7 @@ test_expect_success 'option --no-ff overrides merge.ff=only config' '
 
 test_expect_success 'merge c0 with c1 (ff overrides no-ff)' '
 	git reset --hard c0 &&
-	test_config branch.master.mergeoptions "--no-ff" &&
+	test_config branch.main.mergeoptions "--no-ff" &&
 	git merge --ff c1 &&
 	verify_merge file result.1 &&
 	verify_head $c1
@@ -606,7 +606,7 @@ test_expect_success 'merge log message' '
 	test_must_be_empty msg.act &&
 
 	git reset --hard c0 &&
-	test_config branch.master.mergeoptions "--no-ff" &&
+	test_config branch.main.mergeoptions "--no-ff" &&
 	git merge --no-log c2 &&
 	git show -s --pretty=format:%b HEAD >msg.act &&
 	test_must_be_empty msg.act &&
@@ -950,10 +950,10 @@ test_expect_success 'set up mod-256 conflict scenario' '
 	git add file &&
 	git commit -m base &&
 
-	# one side changes the first line of each to "master"
-	sed s/-1/-master/ file >tmp &&
+	# one side changes the first line of each to "main"
+	sed s/-1/-main/ file >tmp &&
 	mv tmp file &&
-	git commit -am master &&
+	git commit -am main &&
 
 	# and the other to "side"; merging the two will
 	# yield 256 separate conflicts
@@ -965,12 +965,12 @@ test_expect_success 'set up mod-256 conflict scenario' '
 
 test_expect_success 'merge detects mod-256 conflicts (recursive)' '
 	git reset --hard &&
-	test_must_fail git merge -s recursive master
+	test_must_fail git merge -s recursive main
 '
 
 test_expect_success 'merge detects mod-256 conflicts (resolve)' '
 	git reset --hard &&
-	test_must_fail git merge -s resolve master
+	test_must_fail git merge -s resolve main
 '
 
 test_expect_success 'merge nothing into void' '
diff --git a/t/t7606-merge-custom.sh b/t/t7606-merge-custom.sh
index 8e8c4d7246..81fb7c474c 100755
--- a/t/t7606-merge-custom.sh
+++ b/t/t7606-merge-custom.sh
@@ -4,7 +4,7 @@ test_description="git merge
 
 Testing a custom strategy.
 
-*   (HEAD, master) Merge commit 'c3'
+*   (HEAD, main) Merge commit 'c3'
 |\
 | * (tag: c3) c3
 * | (tag: c1) c1
diff --git a/t/t7608-merge-messages.sh b/t/t7608-merge-messages.sh
index 8e7e0a5865..d5e411daf5 100755
--- a/t/t7608-merge-messages.sh
+++ b/t/t7608-merge-messages.sh
@@ -10,51 +10,51 @@ check_oneline() {
 }
 
 test_expect_success 'merge local branch' '
-	test_commit master-1 &&
+	test_commit main-1 &&
 	git checkout -b local-branch &&
 	test_commit branch-1 &&
-	git checkout master &&
-	test_commit master-2 &&
+	git checkout main &&
+	test_commit main-2 &&
 	git merge local-branch &&
 	check_oneline "Merge branch Qlocal-branchQ"
 '
 
 test_expect_success 'merge octopus branches' '
-	git checkout -b octopus-a master &&
+	git checkout -b octopus-a main &&
 	test_commit octopus-1 &&
-	git checkout -b octopus-b master &&
+	git checkout -b octopus-b main &&
 	test_commit octopus-2 &&
-	git checkout master &&
+	git checkout main &&
 	git merge octopus-a octopus-b &&
 	check_oneline "Merge branches Qoctopus-aQ and Qoctopus-bQ"
 '
 
 test_expect_success 'merge tag' '
-	git checkout -b tag-branch master &&
+	git checkout -b tag-branch main &&
 	test_commit tag-1 &&
-	git checkout master &&
-	test_commit master-3 &&
+	git checkout main &&
+	test_commit main-3 &&
 	git merge tag-1 &&
 	check_oneline "Merge tag Qtag-1Q"
 '
 
 test_expect_success 'ambiguous tag' '
-	git checkout -b ambiguous master &&
+	git checkout -b ambiguous main &&
 	test_commit ambiguous &&
-	git checkout master &&
-	test_commit master-4 &&
+	git checkout main &&
+	test_commit main-4 &&
 	git merge ambiguous &&
 	check_oneline "Merge tag QambiguousQ"
 '
 
 test_expect_success 'remote-tracking branch' '
-	git checkout -b remote master &&
+	git checkout -b remote main &&
 	test_commit remote-1 &&
-	git update-ref refs/remotes/origin/master remote &&
-	git checkout master &&
-	test_commit master-5 &&
-	git merge origin/master &&
-	check_oneline "Merge remote-tracking branch Qorigin/masterQ"
+	git update-ref refs/remotes/origin/main remote &&
+	git checkout main &&
+	test_commit main-5 &&
+	git merge origin/main &&
+	check_oneline "Merge remote-tracking branch Qorigin/mainQ"
 '
 
 test_done
diff --git a/t/t7610-mergetool.sh b/t/t7610-mergetool.sh
index 70afdd06fa..69ef7f7356 100755
--- a/t/t7610-mergetool.sh
+++ b/t/t7610-mergetool.sh
@@ -10,19 +10,19 @@ Testing basic merge tool invocation'
 . ./test-lib.sh
 
 # All the mergetool test work by checking out a temporary branch based
-# off 'branch1' and then merging in master and checking the results of
+# off 'branch1' and then merging in main and checking the results of
 # running mergetool
 
 test_expect_success 'setup' '
 	test_config rerere.enabled true &&
-	echo master >file1 &&
-	echo master spaced >"spaced name" &&
-	echo master file11 >file11 &&
-	echo master file12 >file12 &&
-	echo master file13 >file13 &&
-	echo master file14 >file14 &&
+	echo main >file1 &&
+	echo main spaced >"spaced name" &&
+	echo main file11 >file11 &&
+	echo main file12 >file12 &&
+	echo main file13 >file13 &&
+	echo main file14 >file14 &&
 	mkdir subdir &&
-	echo master sub >subdir/file3 &&
+	echo main sub >subdir/file3 &&
 	test_create_repo submod &&
 	(
 		cd submod &&
@@ -34,7 +34,7 @@ test_expect_success 'setup' '
 	git add file1 "spaced name" file1[1-4] subdir/file3 .gitmodules submod &&
 	git commit -m "add initial versions" &&
 
-	git checkout -b branch1 master &&
+	git checkout -b branch1 main &&
 	git submodule update -N &&
 	echo branch1 change >file1 &&
 	echo branch1 newfile >file2 &&
@@ -71,39 +71,39 @@ test_expect_success 'setup' '
 	test_write_lines one two 3 >c/c/file.txt &&
 	git commit -a -m"move to c" &&
 
-	git checkout -b stash1 master &&
+	git checkout -b stash1 main &&
 	echo stash1 change file11 >file11 &&
 	git add file11 &&
 	git commit -m "stash1 changes" &&
 
-	git checkout -b stash2 master &&
+	git checkout -b stash2 main &&
 	echo stash2 change file11 >file11 &&
 	git add file11 &&
 	git commit -m "stash2 changes" &&
 
-	git checkout master &&
+	git checkout main &&
 	git submodule update -N &&
-	echo master updated >file1 &&
-	echo master new >file2 &&
-	echo master updated spaced >"spaced name" &&
-	echo master both added >both &&
-	echo master updated file12 >file12 &&
-	echo master updated file14 >file14 &&
-	echo master new sub >subdir/file3 &&
+	echo main updated >file1 &&
+	echo main new >file2 &&
+	echo main updated spaced >"spaced name" &&
+	echo main both added >both &&
+	echo main updated file12 >file12 &&
+	echo main updated file14 >file14 &&
+	echo main new sub >subdir/file3 &&
 	(
 		cd submod &&
-		echo master submodule >bar &&
+		echo main submodule >bar &&
 		git add bar &&
-		git commit -m "Add bar on master" &&
-		git checkout -b submod-master
+		git commit -m "Add bar on main" &&
+		git checkout -b submod-main
 	) &&
 	git add file1 "spaced name" file12 file14 file2 subdir/file3 submod &&
 	git add both &&
 	git rm file11 &&
-	git commit -m "master updates" &&
+	git commit -m "main updates" &&
 
 	git clean -fdx &&
-	git checkout -b order-file-start master &&
+	git checkout -b order-file-start main &&
 	echo start >a &&
 	echo start >b &&
 	git add a b &&
@@ -130,7 +130,7 @@ test_expect_success 'custom mergetool' '
 	test_when_finished "git reset --hard" &&
 	git checkout -b test$test_count branch1 &&
 	git submodule update -N &&
-	test_must_fail git merge master &&
+	test_must_fail git merge main &&
 	yes "" | git mergetool both &&
 	yes "" | git mergetool file1 file1 &&
 	yes "" | git mergetool file2 "spaced name" &&
@@ -138,11 +138,11 @@ test_expect_success 'custom mergetool' '
 	yes "d" | git mergetool file11 &&
 	yes "d" | git mergetool file12 &&
 	yes "l" | git mergetool submod &&
-	echo "master updated" >expect &&
+	echo "main updated" >expect &&
 	test_cmp expect file1 &&
-	echo "master new" >expect &&
+	echo "main new" >expect &&
 	test_cmp expect file2 &&
-	echo "master new sub" >expect &&
+	echo "main new sub" >expect &&
 	test_cmp expect subdir/file3 &&
 	echo "branch1 submodule" >expect &&
 	test_cmp expect submod/bar &&
@@ -156,7 +156,7 @@ test_expect_success 'gui mergetool' '
 	test_when_finished "git reset --hard" &&
 	git checkout -b test$test_count branch1 &&
 	git submodule update -N &&
-	test_must_fail git merge master &&
+	test_must_fail git merge main &&
 	yes "" | git mergetool --gui both &&
 	yes "" | git mergetool -g file1 file1 &&
 	yes "" | git mergetool --gui file2 "spaced name" &&
@@ -164,11 +164,11 @@ test_expect_success 'gui mergetool' '
 	yes "d" | git mergetool --gui file11 &&
 	yes "d" | git mergetool --gui file12 &&
 	yes "l" | git mergetool --gui submod &&
-	echo "gui master updated" >expect &&
+	echo "gui main updated" >expect &&
 	test_cmp expect file1 &&
-	echo "gui master new" >expect &&
+	echo "gui main new" >expect &&
 	test_cmp expect file2 &&
-	echo "gui master new sub" >expect &&
+	echo "gui main new sub" >expect &&
 	test_cmp expect subdir/file3 &&
 	echo "branch1 submodule" >expect &&
 	test_cmp expect submod/bar &&
@@ -179,7 +179,7 @@ test_expect_success 'gui mergetool without merge.guitool set falls back to merge
 	test_when_finished "git reset --hard" &&
 	git checkout -b test$test_count branch1 &&
 	git submodule update -N &&
-	test_must_fail git merge master &&
+	test_must_fail git merge main &&
 	yes "" | git mergetool --gui both &&
 	yes "" | git mergetool -g file1 file1 &&
 	yes "" | git mergetool --gui file2 "spaced name" &&
@@ -187,11 +187,11 @@ test_expect_success 'gui mergetool without merge.guitool set falls back to merge
 	yes "d" | git mergetool --gui file11 &&
 	yes "d" | git mergetool --gui file12 &&
 	yes "l" | git mergetool --gui submod &&
-	echo "master updated" >expect &&
+	echo "main updated" >expect &&
 	test_cmp expect file1 &&
-	echo "master new" >expect &&
+	echo "main new" >expect &&
 	test_cmp expect file2 &&
-	echo "master new sub" >expect &&
+	echo "main new sub" >expect &&
 	test_cmp expect subdir/file3 &&
 	echo "branch1 submodule" >expect &&
 	test_cmp expect submod/bar &&
@@ -206,7 +206,7 @@ test_expect_success 'mergetool crlf' '
 	# test_when_finished is LIFO.)
 	test_config core.autocrlf true &&
 	git checkout -b test$test_count branch1 &&
-	test_must_fail git merge master &&
+	test_must_fail git merge main &&
 	yes "" | git mergetool file1 &&
 	yes "" | git mergetool file2 &&
 	yes "" | git mergetool "spaced name" &&
@@ -215,11 +215,11 @@ test_expect_success 'mergetool crlf' '
 	yes "d" | git mergetool file11 &&
 	yes "d" | git mergetool file12 &&
 	yes "r" | git mergetool submod &&
-	test "$(printf x | cat file1 -)" = "$(printf "master updated\r\nx")" &&
-	test "$(printf x | cat file2 -)" = "$(printf "master new\r\nx")" &&
-	test "$(printf x | cat subdir/file3 -)" = "$(printf "master new sub\r\nx")" &&
+	test "$(printf x | cat file1 -)" = "$(printf "main updated\r\nx")" &&
+	test "$(printf x | cat file2 -)" = "$(printf "main new\r\nx")" &&
+	test "$(printf x | cat subdir/file3 -)" = "$(printf "main new sub\r\nx")" &&
 	git submodule update -N &&
-	echo "master submodule" >expect &&
+	echo "main submodule" >expect &&
 	test_cmp expect submod/bar &&
 	git commit -m "branch1 resolved with mergetool - autocrlf"
 '
@@ -230,9 +230,9 @@ test_expect_success 'mergetool in subdir' '
 	git submodule update -N &&
 	(
 		cd subdir &&
-		test_must_fail git merge master &&
+		test_must_fail git merge main &&
 		yes "" | git mergetool file3 &&
-		echo "master new sub" >expect &&
+		echo "main new sub" >expect &&
 		test_cmp expect file3
 	)
 '
@@ -243,7 +243,7 @@ test_expect_success 'mergetool on file in parent dir' '
 	git submodule update -N &&
 	(
 		cd subdir &&
-		test_must_fail git merge master &&
+		test_must_fail git merge main &&
 		yes "" | git mergetool file3 &&
 		yes "" | git mergetool ../file1 &&
 		yes "" | git mergetool ../file2 ../spaced\ name &&
@@ -251,9 +251,9 @@ test_expect_success 'mergetool on file in parent dir' '
 		yes "d" | git mergetool ../file11 &&
 		yes "d" | git mergetool ../file12 &&
 		yes "l" | git mergetool ../submod &&
-		echo "master updated" >expect &&
+		echo "main updated" >expect &&
 		test_cmp expect ../file1 &&
-		echo "master new" >expect &&
+		echo "main new" >expect &&
 		test_cmp expect ../file2 &&
 		echo "branch1 submodule" >expect &&
 		test_cmp expect ../submod/bar &&
@@ -265,7 +265,7 @@ test_expect_success 'mergetool skips autoresolved' '
 	test_when_finished "git reset --hard" &&
 	git checkout -b test$test_count branch1 &&
 	git submodule update -N &&
-	test_must_fail git merge master &&
+	test_must_fail git merge main &&
 	test -n "$(git ls-files -u)" &&
 	yes "d" | git mergetool file11 &&
 	yes "d" | git mergetool file12 &&
@@ -280,17 +280,17 @@ test_expect_success 'mergetool merges all from subdir (rerere disabled)' '
 	test_config rerere.enabled false &&
 	(
 		cd subdir &&
-		test_must_fail git merge master &&
+		test_must_fail git merge main &&
 		yes "r" | git mergetool ../submod &&
 		yes "d" "d" | git mergetool --no-prompt &&
-		echo "master updated" >expect &&
+		echo "main updated" >expect &&
 		test_cmp expect ../file1 &&
-		echo "master new" >expect &&
+		echo "main new" >expect &&
 		test_cmp expect ../file2 &&
-		echo "master new sub" >expect &&
+		echo "main new sub" >expect &&
 		test_cmp expect file3 &&
 		( cd .. && git submodule update -N ) &&
-		echo "master submodule" >expect &&
+		echo "main submodule" >expect &&
 		test_cmp expect ../submod/bar &&
 		git commit -m "branch2 resolved by mergetool from subdir"
 	)
@@ -303,17 +303,17 @@ test_expect_success 'mergetool merges all from subdir (rerere enabled)' '
 	rm -rf .git/rr-cache &&
 	(
 		cd subdir &&
-		test_must_fail git merge master &&
+		test_must_fail git merge main &&
 		yes "r" | git mergetool ../submod &&
 		yes "d" "d" | git mergetool --no-prompt &&
-		echo "master updated" >expect &&
+		echo "main updated" >expect &&
 		test_cmp expect ../file1 &&
-		echo "master new" >expect &&
+		echo "main new" >expect &&
 		test_cmp expect ../file2 &&
-		echo "master new sub" >expect &&
+		echo "main new sub" >expect &&
 		test_cmp expect file3 &&
 		( cd .. && git submodule update -N ) &&
-		echo "master submodule" >expect &&
+		echo "main submodule" >expect &&
 		test_cmp expect ../submod/bar &&
 		git commit -m "branch2 resolved by mergetool from subdir"
 	)
@@ -325,7 +325,7 @@ test_expect_success 'mergetool skips resolved paths when rerere is active' '
 	rm -rf .git/rr-cache &&
 	git checkout -b test$test_count branch1 &&
 	git submodule update -N &&
-	test_must_fail git merge master &&
+	test_must_fail git merge main &&
 	yes "l" | git mergetool --no-prompt submod &&
 	yes "d" "d" | git mergetool --no-prompt &&
 	git submodule update -N &&
@@ -366,11 +366,11 @@ test_expect_success 'mergetool takes partial path' '
 	test_config rerere.enabled false &&
 	git checkout -b test$test_count branch1 &&
 	git submodule update -N &&
-	test_must_fail git merge master &&
+	test_must_fail git merge main &&
 
 	yes "" | git mergetool subdir &&
 
-	echo "master new sub" >expect &&
+	echo "main new sub" >expect &&
 	test_cmp expect subdir/file3
 '
 
@@ -434,7 +434,7 @@ test_expect_success 'deleted vs modified submodule' '
 	git rm --cached submod &&
 	git commit -m "Submodule deleted from branch" &&
 	git checkout -b test$test_count.a test$test_count &&
-	test_must_fail git merge master &&
+	test_must_fail git merge main &&
 	test -n "$(git ls-files -u)" &&
 	yes "" | git mergetool file1 file2 spaced\ name subdir/file3 &&
 	yes "" | git mergetool both &&
@@ -444,7 +444,7 @@ test_expect_success 'deleted vs modified submodule' '
 	echo "branch1 submodule" >expect &&
 	test_cmp expect submod/bar &&
 	git submodule update -N &&
-	echo "master submodule" >expect &&
+	echo "main submodule" >expect &&
 	test_cmp expect submod/bar &&
 	output="$(git mergetool --no-prompt)" &&
 	test "$output" = "No files need merging" &&
@@ -453,7 +453,7 @@ test_expect_success 'deleted vs modified submodule' '
 	mv submod submod-movedaside &&
 	git checkout -b test$test_count.b test$test_count &&
 	git submodule update -N &&
-	test_must_fail git merge master &&
+	test_must_fail git merge main &&
 	test -n "$(git ls-files -u)" &&
 	yes "" | git mergetool file1 file2 spaced\ name subdir/file3 &&
 	yes "" | git mergetool both &&
@@ -465,7 +465,7 @@ test_expect_success 'deleted vs modified submodule' '
 	git commit -m "Merge resolved by deleting module" &&
 
 	mv submod-movedaside submod &&
-	git checkout -b test$test_count.c master &&
+	git checkout -b test$test_count.c main &&
 	git submodule update -N &&
 	test_must_fail git merge test$test_count &&
 	test -n "$(git ls-files -u)" &&
@@ -481,7 +481,7 @@ test_expect_success 'deleted vs modified submodule' '
 	git commit -m "Merge resolved by deleting module" &&
 	mv submod.orig submod &&
 
-	git checkout -b test$test_count.d master &&
+	git checkout -b test$test_count.d main &&
 	git submodule update -N &&
 	test_must_fail git merge test$test_count &&
 	test -n "$(git ls-files -u)" &&
@@ -489,10 +489,10 @@ test_expect_success 'deleted vs modified submodule' '
 	yes "" | git mergetool both &&
 	yes "d" | git mergetool file11 file12 &&
 	yes "l" | git mergetool submod &&
-	echo "master submodule" >expect &&
+	echo "main submodule" >expect &&
 	test_cmp expect submod/bar &&
 	git submodule update -N &&
-	echo "master submodule" >expect &&
+	echo "main submodule" >expect &&
 	test_cmp expect submod/bar &&
 	output="$(git mergetool --no-prompt)" &&
 	test "$output" = "No files need merging" &&
@@ -509,7 +509,7 @@ test_expect_success 'file vs modified submodule' '
 	git add submod &&
 	git commit -m "Submodule path becomes file" &&
 	git checkout -b test$test_count.a branch1 &&
-	test_must_fail git merge master &&
+	test_must_fail git merge main &&
 	test -n "$(git ls-files -u)" &&
 	yes "" | git mergetool file1 file2 spaced\ name subdir/file3 &&
 	yes "" | git mergetool both &&
@@ -519,7 +519,7 @@ test_expect_success 'file vs modified submodule' '
 	echo "branch1 submodule" >expect &&
 	test_cmp expect submod/bar &&
 	git submodule update -N &&
-	echo "master submodule" >expect &&
+	echo "main submodule" >expect &&
 	test_cmp expect submod/bar &&
 	output="$(git mergetool --no-prompt)" &&
 	test "$output" = "No files need merging" &&
@@ -527,7 +527,7 @@ test_expect_success 'file vs modified submodule' '
 
 	mv submod submod-movedaside &&
 	git checkout -b test$test_count.b test$test_count &&
-	test_must_fail git merge master &&
+	test_must_fail git merge main &&
 	test -n "$(git ls-files -u)" &&
 	yes "" | git mergetool file1 file2 spaced\ name subdir/file3 &&
 	yes "" | git mergetool both &&
@@ -547,7 +547,7 @@ test_expect_success 'file vs modified submodule' '
 	test "$output" = "No files need merging" &&
 	git commit -m "Merge resolved by keeping file" &&
 
-	git checkout -b test$test_count.c master &&
+	git checkout -b test$test_count.c main &&
 	rmdir submod && mv submod-movedaside submod &&
 	test ! -e submod.orig &&
 	git submodule update -N &&
@@ -573,7 +573,7 @@ test_expect_success 'file vs modified submodule' '
 	test "$output" = "No files need merging" &&
 	git commit -m "Merge resolved by keeping file" &&
 
-	git checkout -b test$test_count.d master &&
+	git checkout -b test$test_count.d main &&
 	rmdir submod && mv submod.orig submod &&
 	git submodule update -N &&
 	test_must_fail git merge test$test_count &&
@@ -586,10 +586,10 @@ test_expect_success 'file vs modified submodule' '
 	then
 		yes "d" | git mergetool submod~test19
 	fi &&
-	echo "master submodule" >expect &&
+	echo "main submodule" >expect &&
 	test_cmp expect submod/bar &&
 	git submodule update -N &&
-	echo "master submodule" >expect &&
+	echo "main submodule" >expect &&
 	test_cmp expect submod/bar &&
 	output="$(git mergetool --no-prompt)" &&
 	test "$output" = "No files need merging" &&
@@ -672,7 +672,7 @@ test_expect_success 'directory vs modified submodule' '
 	git add submod/file16 &&
 	git commit -m "Submodule path becomes directory" &&
 
-	test_must_fail git merge master &&
+	test_must_fail git merge main &&
 	test -n "$(git ls-files -u)" &&
 	yes "l" | git mergetool submod &&
 	echo "not a submodule" >expect &&
@@ -680,14 +680,14 @@ test_expect_success 'directory vs modified submodule' '
 	rm -rf submod.orig &&
 
 	git reset --hard &&
-	test_must_fail git merge master &&
+	test_must_fail git merge main &&
 	test -n "$(git ls-files -u)" &&
 	test ! -e submod.orig &&
 	if test "$GIT_TEST_MERGE_ALGORITHM" = ort
 	then
-		yes "r" | git mergetool submod~master &&
+		yes "r" | git mergetool submod~main &&
 		git mv submod submod.orig &&
-		git mv submod~master submod
+		git mv submod~main submod
 	else
 		yes "r" | git mergetool submod
 	fi &&
@@ -698,18 +698,18 @@ test_expect_success 'directory vs modified submodule' '
 	mv submod-movedaside/.git submod &&
 	( cd submod && git clean -f && git reset --hard ) &&
 	git submodule update -N &&
-	echo "master submodule" >expect &&
+	echo "main submodule" >expect &&
 	test_cmp expect submod/bar &&
 	git reset --hard &&
 	rm -rf submod-movedaside &&
 
-	git checkout -b test$test_count.c master &&
+	git checkout -b test$test_count.c main &&
 	git submodule update -N &&
 	test_must_fail git merge test$test_count &&
 	test -n "$(git ls-files -u)" &&
 	yes "l" | git mergetool submod &&
 	git submodule update -N &&
-	echo "master submodule" >expect &&
+	echo "main submodule" >expect &&
 	test_cmp expect submod/bar &&
 
 	git reset --hard &&
@@ -721,7 +721,7 @@ test_expect_success 'directory vs modified submodule' '
 	echo "not a submodule" >expect &&
 	test_cmp expect submod/file16 &&
 
-	git reset --hard master &&
+	git reset --hard main &&
 	( cd submod && git clean -f && git reset --hard ) &&
 	git submodule update -N
 '
@@ -729,7 +729,7 @@ test_expect_success 'directory vs modified submodule' '
 test_expect_success 'file with no base' '
 	test_when_finished "git reset --hard" &&
 	git checkout -b test$test_count branch1 &&
-	test_must_fail git merge master &&
+	test_must_fail git merge main &&
 	git mergetool --no-prompt --tool mybase -- both &&
 	test_must_be_empty both
 '
@@ -739,9 +739,9 @@ test_expect_success 'custom commands override built-ins' '
 	git checkout -b test$test_count branch1 &&
 	test_config mergetool.defaults.cmd "cat \"\$REMOTE\" >\"\$MERGED\"" &&
 	test_config mergetool.defaults.trustExitCode true &&
-	test_must_fail git merge master &&
+	test_must_fail git merge main &&
 	git mergetool --no-prompt --tool defaults -- both &&
-	echo master both added >expected &&
+	echo main both added >expected &&
 	test_cmp expected both
 '
 
@@ -751,7 +751,7 @@ test_expect_success 'filenames seen by tools start with ./' '
 	test_config mergetool.writeToTemp false &&
 	test_config mergetool.myecho.cmd "echo \"\$LOCAL\"" &&
 	test_config mergetool.myecho.trustExitCode true &&
-	test_must_fail git merge master &&
+	test_must_fail git merge main &&
 	git mergetool --no-prompt --tool myecho -- both >actual &&
 	grep ^\./both_LOCAL_ actual
 '
@@ -768,7 +768,7 @@ test_expect_success MKTEMP 'temporary filenames are used with mergetool.writeToT
 	test_config mergetool.writeToTemp true &&
 	test_config mergetool.myecho.cmd "echo \"\$LOCAL\"" &&
 	test_config mergetool.myecho.trustExitCode true &&
-	test_must_fail git merge master &&
+	test_must_fail git merge main &&
 	git mergetool --no-prompt --tool myecho -- both >actual &&
 	! grep ^\./both_LOCAL_ actual &&
 	grep /both_LOCAL_ actual
diff --git a/t/t7611-merge-abort.sh b/t/t7611-merge-abort.sh
index 7c84a518aa..8e95182566 100755
--- a/t/t7611-merge-abort.sh
+++ b/t/t7611-merge-abort.sh
@@ -7,7 +7,7 @@ Set up repo with conflicting and non-conflicting branches:
 There are three files foo/bar/baz, and the following graph illustrates the
 content of these files in each commit:
 
-# foo/bar/baz --- foo/bar/bazz     <-- master
+# foo/bar/baz --- foo/bar/bazz     <-- main
 #             \
 #              --- foo/barf/bazf   <-- conflict_branch
 #               \
@@ -40,7 +40,7 @@ test_expect_success 'setup' '
 	git checkout -b clean_branch HEAD^ &&
 	echo bart > bar &&
 	git commit -a -m "clean" &&
-	git checkout master
+	git checkout main
 '
 
 pre_merge_head="$(git rev-parse HEAD)"
diff --git a/t/t7612-merge-verify-signatures.sh b/t/t7612-merge-verify-signatures.sh
index a426f3a89a..6c52b6ac1e 100755
--- a/t/t7612-merge-verify-signatures.sh
+++ b/t/t7612-merge-verify-signatures.sh
@@ -31,7 +31,7 @@ test_expect_success GPG 'create signed commits' '
 	echo 3 >baz && git add baz &&
 	test_tick && git commit -SB7227189 -m "untrusted on side" &&
 
-	git checkout master
+	git checkout main
 '
 
 test_expect_success GPG 'merge unsigned commit with verification' '
diff --git a/t/t7614-merge-signoff.sh b/t/t7614-merge-signoff.sh
index c1b8446f49..1e901224cd 100755
--- a/t/t7614-merge-signoff.sh
+++ b/t/t7614-merge-signoff.sh
@@ -11,17 +11,17 @@ This test runs git merge --signoff and makes sure that it works.
 test_setup() {
 	# Expected commit message after merge --signoff
 	cat >expected-signed <<EOF &&
-Merge branch 'master' into other-branch
+Merge branch 'main' into other-branch
 
 Signed-off-by: $(git var GIT_COMMITTER_IDENT | sed -e "s/>.*/>/")
 EOF
 
 	# Expected commit message after merge without --signoff (or with --no-signoff)
 	cat >expected-unsigned <<EOF &&
-Merge branch 'master' into other-branch
+Merge branch 'main' into other-branch
 EOF
 
-	# Initial commit and feature branch to merge master into it.
+	# Initial commit and feature branch to merge main into it.
 	git commit --allow-empty -m "Initial empty commit" &&
 	git checkout -b other-branch &&
 	test_commit other-branch file1 1
@@ -38,30 +38,30 @@ test_expect_success 'setup' '
 
 # Test with --signoff flag
 test_expect_success 'git merge --signoff adds a sign-off line' '
-	git checkout master &&
-	test_commit master-branch-2 file2 2 &&
+	git checkout main &&
+	test_commit main-branch-2 file2 2 &&
 	git checkout other-branch &&
-	git merge master --signoff --no-edit &&
+	git merge main --signoff --no-edit &&
 	git cat-file commit HEAD | sed -e "1,/^\$/d" >actual &&
 	test_cmp expected-signed actual
 '
 
 # Test without --signoff flag
 test_expect_success 'git merge does not add a sign-off line' '
-	git checkout master &&
-	test_commit master-branch-3 file3 3 &&
+	git checkout main &&
+	test_commit main-branch-3 file3 3 &&
 	git checkout other-branch &&
-	git merge master --no-edit &&
+	git merge main --no-edit &&
 	git cat-file commit HEAD | sed -e "1,/^\$/d" >actual &&
 	test_cmp expected-unsigned actual
 '
 
 # Test for --no-signoff flag
 test_expect_success 'git merge --no-signoff flag cancels --signoff flag' '
-	git checkout master &&
-	test_commit master-branch-4 file4 4 &&
+	git checkout main &&
+	test_commit main-branch-4 file4 4 &&
 	git checkout other-branch &&
-	git merge master --no-edit --signoff --no-signoff &&
+	git merge main --no-edit --signoff --no-signoff &&
 	git cat-file commit HEAD | sed -e "1,/^\$/d" >actual &&
 	test_cmp expected-unsigned actual
 '
diff --git a/t/t7701-repack-unpack-unreachable.sh b/t/t7701-repack-unpack-unreachable.sh
index 48261ba080..852c81d13e 100755
--- a/t/t7701-repack-unpack-unreachable.sh
+++ b/t/t7701-repack-unpack-unreachable.sh
@@ -22,7 +22,7 @@ test_expect_success '-A with -d option leaves unreachable objects unpacked' '
 	git commit -a -m more_content &&
 	csha1=$(git rev-parse HEAD^{commit}) &&
 	tsha1=$(git rev-parse HEAD^{tree}) &&
-	git checkout master &&
+	git checkout main &&
 	echo even more content >> file1 &&
 	test_tick &&
 	git commit -a -m even_more_content &&
diff --git a/t/t7800-difftool.sh b/t/t7800-difftool.sh
index a578b35761..31e719e361 100755
--- a/t/t7800-difftool.sh
+++ b/t/t7800-difftool.sh
@@ -35,23 +35,23 @@ test_expect_success 'basic usage requires no repo' '
 	test_i18ngrep ^usage: output
 '
 
-# Create a file on master and change it on branch
+# Create a file on main and change it on branch
 test_expect_success 'setup' '
-	echo master >file &&
+	echo main >file &&
 	git add file &&
 	git commit -m "added file" &&
 
-	git checkout -b branch master &&
+	git checkout -b branch main &&
 	echo branch >file &&
 	git commit -a -m "branch changed file" &&
-	git checkout master
+	git checkout main
 '
 
 # Configure a custom difftool.<tool>.cmd and use it
 test_expect_success 'custom commands' '
 	difftool_test_setup &&
 	test_config difftool.test-tool.cmd "cat \"\$REMOTE\"" &&
-	echo master >expect &&
+	echo main >expect &&
 	git difftool --no-prompt branch >actual &&
 	test_cmp expect actual &&
 
@@ -63,7 +63,7 @@ test_expect_success 'custom commands' '
 
 test_expect_success 'custom tool commands override built-ins' '
 	test_config difftool.vimdiff.cmd "cat \"\$REMOTE\"" &&
-	echo master >expect &&
+	echo main >expect &&
 	git difftool --tool vimdiff --no-prompt branch >actual &&
 	test_cmp expect actual
 '
@@ -311,21 +311,21 @@ test_expect_success 'difftool.<tool>.path' '
 
 test_expect_success 'difftool --extcmd=cat' '
 	echo branch >expect &&
-	echo master >>expect &&
+	echo main >>expect &&
 	git difftool --no-prompt --extcmd=cat branch >actual &&
 	test_cmp expect actual
 '
 
 test_expect_success 'difftool --extcmd cat' '
 	echo branch >expect &&
-	echo master >>expect &&
+	echo main >>expect &&
 	git difftool --no-prompt --extcmd=cat branch >actual &&
 	test_cmp expect actual
 '
 
 test_expect_success 'difftool -x cat' '
 	echo branch >expect &&
-	echo master >>expect &&
+	echo main >>expect &&
 	git difftool --no-prompt -x cat branch >actual &&
 	test_cmp expect actual
 '
@@ -338,7 +338,7 @@ test_expect_success 'difftool --extcmd echo arg1' '
 '
 
 test_expect_success 'difftool --extcmd cat arg1' '
-	echo master >expect &&
+	echo main >expect &&
 	git difftool --no-prompt \
 		--extcmd sh\ -c\ \"cat\ \$1\" branch >actual &&
 	test_cmp expect actual
@@ -351,7 +351,7 @@ test_expect_success 'difftool --extcmd cat arg2' '
 	test_cmp expect actual
 '
 
-# Create a second file on master and a different version on branch
+# Create a second file on main and a different version on branch
 test_expect_success 'setup with 2 files different' '
 	echo m2 >file2 &&
 	git add file2 &&
@@ -361,7 +361,7 @@ test_expect_success 'setup with 2 files different' '
 	echo br2 >file2 &&
 	git add file2 &&
 	git commit -a -m "branch changed file2" &&
-	git checkout master
+	git checkout main
 '
 
 test_expect_success 'say no to the first file' '
@@ -369,14 +369,14 @@ test_expect_success 'say no to the first file' '
 	git difftool -x cat branch <input >output &&
 	grep m2 output &&
 	grep br2 output &&
-	! grep master output &&
+	! grep main output &&
 	! grep branch output
 '
 
 test_expect_success 'say no to the second file' '
 	(echo && echo n) >input &&
 	git difftool -x cat branch <input >output &&
-	grep master output &&
+	grep main output &&
 	grep branch output &&
 	! grep m2 output &&
 	! grep br2 output
@@ -384,7 +384,7 @@ test_expect_success 'say no to the second file' '
 
 test_expect_success 'ending prompt input with EOF' '
 	git difftool -x cat branch </dev/null >output &&
-	! grep master output &&
+	! grep main output &&
 	! grep branch output &&
 	! grep m2 output &&
 	! grep br2 output
@@ -396,9 +396,9 @@ test_expect_success 'difftool --tool-help' '
 '
 
 test_expect_success 'setup change in subdirectory' '
-	git checkout master &&
+	git checkout main &&
 	mkdir sub &&
-	echo master >sub/sub &&
+	echo main >sub/sub &&
 	git add sub/sub &&
 	git commit -m "added sub/sub" &&
 	git tag v1 &&
@@ -526,7 +526,7 @@ run_dir_diff_test 'difftool --dir-diff from subdirectory with GIT_DIR set' '
 run_dir_diff_test 'difftool --dir-diff when worktree file is missing' '
 	test_when_finished git reset --hard &&
 	rm file2 &&
-	git difftool --dir-diff $symlinks --extcmd ls branch master >output &&
+	git difftool --dir-diff $symlinks --extcmd ls branch main >output &&
 	grep file2 output
 '
 
@@ -543,7 +543,7 @@ run_dir_diff_test 'difftool --dir-diff with unmerged files' '
 	echo b >>file &&
 	git add file &&
 	git commit -m conflict-b &&
-	git checkout master &&
+	git checkout main &&
 	git merge conflict-a &&
 	test_must_fail git merge conflict-b &&
 	cat >expect <<-EOF &&
diff --git a/t/t7810-grep.sh b/t/t7810-grep.sh
index 991d5bd9c0..bee57a4e08 100755
--- a/t/t7810-grep.sh
+++ b/t/t7810-grep.sh
@@ -1206,19 +1206,19 @@ test_expect_success 'grep -e -- -- path' '
 '
 
 test_expect_success 'dashdash disambiguates rev as rev' '
-	test_when_finished "rm -f master" &&
-	echo content >master &&
-	echo master:hello.c >expect &&
-	git grep -l o master -- hello.c >actual &&
+	test_when_finished "rm -f main" &&
+	echo content >main &&
+	echo main:hello.c >expect &&
+	git grep -l o main -- hello.c >actual &&
 	test_cmp expect actual
 '
 
 test_expect_success 'dashdash disambiguates pathspec as pathspec' '
-	test_when_finished "git rm -f master" &&
-	echo content >master &&
-	git add master &&
-	echo master:content >expect &&
-	git grep o -- master >actual &&
+	test_when_finished "git rm -f main" &&
+	echo content >main &&
+	git add main &&
+	echo main:content >expect &&
+	git grep o -- main >actual &&
 	test_cmp expect actual
 '
 
@@ -1254,15 +1254,15 @@ test_expect_success 'grep --no-index pattern -- path' '
 '
 
 test_expect_success 'grep --no-index complains of revs' '
-	test_must_fail git grep --no-index o master -- 2>err &&
+	test_must_fail git grep --no-index o main -- 2>err &&
 	test_i18ngrep "cannot be used with revs" err
 '
 
 test_expect_success 'grep --no-index prefers paths to revs' '
-	test_when_finished "rm -f master" &&
-	echo content >master &&
-	echo master:content >expect &&
-	git grep --no-index o master >actual &&
+	test_when_finished "rm -f main" &&
+	echo content >main &&
+	echo main:content >expect &&
+	git grep --no-index o main >actual &&
 	test_cmp expect actual
 '
 
diff --git a/t/test-lib.sh b/t/test-lib.sh
index 056d9591aa..6ce12ad6d8 100644
--- a/t/test-lib.sh
+++ b/t/test-lib.sh
@@ -257,13 +257,13 @@ case "$TRASH_DIRECTORY" in
 esac
 
 case "$TEST_NUMBER" in
-3404|4013|5310|5526|6300|7064)
+3404|4013|5310|5526|6300|7064|7817)
 	# Avoid conflicts with patch series that are cooking at the same time
 	# as the patch series changing the default of `init.defaultBranch`.
 	GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
 	export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 	;;
-[0-6]*|7[0-4]*)
+[0-7]*)
 	GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 	export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 	;;
-- 
gitgitgadget


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH v2 22/27] t8*: adjust the references to the default branch name "main"
  2020-11-17 16:12 ` [PATCH v2 00/27] tests: use " Johannes Schindelin via GitGitGadget
                     ` (20 preceding siblings ...)
  2020-11-17 16:12   ` [PATCH v2 21/27] t7[5-9]*: " Johannes Schindelin via GitGitGadget
@ 2020-11-17 16:12   ` Johannes Schindelin via GitGitGadget
  2020-11-17 16:12   ` [PATCH v2 23/27] t9[0-4]*: " Johannes Schindelin via GitGitGadget
                     ` (6 subsequent siblings)
  28 siblings, 0 replies; 163+ messages in thread
From: Johannes Schindelin via GitGitGadget @ 2020-11-17 16:12 UTC (permalink / raw)
  To: git
  Cc: Felipe Contreras, Ævar Arnfjörð Bjarmason,
	Johannes Schindelin, Jeff King, Johannes Schindelin,
	Johannes Schindelin

From: Johannes Schindelin <johannes.schindelin@gmx.de>

This trick was performed via

	$ (cd t &&
	   sed -i -e 's/master/main/g' -e 's/MASTER/MAIN/g' \
		-e 's/Master/Main/g' -- t8*.sh annotate*.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>
---
 t/annotate-tests.sh             |  8 ++++----
 t/t8001-annotate.sh             |  2 +-
 t/t8003-blame-corner-cases.sh   |  4 ++--
 t/t8004-blame-with-conflicts.sh | 14 +++++++-------
 t/test-lib.sh                   |  2 +-
 5 files changed, 15 insertions(+), 15 deletions(-)

diff --git a/t/annotate-tests.sh b/t/annotate-tests.sh
index 3aee61d2cc..ee5d2d4cf8 100644
--- a/t/annotate-tests.sh
+++ b/t/annotate-tests.sh
@@ -95,7 +95,7 @@ test_expect_success 'blame 2 authors' '
 '
 
 test_expect_success 'setup B1 lines (branch1)' '
-	git checkout -b branch1 master &&
+	git checkout -b branch1 main &&
 	echo "3A slow green fox jumps into the" >>file &&
 	echo "well." >>file &&
 	GIT_AUTHOR_NAME="B1" GIT_AUTHOR_EMAIL="B1@test.git" \
@@ -107,7 +107,7 @@ test_expect_success 'blame 2 authors + 1 branch1 author' '
 '
 
 test_expect_success 'setup B2 lines (branch2)' '
-	git checkout -b branch2 master &&
+	git checkout -b branch2 main &&
 	sed -e "s/2A quick brown/4A quick brown lazy dog/" <file >file.new &&
 	mv file.new file &&
 	GIT_AUTHOR_NAME="B2" GIT_AUTHOR_EMAIL="B2@test.git" \
@@ -131,11 +131,11 @@ test_expect_success 'blame --first-parent blames merge for branch1' '
 '
 
 test_expect_success 'blame ancestor' '
-	check_count -h master A 2 B 2
+	check_count -h main A 2 B 2
 '
 
 test_expect_success 'blame great-ancestor' '
-	check_count -h master^ A 2
+	check_count -h main^ A 2
 '
 
 test_expect_success 'setup evil merge' '
diff --git a/t/t8001-annotate.sh b/t/t8001-annotate.sh
index 72176e42c1..3687fc58d8 100755
--- a/t/t8001-annotate.sh
+++ b/t/t8001-annotate.sh
@@ -7,7 +7,7 @@ PROG='git annotate'
 . "$TEST_DIRECTORY"/annotate-tests.sh
 
 test_expect_success 'annotate old revision' '
-	git annotate file master >actual &&
+	git annotate file main >actual &&
 	awk "{ print \$3; }" <actual >authors &&
 	test 2 = $(grep A <authors | wc -l) &&
 	test 2 = $(grep B <authors | wc -l)
diff --git a/t/t8003-blame-corner-cases.sh b/t/t8003-blame-corner-cases.sh
index ba8013b002..2e499b4511 100755
--- a/t/t8003-blame-corner-cases.sh
+++ b/t/t8003-blame-corner-cases.sh
@@ -161,13 +161,13 @@ test_expect_success 'blame wholesale copy and more in the index' '
 
 test_expect_success 'blame during cherry-pick with file rename conflict' '
 
-	test_when_finished "git reset --hard && git checkout master" &&
+	test_when_finished "git reset --hard && git checkout main" &&
 	git checkout HEAD~3 &&
 	echo MOUSE >> mouse &&
 	git mv mouse rodent &&
 	git add rodent &&
 	GIT_AUTHOR_NAME=Rodent git commit -m "rodent" &&
-	git checkout --detach master &&
+	git checkout --detach main &&
 	(git cherry-pick HEAD@{1} || test $? -eq 1) &&
 	git show HEAD@{1}:rodent > rodent &&
 	git add rodent &&
diff --git a/t/t8004-blame-with-conflicts.sh b/t/t8004-blame-with-conflicts.sh
index 9c353ab222..b6c992ec45 100755
--- a/t/t8004-blame-with-conflicts.sh
+++ b/t/t8004-blame-with-conflicts.sh
@@ -21,16 +21,16 @@ test_expect_success 'setup first case' '
 	git add file2 &&
 	git commit --author "U Gly <ug@localhost>" -m ugly &&
 
-	# Back to master and change something
-	git checkout master &&
+	# Back to main and change something
+	git checkout main &&
 	echo "
 
 bla" >> file1 &&
 	git commit --author "Old Line <ol@localhost>" -a -m file1.b &&
 
-	# Back to foo and merge master
+	# Back to foo and merge main
 	git checkout foo &&
-	if git merge master; then
+	if git merge main; then
 		echo needed conflict here
 		exit 1
 	else
@@ -44,8 +44,8 @@ Even more" > file2 &&
 	git rm file1 &&
 	git commit --author "M Result <mr@localhost>" -a -m merged &&
 
-	# Back to master and change file1 again
-	git checkout master &&
+	# Back to main and change file1 again
+	git checkout main &&
 	sed s/bla/foo/ <file1 >X &&
 	rm file1 &&
 	mv X file1 &&
@@ -53,7 +53,7 @@ Even more" > file2 &&
 
 	# Try to merge into foo again
 	git checkout foo &&
-	if git merge master; then
+	if git merge main; then
 		echo needed conflict here
 		exit 1
 	else
diff --git a/t/test-lib.sh b/t/test-lib.sh
index 6ce12ad6d8..a63945569f 100644
--- a/t/test-lib.sh
+++ b/t/test-lib.sh
@@ -263,7 +263,7 @@ case "$TEST_NUMBER" in
 	GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
 	export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 	;;
-[0-7]*)
+[0-8]*)
 	GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 	export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 	;;
-- 
gitgitgadget


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH v2 23/27] t9[0-4]*: adjust the references to the default branch name "main"
  2020-11-17 16:12 ` [PATCH v2 00/27] tests: use " Johannes Schindelin via GitGitGadget
                     ` (21 preceding siblings ...)
  2020-11-17 16:12   ` [PATCH v2 22/27] t8*: " Johannes Schindelin via GitGitGadget
@ 2020-11-17 16:12   ` Johannes Schindelin via GitGitGadget
  2020-11-17 16:12   ` [PATCH v2 24/27] t9[5-7]*: " Johannes Schindelin via GitGitGadget
                     ` (5 subsequent siblings)
  28 siblings, 0 replies; 163+ messages in thread
From: Johannes Schindelin via GitGitGadget @ 2020-11-17 16:12 UTC (permalink / raw)
  To: git
  Cc: Felipe Contreras, Ævar Arnfjörð Bjarmason,
	Johannes Schindelin, Jeff King, Johannes Schindelin,
	Johannes Schindelin

From: Johannes Schindelin <johannes.schindelin@gmx.de>

This trick was performed via

	$ (cd t &&
	   sed -i -e 's/master/main/g' -e 's/MASTER/MAIN/g' \
		-e 's/Master/Main/g' -- t9[0-4]*.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>
---
 t/t9001-send-email.sh                  | 28 ++++-----
 t/t9100-git-svn-basic.sh               |  2 +-
 t/t9145-git-svn-master-branch.sh       |  6 +-
 t/t9151-svn-mergeinfo.sh               |  2 +-
 t/t9155-git-svn-fetch-deleted-tag.sh   |  2 +-
 t/t9156-git-svn-fetch-deleted-tag-2.sh |  6 +-
 t/t9163-git-svn-reset-clears-caches.sh |  2 +-
 t/t9169-git-svn-dcommit-crlf.sh        |  2 +-
 t/t9300-fast-import.sh                 | 82 ++++++++++++------------
 t/t9301-fast-import-notes.sh           | 14 ++---
 t/t9302-fast-import-unpack-limit.sh    | 16 ++---
 t/t9350-fast-export.sh                 | 86 +++++++++++++-------------
 t/t9351-fast-export-anonymize.sh       |  4 +-
 t/t9400-git-cvsserver-server.sh        | 32 +++++-----
 t/t9401-git-cvsserver-crlf.sh          | 16 ++---
 t/t9402-git-cvsserver-refs.sh          |  8 +--
 t/test-lib.sh                          |  2 +-
 17 files changed, 155 insertions(+), 155 deletions(-)

diff --git a/t/t9001-send-email.sh b/t/t9001-send-email.sh
index a08f72596a..579360d2f1 100755
--- a/t/t9001-send-email.sh
+++ b/t/t9001-send-email.sh
@@ -1168,10 +1168,10 @@ test_expect_success $PREREQ '--compose-encoding adds correct MIME for subject' '
 '
 
 test_expect_success $PREREQ 'detects ambiguous reference/file conflict' '
-	echo master >master &&
-	git add master &&
-	git commit -m"add master" &&
-	test_must_fail git send-email --dry-run master 2>errors &&
+	echo main >main &&
+	git add main &&
+	git commit -m"add main" &&
+	test_must_fail git send-email --dry-run main 2>errors &&
 	grep disambiguate errors
 '
 
@@ -1185,7 +1185,7 @@ test_expect_success $PREREQ 'feed two files' '
 		outdir/000?-*.patch 2>errors >out &&
 	grep "^Subject: " out >subjects &&
 	test "z$(sed -n -e 1p subjects)" = "zSubject: [PATCH 1/2] Second." &&
-	test "z$(sed -n -e 2p subjects)" = "zSubject: [PATCH 2/2] add master"
+	test "z$(sed -n -e 2p subjects)" = "zSubject: [PATCH 2/2] add main"
 '
 
 test_expect_success $PREREQ 'in-reply-to but no threading' '
@@ -2037,7 +2037,7 @@ test_expect_success $PREREQ 'setup expected-list' '
 	--cc="Cc2 <cc2@example.com>" \
 	--bcc="bcc1@example.com" \
 	--bcc="bcc2@example.com" \
-	0001-add-master.patch | replace_variable_fields \
+	0001-add-main.patch | replace_variable_fields \
 	>expected-list
 '
 
@@ -2049,7 +2049,7 @@ test_expect_success $PREREQ 'use email list in --cc --to and --bcc' '
 	--to="to3@example.com" \
 	--cc="Cc 1 <cc1@example.com>, Cc2 <cc2@example.com>" \
 	--bcc="bcc1@example.com, bcc2@example.com" \
-	0001-add-master.patch | replace_variable_fields \
+	0001-add-main.patch | replace_variable_fields \
 	>actual-list &&
 	test_cmp expected-list actual-list
 '
@@ -2065,7 +2065,7 @@ test_expect_success $PREREQ 'aliases work with email list' '
 	--to="To 1 <to1@example.com>, to2, to3@example.com" \
 	--cc="cc1, Cc2 <cc2@example.com>" \
 	--bcc="bcc1@example.com, bcc2@example.com" \
-	0001-add-master.patch | replace_variable_fields \
+	0001-add-main.patch | replace_variable_fields \
 	>actual-list &&
 	test_cmp expected-list actual-list
 '
@@ -2089,7 +2089,7 @@ test_expect_success $PREREQ 'leading and trailing whitespaces are removed' '
 	--cc="Cc2 <cc2@example.com>" \
 	--bcc="$BCC1" \
 	--bcc="bcc2@example.com" \
-	0001-add-master.patch | replace_variable_fields \
+	0001-add-main.patch | replace_variable_fields \
 	>actual-list &&
 	test_cmp expected-list actual-list
 '
@@ -2108,8 +2108,8 @@ test_expect_success $PREREQ 'invoke hook' '
 		false
 		;;
 	esac &&
-	test -f 0001-add-master.patch &&
-	grep "add master" "$1"
+	test -f 0001-add-main.patch &&
+	grep "add main" "$1"
 	EOF
 
 	mkdir subdir &&
@@ -2121,10 +2121,10 @@ test_expect_success $PREREQ 'invoke hook' '
 			--from="Example <nobody@example.com>" \
 			--to=nobody@example.com \
 			--smtp-server="$(pwd)/../fake.sendmail" \
-			../0001-add-master.patch &&
+			../0001-add-main.patch &&
 
 		# Verify error message when a patch is rejected by the hook
-		sed -e "s/add master/x/" ../0001-add-master.patch >../another.patch &&
+		sed -e "s/add main/x/" ../0001-add-main.patch >../another.patch &&
 		test_must_fail git send-email \
 			--from="Example <nobody@example.com>" \
 			--to=nobody@example.com \
@@ -2139,7 +2139,7 @@ test_expect_success $PREREQ 'test that send-email works outside a repo' '
 		--from="Example <nobody@example.com>" \
 		--to=nobody@example.com \
 		--smtp-server="$(pwd)/fake.sendmail" \
-		"$(pwd)/0001-add-master.patch"
+		"$(pwd)/0001-add-main.patch"
 '
 
 test_expect_success $PREREQ 'test that sendmail config is rejected' '
diff --git a/t/t9100-git-svn-basic.sh b/t/t9100-git-svn-basic.sh
index e4bb22034e..7dbf4b8fa0 100755
--- a/t/t9100-git-svn-basic.sh
+++ b/t/t9100-git-svn-basic.sh
@@ -275,7 +275,7 @@ test_expect_success 'dcommit $rev does not clobber current branch' '
 	test refs/heads/my-bar = $(git symbolic-ref HEAD) &&
 	git log refs/remotes/bar | grep "change 1" &&
 	! git log refs/remotes/bar | grep "change 2" &&
-	git checkout master &&
+	git checkout main &&
 	git branch -D my-bar
 	'
 
diff --git a/t/t9145-git-svn-master-branch.sh b/t/t9145-git-svn-master-branch.sh
index 3bbf341f6a..c5acce010d 100755
--- a/t/t9145-git-svn-master-branch.sh
+++ b/t/t9145-git-svn-master-branch.sh
@@ -2,7 +2,7 @@
 #
 # Copyright (c) 2009 Eric Wong
 #
-test_description='git svn initial master branch is "trunk" if possible'
+test_description='git svn initial main branch is "trunk" if possible'
 . ./lib-git-svn.sh
 
 test_expect_success 'setup test repository' '
@@ -13,12 +13,12 @@ test_expect_success 'setup test repository' '
 	svn_cmd import -m b/b i "$svnrepo/branches/b"
 '
 
-test_expect_success 'git svn clone --stdlayout sets up trunk as master' '
+test_expect_success 'git svn clone --stdlayout sets up trunk as main' '
 	git svn clone -s "$svnrepo" g &&
 	(
 		cd g &&
 		test x$(git rev-parse --verify refs/remotes/origin/trunk^0) = \
-		     x$(git rev-parse --verify refs/heads/master^0)
+		     x$(git rev-parse --verify refs/heads/main^0)
 	)
 '
 
diff --git a/t/t9151-svn-mergeinfo.sh b/t/t9151-svn-mergeinfo.sh
index 4f6c06ecb2..e2f63823f1 100755
--- a/t/t9151-svn-mergeinfo.sh
+++ b/t/t9151-svn-mergeinfo.sh
@@ -50,7 +50,7 @@ test_expect_success 'merging two branches in one commit is detected correctly' '
 	'
 
 test_expect_failure 'everything got merged in the end' '
-	unmerged=$(git rev-list --all --not master) &&
+	unmerged=$(git rev-list --all --not main) &&
 	[ -z "$unmerged" ]
 	'
 
diff --git a/t/t9155-git-svn-fetch-deleted-tag.sh b/t/t9155-git-svn-fetch-deleted-tag.sh
index 184336f346..891c209238 100755
--- a/t/t9155-git-svn-fetch-deleted-tag.sh
+++ b/t/t9155-git-svn-fetch-deleted-tag.sh
@@ -36,7 +36,7 @@ test_expect_success 'fetch deleted tags from same revision with checksum error'
 	git svn fetch &&
 
 	git diff --exit-code origin/mybranch:trunk/subdir/file origin/tags/mytag:file &&
-	git diff --exit-code master:subdir/file origin/tags/mytag^:file
+	git diff --exit-code main:subdir/file origin/tags/mytag^:file
 '
 
 test_done
diff --git a/t/t9156-git-svn-fetch-deleted-tag-2.sh b/t/t9156-git-svn-fetch-deleted-tag-2.sh
index 7a6e33ba3c..0b91063edb 100755
--- a/t/t9156-git-svn-fetch-deleted-tag-2.sh
+++ b/t/t9156-git-svn-fetch-deleted-tag-2.sh
@@ -36,9 +36,9 @@ test_expect_success 'fetch deleted tags from same revision with no checksum erro
 	cd git_project &&
 	git svn fetch &&
 
-	git diff --exit-code master:subdir3/file origin/tags/mytag:file &&
-	git diff --exit-code master:subdir2/file origin/tags/mytag^:file &&
-	git diff --exit-code master:subdir1/file origin/tags/mytag^^:file
+	git diff --exit-code main:subdir3/file origin/tags/mytag:file &&
+	git diff --exit-code main:subdir2/file origin/tags/mytag^:file &&
+	git diff --exit-code main:subdir1/file origin/tags/mytag^^:file
 '
 
 test_done
diff --git a/t/t9163-git-svn-reset-clears-caches.sh b/t/t9163-git-svn-reset-clears-caches.sh
index d6245cee08..0da856338f 100755
--- a/t/t9163-git-svn-reset-clears-caches.sh
+++ b/t/t9163-git-svn-reset-clears-caches.sh
@@ -59,7 +59,7 @@ test_expect_success 'fetch to merge-base (a)' '
 test_expect_success 'rebase looses SVN merge (m)' '
 	git svn rebase &&
 	git svn fetch &&
-	test 1 = $(git cat-file -p master|grep parent|wc -l)
+	test 1 = $(git cat-file -p main|grep parent|wc -l)
 '
 
 # git svn fetch creates correct history with merge commit
diff --git a/t/t9169-git-svn-dcommit-crlf.sh b/t/t9169-git-svn-dcommit-crlf.sh
index 54b1f61a2a..5016896ae6 100755
--- a/t/t9169-git-svn-dcommit-crlf.sh
+++ b/t/t9169-git-svn-dcommit-crlf.sh
@@ -14,7 +14,7 @@ test_expect_success 'setup commit repository' '
 		p=$(git rev-parse HEAD) &&
 		t=$(git write-tree) &&
 		cmt=$(git commit-tree -p $p $t <cmt) &&
-		git update-ref refs/heads/master $cmt &&
+		git update-ref refs/heads/main $cmt &&
 		git cat-file commit HEAD | tail -n4 >out &&
 		test_cmp cmt out &&
 		git svn dcommit &&
diff --git a/t/t9300-fast-import.sh b/t/t9300-fast-import.sh
index 308c1ef42c..e66f438e64 100755
--- a/t/t9300-fast-import.sh
+++ b/t/t9300-fast-import.sh
@@ -62,7 +62,7 @@ test_expect_success 'A: create pack from stdin' '
 	mark :4
 	data $file4_len
 	$file4_data
-	commit refs/heads/master
+	commit refs/heads/main
 	mark :5
 	committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
 	data <<COMMIT
@@ -117,7 +117,7 @@ test_expect_success 'A: create pack from stdin' '
 
 	INPUT_END
 	git fast-import --export-marks=marks.out <input &&
-	git whatchanged master
+	git whatchanged main
 '
 
 test_expect_success 'A: verify pack' '
@@ -131,7 +131,7 @@ test_expect_success 'A: verify commit' '
 
 	initial
 	EOF
-	git cat-file commit master | sed 1d >actual &&
+	git cat-file commit main | sed 1d >actual &&
 	test_cmp expect actual
 '
 
@@ -141,31 +141,31 @@ test_expect_success 'A: verify tree' '
 	100644 blob file3
 	100755 blob file4
 	EOF
-	git cat-file -p master^{tree} | sed "s/ [0-9a-f]*	/ /" >actual &&
+	git cat-file -p main^{tree} | sed "s/ [0-9a-f]*	/ /" >actual &&
 	test_cmp expect actual
 '
 
 test_expect_success 'A: verify file2' '
 	echo "$file2_data" >expect &&
-	git cat-file blob master:file2 >actual &&
+	git cat-file blob main:file2 >actual &&
 	test_cmp expect actual
 '
 
 test_expect_success 'A: verify file3' '
 	echo "$file3_data" >expect &&
-	git cat-file blob master:file3 >actual &&
+	git cat-file blob main:file3 >actual &&
 	test_cmp expect actual
 '
 
 test_expect_success 'A: verify file4' '
 	printf "$file4_data" >expect &&
-	git cat-file blob master:file4 >actual &&
+	git cat-file blob main:file4 >actual &&
 	test_cmp expect actual
 '
 
 test_expect_success 'A: verify tag/series-A' '
 	cat >expect <<-EOF &&
-	object $(git rev-parse refs/heads/master)
+	object $(git rev-parse refs/heads/main)
 	type commit
 	tag series-A
 
@@ -177,7 +177,7 @@ test_expect_success 'A: verify tag/series-A' '
 
 test_expect_success 'A: verify tag/series-A-blob' '
 	cat >expect <<-EOF &&
-	object $(git rev-parse refs/heads/master:file3)
+	object $(git rev-parse refs/heads/main:file3)
 	type blob
 	tag series-A-blob
 
@@ -193,13 +193,13 @@ test_expect_success 'A: verify tag deletion is successful' '
 
 test_expect_success 'A: verify marks output' '
 	cat >expect <<-EOF &&
-	:2 $(git rev-parse --verify master:file2)
-	:3 $(git rev-parse --verify master:file3)
-	:4 $(git rev-parse --verify master:file4)
-	:5 $(git rev-parse --verify master^0)
+	:2 $(git rev-parse --verify main:file2)
+	:3 $(git rev-parse --verify main:file3)
+	:4 $(git rev-parse --verify main:file4)
+	:5 $(git rev-parse --verify main^0)
 	:6 $(git cat-file tag nested | grep object | cut -d" " -f 2)
 	:7 $(git rev-parse --verify nested)
-	:8 $(git rev-parse --verify master^0)
+	:8 $(git rev-parse --verify main^0)
 	EOF
 	test_cmp expect marks.out
 '
@@ -217,7 +217,7 @@ test_expect_success 'A: tag blob by sha1' '
 	new_blob=$(echo testing | git hash-object --stdin) &&
 	cat >input <<-INPUT_END &&
 	tag series-A-blob-2
-	from $(git rev-parse refs/heads/master:file3)
+	from $(git rev-parse refs/heads/main:file3)
 	data <<EOF
 	Tag blob by sha1.
 	EOF
@@ -243,7 +243,7 @@ test_expect_success 'A: tag blob by sha1' '
 	INPUT_END
 
 	cat >expect <<-EOF &&
-	object $(git rev-parse refs/heads/master:file3)
+	object $(git rev-parse refs/heads/main:file3)
 	type blob
 	tag series-A-blob-2
 
@@ -284,13 +284,13 @@ test_expect_success 'A: verify pack' '
 '
 
 test_expect_success 'A: verify diff' '
-	copy=$(git rev-parse --verify master:file2) &&
+	copy=$(git rev-parse --verify main:file2) &&
 	cat >expect <<-EOF &&
 	:000000 100755 $ZERO_OID $copy A	copy-of-file2
 	EOF
-	git diff-tree -M -r master verify--import-marks >actual &&
+	git diff-tree -M -r main verify--import-marks >actual &&
 	compare_diff_raw expect actual &&
-	test $(git rev-parse --verify master:file2) \
+	test $(git rev-parse --verify main:file2) \
 	    = $(git rev-parse --verify verify--import-marks:copy-of-file2)
 '
 
@@ -364,7 +364,7 @@ test_expect_success 'B: fail on invalid blob sha1' '
 	corrupt
 	COMMIT
 
-	from refs/heads/master
+	from refs/heads/main
 	M 755 $(echo $ZERO_OID | sed -e "s/0$/1/") zero1
 
 	INPUT_END
@@ -381,7 +381,7 @@ test_expect_success 'B: accept branch name "TEMP_TAG"' '
 	tag base
 	COMMIT
 
-	from refs/heads/master
+	from refs/heads/main
 
 	INPUT_END
 
@@ -390,7 +390,7 @@ test_expect_success 'B: accept branch name "TEMP_TAG"' '
 		git prune" &&
 	git fast-import <input &&
 	test -f .git/TEMP_TAG &&
-	test $(git rev-parse master) = $(git rev-parse TEMP_TAG^)
+	test $(git rev-parse main) = $(git rev-parse TEMP_TAG^)
 '
 
 test_expect_success 'B: accept empty committer' '
@@ -528,8 +528,8 @@ test_expect_success 'B: fail on invalid committer (5)' '
 
 test_expect_success 'C: incremental import create pack from stdin' '
 	newf=$(echo hi newf | git hash-object -w --stdin) &&
-	oldf=$(git rev-parse --verify master:file2) &&
-	thrf=$(git rev-parse --verify master:file3) &&
+	oldf=$(git rev-parse --verify main:file2) &&
+	thrf=$(git rev-parse --verify main:file3) &&
 	test_tick &&
 	cat >input <<-INPUT_END &&
 	commit refs/heads/branch
@@ -538,7 +538,7 @@ test_expect_success 'C: incremental import create pack from stdin' '
 	second
 	COMMIT
 
-	from refs/heads/master
+	from refs/heads/main
 	M 644 $oldf file2/oldf
 	M 755 $newf file2/newf
 	D file3
@@ -560,7 +560,7 @@ test_expect_success 'C: validate reuse existing blob' '
 
 test_expect_success 'C: verify commit' '
 	cat >expect <<-EOF &&
-	parent $(git rev-parse --verify master^0)
+	parent $(git rev-parse --verify main^0)
 	author $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
 	committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
 
@@ -578,7 +578,7 @@ test_expect_success 'C: validate rename result' '
 	:100644 100644 $oldf $oldf R100	file2	file2/oldf
 	:100644 000000 $thrf $zero D	file3
 	EOF
-	git diff-tree -M -r master branch >actual &&
+	git diff-tree -M -r main branch >actual &&
 	compare_diff_raw expect actual
 '
 
@@ -1698,7 +1698,7 @@ test_expect_success 'P: superproject & submodule mix' '
 	committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
 	data 8
 	initial
-	from refs/heads/master
+	from refs/heads/main
 	M 100644 :3 .gitmodules
 	M 160000 :2 sub
 
@@ -1733,8 +1733,8 @@ test_expect_success 'P: superproject & submodule mix' '
 	(
 		cd sub &&
 		git init &&
-		git fetch --update-head-ok .. refs/heads/sub:refs/heads/master &&
-		git checkout master
+		git fetch --update-head-ok .. refs/heads/sub:refs/heads/main &&
+		git checkout main
 	) &&
 	git submodule init &&
 	git submodule update
@@ -1758,7 +1758,7 @@ test_expect_success 'P: verbatim SHA gitlinks' '
 	committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
 	data 8
 	initial
-	from refs/heads/master
+	from refs/heads/main
 	M 100644 :1 .gitmodules
 	M 160000 $SUBPREV sub
 
@@ -3429,8 +3429,8 @@ mark :1
 data 4
 foo
 
-reset refs/heads/master
-commit refs/heads/master
+reset refs/heads/main
+commit refs/heads/main
 mark :2
 author Full Name <user@company.tld> 1000000000 +0100
 committer Full Name <user@company.tld> 1000000000 +0100
@@ -3444,7 +3444,7 @@ data 8
 foo
 bar
 
-commit refs/heads/master
+commit refs/heads/main
 mark :4
 author Full Name <user@company.tld> 1000000001 +0100
 committer Full Name <user@company.tld> 1000000001 +0100
@@ -3461,8 +3461,8 @@ mark :1
 data 4
 foo
 
-reset refs/heads/master
-commit refs/heads/master
+reset refs/heads/main
+commit refs/heads/main
 mark :2
 author Full Name <user@company.tld> 2000000000 +0100
 committer Full Name <user@company.tld> 2000000000 +0100
@@ -3477,7 +3477,7 @@ data 73
 	path = sub1
 	url = https://void.example.com/main.git
 
-commit refs/heads/master
+commit refs/heads/main
 mark :4
 author Full Name <user@company.tld> 2000000001 +0100
 committer Full Name <user@company.tld> 2000000001 +0100
@@ -3493,7 +3493,7 @@ data 8
 foo
 bar
 
-commit refs/heads/master
+commit refs/heads/main
 mark :6
 author Full Name <user@company.tld> 2000000002 +0100
 committer Full Name <user@company.tld> 2000000002 +0100
@@ -3511,8 +3511,8 @@ Y_INPUT_END
 
 test_expect_success 'Y: setup' '
 	test_oid_cache <<-EOF
-	Ymaster sha1:9afed2f9161ddf416c0a1863b8b0725b00070504
-	Ymaster sha256:c0a1010da1df187b2e287654793df01b464bd6f8e3f17fc1481a7dadf84caee3
+	Ymain sha1:9afed2f9161ddf416c0a1863b8b0725b00070504
+	Ymain sha256:c0a1010da1df187b2e287654793df01b464bd6f8e3f17fc1481a7dadf84caee3
 	EOF
 '
 
@@ -3524,7 +3524,7 @@ test_expect_success 'Y: rewrite submodules' '
 		git -C sub2 fast-import --export-marks=../sub2-marks <../Y-sub-input &&
 		git fast-import --rewrite-submodules-from=sub:../Y-marks \
 			--rewrite-submodules-to=sub:sub2-marks <../Y-main-input &&
-		test "$(git rev-parse master)" = "$(test_oid Ymaster)"
+		test "$(git rev-parse main)" = "$(test_oid Ymain)"
 	)
 '
 
diff --git a/t/t9301-fast-import-notes.sh b/t/t9301-fast-import-notes.sh
index 14c1baa739..ea6efbd387 100755
--- a/t/t9301-fast-import-notes.sh
+++ b/t/t9301-fast-import-notes.sh
@@ -9,7 +9,7 @@ test_description='test git fast-import of notes objects'
 
 test_tick
 cat >input <<INPUT_END
-commit refs/heads/master
+commit refs/heads/main
 committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
 data <<COMMIT
 first commit
@@ -30,7 +30,7 @@ data <<EOF
 file baz/xyzzy in first commit
 EOF
 
-commit refs/heads/master
+commit refs/heads/main
 committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
 data <<COMMIT
 second commit
@@ -46,7 +46,7 @@ data <<EOF
 file baz/xyzzy in second commit
 EOF
 
-commit refs/heads/master
+commit refs/heads/main
 committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
 data <<COMMIT
 third commit
@@ -57,7 +57,7 @@ data <<EOF
 file foo in third commit
 EOF
 
-commit refs/heads/master
+commit refs/heads/main
 committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
 data <<COMMIT
 fourth commit
@@ -70,13 +70,13 @@ EOF
 
 INPUT_END
 
-test_expect_success 'set up master branch' '
+test_expect_success 'set up main branch' '
 
 	git fast-import <input &&
-	git whatchanged master
+	git whatchanged main
 '
 
-commit4=$(git rev-parse refs/heads/master)
+commit4=$(git rev-parse refs/heads/main)
 commit3=$(git rev-parse "$commit4^")
 commit2=$(git rev-parse "$commit4~2")
 commit1=$(git rev-parse "$commit4~3")
diff --git a/t/t9302-fast-import-unpack-limit.sh b/t/t9302-fast-import-unpack-limit.sh
index bb1c39cfcc..f519e4f1bf 100755
--- a/t/t9302-fast-import-unpack-limit.sh
+++ b/t/t9302-fast-import-unpack-limit.sh
@@ -5,7 +5,7 @@ test_description='test git fast-import unpack limit'
 test_expect_success 'create loose objects on import' '
 	test_tick &&
 	cat >input <<-INPUT_END &&
-	commit refs/heads/master
+	commit refs/heads/main
 	committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
 	data <<COMMIT
 	initial
@@ -23,12 +23,12 @@ test_expect_success 'create loose objects on import' '
 test_expect_success 'bigger packs are preserved' '
 	test_tick &&
 	cat >input <<-INPUT_END &&
-	commit refs/heads/master
+	commit refs/heads/main
 	committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
 	data <<COMMIT
 	incremental should create a pack
 	COMMIT
-	from refs/heads/master^0
+	from refs/heads/main^0
 
 	commit refs/heads/branch
 	committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
@@ -48,7 +48,7 @@ test_expect_success 'bigger packs are preserved' '
 test_expect_success 'lookups after checkpoint works' '
 	hello_id=$(echo hello | git hash-object --stdin -t blob) &&
 	id="$GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE" &&
-	before=$(git rev-parse refs/heads/master^0) &&
+	before=$(git rev-parse refs/heads/main^0) &&
 	(
 		cat <<-INPUT_END &&
 		blob
@@ -56,13 +56,13 @@ test_expect_success 'lookups after checkpoint works' '
 		data 6
 		hello
 
-		commit refs/heads/master
+		commit refs/heads/main
 		mark :2
 		committer $id
 		data <<COMMIT
 		checkpoint after this
 		COMMIT
-		from refs/heads/master^0
+		from refs/heads/main^0
 		M 100644 :1 hello
 
 		# pre-checkpoint
@@ -86,10 +86,10 @@ test_expect_success 'lookups after checkpoint works' '
 				n=$(($n + 1))
 			fi &&
 			sleep 1 &&
-			from=$(git rev-parse refs/heads/master^0)
+			from=$(git rev-parse refs/heads/main^0)
 		done &&
 		cat <<-INPUT_END &&
-		commit refs/heads/master
+		commit refs/heads/main
 		committer $id
 		data <<COMMIT
 		make sure from "unpacked sha1 reference" works, too
diff --git a/t/t9350-fast-export.sh b/t/t9350-fast-export.sh
index 1372842559..0715eefd52 100755
--- a/t/t9350-fast-export.sh
+++ b/t/t9350-fast-export.sh
@@ -31,13 +31,13 @@ test_expect_success 'setup' '
 	git commit -m sitzt file2 &&
 	test_tick &&
 	git tag -a -m valentin muss &&
-	git merge -s ours master
+	git merge -s ours main
 
 '
 
 test_expect_success 'fast-export | fast-import' '
 
-	MASTER=$(git rev-parse --verify master) &&
+	MAIN=$(git rev-parse --verify main) &&
 	REIN=$(git rev-parse --verify rein) &&
 	WER=$(git rev-parse --verify wer) &&
 	MUSS=$(git rev-parse --verify muss) &&
@@ -46,7 +46,7 @@ test_expect_success 'fast-export | fast-import' '
 	git fast-export --all >actual &&
 	(cd new &&
 	 git fast-import &&
-	 test $MASTER = $(git rev-parse --verify refs/heads/master) &&
+	 test $MAIN = $(git rev-parse --verify refs/heads/main) &&
 	 test $REIN = $(git rev-parse --verify refs/tags/rein) &&
 	 test $WER = $(git rev-parse --verify refs/heads/wer) &&
 	 test $MUSS = $(git rev-parse --verify refs/tags/muss)) <actual
@@ -80,35 +80,35 @@ test_expect_success 'fast-export --mark-tags ^muss^{commit} muss' '
 	test_cmp expected actual
 '
 
-test_expect_success 'fast-export master~2..master' '
+test_expect_success 'fast-export main~2..main' '
 
-	git fast-export master~2..master >actual &&
-	sed "s/master/partial/" actual |
+	git fast-export main~2..main >actual &&
+	sed "s/main/partial/" actual |
 		(cd new &&
 		 git fast-import &&
-		 test $MASTER != $(git rev-parse --verify refs/heads/partial) &&
-		 git diff --exit-code master partial &&
-		 git diff --exit-code master^ partial^ &&
+		 test $MAIN != $(git rev-parse --verify refs/heads/partial) &&
+		 git diff --exit-code main partial &&
+		 git diff --exit-code main^ partial^ &&
 		 test_must_fail git rev-parse partial~2)
 
 '
 
-test_expect_success 'fast-export --reference-excluded-parents master~2..master' '
+test_expect_success 'fast-export --reference-excluded-parents main~2..main' '
 
-	git fast-export --reference-excluded-parents master~2..master >actual &&
-	grep commit.refs/heads/master actual >commit-count &&
+	git fast-export --reference-excluded-parents main~2..main >actual &&
+	grep commit.refs/heads/main actual >commit-count &&
 	test_line_count = 2 commit-count &&
-	sed "s/master/rewrite/" actual |
+	sed "s/main/rewrite/" actual |
 		(cd new &&
 		 git fast-import &&
-		 test $MASTER = $(git rev-parse --verify refs/heads/rewrite))
+		 test $MAIN = $(git rev-parse --verify refs/heads/rewrite))
 '
 
 test_expect_success 'fast-export --show-original-ids' '
 
-	git fast-export --show-original-ids master >output &&
+	git fast-export --show-original-ids main >output &&
 	grep ^original-oid output| sed -e s/^original-oid.// | sort >actual &&
-	git rev-list --objects master muss >objects-and-names &&
+	git rev-list --objects main muss >objects-and-names &&
 	awk "{print \$1}" objects-and-names | sort >commits-trees-blobs &&
 	comm -23 actual commits-trees-blobs >unfound &&
 	test_must_be_empty unfound
@@ -116,8 +116,8 @@ test_expect_success 'fast-export --show-original-ids' '
 
 test_expect_success 'fast-export --show-original-ids | git fast-import' '
 
-	git fast-export --show-original-ids master muss | git fast-import --quiet &&
-	test $MASTER = $(git rev-parse --verify refs/heads/master) &&
+	git fast-export --show-original-ids main muss | git fast-import --quiet &&
+	test $MAIN = $(git rev-parse --verify refs/heads/main) &&
 	test $MUSS = $(git rev-parse --verify refs/tags/muss)
 '
 
@@ -200,7 +200,7 @@ test_expect_success 'encoding preserved if reencoding fails' '
 
 test_expect_success 'import/export-marks' '
 
-	git checkout -b marks master &&
+	git checkout -b marks main &&
 	git fast-export --export-marks=tmp-marks HEAD &&
 	test -s tmp-marks &&
 	test_line_count = 3 tmp-marks &&
@@ -265,7 +265,7 @@ test_expect_success 'signed-tags=warn-strip' '
 
 test_expect_success 'setup submodule' '
 
-	git checkout -f master &&
+	git checkout -f main &&
 	mkdir sub &&
 	(
 		cd sub &&
@@ -290,17 +290,17 @@ test_expect_success 'setup submodule' '
 
 test_expect_success 'submodule fast-export | fast-import' '
 
-	SUBENT1=$(git ls-tree master^ sub) &&
-	SUBENT2=$(git ls-tree master sub) &&
+	SUBENT1=$(git ls-tree main^ sub) &&
+	SUBENT2=$(git ls-tree main sub) &&
 	rm -rf new &&
 	mkdir new &&
 	git --git-dir=new/.git init &&
 	git fast-export --signed-tags=strip --all >actual &&
 	(cd new &&
 	 git fast-import &&
-	 test "$SUBENT1" = "$(git ls-tree refs/heads/master^ sub)" &&
-	 test "$SUBENT2" = "$(git ls-tree refs/heads/master sub)" &&
-	 git checkout master &&
+	 test "$SUBENT1" = "$(git ls-tree refs/heads/main^ sub)" &&
+	 test "$SUBENT2" = "$(git ls-tree refs/heads/main sub)" &&
+	 git checkout main &&
 	 git submodule init &&
 	 git submodule update &&
 	 cmp sub/file ../sub/file) <actual
@@ -352,7 +352,7 @@ test_expect_success 'fast-export -C -C | fast-import' '
 
 '
 
-test_expect_success 'fast-export | fast-import when master is tagged' '
+test_expect_success 'fast-export | fast-import when main is tagged' '
 
 	git tag -m msg last &&
 	git fast-export -C -C --signed-tags=strip --all > output &&
@@ -467,8 +467,8 @@ mark :2
 data 3
 hi
 
-reset refs/heads/master
-commit refs/heads/master
+reset refs/heads/main
+commit refs/heads/main
 mark :3
 author A U Thor <author@example.com> 1112912713 -0700
 committer C O Mitter <committer@example.com> 1112912713 -0700
@@ -482,7 +482,7 @@ EOF
 test_expect_failure 'no exact-ref revisions included' '
 	(
 		cd limit-by-paths &&
-		git fast-export master~2..master~1 > output &&
+		git fast-export main~2..main~1 > output &&
 		test_cmp expected output
 	)
 '
@@ -524,7 +524,7 @@ test_expect_success 'full-tree re-shows unmodified files'        '
 '
 
 test_expect_success 'set-up a few more tags for tag export tests' '
-	git checkout -f master &&
+	git checkout -f main &&
 	HEAD_TREE=$(git show -s --pretty=raw HEAD | grep tree | sed "s/tree //") &&
 	git tag    tree_tag        -m "tagging a tree" $HEAD_TREE &&
 	git tag -a tree_tag-obj    -m "tagging a tree" $HEAD_TREE &&
@@ -549,7 +549,7 @@ test_expect_success 'tag-obj_tag'     'git fast-export tag-obj_tag'
 test_expect_success 'tag-obj_tag-obj' 'git fast-export tag-obj_tag-obj'
 
 test_expect_success 'handling tags of blobs' '
-	git tag -a -m "Tag of a blob" blobtag $(git rev-parse master:file) &&
+	git tag -a -m "Tag of a blob" blobtag $(git rev-parse main:file) &&
 	git fast-export blobtag >actual &&
 	cat >expect <<-EOF &&
 	blob
@@ -592,10 +592,10 @@ test_expect_success 'directory becomes symlink'        '
 	) &&
 	(
 		cd dirtosymlink &&
-		git fast-export master -- foo |
+		git fast-export main -- foo |
 		(cd ../result && git fast-import --quiet)
 	) &&
-	(cd result && git show master:foo)
+	(cd result && git show main:foo)
 '
 
 test_expect_success 'fast-export quotes pathnames' '
@@ -643,7 +643,7 @@ mark :13
 data 5
 bump
 
-commit refs/heads/master
+commit refs/heads/main
 mark :14
 author A U Thor <author@example.com> 1112912773 -0700
 committer C O Mitter <committer@example.com> 1112912773 -0700
@@ -657,18 +657,18 @@ EOF
 test_expect_success 'avoid uninteresting refs' '
 	> tmp-marks &&
 	git fast-export --import-marks=tmp-marks \
-		--export-marks=tmp-marks master > /dev/null &&
+		--export-marks=tmp-marks main > /dev/null &&
 	git tag v1.0 &&
 	git branch uninteresting &&
 	echo bump > file &&
 	git commit -a -m bump &&
 	git fast-export --import-marks=tmp-marks \
-		--export-marks=tmp-marks ^uninteresting ^v1.0 master > actual &&
+		--export-marks=tmp-marks ^uninteresting ^v1.0 main > actual &&
 	test_cmp expected actual
 '
 
 cat > expected << EOF
-reset refs/heads/master
+reset refs/heads/main
 from :14
 
 EOF
@@ -676,14 +676,14 @@ EOF
 test_expect_success 'refs are updated even if no commits need to be exported' '
 	> tmp-marks &&
 	git fast-export --import-marks=tmp-marks \
-		--export-marks=tmp-marks master > /dev/null &&
+		--export-marks=tmp-marks main > /dev/null &&
 	git fast-export --import-marks=tmp-marks \
-		--export-marks=tmp-marks master > actual &&
+		--export-marks=tmp-marks main > actual &&
 	test_cmp expected actual
 '
 
 test_expect_success 'use refspec' '
-	git fast-export --refspec refs/heads/master:refs/heads/foobar master >actual2 &&
+	git fast-export --refspec refs/heads/main:refs/heads/foobar main >actual2 &&
 	grep "^commit " actual2 | sort | uniq >actual &&
 	echo "commit refs/heads/foobar" > expected &&
 	test_cmp expected actual
@@ -736,13 +736,13 @@ test_expect_success 'merge commit gets exported with --import-marks' '
 		test_commit initial &&
 		git checkout -b topic &&
 		test_commit on-topic &&
-		git checkout master &&
-		test_commit on-master &&
+		git checkout main &&
+		test_commit on-main &&
 		test_tick &&
 		git merge --no-ff -m Yeah topic &&
 
 		echo ":1 $(git rev-parse HEAD^^)" >marks &&
-		git fast-export --import-marks=marks master >out &&
+		git fast-export --import-marks=marks main >out &&
 		grep Yeah out
 	)
 '
diff --git a/t/t9351-fast-export-anonymize.sh b/t/t9351-fast-export-anonymize.sh
index 5ac2c3b5ee..c07175db47 100755
--- a/t/t9351-fast-export-anonymize.sh
+++ b/t/t9351-fast-export-anonymize.sh
@@ -51,7 +51,7 @@ test_expect_success 'stream retains other as refname' '
 '
 
 test_expect_success 'stream omits other refnames' '
-	! grep master stream &&
+	! grep main stream &&
 	! grep mytag stream
 '
 
@@ -85,7 +85,7 @@ test_expect_success 'repo has original shape and timestamps' '
 	shape () {
 		git log --format="%m %ct" --left-right --boundary "$@"
 	} &&
-	(cd .. && shape master...other) >expect &&
+	(cd .. && shape main...other) >expect &&
 	shape $main_branch...$other_branch >actual &&
 	test_cmp expect actual
 '
diff --git a/t/t9400-git-cvsserver-server.sh b/t/t9400-git-cvsserver-server.sh
index 4a46f31c41..9aa49c6906 100755
--- a/t/t9400-git-cvsserver-server.sh
+++ b/t/t9400-git-cvsserver-server.sh
@@ -45,7 +45,7 @@ test_expect_success 'setup' '
   touch secondrootfile &&
   git add secondrootfile &&
   git commit -m "second root") &&
-  git fetch secondroot master &&
+  git fetch secondroot main &&
   git merge --allow-unrelated-histories FETCH_HEAD &&
   git clone -q --bare "$WORKDIR/.git" "$SERVERDIR" >/dev/null 2>&1 &&
   GIT_DIR="$SERVERDIR" git config --bool gitcvs.enabled true &&
@@ -57,7 +57,7 @@ test_expect_success 'setup' '
 # note that cvs doesn't accept absolute pathnames
 # as argument to co -d
 test_expect_success 'basic checkout' \
-  'GIT_CONFIG="$git_config" cvs -Q co -d cvswork master &&
+  'GIT_CONFIG="$git_config" cvs -Q co -d cvswork main &&
    test "$(echo $(grep -v ^D cvswork/CVS/Entries|cut -d/ -f2,3,5 | head -n 1))" = "empty/1.1/" &&
    test "$(echo $(grep -v ^D cvswork/CVS/Entries|cut -d/ -f2,3,5 | sed -ne \$p))" = "secondrootfile/1.1/"'
 
@@ -226,7 +226,7 @@ GIT_DIR="$SERVERDIR" git config --bool gitcvs.enabled true || exit 1
 
 test_expect_success 'gitcvs.enabled = false' \
   'GIT_DIR="$SERVERDIR" git config --bool gitcvs.enabled false &&
-   if GIT_CONFIG="$git_config" cvs -Q co -d cvswork2 master >cvs.log 2>&1
+   if GIT_CONFIG="$git_config" cvs -Q co -d cvswork2 main >cvs.log 2>&1
    then
      echo unexpected cvs success
      false
@@ -240,14 +240,14 @@ rm -fr cvswork2
 test_expect_success 'gitcvs.ext.enabled = true' \
   'GIT_DIR="$SERVERDIR" git config --bool gitcvs.ext.enabled true &&
    GIT_DIR="$SERVERDIR" git config --bool gitcvs.enabled false &&
-   GIT_CONFIG="$git_config" cvs -Q co -d cvswork2 master >cvs.log 2>&1 &&
+   GIT_CONFIG="$git_config" cvs -Q co -d cvswork2 main >cvs.log 2>&1 &&
    test_cmp cvswork cvswork2'
 
 rm -fr cvswork2
 test_expect_success 'gitcvs.ext.enabled = false' \
   'GIT_DIR="$SERVERDIR" git config --bool gitcvs.ext.enabled false &&
    GIT_DIR="$SERVERDIR" git config --bool gitcvs.enabled true &&
-   if GIT_CONFIG="$git_config" cvs -Q co -d cvswork2 master >cvs.log 2>&1
+   if GIT_CONFIG="$git_config" cvs -Q co -d cvswork2 main >cvs.log 2>&1
    then
      echo unexpected cvs success
      false
@@ -261,21 +261,21 @@ rm -fr cvswork2
 test_expect_success 'gitcvs.dbname' \
   'GIT_DIR="$SERVERDIR" git config --bool gitcvs.ext.enabled true &&
    GIT_DIR="$SERVERDIR" git config gitcvs.dbname %Ggitcvs.%a.%m.sqlite &&
-   GIT_CONFIG="$git_config" cvs -Q co -d cvswork2 master >cvs.log 2>&1 &&
+   GIT_CONFIG="$git_config" cvs -Q co -d cvswork2 main >cvs.log 2>&1 &&
    test_cmp cvswork cvswork2 &&
-   test -f "$SERVERDIR/gitcvs.ext.master.sqlite" &&
-   cmp "$SERVERDIR/gitcvs.master.sqlite" "$SERVERDIR/gitcvs.ext.master.sqlite"'
+   test -f "$SERVERDIR/gitcvs.ext.main.sqlite" &&
+   cmp "$SERVERDIR/gitcvs.main.sqlite" "$SERVERDIR/gitcvs.ext.main.sqlite"'
 
 rm -fr cvswork2
 test_expect_success 'gitcvs.ext.dbname' \
   'GIT_DIR="$SERVERDIR" git config --bool gitcvs.ext.enabled true &&
    GIT_DIR="$SERVERDIR" git config gitcvs.ext.dbname %Ggitcvs1.%a.%m.sqlite &&
    GIT_DIR="$SERVERDIR" git config gitcvs.dbname %Ggitcvs2.%a.%m.sqlite &&
-   GIT_CONFIG="$git_config" cvs -Q co -d cvswork2 master >cvs.log 2>&1 &&
+   GIT_CONFIG="$git_config" cvs -Q co -d cvswork2 main >cvs.log 2>&1 &&
    test_cmp cvswork cvswork2 &&
-   test -f "$SERVERDIR/gitcvs1.ext.master.sqlite" &&
-   test ! -f "$SERVERDIR/gitcvs2.ext.master.sqlite" &&
-   cmp "$SERVERDIR/gitcvs.master.sqlite" "$SERVERDIR/gitcvs1.ext.master.sqlite"'
+   test -f "$SERVERDIR/gitcvs1.ext.main.sqlite" &&
+   test ! -f "$SERVERDIR/gitcvs2.ext.main.sqlite" &&
+   cmp "$SERVERDIR/gitcvs.main.sqlite" "$SERVERDIR/gitcvs1.ext.main.sqlite"'
 
 
 #------------
@@ -457,7 +457,7 @@ cd "$WORKDIR"
 test_expect_success 'cvs update (module list supports packed refs)' '
     GIT_DIR="$SERVERDIR" git pack-refs --all &&
     GIT_CONFIG="$git_config" cvs -n up -d 2> out &&
-    grep "cvs update: New directory \`master'\''" < out
+    grep "cvs update: New directory \`main'\''" < out
 '
 
 #------------
@@ -499,8 +499,8 @@ test_expect_success 'cvs status (no subdirs in header)' '
 cd "$WORKDIR"
 test_expect_success 'cvs co -c (shows module database)' '
     GIT_CONFIG="$git_config" cvs co -c > out &&
-    grep "^master[	 ][ 	]*master$" <out &&
-    ! grep -v "^master[	 ][ 	]*master$" <out
+    grep "^main[	 ][ 	]*main$" <out &&
+    ! grep -v "^main[	 ][ 	]*main$" <out
 '
 
 #------------
@@ -526,7 +526,7 @@ test_expect_success 'cvs co -c (shows module database)' '
 
 sed -e 's/^x//' -e 's/SP$/ /' > "$WORKDIR/expect" <<EOF
 x
-xRCS file: $WORKDIR/gitcvs.git/master/merge,v
+xRCS file: $WORKDIR/gitcvs.git/main/merge,v
 xWorking file: merge
 xhead: 1.4
 xbranch:
diff --git a/t/t9401-git-cvsserver-crlf.sh b/t/t9401-git-cvsserver-crlf.sh
index c7a0dd84a4..8046a25b1f 100755
--- a/t/t9401-git-cvsserver-crlf.sh
+++ b/t/t9401-git-cvsserver-crlf.sh
@@ -105,14 +105,14 @@ test_expect_success 'setup' '
 '
 
 test_expect_success 'cvs co (default crlf)' '
-    GIT_CONFIG="$git_config" cvs -Q co -d cvswork master >cvs.log 2>&1 &&
+    GIT_CONFIG="$git_config" cvs -Q co -d cvswork main >cvs.log 2>&1 &&
     test x"$(grep '/-k' cvswork/CVS/Entries cvswork/subdir/CVS/Entries)" = x""
 '
 
 rm -rf cvswork
 test_expect_success 'cvs co (allbinary)' '
     GIT_DIR="$SERVERDIR" git config --bool gitcvs.allbinary true &&
-    GIT_CONFIG="$git_config" cvs -Q co -d cvswork master >cvs.log 2>&1 &&
+    GIT_CONFIG="$git_config" cvs -Q co -d cvswork main >cvs.log 2>&1 &&
     marked_as cvswork textfile.c -kb &&
     marked_as cvswork binfile.bin -kb &&
     marked_as cvswork .gitattributes -kb &&
@@ -125,7 +125,7 @@ test_expect_success 'cvs co (allbinary)' '
 rm -rf cvswork cvs.log
 test_expect_success 'cvs co (use attributes/allbinary)' '
     GIT_DIR="$SERVERDIR" git config --bool gitcvs.usecrlfattr true &&
-    GIT_CONFIG="$git_config" cvs -Q co -d cvswork master >cvs.log 2>&1 &&
+    GIT_CONFIG="$git_config" cvs -Q co -d cvswork main >cvs.log 2>&1 &&
     marked_as cvswork textfile.c "" &&
     marked_as cvswork binfile.bin -kb &&
     marked_as cvswork .gitattributes -kb &&
@@ -138,7 +138,7 @@ test_expect_success 'cvs co (use attributes/allbinary)' '
 rm -rf cvswork
 test_expect_success 'cvs co (use attributes)' '
     GIT_DIR="$SERVERDIR" git config --bool gitcvs.allbinary false &&
-    GIT_CONFIG="$git_config" cvs -Q co -d cvswork master >cvs.log 2>&1 &&
+    GIT_CONFIG="$git_config" cvs -Q co -d cvswork main >cvs.log 2>&1 &&
     marked_as cvswork textfile.c "" &&
     marked_as cvswork binfile.bin -kb &&
     marked_as cvswork .gitattributes "" &&
@@ -194,7 +194,7 @@ test_expect_success 'updating' '
 rm -rf cvswork
 test_expect_success 'cvs co (use attributes/guess)' '
     GIT_DIR="$SERVERDIR" git config gitcvs.allbinary guess &&
-    GIT_CONFIG="$git_config" cvs -Q co -d cvswork master >cvs.log 2>&1 &&
+    GIT_CONFIG="$git_config" cvs -Q co -d cvswork main >cvs.log 2>&1 &&
     marked_as cvswork textfile.c "" &&
     marked_as cvswork binfile.bin -kb &&
     marked_as cvswork .gitattributes "" &&
@@ -224,7 +224,7 @@ test_expect_success 'setup multi-line files' '
 rm -rf cvswork
 test_expect_success 'cvs co (guess)' '
     GIT_DIR="$SERVERDIR" git config --bool gitcvs.usecrlfattr false &&
-    GIT_CONFIG="$git_config" cvs -Q co -d cvswork master >cvs.log 2>&1 &&
+    GIT_CONFIG="$git_config" cvs -Q co -d cvswork main >cvs.log 2>&1 &&
     marked_as cvswork textfile.c "" &&
     marked_as cvswork binfile.bin -kb &&
     marked_as cvswork .gitattributes "" &&
@@ -239,7 +239,7 @@ test_expect_success 'cvs co (guess)' '
 '
 
 test_expect_success 'cvs co another copy (guess)' '
-    GIT_CONFIG="$git_config" cvs -Q co -d cvswork2 master >cvs.log 2>&1 &&
+    GIT_CONFIG="$git_config" cvs -Q co -d cvswork2 main >cvs.log 2>&1 &&
     marked_as cvswork2 textfile.c "" &&
     marked_as cvswork2 binfile.bin -kb &&
     marked_as cvswork2 .gitattributes "" &&
@@ -335,7 +335,7 @@ test_expect_success 'update subdir of other copy (guess)' '
 
 echo "starting update/merge" >> "${WORKDIR}/marked.log"
 test_expect_success 'update/merge full other copy (guess)' '
-    git pull gitcvs.git master &&
+    git pull gitcvs.git main &&
     sed "s/3/replaced_3/" < multilineTxt.c > ml.temp &&
     mv ml.temp multilineTxt.c &&
     git add multilineTxt.c &&
diff --git a/t/t9402-git-cvsserver-refs.sh b/t/t9402-git-cvsserver-refs.sh
index 6436c91a3c..3b30b02bd1 100755
--- a/t/t9402-git-cvsserver-refs.sh
+++ b/t/t9402-git-cvsserver-refs.sh
@@ -115,7 +115,7 @@ test_expect_success 'setup v1, b1' '
 
 rm -rf cvswork
 test_expect_success 'cvs co v1' '
-	cvs -f -Q co -r v1 -d cvswork master >cvs.log 2>&1 &&
+	cvs -f -Q co -r v1 -d cvswork main >cvs.log 2>&1 &&
 	check_start_tree cvswork &&
 	check_file cvswork textfile.c v1 &&
 	check_file cvswork t2 v1 &&
@@ -128,7 +128,7 @@ test_expect_success 'cvs co v1' '
 
 rm -rf cvswork
 test_expect_success 'cvs co b1' '
-	cvs -f co -r b1 -d cvswork master >cvs.log 2>&1 &&
+	cvs -f co -r b1 -d cvswork main >cvs.log 2>&1 &&
 	check_start_tree cvswork &&
 	check_file cvswork textfile.c v1 &&
 	check_file cvswork t2 v1 &&
@@ -140,7 +140,7 @@ test_expect_success 'cvs co b1' '
 '
 
 test_expect_success 'cvs co b1 [cvswork3]' '
-	cvs -f co -r b1 -d cvswork3 master >cvs.log 2>&1 &&
+	cvs -f co -r b1 -d cvswork3 main >cvs.log 2>&1 &&
 	check_start_tree cvswork3 &&
 	check_file cvswork3 textfile.c v1 &&
 	check_file cvswork3 t2 v1 &&
@@ -265,7 +265,7 @@ test_expect_success 'setup simple b2' '
 '
 
 test_expect_success 'cvs co b2 [into cvswork2]' '
-	cvs -f co -r b2 -d cvswork2 master >cvs.log 2>&1 &&
+	cvs -f co -r b2 -d cvswork2 main >cvs.log 2>&1 &&
 	check_start_tree cvswork &&
 	check_file cvswork textfile.c v1 &&
 	check_file cvswork t2 v1 &&
diff --git a/t/test-lib.sh b/t/test-lib.sh
index a63945569f..faad473555 100644
--- a/t/test-lib.sh
+++ b/t/test-lib.sh
@@ -263,7 +263,7 @@ case "$TEST_NUMBER" in
 	GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
 	export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 	;;
-[0-8]*)
+[0-8]*|9[0-4]*)
 	GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 	export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 	;;
-- 
gitgitgadget


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH v2 24/27] t9[5-7]*: adjust the references to the default branch name "main"
  2020-11-17 16:12 ` [PATCH v2 00/27] tests: use " Johannes Schindelin via GitGitGadget
                     ` (22 preceding siblings ...)
  2020-11-17 16:12   ` [PATCH v2 23/27] t9[0-4]*: " Johannes Schindelin via GitGitGadget
@ 2020-11-17 16:12   ` Johannes Schindelin via GitGitGadget
  2020-11-17 16:12   ` [PATCH v2 25/27] tests(git-p4): transition to the default branch name `main` Johannes Schindelin via GitGitGadget
                     ` (4 subsequent siblings)
  28 siblings, 0 replies; 163+ messages in thread
From: Johannes Schindelin via GitGitGadget @ 2020-11-17 16:12 UTC (permalink / raw)
  To: git
  Cc: Felipe Contreras, Ævar Arnfjörð Bjarmason,
	Johannes Schindelin, Jeff King, Johannes Schindelin,
	Johannes Schindelin

From: Johannes Schindelin <johannes.schindelin@gmx.de>

This trick was performed via

	$ (cd t &&
	   sed -i -e 's/master/main/g' -e 's/MASTER/MAIN/g' \
		-e 's/Master/Main/g' -- t9[5-7]*.sh lib-cvs.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>
---
 t/lib-cvs.sh                              |  2 +-
 t/t9500-gitweb-standalone-no-errors.sh    | 20 ++++++++++----------
 t/t9501-gitweb-standalone-http-status.sh  | 14 +++++++-------
 t/t9502-gitweb-standalone-parse-output.sh | 16 ++++++++--------
 t/t9600-cvsimport.sh                      |  2 +-
 t/t9601-cvsimport-vendor-branch.sh        | 16 ++++++++--------
 t/t9602-cvsimport-branches-tags.sh        |  4 ++--
 t/t9603-cvsimport-patchsets.sh            |  8 ++++----
 t/test-lib.sh                             |  2 +-
 9 files changed, 42 insertions(+), 42 deletions(-)

diff --git a/t/lib-cvs.sh b/t/lib-cvs.sh
index 9b2bcfb1b0..32b3473379 100644
--- a/t/lib-cvs.sh
+++ b/t/lib-cvs.sh
@@ -36,7 +36,7 @@ setup_cvs_test_repository () {
 test_cvs_co () {
 	# Usage: test_cvs_co BRANCH_NAME
 	rm -rf module-cvs-"$1"
-	if [ "$1" = "master" ]
+	if [ "$1" = "main" ]
 	then
 		$CVS co -P -d module-cvs-"$1" -A module
 	else
diff --git a/t/t9500-gitweb-standalone-no-errors.sh b/t/t9500-gitweb-standalone-no-errors.sh
index b484e3e250..452470ff3b 100755
--- a/t/t9500-gitweb-standalone-no-errors.sh
+++ b/t/t9500-gitweb-standalone-no-errors.sh
@@ -327,7 +327,7 @@ test_expect_success \
 	 echo "Branch" >>b &&
 	 git add b &&
 	 git commit -a -m "On branch" &&
-	 git checkout master &&
+	 git checkout main &&
 	 git merge b &&
 	 git tag merge_commit'
 
@@ -364,7 +364,7 @@ test_expect_success \
 	 echo "Changed and have mode changed" >07-change-mode-change &&
 	 test_chmod +x 07-change-mode-change &&
 	 git commit -a -m "Large commit" &&
-	 git checkout master'
+	 git checkout main'
 
 test_expect_success \
 	'commit(1): large commit' \
@@ -402,7 +402,7 @@ test_expect_success 'side-by-side: merge commit' '
 
 test_expect_success \
 	'tags: list of different types of tags' \
-	'git checkout master &&
+	'git checkout main &&
 	 git tag -a -m "Tag commit object" tag-commit HEAD &&
 	 git tag -a -m "" tag-commit-nomessage HEAD &&
 	 git tag -a -m "Tag tag object" tag-tag tag-commit &&
@@ -443,7 +443,7 @@ test_expect_success \
 
 test_expect_success \
 	'logs: history (implicit HEAD, deleted file)' \
-	'git checkout master &&
+	'git checkout main &&
 	 echo "to be deleted" >deleted_file &&
 	 git add deleted_file &&
 	 git commit -m "Add file to be deleted" &&
@@ -463,11 +463,11 @@ test_expect_success \
 
 test_expect_success \
 	'path_info: project/branch:file' \
-	'gitweb_run "" "/.git/master:file"'
+	'gitweb_run "" "/.git/main:file"'
 
 test_expect_success \
 	'path_info: project/branch:dir/' \
-	'gitweb_run "" "/.git/master:foo/"'
+	'gitweb_run "" "/.git/main:foo/"'
 
 test_expect_success \
 	'path_info: project/branch (non-existent)' \
@@ -479,16 +479,16 @@ test_expect_success \
 
 test_expect_success \
 	'path_info: project/branch:file (non-existent)' \
-	'gitweb_run "" "/.git/master:non-existent"'
+	'gitweb_run "" "/.git/main:non-existent"'
 
 test_expect_success \
 	'path_info: project/branch:dir/ (non-existent)' \
-	'gitweb_run "" "/.git/master:non-existent/"'
+	'gitweb_run "" "/.git/main:non-existent/"'
 
 
 test_expect_success \
 	'path_info: project/branch:/file' \
-	'gitweb_run "" "/.git/master:/file"'
+	'gitweb_run "" "/.git/main:/file"'
 
 test_expect_success \
 	'path_info: project/:/file (implicit HEAD)' \
@@ -801,7 +801,7 @@ test_expect_success \
 		git checkout orphan_branch ||
 		git checkout --orphan orphan_branch
 	 } &&
-	 test_when_finished "git checkout master" &&
+	 test_when_finished "git checkout main" &&
 	 gitweb_run "p=.git;a=summary"'
 
 test_done
diff --git a/t/t9501-gitweb-standalone-http-status.sh b/t/t9501-gitweb-standalone-http-status.sh
index 2a0ffed870..16f98ab54e 100755
--- a/t/t9501-gitweb-standalone-http-status.sh
+++ b/t/t9501-gitweb-standalone-http-status.sh
@@ -85,7 +85,7 @@ test_debug 'cat gitweb.headers'
 # snapshot hash ids
 
 test_expect_success 'snapshots: good tree-ish id' '
-	gitweb_run "p=.git;a=snapshot;h=master;sf=tgz" &&
+	gitweb_run "p=.git;a=snapshot;h=main;sf=tgz" &&
 	grep "Status: 200 OK" gitweb.output
 '
 test_debug 'cat gitweb.headers'
@@ -123,7 +123,7 @@ test_debug 'cat gitweb.output'
 # modification times (Last-Modified and If-Modified-Since)
 
 test_expect_success DATE_PARSER 'modification: feed last-modified' '
-	gitweb_run "p=.git;a=atom;h=master" &&
+	gitweb_run "p=.git;a=atom;h=main" &&
 	grep "Status: 200 OK" gitweb.headers &&
 	grep "Last-modified: Thu, 7 Apr 2005 22:14:13 +0000" gitweb.headers
 '
@@ -133,7 +133,7 @@ test_expect_success DATE_PARSER 'modification: feed if-modified-since (modified)
 	HTTP_IF_MODIFIED_SINCE="Wed, 6 Apr 2005 22:14:13 +0000" &&
 	export HTTP_IF_MODIFIED_SINCE &&
 	test_when_finished "unset HTTP_IF_MODIFIED_SINCE" &&
-	gitweb_run "p=.git;a=atom;h=master" &&
+	gitweb_run "p=.git;a=atom;h=main" &&
 	grep "Status: 200 OK" gitweb.headers
 '
 test_debug 'cat gitweb.headers'
@@ -142,13 +142,13 @@ test_expect_success DATE_PARSER 'modification: feed if-modified-since (unmodifie
 	HTTP_IF_MODIFIED_SINCE="Thu, 7 Apr 2005 22:14:13 +0000" &&
 	export HTTP_IF_MODIFIED_SINCE &&
 	test_when_finished "unset HTTP_IF_MODIFIED_SINCE" &&
-	gitweb_run "p=.git;a=atom;h=master" &&
+	gitweb_run "p=.git;a=atom;h=main" &&
 	grep "Status: 304 Not Modified" gitweb.headers
 '
 test_debug 'cat gitweb.headers'
 
 test_expect_success DATE_PARSER 'modification: snapshot last-modified' '
-	gitweb_run "p=.git;a=snapshot;h=master;sf=tgz" &&
+	gitweb_run "p=.git;a=snapshot;h=main;sf=tgz" &&
 	grep "Status: 200 OK" gitweb.headers &&
 	grep "Last-modified: Thu, 7 Apr 2005 22:14:13 +0000" gitweb.headers
 '
@@ -158,7 +158,7 @@ test_expect_success DATE_PARSER 'modification: snapshot if-modified-since (modif
 	HTTP_IF_MODIFIED_SINCE="Wed, 6 Apr 2005 22:14:13 +0000" &&
 	export HTTP_IF_MODIFIED_SINCE &&
 	test_when_finished "unset HTTP_IF_MODIFIED_SINCE" &&
-	gitweb_run "p=.git;a=snapshot;h=master;sf=tgz" &&
+	gitweb_run "p=.git;a=snapshot;h=main;sf=tgz" &&
 	grep "Status: 200 OK" gitweb.headers
 '
 test_debug 'cat gitweb.headers'
@@ -167,7 +167,7 @@ test_expect_success DATE_PARSER 'modification: snapshot if-modified-since (unmod
 	HTTP_IF_MODIFIED_SINCE="Thu, 7 Apr 2005 22:14:13 +0000" &&
 	export HTTP_IF_MODIFIED_SINCE &&
 	test_when_finished "unset HTTP_IF_MODIFIED_SINCE" &&
-	gitweb_run "p=.git;a=snapshot;h=master;sf=tgz" &&
+	gitweb_run "p=.git;a=snapshot;h=main;sf=tgz" &&
 	grep "Status: 304 Not Modified" gitweb.headers
 '
 test_debug 'cat gitweb.headers'
diff --git a/t/t9502-gitweb-standalone-parse-output.sh b/t/t9502-gitweb-standalone-parse-output.sh
index e38cbc97d3..d0cfff9fdd 100755
--- a/t/t9502-gitweb-standalone-parse-output.sh
+++ b/t/t9502-gitweb-standalone-parse-output.sh
@@ -79,10 +79,10 @@ test_expect_success 'snapshot: HEAD' '
 '
 test_debug 'cat gitweb.headers && cat file_list'
 
-test_expect_success 'snapshot: short branch name (master)' '
-	gitweb_run "p=.git;a=snapshot;h=master;sf=tar" &&
-	ID=$(git rev-parse --verify --short=7 master) &&
-	check_snapshot ".git-master-$ID"
+test_expect_success 'snapshot: short branch name (main)' '
+	gitweb_run "p=.git;a=snapshot;h=main;sf=tar" &&
+	ID=$(git rev-parse --verify --short=7 main) &&
+	check_snapshot ".git-main-$ID"
 '
 test_debug 'cat gitweb.headers && cat file_list'
 
@@ -93,10 +93,10 @@ test_expect_success 'snapshot: short tag name (first)' '
 '
 test_debug 'cat gitweb.headers && cat file_list'
 
-test_expect_success 'snapshot: full branch name (refs/heads/master)' '
-	gitweb_run "p=.git;a=snapshot;h=refs/heads/master;sf=tar" &&
-	ID=$(git rev-parse --verify --short=7 master) &&
-	check_snapshot ".git-master-$ID"
+test_expect_success 'snapshot: full branch name (refs/heads/main)' '
+	gitweb_run "p=.git;a=snapshot;h=refs/heads/main;sf=tar" &&
+	ID=$(git rev-parse --verify --short=7 main) &&
+	check_snapshot ".git-main-$ID"
 '
 test_debug 'cat gitweb.headers && cat file_list'
 
diff --git a/t/t9600-cvsimport.sh b/t/t9600-cvsimport.sh
index 251fdd66c4..0c8e02c2b3 100755
--- a/t/t9600-cvsimport.sh
+++ b/t/t9600-cvsimport.sh
@@ -159,6 +159,6 @@ test_expect_success PERL 'no .git/cvs-revisions created by default' '
 
 '
 
-test_expect_success PERL 'test entire HEAD' 'test_cmp_branch_tree master'
+test_expect_success PERL 'test entire HEAD' 'test_cmp_branch_tree main'
 
 test_done
diff --git a/t/t9601-cvsimport-vendor-branch.sh b/t/t9601-cvsimport-vendor-branch.sh
index 827d39f5bf..1e89f936e8 100755
--- a/t/t9601-cvsimport-vendor-branch.sh
+++ b/t/t9601-cvsimport-vendor-branch.sh
@@ -42,43 +42,43 @@ test_expect_success PERL 'import a module with a vendor branch' '
 
 '
 
-test_expect_success PERL 'check HEAD out of cvs repository' 'test_cvs_co master'
+test_expect_success PERL 'check HEAD out of cvs repository' 'test_cvs_co main'
 
-test_expect_success PERL 'check master out of git repository' 'test_git_co master'
+test_expect_success PERL 'check main out of git repository' 'test_git_co main'
 
 test_expect_success PERL 'check a file that was imported once' '
 
-	test_cmp_branch_file master imported-once.txt
+	test_cmp_branch_file main imported-once.txt
 
 '
 
 test_expect_failure PERL 'check a file that was imported twice' '
 
-	test_cmp_branch_file master imported-twice.txt
+	test_cmp_branch_file main imported-twice.txt
 
 '
 
 test_expect_success PERL 'check a file that was imported then modified on HEAD' '
 
-	test_cmp_branch_file master imported-modified.txt
+	test_cmp_branch_file main imported-modified.txt
 
 '
 
 test_expect_success PERL 'check a file that was imported, modified, then imported again' '
 
-	test_cmp_branch_file master imported-modified-imported.txt
+	test_cmp_branch_file main imported-modified-imported.txt
 
 '
 
 test_expect_success PERL 'check a file that was added to HEAD then imported' '
 
-	test_cmp_branch_file master added-imported.txt
+	test_cmp_branch_file main added-imported.txt
 
 '
 
 test_expect_success PERL 'a vendor branch whose tag has been removed' '
 
-	test_cmp_branch_file master imported-anonymously.txt
+	test_cmp_branch_file main imported-anonymously.txt
 
 '
 
diff --git a/t/t9602-cvsimport-branches-tags.sh b/t/t9602-cvsimport-branches-tags.sh
index e1db323f54..fa3c1ae133 100755
--- a/t/t9602-cvsimport-branches-tags.sh
+++ b/t/t9602-cvsimport-branches-tags.sh
@@ -14,9 +14,9 @@ test_expect_success PERL 'import module' '
 
 '
 
-test_expect_success PERL 'test branch master' '
+test_expect_success PERL 'test branch main' '
 
-	test_cmp_branch_tree master
+	test_cmp_branch_tree main
 
 '
 
diff --git a/t/t9603-cvsimport-patchsets.sh b/t/t9603-cvsimport-patchsets.sh
index e7a91611dc..19f38f78f2 100755
--- a/t/t9603-cvsimport-patchsets.sh
+++ b/t/t9603-cvsimport-patchsets.sh
@@ -20,16 +20,16 @@ test_expect_failure PERL 'import with criss cross times on revisions' '
 	git cvsimport -p"-x" -C module-git module &&
 	(
 		cd module-git &&
-		git log --pretty=format:%s > ../actual-master &&
+		git log --pretty=format:%s > ../actual-main &&
 		git log A~2..A --pretty="format:%s %ad" -- > ../actual-A &&
-		echo "" >> ../actual-master &&
+		echo "" >> ../actual-main &&
 		echo "" >> ../actual-A
 	) &&
 	echo "Rev 4
 Rev 3
 Rev 2
-Rev 1" > expect-master &&
-	test_cmp expect-master actual-master &&
+Rev 1" > expect-main &&
+	test_cmp expect-main actual-main &&
 
 	echo "Rev 5 Branch A Wed Mar 11 19:09:10 2009 +0000
 Rev 4 Branch A Wed Mar 11 19:03:52 2009 +0000" > expect-A &&
diff --git a/t/test-lib.sh b/t/test-lib.sh
index faad473555..58267802f9 100644
--- a/t/test-lib.sh
+++ b/t/test-lib.sh
@@ -263,7 +263,7 @@ case "$TEST_NUMBER" in
 	GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
 	export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 	;;
-[0-8]*|9[0-4]*)
+[0-8]*|9[0-7]*)
 	GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 	export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 	;;
-- 
gitgitgadget


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH v2 25/27] tests(git-p4): transition to the default branch name `main`
  2020-11-17 16:12 ` [PATCH v2 00/27] tests: use " Johannes Schindelin via GitGitGadget
                     ` (23 preceding siblings ...)
  2020-11-17 16:12   ` [PATCH v2 24/27] t9[5-7]*: " Johannes Schindelin via GitGitGadget
@ 2020-11-17 16:12   ` Johannes Schindelin via GitGitGadget
  2020-11-17 16:12   ` [PATCH v2 26/27] t99*: adjust the references to the default branch name "main" Johannes Schindelin via GitGitGadget
                     ` (3 subsequent siblings)
  28 siblings, 0 replies; 163+ messages in thread
From: Johannes Schindelin via GitGitGadget @ 2020-11-17 16:12 UTC (permalink / raw)
  To: git
  Cc: Felipe Contreras, Ævar Arnfjörð Bjarmason,
	Johannes Schindelin, Jeff King, Johannes Schindelin,
	Johannes Schindelin

From: Johannes Schindelin <johannes.schindelin@gmx.de>

In the previous commits, we adjusted the test suite to use the branch
name `main` for initial branches.

The `git p4`-related tests are a bit harder to adjust because `git p4`
uses the ref `refs/heads/p4/master` to track the remote branches, and
for now, we do not want to change that (this might be the subject of a
future patch series). We only need to adjust for the actual initial
branch name to be changed to `main`.

This allows us to define `GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main`
for those tests.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
---
 t/t9800-git-p4-basic.sh        |  2 +-
 t/t9801-git-p4-branch.sh       | 16 ++++++++--------
 t/t9806-git-p4-options.sh      | 18 +++++++++---------
 t/t9807-git-p4-submit.sh       |  2 +-
 t/t9811-git-p4-label-import.sh |  2 +-
 t/test-lib.sh                  |  2 +-
 6 files changed, 21 insertions(+), 21 deletions(-)

diff --git a/t/t9800-git-p4-basic.sh b/t/t9800-git-p4-basic.sh
index c98c1dfc23..0c543a8708 100755
--- a/t/t9800-git-p4-basic.sh
+++ b/t/t9800-git-p4-basic.sh
@@ -226,7 +226,7 @@ test_expect_success 'clone --bare should make a bare repository' '
 		git config --get --bool core.bare true &&
 		git rev-parse --verify refs/remotes/p4/master &&
 		git rev-parse --verify refs/remotes/p4/HEAD &&
-		git rev-parse --verify refs/heads/master &&
+		git rev-parse --verify refs/heads/main &&
 		git rev-parse --verify HEAD
 	)
 '
diff --git a/t/t9801-git-p4-branch.sh b/t/t9801-git-p4-branch.sh
index a3abd778f9..94161d4b57 100755
--- a/t/t9801-git-p4-branch.sh
+++ b/t/t9801-git-p4-branch.sh
@@ -67,7 +67,7 @@ test_expect_success 'import main, no branch detection' '
 	(
 		cd "$git" &&
 		git log --oneline --graph --decorate --all &&
-		git rev-list master -- >wc &&
+		git rev-list main -- >wc &&
 		test_line_count = 4 wc
 	)
 '
@@ -78,7 +78,7 @@ test_expect_success 'import branch1, no branch detection' '
 	(
 		cd "$git" &&
 		git log --oneline --graph --decorate --all &&
-		git rev-list master -- >wc &&
+		git rev-list main -- >wc &&
 		test_line_count = 2 wc
 	)
 '
@@ -89,7 +89,7 @@ test_expect_success 'import branch2, no branch detection' '
 	(
 		cd "$git" &&
 		git log --oneline --graph --decorate --all &&
-		git rev-list master -- >wc &&
+		git rev-list main -- >wc &&
 		test_line_count = 2 wc
 	)
 '
@@ -100,7 +100,7 @@ test_expect_success 'import depot, no branch detection' '
 	(
 		cd "$git" &&
 		git log --oneline --graph --decorate --all &&
-		git rev-list master -- >wc &&
+		git rev-list main -- >wc &&
 		test_line_count = 8 wc
 	)
 '
@@ -114,7 +114,7 @@ test_expect_success 'import depot, branch detection' '
 		git log --oneline --graph --decorate --all &&
 
 		# 4 main commits
-		git rev-list master -- >wc &&
+		git rev-list main -- >wc &&
 		test_line_count = 4 wc &&
 
 		# 3 main, 1 integrate, 1 on branch2
@@ -137,7 +137,7 @@ test_expect_success 'import depot, branch detection, branchList branch definitio
 		git log --oneline --graph --decorate --all &&
 
 		# 4 main commits
-		git rev-list master -- >wc &&
+		git rev-list main -- >wc &&
 		test_line_count = 4 wc &&
 
 		# 3 main, 1 integrate, 1 on branch2
@@ -484,7 +484,7 @@ test_expect_success 'use-client-spec detect-branches files in top-level' '
 	(
 		cd "$git" &&
 		git p4 sync --detect-branches --use-client-spec //depot/usecs@all &&
-		git checkout -b master p4/usecs/b1 &&
+		git checkout -b main p4/usecs/b1 &&
 		test_path_is_file b1-file1 &&
 		test_path_is_missing b2-file2 &&
 		test_path_is_missing b1 &&
@@ -537,7 +537,7 @@ test_expect_success 'use-client-spec detect-branches skips files in branches' '
 	(
 		cd "$git" &&
 		git p4 sync --detect-branches --use-client-spec //depot/usecs@all &&
-		git checkout -b master p4/usecs/b3 &&
+		git checkout -b main p4/usecs/b3 &&
 		test_path_is_file b1-file1 &&
 		test_path_is_file b3-file3_2 &&
 		test_path_is_missing b3-file3_1
diff --git a/t/t9806-git-p4-options.sh b/t/t9806-git-p4-options.sh
index 4e794a01bf..0beae2e3f3 100755
--- a/t/t9806-git-p4-options.sh
+++ b/t/t9806-git-p4-options.sh
@@ -27,14 +27,14 @@ test_expect_success 'clone no --git-dir' '
 	test_must_fail git p4 clone --git-dir=xx //depot
 '
 
-test_expect_success 'clone --branch should checkout master' '
+test_expect_success 'clone --branch should checkout main' '
 	git p4 clone --branch=refs/remotes/p4/sb --dest="$git" //depot &&
 	test_when_finished cleanup_git &&
 	(
 		cd "$git" &&
 		git rev-parse refs/remotes/p4/sb >sb &&
-		git rev-parse refs/heads/master >master &&
-		test_cmp sb master &&
+		git rev-parse refs/heads/main >main &&
+		test_cmp sb main &&
 		git rev-parse HEAD >head &&
 		test_cmp sb head
 	)
@@ -147,22 +147,22 @@ test_expect_success 'clone --changesfile, @all' '
 	test_must_fail git p4 clone --changesfile="$TRASH_DIRECTORY/cf" --dest="$git" //depot@all
 '
 
-# imports both master and p4/master in refs/heads
+# imports both main and p4/master in refs/heads
 # requires --import-local on sync to find p4 refs/heads
-# does not update master on sync, just p4/master
+# does not update main on sync, just p4/master
 test_expect_success 'clone/sync --import-local' '
 	git p4 clone --import-local --dest="$git" //depot@1,2 &&
 	test_when_finished cleanup_git &&
 	(
 		cd "$git" &&
-		git log --oneline refs/heads/master >lines &&
+		git log --oneline refs/heads/main >lines &&
 		test_line_count = 2 lines &&
 		git log --oneline refs/heads/p4/master >lines &&
 		test_line_count = 2 lines &&
 		test_must_fail git p4 sync &&
 
 		git p4 sync --import-local &&
-		git log --oneline refs/heads/master >lines &&
+		git log --oneline refs/heads/main >lines &&
 		test_line_count = 2 lines &&
 		git log --oneline refs/heads/p4/master >lines &&
 		test_line_count = 3 lines
@@ -174,7 +174,7 @@ test_expect_success 'clone --max-changes' '
 	test_when_finished cleanup_git &&
 	(
 		cd "$git" &&
-		git log --oneline refs/heads/master >lines &&
+		git log --oneline refs/heads/main >lines &&
 		test_line_count = 2 lines
 	)
 '
@@ -237,7 +237,7 @@ test_expect_success 'clone --use-client-spec' '
 			git init &&
 			git config git-p4.useClientSpec true &&
 			git p4 sync //depot/... &&
-			git checkout -b master p4/master &&
+			git checkout -b main p4/master &&
 			test_path_is_file bus/dir/f4 &&
 			test_path_is_missing file1
 		)
diff --git a/t/t9807-git-p4-submit.sh b/t/t9807-git-p4-submit.sh
index eaaae414a1..e45104d1ef 100755
--- a/t/t9807-git-p4-submit.sh
+++ b/t/t9807-git-p4-submit.sh
@@ -114,7 +114,7 @@ test_expect_success 'submit with allowSubmit' '
 		git config git-p4.skipSubmitEdit true &&
 		git config git-p4.allowSubmit "nobranch" &&
 		test_must_fail git p4 submit &&
-		git config git-p4.allowSubmit "nobranch,master" &&
+		git config git-p4.allowSubmit "nobranch,main" &&
 		git p4 submit
 	)
 '
diff --git a/t/t9811-git-p4-label-import.sh b/t/t9811-git-p4-label-import.sh
index c1446f26ab..c722b5a176 100755
--- a/t/t9811-git-p4-label-import.sh
+++ b/t/t9811-git-p4-label-import.sh
@@ -185,7 +185,7 @@ test_expect_success 'tag that cannot be exported' '
 		git add main/f12 &&
 		git commit -m "adding f12" &&
 		git tag -m "tag on a_branch" GIT_TAG_ON_A_BRANCH &&
-		git checkout master &&
+		git checkout main &&
 		git p4 submit --export-labels
 	) &&
 	(
diff --git a/t/test-lib.sh b/t/test-lib.sh
index 58267802f9..0ec93a2eec 100644
--- a/t/test-lib.sh
+++ b/t/test-lib.sh
@@ -263,7 +263,7 @@ case "$TEST_NUMBER" in
 	GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
 	export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 	;;
-[0-8]*|9[0-7]*)
+[0-8]*|9[0-8]*)
 	GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 	export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 	;;
-- 
gitgitgadget


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH v2 26/27] t99*: adjust the references to the default branch name "main"
  2020-11-17 16:12 ` [PATCH v2 00/27] tests: use " Johannes Schindelin via GitGitGadget
                     ` (24 preceding siblings ...)
  2020-11-17 16:12   ` [PATCH v2 25/27] tests(git-p4): transition to the default branch name `main` Johannes Schindelin via GitGitGadget
@ 2020-11-17 16:12   ` Johannes Schindelin via GitGitGadget
  2020-11-17 16:12   ` [PATCH v2 27/27] tests: drop prereq `PREPARE_FOR_MAIN_BRANCH` where no longer needed Johannes Schindelin via GitGitGadget
                     ` (2 subsequent siblings)
  28 siblings, 0 replies; 163+ messages in thread
From: Johannes Schindelin via GitGitGadget @ 2020-11-17 16:12 UTC (permalink / raw)
  To: git
  Cc: Felipe Contreras, Ævar Arnfjörð Bjarmason,
	Johannes Schindelin, Jeff King, Johannes Schindelin,
	Johannes Schindelin

From: Johannes Schindelin <johannes.schindelin@gmx.de>

Carefully excluding t9902, which sees independent development elsewhere
at the time of writing, we use `main` as the default branch name in
t9903. This trick was performed via

	$ (cd t &&
	   sed -i -e 's/master/main/g' -e 's/MASTER/MAIN/g' \
		-e 's/Master/Main/g' -- t99*.sh lib-cvs.sh &&
	   git checkout HEAD -- t9902\*)

This allows us to define `GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main`
for all tests (except the ones we specifically excluded for now).

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
---
 t/t9903-bash-prompt.sh | 114 ++++++++++++++++++++---------------------
 t/test-lib.sh          |   4 +-
 2 files changed, 59 insertions(+), 59 deletions(-)

diff --git a/t/t9903-bash-prompt.sh b/t/t9903-bash-prompt.sh
index ab5da2cabc..a77daa7419 100755
--- a/t/t9903-bash-prompt.sh
+++ b/t/t9903-bash-prompt.sh
@@ -28,7 +28,7 @@ test_expect_success 'setup for prompt tests' '
 	echo 3 >file &&
 	git commit -m "third b1" file &&
 	git tag -a -m msg2 t2 &&
-	git checkout -b b2 master &&
+	git checkout -b b2 main &&
 	echo 0 >file &&
 	git commit -m "second b2" file &&
 	echo 00 >file &&
@@ -37,20 +37,20 @@ test_expect_success 'setup for prompt tests' '
 	git commit -m "yet another b2" file &&
 	mkdir ignored_dir &&
 	echo "ignored_dir/" >>.gitignore &&
-	git checkout master
+	git checkout main
 '
 
 test_expect_success 'prompt - branch name' '
-	printf " (master)" >expected &&
+	printf " (main)" >expected &&
 	__git_ps1 >"$actual" &&
 	test_cmp expected "$actual"
 '
 
 test_expect_success SYMLINKS 'prompt - branch name - symlink symref' '
-	printf " (master)" >expected &&
-	test_when_finished "git checkout master" &&
+	printf " (main)" >expected &&
+	test_when_finished "git checkout main" &&
 	test_config core.preferSymlinkRefs true &&
-	git checkout master &&
+	git checkout main &&
 	__git_ps1 >"$actual" &&
 	test_cmp expected "$actual"
 '
@@ -58,7 +58,7 @@ test_expect_success SYMLINKS 'prompt - branch name - symlink symref' '
 test_expect_success 'prompt - unborn branch' '
 	printf " (unborn)" >expected &&
 	git checkout --orphan unborn &&
-	test_when_finished "git checkout master" &&
+	test_when_finished "git checkout main" &&
 	__git_ps1 >"$actual" &&
 	test_cmp expected "$actual"
 '
@@ -72,7 +72,7 @@ test_expect_success FUNNYNAMES 'prompt - with newline in path' '
 with
 newline" &&
 	mkdir "$repo_with_newline" &&
-	printf " (master)" >expected &&
+	printf " (main)" >expected &&
 	git init "$repo_with_newline" &&
 	test_when_finished "rm -rf \"$repo_with_newline\"" &&
 	mkdir "$repo_with_newline"/subdir &&
@@ -87,7 +87,7 @@ test_expect_success 'prompt - detached head' '
 	printf " ((%s...))" $(git log -1 --format="%h" --abbrev=13 b1^) >expected &&
 	test_config core.abbrev 13 &&
 	git checkout b1^ &&
-	test_when_finished "git checkout master" &&
+	test_when_finished "git checkout main" &&
 	__git_ps1 >"$actual" &&
 	test_cmp expected "$actual"
 '
@@ -95,7 +95,7 @@ test_expect_success 'prompt - detached head' '
 test_expect_success 'prompt - describe detached head - contains' '
 	printf " ((t2~1))" >expected &&
 	git checkout b1^ &&
-	test_when_finished "git checkout master" &&
+	test_when_finished "git checkout main" &&
 	(
 		GIT_PS1_DESCRIBE_STYLE=contains &&
 		__git_ps1 >"$actual"
@@ -106,7 +106,7 @@ test_expect_success 'prompt - describe detached head - contains' '
 test_expect_success 'prompt - describe detached head - branch' '
 	printf " ((tags/t2~1))" >expected &&
 	git checkout b1^ &&
-	test_when_finished "git checkout master" &&
+	test_when_finished "git checkout main" &&
 	(
 		GIT_PS1_DESCRIBE_STYLE=branch &&
 		__git_ps1 >"$actual"
@@ -117,7 +117,7 @@ test_expect_success 'prompt - describe detached head - branch' '
 test_expect_success 'prompt - describe detached head - describe' '
 	printf " ((t1-1-g%s))" $(git log -1 --format="%h" b1^) >expected &&
 	git checkout b1^ &&
-	test_when_finished "git checkout master" &&
+	test_when_finished "git checkout main" &&
 	(
 		GIT_PS1_DESCRIBE_STYLE=describe &&
 		__git_ps1 >"$actual"
@@ -128,7 +128,7 @@ test_expect_success 'prompt - describe detached head - describe' '
 test_expect_success 'prompt - describe detached head - default' '
 	printf " ((t2))" >expected &&
 	git checkout --detach b1 &&
-	test_when_finished "git checkout master" &&
+	test_when_finished "git checkout main" &&
 	__git_ps1 >"$actual" &&
 	test_cmp expected "$actual"
 '
@@ -152,7 +152,7 @@ test_expect_success 'prompt - deep inside .git directory' '
 '
 
 test_expect_success 'prompt - inside bare repository' '
-	printf " (BARE:master)" >expected &&
+	printf " (BARE:main)" >expected &&
 	git init --bare bare.git &&
 	test_when_finished "rm -rf bare.git" &&
 	(
@@ -172,7 +172,7 @@ test_expect_success 'prompt - interactive rebase' '
 	test_when_finished "rm -f fake_editor.sh" &&
 	test_set_editor "$TRASH_DIRECTORY/fake_editor.sh" &&
 	git checkout b1 &&
-	test_when_finished "git checkout master" &&
+	test_when_finished "git checkout main" &&
 	git rebase -i HEAD^ &&
 	test_when_finished "git rebase --abort" &&
 	__git_ps1 >"$actual" &&
@@ -182,7 +182,7 @@ test_expect_success 'prompt - interactive rebase' '
 test_expect_success 'prompt - rebase merge' '
 	printf " (b2|REBASE 1/3)" >expected &&
 	git checkout b2 &&
-	test_when_finished "git checkout master" &&
+	test_when_finished "git checkout main" &&
 	test_must_fail git rebase --merge b1 b2 &&
 	test_when_finished "git rebase --abort" &&
 	__git_ps1 >"$actual" &&
@@ -192,7 +192,7 @@ test_expect_success 'prompt - rebase merge' '
 test_expect_success 'prompt - rebase am' '
 	printf " (b2|REBASE 1/3)" >expected &&
 	git checkout b2 &&
-	test_when_finished "git checkout master" &&
+	test_when_finished "git checkout main" &&
 	test_must_fail git rebase --apply b1 b2 &&
 	test_when_finished "git rebase --abort" &&
 	__git_ps1 >"$actual" &&
@@ -202,7 +202,7 @@ test_expect_success 'prompt - rebase am' '
 test_expect_success 'prompt - merge' '
 	printf " (b1|MERGING)" >expected &&
 	git checkout b1 &&
-	test_when_finished "git checkout master" &&
+	test_when_finished "git checkout main" &&
 	test_must_fail git merge b2 &&
 	test_when_finished "git reset --hard" &&
 	__git_ps1 >"$actual" &&
@@ -210,7 +210,7 @@ test_expect_success 'prompt - merge' '
 '
 
 test_expect_success 'prompt - cherry-pick' '
-	printf " (master|CHERRY-PICKING)" >expected &&
+	printf " (main|CHERRY-PICKING)" >expected &&
 	test_must_fail git cherry-pick b1 b1^ &&
 	test_when_finished "git cherry-pick --abort" &&
 	__git_ps1 >"$actual" &&
@@ -222,7 +222,7 @@ test_expect_success 'prompt - cherry-pick' '
 '
 
 test_expect_success 'prompt - revert' '
-	printf " (master|REVERTING)" >expected &&
+	printf " (main|REVERTING)" >expected &&
 	test_must_fail git revert b1^ b1 &&
 	test_when_finished "git revert --abort" &&
 	__git_ps1 >"$actual" &&
@@ -234,7 +234,7 @@ test_expect_success 'prompt - revert' '
 '
 
 test_expect_success 'prompt - bisect' '
-	printf " (master|BISECTING)" >expected &&
+	printf " (main|BISECTING)" >expected &&
 	git bisect start &&
 	test_when_finished "git bisect reset" &&
 	__git_ps1 >"$actual" &&
@@ -242,7 +242,7 @@ test_expect_success 'prompt - bisect' '
 '
 
 test_expect_success 'prompt - dirty status indicator - clean' '
-	printf " (master)" >expected &&
+	printf " (main)" >expected &&
 	(
 		GIT_PS1_SHOWDIRTYSTATE=y &&
 		__git_ps1 >"$actual"
@@ -251,7 +251,7 @@ test_expect_success 'prompt - dirty status indicator - clean' '
 '
 
 test_expect_success 'prompt - dirty status indicator - dirty worktree' '
-	printf " (master *)" >expected &&
+	printf " (main *)" >expected &&
 	echo "dirty" >file &&
 	test_when_finished "git reset --hard" &&
 	(
@@ -262,7 +262,7 @@ test_expect_success 'prompt - dirty status indicator - dirty worktree' '
 '
 
 test_expect_success 'prompt - dirty status indicator - dirty index' '
-	printf " (master +)" >expected &&
+	printf " (main +)" >expected &&
 	echo "dirty" >file &&
 	test_when_finished "git reset --hard" &&
 	git add -u &&
@@ -274,7 +274,7 @@ test_expect_success 'prompt - dirty status indicator - dirty index' '
 '
 
 test_expect_success 'prompt - dirty status indicator - dirty index and worktree' '
-	printf " (master *+)" >expected &&
+	printf " (main *+)" >expected &&
 	echo "dirty index" >file &&
 	test_when_finished "git reset --hard" &&
 	git add -u &&
@@ -288,7 +288,7 @@ test_expect_success 'prompt - dirty status indicator - dirty index and worktree'
 
 test_expect_success 'prompt - dirty status indicator - orphan branch - clean' '
 	printf " (orphan #)" >expected &&
-	test_when_finished "git checkout master" &&
+	test_when_finished "git checkout main" &&
 	git checkout --orphan orphan &&
 	git reset --hard &&
 	(
@@ -300,7 +300,7 @@ test_expect_success 'prompt - dirty status indicator - orphan branch - clean' '
 
 test_expect_success 'prompt - dirty status indicator - orphan branch - dirty index' '
 	printf " (orphan +)" >expected &&
-	test_when_finished "git checkout master" &&
+	test_when_finished "git checkout main" &&
 	git checkout --orphan orphan &&
 	(
 		GIT_PS1_SHOWDIRTYSTATE=y &&
@@ -311,7 +311,7 @@ test_expect_success 'prompt - dirty status indicator - orphan branch - dirty ind
 
 test_expect_success 'prompt - dirty status indicator - orphan branch - dirty index and worktree' '
 	printf " (orphan *+)" >expected &&
-	test_when_finished "git checkout master" &&
+	test_when_finished "git checkout main" &&
 	git checkout --orphan orphan &&
 	>file &&
 	(
@@ -322,7 +322,7 @@ test_expect_success 'prompt - dirty status indicator - orphan branch - dirty ind
 '
 
 test_expect_success 'prompt - dirty status indicator - shell variable unset with config disabled' '
-	printf " (master)" >expected &&
+	printf " (main)" >expected &&
 	echo "dirty" >file &&
 	test_when_finished "git reset --hard" &&
 	test_config bash.showDirtyState false &&
@@ -334,7 +334,7 @@ test_expect_success 'prompt - dirty status indicator - shell variable unset with
 '
 
 test_expect_success 'prompt - dirty status indicator - shell variable unset with config enabled' '
-	printf " (master)" >expected &&
+	printf " (main)" >expected &&
 	echo "dirty" >file &&
 	test_when_finished "git reset --hard" &&
 	test_config bash.showDirtyState true &&
@@ -346,7 +346,7 @@ test_expect_success 'prompt - dirty status indicator - shell variable unset with
 '
 
 test_expect_success 'prompt - dirty status indicator - shell variable set with config disabled' '
-	printf " (master)" >expected &&
+	printf " (main)" >expected &&
 	echo "dirty" >file &&
 	test_when_finished "git reset --hard" &&
 	test_config bash.showDirtyState false &&
@@ -358,7 +358,7 @@ test_expect_success 'prompt - dirty status indicator - shell variable set with c
 '
 
 test_expect_success 'prompt - dirty status indicator - shell variable set with config enabled' '
-	printf " (master *)" >expected &&
+	printf " (main *)" >expected &&
 	echo "dirty" >file &&
 	test_when_finished "git reset --hard" &&
 	test_config bash.showDirtyState true &&
@@ -382,7 +382,7 @@ test_expect_success 'prompt - dirty status indicator - not shown inside .git dir
 '
 
 test_expect_success 'prompt - stash status indicator - no stash' '
-	printf " (master)" >expected &&
+	printf " (main)" >expected &&
 	(
 		GIT_PS1_SHOWSTASHSTATE=y &&
 		__git_ps1 >"$actual"
@@ -391,7 +391,7 @@ test_expect_success 'prompt - stash status indicator - no stash' '
 '
 
 test_expect_success 'prompt - stash status indicator - stash' '
-	printf " (master $)" >expected &&
+	printf " (main $)" >expected &&
 	echo 2 >file &&
 	git stash &&
 	test_when_finished "git stash drop" &&
@@ -417,7 +417,7 @@ test_expect_success 'prompt - stash status indicator - not shown inside .git dir
 '
 
 test_expect_success 'prompt - untracked files status indicator - no untracked files' '
-	printf " (master)" >expected &&
+	printf " (main)" >expected &&
 	(
 		GIT_PS1_SHOWUNTRACKEDFILES=y &&
 		cd otherrepo &&
@@ -427,7 +427,7 @@ test_expect_success 'prompt - untracked files status indicator - no untracked fi
 '
 
 test_expect_success 'prompt - untracked files status indicator - untracked files' '
-	printf " (master %%)" >expected &&
+	printf " (main %%)" >expected &&
 	(
 		GIT_PS1_SHOWUNTRACKEDFILES=y &&
 		__git_ps1 >"$actual"
@@ -436,7 +436,7 @@ test_expect_success 'prompt - untracked files status indicator - untracked files
 '
 
 test_expect_success 'prompt - untracked files status indicator - empty untracked dir' '
-	printf " (master)" >expected &&
+	printf " (main)" >expected &&
 	mkdir otherrepo/untracked-dir &&
 	test_when_finished "rm -rf otherrepo/untracked-dir" &&
 	(
@@ -448,7 +448,7 @@ test_expect_success 'prompt - untracked files status indicator - empty untracked
 '
 
 test_expect_success 'prompt - untracked files status indicator - non-empty untracked dir' '
-	printf " (master %%)" >expected &&
+	printf " (main %%)" >expected &&
 	mkdir otherrepo/untracked-dir &&
 	test_when_finished "rm -rf otherrepo/untracked-dir" &&
 	>otherrepo/untracked-dir/untracked-file &&
@@ -461,7 +461,7 @@ test_expect_success 'prompt - untracked files status indicator - non-empty untra
 '
 
 test_expect_success 'prompt - untracked files status indicator - untracked files outside cwd' '
-	printf " (master %%)" >expected &&
+	printf " (main %%)" >expected &&
 	(
 		mkdir -p ignored_dir &&
 		cd ignored_dir &&
@@ -472,7 +472,7 @@ test_expect_success 'prompt - untracked files status indicator - untracked files
 '
 
 test_expect_success 'prompt - untracked files status indicator - shell variable unset with config disabled' '
-	printf " (master)" >expected &&
+	printf " (main)" >expected &&
 	test_config bash.showUntrackedFiles false &&
 	(
 		sane_unset GIT_PS1_SHOWUNTRACKEDFILES &&
@@ -482,7 +482,7 @@ test_expect_success 'prompt - untracked files status indicator - shell variable
 '
 
 test_expect_success 'prompt - untracked files status indicator - shell variable unset with config enabled' '
-	printf " (master)" >expected &&
+	printf " (main)" >expected &&
 	test_config bash.showUntrackedFiles true &&
 	(
 		sane_unset GIT_PS1_SHOWUNTRACKEDFILES &&
@@ -492,7 +492,7 @@ test_expect_success 'prompt - untracked files status indicator - shell variable
 '
 
 test_expect_success 'prompt - untracked files status indicator - shell variable set with config disabled' '
-	printf " (master)" >expected &&
+	printf " (main)" >expected &&
 	test_config bash.showUntrackedFiles false &&
 	(
 		GIT_PS1_SHOWUNTRACKEDFILES=y &&
@@ -502,7 +502,7 @@ test_expect_success 'prompt - untracked files status indicator - shell variable
 '
 
 test_expect_success 'prompt - untracked files status indicator - shell variable set with config enabled' '
-	printf " (master %%)" >expected &&
+	printf " (main %%)" >expected &&
 	test_config bash.showUntrackedFiles true &&
 	(
 		GIT_PS1_SHOWUNTRACKEDFILES=y &&
@@ -522,13 +522,13 @@ test_expect_success 'prompt - untracked files status indicator - not shown insid
 '
 
 test_expect_success 'prompt - format string starting with dash' '
-	printf -- "-master" >expected &&
+	printf -- "-main" >expected &&
 	__git_ps1 "-%s" >"$actual" &&
 	test_cmp expected "$actual"
 '
 
 test_expect_success 'prompt - pc mode' '
-	printf "BEFORE: (\${__git_ps1_branch_name}):AFTER\\nmaster" >expected &&
+	printf "BEFORE: (\${__git_ps1_branch_name}):AFTER\\nmain" >expected &&
 	(
 		__git_ps1 "BEFORE:" ":AFTER" >"$actual" &&
 		test_must_be_empty "$actual" &&
@@ -538,7 +538,7 @@ test_expect_success 'prompt - pc mode' '
 '
 
 test_expect_success 'prompt - bash color pc mode - branch name' '
-	printf "BEFORE: (${c_green}\${__git_ps1_branch_name}${c_clear}):AFTER\\nmaster" >expected &&
+	printf "BEFORE: (${c_green}\${__git_ps1_branch_name}${c_clear}):AFTER\\nmain" >expected &&
 	(
 		GIT_PS1_SHOWCOLORHINTS=y &&
 		__git_ps1 "BEFORE:" ":AFTER" >"$actual" &&
@@ -550,7 +550,7 @@ test_expect_success 'prompt - bash color pc mode - branch name' '
 test_expect_success 'prompt - bash color pc mode - detached head' '
 	printf "BEFORE: (${c_red}\${__git_ps1_branch_name}${c_clear}):AFTER\\n(%s...)" $(git log -1 --format="%h" b1^) >expected &&
 	git checkout b1^ &&
-	test_when_finished "git checkout master" &&
+	test_when_finished "git checkout main" &&
 	(
 		GIT_PS1_SHOWCOLORHINTS=y &&
 		__git_ps1 "BEFORE:" ":AFTER" &&
@@ -560,7 +560,7 @@ test_expect_success 'prompt - bash color pc mode - detached head' '
 '
 
 test_expect_success 'prompt - bash color pc mode - dirty status indicator - dirty worktree' '
-	printf "BEFORE: (${c_green}\${__git_ps1_branch_name}${c_clear} ${c_red}*${c_clear}):AFTER\\nmaster" >expected &&
+	printf "BEFORE: (${c_green}\${__git_ps1_branch_name}${c_clear} ${c_red}*${c_clear}):AFTER\\nmain" >expected &&
 	echo "dirty" >file &&
 	test_when_finished "git reset --hard" &&
 	(
@@ -573,7 +573,7 @@ test_expect_success 'prompt - bash color pc mode - dirty status indicator - dirt
 '
 
 test_expect_success 'prompt - bash color pc mode - dirty status indicator - dirty index' '
-	printf "BEFORE: (${c_green}\${__git_ps1_branch_name}${c_clear} ${c_green}+${c_clear}):AFTER\\nmaster" >expected &&
+	printf "BEFORE: (${c_green}\${__git_ps1_branch_name}${c_clear} ${c_green}+${c_clear}):AFTER\\nmain" >expected &&
 	echo "dirty" >file &&
 	test_when_finished "git reset --hard" &&
 	git add -u &&
@@ -587,7 +587,7 @@ test_expect_success 'prompt - bash color pc mode - dirty status indicator - dirt
 '
 
 test_expect_success 'prompt - bash color pc mode - dirty status indicator - dirty index and worktree' '
-	printf "BEFORE: (${c_green}\${__git_ps1_branch_name}${c_clear} ${c_red}*${c_green}+${c_clear}):AFTER\\nmaster" >expected &&
+	printf "BEFORE: (${c_green}\${__git_ps1_branch_name}${c_clear} ${c_red}*${c_green}+${c_clear}):AFTER\\nmain" >expected &&
 	echo "dirty index" >file &&
 	test_when_finished "git reset --hard" &&
 	git add -u &&
@@ -602,7 +602,7 @@ test_expect_success 'prompt - bash color pc mode - dirty status indicator - dirt
 '
 
 test_expect_success 'prompt - bash color pc mode - dirty status indicator - before root commit' '
-	printf "BEFORE: (${c_green}\${__git_ps1_branch_name}${c_clear} ${c_green}#${c_clear}):AFTER\\nmaster" >expected &&
+	printf "BEFORE: (${c_green}\${__git_ps1_branch_name}${c_clear} ${c_green}#${c_clear}):AFTER\\nmain" >expected &&
 	(
 		GIT_PS1_SHOWDIRTYSTATE=y &&
 		GIT_PS1_SHOWCOLORHINTS=y &&
@@ -628,7 +628,7 @@ test_expect_success 'prompt - bash color pc mode - inside .git directory' '
 '
 
 test_expect_success 'prompt - bash color pc mode - stash status indicator' '
-	printf "BEFORE: (${c_green}\${__git_ps1_branch_name}${c_clear} ${c_lblue}\$${c_clear}):AFTER\\nmaster" >expected &&
+	printf "BEFORE: (${c_green}\${__git_ps1_branch_name}${c_clear} ${c_lblue}\$${c_clear}):AFTER\\nmain" >expected &&
 	echo 2 >file &&
 	git stash &&
 	test_when_finished "git stash drop" &&
@@ -642,7 +642,7 @@ test_expect_success 'prompt - bash color pc mode - stash status indicator' '
 '
 
 test_expect_success 'prompt - bash color pc mode - untracked files status indicator' '
-	printf "BEFORE: (${c_green}\${__git_ps1_branch_name}${c_clear} ${c_red}%%${c_clear}):AFTER\\nmaster" >expected &&
+	printf "BEFORE: (${c_green}\${__git_ps1_branch_name}${c_clear} ${c_red}%%${c_clear}):AFTER\\nmain" >expected &&
 	(
 		GIT_PS1_SHOWUNTRACKEDFILES=y &&
 		GIT_PS1_SHOWCOLORHINTS=y &&
@@ -653,7 +653,7 @@ test_expect_success 'prompt - bash color pc mode - untracked files status indica
 '
 
 test_expect_success 'prompt - zsh color pc mode' '
-	printf "BEFORE: (%%F{green}master%%f):AFTER" >expected &&
+	printf "BEFORE: (%%F{green}main%%f):AFTER" >expected &&
 	(
 		ZSH_VERSION=5.0.0 &&
 		GIT_PS1_SHOWCOLORHINTS=y &&
@@ -664,7 +664,7 @@ test_expect_success 'prompt - zsh color pc mode' '
 '
 
 test_expect_success 'prompt - hide if pwd ignored - env var unset, config disabled' '
-	printf " (master)" >expected &&
+	printf " (main)" >expected &&
 	test_config bash.hideIfPwdIgnored false &&
 	(
 		cd ignored_dir &&
@@ -685,7 +685,7 @@ test_expect_success 'prompt - hide if pwd ignored - env var unset, config disabl
 '
 
 test_expect_success 'prompt - hide if pwd ignored - env var unset, config unset' '
-	printf " (master)" >expected &&
+	printf " (main)" >expected &&
 	(
 		cd ignored_dir &&
 		__git_ps1 >"$actual"
@@ -704,7 +704,7 @@ test_expect_success 'prompt - hide if pwd ignored - env var unset, config unset,
 '
 
 test_expect_success 'prompt - hide if pwd ignored - env var set, config disabled' '
-	printf " (master)" >expected &&
+	printf " (main)" >expected &&
 	test_config bash.hideIfPwdIgnored false &&
 	(
 		cd ignored_dir &&
diff --git a/t/test-lib.sh b/t/test-lib.sh
index 0ec93a2eec..d39bdf04ce 100644
--- a/t/test-lib.sh
+++ b/t/test-lib.sh
@@ -257,13 +257,13 @@ case "$TRASH_DIRECTORY" in
 esac
 
 case "$TEST_NUMBER" in
-3404|4013|5310|5526|6300|7064|7817)
+3404|4013|5310|5526|6300|7064|7817|9902)
 	# Avoid conflicts with patch series that are cooking at the same time
 	# as the patch series changing the default of `init.defaultBranch`.
 	GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
 	export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 	;;
-[0-8]*|9[0-8]*)
+*)
 	GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 	export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 	;;
-- 
gitgitgadget


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH v2 27/27] tests: drop prereq `PREPARE_FOR_MAIN_BRANCH` where no longer needed
  2020-11-17 16:12 ` [PATCH v2 00/27] tests: use " Johannes Schindelin via GitGitGadget
                     ` (25 preceding siblings ...)
  2020-11-17 16:12   ` [PATCH v2 26/27] t99*: adjust the references to the default branch name "main" Johannes Schindelin via GitGitGadget
@ 2020-11-17 16:12   ` Johannes Schindelin via GitGitGadget
  2020-11-18 11:48   ` [PATCH v2 28/27] tests: run tests omitted by PREPARE_FOR_MAIN_BRANCH Ævar Arnfjörð Bjarmason
  2020-11-18 23:44   ` [PATCH v3 00/28] tests: use main as default branch name Johannes Schindelin via GitGitGadget
  28 siblings, 0 replies; 163+ messages in thread
From: Johannes Schindelin via GitGitGadget @ 2020-11-17 16:12 UTC (permalink / raw)
  To: git
  Cc: Felipe Contreras, Ævar Arnfjörð Bjarmason,
	Johannes Schindelin, Jeff King, Johannes Schindelin,
	Johannes Schindelin

From: Johannes Schindelin <johannes.schindelin@gmx.de>

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>
---
 t/t1400-update-ref.sh              |  4 ++--
 t/t3200-branch.sh                  |  6 +++---
 t/t3201-branch-contains.sh         |  2 +-
 t/t3203-branch-output.sh           |  2 +-
 t/t3205-branch-color.sh            |  2 +-
 t/t5505-remote.sh                  |  8 ++++----
 t/t5510-fetch.sh                   |  4 ++--
 t/t5703-upload-pack-ref-in-want.sh |  2 +-
 t/t6302-for-each-ref-filter.sh     | 12 ++++++------
 9 files changed, 21 insertions(+), 21 deletions(-)

diff --git a/t/t1400-update-ref.sh b/t/t1400-update-ref.sh
index 3265a8c58e..127efff136 100755
--- a/t/t1400-update-ref.sh
+++ b/t/t1400-update-ref.sh
@@ -585,7 +585,7 @@ test_expect_success 'stdin fails on unbalanced quotes' '
 	grep "fatal: badly quoted argument: \\\"main" err
 '
 
-test_expect_success PREPARE_FOR_MAIN_BRANCH 'stdin fails on invalid escape' '
+test_expect_success 'stdin fails on invalid escape' '
 	echo "create $a \"ma\zn\"" >stdin &&
 	test_must_fail git update-ref --stdin <stdin 2>err &&
 	grep "fatal: badly quoted argument: \\\"ma\\\\zn\\\"" err
@@ -704,7 +704,7 @@ test_expect_success 'stdin succeeds with quoted argument' '
 	test_cmp expect actual
 '
 
-test_expect_success PREPARE_FOR_MAIN_BRANCH 'stdin succeeds with escaped character' '
+test_expect_success 'stdin succeeds with escaped character' '
 	git update-ref -d $a &&
 	echo "create $a \"ma\\151n\"" >stdin &&
 	git update-ref --stdin <stdin &&
diff --git a/t/t3200-branch.sh b/t/t3200-branch.sh
index 63036e0369..430f5af21b 100755
--- a/t/t3200-branch.sh
+++ b/t/t3200-branch.sh
@@ -321,7 +321,7 @@ test_expect_success 'git branch --list -v with --abbrev' '
 
 '
 
-test_expect_success PREPARE_FOR_MAIN_BRANCH 'git branch --column' '
+test_expect_success 'git branch --column' '
 	COLUMNS=81 git branch --column=column >actual &&
 	cat >expect <<\EOF &&
   a/b/c   bam     foo     l     * main    n       o/p     r
@@ -358,7 +358,7 @@ EOF
 	test_cmp expect actual
 '
 
-test_expect_success PREPARE_FOR_MAIN_BRANCH 'git branch with column.*' '
+test_expect_success 'git branch with column.*' '
 	git config column.ui column &&
 	git config column.branch "dense" &&
 	COLUMNS=80 git branch >actual &&
@@ -375,7 +375,7 @@ test_expect_success 'git branch --column -v should fail' '
 	test_must_fail git branch --column -v
 '
 
-test_expect_success PREPARE_FOR_MAIN_BRANCH 'git branch -v with column.ui ignored' '
+test_expect_success 'git branch -v with column.ui ignored' '
 	git config column.ui column &&
 	COLUMNS=80 git branch -v | cut -c -8 | sed "s/ *$//" >actual &&
 	git config --unset column.ui &&
diff --git a/t/t3201-branch-contains.sh b/t/t3201-branch-contains.sh
index 110cfef820..f39ae97264 100755
--- a/t/t3201-branch-contains.sh
+++ b/t/t3201-branch-contains.sh
@@ -242,7 +242,7 @@ test_expect_success 'branch --merged combined with --no-merged' '
 # Here "topic" tracks "main" with one extra commit, and "zzz" points to the
 # same tip as main The name "zzz" must come alphabetically after "topic"
 # as we process them in that order.
-test_expect_success PREPARE_FOR_MAIN_BRANCH 'branch --merged with --verbose' '
+test_expect_success 'branch --merged with --verbose' '
 	git branch --track topic main &&
 	git branch zzz topic &&
 	git checkout topic &&
diff --git a/t/t3203-branch-output.sh b/t/t3203-branch-output.sh
index 727c9d9caa..211eb8357f 100755
--- a/t/t3203-branch-output.sh
+++ b/t/t3203-branch-output.sh
@@ -329,7 +329,7 @@ test_expect_success '--color overrides auto-color' '
 	test_cmp expect.color actual
 '
 
-test_expect_success PREPARE_FOR_MAIN_BRANCH 'verbose output lists worktree path' '
+test_expect_success 'verbose output lists worktree path' '
 	one=$(git rev-parse --short HEAD) &&
 	two=$(git rev-parse --short main) &&
 	cat >expect <<-EOF &&
diff --git a/t/t3205-branch-color.sh b/t/t3205-branch-color.sh
index 9f2fb785d2..2eb619231d 100755
--- a/t/t3205-branch-color.sh
+++ b/t/t3205-branch-color.sh
@@ -28,7 +28,7 @@ test_expect_success 'regular output shows colors' '
 	test_cmp expect actual
 '
 
-test_expect_success PREPARE_FOR_MAIN_BRANCH 'verbose output shows colors' '
+test_expect_success 'verbose output shows colors' '
 	oid=$(git rev-parse --short HEAD) &&
 	cat >expect <<-EOF &&
 	* <CYAN>main               <RESET> $oid foo
diff --git a/t/t5505-remote.sh b/t/t5505-remote.sh
index 540d65aa22..869109a2c6 100755
--- a/t/t5505-remote.sh
+++ b/t/t5505-remote.sh
@@ -234,7 +234,7 @@ cat >test/expect <<EOF
     main  pushes to another (up to date)
 EOF
 
-test_expect_success PREPARE_FOR_MAIN_BRANCH 'show' '
+test_expect_success 'show' '
 	(
 		cd test &&
 		git config --add remote.origin.fetch refs/heads/main:refs/heads/upstream &&
@@ -285,7 +285,7 @@ cat >test/expect <<EOF
     refs/tags/lastbackup forces to refs/tags/lastbackup
 EOF
 
-test_expect_success PREPARE_FOR_MAIN_BRANCH 'show -n' '
+test_expect_success 'show -n' '
 	mv one one.unreachable &&
 	(
 		cd test &&
@@ -328,7 +328,7 @@ test_expect_success 'set-head --auto' '
 	)
 '
 
-test_expect_success PREPARE_FOR_MAIN_BRANCH 'set-head --auto has no problem w/multiple HEADs' '
+test_expect_success 'set-head --auto has no problem w/multiple HEADs' '
 	(
 		cd test &&
 		git fetch two "refs/heads/*:refs/remotes/two/*" &&
@@ -1348,7 +1348,7 @@ test_expect_success 'unqualified <dst> refspec DWIM and advice' '
 	)
 '
 
-test_expect_success PREPARE_FOR_MAIN_BRANCH 'refs/remotes/* <src> refspec and unqualified <dst> DWIM and advice' '
+test_expect_success 'refs/remotes/* <src> refspec and unqualified <dst> DWIM and advice' '
 	(
 		cd two &&
 		git tag -a -m "Some tag" my-tag main &&
diff --git a/t/t5510-fetch.sh b/t/t5510-fetch.sh
index 206e3be695..f8bcaeca08 100755
--- a/t/t5510-fetch.sh
+++ b/t/t5510-fetch.sh
@@ -942,7 +942,7 @@ test_expect_success 'fetching with auto-gc does not lock up' '
 	)
 '
 
-test_expect_success PREPARE_FOR_MAIN_BRANCH,C_LOCALE_OUTPUT 'fetch aligned output' '
+test_expect_success C_LOCALE_OUTPUT 'fetch aligned output' '
 	git clone . full-output &&
 	test_commit looooooooooooong-tag &&
 	(
@@ -957,7 +957,7 @@ test_expect_success PREPARE_FOR_MAIN_BRANCH,C_LOCALE_OUTPUT 'fetch aligned outpu
 	test_cmp expect actual
 '
 
-test_expect_success PREPARE_FOR_MAIN_BRANCH,C_LOCALE_OUTPUT 'fetch compact output' '
+test_expect_success C_LOCALE_OUTPUT 'fetch compact output' '
 	git clone . compact &&
 	test_commit extraaa &&
 	(
diff --git a/t/t5703-upload-pack-ref-in-want.sh b/t/t5703-upload-pack-ref-in-want.sh
index bbf03a8f66..fe89ea55b1 100755
--- a/t/t5703-upload-pack-ref-in-want.sh
+++ b/t/t5703-upload-pack-ref-in-want.sh
@@ -383,7 +383,7 @@ test_expect_success 'server is initially behind - ref in want' '
 	test_cmp expected actual
 '
 
-test_expect_success PREPARE_FOR_MAIN_BRANCH 'server loses a ref - ref in want' '
+test_expect_success 'server loses a ref - ref in want' '
 	git -C "$REPO" config uploadpack.allowRefInWant true &&
 	rm -rf local &&
 	cp -r "$LOCAL_PRISTINE" local &&
diff --git a/t/t6302-for-each-ref-filter.sh b/t/t6302-for-each-ref-filter.sh
index f5a55c1991..7a45bbf048 100755
--- a/t/t6302-for-each-ref-filter.sh
+++ b/t/t6302-for-each-ref-filter.sh
@@ -113,7 +113,7 @@ test_expect_success '%(color) must fail' '
 	test_must_fail git for-each-ref --format="%(color)%(refname)"
 '
 
-test_expect_success PREPARE_FOR_MAIN_BRANCH 'left alignment is default' '
+test_expect_success 'left alignment is default' '
 	cat >expect <<-\EOF &&
 	refname is refs/heads/main    |refs/heads/main
 	refname is refs/heads/side    |refs/heads/side
@@ -131,7 +131,7 @@ test_expect_success PREPARE_FOR_MAIN_BRANCH 'left alignment is default' '
 	test_cmp expect actual
 '
 
-test_expect_success PREPARE_FOR_MAIN_BRANCH 'middle alignment' '
+test_expect_success 'middle alignment' '
 	cat >expect <<-\EOF &&
 	|  refname is refs/heads/main  |refs/heads/main
 	|  refname is refs/heads/side  |refs/heads/side
@@ -149,7 +149,7 @@ test_expect_success PREPARE_FOR_MAIN_BRANCH 'middle alignment' '
 	test_cmp expect actual
 '
 
-test_expect_success PREPARE_FOR_MAIN_BRANCH 'right alignment' '
+test_expect_success 'right alignment' '
 	cat >expect <<-\EOF &&
 	|    refname is refs/heads/main|refs/heads/main
 	|    refname is refs/heads/side|refs/heads/side
@@ -184,7 +184,7 @@ EOF
 test_align_permutations() {
 	while read -r option
 	do
-		test_expect_success PREPARE_FOR_MAIN_BRANCH "align:$option" '
+		test_expect_success "align:$option" '
 			git for-each-ref --format="|%(align:$option)refname is %(refname)%(end)|%(refname)" >actual &&
 			test_cmp expect actual
 		'
@@ -213,7 +213,7 @@ EOF
 
 # Individual atoms inside %(align:...) and %(end) must not be quoted.
 
-test_expect_success PREPARE_FOR_MAIN_BRANCH 'alignment with format quote' "
+test_expect_success 'alignment with format quote' "
 	cat >expect <<-\EOF &&
 	|'       '\''main| A U Thor'\''       '|
 	|'       '\''side| A U Thor'\''       '|
@@ -231,7 +231,7 @@ test_expect_success PREPARE_FOR_MAIN_BRANCH 'alignment with format quote' "
 	test_cmp expect actual
 "
 
-test_expect_success PREPARE_FOR_MAIN_BRANCH 'nested alignment with quote formatting' "
+test_expect_success 'nested alignment with quote formatting' "
 	cat >expect <<-\EOF &&
 	|'           main               '|
 	|'           side               '|
-- 
gitgitgadget

^ permalink raw reply related	[flat|nested] 163+ messages in thread

* Re: [PATCH 00/28] Use main as default branch name
  2020-11-17 16:10     ` Johannes Schindelin
@ 2020-11-17 19:09       ` Junio C Hamano
  2020-11-18 20:58         ` Johannes Schindelin
  0 siblings, 1 reply; 163+ messages in thread
From: Junio C Hamano @ 2020-11-17 19:09 UTC (permalink / raw)
  To: Johannes Schindelin; +Cc: Johannes Schindelin via GitGitGadget, git

Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:

> Hi Junio,
>
> On Mon, 16 Nov 2020, Junio C Hamano wrote:
>
>> Junio C Hamano <gitster@pobox.com> writes:
>>
>> >    Some test scripts may require setting init.defaultBranch='master'
>> >    at the top in the 'setup' part (I've shown how in my response to
>> >    t4013 patchset) if the body of the test relies too heavily on the
>> >    primary branch to be 'master'.
>>
>> Ah, I realized we have much better mechanism already in the form of
>> GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME environment.
>>
>> So, my three wishes in this message now become
>>
>>  - lose PREPARE_FOR_MAIN_BRANCH prerequisite as quickly as possible
>
> Okay, we're on the same page here.

Yeah, you may have noticed after reading my recent messages to this
topic, my initial reaction was mostly triggered by "eh, are we
losing test coverage too much?" before re-reading what the patches
(both what we have already merged and these 28 final stretch
patches) actually do, and realizing that they aim at preparing us so
that we can flip the fallback default any time we like.  So we are
very much on the same page.

> That's precisely what I do, incrementally, by adjusting that `case`
> statement in `t/test-lib.sh` whenever a range of test scripts has been
> transitioned. In patch 2/28, it looks like this:
>
> 	case "$TEST_NUMBER" in
> 	[01]*)
> 	       GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
> 	       export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
> 	       ;;
> 	esac
>
> By patch 26/28, it looks like this:
>
> 	case "$TEST_NUMBER" in
> 	3404|4013|5310|5526|6300|7064|7817|9902)
> 		# Avoid conflicts with patch series that are cooking at the same
> 		# time
> 		# as the patch series changing the default of
> 		# `init.defaultBranch`.
> 		GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
> 		export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
> 		;;
> 	*)
> 		GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
> 		export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
> 		;;
> 	esac

I actually am not a big fan of the centralized table of "these want
to run with main".  My ideal would be to have an explicit assignment
of either master or main for tests that absolutely require the
default to be one of these names at the top of these script, and any
test scripts that do not care what the initial branch is called
(perhaps because they begin by switching to a branch whose name is
picked by them immediately after they start and use that name
throughout) won't have GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME in them.

I think we can live with a centralized "case", but I have trouble
with seeing only two arms in the above case statement, whether which
one gets the asterisk.  There may be ones that need to force
'master', there may be ones that need to force 'main', but hopefully
many do not even have to force and can work with either.  And seeing
"everything else works only with 'main'" is a bit disappointing.

But if you must have a case with only two arms, i.e. "these are
exceptions" and "everything else", I think the above (i.e. we
refrain from touching these and force them to 'master' as
exceptions, but everything else is forced to 'main') is better than
having them the other way around.

Thanks.



^ permalink raw reply	[flat|nested] 163+ messages in thread

* Re: [PATCH 00/28] Use main as default branch name
  2020-11-12 22:43 [PATCH 00/28] Use main as default branch name Johannes Schindelin via GitGitGadget
                   ` (31 preceding siblings ...)
  2020-11-17 16:12 ` [PATCH v2 00/27] tests: use " Johannes Schindelin via GitGitGadget
@ 2020-11-17 20:48 ` Eric W. Biederman
  2020-11-17 22:47   ` Felipe Contreras
                     ` (2 more replies)
  32 siblings, 3 replies; 163+ messages in thread
From: Eric W. Biederman @ 2020-11-17 20:48 UTC (permalink / raw)
  To: Johannes Schindelin via GitGitGadget
  Cc: git, Johannes Schindelin, Junio C Hamano

"Johannes Schindelin via GitGitGadget" <gitgitgadget@gmail.com> writes:

> This is the big one. This changes the default of init.defaultBranch to main,
> reflecting what many open source projects already did (which was followed by
> GitHub, Azure Repos and others).

Can we please not simply replace one hard coded branch name with
another?

Having a blessed name for the initially created branch continues to
imply the branch has special significance.  As the initially created
branch does not have special significance can we please do
something that does not imply that?

Instead of having a fixed name across all repos for the initially
created branch can we instead use the directory name of the repo for the
branch name?

Advantages:

- The branch name that is somewhat meaningful to the creator of the git
  repo.

  I have at least two repos where I wound up doing this by hand.  So at
  least for me it is something I am doing anyway.

- Tools can not hard code the name of an initially created branch and
  expect it to work.

  This moves us farther from the realm of people assuming incorrectly
  that there is something special about the branch created by default.

- As the name is somewhat meaningful.  This change to the initial branch
  name becomes something that can be argued is a technical improvement
  rather than a simple political statement.

At least for my usage main is a pretty huge misnomer as I barely use the
branch with the master.  Renaming my unused branch main implies that I
am using the tool wrong.


I don't look in on the git list very often so perhaps I am missing a
conversation where all of the details were thought through.  If so
please point me at that conversation.  Otherwise can we please use this
opportunity to come up with something that is actually better than
naming the default branch main, rather than just something just as
awkward whose only advantage is that people don't think it is
politically incorrect this week.

Eric

^ permalink raw reply	[flat|nested] 163+ messages in thread

* Re: [PATCH 00/28] Use main as default branch name
  2020-11-17 20:48 ` [PATCH 00/28] Use " Eric W. Biederman
@ 2020-11-17 22:47   ` Felipe Contreras
  2020-11-17 23:33     ` Jeff King
  2020-11-17 22:55   ` Junio C Hamano
  2020-11-18  2:56   ` Jonathan Nieder
  2 siblings, 1 reply; 163+ messages in thread
From: Felipe Contreras @ 2020-11-17 22:47 UTC (permalink / raw)
  To: Eric W. Biederman
  Cc: Johannes Schindelin via GitGitGadget, Git, Johannes Schindelin,
	Junio C Hamano

On Tue, Nov 17, 2020 at 3:10 PM Eric W. Biederman <ebiederm@xmission.com> wrote:
>
> "Johannes Schindelin via GitGitGadget" <gitgitgadget@gmail.com> writes:
>
> > This is the big one. This changes the default of init.defaultBranch to main,
> > reflecting what many open source projects already did (which was followed by
> > GitHub, Azure Repos and others).
>
> Can we please not simply replace one hard coded branch name with
> another?

I thought precisely the same thing.

This should be easy to do if we make "origin" be a pseudo ref that
points to "origin/HEAD" (and we could introduce "origin/@").

That way there will never be a need to type "origin/master", or having
it as an upstream, you can simply set "origin" as the upstream
tracking "branch".

> I don't look in on the git list very often so perhaps I am missing a
> conversation where all of the details were thought through.  If so
> please point me at that conversation.  Otherwise can we please use this
> opportunity to come up with something that is actually better than
> naming the default branch main, rather than just something just as
> awkward whose only advantage is that people don't think it is
> politically incorrect this week.

This is the thread:

https://lore.kernel.org/git/CAOAHyQwyXC1Z3v7BZAC+Bq6JBaM7FvBenA-1fcqeDV==apdWDg@mail.gmail.com/

Unfortunately in my opinion the most important topics--like your
suggestion--were not even mentioned. Everyone focused on the wrong
thing (e.g. what would be a better name for "master").

Cheers.

-- 
Felipe Contreras

^ permalink raw reply	[flat|nested] 163+ messages in thread

* Re: [PATCH 00/28] Use main as default branch name
  2020-11-17 20:48 ` [PATCH 00/28] Use " Eric W. Biederman
  2020-11-17 22:47   ` Felipe Contreras
@ 2020-11-17 22:55   ` Junio C Hamano
  2020-11-17 23:16     ` Felipe Contreras
  2020-11-18 23:45     ` Philip Oakley
  2020-11-18  2:56   ` Jonathan Nieder
  2 siblings, 2 replies; 163+ messages in thread
From: Junio C Hamano @ 2020-11-17 22:55 UTC (permalink / raw)
  To: Eric W. Biederman
  Cc: Johannes Schindelin via GitGitGadget, git, Johannes Schindelin

ebiederm@xmission.com (Eric W. Biederman) writes:

> "Johannes Schindelin via GitGitGadget" <gitgitgadget@gmail.com> writes:
>
>> This is the big one. This changes the default of init.defaultBranch to main,
>> reflecting what many open source projects already did (which was followed by
>> GitHub, Azure Repos and others).
>
> Can we please not simply replace one hard coded branch name with
> another?
>
> Having a blessed name for the initially created branch continues to
> imply the branch has special significance.  As the initially created
> branch does not have special significance can we please do
> something that does not imply that?

I personally am fond of this line of "let's not treat one single
thing any special among others" approach, but I think the way people
use the initially created branch tends to make it special at the end
of the day.

While the project is still in its infancy, you may use that as the
only branch until the tree of the project starts to take its shape,
perhaps with subdirectories dedicated to sources, documentation, and
overall build procedure, etc.  Then you may start to fork different
branches to work on topics that last more than one commit's worth of
time and then it is likely you'd use the initially created branch as
the integration branch, until you start to need the second and third
integration branches.  Like it or not, the primary integration
branch would inevitably end up being something more special than
others, and it is likely that using the initially created branch for
that purpose would be the most convenient.  There however may exist
two or more equally significant branches, not just one special one,
though, but it is reasonable to have at least one special one.

I think using some word that is derived from $(basename $(pwd)) as
the name of the initial branch may be a more reasonable choice than
using any single word that tries to fit everybody (which will *not*
exist).  When a user says "git init tinyshell" to start a project to
create a tiny shell, "tinyshell" may be one reasonable choice to
refer to its primary integration branch.  Everything that goes into
it will become part of the tinyshell project.

But if there is a woke-safe word that can refer to "the primary
integration branch", calling the initially created branch with that
word by default is also equally a reasonable approach.  I personally
do not like the word 'main' used as such, but the rest of the world
seems to be moving in that direction, so being consistent with them
would help users who want to do

	mkdir project && cd project
	git init
	... some workflow specific 'git config' here ...
	git remote add $URL origin
	git pull origin

and have it be an enhanced equivalent to

	git clone $URL project

The latter will try to find the name used for the primary branch on
the other side and use the same name; the former would not work that
way, but if "git init" uses a fallback default that is most common,
it would hurt less.

In any case, the updated version of these 28 patches no longer has
the final "switch the fallback default to 'main'" step, and the good
thing is that the other 27 patches will help us moving in any
direction.  If we choose to dynamically derive the initial branch
name, these steps make sure that such a change won't break our
testsuite.

> Instead of having a fixed name across all repos for the initially
> created branch can we instead use the directory name of the repo for the
> branch name?
>
> Advantages:
>
> - The branch name that is somewhat meaningful to the creator of the git
>   repo.
>
>   I have at least two repos where I wound up doing this by hand.  So at
>   least for me it is something I am doing anyway.

Direct "other side" of the coin is that the name meaningful to the
creator may be different from project to project, so those who want
to try peeking projects that are so far unknown to them will have to
guess what that meaningful thing is.  When visiting a random github
repository and presented by 47 different branches, it would be more
helpful for such a visitor to have a reliable "this is likely to be
the primary integration branch" cue.  Not having a convention is
worse than having a convention some folks may find suboptimal from
usability's point of view.

> - Tools can not hard code the name of an initially created branch and
>   expect it to work.

Cannot?  Is this a dogmatic declaration?

If tools that are meant to work with variety of projects with a
single "special" branch and do things relative to that special
branch (e.g. perhaps the special branch is the primary integration
branch, and the tool may list commits that are not yet in that
branch), a toolsmith has multiple choices.  The tool can take the
name of the "special" branch from the end-user to be most flexible,
of the tool can hardcode the most commonly used name for the
"special" branch to be out-of-the-box useful for majority of
projects.  Most sensible folks may do the former, but I do not think
the latter is a bad choice.  And even those who do the former has to
fall back to some hardcoded value when the user didn't give the name
of the "special" branch, because end-users are greedy and will
demand such a "convenience" feature, saying "in most repositories,
this name is commonly used for the 'special' branch---why force us
to type the same thing?"


^ permalink raw reply	[flat|nested] 163+ messages in thread

* Re: [PATCH 00/28] Use main as default branch name
  2020-11-17 22:55   ` Junio C Hamano
@ 2020-11-17 23:16     ` Felipe Contreras
  2020-11-18  0:10       ` Junio C Hamano
  2020-11-18 23:45     ` Philip Oakley
  1 sibling, 1 reply; 163+ messages in thread
From: Felipe Contreras @ 2020-11-17 23:16 UTC (permalink / raw)
  To: Junio C Hamano
  Cc: Eric W. Biederman, Johannes Schindelin via GitGitGadget, Git,
	Johannes Schindelin

On Tue, Nov 17, 2020 at 4:57 PM Junio C Hamano <gitster@pobox.com> wrote:
> ebiederm@xmission.com (Eric W. Biederman) writes:

> > - The branch name that is somewhat meaningful to the creator of the git
> >   repo.
> >
> >   I have at least two repos where I wound up doing this by hand.  So at
> >   least for me it is something I am doing anyway.
>
> Direct "other side" of the coin is that the name meaningful to the
> creator may be different from project to project, so those who want
> to try peeking projects that are so far unknown to them will have to
> guess what that meaningful thing is.  When visiting a random github
> repository and presented by 47 different branches, it would be more
> helpful for such a visitor to have a reliable "this is likely to be
> the primary integration branch" cue.  Not having a convention is
> worse than having a convention some folks may find suboptimal from
> usability's point of view.

But a convention is just that: a convention.

If we already know "origin/HEAD" is very likely pointing to the
integration branch, then why do we need to know what that branch is
called in that particular project?

Just refer to that branch as "origin/@", or just "origin".

That would work for projects that follow the convention, and those who
don't. Why does the tool need to care?

Cheers.

-- 
Felipe Contreras

^ permalink raw reply	[flat|nested] 163+ messages in thread

* Re: [PATCH 00/28] Use main as default branch name
  2020-11-17 22:47   ` Felipe Contreras
@ 2020-11-17 23:33     ` Jeff King
  2020-11-18  0:07       ` Junio C Hamano
  2020-11-18  0:18       ` Felipe Contreras
  0 siblings, 2 replies; 163+ messages in thread
From: Jeff King @ 2020-11-17 23:33 UTC (permalink / raw)
  To: Felipe Contreras
  Cc: Eric W. Biederman, Johannes Schindelin via GitGitGadget, Git,
	Johannes Schindelin, Junio C Hamano

On Tue, Nov 17, 2020 at 04:47:56PM -0600, Felipe Contreras wrote:

> On Tue, Nov 17, 2020 at 3:10 PM Eric W. Biederman <ebiederm@xmission.com> wrote:
> >
> > "Johannes Schindelin via GitGitGadget" <gitgitgadget@gmail.com> writes:
> >
> > > This is the big one. This changes the default of init.defaultBranch to main,
> > > reflecting what many open source projects already did (which was followed by
> > > GitHub, Azure Repos and others).
> >
> > Can we please not simply replace one hard coded branch name with
> > another?
> 
> I thought precisely the same thing.
> 
> This should be easy to do if we make "origin" be a pseudo ref that
> points to "origin/HEAD" (and we could introduce "origin/@").

Didn't we already do this long ago? refs/remotes/%s/HEAD is special in
the dwim_ref() lookup:

  $ git rev-parse --symbolic-full-name origin
  refs/remotes/origin/master

Or did you have something else in mind?

I think I have occasionally hit spots where saying "origin" instead of
"origin/master" does not work. I can't think of any offhand now, though
(I thought perhaps "git checkout -b foo origin" or "git branch
--set-upstream-to=origin", but both seem to work).

> > I don't look in on the git list very often so perhaps I am missing a
> > conversation where all of the details were thought through.  If so
> > please point me at that conversation.  Otherwise can we please use this
> > opportunity to come up with something that is actually better than
> > naming the default branch main, rather than just something just as
> > awkward whose only advantage is that people don't think it is
> > politically incorrect this week.
> 
> This is the thread:
> 
> https://lore.kernel.org/git/CAOAHyQwyXC1Z3v7BZAC+Bq6JBaM7FvBenA-1fcqeDV==apdWDg@mail.gmail.com/
> 
> Unfortunately in my opinion the most important topics--like your
> suggestion--were not even mentioned. Everyone focused on the wrong
> thing (e.g. what would be a better name for "master").

There is another thread from the same time that contains quite a lot of
discussion on logistics. This subthread in particular raises the notion
of "let's try to minimize needing a special branch-name at all":

  https://lore.kernel.org/git/875zbrcpgh.fsf@evledraar.gmail.com/

And indeed, it led to some other bug-fixes in improvements in the time
since then:

  - submodule--helper was fixed to use HEAD from the remote as its
    fallback rather than a hard-coded "master"

  - fast-export --anonymize no longer treats "master" as special, but
    instead grew a flexible system for leaving some bits intact

  - fmt-merge-msg gained new options for configuring when it will print
    "into <branch>"

So really all that is left is deciding what to do when:

  git init
  git commit -m foo

is run. Obviously we added a config variable here, but we still fall
back to a hard-coded name. One suggestion was to not use any name, and
either require "git checkout -b some-branch" first, or commit onto a
detached HEAD:

  https://lore.kernel.org/git/B4814F42-7AF8-4D80-93D4-FAF752C72F21@me.com/

The simplicity has some appeal to me, but it's even less
backwards-compatible than falling back to a new different name.

I think Eric's suggestion of using the directory name as a default was
not previously mentioned. I'm not sure I would like that myself (I find
value in having a consistent "this is the main branch" name across
different repositories, at least for my workflows). And it creates all
of the same "every tutorial is now out of date" issues. But it is
neutral. I wouldn't be opposed to seeing it as a configurable option.

-Peff

^ permalink raw reply	[flat|nested] 163+ messages in thread

* Re: [PATCH 00/28] Use main as default branch name
  2020-11-17 23:33     ` Jeff King
@ 2020-11-18  0:07       ` Junio C Hamano
  2020-11-18  1:25         ` Jeff King
  2020-11-18  0:18       ` Felipe Contreras
  1 sibling, 1 reply; 163+ messages in thread
From: Junio C Hamano @ 2020-11-18  0:07 UTC (permalink / raw)
  To: Jeff King
  Cc: Felipe Contreras, Eric W. Biederman,
	Johannes Schindelin via GitGitGadget, Git, Johannes Schindelin

Jeff King <peff@peff.net> writes:

> I think Eric's suggestion of using the directory name as a default was
> not previously mentioned. I'm not sure I would like that myself (I find
> value in having a consistent "this is the main branch" name across
> different repositories, at least for my workflows). And it creates all
> of the same "every tutorial is now out of date" issues. But it is
> neutral. I wouldn't be opposed to seeing it as a configurable option.

I actually recall hearing it from Eric, not on this list, directly
back in the timeframe of these previous dicsussions.  I somehow
thought I relayed it to the community, perhaps #git-devel on
freenode, but apparently not to this list.

Yes, init.defaultBranchName is defined to be a string, so it is a
bit tricky to introduce special values that mean "no, not a
hardcoded value but derive dynamically based on X".  Perhaps use a
prefix that is not allowed in a refname, perhaps like this update to
the function that uses the value read from the init.defaultBranch
configuration variable.

 refs.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git c/refs.c w/refs.c
index 392f0bbf68..3fbc697cd8 100644
--- c/refs.c
+++ w/refs.c
@@ -576,6 +576,12 @@ char *repo_default_branch_name(struct repository *r)
 
 	if (!ret)
 		ret = xstrdup("master");
+	else if (!strcmp(ret, ":dirname"))
+		ret = ... do the $(basename $(cwd)) thing ...;
+	else if (!strcmp(ret, ":some other magic"))
+		ret = ... do some other magic thing ...;
+	else if (ret[0] == ':')
+		die(_("%s - unrecognised magic", ret);
 
 	full_ref = xstrfmt("refs/heads/%s", ret);
 	if (check_refname_format(full_ref, 0))

^ permalink raw reply related	[flat|nested] 163+ messages in thread

* Re: [PATCH 00/28] Use main as default branch name
  2020-11-17 23:16     ` Felipe Contreras
@ 2020-11-18  0:10       ` Junio C Hamano
  2020-11-18  0:51         ` Felipe Contreras
  0 siblings, 1 reply; 163+ messages in thread
From: Junio C Hamano @ 2020-11-18  0:10 UTC (permalink / raw)
  To: Felipe Contreras
  Cc: Eric W. Biederman, Johannes Schindelin via GitGitGadget, Git,
	Johannes Schindelin

Felipe Contreras <felipe.contreras@gmail.com> writes:

> If we already know "origin/HEAD" is very likely pointing to the
> integration branch, then why do we need to know what that branch is
> called in that particular project?
>
> Just refer to that branch as "origin/@", or just "origin".

"git merge origin" turns into "git merge origin/HEAD", I think, and
we had it for quite some time.

But repositories may not even have any origin to begin with.  The
one I am typing this message in certainly does not.  And we need
some fallback default when origin/HEAD cannot be used anyway, and
that is where the convention comes in again.  You cannot escape from
it, and ...

> That would work for projects that follow the convention, and those who
> don't. Why does the tool need to care?

... certainly it would not work for me.


^ permalink raw reply	[flat|nested] 163+ messages in thread

* Re: [PATCH 00/28] Use main as default branch name
  2020-11-17 23:33     ` Jeff King
  2020-11-18  0:07       ` Junio C Hamano
@ 2020-11-18  0:18       ` Felipe Contreras
  2020-11-18  1:22         ` Jeff King
  1 sibling, 1 reply; 163+ messages in thread
From: Felipe Contreras @ 2020-11-18  0:18 UTC (permalink / raw)
  To: Jeff King
  Cc: Eric W. Biederman, Johannes Schindelin via GitGitGadget, Git,
	Johannes Schindelin, Junio C Hamano

On Tue, Nov 17, 2020 at 5:33 PM Jeff King <peff@peff.net> wrote:
> On Tue, Nov 17, 2020 at 04:47:56PM -0600, Felipe Contreras wrote:

> > This should be easy to do if we make "origin" be a pseudo ref that
> > points to "origin/HEAD" (and we could introduce "origin/@").
>
> Didn't we already do this long ago? refs/remotes/%s/HEAD is special in
> the dwim_ref() lookup:
>
>   $ git rev-parse --symbolic-full-name origin
>   refs/remotes/origin/master

Hmmm. For some reason none of my remotes do have a HEAD.

If I do "git remote add", and then fetch, the HEAD doesn't seem to be present.

-- 
Felipe Contreras

^ permalink raw reply	[flat|nested] 163+ messages in thread

* Re: [PATCH 00/28] Use main as default branch name
  2020-11-18  0:10       ` Junio C Hamano
@ 2020-11-18  0:51         ` Felipe Contreras
  0 siblings, 0 replies; 163+ messages in thread
From: Felipe Contreras @ 2020-11-18  0:51 UTC (permalink / raw)
  To: Junio C Hamano
  Cc: Eric W. Biederman, Johannes Schindelin via GitGitGadget, Git,
	Johannes Schindelin

On Tue, Nov 17, 2020 at 6:10 PM Junio C Hamano <gitster@pobox.com> wrote:
>
> Felipe Contreras <felipe.contreras@gmail.com> writes:
>
> > If we already know "origin/HEAD" is very likely pointing to the
> > integration branch, then why do we need to know what that branch is
> > called in that particular project?
> >
> > Just refer to that branch as "origin/@", or just "origin".
>
> "git merge origin" turns into "git merge origin/HEAD", I think, and
> we had it for quite some time.
>
> But repositories may not even have any origin to begin with.  The
> one I am typing this message in certainly does not.  And we need
> some fallback default when origin/HEAD cannot be used anyway, and
> that is where the convention comes in again.  You cannot escape from
> it, and ...

I did not say the convention can be escaped, I said the convention can
be minimized.

Since apparently there's already support for "origin/HEAD", a lot of
documentation can avoid the term "origin/master", and simply use
"origin".

However, we need to make sure users have a properly set up
"origin/HEAD", and at least in my case none of my remotes have set it
up. Looking at the code, it seems:

  git clone URL test

Is different than:

  git init test
  git remote add origin URL
  git fetch origin
  git checkout -b $favorite origin

In the latter there is no origin/HEAD, and I don't see why that should
be the case.

Cheers.

-- 
Felipe Contreras

^ permalink raw reply	[flat|nested] 163+ messages in thread

* Re: [PATCH 00/28] Use main as default branch name
  2020-11-18  0:18       ` Felipe Contreras
@ 2020-11-18  1:22         ` Jeff King
  2020-11-18  1:45           ` Felipe Contreras
  0 siblings, 1 reply; 163+ messages in thread
From: Jeff King @ 2020-11-18  1:22 UTC (permalink / raw)
  To: Felipe Contreras
  Cc: Eric W. Biederman, Johannes Schindelin via GitGitGadget, Git,
	Johannes Schindelin, Junio C Hamano

On Tue, Nov 17, 2020 at 06:18:03PM -0600, Felipe Contreras wrote:

> On Tue, Nov 17, 2020 at 5:33 PM Jeff King <peff@peff.net> wrote:
> > On Tue, Nov 17, 2020 at 04:47:56PM -0600, Felipe Contreras wrote:
> 
> > > This should be easy to do if we make "origin" be a pseudo ref that
> > > points to "origin/HEAD" (and we could introduce "origin/@").
> >
> > Didn't we already do this long ago? refs/remotes/%s/HEAD is special in
> > the dwim_ref() lookup:
> >
> >   $ git rev-parse --symbolic-full-name origin
> >   refs/remotes/origin/master
> 
> Hmmm. For some reason none of my remotes do have a HEAD.
> 
> If I do "git remote add", and then fetch, the HEAD doesn't seem to be present.

Yes, I have run into that, and it's definitely annoying. The
refs/remotes/<remote>/HEAD symref is created by clone, but is not
updated by "fetch". That's intentional, because it's supposed to
represent a local choice (that is merely seeded by the remote side). But
it seems like adding it if it's missing might be reasonable.

I'm not sure if "git remote add" should be doing it (it already can do
it with "git remote set-head -a", but that is not the default when
adding a new remote, which otherwise does not contact the network at
all). Or if "git fetch" should be doing it. Certainly having "fetch
--update-remote-head" would be fine, but that doesn't really solve the
problem (which is that people don't realize they need to specify it).

There was some related discussion in:

  https://lore.kernel.org/git/CAEXP2g8-reK+u2FaO=mMP-nsvuDDWGpwV_tyKG5L5XpU=1LQeg@mail.gmail.com/

but I don't think any patches came out of that.

-Peff

^ permalink raw reply	[flat|nested] 163+ messages in thread

* Re: [PATCH 00/28] Use main as default branch name
  2020-11-18  0:07       ` Junio C Hamano
@ 2020-11-18  1:25         ` Jeff King
  2020-11-18  2:40           ` Jonathan Nieder
  0 siblings, 1 reply; 163+ messages in thread
From: Jeff King @ 2020-11-18  1:25 UTC (permalink / raw)
  To: Junio C Hamano
  Cc: Felipe Contreras, Eric W. Biederman,
	Johannes Schindelin via GitGitGadget, Git, Johannes Schindelin

On Tue, Nov 17, 2020 at 04:07:28PM -0800, Junio C Hamano wrote:

> Jeff King <peff@peff.net> writes:
> 
> > I think Eric's suggestion of using the directory name as a default was
> > not previously mentioned. I'm not sure I would like that myself (I find
> > value in having a consistent "this is the main branch" name across
> > different repositories, at least for my workflows). And it creates all
> > of the same "every tutorial is now out of date" issues. But it is
> > neutral. I wouldn't be opposed to seeing it as a configurable option.
> 
> I actually recall hearing it from Eric, not on this list, directly
> back in the timeframe of these previous dicsussions.  I somehow
> thought I relayed it to the community, perhaps #git-devel on
> freenode, but apparently not to this list.

Could be. I don't keep up with the irc logs.

> Yes, init.defaultBranchName is defined to be a string, so it is a
> bit tricky to introduce special values that mean "no, not a
> hardcoded value but derive dynamically based on X".  Perhaps use a
> prefix that is not allowed in a refname, perhaps like this update to
> the function that uses the value read from the init.defaultBranch
> configuration variable.

Yeah, I restrained myself from getting too far into thinking about
syntax, but I agree we'd want something like that. It might also be OK
to use something that's extremely unlikely to be a default branch name
(like BASENAME), but the ":" syntax you have here isn't bad. Yet another
option is a separate variable (that if set means we do not look at
init.defaultBranch at all).

IMHO, though, all of this is orthogonal to question of what the default
is. Unless we are thinking the basename thing would work as a default,
but I don't think that resolves any of the backwards-compatibility
concerns.

-Peff

^ permalink raw reply	[flat|nested] 163+ messages in thread

* Re: [PATCH 00/28] Use main as default branch name
  2020-11-18  1:22         ` Jeff King
@ 2020-11-18  1:45           ` Felipe Contreras
  2020-11-18  2:06             ` Jeff King
  0 siblings, 1 reply; 163+ messages in thread
From: Felipe Contreras @ 2020-11-18  1:45 UTC (permalink / raw)
  To: Jeff King
  Cc: Eric W. Biederman, Johannes Schindelin via GitGitGadget, Git,
	Johannes Schindelin, Junio C Hamano

On Tue, Nov 17, 2020 at 7:22 PM Jeff King <peff@peff.net> wrote:
>
> On Tue, Nov 17, 2020 at 06:18:03PM -0600, Felipe Contreras wrote:
>
> > On Tue, Nov 17, 2020 at 5:33 PM Jeff King <peff@peff.net> wrote:
> > > On Tue, Nov 17, 2020 at 04:47:56PM -0600, Felipe Contreras wrote:
> >
> > > > This should be easy to do if we make "origin" be a pseudo ref that
> > > > points to "origin/HEAD" (and we could introduce "origin/@").
> > >
> > > Didn't we already do this long ago? refs/remotes/%s/HEAD is special in
> > > the dwim_ref() lookup:
> > >
> > >   $ git rev-parse --symbolic-full-name origin
> > >   refs/remotes/origin/master
> >
> > Hmmm. For some reason none of my remotes do have a HEAD.
> >
> > If I do "git remote add", and then fetch, the HEAD doesn't seem to be present.
>
> Yes, I have run into that, and it's definitely annoying. The
> refs/remotes/<remote>/HEAD symref is created by clone, but is not
> updated by "fetch". That's intentional, because it's supposed to
> represent a local choice (that is merely seeded by the remote side). But
> it seems like adding it if it's missing might be reasonable.

The equivalent of this choice is in "git remote add -m":

  With `-m <master>` option, a symbolic-ref `refs/remotes/<name>/HEAD`
  is set up to point at remote's `<master>` branch. See also the
  set-head command.

This is of course inconsistent. Is it the "head", or is it the "master"?

Presumably if we want to avoid the term "master", then this option
needs to be renamed.

In my opinion unless this option has been explicitly set,
"origin/HEAD" should keep track of whatever remote head is set.

If somebody updates its remote HEAD from "master" to "main", then
origin/HEAD should be updated accordingly. Granted, this may be some
overhead in the 99.999% of the cases where the remote HEAD is the
same, so it may not be worth even thinking about it.

But at least the first fetch after "git remote add" should fetch it,
in my opinion (unless it's manually configured already). I'm not sure
if origin/HEAD can contain some placeholder so that "git fetch" knows
what to do.

Cheers.

-- 
Felipe Contreras

^ permalink raw reply	[flat|nested] 163+ messages in thread

* Re: [PATCH 00/28] Use main as default branch name
  2020-11-18  1:45           ` Felipe Contreras
@ 2020-11-18  2:06             ` Jeff King
  2020-11-18  2:39               ` Jonathan Nieder
  2020-11-18  9:04               ` Felipe Contreras
  0 siblings, 2 replies; 163+ messages in thread
From: Jeff King @ 2020-11-18  2:06 UTC (permalink / raw)
  To: Felipe Contreras
  Cc: Eric W. Biederman, Johannes Schindelin via GitGitGadget, Git,
	Johannes Schindelin, Junio C Hamano

On Tue, Nov 17, 2020 at 07:45:21PM -0600, Felipe Contreras wrote:

> > Yes, I have run into that, and it's definitely annoying. The
> > refs/remotes/<remote>/HEAD symref is created by clone, but is not
> > updated by "fetch". That's intentional, because it's supposed to
> > represent a local choice (that is merely seeded by the remote side). But
> > it seems like adding it if it's missing might be reasonable.
> 
> The equivalent of this choice is in "git remote add -m":
> 
>   With `-m <master>` option, a symbolic-ref `refs/remotes/<name>/HEAD`
>   is set up to point at remote's `<master>` branch. See also the
>   set-head command.

Wow, I'm not sure how that option escaped my notice for all these years.
Of course it would be much more useful if it pulled the value from the
remote HEAD (but again, unless we use "-f" we are not contacting the
remote at all).

> This is of course inconsistent. Is it the "head", or is it the "master"?
> 
> Presumably if we want to avoid the term "master", then this option
> needs to be renamed.

Agreed that the naming is bad.

> In my opinion unless this option has been explicitly set,
> "origin/HEAD" should keep track of whatever remote head is set.
> 
> If somebody updates its remote HEAD from "master" to "main", then
> origin/HEAD should be updated accordingly. Granted, this may be some
> overhead in the 99.999% of the cases where the remote HEAD is the
> same, so it may not be worth even thinking about it.
> 
> But at least the first fetch after "git remote add" should fetch it,
> in my opinion (unless it's manually configured already). I'm not sure
> if origin/HEAD can contain some placeholder so that "git fetch" knows
> what to do.

If it's simply not present (which is the case now after "git remote
add"), then it might be reasonable for "git fetch" to use that as the
hint to fill it in. That would also make "git remote add -f" just work,
I believe.

It does mean that you can _change_ the value of origin/HEAD, but you
wouldn't be allowed to delete it without fetch trying to re-create it.
I suspect this is quite rare, but we might want an escape hatch config.
E.g., remote.origin.updateHEAD that can be set to one of:

  - never; do not touch it

  - create-if-missing; as discussed here

  - always; update it on every fetch

And then it is just a question of what the default is. Currently it is
"never". I suspect most people would be happy with "always", but it does
break some existing flows. But perhaps "create-if-missing" is a good
medium.

-Peff

^ permalink raw reply	[flat|nested] 163+ messages in thread

* Re: [PATCH 00/28] Use main as default branch name
  2020-11-18  2:06             ` Jeff King
@ 2020-11-18  2:39               ` Jonathan Nieder
  2020-11-18 10:12                 ` Felipe Contreras
  2020-11-18  9:04               ` Felipe Contreras
  1 sibling, 1 reply; 163+ messages in thread
From: Jonathan Nieder @ 2020-11-18  2:39 UTC (permalink / raw)
  To: Jeff King
  Cc: Felipe Contreras, Eric W. Biederman,
	Johannes Schindelin via GitGitGadget, Git, Johannes Schindelin,
	Junio C Hamano

Hi,

Jeff King wrote:
> On Tue, Nov 17, 2020 at 07:45:21PM -0600, Felipe Contreras wrote:
>> Jeff King wrote:

>>> Yes, I have run into that, and it's definitely annoying. The
>>> refs/remotes/<remote>/HEAD symref is created by clone, but is not
>>> updated by "fetch". That's intentional, because it's supposed to
>>> represent a local choice (that is merely seeded by the remote side). But
>>> it seems like adding it if it's missing might be reasonable.
>>
>> The equivalent of this choice is in "git remote add -m":
>>
>>   With `-m <master>` option, a symbolic-ref `refs/remotes/<name>/HEAD`
>>   is set up to point at remote's `<master>` branch. See also the
>>   set-head command.
>
> Wow, I'm not sure how that option escaped my notice for all these years.
> Of course it would be much more useful if it pulled the value from the
> remote HEAD (but again, unless we use "-f" we are not contacting the
> remote at all).

When would I want this implicit "set-head -a" and *not* want "-f"?

[...]
>> Presumably if we want to avoid the term "master", then this option
>> needs to be renamed.
>
> Agreed that the naming is bad.

That said, single-letter options often have bad names.  (That's part of
why these days I try to push back against single-letter options unless
a flag is frequently used.)

For consistency with "git clone -b", I suppose one might expect it to
be "git remote add -b".  Or even better, to retire the option and have
people run "git remote set-head" separately.

[...]
> E.g., remote.origin.updateHEAD that can be set to one of:
>
>   - never; do not touch it
>
>   - create-if-missing; as discussed here
>
>   - always; update it on every fetch
>
> And then it is just a question of what the default is. Currently it is
> "never". I suspect most people would be happy with "always", but it does
> break some existing flows. But perhaps "create-if-missing" is a good
> medium.

Thanks for bringing this up --- this is something I had been
interested in as well but hadn't gotten around to contacting the list
about it.

The default value for a config setting like this has two purposes:

- it makes the config setting for affected people who have not
  discovered it

- it provides a sensible, predictable standard behavior

Those two goals are often in tension, as they were for example when
setting the default for push.default.

If I consider them separately:

- to make as smooth a transition as possible for people who were
  relying on "git remote set-head", a good behavior would be to
  *fail the fetch* when the remote HEAD changes.  That would force
  the user to make a choice between "never" and "always".

- one way to relax that without hurting that goal too much would be to
  fail the fetch when the remote HEAD changes from something other
  than "master" or "main".  That way, the common case (moving from a
  default to a project-appropriate setting) would work without
  friction, and in other cases the user could make a choice between
  "never" and "always".

- all that said, the default that I prefer is simply "always".  Like
  Felipe hinted, this is a simple, intuitive behavior that most people
  would expect.

As a transition plan, I can imagine going from one of those first two
to the third after some appropriate period of time has passed.

What do you think?

Thanks,
Jonathan

^ permalink raw reply	[flat|nested] 163+ messages in thread

* Re: [PATCH 00/28] Use main as default branch name
  2020-11-18  1:25         ` Jeff King
@ 2020-11-18  2:40           ` Jonathan Nieder
  2020-11-18  5:43             ` Junio C Hamano
  0 siblings, 1 reply; 163+ messages in thread
From: Jonathan Nieder @ 2020-11-18  2:40 UTC (permalink / raw)
  To: Jeff King
  Cc: Junio C Hamano, Felipe Contreras, Eric W. Biederman,
	Johannes Schindelin via GitGitGadget, Git, Johannes Schindelin

Jeff King wrote:

> IMHO, though, all of this is orthogonal to question of what the default
> is. Unless we are thinking the basename thing would work as a default,
> but I don't think that resolves any of the backwards-compatibility
> concerns.

If we think it would make sense as the *eventual* default, we could use

	[init]
		defaultBranchName =

(i.e., an empty string) to request it early.

^ permalink raw reply	[flat|nested] 163+ messages in thread

* Re: [PATCH 00/28] Use main as default branch name
  2020-11-17 20:48 ` [PATCH 00/28] Use " Eric W. Biederman
  2020-11-17 22:47   ` Felipe Contreras
  2020-11-17 22:55   ` Junio C Hamano
@ 2020-11-18  2:56   ` Jonathan Nieder
  2020-11-18  5:57     ` Junio C Hamano
  2 siblings, 1 reply; 163+ messages in thread
From: Jonathan Nieder @ 2020-11-18  2:56 UTC (permalink / raw)
  To: Eric W. Biederman
  Cc: Johannes Schindelin via GitGitGadget, git, Johannes Schindelin,
	Junio C Hamano

Eric W. Biederman wrote:

> Instead of having a fixed name across all repos for the initially
> created branch can we instead use the directory name of the repo for the
> branch name?
>
> Advantages:
>
> - The branch name that is somewhat meaningful to the creator of the git
>   repo.
>
>   I have at least two repos where I wound up doing this by hand.  So at
>   least for me it is something I am doing anyway.

Example: this would make the main branch in a new git.git repository
default to "git".  However, we would be free to switch to some other
workflow-specific name like "stable".

> - Tools can not hard code the name of an initially created branch and
>   expect it to work.
>
>   This moves us farther from the realm of people assuming incorrectly
>   that there is something special about the branch created by default.

What's especially nice about this is that a repository's local
basename and the URL at which it gets published do not always
coincide.  So scripts designed to be robust would be more likely to
use commands like "git branch --show-current" instead of trying to
guess using the new rule.

That said, if I put myself in the shoes of such a script author for a
moment, I'm likely to be irritated.  What started as a static string
now becomes something dynamic.  If I put myself in the shoes of
someone who has *inherited* a script (a testsuite, maybe), I'm likely
to be even more irritated.

For testsuites, one can buy time by setting init.defaultBranch, but
not for other scripts.

Are there things we can do to make a script author's life easier?

Today if I want to look up a remote repository's default branch,
the best I can do is

	git ls-remote --symref origin HEAD

The output is not as easy to parse as I'd like: it's split between two
lines and has multiple fields on each line.  Worse, it is slow, since
it scans all refs instead of just the ref I wanted.  Even worse, if
another ref in the remote repository ends with /HEAD (e.g.,
refs/remotes/someremote/HEAD), it prints that, too.

If I could do something like

	git ls-remote --format='%(symref)' --exact-match origin HEAD

(using for-each-ref style formats, and allowing exact matching) then
that would be helpful.

In general, this aspect of a less deterministic first branchname is
appealing; it would result in improving the quality of the ecosystem
of tools built around Git.  This is what I like most about this
proposal.

[...]
> At least for my usage main is a pretty huge misnomer as I barely use the
> branch with the master.  Renaming my unused branch main implies that I
> am using the tool wrong.

Is that because "master" is inherited from your upstream?  Which
branch would you want people to check out by default when they clone
from your repo?

For what it's worth:

- I find this proposal really tempting, and have liked it since the
  moment gitster brought it up on #git-devel.  The main reason I
  haven't brought it up since then is that I didn't have a patch
  implementing it. :)

- That said, a fixed string as default would be fine with me, too.

Thanks,
Jonathan

^ permalink raw reply	[flat|nested] 163+ messages in thread

* Re: [PATCH 00/28] Use main as default branch name
  2020-11-18  2:40           ` Jonathan Nieder
@ 2020-11-18  5:43             ` Junio C Hamano
  2020-11-18 11:32               ` Johannes Schindelin
  0 siblings, 1 reply; 163+ messages in thread
From: Junio C Hamano @ 2020-11-18  5:43 UTC (permalink / raw)
  To: Jonathan Nieder
  Cc: Jeff King, Felipe Contreras, Eric W. Biederman,
	Johannes Schindelin via GitGitGadget, Git, Johannes Schindelin

Jonathan Nieder <jrnieder@gmail.com> writes:

>> IMHO, though, all of this is orthogonal to question of what the default
>> is. Unless we are thinking the basename thing would work as a default,
>> but I don't think that resolves any of the backwards-compatibility
>> concerns.
>
> If we think it would make sense as the *eventual* default, we could use
>
> 	[init]
> 		defaultBranchName =
>
> (i.e., an empty string) to request it early.

I am not opposed to the idea to invent a notation that asks for the
basename behaviour, but I do not think it is a good idea to use "an
empty string" for that.  I'd rather see us use some consistent
naming convention to denote any new "non-constant string" thing.

What Peff suggested is a more viable possibility, for example.  When
"[init] defaultBranchAlgorithm = <name>" is set, the fixed string
"init.defaultBranch" is ignored and the algorithm specified with its
name is invoked to come up with a name dynamically.  We may start
with something like 'dirname' as the only supported algorithm but
that way we would avoid painting ourselves in a corner out of which
we cannot escape (e.g. we may come up with a better way than the
basename thing, and we would not have a good way to give it a name
that is easy to use if we wasted "an empty string" for the basename
thing).

^ permalink raw reply	[flat|nested] 163+ messages in thread

* Re: [PATCH 00/28] Use main as default branch name
  2020-11-18  2:56   ` Jonathan Nieder
@ 2020-11-18  5:57     ` Junio C Hamano
  0 siblings, 0 replies; 163+ messages in thread
From: Junio C Hamano @ 2020-11-18  5:57 UTC (permalink / raw)
  To: Jonathan Nieder
  Cc: Eric W. Biederman, Johannes Schindelin via GitGitGadget, git,
	Johannes Schindelin

Jonathan Nieder <jrnieder@gmail.com> writes:

> That said, if I put myself in the shoes of such a script author for a
> moment, I'm likely to be irritated.  What started as a static string
> now becomes something dynamic.  If I put myself in the shoes of
> someone who has *inherited* a script (a testsuite, maybe), I'm likely
> to be even more irritated.

It is conceptually really nice to say that we do not use words like
'master' and 'main' that are 'meaningless' in the context of
thinking about the workflow used for the project and instead pick
the word the end user chose to call (some aspect of) the project
(i.e. the name of the directory to host its working tree).  It
however is much harder to defend the design in real life because it
can lead to the irritations you mention.

> Are there things we can do to make a script author's life easier?

It largely depends on what "specialness" of 'master' branch the
script is interested in, isn't it?

> Today if I want to look up a remote repository's default branch,
> the best I can do is
>
> 	git ls-remote --symref origin HEAD
>
> The output is not as easy to parse as I'd like:...

In a sense, these follower repositories are easier to work with.

You have refs/remotes/origin/HEAD that indicates what the owner of
the local repository considers of the most significance; it is
initialized to match what the remote had pointed with its HEAD when
the repository was cloned, but the local user can repoint it when
the local interest diverge from that of the remote's.  And you do
not need to talk over the network with ls-remote to find that
out (actually asking ls-remote may actively be wrong after the
local user repointed it); you only need to ask 'git symbolic-ref'
which is totally local.




^ permalink raw reply	[flat|nested] 163+ messages in thread

* Re: [PATCH 00/28] Use main as default branch name
  2020-11-18  2:06             ` Jeff King
  2020-11-18  2:39               ` Jonathan Nieder
@ 2020-11-18  9:04               ` Felipe Contreras
  1 sibling, 0 replies; 163+ messages in thread
From: Felipe Contreras @ 2020-11-18  9:04 UTC (permalink / raw)
  To: Jeff King
  Cc: Eric W. Biederman, Johannes Schindelin via GitGitGadget, Git,
	Johannes Schindelin, Junio C Hamano

On Tue, Nov 17, 2020 at 8:06 PM Jeff King <peff@peff.net> wrote:
> On Tue, Nov 17, 2020 at 07:45:21PM -0600, Felipe Contreras wrote:

> > The equivalent of this choice is in "git remote add -m":
> >
> >   With `-m <master>` option, a symbolic-ref `refs/remotes/<name>/HEAD`
> >   is set up to point at remote's `<master>` branch. See also the
> >   set-head command.
>
> Wow, I'm not sure how that option escaped my notice for all these years.
> Of course it would be much more useful if it pulled the value from the
> remote HEAD (but again, unless we use "-f" we are not contacting the
> remote at all).

Seems to come basically untouched since 2007:

  b6f5da1e0f (Teach git-remote add to fetch and track)

> And then it is just a question of what the default is. Currently it is
> "never". I suspect most people would be happy with "always", but it does
> break some existing flows. But perhaps "create-if-missing" is a good
> medium.

Agreed. Personally I don't see any problem with "create-if-missing",
but creating a configuration and defaulting to "never" should be a
good first step.

I'm sending an RFC patch to that effect.

Cheers.

-- 
Felipe Contreras

^ permalink raw reply	[flat|nested] 163+ messages in thread

* Re: [PATCH 00/28] Use main as default branch name
  2020-11-18  2:39               ` Jonathan Nieder
@ 2020-11-18 10:12                 ` Felipe Contreras
  0 siblings, 0 replies; 163+ messages in thread
From: Felipe Contreras @ 2020-11-18 10:12 UTC (permalink / raw)
  To: Jonathan Nieder
  Cc: Jeff King, Eric W. Biederman,
	Johannes Schindelin via GitGitGadget, Git, Johannes Schindelin,
	Junio C Hamano

On Tue, Nov 17, 2020 at 8:39 PM Jonathan Nieder <jrnieder@gmail.com> wrote:
> Jeff King wrote:
> > On Tue, Nov 17, 2020 at 07:45:21PM -0600, Felipe Contreras wrote:
> >> Jeff King wrote:
>
> >>> Yes, I have run into that, and it's definitely annoying. The
> >>> refs/remotes/<remote>/HEAD symref is created by clone, but is not
> >>> updated by "fetch". That's intentional, because it's supposed to
> >>> represent a local choice (that is merely seeded by the remote side). But
> >>> it seems like adding it if it's missing might be reasonable.
> >>
> >> The equivalent of this choice is in "git remote add -m":
> >>
> >>   With `-m <master>` option, a symbolic-ref `refs/remotes/<name>/HEAD`
> >>   is set up to point at remote's `<master>` branch. See also the
> >>   set-head command.
> >
> > Wow, I'm not sure how that option escaped my notice for all these years.
> > Of course it would be much more useful if it pulled the value from the
> > remote HEAD (but again, unless we use "-f" we are not contacting the
> > remote at all).
>
> When would I want this implicit "set-head -a" and *not* want "-f"?

This is what I often do:

 git remote add origin $url
 git fetch origin

That should work (update origin/HEAD), and it currently doesn't.

> > E.g., remote.origin.updateHEAD that can be set to one of:
> >
> >   - never; do not touch it
> >
> >   - create-if-missing; as discussed here
> >
> >   - always; update it on every fetch
> >
> > And then it is just a question of what the default is. Currently it is
> > "never". I suspect most people would be happy with "always", but it does
> > break some existing flows. But perhaps "create-if-missing" is a good
> > medium.
>
> Thanks for bringing this up --- this is something I had been
> interested in as well but hadn't gotten around to contacting the list
> about it.
>
> The default value for a config setting like this has two purposes:
>
> - it makes the config setting for affected people who have not
>   discovered it
>
> - it provides a sensible, predictable standard behavior
>
> Those two goals are often in tension, as they were for example when
> setting the default for push.default.
>
> If I consider them separately:
>
> - to make as smooth a transition as possible for people who were
>   relying on "git remote set-head", a good behavior would be to
>   *fail the fetch* when the remote HEAD changes.  That would force
>   the user to make a choice between "never" and "always".

We don't need to fail the fetch, we can print a warning so the user
can decide what to do next, including ignoring the warning.

Moreover, since projects rarely change the HEAD, we might want to
print the warning always, until the user sets the configuration.

> - one way to relax that without hurting that goal too much would be to
>   fail the fetch when the remote HEAD changes from something other
>   than "master" or "main".  That way, the common case (moving from a
>   default to a project-appropriate setting) would work without
>   friction, and in other cases the user could make a choice between
>   "never" and "always".

This thread started in an attempt to move away from hard-coded values.
This doesn't help in my opinion.

> - all that said, the default that I prefer is simply "always".  Like
>   Felipe hinted, this is a simple, intuitive behavior that most people
>   would expect.
>
> As a transition plan, I can imagine going from one of those first two
> to the third after some appropriate period of time has passed.

I think the default should be "missing", after a warning period. And
perhaps change it to "always" in the next major version, but that
basically gets rid of the manual "origin/HEAD" that seems to have been
there since forever (at least 2007).

I personally don't see any point in manually setting the HEAD (I have
never done so), but that's just me, others might.

Cheers.

-- 
Felipe Contreras

^ permalink raw reply	[flat|nested] 163+ messages in thread

* Re: [PATCH 00/28] Use main as default branch name
  2020-11-18  5:43             ` Junio C Hamano
@ 2020-11-18 11:32               ` Johannes Schindelin
  2020-11-18 15:43                 ` Junio C Hamano
  0 siblings, 1 reply; 163+ messages in thread
From: Johannes Schindelin @ 2020-11-18 11:32 UTC (permalink / raw)
  To: Junio C Hamano
  Cc: Jonathan Nieder, Jeff King, Felipe Contreras, Eric W. Biederman,
	Johannes Schindelin via GitGitGadget, Git

Hi Junio,

On Tue, 17 Nov 2020, Junio C Hamano wrote:

> Jonathan Nieder <jrnieder@gmail.com> writes:
>
> >> IMHO, though, all of this is orthogonal to question of what the default
> >> is. Unless we are thinking the basename thing would work as a default,
> >> but I don't think that resolves any of the backwards-compatibility
> >> concerns.
> >
> > If we think it would make sense as the *eventual* default, we could use
> >
> > 	[init]
> > 		defaultBranchName =
> >
> > (i.e., an empty string) to request it early.
>
> I am not opposed to the idea to invent a notation that asks for the
> basename behaviour, but I do not think it is a good idea to use "an
> empty string" for that.  I'd rather see us use some consistent
> naming convention to denote any new "non-constant string" thing.

At least in the tests, using the empty string for
`GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME` is equivalent for not setting it at
all, i.e. to trigger the fall-back.

So yes, I totally agree that triggering an interactive prompt by the empty
value is not really a good idea (nor a particularly intuitive behavior).

With your idea to special-case any value starting with a colon, `:ask:`
seems like a saner approach.

Having said that, I would still favor the fall-back `main` over this idea:
it is a much smaller (and less annoying) change of behavior to use a less
loaded name than to change from a previously non-interactive to a
now-interactive operation.

As to using the base name by default: I don't think that is a good idea at
all. Not only doesn't it work when you run `git init` in the root
directory (which some people do, and that's totally okay with me), it also
does not work with any base name that isn't a valid ref name. Try this at
home:

	$ git check-ref-format --branch "My Documents"
	fatal: 'My Documents' is not a valid branch name

So while it is a cute idea, in general it will simply fail, and is
therefore worse than any alternative that does _not_ fail in general.

> What Peff suggested is a more viable possibility, for example.  When
> "[init] defaultBranchAlgorithm = <name>" is set, the fixed string
> "init.defaultBranch" is ignored and the algorithm specified with its
> name is invoked to come up with a name dynamically.  We may start
> with something like 'dirname' as the only supported algorithm but
> that way we would avoid painting ourselves in a corner out of which
> we cannot escape (e.g. we may come up with a better way than the
> basename thing, and we would not have a good way to give it a name
> that is easy to use if we wasted "an empty string" for the basename
> thing).

Indeed. In the spirit of minimizing disruption (as promised in
https://sfconservancy.org/news/2020/jun/23/gitbranchname/), I would like
to stay away from changing the default behavior _that_ much.

My current plan is to implement a warning in `git init` (much like the
`pull.rebase` one, which I thought would raise outcries of frustration,
but to my surprise this did not happen, and `git init` is _a lot_ less
common than `git pull`).

This needs to be done with care, obviously. I haven't looked yet, but I
think there is a chance that `git clone` would implicitly look at
`init.defaultBranch` only to override it later by the name of the remote
primary branch. In that case, we obviously do not want to warn the user
because the `init.defaultBranch` value is not actually used.

Ciao,
Dscho

^ permalink raw reply	[flat|nested] 163+ messages in thread

* [PATCH v2 28/27] tests: run tests omitted by PREPARE_FOR_MAIN_BRANCH
  2020-11-17 16:12 ` [PATCH v2 00/27] tests: use " Johannes Schindelin via GitGitGadget
                     ` (26 preceding siblings ...)
  2020-11-17 16:12   ` [PATCH v2 27/27] tests: drop prereq `PREPARE_FOR_MAIN_BRANCH` where no longer needed Johannes Schindelin via GitGitGadget
@ 2020-11-18 11:48   ` Ævar Arnfjörð Bjarmason
  2020-11-18 23:56     ` Johannes Schindelin
  2020-11-18 23:44   ` [PATCH v3 00/28] tests: use main as default branch name Johannes Schindelin via GitGitGadget
  28 siblings, 1 reply; 163+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2020-11-18 11:48 UTC (permalink / raw)
  To: git
  Cc: Junio C Hamano, Johannes Schindelin, Jeff King, Felipe Contreras,
	Ævar Arnfjörð Bjarmason

Reinstate the test coverage lost due to PREPARE_FOR_MAIN_BRANCH. The
remaining impact of that prerequisite was mainly missing coverage from
submodule fetches being lost[1], e.g. impacting my in-flight
ab/retire-parse-remote. Now the prerequisite is effectively a
noop. This goes on top of [2].

I'm not removing the PREPARE_FOR_MAIN_BRANCH prerequisite to keep this
change small, instead it's now effectively a noop. It can be removed
in some later change.

The only remaining occurrences in t5526-fetch-submodules.sh can be
removed without breakage with:

    perl -pi -e 's/PREPARE_FOR_MAIN_BRANCH //g' t/t5526-fetch-submodules.sh

Which at this point leaves only the now-unused prerequisite
declaration in test-lib.sh.

The coverage in t9902-completion.sh was restored by partially
reverting[3]. After that we were left with one test in a mixed
state. It setup "master" but tested for "mai". Change it back to
"mas", pending a more complete refactoring of that test.

This change only conflicts between next..seen by clashing with Peter
Kaestle's in-flights submodule fix[4]. Fixing the resulting logic
error in t5526-fetch-submodules.sh is trivial, simply:

    - compare_refs_in_dir A origin/master B origin/master
    + compare_refs_in_dir A origin/main B origin/main

1. 66713e84e7 ("tests: prepare aligned mentions of the default branch name", 2020-10-23)
2. https://public-inbox.org/git/pull.762.v2.git.1605629547.gitgitgadget@gmail.com/
3. 8164360fc8 ("t9902: prepare a test for the upcoming default branch name", 2020-10-23)
4. https://public-inbox.org/git/1605196853-37359-1-git-send-email-peter.kaestle@nokia.com/

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
---

On Tue, Nov 17 2020, Johannes Schindelin via GitGitGadget wrote:
> To avoid even more conflicts with topics that did not even make it to seen 
> yet, this patch series specifically excludes t3404, t4013, t5310, t5526,
> t6300, t7064, t7817, t9902: in those test scripts, we will still use master 
> for the time being. Once the topics in question have settled, I will send
> the appropriate follow-up patches to adjust them to use main instead.

This is not a replacement for that subsequent cleanup, but seems like
a simple enough thing to have now to reinstate the missing test
coverage.

Perhaps there's some topics not in "seen" that you have in mind as
conflicting, but as noted above the conflict produced here with
in-flight in "seen" is trivial.

Seems worth having that sooner than later if Junio's willing juggle
that.

 t/t5526-fetch-submodules.sh | 6 +++---
 t/t9902-completion.sh       | 6 +++---
 t/test-lib.sh               | 9 +++------
 3 files changed, 9 insertions(+), 12 deletions(-)

diff --git a/t/t5526-fetch-submodules.sh b/t/t5526-fetch-submodules.sh
index dd8e423d25..f45ba02b8a 100755
--- a/t/t5526-fetch-submodules.sh
+++ b/t/t5526-fetch-submodules.sh
@@ -481,7 +481,7 @@ test_expect_success PREPARE_FOR_MAIN_BRANCH "don't fetch submodule when newly re
 	test_i18ncmp expect.err actual.err &&
 	(
 		cd submodule &&
-		git checkout -q master
+		git checkout -q main
 	)
 '
 
@@ -663,9 +663,9 @@ test_expect_success 'fetch new submodule commits on-demand without .gitmodules e
 	git config -f .gitmodules --remove-section submodule.sub1 &&
 	git add .gitmodules &&
 	git commit -m "delete gitmodules file" &&
-	git checkout -B master &&
+	git checkout -B main &&
 	git -C downstream fetch &&
-	git -C downstream checkout origin/master &&
+	git -C downstream checkout origin/main &&
 
 	C=$(git -C submodule commit-tree -m "yet another change outside refs/heads" HEAD^{tree}) &&
 	git -C submodule update-ref refs/changes/7 $C &&
diff --git a/t/t9902-completion.sh b/t/t9902-completion.sh
index 5c01c75d40..3696b85acb 100755
--- a/t/t9902-completion.sh
+++ b/t/t9902-completion.sh
@@ -1055,13 +1055,13 @@ test_expect_success 'teardown after filtering matching refs' '
 	git -C otherrepo branch -D matching/branch-in-other
 '
 
-test_expect_success PREPARE_FOR_MAIN_BRANCH '__git_refs - for-each-ref format specifiers in prefix' '
+test_expect_success '__git_refs - for-each-ref format specifiers in prefix' '
 	cat >expected <<-EOF &&
 	evil-%%-%42-%(refname)..master
 	EOF
 	(
-		cur="evil-%%-%42-%(refname)..mai" &&
-		__git_refs "" "" "evil-%%-%42-%(refname).." mai >"$actual"
+		cur="evil-%%-%42-%(refname)..mas" &&
+		__git_refs "" "" "evil-%%-%42-%(refname).." mas >"$actual"
 	) &&
 	test_cmp expected "$actual"
 '
diff --git a/t/test-lib.sh b/t/test-lib.sh
index d39bdf04ce..ed489b2213 100644
--- a/t/test-lib.sh
+++ b/t/test-lib.sh
@@ -257,7 +257,7 @@ case "$TRASH_DIRECTORY" in
 esac
 
 case "$TEST_NUMBER" in
-3404|4013|5310|5526|6300|7064|7817|9902)
+3404|4013|5310|6300|7064|7817|9902)
 	# Avoid conflicts with patch series that are cooking at the same time
 	# as the patch series changing the default of `init.defaultBranch`.
 	GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
@@ -1725,12 +1725,9 @@ test_lazy_prereq REBASE_P '
 	test -z "$GIT_TEST_SKIP_REBASE_P"
 '
 
-# Special-purpose prereq for transitioning to a new default branch name:
-# Some tests need more than just a mindless (case-preserving) s/master/main/g
-# replacement. The non-trivial adjustments are guarded behind this
-# prerequisite, acting kind of as a feature flag
+# Obsolete, do not use, removed soon!
 test_lazy_prereq PREPARE_FOR_MAIN_BRANCH '
-	test "$GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME" = main
+	test "$TEST_NAME" = "t5526-fetch-submodules"
 '
 
 # Ensure that no test accidentally triggers a Git command
-- 
2.29.2.222.g5d2a92d10f8


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* Re: [RFC/PATCH] tests: support testing with an arbitrary default branch (sort of)
       [not found]             ` <nycvar.QRO.7.76.6.2011162118060.18437@tvgsbejvaqbjf.bet>
@ 2020-11-18 13:32               ` Ævar Arnfjörð Bjarmason
  2020-11-18 14:16                 ` Felipe Contreras
                                   ` (2 more replies)
  0 siblings, 3 replies; 163+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2020-11-18 13:32 UTC (permalink / raw)
  To: Johannes Schindelin
  Cc: Jeff King, git, Junio C Hamano, Theodore Ts'o,
	Don Goodman-Wilson, brian m. carlson, Felipe Contreras


On Mon, Nov 16 2020, Johannes Schindelin wrote:

> Hi Ævar,
>
> On Sat, 14 Nov 2020, Ævar Arnfjörð Bjarmason wrote:
>
>> On Fri, Nov 13 2020, Johannes Schindelin wrote:
>>
>> > Whatever telemetry I would be able to pull would not be representative,
>> > and I would not be at liberty to share it anyway. So I asked Alex Mullans
>> > of GitHub (who is in charge of the default branch name switch to `main`
>> > there) whether he has any data I could share publicly and he said: "Across
>> > GitHub, 1/4 of daily pushes (and growing) go to `main`."
>> >
>> > Seeing as the branch name to be used in newly-created repositories on
>> > GitHub changed only very recently (October 1st, i.e. some 6 weeks ago), I
>> > highly suspect that this number means that _a lot_ of existing projects
>> > have changed their primary branch name to `main`, and seem to be quite
>> > happy with it.
>> >
>> > All this is to say that I consider it unnecessary to have a long
>> > deprecation period or major version bump for this patch series, based on
>> > available public data. The name `main` is already in wide-spread use (and
>> > growing) as primary branch name of Git projects.
>>
>> [...]
>> I'm on the fence about what we should do in that case, but I'm leaning
>> towards some deprecation period or at least some other approach than a
>> s/master/main/g change precisely because of the numbers you're citing.
>>
>> Because they shows how irrelevant the default shipped with git.git is to
>> users who want this s/master/main/g change in repositories they
>> regularly use. So we're really mostly talking about an impact to scripts
>> & some advanced users, both of who have a pretty good argument for
>> "init"'s default being what's been explicitly documented for ages in its
>> manpage.
>
> I think you have a good point here. It really does not matter _all_ that
> much, yet I still would like to complete the switch to `main` at some
> stage. But as you point out, that point does not _have_ to be now.
>
> As a consequence, I reconsider my stance on "splitting off patch 28". I
> think I will send out a v2 tomorrow, including the fix you suggested for
> t1400 to also rename `naster` to `nain`, and dropping the patch that
> changes the fall-back for `init.defaultBranch` for now.
>
> I _do_ want to complete the transition to using
> `GIT_TEST_DEFAULT_INIT_BRANCH=main` to address the concern you raised
> elsewhere: a couple of test cases are skipped until that transition is
> complete.
>
> After I send out v2, I will work on that patch that imitates d18c950a69f
> (pull: warn if the user didn't say whether to rebase or to merge,
> 2020-03-09) to show some advice when `init.defaultBranch` is not set.
>
> My current thinking is that we could show this advice for about half a
> year and then make the switch to `main`, continuing to show the advice
> (now adjusted for `main`) for about another half year, and then turn the
> warning off.
>
> What do you think, does that sound too conservative of a plan?

The v2 looks good to me. I just had a suggestion in [1] to apply
something on top to restore the test coverage until while whatever comes
after it lands.

In case I didn't make it clear I have no objection entirely replacing
"master" with "main" in the tests. I just had a practical
concern/question about coverage while it was landing, and a suggestion
of whether perhaps there was an easier/faster way to do the "init"
change first by omitting some of the test churn.

But if you want to do all the legwork that's fine by me :)

I just thought that a sober estimation of how long it takes patches to
land would mean the v1 would be in some in-between state for the next
release.

FWIW I'm not necessarily for some warning. I mainly wanted to attempt to
mediate some of the discussion about the concern to something more
productive.

At the risk of repeating too much of my past overly long E-Mails, but if
I'm being difficult for you when you're submitting patches & causing
work for you I think I owe you an unambiguous explanation for why that
is:

I think some of the people advocating this change can rightly look at
some of the previous E-Mail traffic and see what are at best rants and
at worst some political grandstanding that's at best pretty irrelevant
to any proposed changes in git.git.

But that doesn't mean that there aren't some legitimate concerns. Those
are in my mind separate from the particular political motivations of the
s/master/main/ change, we'd have those with any change to the defaults
in the core tooling.

I think in general with such changes that replies like Theodore Ts'o
here [2] (not picking on him in particular, I just thought it was
representative) reflect a rather insular view of how we need to think
about these sorts of changes.

I.e. a *lot* of git users probably aren't aware that there's even a git
config (they use some 3rd party UI), and I'd say the vast majority are
likely to never find or read any sort of release notes about changes we
make.

Most people's relation to git is like my relation to netcat. It's some
tool I use 1-2 levels down in my stack, and I only bothered to find out
about it because "ssh" stopped working one day.

If at the end of the day we decide to keep something like your original
v1 28/28 patch + docs after some realistic look at the impact that would
be fine by me. Just as long as we understand who we're likely to break
stuff for, and whether it's worth the trade-off.

To Theodore's point about some people's motivations in [2], just to make
my stance/opinion on the end-state clear (so far in all these threads
I've been commenting on the "how" of the incremental transition):

I do 100% agree that the s/master/main/g change of the default should be
made in one form or another. In my mind that doesn't even require a
consideration of the political motivations at this point as far as
git.git is concerned, just:

 1. Major Git hosting providers already made the change

 2. Realistically a lot/majority of git's user base interact with that
    in a major way.

 3. A discrepancy in any default between /usr/bin/git and those
    providers is more confusing than not.

 4. #3 doesn't mean they say "jump" we say "how high" whatever the
    change is.

    But in this case the default is an entirely arbitrary default. Not
    e.g. that they decided to add some ill-thought out header to the
    object format or whatever.

P.S.: Shouldn't the pull patch in d18c950a69f be using the advice
     facility, not warning()?

1. https://public-inbox.org/git/20201118114834.11137-1-avarab@gmail.com/

2. https://public-inbox.org/git/20201115034649.GC3985404@mit.edu/

^ permalink raw reply	[flat|nested] 163+ messages in thread

* Re: [RFC/PATCH] tests: support testing with an arbitrary default branch (sort of)
  2020-11-18 13:32               ` Ævar Arnfjörð Bjarmason
@ 2020-11-18 14:16                 ` Felipe Contreras
  2020-11-20 11:36                   ` Ævar Arnfjörð Bjarmason
  2020-11-18 15:56                 ` Junio C Hamano
  2020-11-19 10:46                 ` Johannes Schindelin
  2 siblings, 1 reply; 163+ messages in thread
From: Felipe Contreras @ 2020-11-18 14:16 UTC (permalink / raw)
  To: Ævar Arnfjörð Bjarmason
  Cc: Johannes Schindelin, Jeff King, Git, Junio C Hamano,
	Theodore Ts'o, Don Goodman-Wilson, brian m. carlson

On Wed, Nov 18, 2020 at 7:32 AM Ævar Arnfjörð Bjarmason
<avarab@gmail.com> wrote:

> I do 100% agree that the s/master/main/g change of the default should be
> made in one form or another. In my mind that doesn't even require a
> consideration of the political motivations at this point as far as
> git.git is concerned, just:

Others disagree.

While the political motivation shouldn't be a central concern, I
suspect the vast majority of users have no idea this change is coming,
and when they see the warning they will likely complain... Strongly.
The fact that this change is extremely politically charged will become
a factor.

>  1. Major Git hosting providers already made the change

That's their decision. The Git project shouldn't be held hostage to
third party decisions.

>  2. Realistically a lot/majority of git's user base interact with that
>     in a major way.
>
>  3. A discrepancy in any default between /usr/bin/git and those
>     providers is more confusing than not.

That's a problem for GitHub et al. Fortunately they can tell their
users to set init.defaultbranch to whatever they want.

>  4. #3 doesn't mean they say "jump" we say "how high" whatever the
>     change is.
>
>     But in this case the default is an entirely arbitrary default. Not
>     e.g. that they decided to add some ill-thought out header to the
>     object format or whatever.

I don't agree it is arbitrary, otherwise you could set the default to
"loremipsum". Moreover, even if was arbitrary, it was arbitrary in
2005, not 2020 where "master" is already widely used in basically
*all* the documentation everywhere. Some people have been using this
name for 15 years, they won't give it up just like that.

People will complain, especially if they don't see a good reason for the change.

-- 
Felipe Contreras

^ permalink raw reply	[flat|nested] 163+ messages in thread

* Re: [PATCH 00/28] Use main as default branch name
  2020-11-18 11:32               ` Johannes Schindelin
@ 2020-11-18 15:43                 ` Junio C Hamano
  2020-11-19  9:22                   ` Johannes Schindelin
  0 siblings, 1 reply; 163+ messages in thread
From: Junio C Hamano @ 2020-11-18 15:43 UTC (permalink / raw)
  To: Johannes Schindelin
  Cc: Jonathan Nieder, Jeff King, Felipe Contreras, Eric W. Biederman,
	Johannes Schindelin via GitGitGadget, Git

Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:

> So yes, I totally agree that triggering an interactive prompt by the empty
> value is not really a good idea (nor a particularly intuitive behavior).

Puzzled.

Nobody talked about going interactive so far and I didn't suggest
it---even though I think it is a cute idea to give a "what branch
name do you want to use?" prompt, I do not think it is practical.

I thought it was obvious, but the key to coming up with a name
dynamically instead of using a fixed string is to derive from a cue
the end user gives, not directly use what the end user gives.  I do
not think anybody in the discussion meant by "the <basename> thing"
to literally use $(basename $(cwd)) output, but use it to derive a
token that check-ref-format likes.  As you may have already known
when you wrote them, "My Documents" or the root directory case are
red herring---it would be trivial to derive "MyDocuments" or
"my-documents" for the former, and for the latter, it is totally OK
for the deriving rule to come up with any of "unnamed", "initial",
etc.

Most of the thing you said in the message I am responding to did not
make much sense to me.  Perhaps you can retry after reading the
message you are responding to again?

Thanks.

^ permalink raw reply	[flat|nested] 163+ messages in thread

* Re: [RFC/PATCH] tests: support testing with an arbitrary default branch (sort of)
  2020-11-18 13:32               ` Ævar Arnfjörð Bjarmason
  2020-11-18 14:16                 ` Felipe Contreras
@ 2020-11-18 15:56                 ` Junio C Hamano
  2020-11-19  9:32                   ` Johannes Schindelin
  2020-11-19 10:46                 ` Johannes Schindelin
  2 siblings, 1 reply; 163+ messages in thread
From: Junio C Hamano @ 2020-11-18 15:56 UTC (permalink / raw)
  To: Ævar Arnfjörð Bjarmason
  Cc: Johannes Schindelin, Jeff King, git, Theodore Ts'o,
	Don Goodman-Wilson, brian m. carlson, Felipe Contreras

Ævar Arnfjörð Bjarmason <avarab@gmail.com> writes:

> ... In my mind that doesn't even require a
> consideration of the political motivations at this point as far as
> git.git is concerned, just:
>
>  1. Major Git hosting providers already made the change
>
>  2. Realistically a lot/majority of git's user base interact with that
>     in a major way.
>
>  3. A discrepancy in any default between /usr/bin/git and those
>     providers is more confusing than not.
>
>  4. #3 doesn't mean they say "jump" we say "how high" whatever the
>     change is.
>
>     But in this case the default is an entirely arbitrary default. Not
>     e.g. that they decided to add some ill-thought out header to the
>     object format or whatever.

Yes.

> P.S.: Shouldn't the pull patch in d18c950a69f be using the advice
>      facility, not warning()?

I think warning() is the right thing here, as it is self squelching.
Setting pull.rebase (even to 'false') is sufficient---there is no
need to set advise.setpullrebase to 'false' on top.

^ permalink raw reply	[flat|nested] 163+ messages in thread

* Re: [PATCH 00/28] Use main as default branch name
  2020-11-17 19:09       ` Junio C Hamano
@ 2020-11-18 20:58         ` Johannes Schindelin
  0 siblings, 0 replies; 163+ messages in thread
From: Johannes Schindelin @ 2020-11-18 20:58 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Johannes Schindelin via GitGitGadget, git

Hi Junio,

On Tue, 17 Nov 2020, Junio C Hamano wrote:

> Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
>
> > 	case "$TEST_NUMBER" in
> > 	3404|4013|5310|5526|6300|7064|7817|9902)
> > 		# Avoid conflicts with patch series that are cooking at the same
> > 		# time
> > 		# as the patch series changing the default of
> > 		# `init.defaultBranch`.
> > 		GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
> > 		export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
> > 		;;
> > 	*)
> > 		GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
> > 		export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
> > 		;;
> > 	esac
>
> I actually am not a big fan of the centralized table of "these want
> to run with main".  My ideal would be to have an explicit assignment
> of either master or main for tests that absolutely require the
> default to be one of these names at the top of these script, and any
> test scripts that do not care what the initial branch is called
> (perhaps because they begin by switching to a branch whose name is
> picked by them immediately after they start and use that name
> throughout) won't have GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME in them.

I will make it so in v3.

It does make sense, too: the four patch series I sent out in the past
hours address some issues that I would have otherwise missed in the
transition (in particular, two test cases with `test_must_fail` in them
would have continued to pass, but for the wrong reason, during the
transition to `main`.

Ciao,
Dscho

^ permalink raw reply	[flat|nested] 163+ messages in thread

* [PATCH v3 00/28] tests: use main as default branch name
  2020-11-17 16:12 ` [PATCH v2 00/27] tests: use " Johannes Schindelin via GitGitGadget
                     ` (27 preceding siblings ...)
  2020-11-18 11:48   ` [PATCH v2 28/27] tests: run tests omitted by PREPARE_FOR_MAIN_BRANCH Ævar Arnfjörð Bjarmason
@ 2020-11-18 23:44   ` Johannes Schindelin via GitGitGadget
  2020-11-18 23:44     ` [PATCH v3 01/28] tests: mark tests relying on the current default for `init.defaultBranch` Johannes Schindelin via GitGitGadget
                       ` (28 more replies)
  28 siblings, 29 replies; 163+ messages in thread
From: Johannes Schindelin via GitGitGadget @ 2020-11-18 23:44 UTC (permalink / raw)
  To: git
  Cc: Felipe Contreras, Ævar Arnfjörð Bjarmason,
	Johannes Schindelin, Jeff King, Jonathan Nieder,
	Johannes Schindelin

This (big) patch series (almost) concludes the transition of Git's test
suite to use init.defaultBranch=main that was started in 
js/default-branch-name-part-4-minus-1, continued in 
js/default-branch-name-adjust-t5411 and in 
js/default-branch-name-adjust-t5515. This transition prepares for changing
the fall-back value of init.defaultBranch accordingly (which will be done in
a different set of patch series, with an appropriate deprecation period),
reflecting what many open source projects already did followed by GitHub,
Azure Repos and others.

Before doing anything else, the series starts out with a patch that marks
all the test scripts that expect a specific default branch name and won't
pass with any other name.

Instead of one huge patch that reflects essentially a search-and-replace in
the test suite, this patch series then splits the changes up into chunks
that are intended to be smaller than 100kB so that they are not rejected by
the Git mailing list. Interspersed between those changes are adjustments
e.g. in alignment, to make it easier to review (or recreate) the
search-and-replace patches.

Note that this branch is based on next, mostly because it would otherwise
conflict with en/merge-tests, jk/diff-release-filespec-fix and 
ds/maintenance-part-3.

To avoid even more conflicts with topics that did not even make it to seen 
yet, this patch series specifically excludes t1309, t2106, t3040, t3404,
t4013, t4015, t5310, t5526, t6300, t7064, t7817, t9902: in those test
scripts, we will still use master for the time being. Once the topics in
question have settled, I will send the appropriate follow-up patches to
adjust them to use main instead.

Note that even after this patch series, master is still found in t/, even
outside of the tests we excluded specifically to avoid conflicts with other
patch series that are currently in flight: t/perf/, the git p4 tests
(because git p4 still uses p4/master to refer to the remote main branch),
and some comments still refer to this name. I intend to address at least
some of those, in patch series separate from the current one.

Changes since v2:

 * The case statement setting the default branch name for each test script
   was replaced by an initial patch that sets the default branch name in
   those test scripts that need it (and only in those). This patch also
   modifies the linux-gcc job to verify that the test suite runs with
   overridden default branch name (which the now-marked test scripts
   over-override).
 * Four more test scripts were excluded from this patch series: t1309,
   t2106, t3040 and t4015. These are handled in four separate patch series,
   where I try to remove the requirement to hard-code the default branch
   name in the first place.

Changes since v1:

 * Dropped the commit changing the default initial branch name for git init.
 * Adjusted the patch for t1402 to also replace naster by nain.
 * Excluded t5526 from the patches for now, to avoid clashing with 
   pk/subsub-fetch-fix.

Johannes Schindelin (28):
  tests: mark tests relying on the current default for
    `init.defaultBranch`
  t0060: preemptively adjust alignment
  t[01]*: adjust the references to the default branch name "main"
  t2*: adjust the references to the default branch name "main"
  t3[0-3]*: adjust the references to the default branch name "main"
  t3416: preemptively adjust alignment in a comment
  t34*: adjust the references to the default branch name "main"
  t3[5-9]*: adjust the references to the default branch name "main"
  t4*: adjust the references to the default branch name "main"
  t5323: prepare centered comment for `master` -> `main`
  t5[0-4]*: adjust the references to the default branch name "main"
  t5503: prepare aligned comment for replacing `master` with `main`
  t550*: adjust the references to the default branch name "main"
  t551*: adjust the references to the default branch name "main"
  t55[23]*: adjust the references to the default branch name "main"
  t55[4-9]*: adjust the references to the default branch name "main"
  t5[6-9]*: adjust the references to the default branch name "main"
  t6[0-3]*: adjust the references to the default branch name "main"
  t64*: preemptively adjust alignment to prepare for `master` -> `main`
  t6[4-9]*: adjust the references to the default branch name "main"
  t7[0-4]*: adjust the references to the default branch name "main"
  t7[5-9]*: adjust the references to the default branch name "main"
  t8*: adjust the references to the default branch name "main"
  t9[0-4]*: adjust the references to the default branch name "main"
  t9[5-7]*: adjust the references to the default branch name "main"
  tests(git-p4): transition to the default branch name `main`
  t99*: adjust the references to the default branch name "main"
  tests: drop prereq `PREPARE_FOR_MAIN_BRANCH` where no longer needed

 ci/run-build-and-tests.sh                     |   2 +
 t/annotate-tests.sh                           |   8 +-
 t/lib-cvs.sh                                  |   2 +-
 t/t0002-gitfile.sh                            |   9 +-
 t/t0020-crlf.sh                               |  11 +-
 t/t0021-conversion.sh                         |  43 +-
 t/t0027-auto-crlf.sh                          |   4 +-
 t/t0028-working-tree-encoding.sh              |   7 +-
 t/t0041-usage.sh                              |  13 +-
 t/t0050-filesystem.sh                         |   9 +-
 t/t0060-path-utils.sh                         |   4 +-
 t/t0100-previous.sh                           |  21 +-
 t/t1004-read-tree-m-u-wf.sh                   |  43 +-
 t/t1008-read-tree-overlay.sh                  |   5 +-
 t/t1009-read-tree-new-index.sh                |   7 +-
 t/t1011-read-tree-sparse-checkout.sh          |   2 +-
 t/t1021-rerere-in-workdir.sh                  |   5 +-
 t/t1090-sparse-checkout-scope.sh              |  13 +-
 t/t1091-sparse-checkout-builtin.sh            |   5 +-
 t/t1300-config.sh                             |  11 +-
 t/t1301-shared-repo.sh                        |   7 +-
 t/t1305-config-include.sh                     |   2 +-
 t/t1400-update-ref.sh                         |  75 +--
 t/t1402-check-ref-format.sh                   |  32 +-
 t/t1403-show-ref.sh                           |  21 +-
 t/t1405-main-ref-store.sh                     |  45 +-
 t/t1406-submodule-ref-store.sh                |  33 +-
 t/t1407-worktree-ref-store.sh                 |  35 +-
 t/t1408-packed-refs.sh                        |  15 +-
 t/t1410-reflog.sh                             |  59 +-
 t/t1411-reflog-show.sh                        |   5 +-
 t/t1413-reflog-detach.sh                      |  27 +-
 t/t1414-reflog-walk.sh                        |  15 +-
 t/t1416-ref-transaction-hooks.sh              |  13 +-
 t/t1430-bad-ref-name.sh                       |  55 +-
 t/t1450-fsck.sh                               |   2 +-
 t/t1500-rev-parse.sh                          |   7 +-
 t/t1503-rev-parse-verify.sh                   |  31 +-
 t/t1505-rev-parse-last.sh                     |  11 +-
 t/t1506-rev-parse-diagnosis.sh                |   7 +-
 t/t1507-rev-parse-upstream.sh                 |  43 +-
 t/t1508-at-combinations.sh                    |  13 +-
 t/t1511-rev-parse-caret.sh                    |  29 +-
 t/t1512-rev-parse-disambiguation.sh           |   5 +-
 t/t1513-rev-parse-prefix.sh                   |   7 +-
 t/t1514-rev-parse-push.sh                     |  19 +-
 t/t1700-split-index.sh                        |   5 +-
 t/t2007-checkout-symlink.sh                   |  13 +-
 t/t2009-checkout-statinfo.sh                  |  11 +-
 t/t2010-checkout-ambiguous.sh                 |   7 +-
 t/t2011-checkout-invalid-head.sh              |  19 +-
 t/t2012-checkout-last.sh                      |  51 +-
 t/t2015-checkout-unborn.sh                    |   5 +-
 t/t2017-checkout-orphan.sh                    |  47 +-
 t/t2020-checkout-detach.sh                    |  31 +-
 t/t2022-checkout-paths.sh                     |  25 +-
 t/t2023-checkout-m.sh                         |  13 +-
 t/t2024-checkout-dwim.sh                      |  70 +--
 t/t2027-checkout-track.sh                     |   9 +-
 t/t2030-unresolve-info.sh                     |   9 +-
 t/t2060-switch.sh                             |  33 +-
 t/t2070-restore.sh                            |   7 +-
 t/t2400-worktree-add.sh                       |  69 +--
 t/t2401-worktree-prune.sh                     |   5 +-
 t/t2402-worktree-list.sh                      |  23 +-
 t/t2405-worktree-submodule.sh                 |   9 +-
 t/t3200-branch.sh                             | 251 ++++-----
 t/t3201-branch-contains.sh                    |  85 +--
 t/t3202-show-branch-octopus.sh                |   5 +-
 t/t3203-branch-output.sh                      |  43 +-
 t/t3204-branch-name-interpretation.sh         |   9 +-
 t/t3205-branch-color.sh                       |  11 +-
 t/t3206-range-diff.sh                         |  43 +-
 t/t3206/history.export                        |   2 +-
 t/t3210-pack-refs.sh                          |   7 +-
 t/t3211-peel-ref.sh                           |   7 +-
 t/t3301-notes.sh                              |   6 +-
 t/t3302-notes-index-expensive.sh              |   5 +-
 t/t3303-notes-subtrees.sh                     |  11 +-
 t/t3304-notes-mixed.sh                        |  11 +-
 t/t3308-notes-merge.sh                        |   2 +-
 t/t3320-notes-merge-worktrees.sh              |   7 +-
 t/t3400-rebase.sh                             |  63 +--
 t/t3402-rebase-merge.sh                       |  47 +-
 t/t3403-rebase-skip.sh                        |   9 +-
 t/t3404-rebase-interactive.sh                 |   3 +
 t/t3405-rebase-malformed.sh                   |  11 +-
 t/t3406-rebase-message.sh                     |  27 +-
 t/t3407-rebase-abort.sh                       |  21 +-
 t/t3408-rebase-multi-line.sh                  |   5 +-
 t/t3409-rebase-preserve-merges.sh             |  13 +-
 t/t3412-rebase-root.sh                        |  31 +-
 t/t3413-rebase-hook.sh                        |  45 +-
 t/t3415-rebase-autosquash.sh                  |   5 +-
 t/t3416-rebase-onto-threedots.sh              |  57 +-
 t/t3418-rebase-continue.sh                    |  27 +-
 t/t3419-rebase-patch-id.sh                    |  15 +-
 t/t3420-rebase-autostash.sh                   |  11 +-
 t/t3423-rebase-reword.sh                      |   6 +-
 t/t3427-rebase-subtree.sh                     |  23 +-
 t/t3430-rebase-merges.sh                      |  19 +-
 t/t3431-rebase-fork-point.sh                  |  35 +-
 t/t3432-rebase-fast-forward.sh                |  37 +-
 t/t3434-rebase-i18n.sh                        |  11 +-
 t/t3435-rebase-gpg-sign.sh                    |   7 +-
 t/t3436-rebase-more-options.sh                |   2 +-
 t/t3500-cherry.sh                             |  15 +-
 t/t3501-revert-cherry-pick.sh                 |   7 +-
 t/t3502-cherry-pick-merge.sh                  |   5 +-
 t/t3503-cherry-pick-root.sh                   |  13 +-
 t/t3504-cherry-pick-rerere.sh                 |  27 +-
 t/t3505-cherry-pick-empty.sh                  |  27 +-
 t/t3506-cherry-pick-ff.sh                     |  11 +-
 t/t3507-cherry-pick-conflict.sh               |   5 +-
 t/t3508-cherry-pick-many-commits.sh           |  41 +-
 t/t3509-cherry-pick-merge-df.sh               |   5 +-
 t/t3512-cherry-pick-submodule.sh              |   5 +-
 t/t3600-rm.sh                                 |  13 +-
 t/t3701-add-interactive.sh                    |   7 +-
 t/t3901-i18n-patch.sh                         |  43 +-
 t/t3903-stash.sh                              |  35 +-
 t/t3910-mac-os-precompose.sh                  |   9 +-
 t/t4013-diff-various.sh                       |   3 +
 t/t4014-format-patch.sh                       | 179 ++++---
 t/t4017-diff-retval.sh                        |   5 +-
 t/t4038-diff-combined.sh                      |  17 +-
 t/t4041-diff-submodule-option.sh              |   5 +-
 t/t4048-diff-combined-binary.sh               |  13 +-
 t/t4052-stat-output.sh                        |   7 +-
 t/t4056-diff-order.sh                         |   5 +-
 t/t4057-diff-combined-paths.sh                |  23 +-
 t/t4061-diff-indent.sh                        |  27 +-
 t/t4066-diff-emit-delay.sh                    |   5 +-
 t/t4068-diff-symmetric-merge-base.sh          |  51 +-
 t/t4103-apply-binary.sh                       |  39 +-
 t/t4108-apply-threeway.sh                     |  17 +-
 t/t4121-apply-diffs.sh                        |   5 +-
 t/t4122-apply-symlink-inside.sh               |   9 +-
 t/t4150-am.sh                                 |  29 +-
 t/t4200-rerere.sh                             |  23 +-
 t/t4201-shortlog.sh                           |   5 +-
 t/t4202-log.sh                                | 109 ++--
 t/t4203-mailmap.sh                            |   5 +-
 t/t4204-patch-id.sh                           |  29 +-
 t/t4207-log-decoration-colors.sh              |   9 +-
 t/t4208-log-magic-pathspec.sh                 |   7 +-
 t/t4211-line-log.sh                           |   3 +
 t/t4211/history.export                        |   2 +-
 t/t4214-log-graph-octopus.sh                  |   5 +-
 t/t4216-log-bloom.sh                          |   7 +-
 t/t4253-am-keep-cr-dos.sh                     |  23 +-
 t/t4257-am-interactive.sh                     |   2 +-
 t/t5150-request-pull.sh                       |  37 +-
 t/t5304-prune.sh                              |   5 +-
 t/t5305-include-tag.sh                        |   5 +-
 t/t5310-pack-bitmaps.sh                       |   3 +
 t/t5312-prune-corruption.sh                   |  19 +-
 t/t5317-pack-objects-filter-objects.sh        |   5 +-
 t/t5322-pack-objects-sparse.sh                |   5 +-
 t/t5323-pack-redundant.sh                     |  66 +--
 t/t5400-send-pack.sh                          |  63 +--
 t/t5401-update-hooks.sh                       |  24 +-
 t/t5402-post-merge-hook.sh                    |   5 +-
 t/t5403-post-checkout-hook.sh                 |   9 +-
 t/t5404-tracking-branches.sh                  |  11 +-
 t/t5405-send-pack-rewind.sh                   |   9 +-
 t/t5407-post-rewrite-hook.sh                  |   5 +-
 t/t5410-receive-pack-alternates.sh            |   7 +-
 t/t5500-fetch-pack.sh                         |  31 +-
 t/t5501-fetch-push-alternates.sh              |   7 +-
 t/t5502-quickfetch.sh                         |   9 +-
 t/t5503-tagfollow.sh                          |  15 +-
 t/t5504-fetch-receive-strict.sh               |  23 +-
 t/t5505-remote.sh                             | 151 +++---
 t/t5506-remote-groups.sh                      |   7 +-
 t/t5509-fetch-push-namespaces.sh              |  33 +-
 t/t5510-fetch.sh                              | 165 +++---
 t/t5511-refspec.sh                            |  12 +-
 t/t5512-ls-remote.sh                          |  29 +-
 t/t5514-fetch-multiple.sh                     |  33 +-
 t/t5516-fetch-push.sh                         | 503 +++++++++---------
 t/t5517-push-mirror.sh                        | 127 ++---
 t/t5518-fetch-exit-status.sh                  |   9 +-
 t/t5519-push-alternates.sh                    |  15 +-
 t/t5520-pull.sh                               |  33 +-
 t/t5521-pull-options.sh                       |  19 +-
 t/t5523-push-upstream.sh                      |  33 +-
 t/t5526-fetch-submodules.sh                   |   3 +
 t/t5527-fetch-odd-refs.sh                     |  17 +-
 t/t5528-push-default.sh                       | 101 ++--
 t/t5529-push-errors.sh                        |   2 +-
 t/t5530-upload-pack-error.sh                  |   2 +-
 t/t5531-deep-submodule-push.sh                | 191 +++----
 t/t5533-push-cas.sh                           | 145 ++---
 t/t5534-push-signed.sh                        |   7 +-
 t/t5537-fetch-shallow.sh                      |  33 +-
 t/t5538-push-shallow.sh                       |  25 +-
 t/t5539-fetch-http-shallow.sh                 |  17 +-
 t/t5540-http-push-webdav.sh                   |  11 +-
 t/t5541-http-push-smart.sh                    |  43 +-
 t/t5542-push-http-shallow.sh                  |  11 +-
 t/t5543-atomic-push.sh                        |  83 +--
 t/t5545-push-options.sh                       |  65 +--
 t/t5548-push-porcelain.sh                     |  64 +--
 t/t5550-http-fetch-dumb.sh                    |  23 +-
 t/t5551-http-fetch-smart.sh                   |  23 +-
 t/t5552-skipping-fetch-negotiator.sh          |   2 +-
 t/t5553-set-upstream.sh                       |  85 +--
 t/t5560-http-backend-noserver.sh              |   3 +
 t/t5561-http-backend.sh                       |   7 +-
 t/t556x_common                                |   8 +-
 t/t5570-git-daemon.sh                         |  19 +-
 t/t5571-pre-push-hook.sh                      |   7 +-
 t/t5572-pull-submodule.sh                     |   4 +-
 t/t5580-unc-paths.sh                          |   5 +-
 t/t5581-http-curl-verbose.sh                  |   5 +-
 t/t5582-fetch-negative-refspec.sh             |  25 +-
 t/t5601-clone.sh                              |   7 +-
 t/t5604-clone-reference.sh                    |  15 +-
 t/t5605-clone-local.sh                        |  13 +-
 t/t5606-clone-options.sh                      |  11 +-
 t/t5607-clone-bundle.sh                       |  17 +-
 t/t5608-clone-2gb.sh                          |   2 +-
 t/t5609-clone-branch.sh                       |   9 +-
 t/t5610-clone-detached.sh                     |   7 +-
 t/t5611-clone-config.sh                       |  19 +-
 t/t5612-clone-refspec.sh                      |  45 +-
 t/t5614-clone-submodules-shallow.sh           |   2 +-
 t/t5616-partial-clone.sh                      |  53 +-
 t/t5617-clone-submodules-remote.sh            |   9 +-
 t/t5700-protocol-v1.sh                        |  19 +-
 t/t5701-git-serve.sh                          |  19 +-
 t/t5702-protocol-v2.sh                        |  53 +-
 t/t5703-upload-pack-ref-in-want.sh            |  63 +--
 t/t5801-remote-helpers.sh                     |  27 +-
 t/t6000-rev-list-misc.sh                      |   5 +-
 t/t6001-rev-list-graft.sh                     |   5 +-
 t/t6004-rev-list-path-optim.sh                |  17 +-
 t/t6006-rev-list-format.sh                    |  17 +-
 t/t6007-rev-list-cherry-pick-file.sh          |   7 +-
 t/t6008-rev-list-submodule.sh                 |   5 +-
 t/t6009-rev-list-parent.sh                    |   9 +-
 t/t6012-rev-list-simplify.sh                  |  11 +-
 t/t6013-rev-list-reverse-parents.sh           |  13 +-
 t/t6016-rev-list-graph-simplify-history.sh    |   5 +-
 t/t6017-rev-list-stdin.sh                     |  11 +-
 t/t6018-rev-list-glob.sh                      |  53 +-
 t/t6019-rev-list-ancestry-path.sh             |   9 +-
 t/t6030-bisect-porcelain.sh                   |  13 +-
 t/t6040-tracking-info.sh                      |  57 +-
 t/t6050-replace.sh                            |  13 +-
 t/t6101-rev-parse-parents.sh                  |   5 +-
 t/t6110-rev-list-sparse.sh                    |   5 +-
 t/t6111-rev-list-treesame.sh                  |   9 +-
 t/t6112-rev-list-filters-objects.sh           |  17 +-
 t/t6120-describe.sh                           |  23 +-
 t/t6200-fmt-merge-msg.sh                      |  53 +-
 t/t6300-for-each-ref.sh                       |   3 +
 t/t6302-for-each-ref-filter.sh                |  61 ++-
 t/t6400-merge-df.sh                           |   9 +-
 t/t6402-merge-rename.sh                       |  49 +-
 t/t6404-recursive-merge.sh                    |   7 +-
 t/t6405-merge-symlinks.sh                     |  17 +-
 t/t6406-merge-attr.sh                         |  27 +-
 t/t6407-merge-binary.sh                       |   9 +-
 t/t6409-merge-subtree.sh                      |  19 +-
 t/t6411-merge-filemode.sh                     |  13 +-
 t/t6412-merge-large-rename.sh                 |   9 +-
 t/t6413-merge-crlf.sh                         |   5 +-
 t/t6414-merge-rename-nocruft.sh               |   5 +-
 t/t6415-merge-dir-to-symlink.sh               |  25 +-
 t/t6416-recursive-corner-cases.sh             |  31 +-
 t/t6417-merge-ours-theirs.sh                  |  31 +-
 t/t6418-merge-text-auto.sh                    |  15 +-
 t/t6419-merge-ignorecase.sh                   |  13 +-
 t/t6422-merge-rename-corner-cases.sh          |  15 +-
 t/t6425-merge-rename-delete.sh                |   5 +-
 t/t6427-diff3-conflict-markers.sh             |  17 +-
 t/t6430-merge-recursive.sh                    |  21 +-
 t/t6432-merge-recursive-space-options.sh      |   9 +-
 t/t6433-merge-toplevel.sh                     |  11 +-
 t/t6434-merge-recursive-rename-options.sh     |   9 +-
 t/t6436-merge-overwrite.sh                    |   5 +-
 t/t6437-submodule-merge.sh                    |  17 +-
 t/t6439-merge-co-error-msgs.sh                |   9 +-
 t/t6501-freshen-objects.sh                    |   5 +-
 t/t7003-filter-branch.sh                      |  43 +-
 t/t7004-tag.sh                                |  11 +-
 t/t7030-verify-tag.sh                         |   5 +-
 t/t7060-wtstatus.sh                           |  29 +-
 t/t7063-status-untracked-cache.sh             |  17 +-
 t/t7064-wtstatus-pv2.sh                       |   3 +
 t/t7102-reset.sh                              |   9 +-
 t/t7113-post-index-change-hook.sh             |   5 +-
 t/t7201-co.sh                                 | 113 ++--
 t/t7400-submodule-basic.sh                    |  23 +-
 t/t7403-submodule-sync.sh                     |  13 +-
 t/t7406-submodule-update.sh                   |  41 +-
 t/t7407-submodule-foreach.sh                  |  27 +-
 t/t7409-submodule-detached-work-tree.sh       |  11 +-
 t/t7417-submodule-path-url.sh                 |   5 +-
 t/t7501-commit-basic-functionality.sh         |   5 +-
 t/t7502-commit-porcelain.sh                   |  15 +-
 ...3-pre-commit-and-pre-merge-commit-hooks.sh |  45 +-
 t/t7504-commit-msg-hook.sh                    |  27 +-
 t/t7505-prepare-commit-msg-hook.sh            |  23 +-
 t/t7508-status.sh                             |  58 +-
 t/t7510-signed-commit.sh                      |   5 +-
 t/t7512-status-help.sh                        |  43 +-
 t/t7517-per-repo-email.sh                     |  15 +-
 t/t7600-merge.sh                              |  47 +-
 t/t7606-merge-custom.sh                       |   2 +-
 t/t7608-merge-messages.sh                     |  39 +-
 t/t7610-mergetool.sh                          | 177 +++---
 t/t7611-merge-abort.sh                        |   7 +-
 t/t7612-merge-verify-signatures.sh            |   5 +-
 t/t7614-merge-signoff.sh                      |  27 +-
 t/t7701-repack-unpack-unreachable.sh          |   5 +-
 t/t7800-difftool.sh                           |  41 +-
 t/t7810-grep.sh                               |  31 +-
 t/t8001-annotate.sh                           |   5 +-
 t/t8002-blame.sh                              |   3 +
 t/t8003-blame-corner-cases.sh                 |   7 +-
 t/t8004-blame-with-conflicts.sh               |  17 +-
 t/t8012-blame-colors.sh                       |   3 +
 t/t9001-send-email.sh                         |  31 +-
 t/t9100-git-svn-basic.sh                      |   5 +-
 t/t9145-git-svn-master-branch.sh              |   9 +-
 t/t9151-svn-mergeinfo.sh                      |   5 +-
 t/t9155-git-svn-fetch-deleted-tag.sh          |   5 +-
 t/t9156-git-svn-fetch-deleted-tag-2.sh        |   9 +-
 t/t9163-git-svn-reset-clears-caches.sh        |   5 +-
 t/t9169-git-svn-dcommit-crlf.sh               |   5 +-
 t/t9300-fast-import.sh                        |  85 +--
 t/t9301-fast-import-notes.sh                  |  17 +-
 t/t9302-fast-import-unpack-limit.sh           |  16 +-
 t/t9350-fast-export.sh                        |  89 ++--
 t/t9351-fast-export-anonymize.sh              |   7 +-
 t/t9400-git-cvsserver-server.sh               |  35 +-
 t/t9401-git-cvsserver-crlf.sh                 |  19 +-
 t/t9402-git-cvsserver-refs.sh                 |  11 +-
 t/t9500-gitweb-standalone-no-errors.sh        |  23 +-
 t/t9501-gitweb-standalone-http-status.sh      |  17 +-
 t/t9502-gitweb-standalone-parse-output.sh     |  19 +-
 t/t9600-cvsimport.sh                          |   5 +-
 t/t9601-cvsimport-vendor-branch.sh            |  19 +-
 t/t9602-cvsimport-branches-tags.sh            |   7 +-
 t/t9603-cvsimport-patchsets.sh                |  11 +-
 t/t9800-git-p4-basic.sh                       |   5 +-
 t/t9801-git-p4-branch.sh                      |  19 +-
 t/t9806-git-p4-options.sh                     |  21 +-
 t/t9807-git-p4-submit.sh                      |   5 +-
 t/t9811-git-p4-label-import.sh                |   5 +-
 t/t9902-completion.sh                         |   3 +
 t/t9903-bash-prompt.sh                        | 117 ++--
 355 files changed, 4835 insertions(+), 3861 deletions(-)


base-commit: aff20da3a209088e7f8f3632077fa11b86453d67
Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-762%2Fdscho%2Fuse-main-as-default-branch-name-v3
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-762/dscho/use-main-as-default-branch-name-v3
Pull-Request: https://github.com/gitgitgadget/git/pull/762

Range-diff vs v2:

  -:  ---------- >  1:  e9ee22525a tests: mark tests relying on the current default for `init.defaultBranch`
  1:  0a05d319c0 =  2:  8c2e158c8f t0060: preemptively adjust alignment
  2:  b8fa037791 !  3:  9b7749dcde t[01]*: adjust the references to the default branch name "main"
     @@ Metadata
       ## Commit message ##
          t[01]*: adjust the references to the default branch name "main"
      
     -    This trick was performed via
     +    Carefully excluding t1309, which sees independent development elsewhere
     +    at the time of writing, we transition above-mentioned tests 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' -e 's/naster/nain/g' -- t[01]*.sh)
     +                    -e 's/Master/Main/g' -e 's/naster/nain/g' -- t[01]*.sh &&
     +               git checkout HEAD -- t1309\*)
      
          Note that t5533 contains a variation of the name `master` (`naster`)
          that we rename here, too.
     @@ Commit message
          Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
      
       ## t/t0002-gitfile.sh ##
     +@@ t/t0002-gitfile.sh: test_description='.git file
     + 
     + Verify that plumbing commands work when .git is a file
     + '
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t0002-gitfile.sh: test_expect_success 'enter_repo non-strict mode' '
       	git ls-remote enter_repo >actual &&
       	cat >expected <<-EOF &&
     @@ t/t0002-gitfile.sh: test_expect_success 'enter_repo strict mode' '
       	test_cmp expected actual
      
       ## t/t0020-crlf.sh ##
     +@@
     + 
     + test_description='CRLF conversion'
     + 
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t0020-crlf.sh: test_expect_success 'checkout with existing .gitattributes' '
       	git add .gitattributes .file &&
       	git commit -m second &&
     @@ t/t0020-crlf.sh: test_expect_success 'checkout when deleting .gitattributes' '
       '
      
       ## t/t0021-conversion.sh ##
     +@@
     + 
     + test_description='blob conversion via gitattributes'
     + 
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t0021-conversion.sh: test_expect_success PERL 'required process filter should filter data' '
       		test_cmp_count expected.log debug.log &&
       
     @@ t/t0027-auto-crlf.sh: test_expect_success 'ls-files --eol -o Text/Binary' '
       	printf "\$Id: 0000000000000000000000000000000000000000 \$\nLINEONE\nLINETWO\nLINETHREE"     >LF &&
      
       ## t/t0028-working-tree-encoding.sh ##
     +@@
     + 
     + test_description='working-tree-encoding conversion via gitattributes'
     + 
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t0028-working-tree-encoding.sh: test_expect_success 'error if encoding round trip is not the same during refresh
       	TEST_HASH=$(git hash-object --no-filters -w nonsense.utf16le) &&
       	git update-index --add --cacheinfo 100644 $TEST_HASH nonsense.utf16le &&
     @@ t/t0028-working-tree-encoding.sh: test_expect_success 'error if encoding garbage
       	test_i18ngrep "error: BOM is required" err.out
      
       ## t/t0041-usage.sh ##
     +@@
     + 
     + test_description='Test commands behavior when given invalid argument value'
     + 
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t0041-usage.sh: test_expect_success 'tag usage error' '
       '
       
     @@ t/t0041-usage.sh: test_expect_success 'for-each-ref --contains <inexistent_objec
       '
      
       ## t/t0050-filesystem.sh ##
     +@@
     + 
     + test_description='Various filesystem issues'
     + 
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t0050-filesystem.sh: test_expect_success "setup case tests" '
       	git mv camelcase tmp &&
       	git mv tmp CamelCase &&
     @@ t/t0060-path-utils.sh: test_git_path GIT_COMMON_DIR=bar info/sparse-checkout
       test_git_path GIT_COMMON_DIR=bar config                   bar/config
      
       ## t/t0100-previous.sh ##
     +@@
     + 
     + test_description='previous branch syntax @{-n}'
     + 
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t0100-previous.sh: test_expect_success 'branch -d @{-1}' '
       	test_commit A &&
       	git checkout -b junk &&
     @@ t/t0100-previous.sh: test_expect_success 'merge @{-1}~1' '
       
      
       ## t/t1004-read-tree-m-u-wf.sh ##
     +@@
     + 
     + test_description='read-tree -m -u checks working tree files'
     + 
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t1004-read-tree-m-u-wf.sh: test_expect_success 'two-way setup' '
       	git branch side &&
       	git tag -f branch-point &&
     @@ t/t1004-read-tree-m-u-wf.sh: test_expect_success 'three-way not complaining on a
       test_expect_success '3-way not overwriting local changes (setup)' '
      
       ## t/t1008-read-tree-overlay.sh ##
     +@@
     + 
     + test_description='test multi-tree read-tree without merging'
     + 
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t1008-read-tree-overlay.sh: test_expect_success setup '
       '
       
     @@ t/t1008-read-tree-overlay.sh: test_expect_success setup '
       	test_cmp expect actual
      
       ## t/t1009-read-tree-new-index.sh ##
     +@@
     + 
     + test_description='test read-tree into a fresh index file'
     + 
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t1009-read-tree-new-index.sh: test_expect_success setup '
       
       test_expect_success 'non-existent index file' '
     @@ t/t1011-read-tree-sparse-checkout.sh
       | M	init.t
      
       ## t/t1021-rerere-in-workdir.sh ##
     +@@
     + #!/bin/sh
     + 
     + test_description='rerere run in a workdir'
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t1021-rerere-in-workdir.sh: test_expect_success SYMLINKS setup '
       	test_tick &&
       	git commit -a -m goodbye &&
     @@ t/t1021-rerere-in-workdir.sh: test_expect_success SYMLINKS setup '
       test_expect_success SYMLINKS 'rerere in workdir' '
      
       ## t/t1090-sparse-checkout-scope.sh ##
     +@@
     + 
     + test_description='sparse checkout scope tests'
     + 
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t1090-sparse-checkout-scope.sh: test_expect_success 'create feature branch' '
       	git commit -m "modification"
       '
     @@ t/t1090-sparse-checkout-scope.sh: test_expect_success 'merge feature branch into
       	test_path_is_file c &&
      
       ## t/t1091-sparse-checkout-builtin.sh ##
     +@@
     + 
     + test_description='sparse checkout builtin tests'
     + 
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t1091-sparse-checkout-builtin.sh: test_expect_success 'interaction with clone --no-checkout (unborn index)' '
       	test_path_is_missing clone_no_checkout/.git/index &&
       
     @@ t/t1091-sparse-checkout-builtin.sh: test_expect_success 'interaction with clone
       '
      
       ## t/t1300-config.sh ##
     +@@
     + 
     + test_description='Test git config in different settings'
     + 
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t1300-config.sh: test_expect_success 'check split_cmdline return' "
       	echo foo > foo &&
       	git add foo &&
     @@ t/t1300-config.sh: test_expect_success '--show-origin blob' '
       
      
       ## t/t1301-shared-repo.sh ##
     +@@
     + 
     + test_description='Test shared repository initialization'
     + 
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t1301-shared-repo.sh: test_expect_success POSIXPERM 'git reflog expire honors core.sharedRepository' '
       	umask 077 &&
       	git config core.sharedRepository group &&
     @@ t/t1305-config-include.sh: test_expect_success SYMLINKS 'conditional include, gi
       	git checkout -b foo-branch &&
       	echo 9 >expect &&
      
     - ## t/t1309-early-config.sh ##
     -@@ t/t1309-early-config.sh: test_expect_failure 'ignore .git/ with invalid config' '
     - 
     - test_expect_success 'early config and onbranch' '
     - 	echo "[broken" >broken &&
     --	test_with_config "[includeif \"onbranch:master\"]path=../broken"
     -+	test_with_config "[includeif \"onbranch:main\"]path=../broken"
     - '
     + ## t/t1400-update-ref.sh ##
     +@@
     + #
       
     - test_expect_success 'onbranch config outside of git repo' '
     --	test_config_global includeIf.onbranch:master.path non-existent &&
     -+	test_config_global includeIf.onbranch:main.path non-existent &&
     - 	nongit git help
     - '
     + test_description='Test git update-ref and basic ref logging'
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
       
     -
     - ## t/t1400-update-ref.sh ##
     -@@ t/t1400-update-ref.sh: test_description='Test git update-ref and basic ref logging'
     + . ./test-lib.sh
       
       Z=$ZERO_OID
       
     @@ t/t1402-check-ref-format.sh: test_expect_success 'check-ref-format --branch @{-1
       
      
       ## t/t1403-show-ref.sh ##
     +@@
     + #!/bin/sh
     + 
     + test_description='show-ref'
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t1403-show-ref.sh: test_expect_success setup '
       	git checkout -b side &&
       	test_commit B &&
     @@ t/t1403-show-ref.sh: test_expect_success 'show-ref -d' '
       	done >expect.heads &&
      
       ## t/t1405-main-ref-store.sh ##
     +@@
     + 
     + test_description='test main ref store api'
     + 
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t1405-main-ref-store.sh: test_expect_success 'peel_ref(new-tag)' '
       	test_cmp expected actual
       '
     @@ t/t1405-main-ref-store.sh: test_expect_success 'for_each_reflog()' '
       
      
       ## t/t1406-submodule-ref-store.sh ##
     +@@
     + 
     + test_description='test submodule ref store api'
     + 
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t1406-submodule-ref-store.sh: test_expect_success 'setup' '
       	(
       		cd sub &&
     @@ t/t1406-submodule-ref-store.sh: test_expect_success 'for_each_reflog()' '
       
      
       ## t/t1407-worktree-ref-store.sh ##
     +@@
     + 
     + test_description='test worktree ref store api'
     + 
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t1407-worktree-ref-store.sh: RMAIN="test-tool ref-store worktree:main"
       
       test_expect_success 'setup' '
     @@ t/t1407-worktree-ref-store.sh: test_expect_success 'for_each_reflog()' '
       '
      
       ## t/t1408-packed-refs.sh ##
     +@@
     + 
     + test_description='packed-refs entries are covered by loose refs'
     + 
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t1408-packed-refs.sh: test_expect_success setup '
       	git commit --allow-empty -m one &&
       	one=$(git rev-parse HEAD) &&
     @@ t/t1408-packed-refs.sh: test_expect_success setup '
       '
      
       ## t/t1410-reflog.sh ##
     +@@
     + #
     + 
     + test_description='Test prune and reflog expiration'
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t1410-reflog.sh: test_expect_success setup '
       
       	check_fsck &&
     @@ t/t1410-reflog.sh: test_expect_success 'stale dirs do not cause d/f conflicts (r
       '
      
       ## t/t1411-reflog-show.sh ##
     +@@
     + #!/bin/sh
     + 
     + test_description='Test reflog display routines'
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t1411-reflog-show.sh: test_expect_success 'git log -g -p shows diffs vs. parents' '
       '
       
     @@ t/t1411-reflog-show.sh: test_expect_success 'git log -g -p shows diffs vs. paren
       
      
       ## t/t1413-reflog-detach.sh ##
     -@@ t/t1413-reflog-detach.sh: test_description='Test reflog interaction with detached HEAD'
     +@@
     + #!/bin/sh
     + 
     + test_description='Test reflog interaction with detached HEAD'
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
       . ./test-lib.sh
       
       reset_state () {
     @@ t/t1413-reflog-detach.sh: test_expect_success 'switch to branch' '
       	test_cmp expect actual
      
       ## t/t1414-reflog-walk.sh ##
     +@@
     + #!/bin/sh
     + 
     + test_description='various tests of reflog walk (log -g) behavior'
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t1414-reflog-walk.sh: test_expect_success 'set up some reflog entries' '
       	test_commit two &&
       	git checkout -b side HEAD^ &&
     @@ t/t1414-reflog-walk.sh: test_expect_success 'walking multiple reflogs shows all'
       
      
       ## t/t1416-ref-transaction-hooks.sh ##
     +@@
     + 
     + test_description='reference transaction hooks'
     + 
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t1416-ref-transaction-hooks.sh: test_expect_success 'hook gets all queued updates in prepared state' '
       	EOF
       	cat >expect <<-EOF &&
     @@ t/t1416-ref-transaction-hooks.sh: test_expect_success 'hook gets all queued upda
       	test_cmp expect actual
      
       ## t/t1430-bad-ref-name.sh ##
     +@@
     + #!/bin/sh
     + 
     + test_description='Test handling of ref names that check-ref-format rejects'
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t1430-bad-ref-name.sh: test_expect_success 'fast-import: fail on invalid branch name ".badbranchname"'
       		corrupt
       		COMMIT
     @@ t/t1450-fsck.sh
       . ./test-lib.sh
      
       ## t/t1500-rev-parse.sh ##
     +@@
     + #!/bin/sh
     + 
     + test_description='test git rev-parse'
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t1500-rev-parse.sh: test_expect_success 'showing the superproject correctly' '
       	test_commit -C super/dir/sub branch1_commit &&
       	git -C super add dir/sub &&
     @@ t/t1500-rev-parse.sh: test_expect_success 'showing the superproject correctly' '
       	test_commit -C super branch2_commit &&
      
       ## t/t1503-rev-parse-verify.sh ##
     +@@ t/t1503-rev-parse-verify.sh: test_description='test git rev-parse --verify'
     + 
     + exec </dev/null
     + 
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t1503-rev-parse-verify.sh: test_expect_success 'works with one good rev' '
       	test "$rev_hash3" = "$HASH3" &&
       	rev_hash4=$(git rev-parse --verify $HASH4) &&
     @@ t/t1503-rev-parse-verify.sh: test_expect_success 'no stdout output on error' '
       test_expect_success SYMLINKS 'ref resolution not confused by broken symlinks' '
      
       ## t/t1505-rev-parse-last.sh ##
     +@@
     + 
     + test_description='test @{-N} syntax'
     + 
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t1505-rev-parse-last.sh: test_expect_success 'setup' '
       	make_commit 3 &&
       	git checkout side &&
     @@ t/t1505-rev-parse-last.sh: test_expect_success '@{-1}@{1} works' '
       test_expect_success '@{-3} fails' '
      
       ## t/t1506-rev-parse-diagnosis.sh ##
     +@@ t/t1506-rev-parse-diagnosis.sh: test_description='test git rev-parse diagnosis for invalid argument'
     + 
     + exec </dev/null
     + 
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t1506-rev-parse-diagnosis.sh: test_expect_success 'incorrect file in :path and :N:path' '
       '
       
     @@ t/t1506-rev-parse-diagnosis.sh: test_expect_success 'incorrect file in :path and
       '
      
       ## t/t1507-rev-parse-upstream.sh ##
     +@@
     + 
     + test_description='test <branch>@{upstream} syntax'
     + 
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t1507-rev-parse-upstream.sh: test_expect_success 'setup' '
       	test_commit 1 &&
       	git checkout -b side &&
     @@ t/t1507-rev-parse-upstream.sh: test_expect_success 'log -g other@{u}@{now}' '
       	Date:   Thu Apr 7 15:15:13 2005 -0700
      
       ## t/t1508-at-combinations.sh ##
     +@@
     + #!/bin/sh
     + 
     + test_description='test various @{X} syntax combinations together'
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t1508-at-combinations.sh: fail() {
       }
       
     @@ t/t1508-at-combinations.sh: check "@{-1}@{1}" commit old-one
       check "@@/at-test" ref refs/heads/@@/at-test
      
       ## t/t1511-rev-parse-caret.sh ##
     +@@
     + 
     + test_description='tests for ref^{stuff}'
     + 
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t1511-rev-parse-caret.sh: test_expect_success 'setup' '
       	git commit -m Initial &&
       	git tag -a -m commit commit-tag &&
     @@ t/t1511-rev-parse-caret.sh: test_expect_success 'ref^{tag}' '
       
      
       ## t/t1512-rev-parse-disambiguation.sh ##
     +@@ t/t1512-rev-parse-disambiguation.sh: one tagged as v1.0.0.  They all have one regular file each.
     + 
     + '
     + 
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t1512-rev-parse-disambiguation.sh: test_expect_success 'more history' '
       	side=$(git rev-parse HEAD) &&
       
     @@ t/t1512-rev-parse-disambiguation.sh: test_expect_success 'more history' '
       	# clean up a0blgqsjc as well.  If you use resolve, merge will
      
       ## t/t1513-rev-parse-prefix.sh ##
     +@@
     + 
     + test_description='Tests for rev-parse --prefix'
     + 
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t1513-rev-parse-prefix.sh: test_expect_success 'disambiguate path with valid prefix' '
       '
       
     @@ t/t1513-rev-parse-prefix.sh: test_expect_success 'disambiguate path with valid p
       	test_cmp expected actual
      
       ## t/t1514-rev-parse-push.sh ##
     +@@
     + #!/bin/sh
     + 
     + test_description='test <branch>@{push} syntax'
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t1514-rev-parse-push.sh: test_expect_success 'setup' '
       	git remote add other other.git &&
       	test_commit base &&
     @@ t/t1514-rev-parse-push.sh: test_expect_success 'setup' '
       test_expect_success 'triangular @{push} fails with default=simple' '
      
       ## t/t1700-split-index.sh ##
     +@@
     + 
     + test_description='split index mode tests'
     + 
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t1700-split-index.sh: test_expect_success 'do not refresh null base index' '
       		test_commit initial &&
       		git checkout -b side-branch &&
     @@ t/t1700-split-index.sh: test_expect_success 'do not refresh null base index' '
       		git update-index --split-index &&
       		test_commit more &&
       		# must not write a new shareindex, or we wont catch the problem
     -
     - ## t/test-lib.sh ##
     -@@ t/test-lib.sh: case "$TRASH_DIRECTORY" in
     -  *) TRASH_DIRECTORY="$TEST_OUTPUT_DIRECTORY/$TRASH_DIRECTORY" ;;
     - esac
     - 
     -+case "$TEST_NUMBER" in
     -+[01]*)
     -+	GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     -+	export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     -+	;;
     -+esac
     -+
     - # If --stress was passed, run this test repeatedly in several parallel loops.
     - if test "$GIT_TEST_STRESS_STARTED" = "done"
     - then
  3:  0d4f1275f7 !  4:  f5dbc0d5bb t2*: adjust the references to the default branch name "main"
     @@ Metadata
       ## Commit message ##
          t2*: adjust the references to the default branch name "main"
      
     -    This trick was performed via
     +    Carefully excluding t2106, which sees independent development elsewhere
     +    at the time of writing, we transition above-mentioned tests 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' -- t2*.sh)
     +                    -e 's/Master/Main/g' -- t2*.sh &&
     +               git checkout HEAD -- t2106\*)
      
          This allows us to define `GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main`
          for those tests.
     @@ Commit message
          Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
      
       ## t/t2007-checkout-symlink.sh ##
     +@@
     + 
     + test_description='git checkout to switch between branches with symlink<->dir'
     + 
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t2007-checkout-symlink.sh: test_expect_success setup '
       	echo hello >frotz/filfre &&
       	git add frotz/filfre &&
     @@ t/t2007-checkout-symlink.sh: test_expect_success setup '
       test_expect_success 'switch from dir to symlink' '
      
       ## t/t2009-checkout-statinfo.sh ##
     +@@
     + 
     + test_description='checkout should leave clean stat info'
     + 
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t2009-checkout-statinfo.sh: test_expect_success 'branch switching' '
       	git reset --hard &&
       	test "$(git diff-files --raw)" = "" &&
     @@ t/t2009-checkout-statinfo.sh: test_expect_success 'path checkout' '
       '
      
       ## t/t2010-checkout-ambiguous.sh ##
     +@@
     + 
     + test_description='checkout and pathspecs/refspecs ambiguities'
     + 
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t2010-checkout-ambiguous.sh: test_expect_success 'reference must be a tree' '
       '
       
     @@ t/t2010-checkout-ambiguous.sh: test_expect_success 'disambiguate checking out fr
       '
      
       ## t/t2011-checkout-invalid-head.sh ##
     +@@
     + 
     + test_description='checkout switching away from an invalid branch'
     + 
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t2011-checkout-invalid-head.sh: test_expect_success 'setup' '
       '
       
     @@ t/t2011-checkout-invalid-head.sh: test_expect_success 'pack refs' '
       test_done
      
       ## t/t2012-checkout-last.sh ##
     +@@
     + 
     + test_description='checkout can switch to last branch and merge base'
     + 
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t2012-checkout-last.sh: test_expect_success 'first branch switch' '
       
       test_expect_success '"checkout -" switches back' '
     @@ t/t2012-checkout-last.sh: test_expect_success 'merge base test setup' '
       test_done
      
       ## t/t2015-checkout-unborn.sh ##
     +@@
     + #!/bin/sh
     + 
     + test_description='checkout from unborn branch'
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t2015-checkout-unborn.sh: test_expect_success 'setup' '
       	 git add file &&
       	 git commit -m base
     @@ t/t2015-checkout-unborn.sh: test_expect_success 'setup' '
       test_expect_success 'checkout from unborn preserves untracked files' '
      
       ## t/t2017-checkout-orphan.sh ##
     +@@ t/t2017-checkout-orphan.sh: test_description='git checkout --orphan
     + 
     + Main Tests for --orphan functionality.'
     + 
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t2017-checkout-orphan.sh: test_expect_success '--orphan creates a new orphan branch from HEAD' '
       	test_tick &&
       	git commit -m "Third Commit" &&
     @@ t/t2017-checkout-orphan.sh: test_expect_success '--orphan with -l makes reflog w
       '
      
       ## t/t2020-checkout-detach.sh ##
     +@@
     + #!/bin/sh
     + 
     + test_description='checkout into detached HEAD state'
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t2020-checkout-detach.sh: check_no_orphan_warning() {
       }
       
     @@ t/t2020-checkout-detach.sh: test_expect_success 'describe_detached_head prints n
       	cat >1st_detach <<-EOF &&
      
       ## t/t2022-checkout-paths.sh ##
     -@@ t/t2022-checkout-paths.sh: test_description='checkout $tree -- $paths'
     +@@
     + #!/bin/sh
     + 
     + test_description='checkout $tree -- $paths'
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
       
       test_expect_success setup '
       	mkdir dir &&
     @@ t/t2022-checkout-paths.sh: test_expect_success 'do not touch unmerged entries ma
       '
      
       ## t/t2023-checkout-m.sh ##
     +@@ t/t2023-checkout-m.sh: test_description='checkout -m -- <conflicted path>
     + 
     + Ensures that checkout -m on a resolved file restores the conflicted file'
     + 
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t2023-checkout-m.sh: test_expect_success setup '
       	test_tick &&
       	test_commit both.txt both.txt initial &&
     @@ t/t2024-checkout-dwim.sh: test_expect_success 'loosely defined local base branch
       	status_uno_is_clean &&
      
       ## t/t2027-checkout-track.sh ##
     +@@
     + 
     + test_description='tests for git branch --track'
     + 
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t2027-checkout-track.sh: test_expect_success 'setup' '
       '
       
     @@ t/t2027-checkout-track.sh: test_expect_success 'setup' '
       
      
       ## t/t2030-unresolve-info.sh ##
     +@@
     + 
     + test_description='undoing resolution'
     + 
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t2030-unresolve-info.sh: test_expect_success setup '
       	test_commit fourth fi/le fourth &&
       	git checkout add-add &&
     @@ t/t2030-unresolve-info.sh: test_expect_success 'rerere forget (binary)' '
       	test_must_fail git merge fifth &&
      
       ## t/t2060-switch.sh ##
     +@@
     + 
     + test_description='switch basic functionality'
     + 
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t2060-switch.sh: test_expect_success 'switch branch' '
       '
       
     @@ t/t2060-switch.sh: test_expect_success 'switching ignores file of same branch na
       	test_must_fail git switch foo &&
      
       ## t/t2070-restore.sh ##
     +@@
     + 
     + test_description='restore basic functionality'
     + 
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t2070-restore.sh: test_expect_success 'setup' '
       	echo ignored >ignored &&
       	echo /ignored >.gitignore &&
     @@ t/t2070-restore.sh: test_expect_success 'restore --ignore-unmerged ignores unmer
       		git commit -am second &&
       		test_must_fail git merge first &&
      
     - ## t/t2106-update-index-assume-unchanged.sh ##
     -@@ t/t2106-update-index-assume-unchanged.sh: test_expect_success 'do not switch branches with dirty file' \
     - 	 git checkout other &&
     - 	 echo dirt >file &&
     - 	 git update-index --assume-unchanged file &&
     --	 test_must_fail git checkout master'
     -+	 test_must_fail git checkout main'
     - 
     - test_done
     -
       ## t/t2400-worktree-add.sh ##
     +@@
     + 
     + test_description='test git worktree add'
     + 
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t2400-worktree-add.sh: test_expect_success 'setup' '
       
       test_expect_success '"add" an existing worktree' '
     @@ t/t2400-worktree-add.sh: test_branch_upstream () {
       			"refs/heads/*:refs/remotes/$1/*" &&
      
       ## t/t2401-worktree-prune.sh ##
     +@@
     + 
     + test_description='prune $GIT_DIR/worktrees'
     + 
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t2401-worktree-prune.sh: test_expect_success 'not prune recent checkouts' '
       
       test_expect_success 'not prune proper checkouts' '
     @@ t/t2401-worktree-prune.sh: test_expect_success 'not prune recent checkouts' '
       '
      
       ## t/t2402-worktree-list.sh ##
     +@@
     + 
     + test_description='test git worktree list'
     + 
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t2402-worktree-list.sh: test_expect_success 'rev-parse --git-common-dir on main worktree' '
       test_expect_success 'rev-parse --git-path objects linked worktree' '
       	echo "$(git rev-parse --show-toplevel)/.git/objects" >expect &&
     @@ t/t2402-worktree-list.sh: test_expect_success '"list" all worktrees --porcelain
       	git -C there worktree list >out &&
      
       ## t/t2405-worktree-submodule.sh ##
     +@@
     + 
     + test_description='Combination of submodules and multiple worktrees'
     + 
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t2405-worktree-submodule.sh: test_expect_success 'add superproject worktree' '
       '
       
     @@ t/t2405-worktree-submodule.sh: test_expect_success 'add superproject worktree an
       	grep "file1 updated" out
       '
       
     -
     - ## t/test-lib.sh ##
     -@@ t/test-lib.sh: case "$TRASH_DIRECTORY" in
     - esac
     - 
     - case "$TEST_NUMBER" in
     --[01]*)
     -+[0-2]*)
     - 	GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     - 	export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     - 	;;
  4:  aee29a0528 !  5:  090ac6e9a1 t3[0-3]*: adjust the references to the default branch name "main"
     @@ Metadata
       ## Commit message ##
          t3[0-3]*: adjust the references to the default branch name "main"
      
     -    This trick was performed via
     +    Carefully excluding t3040, which sees independent development elsewhere
     +    at the time of writing, we transition above-mentioned tests 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[0-3]*.sh t3206/*)
     +                    -e 's/Master/Main/g' -- t3[0-3]*.sh t3206/* &&
     +               git checkout HEAD -- t3040\*)
      
          This allows us to define `GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main`
          for those tests.
      
          Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
      
     - ## t/t3040-subprojects-basic.sh ##
     -@@ t/t3040-subprojects-basic.sh: test_expect_success 'checkout in superproject' '
     - '
     + ## t/t3200-branch.sh ##
     +@@
       
     - # just interesting what happened...
     --# git diff --name-status -M save master
     -+# git diff --name-status -M save main
     + test_description='git branch assorted tests'
       
     - test_done
     -
     - ## t/t3200-branch.sh ##
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t3200-branch.sh: test_expect_success 'branch -h in broken repository' '
       	(
       		cd broken &&
     @@ t/t3200-branch.sh: test_expect_success 'option override configured sort' '
       	)
      
       ## t/t3201-branch-contains.sh ##
     +@@
     + 
     + test_description='branch --contains <commit>, --no-contains <commit> --merged, and --no-merged'
     + 
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t3201-branch-contains.sh: test_expect_success setup '
       
       	echo 1 >file &&
     @@ t/t3201-branch-contains.sh: test_expect_success 'branch --merged combined with -
       	EOF
      
       ## t/t3202-show-branch-octopus.sh ##
     +@@
     + 
     + test_description='test show-branch with more than 8 heads'
     + 
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t3202-show-branch-octopus.sh: test_expect_success 'setup' '
       
       	for i in $numbers
     @@ t/t3202-show-branch-octopus.sh: test_expect_success 'setup' '
       		test_tick &&
      
       ## t/t3203-branch-output.sh ##
     +@@
     + #!/bin/sh
     + 
     + test_description='git branch display tests'
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t3203-branch-output.sh: test_expect_success 'make remote branches' '
       cat >expect <<'EOF'
         branch-one
     @@ t/t3203-branch-output.sh: test_expect_success '--color overrides auto-color' '
       	  ambiguous                    $one one
      
       ## t/t3204-branch-name-interpretation.sh ##
     +@@ t/t3204-branch-name-interpretation.sh: Branch name arguments are usually names which are taken to be inside of
     + refs/heads/, but we interpret some magic syntax like @{-1}, @{upstream}, etc.
     + This script aims to check the behavior of those corner cases.
     + '
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t3204-branch-name-interpretation.sh: test_expect_success 'update branch via @{-1}' '
       	git branch previous one &&
       
     @@ t/t3204-branch-name-interpretation.sh: test_expect_success 'disallow deleting re
       	expect_branch refs/remotes/origin/previous one &&
      
       ## t/t3205-branch-color.sh ##
     -@@ t/t3205-branch-color.sh: test_description='basic branch output coloring'
     +@@
     + #!/bin/sh
     + 
     + test_description='basic branch output coloring'
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
       
       test_expect_success 'set up some sample branches' '
       	test_commit foo &&
     @@ t/t3205-branch-color.sh: test_expect_success 'set up some color config' '
       	test_decode_color <actual.raw >actual &&
      
       ## t/t3206-range-diff.sh ##
     +@@
     + 
     + test_description='range-diff tests'
     + 
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t3206-range-diff.sh: test_expect_success 'setup' '
       '
       
     @@ t/t3206/history.export: mark :11
       committer Thomas Rast <trast@inf.ethz.ch> 1374485127 +0200
      
       ## t/t3210-pack-refs.sh ##
     +@@ t/t3210-pack-refs.sh: test_description='git pack-refs should not change the branch semantic
     + This test runs git pack-refs and git show-ref and checks that the branch
     + semantic is still the same.
     + '
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t3210-pack-refs.sh: test_expect_success 'delete ref with dangling packed version' '
       	git commit --allow-empty -m "future garbage" &&
       	git pack-refs --all &&
     @@ t/t3210-pack-refs.sh: test_expect_success 'retry acquiring packed-refs.lock' '
       	ln -s my-deviant-packed-refs .git/packed-refs &&
      
       ## t/t3211-peel-ref.sh ##
     +@@
     + #!/bin/sh
     + 
     + test_description='tests for the peel_ref optimization of packed-refs'
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t3211-peel-ref.sh: print_ref() {
       
       test_expect_success 'set up expected show-ref output' '
     @@ t/t3301-notes.sh: test_expect_success 'git notes copy diagnoses too many or too
       
      
       ## t/t3302-notes-index-expensive.sh ##
     +@@
     + 
     + test_description='Test commit notes index (expensive!)'
     + 
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t3302-notes-index-expensive.sh: create_repo () {
       			notemark=$(($mark+1))
       			test_tick &&
     @@ t/t3302-notes-index-expensive.sh: create_repo () {
       			data <<COMMIT
      
       ## t/t3303-notes-subtrees.sh ##
     +@@
     + 
     + test_description='Test commit notes organized in subtrees'
     + 
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t3303-notes-subtrees.sh: test_expect_success "setup: create $number_of_commits commits" '
       			nr=$(($nr+1)) &&
       			test_tick &&
     @@ t/t3303-notes-subtrees.sh: test_concatenated_notes () {
       			second_note_path=$(echo "$sha1" | sed "$2")
      
       ## t/t3304-notes-mixed.sh ##
     +@@
     + 
     + test_description='Test notes trees that also contain non-notes'
     + 
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t3304-notes-mixed.sh: test_expect_success "setup: create a couple of commits" '
       
       	test_tick &&
     @@ t/t3308-notes-merge.sh: test_expect_success 'fail to merge into various non-note
       	test_must_fail git -c "core.notesRef=refs/notes/foo^{bar" notes merge x
      
       ## t/t3320-notes-merge-worktrees.sh ##
     +@@
     + 
     + test_description='Test merging of notes trees in multiple worktrees'
     + 
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t3320-notes-merge-worktrees.sh: test_expect_success 'modify notes ref ourselves (x)' '
       '
       
     @@ t/t3320-notes-merge-worktrees.sh: test_expect_success 'modify notes ref ourselve
       '
       
       test_expect_success 'merge z into y fails and sets NOTES_MERGE_REF' '
     -
     - ## t/test-lib.sh ##
     -@@ t/test-lib.sh: case "$TRASH_DIRECTORY" in
     - esac
     - 
     - case "$TEST_NUMBER" in
     --[0-2]*)
     -+[0-2]*|3[0-3]*)
     - 	GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     - 	export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     - 	;;
  5:  041ad86e33 !  6:  c8494f4602 t3416: preemptively adjust alignment in a comment
     @@ Commit message
          Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
      
       ## t/t3416-rebase-onto-threedots.sh ##
     -@@ t/t3416-rebase-onto-threedots.sh: test_description='git rebase --onto A...B'
     +@@ t/t3416-rebase-onto-threedots.sh: export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
       #
       #	    F---G topic                             G'
       #	   /                                       /
  6:  2f62b3f469 !  7:  c0d02e4d9d t34*: adjust the references to the default branch name "main"
     @@ Commit message
          Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
      
       ## t/t3400-rebase.sh ##
     +@@ t/t3400-rebase.sh: test_description='git rebase assorted tests
     + This test runs git rebase and checks that the author information is not lost
     + among other things.
     + '
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t3400-rebase.sh: test_expect_success 'prepare repository with topic branches' '
       	git update-index --add Y &&
       	git commit -m "Add Y." &&
     @@ t/t3400-rebase.sh: test_expect_success 'rebase -c rebase.useBuiltin=false warnin
       
      
       ## t/t3402-rebase-merge.sh ##
     +@@
     + 
     + test_description='git rebase --merge test'
     + 
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t3402-rebase-merge.sh: test_expect_success setup '
       	git commit -m"initial" &&
       	git branch side &&
     @@ t/t3402-rebase-merge.sh: test_expect_success '--reapply-cherry-picks refrains fr
       	git -C client rev-list --objects --all --missing=print >missing_list &&
      
       ## t/t3403-rebase-skip.sh ##
     +@@
     + 
     + test_description='git rebase --merge --skip tests'
     + 
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t3403-rebase-skip.sh: test_expect_success setup '
       	'
       
     @@ t/t3403-rebase-skip.sh: test_expect_success 'rebase moves back to skip-reference
       test_expect_success 'rebase --skip with --merge' '
      
       ## t/t3405-rebase-malformed.sh ##
     +@@
     + 
     + test_description='rebase should handle arbitrary git message'
     + 
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t3405-rebase-malformed.sh: test_expect_success setup '
       	git add file3 &&
       	git commit --allow-empty-message -m "" &&
     @@ t/t3405-rebase-malformed.sh: test_expect_success 'rebase commit with multi-line
       test_expect_success 'rebase -i commit with empty message' '
      
       ## t/t3406-rebase-message.sh ##
     +@@
     + 
     + test_description='messages from rebase operation'
     + 
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t3406-rebase-message.sh: test_expect_success 'setup' '
       '
       
     @@ t/t3406-rebase-message.sh: test_expect_success 'rebase -i onto unrelated history
       	test_i18ngrep "5 files changed" actual
      
       ## t/t3407-rebase-abort.sh ##
     +@@
     + 
     + test_description='git rebase --abort tests'
     + 
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t3407-rebase-abort.sh: testrebase() {
       		cd "$work_dir" &&
       		# Clean up the state from the previous one
     @@ t/t3407-rebase-abort.sh: test_expect_success 'rebase --merge --quit' '
       	git rebase --quit &&
      
       ## t/t3408-rebase-multi-line.sh ##
     +@@
     + 
     + test_description='rebasing a commit with multi-line first paragraph.'
     + 
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t3408-rebase-multi-line.sh: But otherwise with a sane description." side2 &&
       test_expect_success rebase '
       
     @@ t/t3408-rebase-multi-line.sh: But otherwise with a sane description." side2 &&
       	test_cmp expect actual
      
       ## t/t3409-rebase-preserve-merges.sh ##
     +@@ t/t3409-rebase-preserve-merges.sh: test_description='git rebase -p should preserve merges
     + 
     + Run "git rebase -p" and check that merges are properly carried along
     + '
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t3409-rebase-preserve-merges.sh: export GIT_AUTHOR_EMAIL
       
       # Clone 2 (conflicting merge):
     @@ t/t3409-rebase-preserve-merges.sh: test_expect_success 'setup for merge-preservi
       	git clone ./. clone3 &&
      
       ## t/t3412-rebase-root.sh ##
     +@@ t/t3412-rebase-root.sh: test_description='git rebase --root
     + 
     + Tests if git rebase --root --onto <newparent> can rebase the root commit.
     + '
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t3412-rebase-root.sh: test_expect_success 'prepare repository' '
       
       test_expect_success 'rebase --root fails with too many args' '
     @@ t/t3412-rebase-root.sh: EOF
       
      
       ## t/t3413-rebase-hook.sh ##
     +@@
     + 
     + test_description='git rebase with its hook(s)'
     + 
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t3413-rebase-hook.sh: test_expect_success setup '
       	git add git &&
       	test_tick &&
     @@ t/t3413-rebase-hook.sh: test_expect_success 'rebase --no-verify overrides pre-re
       '
      
       ## t/t3415-rebase-autosquash.sh ##
     +@@
     + 
     + test_description='auto squash'
     + 
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t3415-rebase-autosquash.sh: test_expect_success 'wrapped original subject' '
       
       test_expect_success 'abort last squash' '
     @@ t/t3415-rebase-autosquash.sh: test_expect_success 'wrapped original subject' '
       	git commit --allow-empty -m first &&
      
       ## t/t3416-rebase-onto-threedots.sh ##
     -@@ t/t3416-rebase-onto-threedots.sh: test_description='git rebase --onto A...B'
     +@@
     + 
     + test_description='git rebase --onto A...B'
     + 
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
       . ./test-lib.sh
       . "$TEST_DIRECTORY/lib-rebase.sh"
       
     @@ t/t3416-rebase-onto-threedots.sh: test_expect_success 'rebase -i --keep-base mas
       test_done
      
       ## t/t3418-rebase-continue.sh ##
     +@@
     + 
     + test_description='git rebase --continue tests'
     + 
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t3418-rebase-continue.sh: test_expect_success 'setup' '
       	git checkout -b topic HEAD^ &&
       	test_commit "commit-new-file-F2-on-topic-branch" F2 22 &&
     @@ t/t3418-rebase-continue.sh: test_rerere_autoupdate () {
       		git add F2 &&
      
       ## t/t3419-rebase-patch-id.sh ##
     +@@
     + 
     + test_description='git rebase - test patch id computation'
     + 
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t3419-rebase-patch-id.sh: test_expect_success 'setup' '
       
       test_expect_success 'setup: 500 lines' '
     @@ t/t3419-rebase-patch-id.sh: test_expect_success 'setup attributes' '
       	git commit -q -m squashed &&
      
       ## t/t3420-rebase-autostash.sh ##
     +@@
     + #
     + 
     + test_description='git rebase --autostash tests'
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t3420-rebase-autostash.sh: test_expect_success setup '
       	git add . &&
       	test_tick &&
     @@ t/t3423-rebase-reword.sh: test_expect_success 'reword after a conflict preserves
       	git add file-2 &&
      
       ## t/t3427-rebase-subtree.sh ##
     +@@ t/t3427-rebase-subtree.sh: test_description='git rebase tests for -Xsubtree
     + 
     + This test runs git rebase and tests the subtree strategy.
     + '
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t3427-rebase-subtree.sh: commit_message() {
       #
       # topic_1 - topic_2 - topic_3
     @@ t/t3430-rebase-merges.sh: Initial setup:
          \    \       /
           \    F - G                (second)
            \
     +       Conflicting-G
     + '
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t3430-rebase-merges.sh: test_expect_success 'setup' '
       	git checkout -b first &&
       	test_commit B &&
     @@ t/t3430-rebase-merges.sh: test_expect_success 'labels that are object IDs are re
       	git commit -m "Merge commit '\''$third'\'' into labels" &&
      
       ## t/t3431-rebase-fork-point.sh ##
     -@@ t/t3431-rebase-fork-point.sh: test_description='git rebase --fork-point test'
     +@@
     + 
     + test_description='git rebase --fork-point test'
     + 
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
       
       . ./test-lib.sh
       
     @@ t/t3431-rebase-fork-point.sh: test_rebase 'G F C E D B A' --no-fork-point
       	git tag one &&
      
       ## t/t3432-rebase-fast-forward.sh ##
     +@@
     + 
     + test_description='ensure rebase fast-forwards commits when possible'
     + 
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t3432-rebase-fast-forward.sh: test_rebase_same_head_ () {
       
       changes='no changes'
     @@ t/t3434-rebase-i18n.sh: test_description='rebase with changing encoding
        \
         3 - 4            first
          \
     +     5 - 6          second
     + '
     + 
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t3434-rebase-i18n.sh: test_expect_success 'rebase --rebase-merges update encoding eucJP to UTF-8' '
       	git config i18n.commitencoding eucJP &&
       	git merge -F "$TEST_DIRECTORY/t3434/eucJP.txt" second &&
     @@ t/t3434-rebase-i18n.sh: test_rebase_continue_update_encode () {
       		git add two.t &&
      
       ## t/t3435-rebase-gpg-sign.sh ##
     +@@
     + 
     + test_description='test rebase --[no-]gpg-sign'
     + 
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t3435-rebase-gpg-sign.sh: test_expect_success 'setup: merge commit' '
       	test_commit fork-point &&
       	git switch -c side &&
     @@ t/t3436-rebase-more-options.sh: test_expect_success 'setup' '
       	rm foo &&
       	test_write_lines "line 1" "        line 2" "line 3" >file &&
       	git commit -am "add file" &&
     -
     - ## t/test-lib.sh ##
     -@@ t/test-lib.sh: case "$TRASH_DIRECTORY" in
     - esac
     - 
     - case "$TEST_NUMBER" in
     --[0-2]*|3[0-3]*)
     -+3404)
     -+	# Avoid conflicts with patch series that are cooking at the same time
     -+	# as the patch series changing the default of `init.defaultBranch`.
     -+	GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     -+	export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     -+	;;
     -+[0-2]*|3[0-4]*)
     - 	GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     - 	export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     - 	;;
  7:  0cf754646e !  8:  db3a104750 t3[5-9]*: adjust the references to the default branch name "main"
     @@ t/t3500-cherry.sh
      +This test cherry-picks one local change of two into main branch, and
       checks that git cherry only returns the second patch in the local branch
       '
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
       . ./test-lib.sh
      @@ t/t3500-cherry.sh: test_expect_success \
            test_tick &&
     @@ t/t3500-cherry.sh: test_expect_success \
       test_expect_success 'cherry ignores whitespace' '
      
       ## t/t3501-revert-cherry-pick.sh ##
     +@@ t/t3501-revert-cherry-pick.sh: test_description='test cherry-pick and revert with renames
     + 
     + '
     + 
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t3501-revert-cherry-pick.sh: test_expect_success 'cherry-pick on unborn branch' '
       test_expect_success 'cherry-pick "-" to pick from previous branch' '
       	git checkout unborn &&
     @@ t/t3501-revert-cherry-pick.sh: test_expect_success 'cherry-pick "-" is meaningle
       	git cat-file commit HEAD | grep ^Signed-off-by: >signoff &&
      
       ## t/t3502-cherry-pick-merge.sh ##
     +@@ t/t3502-cherry-pick-merge.sh: test_description='cherry picking and reverting a merge
     + 
     + '
     + 
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t3502-cherry-pick-merge.sh: test_expect_success setup '
       	echo new line >B &&
       	git commit -m "add line to B" B &&
     @@ t/t3502-cherry-pick-merge.sh: test_expect_success setup '
       
      
       ## t/t3503-cherry-pick-root.sh ##
     +@@
     + 
     + test_description='test cherry-picking (and reverting) a root commit'
     + 
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t3503-cherry-pick-root.sh: test_expect_success setup '
       test_expect_success 'cherry-pick a root commit' '
       
     @@ t/t3503-cherry-pick-root.sh: test_expect_success 'cherry-pick two root commits'
       	test_cmp expect.file2 file2 &&
      
       ## t/t3504-cherry-pick-rerere.sh ##
     -@@ t/t3504-cherry-pick-rerere.sh: test_description='cherry-pick should rerere for conflicts'
     +@@
     + 
     + test_description='cherry-pick should rerere for conflicts'
     + 
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
       
       test_expect_success setup '
       	test_commit foo &&
     @@ t/t3504-cherry-pick-rerere.sh: test_expect_success 'cherry-pick --continue rejec
       test_done
      
       ## t/t3505-cherry-pick-empty.sh ##
     +@@
     + 
     + test_description='test cherry-picking an empty commit'
     + 
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t3505-cherry-pick-empty.sh: test_expect_success setup '
       	test_tick &&
       	git commit --allow-empty-message -m "" &&
     @@ t/t3505-cherry-pick-empty.sh: test_expect_success 'cherry-pick a commit that bec
       
      
       ## t/t3506-cherry-pick-ff.sh ##
     +@@
     + 
     + test_description='test cherry-picking with --ff option'
     + 
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t3506-cherry-pick-ff.sh: test_expect_success setup '
       '
       
     @@ t/t3506-cherry-pick-ff.sh: test_expect_success 'merge setup' '
       	git checkout -b new A
      
       ## t/t3507-cherry-pick-conflict.sh ##
     +@@ t/t3507-cherry-pick-conflict.sh: test_description='test cherry-pick and revert with conflicts
     + 
     + '
     + 
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t3507-cherry-pick-conflict.sh: test_expect_success setup '
       	test_commit redundant-pick foo c redundant &&
       	git commit --allow-empty --allow-empty-message &&
     @@ t/t3507-cherry-pick-conflict.sh: test_expect_success setup '
       '
      
       ## t/t3508-cherry-pick-many-commits.sh ##
     +@@
     + 
     + test_description='test cherry-picking many commits'
     + 
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t3508-cherry-pick-many-commits.sh: test_expect_success setup '
       '
       
     @@ t/t3508-cherry-pick-many-commits.sh: test_expect_success 'cherry-pick -3 fourth
       	git rev-list --reverse first..fourth | git cherry-pick --stdin &&
      
       ## t/t3509-cherry-pick-merge-df.sh ##
     +@@
     + #!/bin/sh
     + 
     + test_description='Test cherry-pick with directory/file conflicts'
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t3509-cherry-pick-merge-df.sh: test_expect_success 'Setup rename across paths each below D/F conflicts' '
       
       test_expect_success 'Cherry-pick succeeds with rename across D/F conflicts' '
     @@ t/t3509-cherry-pick-merge-df.sh: test_expect_success 'Setup rename across paths
       
      
       ## t/t3512-cherry-pick-submodule.sh ##
     +@@
     + 
     + test_description='cherry-pick can handle submodules'
     + 
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t3512-cherry-pick-submodule.sh: test_expect_success 'unrelated submodule/file conflict is ignored' '
       		git add a_file &&
       		git commit -m "modify a file" &&
     @@ t/t3512-cherry-pick-submodule.sh: test_expect_success 'unrelated submodule/file
       		git submodule update sub &&
      
       ## t/t3600-rm.sh ##
     +@@
     + 
     + test_description='Test of the various options to git rm.'
     + 
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t3600-rm.sh: test_expect_success 'setup submodule conflict' '
       	echo 1 >nitfol &&
       	git add nitfol &&
     @@ t/t3600-rm.sh: test_expect_success 'checking out a commit after submodule remova
       	echo "?? submod/" >expected &&
      
       ## t/t3701-add-interactive.sh ##
     +@@
     + #!/bin/sh
     + 
     + test_description='add -i basic tests'
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t3701-add-interactive.sh: test_expect_success 'patch mode ignores unmerged entries' '
       	test_commit non-conflict &&
       	git checkout -b side &&
     @@ t/t3701-add-interactive.sh: test_expect_success 'patch mode ignores unmerged ent
       	echo y | git add -p >output &&
      
       ## t/t3901-i18n-patch.sh ##
     +@@
     + 
     + test_description='i18n settings and format-patch | am pipe'
     + 
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t3901-i18n-patch.sh: test_expect_success setup '
       
       	# the first commit on the side branch is UTF-8
     @@ t/t3901-i18n-patch.sh: test_expect_success !MINGW 'am (L/U)' '
       	git am out-u1 out-u2 &&
      
       ## t/t3903-stash.sh ##
     +@@
     + 
     + test_description='Test git stash'
     + 
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t3903-stash.sh: test_expect_success 'stash branch' '
       	git commit file -m second &&
       	git stash branch stashbranch &&
     @@ t/t3903-stash.sh: test_expect_success 'create with multiple arguments for the me
       	git add foo &&
      
       ## t/t3910-mac-os-precompose.sh ##
     +@@
     + 
     + test_description='utf-8 decomposed (nfd) converted to precomposed (nfc)'
     + 
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t3910-mac-os-precompose.sh: test_expect_success "git checkout link nfd" '
       	git checkout l.$Odiarnfd
       '
     @@ t/t3910-mac-os-precompose.sh: test_expect_success "Add long decomposed filename"
       	git reset --hard &&
       	git checkout -b mac_os_long_nfc_fn
       '
     -
     - ## t/test-lib.sh ##
     -@@ t/test-lib.sh: case "$TEST_NUMBER" in
     - 	GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     - 	export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     - 	;;
     --[0-2]*|3[0-4]*)
     -+[0-3]*)
     - 	GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     - 	export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     - 	;;
  8:  cf6c1d1d83 !  9:  0164eb9745 t4*: adjust the references to the default branch name "main"
     @@ Metadata
       ## Commit message ##
          t4*: adjust the references to the default branch name "main"
      
     -    Carefully excluding t4013, which sees independent development elsewhere
     -    at the time of writing, we use `main` as the default branch name in t4*.
     -    This trick was performed via
     +    Carefully excluding t4013 and t4015, which see independent development
     +    elsewhere at the time of writing, we use `main` as the default branch
     +    name in t4*. This trick was performed via
      
                  $ (cd t &&
                     sed -i -e 's/master/main/g' -e 's/MASTER/MAIN/g' \
     @@ Commit message
          Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
      
       ## t/t4014-format-patch.sh ##
     +@@
     + 
     + test_description='various format-patch tests'
     + 
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t4014-format-patch.sh: test_expect_success setup '
       	test_tick &&
       	git commit -m "Side changes #3 with \\n backslash-n in it." &&
     @@ t/t4014-format-patch.sh: test_expect_success 'format-patch --pretty=mboxrd' '
       	test_commit fleep blorp
       '
      
     - ## t/t4015-diff-whitespace.sh ##
     -@@ t/t4015-diff-whitespace.sh: test_expect_success 'combined diff with autocrlf conversion' '
     - 	echo >x goodbye &&
     - 	git commit -m "the other side" x &&
     - 	git config core.autocrlf true &&
     --	test_must_fail git merge master &&
     -+	test_must_fail git merge main &&
     - 
     - 	git diff >actual.raw &&
     - 	sed -e "1,/^@@@/d" actual.raw >actual &&
     -
       ## t/t4017-diff-retval.sh ##
     +@@
     + 
     + test_description='Return value of diffs'
     + 
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t4017-diff-retval.sh: test_expect_success 'check detects leftover conflict markers' '
       	git checkout HEAD^ &&
       	echo binary >>b &&
     @@ t/t4017-diff-retval.sh: test_expect_success 'check detects leftover conflict mar
       	test 3 = $(grep "conflict marker" test.out | wc -l) &&
      
       ## t/t4038-diff-combined.sh ##
     +@@
     + 
     + test_description='combined diff'
     + 
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t4038-diff-combined.sh: test_expect_success 'check --cc --raw with forty trees' '
       '
       
     @@ t/t4038-diff-combined.sh: test_expect_success 'combine diff gets tree sorting ri
       	printf "MM\tfoo\n" >expect &&
      
       ## t/t4041-diff-submodule-option.sh ##
     +@@ t/t4041-diff-submodule-option.sh: test_description='Support for verbose submodule differences in git diff
     + This test tries to verify the sanity of the --submodule option of git diff.
     + '
     + 
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t4041-diff-submodule-option.sh: test_expect_success 'diff --submodule with objects referenced by alternates' '
       	(cd super &&
       		(cd sub &&
     @@ t/t4041-diff-submodule-option.sh: test_expect_success 'diff --submodule with obj
       	) &&
      
       ## t/t4048-diff-combined-binary.sh ##
     +@@
     + #!/bin/sh
     + 
     + test_description='combined and merge diff handle binary files and textconv'
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t4048-diff-combined-binary.sh: test_expect_success 'setup binary merge conflict' '
       	echo threeQ3 | q_to_nul >binary &&
       	git commit -a -m three &&
     @@ t/t4048-diff-combined-binary.sh: index $three,$two..0000000
       '
      
       ## t/t4052-stat-output.sh ##
     +@@
     + 
     + test_description='test --stat output of various commands'
     + 
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t4052-stat-output.sh: cat >expect <<'EOF'
       EOF
       test_expect_success 'merge --stat respects COLUMNS (big change)' '
     @@ t/t4052-stat-output.sh: cat >expect <<'EOF'
       '
      
       ## t/t4056-diff-order.sh ##
     +@@
     + 
     + test_description='diff order'
     + 
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t4056-diff-order.sh: done
       test_expect_success 'setup for testing combine-diff order' '
       	git checkout -b tmp HEAD~ &&
     @@ t/t4056-diff-order.sh: done
       '
      
       ## t/t4057-diff-combined-paths.sh ##
     +@@
     + 
     + test_description='combined diff show only paths that are different to all parents'
     + 
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t4057-diff-combined-paths.sh: test_expect_success 'trivial merge - combine-diff empty' '
       		echo $i/2 >>$i.txt
       	done &&
     @@ t/t4057-diff-combined-paths.sh: test_expect_success 'merge removed a file' '
       	git commit --amend &&
      
       ## t/t4061-diff-indent.sh ##
     +@@
     + test_description='Test diff indent heuristic.
     + 
     + '
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t4061-diff-indent.sh: test_expect_success 'diff-index: nice spaces with --indent-heuristic' '
       	git reset --soft HEAD~ &&
       	git diff-index --indent-heuristic -p old -- spaces.txt >out-diff-index-compacted &&
     @@ t/t4061-diff-indent.sh: test_expect_success 'diff-files: --no-indent-heuristic o
       test_done
      
       ## t/t4066-diff-emit-delay.sh ##
     +@@
     + #!/bin/sh
     + 
     + test_description='test combined/stat/moved interaction'
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t4066-diff-emit-delay.sh: test_expect_success 'set up history with a merge' '
       	test_commit B &&
       	git checkout -b side HEAD^ &&
     @@ t/t4066-diff-emit-delay.sh: test_expect_success 'set up history with a merge' '
       
      
       ## t/t4068-diff-symmetric-merge-base.sh ##
     -@@ t/t4068-diff-symmetric-merge-base.sh: test_description='behavior of diff with symmetric-diff setups and --merge-base'
     +@@
     + 
     + test_description='behavior of diff with symmetric-diff setups and --merge-base'
     + 
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
       
       # build these situations:
       #  - normal merge with one merge base (br1...b2r);
     @@ t/t4068-diff-symmetric-merge-base.sh: do
       
      
       ## t/t4103-apply-binary.sh ##
     +@@
     + test_description='git apply handling binary patches
     + 
     + '
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t4103-apply-binary.sh: test_expect_success 'setup' '
       	git update-index --add --remove file1 file2 file3 file4 &&
       	git commit -m "Second Version" &&
     @@ t/t4103-apply-binary.sh: test_expect_success 'check binary diff with replacement
       test_expect_success 'apply binary diff -- should fail.' \
      
       ## t/t4108-apply-threeway.sh ##
     +@@
     + 
     + test_description='git apply --3way'
     + 
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t4108-apply-threeway.sh: test_expect_success setup '
       	test_tick &&
       	test_write_lines 1 two 3 4 5 six 7 >one &&
     @@ t/t4108-apply-threeway.sh: test_expect_success 'apply with --3way with rerere en
       	# but rerere should have replayed the recorded resolution
      
       ## t/t4121-apply-diffs.sh ##
     +@@
     + #!/bin/sh
     + 
     + test_description='git apply for contextually independent diffs'
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t4121-apply-diffs.sh: test_expect_success 'setup' \
       	git commit -a -q -m 2 &&
       	echo 9 >>file &&
     @@ t/t4121-apply-diffs.sh: test_expect_success 'setup' \
       	'check if contextually independent diffs for the same file apply' \
      
       ## t/t4122-apply-symlink-inside.sh ##
     +@@
     + #!/bin/sh
     + 
     + test_description='apply to deeper directory without getting fooled with symlink'
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t4122-apply-symlink-inside.sh: test_expect_success apply '
       
       test_expect_success 'check result' '
     @@ t/t4122-apply-symlink-inside.sh: test_expect_success apply '
       
      
       ## t/t4150-am.sh ##
     +@@
     + 
     + test_description='git am running'
     + 
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t4150-am.sh: test_expect_success setup '
       	test_tick &&
       	git commit -m "added another file" &&
     @@ t/t4200-rerere.sh: test_description='git rerere
      +++++++ [main] initial
       '
       
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
       . ./test-lib.sh
      @@ t/t4200-rerere.sh: test_expect_success 'setup' '
       	test_tick &&
     @@ t/t4200-rerere.sh: test_expect_success 'setup simple stage 1 handling' '
       	)
      
       ## t/t4201-shortlog.sh ##
     +@@
     + test_description='git shortlog
     + '
     + 
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t4201-shortlog.sh: test_expect_success 'shortlog with revision pseudo options' '
       '
       
     @@ t/t4201-shortlog.sh: test_expect_success 'shortlog with revision pseudo options'
       '
      
       ## t/t4202-log.sh ##
     +@@
     + 
     + test_description='git log'
     + 
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t4202-log.sh: test_expect_success 'set up merge history' '
       	git checkout -b side HEAD~4 &&
       	test_commit side-1 1 1 &&
     @@ t/t4202-log.sh: test_expect_success 'log diagnoses bogus HEAD' '
       	echo "ref: refs/heads/invalid.lock" >empty/.git/HEAD &&
      
       ## t/t4203-mailmap.sh ##
     +@@
     + 
     + test_description='.mailmap configurations'
     + 
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t4203-mailmap.sh: test_expect_success 'No mailmap files, but configured' '
       
       test_expect_success 'setup mailmap blob tests' '
     @@ t/t4203-mailmap.sh: test_expect_success 'No mailmap files, but configured' '
       	EOF
      
       ## t/t4204-patch-id.sh ##
     +@@
     + 
     + test_description='git patch-id'
     + 
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t4204-patch-id.sh: test_expect_success 'setup' '
       	test_write_lines $as b >foo &&
       	test_write_lines $as b >bar &&
     @@ t/t4204-patch-id.sh: test_expect_success '--stable overrides patchid.stable = fa
       test_expect_success 'patch-id respects config from subdir' '
      
       ## t/t4207-log-decoration-colors.sh ##
     +@@
     + 
     + test_description='Test for "git log --decorate" colors'
     + 
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t4207-log-decoration-colors.sh: test_expect_success setup '
       
       cat >expected <<EOF
     @@ t/t4207-log-decoration-colors.sh: test_expect_success setup '
       
      
       ## t/t4208-log-magic-pathspec.sh ##
     +@@
     + 
     + test_description='magic pathspec tests using git-log'
     + 
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t4208-log-magic-pathspec.sh: test_expect_success '"git log :/a -- " should not be ambiguous' '
       '
       
     @@ t/t4208-log-magic-pathspec.sh: test_expect_success 'command line pathspec parsin
       	git log --merge -- a
       '
      
     + ## t/t4211-line-log.sh ##
     +@@
     + #!/bin/sh
     + 
     + test_description='test log -L'
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
     +
       ## t/t4211/history.export ##
      @@ t/t4211/history.export: long f(long x)
       	return s;
     @@ t/t4211/history.export: long f(long x)
       committer Thomas Rast <trast@student.ethz.ch> 1362045024 +0100
      
       ## t/t4214-log-graph-octopus.sh ##
     +@@
     + 
     + test_description='git log --graph of skewed left octopus merge.'
     + 
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t4214-log-graph-octopus.sh: test_cmp_colored_graph () {
       test_expect_success 'set up merge history' '
       	test_commit initial &&
     @@ t/t4214-log-graph-octopus.sh: test_cmp_colored_graph () {
       		test_commit $i $i $i tag$i || return $?
      
       ## t/t4216-log-bloom.sh ##
     +@@
     + #!/bin/sh
     + 
     + test_description='git log for a path with Bloom filters'
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t4216-log-bloom.sh: test_expect_success 'setup test - repo, commits, commit graph, log outputs' '
       	test_commit c10 file_to_be_deleted &&
       	git checkout -b side HEAD~4 &&
     @@ t/t4216-log-bloom.sh: do
       			test_bloom_filters_used "$option -- $path" &&
      
       ## t/t4253-am-keep-cr-dos.sh ##
     +@@
     + test_description='git-am mbox with dos line ending.
     + 
     + '
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t4253-am-keep-cr-dos.sh: test_expect_success 'setup repository with dos files' '
       
       test_expect_success 'am with dos files without --keep-cr' '
     @@ t/t4257-am-interactive.sh: test_expect_success 'set up patches to apply' '
       '
       
       # Sanity check our setup.
     -
     - ## t/test-lib.sh ##
     -@@ t/test-lib.sh: case "$TRASH_DIRECTORY" in
     - esac
     - 
     - case "$TEST_NUMBER" in
     --3404)
     -+3404|4013)
     - 	# Avoid conflicts with patch series that are cooking at the same time
     - 	# as the patch series changing the default of `init.defaultBranch`.
     - 	GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     - 	export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     - 	;;
     --[0-3]*)
     -+[0-4]*)
     - 	GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     - 	export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     - 	;;
  9:  6ff4594a28 = 10:  36d633a5ec t5323: prepare centered comment for `master` -> `main`
 10:  be29e07892 ! 11:  d9d1d14681 t5[0-4]*: adjust the references to the default branch name "main"
     @@ Commit message
          Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
      
       ## t/t5150-request-pull.sh ##
     +@@
     + 
     + test_description='Test workflows involving pull request.'
     + 
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t5150-request-pull.sh: test_expect_success 'setup' '
       		test_tick &&
       		git commit -m "\"Thirty days\", a reminder of month lengths" &&
     @@ t/t5150-request-pull.sh: test_expect_success 'pull request with stale object' '
       		test_must_fail git request-pull initial "$downstream_url" tags/full \
      
       ## t/t5304-prune.sh ##
     +@@
     + #
     + 
     + test_description='prune'
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t5304-prune.sh: test_expect_success 'prune: do not prune detached HEAD with no reflog' '
       test_expect_success 'prune: prune former HEAD after checking out branch' '
       
     @@ t/t5304-prune.sh: test_expect_success 'prune: do not prune detached HEAD with no
       
      
       ## t/t5305-include-tag.sh ##
     +@@
     + #!/bin/sh
     + 
     + test_description='git pack-object --include-tag'
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t5305-include-tag.sh: test_expect_success 'check unpacked result (have all objects)' '
       
       test_expect_success 'single-branch clone can transfer tag' '
     @@ t/t5305-include-tag.sh: test_expect_success 'check unpacked result (have all obj
       
      
       ## t/t5312-prune-corruption.sh ##
     +@@ t/t5312-prune-corruption.sh: bail out or to proceed using it as a reachable tip, but it is _not_
     + OK to proceed as if it did not exist. Otherwise we might silently
     + delete objects that cannot be recovered.
     + '
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t5312-prune-corruption.sh: test_expect_success 'disable reflogs' '
       '
       
     @@ t/t5312-prune-corruption.sh: test_expect_success 'pack-refs does not silently de
       
      
       ## t/t5317-pack-objects-filter-objects.sh ##
     +@@
     + 
     + test_description='git pack-objects using object filtering'
     + 
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t5317-pack-objects-filter-objects.sh: test_expect_success 'verify sparse:oid=oid-ish' '
       	awk -f print_2.awk ls_files_result |
       	sort >expected &&
     @@ t/t5317-pack-objects-filter-objects.sh: test_expect_success 'verify sparse:oid=o
       	git -C r4 index-pack ../filter.pack &&
      
       ## t/t5322-pack-objects-sparse.sh ##
     +@@
     + #!/bin/sh
     + 
     + test_description='pack-objects object selection using sparse algorithm'
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t5322-pack-objects-sparse.sh: test_expect_success 'setup repo' '
       	git commit -m "Initialized trees" &&
       	for i in $(test_seq 1 3)
     @@ t/t5323-pack-redundant.sh: test_expect_success 'shared: one pack is redundant wi
       #     P1  | x x x x x x x                       x                   |
      
       ## t/t5400-send-pack.sh ##
     +@@
     + test_description='See why rewinding head breaks send-pack
     + 
     + '
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t5400-send-pack.sh: test_expect_success 'pack the destination repository' '
       '
       
     @@ t/t5401-update-hooks.sh: test_expect_success 'pre-receive hook that forgets to r
       '
      
       ## t/t5402-post-merge-hook.sh ##
     +@@
     + #
     + 
     + test_description='Test the post-merge hook.'
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t5402-post-merge-hook.sh: test_expect_success setup '
       	git update-index a &&
       	tree1=$(git write-tree) &&
     @@ t/t5402-post-merge-hook.sh: test_expect_success setup '
       	git clone ./. clone2 &&
      
       ## t/t5403-post-checkout-hook.sh ##
     +@@
     + #
     + 
     + test_description='Test the post-checkout hook.'
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t5403-post-checkout-hook.sh: test_expect_success setup '
       
       test_expect_success 'post-checkout receives the right arguments with HEAD unchanged ' '
     @@ t/t5403-post-checkout-hook.sh: test_expect_success 'post-checkout receives the r
       	read old new flag <.git/post-checkout.args &&
      
       ## t/t5404-tracking-branches.sh ##
     +@@
     + 
     + test_description='tracking branch update checks for git push'
     + 
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t5404-tracking-branches.sh: test_expect_success 'prepare pushable branches' '
       	git checkout -b b2 origin/b2 &&
       	echo aa-b2 >>file &&
     @@ t/t5404-tracking-branches.sh: test_expect_success 'mixed-success push returns er
       test_expect_success 'check tracking branches not updated for failed refs' '
      
       ## t/t5405-send-pack-rewind.sh ##
     +@@
     + 
     + test_description='forced push to replace commit we do not have'
     + 
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t5405-send-pack-rewind.sh: test_expect_success setup '
       	mkdir another && (
       		cd another &&
     @@ t/t5405-send-pack-rewind.sh: test_expect_success 'forced push should succeed' '
       '
      
       ## t/t5407-post-rewrite-hook.sh ##
     +@@
     + #
     + 
     + test_description='Test the post-rewrite hook.'
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t5407-post-rewrite-hook.sh: test_expect_success 'setup' '
       	git checkout A^0 &&
       	test_commit E bar E &&
     @@ t/t5407-post-rewrite-hook.sh: test_expect_success 'setup' '
       mkdir .git/hooks
      
       ## t/t5410-receive-pack-alternates.sh ##
     -@@ t/t5410-receive-pack-alternates.sh: test_description='git receive-pack with alternate ref filtering'
     +@@
     + 
     + test_description='git receive-pack with alternate ref filtering'
     + 
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
     +@@ t/t5410-receive-pack-alternates.sh: export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
       test_expect_success 'setup' '
       	test_commit base &&
       	git clone -s --bare . fork &&
     @@ t/t5410-receive-pack-alternates.sh: test_description='git receive-pack with alte
       	test_commit private
       '
       
     -
     - ## t/test-lib.sh ##
     -@@ t/test-lib.sh: case "$TRASH_DIRECTORY" in
     - esac
     - 
     - case "$TEST_NUMBER" in
     --3404|4013)
     -+3404|4013|5310)
     - 	# Avoid conflicts with patch series that are cooking at the same time
     - 	# as the patch series changing the default of `init.defaultBranch`.
     - 	GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     - 	export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     - 	;;
     --[0-4]*)
     -+[0-4]*|5[0-4]*)
     - 	GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     - 	export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     - 	;;
 11:  5126d90a32 ! 12:  f7a9bc07c7 t5503: prepare aligned comment for replacing `master` with `main`
     @@ Commit message
          Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
      
       ## t/t5503-tagfollow.sh ##
     -@@ t/t5503-tagfollow.sh: test_description='test automatic tag following'
     +@@ t/t5503-tagfollow.sh: export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
       #   L - A ------ O ------ B
       #    \   \                 \
       #     \   C - origin/cat    \
 12:  332677cbf9 ! 13:  4d7eb7dc28 t550*: adjust the references to the default branch name "main"
     @@ Commit message
          Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
      
       ## t/t5500-fetch-pack.sh ##
     +@@
     + 
     + test_description='Testing multi_ack pack fetching'
     + 
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t5500-fetch-pack.sh: test_expect_success 'in_vain resetted upon ACK' '
       	rm -rf myserver myclient &&
       	git init myserver &&
     @@ t/t5500-fetch-pack.sh: test_expect_success 'fetching deepen' '
       	three
      
       ## t/t5501-fetch-push-alternates.sh ##
     +@@
     + #!/bin/sh
     + 
     + test_description='fetch/push involving alternates'
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t5501-fetch-push-alternates.sh: test_expect_success setup '
       test_expect_success 'pushing into a repository with the same alternate' '
       	(
     @@ t/t5501-fetch-push-alternates.sh: test_expect_success 'pushing into a repository
       	test_cmp one.count fetcher.count
      
       ## t/t5502-quickfetch.sh ##
     +@@
     + 
     + test_description='test quickfetch from local'
     + 
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t5502-quickfetch.sh: test_expect_success 'quickfetch should not copy from alternate' '
       				q
       			}"
     @@ t/t5502-quickfetch.sh: test_expect_success 'quickfetch should not copy from alte
       
      
       ## t/t5503-tagfollow.sh ##
     -@@ t/t5503-tagfollow.sh: test_description='test automatic tag following'
     +@@
     + 
     + test_description='test automatic tag following'
     + 
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
     +@@ t/t5503-tagfollow.sh: export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
       #   L - A ------ O ------ B
       #    \   \                 \
       #     \   C - origin/cat    \
     @@ t/t5503-tagfollow.sh: test_expect_success 'new clone fetch master and tags' '
       		test $T = $(git rev-parse --verify tag1) &&
      
       ## t/t5504-fetch-receive-strict.sh ##
     +@@
     + #!/bin/sh
     + 
     + test_description='fetch/receive strict mode'
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t5504-fetch-receive-strict.sh: test_expect_success 'fetch without strict' '
       		cd dst &&
       		git config fetch.fsckobjects false &&
     @@ t/t5504-fetch-receive-strict.sh: test_expect_success 'push with transfer.fsckobj
       
      
       ## t/t5505-remote.sh ##
     +@@
     + 
     + test_description='git remote porcelain-ish'
     + 
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t5505-remote.sh: setup_repository () {
       	git add elif &&
       	test_tick &&
     @@ t/t5505-remote.sh: test_expect_success 'unqualified <dst> refspec DWIM and advic
       	) &&
      
       ## t/t5506-remote-groups.sh ##
     +@@
     + #!/bin/sh
     + 
     + test_description='git remote group handling'
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t5506-remote-groups.sh: repo_fetched() {
       test_expect_success 'setup' '
       	mkdir one && (cd one && git init) &&
     @@ t/t5506-remote-groups.sh: repo_fetched() {
       test_expect_success 'no group updates all' '
      
       ## t/t5509-fetch-push-namespaces.sh ##
     +@@
     + #!/bin/sh
     + 
     + test_description='fetch/push involving ref namespaces'
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t5509-fetch-push-namespaces.sh: test_expect_success setup '
       test_expect_success 'pushing into a repository using a ref namespace' '
       	(
     @@ t/t5509-fetch-push-namespaces.sh: test_expect_success 'denyCurrentBranch and unb
       	)
       '
       
     -
     - ## t/test-lib.sh ##
     -@@ t/test-lib.sh: case "$TEST_NUMBER" in
     - 	GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     - 	export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     - 	;;
     --[0-4]*|5[0-4]*)
     -+[0-4]*|5[0-4]*|550*)
     - 	GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     - 	export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     - 	;;
 13:  b7333ef201 ! 14:  88b2c30cc8 t551*: adjust the references to the default branch name "main"
     @@ Commit message
          Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
      
       ## t/t5510-fetch.sh ##
     +@@ t/t5510-fetch.sh: test_description='Per branch config variables affects "git fetch".
     + 
     + '
     + 
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t5510-fetch.sh: test_expect_success "clone and setup child repos" '
       	git clone . two &&
       	(
     @@ t/t5511-refspec.sh: test_refspec push 'refs/heads/master:refs/remotes/frotz/xyzz
       
      
       ## t/t5512-ls-remote.sh ##
     +@@
     + 
     + test_description='git ls-remote'
     + 
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t5512-ls-remote.sh: test_expect_success 'use branch.<name>.remote if possible' '
       	echo "From $URL" >exp_err &&
       
     @@ t/t5512-ls-remote.sh: test_expect_success 'ls-remote --sort fails gracefully out
       
      
       ## t/t5514-fetch-multiple.sh ##
     +@@
     + 
     + test_description='fetch --all works correctly'
     + 
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t5514-fetch-multiple.sh: setup_repository () {
       	git add elif &&
       	test_tick &&
     @@ t/t5514-fetch-multiple.sh: test_expect_success 'git fetch --all (skipFetchAll)'
       
      
       ## t/t5516-fetch-push.sh ##
     +@@ t/t5516-fetch-push.sh: This test checks the following functionality:
     + * reflogs
     + '
     + 
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t5516-fetch-push.sh: test_expect_success setup '
       	git add path1 &&
       	test_tick &&
     @@ t/t5516-fetch-push.sh: test_expect_success 'updateInstead with push-to-checkout
       		git diff --quiet &&
      
       ## t/t5517-push-mirror.sh ##
     +@@
     + 
     + test_description='pushing to a mirror repository'
     + 
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t5517-push-mirror.sh: invert () {
       }
       
     @@ t/t5517-push-mirror.sh: test_expect_success 'remote.foo.mirror=no has no effect'
       
      
       ## t/t5518-fetch-exit-status.sh ##
     +@@
     + 
     + test_description='fetch exit status test'
     + 
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t5518-fetch-exit-status.sh: test_expect_success setup '
       	echo side >file &&
       	git commit -a -m side &&
     @@ t/t5518-fetch-exit-status.sh: test_expect_success setup '
       
      
       ## t/t5519-push-alternates.sh ##
     +@@
     + 
     + test_description='push to a repository that borrows from elsewhere'
     + 
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t5519-push-alternates.sh: test_expect_success setup '
       		>file &&
       		git add . &&
     @@ t/t5519-push-alternates.sh: test_expect_success 'alice works and pushes yet agai
       		# at a commit Bob does not fully know about, but
       		# he happens to have the commit object (but not the
       		# necessary tree) in his repository from Alice.
     -
     - ## t/test-lib.sh ##
     -@@ t/test-lib.sh: case "$TEST_NUMBER" in
     - 	GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     - 	export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     - 	;;
     --[0-4]*|5[0-4]*|550*)
     -+[0-4]*|5[0-4]*|55[01]*)
     - 	GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     - 	export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     - 	;;
 14:  4b1b1ee51f ! 15:  3b73811af4 t55[23]*: adjust the references to the default branch name "main"
     @@ Commit message
          Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
      
       ## t/t5520-pull.sh ##
     +@@
     + 
     + test_description='pulling into void'
     + 
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t5520-pull.sh: test_expect_success 'pulling into void' '
       	test_cmp file cloned/file
       '
     @@ t/t5520-pull.sh: test_expect_success 'setup for avoiding reapplying old patches'
       	rm -rf src &&
      
       ## t/t5521-pull-options.sh ##
     +@@
     + 
     + test_description='pull options'
     + 
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t5521-pull-options.sh: test_expect_success 'git pull --force' '
       	cat >>.git/config <<-\EOF &&
       	[remote "one"]
     @@ t/t5521-pull-options.sh: test_expect_success 'git pull --all --dry-run' '
       	)
      
       ## t/t5523-push-upstream.sh ##
     +@@
     + #!/bin/sh
     + 
     + test_description='push with --set-upstream'
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t5523-push-upstream.sh: check_config() {
       	test_cmp expect.$1 actual.$1
       }
     @@ t/t5523-push-upstream.sh: test_expect_success TTY 'push --no-progress suppresses
       
      
       ## t/t5527-fetch-odd-refs.sh ##
     -@@ t/t5527-fetch-odd-refs.sh: test_description='test fetching of oddly-named refs'
     +@@
     + #!/bin/sh
     + 
     + test_description='test fetching of oddly-named refs'
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
       
       # afterwards we will have:
       #  HEAD - two
     @@ t/t5527-fetch-odd-refs.sh: test_expect_success LONG_REF 'fetch handles extremely
       
      
       ## t/t5528-push-default.sh ##
     +@@
     + #!/bin/sh
     + 
     + test_description='check various push.default settings'
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t5528-push-default.sh: test_push_failure () {
       
       # $1 = success or failure
     @@ t/t5530-upload-pack-error.sh: test_expect_success 'create empty repository' '
       
      
       ## t/t5531-deep-submodule-push.sh ##
     +@@
     + 
     + test_description='test push with submodules'
     + 
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t5531-deep-submodule-push.sh: test_expect_success setup '
       test_expect_success 'push works with recorded gitlink' '
       	(
     @@ t/t5531-deep-submodule-push.sh: test_expect_success 'push propagating refspec to
       	git -C submodule.git rev-parse branch2 >actual_submodule &&
      
       ## t/t5533-push-cas.sh ##
     +@@
     + 
     + test_description='compare & swap push force/delete safety'
     + 
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t5533-push-cas.sh: setup_src_dup_dst () {
       	(
       		cd dup &&
     @@ t/t5533-push-cas.sh: test_expect_success '"--force-if-includes" should allow for
       
      
       ## t/t5534-push-signed.sh ##
     +@@
     + 
     + test_description='signed push'
     + 
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t5534-push-signed.sh: prepare_dst () {
       	rm -fr dst &&
       	test_create_repo dst &&
     @@ t/t5534-push-signed.sh: prepare_dst () {
       
      
       ## t/t5537-fetch-shallow.sh ##
     +@@
     + 
     + test_description='fetch/clone from a shallow clone'
     + 
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t5537-fetch-shallow.sh: test_expect_success 'fetch from shallow clone' '
       	cd shallow2 &&
       	git fetch &&
     @@ t/t5537-fetch-shallow.sh: test_expect_success 'shallow fetches check connectivit
       	! test -e "$HTTPD_ROOT_PATH/one-time-perl" &&
      
       ## t/t5538-push-shallow.sh ##
     +@@
     + 
     + test_description='push from/to a shallow clone'
     + 
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t5538-push-shallow.sh: test_expect_success 'push from shallow clone' '
       	(
       	cd shallow &&
     @@ t/t5538-push-shallow.sh: EOF
       1
      
       ## t/t5539-fetch-http-shallow.sh ##
     +@@
     + 
     + test_description='fetch/clone from a shallow clone over http'
     + 
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t5539-fetch-http-shallow.sh: test_expect_success 'clone http repository' '
       	(
       	cd clone &&
     @@ t/t5539-fetch-http-shallow.sh: test_expect_success 'fetching deepen' '
       	cat >expected <<-\EOF &&
       	four
       	three
     -
     - ## t/test-lib.sh ##
     -@@ t/test-lib.sh: case "$TRASH_DIRECTORY" in
     - esac
     - 
     - case "$TEST_NUMBER" in
     --3404|4013|5310)
     -+3404|4013|5310|5526)
     - 	# Avoid conflicts with patch series that are cooking at the same time
     - 	# as the patch series changing the default of `init.defaultBranch`.
     - 	GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     - 	export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     - 	;;
     --[0-4]*|5[0-4]*|55[01]*)
     -+[0-4]*|5[0-4]*|55[0-3]*)
     - 	GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     - 	export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     - 	;;
 15:  c37d97c2d8 ! 16:  5c57fbe695 t55[4-9]*: adjust the references to the default branch name "main"
     @@ Commit message
          Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
      
       ## t/t5540-http-push-webdav.sh ##
     +@@ t/t5540-http-push-webdav.sh: test_description='test WebDAV http-push
     + 
     + This test runs various sanity checks on http-push.'
     + 
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t5540-http-push-webdav.sh: test_expect_success 'push already up-to-date' '
       test_expect_success 'push to remote repository with unpacked refs' '
       	(cd "$HTTPD_DOCUMENT_ROOT_PATH"/test_repo.git &&
     @@ t/t5540-http-push-webdav.sh: test_expect_success 'PUT and MOVE sends object to U
       	test_commit pw-user &&
      
       ## t/t5541-http-push-smart.sh ##
     +@@
     + #
     + 
     + test_description='test smart pushing over http via http-backend'
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t5541-http-push-smart.sh: test_expect_success 'used receive-pack service' '
       '
       
     @@ t/t5541-http-push-smart.sh: test_expect_success 'colorize errors/hints' '
       	test_i18ngrep "<RED>error: failed to push some refs" decoded &&
      
       ## t/t5542-push-http-shallow.sh ##
     +@@
     + 
     + test_description='push from/to a shallow clone over http'
     + 
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t5542-push-http-shallow.sh: test_expect_success 'push to shallow repo via http' '
       	(
       	cd full &&
     @@ t/t5542-push-http-shallow.sh: test_expect_success 'push from shallow repo via ht
       4
      
       ## t/t5543-atomic-push.sh ##
     +@@
     + 
     + test_description='pushing to a repository using the atomic push option'
     + 
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t5543-atomic-push.sh: test_expect_success 'atomic push works for a single branch' '
       		test_commit one &&
       		git push --mirror up &&
     @@ t/t5543-atomic-push.sh: test_expect_success 'atomic push reports (mirror, but re
       	test_cmp expect actual
      
       ## t/t5545-push-options.sh ##
     +@@
     + 
     + test_description='pushing to a repository using push options'
     + 
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t5545-push-options.sh: test_expect_success 'one push option works for a single branch' '
       		test_commit one &&
       		git push --mirror up &&
     @@ t/t5548-push-porcelain.sh: run_git_push_porcelain_output_test() {
       		test_cmp expect actual
      
       ## t/t5550-http-fetch-dumb.sh ##
     +@@
     + #!/bin/sh
     + 
     + test_description='test dumb fetching over http via static file'
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t5550-http-fetch-dumb.sh: test_expect_success 'create http-accessible bare repository with loose objects'
       	 hooks/post-update
       	) &&
     @@ t/t5550-http-fetch-dumb.sh: test_expect_success 'set up evil alternates scheme'
       # Here we'll just redirect via HTTP. In a real-world attack these would be on
      
       ## t/t5551-http-fetch-smart.sh ##
     +@@
     + #!/bin/sh
     + 
     + test_description='test smart fetching over http via http-backend'
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t5551-http-fetch-smart.sh: test_expect_success 'create http-accessible bare repository' '
       	 git --bare init
       	) &&
     @@ t/t5552-skipping-fetch-negotiator.sh: test_expect_success 'use ref advertisement
       	test_config -C client fetch.negotiationalgorithm skipping &&
      
       ## t/t5553-set-upstream.sh ##
     +@@
     + #!/bin/sh
     + 
     + test_description='"git fetch/pull --set-upstream" basic tests.'
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t5553-set-upstream.sh: test_expect_success 'setup bare parent fetch' '
       	git remote add upstream parent
       '
     @@ t/t5553-set-upstream.sh: test_expect_success 'pull --set-upstream upstream tag d
       	check_config_missing other2
       '
      
     + ## t/t5560-http-backend-noserver.sh ##
     +@@
     + #!/bin/sh
     + 
     + test_description='test git-http-backend-noserver'
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
     +
       ## t/t5561-http-backend.sh ##
     +@@
     + #!/bin/sh
     + 
     + test_description='test git-http-backend'
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t5561-http-backend.sh: POST() {
       
       grep '^[^#]' >exp <<EOF
     @@ t/t556x_common: get_static_files() {
       	get_static_files "200 OK"
      
       ## t/t5570-git-daemon.sh ##
     +@@
     + #!/bin/sh
     + 
     + test_description='test fetching over git protocol'
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t5570-git-daemon.sh: test_expect_success 'create git-accessible bare repository' '
       	 : >git-daemon-export-ok
       	) &&
     @@ t/t5570-git-daemon.sh: test_expect_success FAKENC 'hostname interpolation works
       
      
       ## t/t5571-pre-push-hook.sh ##
     +@@
     + #!/bin/sh
     + 
     + test_description='check pre-push hooks'
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t5571-pre-push-hook.sh: EOF
       cat >expected <<EOF
       parent1
     @@ t/t5572-pull-submodule.sh: test_expect_success 'branch has no merge base with re
       	git -C child reset --hard "$OTHER" &&
      
       ## t/t5580-unc-paths.sh ##
     +@@
     + #!/bin/sh
     + 
     + test_description='various Windows-only path tests'
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t5580-unc-paths.sh: test_expect_success fetch '
       	git init to-fetch &&
       	(
     @@ t/t5580-unc-paths.sh: test_expect_success fetch '
       
      
       ## t/t5581-http-curl-verbose.sh ##
     +@@
     + #!/bin/sh
     + 
     + test_description='test GIT_CURL_VERBOSE'
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t5581-http-curl-verbose.sh: test_expect_success 'setup repository' '
       	git add file &&
       	git commit -m one &&
     @@ t/t5581-http-curl-verbose.sh: test_expect_success 'setup repository' '
       test_expect_success 'failure in git-upload-pack is shown' '
      
       ## t/t5582-fetch-negative-refspec.sh ##
     +@@ t/t5582-fetch-negative-refspec.sh: test_description='"git fetch" with negative refspecs.
     + 
     + '
     + 
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t5582-fetch-negative-refspec.sh: test_expect_success "clone and setup child repos" '
       		git switch -c alternate &&
       		echo >file updated again by one &&
     @@ t/t5582-fetch-negative-refspec.sh: test_expect_success "fetch with negative patt
       		cut -f -1 .git/FETCH_HEAD >actual &&
       		test_cmp expect actual
       	)
     -
     - ## t/test-lib.sh ##
     -@@ t/test-lib.sh: case "$TEST_NUMBER" in
     - 	GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     - 	export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     - 	;;
     --[0-4]*|5[0-4]*|55[0-3]*)
     -+[0-4]*|5[0-5]*)
     - 	GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     - 	export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     - 	;;
 16:  dda6ce098c ! 17:  b2fda75261 t5[6-9]*: adjust the references to the default branch name "main"
     @@ Commit message
          Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
      
       ## t/t5601-clone.sh ##
     +@@
     + 
     + test_description=clone
     + 
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t5601-clone.sh: test_expect_success 'clone respects global branch.autosetuprebase' '
       		rm -fr dst &&
       		git clone src dst &&
     @@ t/t5601-clone.sh: test_expect_success 'clone from a repository with two identica
       	test "z$( cd target-11 && git symbolic-ref HEAD )" = zrefs/heads/another
      
       ## t/t5604-clone-reference.sh ##
     +@@
     + #
     + 
     + test_description='test clone --reference'
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t5604-clone-reference.sh: test_expect_success 'existence of info/alternates' '
       '
       
     @@ t/t5604-clone-reference.sh: test_expect_success 'fetch with incomplete alternate
       '
      
       ## t/t5605-clone-local.sh ##
     +@@
     + #!/bin/sh
     + 
     + test_description='test local clone'
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t5605-clone-local.sh: test_expect_success 'preparing origin repository' '
       	test "$(cd a.git && git config --bool core.bare)" = true &&
       	test "$(cd x && git config --bool core.bare)" = true &&
     @@ t/t5605-clone-local.sh: test_expect_success 'clone empty repository' '
       
      
       ## t/t5606-clone-options.sh ##
     +@@
     + #!/bin/sh
     + 
     + test_description='basic clone options'
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t5606-clone-options.sh: test_expect_success 'setup' '
       test_expect_success 'clone -o' '
       
     @@ t/t5606-clone-options.sh: test_expect_success 'prefers config "clone.defaultRemo
       
      
       ## t/t5607-clone-bundle.sh ##
     +@@
     + #!/bin/sh
     + 
     + test_description='some bundle related tests'
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t5607-clone-bundle.sh: test_expect_success 'setup' '
       '
       
     @@ t/t5608-clone-2gb.sh: test_expect_success 'setup' '
       	 echo "data 5" &&
      
       ## t/t5609-clone-branch.sh ##
     +@@
     + #!/bin/sh
     + 
     + test_description='clone --branch option'
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t5609-clone-branch.sh: test_expect_success 'setup' '
       	 echo one >file && git add file && git commit -m one &&
       	 git checkout -b two &&
     @@ t/t5609-clone-branch.sh: test_expect_success 'clone -b sets up tracking' '
       	)
      
       ## t/t5610-clone-detached.sh ##
     +@@
     + #!/bin/sh
     + 
     + test_description='test cloning a repository with detached HEAD'
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t5610-clone-detached.sh: test_expect_success 'setup' '
       '
       
     @@ t/t5610-clone-detached.sh: test_expect_success 'cloned HEAD is detached' '
       	git clone "file://$PWD" detached-orphan
      
       ## t/t5611-clone-config.sh ##
     +@@
     + #!/bin/sh
     + 
     + test_description='tests for git clone -c key=value'
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t5611-clone-config.sh: test_expect_success 'clone -c config is available during clone' '
       
       test_expect_success 'clone -c remote.origin.fetch=<refspec> works' '
     @@ t/t5611-clone-config.sh: test_expect_success 'clone -c remote.<remote>.fetch=<re
       '
      
       ## t/t5612-clone-refspec.sh ##
     -@@ t/t5612-clone-refspec.sh: test_description='test refspec written by clone-command'
     +@@
     + #!/bin/sh
     + 
     + test_description='test refspec written by clone-command'
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
       . ./test-lib.sh
       
       test_expect_success 'setup' '
     @@ t/t5614-clone-submodules-shallow.sh: test_description='Test shallow cloning of r
       	mkdir sub &&
      
       ## t/t5616-partial-clone.sh ##
     +@@
     + 
     + test_description='git partial clone'
     + 
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t5616-partial-clone.sh: test_expect_success 'verify that .promisor file contains refs fetched' '
       	test_line_count = 1 promisorlist &&
       	git -C srv.bare rev-parse --verify HEAD >headhash &&
     @@ t/t5616-partial-clone.sh: test_expect_success 'fetch lazy-fetches only to resolv
       	grep "fetch< version 2" trace &&
      
       ## t/t5617-clone-submodules-remote.sh ##
     -@@ t/t5617-clone-submodules-remote.sh: test_description='Test cloning repos with submodules using remote-tracking branc
     +@@
     + 
     + test_description='Test cloning repos with submodules using remote-tracking branches'
     + 
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
     +@@ t/t5617-clone-submodules-remote.sh: export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
       pwd=$(pwd)
       
       test_expect_success 'setup' '
     @@ t/t5617-clone-submodules-remote.sh: test_expect_success 'clone with --single-bra
       '
      
       ## t/t5700-protocol-v1.sh ##
     +@@ t/t5700-protocol-v1.sh: TEST_NO_CREATE_REPO=1
     + GIT_TEST_PROTOCOL_VERSION=0
     + export GIT_TEST_PROTOCOL_VERSION
     + 
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t5700-protocol-v1.sh: test_expect_success 'fetch with git:// using protocol v1' '
       	GIT_TRACE_PACKET=1 git -C daemon_child -c protocol.version=1 \
       		fetch 2>log &&
     @@ t/t5700-protocol-v1.sh: test_expect_success 'push with http:// using protocol v1
       
      
       ## t/t5701-git-serve.sh ##
     +@@
     + 
     + test_description='test protocol v2 server commands'
     + 
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t5701-git-serve.sh: test_expect_success 'wrong object-format' '
       #
       test_expect_success 'setup some refs and tags' '
     @@ t/t5701-git-serve.sh: test_expect_success 'symrefs parameter' '
       
      
       ## t/t5702-protocol-v2.sh ##
     +@@ t/t5702-protocol-v2.sh: test_description='test git wire-protocol version 2'
     + 
     + TEST_NO_CREATE_REPO=1
     + 
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t5702-protocol-v2.sh: test_expect_success 'ref advertisement is filtered with ls-remote using protocol
       	test_when_finished "rm -f log" &&
       
     @@ t/t5702-protocol-v2.sh: test_expect_success 'push with http:// and a config of v
       
      
       ## t/t5703-upload-pack-ref-in-want.sh ##
     +@@
     + 
     + test_description='upload-pack ref-in-want'
     + 
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t5703-upload-pack-ref-in-want.sh: write_command () {
       
       # c(o/foo) d(o/bar)
     @@ t/t5703-upload-pack-ref-in-want.sh: test_expect_success 'server is initially beh
       
      
       ## t/t5801-remote-helpers.sh ##
     +@@
     + 
     + test_description='Test remote-helper import and export commands'
     + 
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t5801-remote-helpers.sh: test_expect_success 'fetch multiple branches' '
       	(cd local &&
       	 git fetch
     @@ t/t5801-remote-helpers.sh: test_expect_success 'fetch HEAD' '
       	echo more >>file &&
       	git commit -a -m more
       	) &&
     -
     - ## t/test-lib.sh ##
     -@@ t/test-lib.sh: case "$TEST_NUMBER" in
     - 	GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     - 	export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     - 	;;
     --[0-4]*|5[0-5]*)
     -+[0-5]*)
     - 	GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     - 	export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     - 	;;
 17:  27d7994933 ! 18:  dfbc93923b t6[0-3]*: adjust the references to the default branch name "main"
     @@ Commit message
          Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
      
       ## t/t6000-rev-list-misc.sh ##
     +@@
     + 
     + test_description='miscellaneous rev-list tests'
     + 
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t6000-rev-list-misc.sh: test_expect_success 'propagate uninteresting flag down correctly' '
       '
       
     @@ t/t6000-rev-list-misc.sh: test_expect_success 'propagate uninteresting flag down
       	< that
      
       ## t/t6001-rev-list-graft.sh ##
     +@@
     + 
     + test_description='Revision traversal vs grafts and path limiter'
     + 
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t6001-rev-list-graft.sh: test_expect_success setup '
       	git commit -a -m "Third in one history." &&
       	A2=$(git rev-parse --verify HEAD) &&
     @@ t/t6004-rev-list-path-optim.sh: test_description='git rev-list trivial path opti
         /                        /
        o---------o----o----o----o side
        a0        c0   c1   a1   c2
     +@@ t/t6004-rev-list-path-optim.sh: test_description='git rev-list trivial path optimization test
     + 
     + '
     + 
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t6004-rev-list-path-optim.sh: test_expect_success 'further setup' '
       	git add c &&
       	test_tick &&
     @@ t/t6004-rev-list-path-optim.sh: test_expect_success 'path optimization 2' '
       '
      
       ## t/t6006-rev-list-format.sh ##
     +@@
     + 
     + test_description='git rev-list --pretty=format test'
     + 
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t6006-rev-list-format.sh: test_expect_success 'setup' '
       test_format () {
       	cat >expect.$1
     @@ t/t6006-rev-list-format.sh: test_expect_success '"%h %gD: %gs" is same as git-re
       
      
       ## t/t6007-rev-list-cherry-pick-file.sh ##
     +@@
     + 
     + test_description='test git rev-list --cherry-pick -- file'
     + 
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t6007-rev-list-cherry-pick-file.sh: test_expect_success setup '
       	test_tick &&
       	git commit -m "E" &&
     @@ t/t6007-rev-list-cherry-pick-file.sh: test_expect_success '--cherry-pick with in
       cat >expect <<EOF
      
       ## t/t6008-rev-list-submodule.sh ##
     +@@
     + 
     + test_description='git rev-list involving submodules that this repo has'
     + 
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t6008-rev-list-submodule.sh: test_expect_success 'setup' '
       '
       
     @@ t/t6008-rev-list-submodule.sh: test_expect_success 'setup' '
       test_done
      
       ## t/t6009-rev-list-parent.sh ##
     +@@
     + 
     + test_description='ancestor culling and limiting by parent number'
     + 
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t6009-rev-list-parent.sh: test_expect_success 'setup roots, merges and octopuses' '
       	test_commit seven &&
       	git checkout -b yetanotherbranch four &&
     @@ t/t6009-rev-list-parent.sh: test_expect_success 'dodecapus' '
       	git tag dodecapus &&
      
       ## t/t6012-rev-list-simplify.sh ##
     +@@
     + 
     + test_description='merge simplification'
     + 
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t6012-rev-list-simplify.sh: test_expect_success setup '
       	git add side &&
       	test_tick && git commit -m "Side root" &&
     @@ t/t6012-rev-list-simplify.sh: test_expect_success setup '
       
      
       ## t/t6013-rev-list-reverse-parents.sh ##
     +@@
     + 
     + test_description='--reverse combines with --parents'
     + 
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t6013-rev-list-reverse-parents.sh: test_expect_success 'set up --reverse example' '
       	commit two &&
       	git checkout -b side HEAD^ &&
     @@ t/t6013-rev-list-reverse-parents.sh: test_expect_success 'set up --reverse examp
       
      
       ## t/t6016-rev-list-graph-simplify-history.sh ##
     +@@
     + 
     + test_description='--graph and simplified history'
     + 
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t6016-rev-list-graph-simplify-history.sh: test_expect_success 'set up rev-list --graph test' '
       	test_commit A1 foo.txt &&
       	test_commit A2 bar.txt &&
     @@ t/t6016-rev-list-graph-simplify-history.sh: test_expect_success 'set up rev-list
       	git checkout -b B A1 &&
      
       ## t/t6017-rev-list-stdin.sh ##
     +@@
     + 
     + test_description='log family learns --stdin'
     + 
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t6017-rev-list-stdin.sh: test_expect_success setup '
       		done &&
       		for i in $them
     @@ t/t6017-rev-list-stdin.sh: test_expect_success 'not only --stdin' '
       '
      
       ## t/t6018-rev-list-glob.sh ##
     +@@
     + 
     + test_description='rev-list/rev-parse --glob'
     + 
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t6018-rev-list-glob.sh: compare () {
       
       test_expect_success 'setup' '
     @@ t/t6018-rev-list-glob.sh: test_expect_success 'shortlog accepts --glob/--tags/--
       
      
       ## t/t6019-rev-list-ancestry-path.sh ##
     +@@ t/t6019-rev-list-ancestry-path.sh: test_description='--ancestry-path'
     + #  --ancestry-path G..M -- G.t == L
     + #  --ancestry-path --simplify-merges G^..M -- G.t == G L
     + 
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t6019-rev-list-ancestry-path.sh: test_expect_success 'setup criss-cross' '
       	(cd criss-cross &&
       	 git init &&
     @@ t/t6019-rev-list-ancestry-path.sh: test_expect_success 'setup criss-cross' '
       # no commits in bc descend from cb
      
       ## t/t6030-bisect-porcelain.sh ##
     +@@ t/t6030-bisect-porcelain.sh: test_description='Tests git bisect functionality'
     + 
     + exec </dev/null
     + 
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t6030-bisect-porcelain.sh: test_expect_success 'bisect start without -- takes unknown arg as pathspec' '
       	grep bar ".git/BISECT_NAMES"
       '
     @@ t/t6030-bisect-porcelain.sh: test_expect_success 'bisect: --no-checkout - target
       		git rev-list --objects BISECT_HEAD --not \$GOOD >tmp.\$\$ &&
      
       ## t/t6040-tracking-info.sh ##
     +@@
     + 
     + test_description='remote tracking stats'
     + 
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t6040-tracking-info.sh: test_expect_success setup '
       		git branch -d brokenbase &&
       		git checkout -b b6 origin
     @@ t/t6040-tracking-info.sh: test_expect_success '--set-upstream-to @{-1}' '
       '
      
       ## t/t6050-replace.sh ##
     +@@
     + #
     + test_description='Tests replace refs functionality'
     + 
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t6050-replace.sh: test_expect_success 'tag replaced commit' '
       '
       
     @@ t/t6050-replace.sh: test_expect_success GPG 'set up a merge commit with a merget
       	git cat-file commit $HASH10 | grep "^mergetag object"
      
       ## t/t6101-rev-parse-parents.sh ##
     +@@
     + 
     + test_description='Test git rev-parse with different parent options'
     + 
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t6101-rev-parse-parents.sh: test_expect_success 'setup' '
       	test_commit second &&
       	git checkout --orphan tmp &&
     @@ t/t6101-rev-parse-parents.sh: test_expect_success 'setup' '
       
      
       ## t/t6110-rev-list-sparse.sh ##
     +@@
     + #!/bin/sh
     + 
     + test_description='operations that cull histories in unusual ways'
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t6110-rev-list-sparse.sh: test_expect_success setup '
       	git checkout -b side HEAD^ &&
       	test_commit D &&
     @@ t/t6110-rev-list-sparse.sh: test_expect_success setup '
       test_expect_success 'rev-list --first-parent --boundary' '
      
       ## t/t6111-rev-list-treesame.sh ##
     +@@
     + 
     + test_description='TREESAME and limiting'
     + 
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t6111-rev-list-treesame.sh: test_expect_success setup '
       	git checkout other-branch &&
       	test_commit "Added other" other "Hello" C &&
     @@ t/t6111-rev-list-treesame.sh: test_expect_success setup '
       
      
       ## t/t6112-rev-list-filters-objects.sh ##
     +@@
     + 
     + test_description='git rev-list using object filtering'
     + 
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t6112-rev-list-filters-objects.sh: test_expect_success 'verify sparse:oid=oid-ish omits top-level files' '
       	sort >expected &&
       
     @@ t/t6112-rev-list-filters-objects.sh: test_expect_success 'combine:... with more
       
      
       ## t/t6120-describe.sh ##
     +@@ t/t6120-describe.sh: test_description='test describe'
     + #
     + # First parent of a merge commit is on the same line, second parent below.
     + 
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t6120-describe.sh: check_describe c-* --tags HEAD^^2
       check_describe B --tags HEAD^^2^
       check_describe e --tags HEAD^^^
     @@ t/t6120-describe.sh: test_expect_success 'describe commits with disjoint bases 2
       	)
      
       ## t/t6200-fmt-merge-msg.sh ##
     +@@
     + 
     + test_description='fmt-merge-msg test'
     + 
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t6200-fmt-merge-msg.sh: test_expect_success GPG 'set up a signed tag' '
       test_expect_success 'message for merging local branch' '
       	echo "Merge branch ${apos}left${apos}" >expected &&
     @@ t/t6200-fmt-merge-msg.sh: test_expect_success 'merge-msg with "merging" an annot
       test_done
      
       ## t/t6302-for-each-ref-filter.sh ##
     +@@
     + 
     + test_description='test for-each-refs usage of ref-filter APIs'
     + 
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t6302-for-each-ref-filter.sh: test_expect_success 'setup some history and refs' '
       	git tag $sign -m "A signed tag" signed-tag &&
       	git tag $sign -m "Signed doubly" doubly-signed-tag signed-tag &&
     @@ t/t6302-for-each-ref-filter.sh: test_expect_success '--merged is compatible with
       	git for-each-ref --format="%(refname:short): %(if)%(worktreepath)%(then)%(worktreepath)%(else)not checked out%(end)" refs/heads/ >actual &&
       	rm -r worktree_dir &&
       	git worktree prune &&
     -
     - ## t/test-lib.sh ##
     -@@ t/test-lib.sh: case "$TRASH_DIRECTORY" in
     - esac
     - 
     - case "$TEST_NUMBER" in
     --3404|4013|5310|5526)
     -+3404|4013|5310|5526|6300)
     - 	# Avoid conflicts with patch series that are cooking at the same time
     - 	# as the patch series changing the default of `init.defaultBranch`.
     - 	GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     - 	export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     - 	;;
     --[0-5]*)
     -+[0-5]*|6[0-3]*)
     - 	GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     - 	export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     - 	;;
 18:  04878e2268 = 19:  0a4bc77dac t64*: preemptively adjust alignment to prepare for `master` -> `main`
 19:  f0fa12b577 ! 20:  3dbc83c6a1 t6[4-9]*: adjust the references to the default branch name "main"
     @@ Commit message
          Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
      
       ## t/t6400-merge-df.sh ##
     +@@
     + #
     + 
     + test_description='Test merge with directory/file conflicts'
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t6400-merge-df.sh: test_expect_success 'prepare repository' '
       '
       
     @@ t/t6400-merge-df.sh: test_expect_success 'F/D conflict' '
       test_expect_success 'setup modify/delete + directory/file conflict' '
      
       ## t/t6402-merge-rename.sh ##
     +@@
     + #!/bin/sh
     + 
     + test_description='Merge-recursive merging renames'
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t6402-merge-rename.sh: test_expect_success 'setup' '
       	git branch change &&
       	git branch change+rename &&
     @@ t/t6402-merge-rename.sh: test_expect_success 'setup spurious "refusing to lose u
       '
      
       ## t/t6404-recursive-merge.sh ##
     +@@
     + #!/bin/sh
     + 
     + test_description='Test merge without common ancestors'
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t6404-recursive-merge.sh: test_expect_success 'setup tests' '
       	git add a1 &&
       	GIT_AUTHOR_DATE="2006-12-12 23:00:00" git commit -m 1 a1 &&
     @@ t/t6404-recursive-merge.sh: test_expect_success 'setup tests' '
       
      
       ## t/t6405-merge-symlinks.sh ##
     +@@ t/t6405-merge-symlinks.sh: test_description='merging symlinks on filesystem w/o symlink support.
     + This tests that git merge-recursive writes merge results as plain files
     + if core.symlinks is false.'
     + 
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t6405-merge-symlinks.sh: test_expect_success 'setup' '
       	git branch b-file &&
       	l=$(printf file | git hash-object -t blob -w --stdin) &&
     @@ t/t6405-merge-symlinks.sh: test_expect_success 'setup' '
       
      
       ## t/t6406-merge-attr.sh ##
     +@@
     + 
     + test_description='per path merge controlled by merge attribute'
     + 
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t6406-merge-attr.sh: test_expect_success setup '
       	git branch side &&
       	for f in text binary union
     @@ t/t6406-merge-attr.sh: test_expect_success 'custom merge does not lock index' '
       test_done
      
       ## t/t6407-merge-binary.sh ##
     +@@
     + 
     + test_description='ask merge-recursive to merge binary files'
     + 
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t6407-merge-binary.sh: test_expect_success setup '
       	git ls-files -s a >E0 &&
       	git ls-files -s m | sed -e "s/ 0	/ 3	/" >E3 &&
     @@ t/t6407-merge-binary.sh: test_expect_success recursive '
       		false
      
       ## t/t6409-merge-subtree.sh ##
     +@@
     + 
     + test_description='subtree merge strategy'
     + 
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t6409-merge-subtree.sh: test_expect_success setup '
       	echo >>hello world &&
       	git add hello &&
     @@ t/t6409-merge-subtree.sh: test_expect_success 'merge update' '
       	git ls-files -s >actual &&
      
       ## t/t6411-merge-filemode.sh ##
     +@@
     + #!/bin/sh
     + 
     + test_description='merge: handle file mode'
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t6411-merge-filemode.sh: test_expect_success 'set up mode change in one branch' '
       	: >file1 &&
       	git add file1 &&
     @@ t/t6411-merge-filemode.sh: do_both_modes resolve
       '
      
       ## t/t6412-merge-large-rename.sh ##
     +@@
     + #!/bin/sh
     + 
     + test_description='merging with large rename matrix'
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t6412-merge-large-rename.sh: test_rename() {
       	test_expect_success "rename ($1, $2)" '
       	n='$1' &&
     @@ t/t6412-merge-large-rename.sh: test_rename() {
       }
      
       ## t/t6413-merge-crlf.sh ##
     +@@ t/t6413-merge-crlf.sh: test_description='merge conflict in crlf repo
     + 
     + '
     + 
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t6413-merge-crlf.sh: test_expect_success setup '
       	echo line from b | append_cr >file &&
       	git commit -m "add line from b" file &&
     @@ t/t6413-merge-crlf.sh: test_expect_success setup '
       test_expect_success 'Check "ours" is CRLF' '
      
       ## t/t6414-merge-rename-nocruft.sh ##
     +@@
     + #!/bin/sh
     + 
     + test_description='Merge-recursive merging renames'
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t6414-merge-rename-nocruft.sh: test_expect_success 'setup' '
       	git update-index A &&
       	git commit -m "blue modify A" &&
     @@ t/t6414-merge-rename-nocruft.sh: test_expect_success 'setup' '
       # This test broke in 65ac6e9c3f47807cb603af07a6a9e1a43bc119ae
      
       ## t/t6415-merge-dir-to-symlink.sh ##
     +@@
     + #!/bin/sh
     + 
     + test_description='merging when a directory was replaced with a symlink'
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t6415-merge-dir-to-symlink.sh: test_expect_success 'create a commit where dir a/b changed to symlink' '
       
       test_expect_success 'checkout does not clobber untracked symlink' '
     @@ t/t6415-merge-dir-to-symlink.sh: test_expect_success 'do not lose modifications
       test_expect_success 'setup a merge where dir a/b-2 changed to symlink' '
      
       ## t/t6416-recursive-corner-cases.sh ##
     +@@
     + 
     + test_description='recursive merge corner cases involving criss-cross merges'
     + 
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t6416-recursive-corner-cases.sh: test_expect_success 'git detects conflict merging criss-cross+modify/delete' '
       		test_line_count = 2 out &&
       
     @@ t/t6416-recursive-corner-cases.sh: test_expect_success 'check virtual merge base
       			base        \
      
       ## t/t6417-merge-ours-theirs.sh ##
     +@@
     + #!/bin/sh
     + 
     + test_description='Merge-recursive ours and theirs variants'
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t6417-merge-ours-theirs.sh: test_expect_success setup '
       	sed -e "s/9/nueve/" >file <elif &&
       	git commit -a -m theirs &&
     @@ t/t6418-merge-text-auto.sh
       *+ [side^] Initial
       '
       
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t6418-merge-text-auto.sh: test_expect_success setup '
       	git commit -m "add line from b" &&
       	git tag b &&
     @@ t/t6418-merge-text-auto.sh: test_expect_success 'Test delete/normalize conflict'
       	test_path_is_missing file
      
       ## t/t6419-merge-ignorecase.sh ##
     +@@
     + 
     + test_description='git-merge with case-changing rename on case-insensitive file system'
     + 
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t6419-merge-ignorecase.sh: test_expect_success 'merge with case-changing rename' '
       	>foo &&
       	git add foo &&
     @@ t/t6419-merge-ignorecase.sh: test_expect_success 'merge with case-changing renam
       
      
       ## t/t6422-merge-rename-corner-cases.sh ##
     +@@
     + test_description="recursive merge corner cases w/ renames but not criss-crosses"
     + # t6036 has corner cases that involve both criss-cross merges and renames
     + 
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t6422-merge-rename-corner-cases.sh: test_conflicts_with_adds_and_renames() {
       	# Setup:
       	#          L
     @@ t/t6422-merge-rename-corner-cases.sh: test_expect_success 'check nested conflict
       		test_must_fail git merge-file    \
      
       ## t/t6425-merge-rename-delete.sh ##
     +@@
     + #!/bin/sh
     + 
     + test_description='Merge-recursive rename/delete conflict message'
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t6425-merge-rename-delete.sh: test_expect_success 'rename/delete' '
       	git mv A B &&
       	git commit -m "rename" &&
     @@ t/t6425-merge-rename-delete.sh: test_expect_success 'rename/delete' '
       
      
       ## t/t6427-diff3-conflict-markers.sh ##
     +@@
     + 
     + test_description='recursive merge diff3 style conflict markers'
     + 
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t6427-diff3-conflict-markers.sh: test_expect_success 'check no merge base' '
       # Setup:
       #          L1
     @@ t/t6427-diff3-conflict-markers.sh: test_expect_success 'rebase --apply describes
       '
      
       ## t/t6430-merge-recursive.sh ##
     +@@
     + 
     + test_description='merge-recursive backend test'
     + 
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t6430-merge-recursive.sh: test_expect_success 'setup 1' '
       	git add a d/e &&
       
     @@ t/t6432-merge-recursive-space-options.sh
       *+ [remote^] Initial revision
       *   ok 1: setup
       '
     + 
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t6432-merge-recursive-space-options.sh: test_expect_success 'setup' '
       	mv text.txt+ text.txt &&
       	git commit -a -m "Remove cruft" &&
     @@ t/t6432-merge-recursive-space-options.sh: test_expect_success 'setup' '
       			s/Quite correct\(.*\)/It is too correct\1Q/
      
       ## t/t6433-merge-toplevel.sh ##
     -@@ t/t6433-merge-toplevel.sh: test_description='"git merge" top-level frontend'
     +@@
     + 
     + test_description='"git merge" top-level frontend'
     + 
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
       . ./test-lib.sh
       
       t3033_reset () {
     @@ t/t6434-merge-recursive-rename-options.sh: test_description='merge-recursive ren
       D	0-old
       D	1-old
       D	2-old
     +@@ t/t6434-merge-recursive-rename-options.sh: they are rounded down (see, e.g., Documentation/diff-generate-patch.txt, which
     + mentions this in a different context).
     + '
     + 
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t6434-merge-recursive-rename-options.sh: test_expect_success 'setup repo' '
       	get_expected_stages 2 &&
       	get_expected_stages 3 &&
     @@ t/t6434-merge-recursive-rename-options.sh: test_expect_success 'setup repo' '
       test_expect_success 'setup thresholds' '
      
       ## t/t6436-merge-overwrite.sh ##
     +@@ t/t6436-merge-overwrite.sh: test_description='git-merge
     + 
     + Do not overwrite changes.'
     + 
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t6436-merge-overwrite.sh: test_expect_success 'set up unborn branch and content' '
       '
       
     @@ t/t6436-merge-overwrite.sh: test_expect_success 'set up unborn branch and conten
       	grep foo expect &&
      
       ## t/t6437-submodule-merge.sh ##
     +@@
     + 
     + test_description='merging with submodules'
     + 
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t6437-submodule-merge.sh: test_expect_success setup '
       	test_tick &&
       	git commit -m root &&
     @@ t/t6437-submodule-merge.sh: test_expect_success 'setup for recursive merge with
       	 git commit -m c &&
      
       ## t/t6439-merge-co-error-msgs.sh ##
     +@@
     + 
     + test_description='unpack-trees error messages'
     + 
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t6439-merge-co-error-msgs.sh: test_expect_success 'setup' '
       	git add two three four five &&
       	git commit -m Second &&
     @@ t/t6439-merge-co-error-msgs.sh: test_expect_success 'not_uptodate_dir porcelain
       	test_must_fail git checkout branch 2>out &&
      
       ## t/t6501-freshen-objects.sh ##
     +@@
     + #      to refer to an existing tree).
     + 
     + test_description='check pruning of dependent objects'
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t6501-freshen-objects.sh: for repack in '' true; do
       		git checkout -b experiment &&
       		commit abandon &&
     @@ t/t6501-freshen-objects.sh: for repack in '' true; do
       		git branch -D experiment
       	'
       
     -
     - ## t/test-lib.sh ##
     -@@ t/test-lib.sh: case "$TEST_NUMBER" in
     - 	GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     - 	export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     - 	;;
     --[0-5]*|6[0-3]*)
     -+[0-6]*)
     - 	GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     - 	export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     - 	;;
 20:  f9c30dc516 ! 21:  2315a253f6 t7[0-4]*: adjust the references to the default branch name "main"
     @@ Commit message
          Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
      
       ## t/t7003-filter-branch.sh ##
     +@@
     + #!/bin/sh
     + 
     + test_description='git filter-branch'
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t7003-filter-branch.sh: test_expect_success 'setup' '
       	mkdir dir &&
       	test_commit dir/D &&
     @@ t/t7003-filter-branch.sh: test_expect_success 'automatic remapping to ancestor w
       
      
       ## t/t7004-tag.sh ##
     +@@ t/t7004-tag.sh: test_description='git tag
     + 
     + Tests for operations with tags.'
     + 
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t7004-tag.sh: test_expect_success 'checking that branch head with --no-contains lists all but
       "
       
     @@ t/t7004-tag.sh: test_expect_success ULIMIT_STACK_SIZE '--contains and --no-conta
       	test_must_be_empty actual &&
      
       ## t/t7030-verify-tag.sh ##
     +@@
     + #!/bin/sh
     + 
     + test_description='signed tag tests'
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t7030-verify-tag.sh: test_expect_success GPG 'create signed tags' '
       	echo 3 >elif && git add elif &&
       	test_tick && git commit -m "third on side" &&
     @@ t/t7030-verify-tag.sh: test_expect_success GPG 'create signed tags' '
       
      
       ## t/t7060-wtstatus.sh ##
     +@@
     + 
     + test_description='basic work tree status reporting'
     + 
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t7060-wtstatus.sh: EOF
       		git checkout -b side HEAD^ &&
       		git rm foo &&
     @@ t/t7060-wtstatus.sh: test_expect_success 'status --branch with detached HEAD' '
       	## HEAD (no branch)
      
       ## t/t7063-status-untracked-cache.sh ##
     +@@
     + 
     + test_description='test untracked cache'
     + 
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t7063-status-untracked-cache.sh: EOF
       test_expect_success 'set up sparse checkout' '
       	echo "done/[a-z]*" >.git/info/sparse-checkout &&
     @@ t/t7063-status-untracked-cache.sh: test_expect_success '"status" after file repl
       	status_is_clean
      
       ## t/t7102-reset.sh ##
     +@@ t/t7102-reset.sh: test_description='git reset
     + 
     + Documented tests for git reset'
     + 
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t7102-reset.sh: test_expect_success 'trying to do reset --soft with pending merge should fail' '
       	printf "1st line 2nd file\n2nd line 2nd file\n3rd line" >secondfile &&
       	git commit -a -m "the change in branch2" &&
     @@ t/t7102-reset.sh: test_expect_success '--hard reset to ORIG_HEAD should clear a
       '
      
       ## t/t7113-post-index-change-hook.sh ##
     +@@
     + 
     + test_description='post index change hook'
     + 
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t7113-post-index-change-hook.sh: test_expect_success 'test checkout and reset trigger the hook' '
       	EOF
       	: force index to be dirty &&
     @@ t/t7201-co.sh: Test switching across them.
       
       '
       
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t7201-co.sh: test_expect_success setup '
       	fill a b c d e f >two &&
       	git commit -a -m "Renamer R one->uno, M two" &&
     @@ t/t7201-co.sh: test_expect_success 'checkout --conflict=diff3' '
       	! grep "^Previous HEAD" error.log
      
       ## t/t7400-submodule-basic.sh ##
     +@@ t/t7400-submodule-basic.sh: This test tries to verify basic sanity of the init, update and status
     + subcommands of git submodule.
     + '
     + 
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t7400-submodule-basic.sh: inspect() {
       }
       
     @@ t/t7400-submodule-basic.sh: test_expect_success 'apply submodule diff' '
       
      
       ## t/t7403-submodule-sync.sh ##
     +@@ t/t7403-submodule-sync.sh: test_description='git submodule sync
     + These tests exercise the "git submodule sync" subcommand.
     + '
     + 
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t7403-submodule-sync.sh: test_expect_success 'change submodule url' '
       	(
       		cd super &&
     @@ t/t7403-submodule-sync.sh: test_expect_success '"git submodule sync --recursive"
       '
      
       ## t/t7406-submodule-update.sh ##
     -@@ t/t7406-submodule-update.sh: submodule and "git submodule update --rebase/--merge" does not detach the HEAD.
     +@@ t/t7406-submodule-update.sh: This test verifies that "git submodule update" detaches the HEAD of the
     + submodule and "git submodule update --rebase/--merge" does not detach the HEAD.
     + '
     + 
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
     +@@ t/t7406-submodule-update.sh: export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
       
       compare_head()
       {
     @@ t/t7406-submodule-update.sh: test_expect_success 'submodule update places git-di
       	)
      
       ## t/t7407-submodule-foreach.sh ##
     +@@ t/t7407-submodule-foreach.sh: This test verifies that "git submodule foreach" correctly visits all submodules
     + that are currently checked out.
     + '
     + 
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t7407-submodule-foreach.sh: sub1sha1_short=$(cd clone3/sub1 && git rev-parse --short HEAD)
       sub2sha1_short=$(cd clone3/sub2 && git rev-parse --short HEAD)
       
     @@ t/t7407-submodule-foreach.sh: test_expect_success 'ensure "status --cached --rec
       test_expect_success 'test "status --recursive" from sub directory' '
      
       ## t/t7409-submodule-detached-work-tree.sh ##
     +@@ t/t7409-submodule-detached-work-tree.sh: on detached working trees
     + '
     + 
     + TEST_NO_CREATE_REPO=1
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t7409-submodule-detached-work-tree.sh: test_expect_success 'submodule on detached working tree' '
       			git rev-parse --verify HEAD >actual &&
       			test_cmp ../../../../expect actual
     @@ t/t7409-submodule-detached-work-tree.sh: test_expect_success 'submodule on detac
       		cd home &&
      
       ## t/t7417-submodule-path-url.sh ##
     +@@
     + #!/bin/sh
     + 
     + test_description='check handling of .gitmodule path with dash'
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t7417-submodule-path-url.sh: test_expect_success MINGW 'submodule paths disallows trailing spaces' '
       	sed "s/sub/sub /" <tree >tree.new &&
       	tree=$(git -C super mktree <tree.new) &&
     @@ t/t7417-submodule-path-url.sh: test_expect_success MINGW 'submodule paths disall
       
       	test_must_fail git clone --recurse-submodules super dst 2>err &&
       	test_i18ngrep "sub " err
     -
     - ## t/test-lib.sh ##
     -@@ t/test-lib.sh: case "$TRASH_DIRECTORY" in
     - esac
     - 
     - case "$TEST_NUMBER" in
     --3404|4013|5310|5526|6300)
     -+3404|4013|5310|5526|6300|7064)
     - 	# Avoid conflicts with patch series that are cooking at the same time
     - 	# as the patch series changing the default of `init.defaultBranch`.
     - 	GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     - 	export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     - 	;;
     --[0-6]*)
     -+[0-6]*|7[0-4]*)
     - 	GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     - 	export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     - 	;;
 21:  2b269ca983 ! 22:  20eef6cc97 t7[5-9]*: adjust the references to the default branch name "main"
     @@ Commit message
          Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
      
       ## t/t7501-commit-basic-functionality.sh ##
     +@@
     + # signoff
     + 
     + test_description='git commit'
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t7501-commit-basic-functionality.sh: test_expect_success 'same tree (merge and amend merge)' '
       	echo zero >zero &&
       	git add zero &&
     @@ t/t7501-commit-basic-functionality.sh: test_expect_success 'same tree (merge and
       	git diff HEAD^ HEAD >actual &&
      
       ## t/t7502-commit-porcelain.sh ##
     +@@
     + 
     + test_description='git commit porcelain-ish'
     + 
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t7502-commit-porcelain.sh: test_expect_success 'output summary format for merges' '
       
       output_tests_cleanup() {
     @@ t/t7502-commit-porcelain.sh: git reset -q --hard
       	sed -n -e "s/^parent //p" -e "/^$/q" raw >actual &&
      
       ## t/t7503-pre-commit-and-pre-merge-commit-hooks.sh ##
     +@@
     + 
     + test_description='pre-commit and pre-merge-commit hooks'
     + 
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t7503-pre-commit-and-pre-merge-commit-hooks.sh: test_expect_success 'root commit' '
       	git add foo &&
       	git commit -m "make it non-ff" &&
     @@ t/t7503-pre-commit-and-pre-merge-commit-hooks.sh: test_expect_success POSIXPERM
       
      
       ## t/t7504-commit-msg-hook.sh ##
     +@@
     + 
     + test_description='commit-msg hook'
     + 
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t7504-commit-msg-hook.sh: test_expect_success '--no-verify with failing hook (editor)' '
       test_expect_success 'merge fails with failing hook' '
       
     @@ t/t7504-commit-msg-hook.sh: test_expect_success "hook doesn't edit commit messag
       	git add file2 &&
      
       ## t/t7505-prepare-commit-msg-hook.sh ##
     +@@
     + 
     + test_description='prepare-commit-msg hook'
     + 
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t7505-prepare-commit-msg-hook.sh: test_expect_success 'set up commits for rebasing' '
       	do
       		test_commit rebase-$i c $i
     @@ t/t7508-status.sh: test_expect_success 'git commit --dry-run will show a staged
         (use "git pull" to merge the remote branch into yours)
      
       ## t/t7510-signed-commit.sh ##
     +@@
     + #!/bin/sh
     + 
     + test_description='signed commit tests'
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t7510-signed-commit.sh: test_expect_success GPG 'create signed commits' '
       	echo 3 >elif && git add elif &&
       	test_tick && git commit -m "third on side" &&
     @@ t/t7510-signed-commit.sh: test_expect_success GPG 'create signed commits' '
       
      
       ## t/t7512-status-help.sh ##
     +@@
     + 
     + test_description='git status advice'
     + 
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t7512-status-help.sh: test_expect_success 'prepare for conflicts' '
       	git config --global advice.statusuoption false &&
       	test_commit init main.txt init &&
     @@ t/t7512-status-help.sh: EOF
       	test_commit two_commit main.txt two &&
      
       ## t/t7517-per-repo-email.sh ##
     +@@
     + 
     + test_description='per-repo forced setting of email address'
     + 
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t7517-per-repo-email.sh: test_expect_success 'set up rebase scenarios' '
       
       test_expect_success 'fast-forward rebase does not care about ident' '
     @@ t/t7600-merge.sh: Testing basic merge operations/option parsing.
        +     * [c1] commit 1
             +  [c6] c6
            +   [c5] c5
     +@@ t/t7600-merge.sh: Testing basic merge operations/option parsing.
     + +++++++* [c0] commit 0
     + '
     + 
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t7600-merge.sh: test_expect_success 'merge c0 with c1 with --ff-only' '
       test_debug 'git log --graph --decorate --oneline --all'
       
     @@ t/t7606-merge-custom.sh: test_description="git merge
       * | (tag: c1) c1
      
       ## t/t7608-merge-messages.sh ##
     +@@
     + #!/bin/sh
     + 
     + test_description='test auto-generated merge messages'
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t7608-merge-messages.sh: check_oneline() {
       }
       
     @@ t/t7608-merge-messages.sh: check_oneline() {
       test_done
      
       ## t/t7610-mergetool.sh ##
     -@@ t/t7610-mergetool.sh: Testing basic merge tool invocation'
     +@@ t/t7610-mergetool.sh: test_description='git mergetool
     + 
     + Testing basic merge tool invocation'
     + 
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
       . ./test-lib.sh
       
       # All the mergetool test work by checking out a temporary branch based
     @@ t/t7611-merge-abort.sh: Set up repo with conflicting and non-conflicting branche
       #             \
       #              --- foo/barf/bazf   <-- conflict_branch
       #               \
     +@@ t/t7611-merge-abort.sh: Next, test git merge --abort with the following variables:
     + - changed/unchanged worktree after merge
     + - changed/unchanged index after merge
     + '
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t7611-merge-abort.sh: test_expect_success 'setup' '
       	git checkout -b clean_branch HEAD^ &&
       	echo bart > bar &&
     @@ t/t7611-merge-abort.sh: test_expect_success 'setup' '
       pre_merge_head="$(git rev-parse HEAD)"
      
       ## t/t7612-merge-verify-signatures.sh ##
     +@@
     + #!/bin/sh
     + 
     + test_description='merge signature verification tests'
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t7612-merge-verify-signatures.sh: test_expect_success GPG 'create signed commits' '
       	echo 3 >baz && git add baz &&
       	test_tick && git commit -SB7227189 -m "untrusted on side" &&
     @@ t/t7612-merge-verify-signatures.sh: test_expect_success GPG 'create signed commi
       test_expect_success GPG 'merge unsigned commit with verification' '
      
       ## t/t7614-merge-signoff.sh ##
     -@@ t/t7614-merge-signoff.sh: This test runs git merge --signoff and makes sure that it works.
     +@@ t/t7614-merge-signoff.sh: test_description='git merge --signoff
     + This test runs git merge --signoff and makes sure that it works.
     + '
     + 
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
     +@@ t/t7614-merge-signoff.sh: export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
       test_setup() {
       	# Expected commit message after merge --signoff
       	cat >expected-signed <<EOF &&
     @@ t/t7614-merge-signoff.sh: test_expect_success 'setup' '
       '
      
       ## t/t7701-repack-unpack-unreachable.sh ##
     +@@
     + 
     + test_description='git repack works correctly'
     + 
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t7701-repack-unpack-unreachable.sh: test_expect_success '-A with -d option leaves unreachable objects unpacked' '
       	git commit -a -m more_content &&
       	csha1=$(git rev-parse HEAD^{commit}) &&
     @@ t/t7701-repack-unpack-unreachable.sh: test_expect_success '-A with -d option lea
       	git commit -a -m even_more_content &&
      
       ## t/t7800-difftool.sh ##
     +@@ t/t7800-difftool.sh: test_description='git-difftool
     + Testing basic diff tool invocation
     + '
     + 
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t7800-difftool.sh: test_expect_success 'basic usage requires no repo' '
       	test_i18ngrep ^usage: output
       '
     @@ t/t7800-difftool.sh: run_dir_diff_test 'difftool --dir-diff with unmerged files'
       	cat >expect <<-EOF &&
      
       ## t/t7810-grep.sh ##
     +@@
     + test_description='git grep various.
     + '
     + 
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t7810-grep.sh: test_expect_success 'grep -e -- -- path' '
       '
       
     @@ t/t7810-grep.sh: test_expect_success 'grep --no-index pattern -- path' '
       	test_cmp expect actual
       '
       
     -
     - ## t/test-lib.sh ##
     -@@ t/test-lib.sh: case "$TRASH_DIRECTORY" in
     - esac
     - 
     - case "$TEST_NUMBER" in
     --3404|4013|5310|5526|6300|7064)
     -+3404|4013|5310|5526|6300|7064|7817)
     - 	# Avoid conflicts with patch series that are cooking at the same time
     - 	# as the patch series changing the default of `init.defaultBranch`.
     - 	GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     - 	export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     - 	;;
     --[0-6]*|7[0-4]*)
     -+[0-7]*)
     - 	GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     - 	export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     - 	;;
 22:  5cac0065c8 ! 23:  e37bc3c792 t8*: adjust the references to the default branch name "main"
     @@ t/annotate-tests.sh: test_expect_success 'blame --first-parent blames merge for
       test_expect_success 'setup evil merge' '
      
       ## t/t8001-annotate.sh ##
     +@@
     + #!/bin/sh
     + 
     + test_description='git annotate'
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t8001-annotate.sh: PROG='git annotate'
       . "$TEST_DIRECTORY"/annotate-tests.sh
       
     @@ t/t8001-annotate.sh: PROG='git annotate'
       	test 2 = $(grep A <authors | wc -l) &&
       	test 2 = $(grep B <authors | wc -l)
      
     + ## t/t8002-blame.sh ##
     +@@
     + #!/bin/sh
     + 
     + test_description='git blame'
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
     +
       ## t/t8003-blame-corner-cases.sh ##
     +@@
     + #!/bin/sh
     + 
     + test_description='git blame corner cases'
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t8003-blame-corner-cases.sh: test_expect_success 'blame wholesale copy and more in the index' '
       
       test_expect_success 'blame during cherry-pick with file rename conflict' '
     @@ t/t8003-blame-corner-cases.sh: test_expect_success 'blame wholesale copy and mor
       	git add rodent &&
      
       ## t/t8004-blame-with-conflicts.sh ##
     +@@
     + # Based on a test case submitted by Björn Steinbrink.
     + 
     + test_description='git blame on conflicted files'
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t8004-blame-with-conflicts.sh: test_expect_success 'setup first case' '
       	git add file2 &&
       	git commit --author "U Gly <ug@localhost>" -m ugly &&
     @@ t/t8004-blame-with-conflicts.sh: Even more" > file2 &&
       		exit 1
       	else
      
     - ## t/test-lib.sh ##
     -@@ t/test-lib.sh: case "$TEST_NUMBER" in
     - 	GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     - 	export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     - 	;;
     --[0-7]*)
     -+[0-8]*)
     - 	GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     - 	export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     - 	;;
     + ## t/t8012-blame-colors.sh ##
     +@@
     + #!/bin/sh
     + 
     + test_description='colored git blame'
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
 23:  57e90d459a ! 24:  3e81bc89a2 t9[0-4]*: adjust the references to the default branch name "main"
     @@ Commit message
          Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
      
       ## t/t9001-send-email.sh ##
     +@@
     + #!/bin/sh
     + 
     + test_description='git send-email'
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t9001-send-email.sh: test_expect_success $PREREQ '--compose-encoding adds correct MIME for subject' '
       '
       
     @@ t/t9001-send-email.sh: test_expect_success $PREREQ 'test that send-email works o
       test_expect_success $PREREQ 'test that sendmail config is rejected' '
      
       ## t/t9100-git-svn-basic.sh ##
     +@@
     + test_description='git svn basic tests'
     + GIT_SVN_LC_ALL=${LC_ALL:-$LANG}
     + 
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./lib-git-svn.sh
      @@ t/t9100-git-svn-basic.sh: test_expect_success 'dcommit $rev does not clobber current branch' '
       	test refs/heads/my-bar = $(git symbolic-ref HEAD) &&
       	git log refs/remotes/bar | grep "change 1" &&
     @@ t/t9145-git-svn-master-branch.sh
       # Copyright (c) 2009 Eric Wong
       #
      -test_description='git svn initial master branch is "trunk" if possible'
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
      +test_description='git svn initial main branch is "trunk" if possible'
     - . ./lib-git-svn.sh
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
       
     - test_expect_success 'setup test repository' '
     + . ./lib-git-svn.sh
      @@ t/t9145-git-svn-master-branch.sh: test_expect_success 'setup test repository' '
       	svn_cmd import -m b/b i "$svnrepo/branches/b"
       '
     @@ t/t9145-git-svn-master-branch.sh: test_expect_success 'setup test repository' '
       
      
       ## t/t9151-svn-mergeinfo.sh ##
     +@@
     + 
     + test_description='git-svn svn mergeinfo properties'
     + 
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./lib-git-svn.sh
      @@ t/t9151-svn-mergeinfo.sh: test_expect_success 'merging two branches in one commit is detected correctly' '
       	'
       
     @@ t/t9151-svn-mergeinfo.sh: test_expect_success 'merging two branches in one commi
       
      
       ## t/t9155-git-svn-fetch-deleted-tag.sh ##
     +@@
     + 
     + test_description='git svn fetch deleted tag'
     + 
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./lib-git-svn.sh
      @@ t/t9155-git-svn-fetch-deleted-tag.sh: test_expect_success 'fetch deleted tags from same revision with checksum error'
       	git svn fetch &&
       
     @@ t/t9155-git-svn-fetch-deleted-tag.sh: test_expect_success 'fetch deleted tags fr
       test_done
      
       ## t/t9156-git-svn-fetch-deleted-tag-2.sh ##
     +@@
     + 
     + test_description='git svn fetch deleted tag 2'
     + 
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./lib-git-svn.sh
      @@ t/t9156-git-svn-fetch-deleted-tag-2.sh: test_expect_success 'fetch deleted tags from same revision with no checksum erro
       	cd git_project &&
       	git svn fetch &&
     @@ t/t9156-git-svn-fetch-deleted-tag-2.sh: test_expect_success 'fetch deleted tags
       test_done
      
       ## t/t9163-git-svn-reset-clears-caches.sh ##
     +@@
     + #
     + 
     + test_description='git svn reset clears memoized caches'
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./lib-git-svn.sh
      @@ t/t9163-git-svn-reset-clears-caches.sh: test_expect_success 'fetch to merge-base (a)' '
       test_expect_success 'rebase looses SVN merge (m)' '
       	git svn rebase &&
     @@ t/t9163-git-svn-reset-clears-caches.sh: test_expect_success 'fetch to merge-base
       # git svn fetch creates correct history with merge commit
      
       ## t/t9169-git-svn-dcommit-crlf.sh ##
     +@@
     + #!/bin/sh
     + 
     + test_description='git svn dcommit CRLF'
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./lib-git-svn.sh
      @@ t/t9169-git-svn-dcommit-crlf.sh: test_expect_success 'setup commit repository' '
       		p=$(git rev-parse HEAD) &&
       		t=$(git write-tree) &&
     @@ t/t9169-git-svn-dcommit-crlf.sh: test_expect_success 'setup commit repository' '
       		git svn dcommit &&
      
       ## t/t9300-fast-import.sh ##
     +@@
     + #
     + 
     + test_description='test git fast-import utility'
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t9300-fast-import.sh: test_expect_success 'A: create pack from stdin' '
       	mark :4
       	data $file4_len
     @@ t/t9300-fast-import.sh: test_expect_success 'Y: rewrite submodules' '
       
      
       ## t/t9301-fast-import-notes.sh ##
     -@@ t/t9301-fast-import-notes.sh: test_description='test git fast-import of notes objects'
     +@@
     + #
     + 
     + test_description='test git fast-import of notes objects'
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
     +@@ t/t9301-fast-import-notes.sh: export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
       
       test_tick
       cat >input <<INPUT_END
     @@ t/t9302-fast-import-unpack-limit.sh: test_expect_success 'lookups after checkpoi
       		make sure from "unpacked sha1 reference" works, too
      
       ## t/t9350-fast-export.sh ##
     +@@
     + #
     + 
     + test_description='git fast-export'
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t9350-fast-export.sh: test_expect_success 'setup' '
       	git commit -m sitzt file2 &&
       	test_tick &&
     @@ t/t9350-fast-export.sh: test_expect_success 'merge commit gets exported with --i
       '
      
       ## t/t9351-fast-export-anonymize.sh ##
     +@@
     + #!/bin/sh
     + 
     + test_description='basic tests for fast-export --anonymize'
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t9351-fast-export-anonymize.sh: test_expect_success 'stream retains other as refname' '
       '
       
     @@ t/t9351-fast-export-anonymize.sh: test_expect_success 'repo has original shape a
       '
      
       ## t/t9400-git-cvsserver-server.sh ##
     +@@ t/t9400-git-cvsserver-server.sh: test_description='git-cvsserver access
     + tests read access to a git repository with the
     + cvs CLI client via git-cvsserver server'
     + 
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t9400-git-cvsserver-server.sh: test_expect_success 'setup' '
         touch secondrootfile &&
         git add secondrootfile &&
     @@ t/t9400-git-cvsserver-server.sh: test_expect_success 'cvs co -c (shows module da
       xbranch:
      
       ## t/t9401-git-cvsserver-crlf.sh ##
     +@@ t/t9401-git-cvsserver-crlf.sh: test_description='git-cvsserver -kb modes
     + tests -kb mode for binary files when accessing a git
     + repository using cvs CLI client via git-cvsserver server'
     + 
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t9401-git-cvsserver-crlf.sh: test_expect_success 'setup' '
       '
       
     @@ t/t9401-git-cvsserver-crlf.sh: test_expect_success 'update subdir of other copy
           git add multilineTxt.c &&
      
       ## t/t9402-git-cvsserver-refs.sh ##
     +@@ t/t9402-git-cvsserver-refs.sh: test_description='git-cvsserver and git refspecs
     + tests ability for git-cvsserver to switch between and compare
     + tags, branches and other git refspecs'
     + 
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./test-lib.sh
      @@ t/t9402-git-cvsserver-refs.sh: test_expect_success 'setup v1, b1' '
       
       rm -rf cvswork
     @@ t/t9402-git-cvsserver-refs.sh: test_expect_success 'setup simple b2' '
       	check_start_tree cvswork &&
       	check_file cvswork textfile.c v1 &&
       	check_file cvswork t2 v1 &&
     -
     - ## t/test-lib.sh ##
     -@@ t/test-lib.sh: case "$TEST_NUMBER" in
     - 	GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     - 	export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     - 	;;
     --[0-8]*)
     -+[0-8]*|9[0-4]*)
     - 	GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     - 	export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     - 	;;
 24:  f9e01de17f ! 25:  cda06e253d t9[5-7]*: adjust the references to the default branch name "main"
     @@ t/lib-cvs.sh: setup_cvs_test_repository () {
       	else
      
       ## t/t9500-gitweb-standalone-no-errors.sh ##
     +@@ t/t9500-gitweb-standalone-no-errors.sh: commandline, and checks that it would not write any errors
     + or warnings to log.'
     + 
     + 
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./gitweb-lib.sh
      @@ t/t9500-gitweb-standalone-no-errors.sh: test_expect_success \
       	 echo "Branch" >>b &&
       	 git add b &&
     @@ t/t9500-gitweb-standalone-no-errors.sh: test_expect_success \
       test_done
      
       ## t/t9501-gitweb-standalone-http-status.sh ##
     +@@ t/t9501-gitweb-standalone-http-status.sh: commandline, and checks that it returns the expected HTTP status
     + code and message.'
     + 
     + 
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./gitweb-lib.sh
      @@ t/t9501-gitweb-standalone-http-status.sh: test_debug 'cat gitweb.headers'
       # snapshot hash ids
       
     @@ t/t9501-gitweb-standalone-http-status.sh: test_expect_success DATE_PARSER 'modif
       test_debug 'cat gitweb.headers'
      
       ## t/t9502-gitweb-standalone-parse-output.sh ##
     +@@ t/t9502-gitweb-standalone-parse-output.sh: commandline, and checks that it produces the correct output, either
     + in the HTTP header or the actual script output.'
     + 
     + 
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./gitweb-lib.sh
      @@ t/t9502-gitweb-standalone-parse-output.sh: test_expect_success 'snapshot: HEAD' '
       '
       test_debug 'cat gitweb.headers && cat file_list'
     @@ t/t9502-gitweb-standalone-parse-output.sh: test_expect_success 'snapshot: short
       
      
       ## t/t9600-cvsimport.sh ##
     +@@
     + #!/bin/sh
     + 
     + test_description='git cvsimport basic tests'
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./lib-cvs.sh
      @@ t/t9600-cvsimport.sh: test_expect_success PERL 'no .git/cvs-revisions created by default' '
       
       '
     @@ t/t9600-cvsimport.sh: test_expect_success PERL 'no .git/cvs-revisions created by
       test_done
      
       ## t/t9601-cvsimport-vendor-branch.sh ##
     +@@
     + #       tag has been removed.
     + 
     + test_description='git cvsimport handling of vendor branches'
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./lib-cvs.sh
      @@ t/t9601-cvsimport-vendor-branch.sh: test_expect_success PERL 'import a module with a vendor branch' '
       
       '
     @@ t/t9601-cvsimport-vendor-branch.sh: test_expect_success PERL 'import a module wi
       
      
       ## t/t9602-cvsimport-branches-tags.sh ##
     +@@
     + # t9602/README.
     + 
     + test_description='git cvsimport handling of branches and tags'
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./lib-cvs.sh
      @@ t/t9602-cvsimport-branches-tags.sh: test_expect_success PERL 'import module' '
       
       '
     @@ t/t9602-cvsimport-branches-tags.sh: test_expect_success PERL 'import module' '
       
      
       ## t/t9603-cvsimport-patchsets.sh ##
     +@@
     + # bug.
     + 
     + test_description='git cvsimport testing for correct patchset estimation'
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./lib-cvs.sh
      @@ t/t9603-cvsimport-patchsets.sh: test_expect_failure PERL 'import with criss cross times on revisions' '
       	git cvsimport -p"-x" -C module-git module &&
       	(
     @@ t/t9603-cvsimport-patchsets.sh: test_expect_failure PERL 'import with criss cros
       
       	echo "Rev 5 Branch A Wed Mar 11 19:09:10 2009 +0000
       Rev 4 Branch A Wed Mar 11 19:03:52 2009 +0000" > expect-A &&
     -
     - ## t/test-lib.sh ##
     -@@ t/test-lib.sh: case "$TEST_NUMBER" in
     - 	GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     - 	export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     - 	;;
     --[0-8]*|9[0-4]*)
     -+[0-8]*|9[0-7]*)
     - 	GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     - 	export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     - 	;;
 25:  4da4b69114 ! 26:  fb8584d993 tests(git-p4): transition to the default branch name `main`
     @@ Commit message
          Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
      
       ## t/t9800-git-p4-basic.sh ##
     +@@
     + 
     + test_description='git p4 tests'
     + 
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./lib-git-p4.sh
      @@ t/t9800-git-p4-basic.sh: test_expect_success 'clone --bare should make a bare repository' '
       		git config --get --bool core.bare true &&
       		git rev-parse --verify refs/remotes/p4/master &&
     @@ t/t9800-git-p4-basic.sh: test_expect_success 'clone --bare should make a bare re
       '
      
       ## t/t9801-git-p4-branch.sh ##
     +@@
     + 
     + test_description='git p4 tests for p4 branches'
     + 
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./lib-git-p4.sh
      @@ t/t9801-git-p4-branch.sh: test_expect_success 'import main, no branch detection' '
       	(
       		cd "$git" &&
     @@ t/t9801-git-p4-branch.sh: test_expect_success 'use-client-spec detect-branches s
       		test_path_is_missing b3-file3_1
      
       ## t/t9806-git-p4-options.sh ##
     +@@
     + 
     + test_description='git p4 options'
     + 
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./lib-git-p4.sh
      @@ t/t9806-git-p4-options.sh: test_expect_success 'clone no --git-dir' '
       	test_must_fail git p4 clone --git-dir=xx //depot
       '
     @@ t/t9806-git-p4-options.sh: test_expect_success 'clone --use-client-spec' '
       		)
      
       ## t/t9807-git-p4-submit.sh ##
     +@@
     + 
     + test_description='git p4 submit'
     + 
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./lib-git-p4.sh
      @@ t/t9807-git-p4-submit.sh: test_expect_success 'submit with allowSubmit' '
       		git config git-p4.skipSubmitEdit true &&
       		git config git-p4.allowSubmit "nobranch" &&
     @@ t/t9807-git-p4-submit.sh: test_expect_success 'submit with allowSubmit' '
       '
      
       ## t/t9811-git-p4-label-import.sh ##
     +@@
     + 
     + test_description='git p4 label tests'
     + 
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./lib-git-p4.sh
      @@ t/t9811-git-p4-label-import.sh: test_expect_success 'tag that cannot be exported' '
       		git add main/f12 &&
       		git commit -m "adding f12" &&
     @@ t/t9811-git-p4-label-import.sh: test_expect_success 'tag that cannot be exported
       		git p4 submit --export-labels
       	) &&
       	(
     -
     - ## t/test-lib.sh ##
     -@@ t/test-lib.sh: case "$TEST_NUMBER" in
     - 	GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     - 	export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     - 	;;
     --[0-8]*|9[0-7]*)
     -+[0-8]*|9[0-8]*)
     - 	GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     - 	export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     - 	;;
 26:  cfa29c7f71 ! 27:  bbc17c8ee5 t99*: adjust the references to the default branch name "main"
     @@ Commit message
          Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
      
       ## t/t9903-bash-prompt.sh ##
     +@@
     + 
     + test_description='test git-specific bash prompt functions'
     + 
     +-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     ++GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     + 
     + . ./lib-bash.sh
      @@ t/t9903-bash-prompt.sh: test_expect_success 'setup for prompt tests' '
       	echo 3 >file &&
       	git commit -m "third b1" file &&
     @@ t/t9903-bash-prompt.sh: test_expect_success 'prompt - hide if pwd ignored - env
       	test_config bash.hideIfPwdIgnored false &&
       	(
       		cd ignored_dir &&
     -
     - ## t/test-lib.sh ##
     -@@ t/test-lib.sh: case "$TRASH_DIRECTORY" in
     - esac
     - 
     - case "$TEST_NUMBER" in
     --3404|4013|5310|5526|6300|7064|7817)
     -+3404|4013|5310|5526|6300|7064|7817|9902)
     - 	# Avoid conflicts with patch series that are cooking at the same time
     - 	# as the patch series changing the default of `init.defaultBranch`.
     - 	GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
     - 	export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     - 	;;
     --[0-8]*|9[0-8]*)
     -+*)
     - 	GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
     - 	export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
     - 	;;
 27:  fc0c1f6463 = 28:  ec9b9cab88 tests: drop prereq `PREPARE_FOR_MAIN_BRANCH` where no longer needed

-- 
gitgitgadget

^ permalink raw reply	[flat|nested] 163+ messages in thread

* [PATCH v3 01/28] tests: mark tests relying on the current default for `init.defaultBranch`
  2020-11-18 23:44   ` [PATCH v3 00/28] tests: use main as default branch name Johannes Schindelin via GitGitGadget
@ 2020-11-18 23:44     ` Johannes Schindelin via GitGitGadget
  2020-11-18 23:44     ` [PATCH v3 02/28] t0060: preemptively adjust alignment Johannes Schindelin via GitGitGadget
                       ` (27 subsequent siblings)
  28 siblings, 0 replies; 163+ messages in thread
From: Johannes Schindelin via GitGitGadget @ 2020-11-18 23:44 UTC (permalink / raw)
  To: git
  Cc: Felipe Contreras, Ævar Arnfjörð Bjarmason,
	Johannes Schindelin, Jeff King, Jonathan Nieder,
	Johannes Schindelin, Johannes Schindelin

From: Johannes Schindelin <johannes.schindelin@gmx.de>

In addition to the manual adjustment to let the `linux-gcc` CI job run
the test suite with `master` and then with `main`, this patch makes sure
that GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME is set in all test scripts
that currently rely on the initial branch name being `master by default.

To determine which test scripts to mark up, the first step was to
force-set the default branch name to `master` in

- all test scripts that contain the keyword `master`,

- t4211, which expects `t/t4211/history.export` with a hard-coded ref to
  initialize the default branch,

- t5560 because it sources `t/t556x_common` which uses `master`,

- t8002 and t8012 because both source `t/annotate-tests.sh` which also
  uses `master`)

This trick was performed by this command:

	$ sed -i '/^ *\. \.\/\(test-lib\|lib-\(bash\|cvs\|git-svn\)\|gitweb-lib\)\.sh$/i\
	GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master\
	export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME\
	' $(git grep -l master t/t[0-9]*.sh) \
	t/t4211*.sh t/t5560*.sh t/t8002*.sh t/t8012*.sh

After that, careful, manual inspection revealed that some of the test
scripts containing the needle `master` do not actually rely on a
specific default branch name: either they mention `master` only in a
comment, or they initialize that branch specificially, or they do not
actually refer to the current default branch. Therefore, the
aforementioned modification was undone in those test scripts thusly:

	$ git checkout HEAD -- \
		t/t0027-auto-crlf.sh t/t0060-path-utils.sh \
		t/t1011-read-tree-sparse-checkout.sh \
		t/t1305-config-include.sh t/t1309-early-config.sh \
		t/t1402-check-ref-format.sh t/t1450-fsck.sh \
		t/t2024-checkout-dwim.sh \
		t/t2106-update-index-assume-unchanged.sh \
		t/t3040-subprojects-basic.sh t/t3301-notes.sh \
		t/t3308-notes-merge.sh t/t3423-rebase-reword.sh \
		t/t3436-rebase-more-options.sh \
		t/t4015-diff-whitespace.sh t/t4257-am-interactive.sh \
		t/t5323-pack-redundant.sh t/t5401-update-hooks.sh \
		t/t5511-refspec.sh t/t5526-fetch-submodules.sh \
		t/t5529-push-errors.sh t/t5530-upload-pack-error.sh \
		t/t5548-push-porcelain.sh \
		t/t5552-skipping-fetch-negotiator.sh \
		t/t5572-pull-submodule.sh t/t5608-clone-2gb.sh \
		t/t5614-clone-submodules-shallow.sh \
		t/t7508-status.sh t/t7606-merge-custom.sh \
		t/t9302-fast-import-unpack-limit.sh

We excluded one set of test scripts in these commands, though: the range
of `git p4` tests. The reason? `git p4` stores the (foreign) remote
branch in the branch called `p4/master`, which is obviously not the
default branch. Manual analysis revealed that only five of these tests
actually require a specific default branch name to pass; They were
modified thusly:

	$ sed -i '/^ *\. \.\/lib-git-p4\.sh$/i\
	GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master\
	export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME\
	' t/t980[0167]*.sh t/t9811*.sh

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
---
 ci/run-build-and-tests.sh                        | 2 ++
 t/t0002-gitfile.sh                               | 3 +++
 t/t0020-crlf.sh                                  | 3 +++
 t/t0021-conversion.sh                            | 3 +++
 t/t0028-working-tree-encoding.sh                 | 3 +++
 t/t0041-usage.sh                                 | 3 +++
 t/t0050-filesystem.sh                            | 3 +++
 t/t0100-previous.sh                              | 3 +++
 t/t1004-read-tree-m-u-wf.sh                      | 3 +++
 t/t1008-read-tree-overlay.sh                     | 3 +++
 t/t1009-read-tree-new-index.sh                   | 3 +++
 t/t1021-rerere-in-workdir.sh                     | 3 +++
 t/t1090-sparse-checkout-scope.sh                 | 3 +++
 t/t1091-sparse-checkout-builtin.sh               | 3 +++
 t/t1300-config.sh                                | 3 +++
 t/t1301-shared-repo.sh                           | 3 +++
 t/t1400-update-ref.sh                            | 3 +++
 t/t1403-show-ref.sh                              | 3 +++
 t/t1405-main-ref-store.sh                        | 3 +++
 t/t1406-submodule-ref-store.sh                   | 3 +++
 t/t1407-worktree-ref-store.sh                    | 3 +++
 t/t1408-packed-refs.sh                           | 3 +++
 t/t1410-reflog.sh                                | 3 +++
 t/t1411-reflog-show.sh                           | 3 +++
 t/t1413-reflog-detach.sh                         | 3 +++
 t/t1414-reflog-walk.sh                           | 3 +++
 t/t1416-ref-transaction-hooks.sh                 | 3 +++
 t/t1430-bad-ref-name.sh                          | 3 +++
 t/t1500-rev-parse.sh                             | 3 +++
 t/t1503-rev-parse-verify.sh                      | 3 +++
 t/t1505-rev-parse-last.sh                        | 3 +++
 t/t1506-rev-parse-diagnosis.sh                   | 3 +++
 t/t1507-rev-parse-upstream.sh                    | 3 +++
 t/t1508-at-combinations.sh                       | 3 +++
 t/t1511-rev-parse-caret.sh                       | 3 +++
 t/t1512-rev-parse-disambiguation.sh              | 3 +++
 t/t1513-rev-parse-prefix.sh                      | 3 +++
 t/t1514-rev-parse-push.sh                        | 3 +++
 t/t1700-split-index.sh                           | 3 +++
 t/t2007-checkout-symlink.sh                      | 3 +++
 t/t2009-checkout-statinfo.sh                     | 3 +++
 t/t2010-checkout-ambiguous.sh                    | 3 +++
 t/t2011-checkout-invalid-head.sh                 | 3 +++
 t/t2012-checkout-last.sh                         | 3 +++
 t/t2015-checkout-unborn.sh                       | 3 +++
 t/t2017-checkout-orphan.sh                       | 3 +++
 t/t2020-checkout-detach.sh                       | 3 +++
 t/t2022-checkout-paths.sh                        | 3 +++
 t/t2023-checkout-m.sh                            | 3 +++
 t/t2027-checkout-track.sh                        | 3 +++
 t/t2030-unresolve-info.sh                        | 3 +++
 t/t2060-switch.sh                                | 3 +++
 t/t2070-restore.sh                               | 3 +++
 t/t2400-worktree-add.sh                          | 3 +++
 t/t2401-worktree-prune.sh                        | 3 +++
 t/t2402-worktree-list.sh                         | 3 +++
 t/t2405-worktree-submodule.sh                    | 3 +++
 t/t3200-branch.sh                                | 3 +++
 t/t3201-branch-contains.sh                       | 3 +++
 t/t3202-show-branch-octopus.sh                   | 3 +++
 t/t3203-branch-output.sh                         | 3 +++
 t/t3204-branch-name-interpretation.sh            | 3 +++
 t/t3205-branch-color.sh                          | 3 +++
 t/t3206-range-diff.sh                            | 3 +++
 t/t3210-pack-refs.sh                             | 3 +++
 t/t3211-peel-ref.sh                              | 3 +++
 t/t3302-notes-index-expensive.sh                 | 3 +++
 t/t3303-notes-subtrees.sh                        | 3 +++
 t/t3304-notes-mixed.sh                           | 3 +++
 t/t3320-notes-merge-worktrees.sh                 | 3 +++
 t/t3400-rebase.sh                                | 3 +++
 t/t3402-rebase-merge.sh                          | 3 +++
 t/t3403-rebase-skip.sh                           | 3 +++
 t/t3404-rebase-interactive.sh                    | 3 +++
 t/t3405-rebase-malformed.sh                      | 3 +++
 t/t3406-rebase-message.sh                        | 3 +++
 t/t3407-rebase-abort.sh                          | 3 +++
 t/t3408-rebase-multi-line.sh                     | 3 +++
 t/t3409-rebase-preserve-merges.sh                | 3 +++
 t/t3412-rebase-root.sh                           | 3 +++
 t/t3413-rebase-hook.sh                           | 3 +++
 t/t3415-rebase-autosquash.sh                     | 3 +++
 t/t3416-rebase-onto-threedots.sh                 | 3 +++
 t/t3418-rebase-continue.sh                       | 3 +++
 t/t3419-rebase-patch-id.sh                       | 3 +++
 t/t3420-rebase-autostash.sh                      | 3 +++
 t/t3427-rebase-subtree.sh                        | 3 +++
 t/t3430-rebase-merges.sh                         | 3 +++
 t/t3431-rebase-fork-point.sh                     | 3 +++
 t/t3432-rebase-fast-forward.sh                   | 3 +++
 t/t3434-rebase-i18n.sh                           | 3 +++
 t/t3435-rebase-gpg-sign.sh                       | 3 +++
 t/t3500-cherry.sh                                | 3 +++
 t/t3501-revert-cherry-pick.sh                    | 3 +++
 t/t3502-cherry-pick-merge.sh                     | 3 +++
 t/t3503-cherry-pick-root.sh                      | 3 +++
 t/t3504-cherry-pick-rerere.sh                    | 3 +++
 t/t3505-cherry-pick-empty.sh                     | 3 +++
 t/t3506-cherry-pick-ff.sh                        | 3 +++
 t/t3507-cherry-pick-conflict.sh                  | 3 +++
 t/t3508-cherry-pick-many-commits.sh              | 3 +++
 t/t3509-cherry-pick-merge-df.sh                  | 3 +++
 t/t3512-cherry-pick-submodule.sh                 | 3 +++
 t/t3600-rm.sh                                    | 3 +++
 t/t3701-add-interactive.sh                       | 3 +++
 t/t3901-i18n-patch.sh                            | 3 +++
 t/t3903-stash.sh                                 | 3 +++
 t/t3910-mac-os-precompose.sh                     | 3 +++
 t/t4013-diff-various.sh                          | 3 +++
 t/t4014-format-patch.sh                          | 3 +++
 t/t4017-diff-retval.sh                           | 3 +++
 t/t4038-diff-combined.sh                         | 3 +++
 t/t4041-diff-submodule-option.sh                 | 3 +++
 t/t4048-diff-combined-binary.sh                  | 3 +++
 t/t4052-stat-output.sh                           | 3 +++
 t/t4056-diff-order.sh                            | 3 +++
 t/t4057-diff-combined-paths.sh                   | 3 +++
 t/t4061-diff-indent.sh                           | 3 +++
 t/t4066-diff-emit-delay.sh                       | 3 +++
 t/t4068-diff-symmetric-merge-base.sh             | 3 +++
 t/t4103-apply-binary.sh                          | 3 +++
 t/t4108-apply-threeway.sh                        | 3 +++
 t/t4121-apply-diffs.sh                           | 3 +++
 t/t4122-apply-symlink-inside.sh                  | 3 +++
 t/t4150-am.sh                                    | 3 +++
 t/t4200-rerere.sh                                | 3 +++
 t/t4201-shortlog.sh                              | 3 +++
 t/t4202-log.sh                                   | 3 +++
 t/t4203-mailmap.sh                               | 3 +++
 t/t4204-patch-id.sh                              | 3 +++
 t/t4207-log-decoration-colors.sh                 | 3 +++
 t/t4208-log-magic-pathspec.sh                    | 3 +++
 t/t4211-line-log.sh                              | 3 +++
 t/t4214-log-graph-octopus.sh                     | 3 +++
 t/t4216-log-bloom.sh                             | 3 +++
 t/t4253-am-keep-cr-dos.sh                        | 3 +++
 t/t5150-request-pull.sh                          | 3 +++
 t/t5304-prune.sh                                 | 3 +++
 t/t5305-include-tag.sh                           | 3 +++
 t/t5310-pack-bitmaps.sh                          | 3 +++
 t/t5312-prune-corruption.sh                      | 3 +++
 t/t5317-pack-objects-filter-objects.sh           | 3 +++
 t/t5322-pack-objects-sparse.sh                   | 3 +++
 t/t5400-send-pack.sh                             | 3 +++
 t/t5402-post-merge-hook.sh                       | 3 +++
 t/t5403-post-checkout-hook.sh                    | 3 +++
 t/t5404-tracking-branches.sh                     | 3 +++
 t/t5405-send-pack-rewind.sh                      | 3 +++
 t/t5407-post-rewrite-hook.sh                     | 3 +++
 t/t5410-receive-pack-alternates.sh               | 3 +++
 t/t5500-fetch-pack.sh                            | 3 +++
 t/t5501-fetch-push-alternates.sh                 | 3 +++
 t/t5502-quickfetch.sh                            | 3 +++
 t/t5503-tagfollow.sh                             | 3 +++
 t/t5504-fetch-receive-strict.sh                  | 3 +++
 t/t5505-remote.sh                                | 3 +++
 t/t5506-remote-groups.sh                         | 3 +++
 t/t5509-fetch-push-namespaces.sh                 | 3 +++
 t/t5510-fetch.sh                                 | 3 +++
 t/t5512-ls-remote.sh                             | 3 +++
 t/t5514-fetch-multiple.sh                        | 3 +++
 t/t5516-fetch-push.sh                            | 3 +++
 t/t5517-push-mirror.sh                           | 3 +++
 t/t5518-fetch-exit-status.sh                     | 3 +++
 t/t5519-push-alternates.sh                       | 3 +++
 t/t5520-pull.sh                                  | 3 +++
 t/t5521-pull-options.sh                          | 3 +++
 t/t5523-push-upstream.sh                         | 3 +++
 t/t5526-fetch-submodules.sh                      | 3 +++
 t/t5527-fetch-odd-refs.sh                        | 3 +++
 t/t5528-push-default.sh                          | 3 +++
 t/t5531-deep-submodule-push.sh                   | 3 +++
 t/t5533-push-cas.sh                              | 3 +++
 t/t5534-push-signed.sh                           | 3 +++
 t/t5537-fetch-shallow.sh                         | 3 +++
 t/t5538-push-shallow.sh                          | 3 +++
 t/t5539-fetch-http-shallow.sh                    | 3 +++
 t/t5540-http-push-webdav.sh                      | 3 +++
 t/t5541-http-push-smart.sh                       | 3 +++
 t/t5542-push-http-shallow.sh                     | 3 +++
 t/t5543-atomic-push.sh                           | 3 +++
 t/t5545-push-options.sh                          | 3 +++
 t/t5550-http-fetch-dumb.sh                       | 3 +++
 t/t5551-http-fetch-smart.sh                      | 3 +++
 t/t5553-set-upstream.sh                          | 3 +++
 t/t5560-http-backend-noserver.sh                 | 3 +++
 t/t5561-http-backend.sh                          | 3 +++
 t/t5570-git-daemon.sh                            | 3 +++
 t/t5571-pre-push-hook.sh                         | 3 +++
 t/t5580-unc-paths.sh                             | 3 +++
 t/t5581-http-curl-verbose.sh                     | 3 +++
 t/t5582-fetch-negative-refspec.sh                | 3 +++
 t/t5601-clone.sh                                 | 3 +++
 t/t5604-clone-reference.sh                       | 3 +++
 t/t5605-clone-local.sh                           | 3 +++
 t/t5606-clone-options.sh                         | 3 +++
 t/t5607-clone-bundle.sh                          | 3 +++
 t/t5609-clone-branch.sh                          | 3 +++
 t/t5610-clone-detached.sh                        | 3 +++
 t/t5611-clone-config.sh                          | 3 +++
 t/t5612-clone-refspec.sh                         | 3 +++
 t/t5616-partial-clone.sh                         | 3 +++
 t/t5617-clone-submodules-remote.sh               | 3 +++
 t/t5700-protocol-v1.sh                           | 3 +++
 t/t5701-git-serve.sh                             | 3 +++
 t/t5702-protocol-v2.sh                           | 3 +++
 t/t5703-upload-pack-ref-in-want.sh               | 3 +++
 t/t5801-remote-helpers.sh                        | 3 +++
 t/t6000-rev-list-misc.sh                         | 3 +++
 t/t6001-rev-list-graft.sh                        | 3 +++
 t/t6004-rev-list-path-optim.sh                   | 3 +++
 t/t6006-rev-list-format.sh                       | 3 +++
 t/t6007-rev-list-cherry-pick-file.sh             | 3 +++
 t/t6008-rev-list-submodule.sh                    | 3 +++
 t/t6009-rev-list-parent.sh                       | 3 +++
 t/t6012-rev-list-simplify.sh                     | 3 +++
 t/t6013-rev-list-reverse-parents.sh              | 3 +++
 t/t6016-rev-list-graph-simplify-history.sh       | 3 +++
 t/t6017-rev-list-stdin.sh                        | 3 +++
 t/t6018-rev-list-glob.sh                         | 3 +++
 t/t6019-rev-list-ancestry-path.sh                | 3 +++
 t/t6030-bisect-porcelain.sh                      | 3 +++
 t/t6040-tracking-info.sh                         | 3 +++
 t/t6050-replace.sh                               | 3 +++
 t/t6101-rev-parse-parents.sh                     | 3 +++
 t/t6110-rev-list-sparse.sh                       | 3 +++
 t/t6111-rev-list-treesame.sh                     | 3 +++
 t/t6112-rev-list-filters-objects.sh              | 3 +++
 t/t6120-describe.sh                              | 3 +++
 t/t6200-fmt-merge-msg.sh                         | 3 +++
 t/t6300-for-each-ref.sh                          | 3 +++
 t/t6302-for-each-ref-filter.sh                   | 3 +++
 t/t6400-merge-df.sh                              | 3 +++
 t/t6402-merge-rename.sh                          | 3 +++
 t/t6404-recursive-merge.sh                       | 3 +++
 t/t6405-merge-symlinks.sh                        | 3 +++
 t/t6406-merge-attr.sh                            | 3 +++
 t/t6407-merge-binary.sh                          | 3 +++
 t/t6409-merge-subtree.sh                         | 3 +++
 t/t6411-merge-filemode.sh                        | 3 +++
 t/t6412-merge-large-rename.sh                    | 3 +++
 t/t6413-merge-crlf.sh                            | 3 +++
 t/t6414-merge-rename-nocruft.sh                  | 3 +++
 t/t6415-merge-dir-to-symlink.sh                  | 3 +++
 t/t6416-recursive-corner-cases.sh                | 3 +++
 t/t6417-merge-ours-theirs.sh                     | 3 +++
 t/t6418-merge-text-auto.sh                       | 3 +++
 t/t6419-merge-ignorecase.sh                      | 3 +++
 t/t6422-merge-rename-corner-cases.sh             | 3 +++
 t/t6425-merge-rename-delete.sh                   | 3 +++
 t/t6427-diff3-conflict-markers.sh                | 3 +++
 t/t6430-merge-recursive.sh                       | 3 +++
 t/t6432-merge-recursive-space-options.sh         | 3 +++
 t/t6433-merge-toplevel.sh                        | 3 +++
 t/t6434-merge-recursive-rename-options.sh        | 3 +++
 t/t6436-merge-overwrite.sh                       | 3 +++
 t/t6437-submodule-merge.sh                       | 3 +++
 t/t6439-merge-co-error-msgs.sh                   | 3 +++
 t/t6501-freshen-objects.sh                       | 3 +++
 t/t7003-filter-branch.sh                         | 3 +++
 t/t7004-tag.sh                                   | 3 +++
 t/t7030-verify-tag.sh                            | 3 +++
 t/t7060-wtstatus.sh                              | 3 +++
 t/t7063-status-untracked-cache.sh                | 3 +++
 t/t7064-wtstatus-pv2.sh                          | 3 +++
 t/t7102-reset.sh                                 | 3 +++
 t/t7113-post-index-change-hook.sh                | 3 +++
 t/t7201-co.sh                                    | 3 +++
 t/t7400-submodule-basic.sh                       | 3 +++
 t/t7403-submodule-sync.sh                        | 3 +++
 t/t7406-submodule-update.sh                      | 3 +++
 t/t7407-submodule-foreach.sh                     | 3 +++
 t/t7409-submodule-detached-work-tree.sh          | 3 +++
 t/t7417-submodule-path-url.sh                    | 3 +++
 t/t7501-commit-basic-functionality.sh            | 3 +++
 t/t7502-commit-porcelain.sh                      | 3 +++
 t/t7503-pre-commit-and-pre-merge-commit-hooks.sh | 3 +++
 t/t7504-commit-msg-hook.sh                       | 3 +++
 t/t7505-prepare-commit-msg-hook.sh               | 3 +++
 t/t7510-signed-commit.sh                         | 3 +++
 t/t7512-status-help.sh                           | 3 +++
 t/t7517-per-repo-email.sh                        | 3 +++
 t/t7600-merge.sh                                 | 3 +++
 t/t7608-merge-messages.sh                        | 3 +++
 t/t7610-mergetool.sh                             | 3 +++
 t/t7611-merge-abort.sh                           | 3 +++
 t/t7612-merge-verify-signatures.sh               | 3 +++
 t/t7614-merge-signoff.sh                         | 3 +++
 t/t7701-repack-unpack-unreachable.sh             | 3 +++
 t/t7800-difftool.sh                              | 3 +++
 t/t7810-grep.sh                                  | 3 +++
 t/t8001-annotate.sh                              | 3 +++
 t/t8002-blame.sh                                 | 3 +++
 t/t8003-blame-corner-cases.sh                    | 3 +++
 t/t8004-blame-with-conflicts.sh                  | 3 +++
 t/t8012-blame-colors.sh                          | 3 +++
 t/t9001-send-email.sh                            | 3 +++
 t/t9100-git-svn-basic.sh                         | 3 +++
 t/t9145-git-svn-master-branch.sh                 | 3 +++
 t/t9151-svn-mergeinfo.sh                         | 3 +++
 t/t9155-git-svn-fetch-deleted-tag.sh             | 3 +++
 t/t9156-git-svn-fetch-deleted-tag-2.sh           | 3 +++
 t/t9163-git-svn-reset-clears-caches.sh           | 3 +++
 t/t9169-git-svn-dcommit-crlf.sh                  | 3 +++
 t/t9300-fast-import.sh                           | 3 +++
 t/t9301-fast-import-notes.sh                     | 3 +++
 t/t9350-fast-export.sh                           | 3 +++
 t/t9351-fast-export-anonymize.sh                 | 3 +++
 t/t9400-git-cvsserver-server.sh                  | 3 +++
 t/t9401-git-cvsserver-crlf.sh                    | 3 +++
 t/t9402-git-cvsserver-refs.sh                    | 3 +++
 t/t9500-gitweb-standalone-no-errors.sh           | 3 +++
 t/t9501-gitweb-standalone-http-status.sh         | 3 +++
 t/t9502-gitweb-standalone-parse-output.sh        | 3 +++
 t/t9600-cvsimport.sh                             | 3 +++
 t/t9601-cvsimport-vendor-branch.sh               | 3 +++
 t/t9602-cvsimport-branches-tags.sh               | 3 +++
 t/t9603-cvsimport-patchsets.sh                   | 3 +++
 t/t9800-git-p4-basic.sh                          | 3 +++
 t/t9801-git-p4-branch.sh                         | 3 +++
 t/t9806-git-p4-options.sh                        | 3 +++
 t/t9807-git-p4-submit.sh                         | 3 +++
 t/t9811-git-p4-label-import.sh                   | 3 +++
 t/t9902-completion.sh                            | 3 +++
 t/t9903-bash-prompt.sh                           | 3 +++
 325 files changed, 974 insertions(+)

diff --git a/ci/run-build-and-tests.sh b/ci/run-build-and-tests.sh
index 6c27b886b8..50e0b90073 100755
--- a/ci/run-build-and-tests.sh
+++ b/ci/run-build-and-tests.sh
@@ -13,6 +13,7 @@ esac
 make
 case "$jobname" in
 linux-gcc)
+	export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 	make test
 	export GIT_TEST_SPLIT_INDEX=yes
 	export GIT_TEST_FULL_IN_PACK_ARRAY=true
@@ -22,6 +23,7 @@ linux-gcc)
 	export GIT_TEST_COMMIT_GRAPH_CHANGED_PATHS=1
 	export GIT_TEST_MULTI_PACK_INDEX=1
 	export GIT_TEST_ADD_I_USE_BUILTIN=1
+	export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
 	make test
 	;;
 linux-clang)
diff --git a/t/t0002-gitfile.sh b/t/t0002-gitfile.sh
index 960ed150cb..0a396c95e5 100755
--- a/t/t0002-gitfile.sh
+++ b/t/t0002-gitfile.sh
@@ -4,6 +4,9 @@ test_description='.git file
 
 Verify that plumbing commands work when .git is a file
 '
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 objpath() {
diff --git a/t/t0020-crlf.sh b/t/t0020-crlf.sh
index b63ba62e5d..0d43189048 100755
--- a/t/t0020-crlf.sh
+++ b/t/t0020-crlf.sh
@@ -2,6 +2,9 @@
 
 test_description='CRLF conversion'
 
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 has_cr() {
diff --git a/t/t0021-conversion.sh b/t/t0021-conversion.sh
index f6deaf498b..adf862aef1 100755
--- a/t/t0021-conversion.sh
+++ b/t/t0021-conversion.sh
@@ -2,6 +2,9 @@
 
 test_description='blob conversion via gitattributes'
 
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 TEST_ROOT="$PWD"
diff --git a/t/t0028-working-tree-encoding.sh b/t/t0028-working-tree-encoding.sh
index bfc4fb9af5..ccdc91c41c 100755
--- a/t/t0028-working-tree-encoding.sh
+++ b/t/t0028-working-tree-encoding.sh
@@ -2,6 +2,9 @@
 
 test_description='working-tree-encoding conversion via gitattributes'
 
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 GIT_TRACE_WORKING_TREE_ENCODING=1 && export GIT_TRACE_WORKING_TREE_ENCODING
diff --git a/t/t0041-usage.sh b/t/t0041-usage.sh
index 5b927b76fe..068b784e72 100755
--- a/t/t0041-usage.sh
+++ b/t/t0041-usage.sh
@@ -2,6 +2,9 @@
 
 test_description='Test commands behavior when given invalid argument value'
 
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 test_expect_success 'setup ' '
diff --git a/t/t0050-filesystem.sh b/t/t0050-filesystem.sh
index 608673fb77..368f7d515b 100755
--- a/t/t0050-filesystem.sh
+++ b/t/t0050-filesystem.sh
@@ -2,6 +2,9 @@
 
 test_description='Various filesystem issues'
 
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 auml=$(printf '\303\244')
diff --git a/t/t0100-previous.sh b/t/t0100-previous.sh
index 58c0b7e9b6..c3c2770ab3 100755
--- a/t/t0100-previous.sh
+++ b/t/t0100-previous.sh
@@ -2,6 +2,9 @@
 
 test_description='previous branch syntax @{-n}'
 
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 test_expect_success 'branch -d @{-1}' '
diff --git a/t/t1004-read-tree-m-u-wf.sh b/t/t1004-read-tree-m-u-wf.sh
index 181956b241..57caa3a73f 100755
--- a/t/t1004-read-tree-m-u-wf.sh
+++ b/t/t1004-read-tree-m-u-wf.sh
@@ -2,6 +2,9 @@
 
 test_description='read-tree -m -u checks working tree files'
 
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 . "$TEST_DIRECTORY"/lib-read-tree.sh
 
diff --git a/t/t1008-read-tree-overlay.sh b/t/t1008-read-tree-overlay.sh
index cf96016844..edb89447c7 100755
--- a/t/t1008-read-tree-overlay.sh
+++ b/t/t1008-read-tree-overlay.sh
@@ -2,6 +2,9 @@
 
 test_description='test multi-tree read-tree without merging'
 
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 . "$TEST_DIRECTORY"/lib-read-tree.sh
 
diff --git a/t/t1009-read-tree-new-index.sh b/t/t1009-read-tree-new-index.sh
index 59b3aa4bc4..b9bab37ac0 100755
--- a/t/t1009-read-tree-new-index.sh
+++ b/t/t1009-read-tree-new-index.sh
@@ -2,6 +2,9 @@
 
 test_description='test read-tree into a fresh index file'
 
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 test_expect_success setup '
diff --git a/t/t1021-rerere-in-workdir.sh b/t/t1021-rerere-in-workdir.sh
index 301e071ff7..9177871c99 100755
--- a/t/t1021-rerere-in-workdir.sh
+++ b/t/t1021-rerere-in-workdir.sh
@@ -1,6 +1,9 @@
 #!/bin/sh
 
 test_description='rerere run in a workdir'
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 test_expect_success SYMLINKS setup '
diff --git a/t/t1090-sparse-checkout-scope.sh b/t/t1090-sparse-checkout-scope.sh
index f35a73dd20..d731322633 100755
--- a/t/t1090-sparse-checkout-scope.sh
+++ b/t/t1090-sparse-checkout-scope.sh
@@ -2,6 +2,9 @@
 
 test_description='sparse checkout scope tests'
 
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 test_expect_success 'setup' '
diff --git a/t/t1091-sparse-checkout-builtin.sh b/t/t1091-sparse-checkout-builtin.sh
index 84acfc48b6..25e68ca036 100755
--- a/t/t1091-sparse-checkout-builtin.sh
+++ b/t/t1091-sparse-checkout-builtin.sh
@@ -2,6 +2,9 @@
 
 test_description='sparse checkout builtin tests'
 
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 list_files() {
diff --git a/t/t1300-config.sh b/t/t1300-config.sh
index 825d9a184f..67e201b5c1 100755
--- a/t/t1300-config.sh
+++ b/t/t1300-config.sh
@@ -5,6 +5,9 @@
 
 test_description='Test git config in different settings'
 
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 test_expect_success 'clear default config' '
diff --git a/t/t1301-shared-repo.sh b/t/t1301-shared-repo.sh
index 2dc853d1be..c573438f98 100755
--- a/t/t1301-shared-repo.sh
+++ b/t/t1301-shared-repo.sh
@@ -5,6 +5,9 @@
 
 test_description='Test shared repository initialization'
 
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 # Remove a default ACL from the test dir if possible.
diff --git a/t/t1400-update-ref.sh b/t/t1400-update-ref.sh
index 4c01e08551..4ae6f50c02 100755
--- a/t/t1400-update-ref.sh
+++ b/t/t1400-update-ref.sh
@@ -4,6 +4,9 @@
 #
 
 test_description='Test git update-ref and basic ref logging'
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 Z=$ZERO_OID
diff --git a/t/t1403-show-ref.sh b/t/t1403-show-ref.sh
index 5d955c3bff..aaf32f3b07 100755
--- a/t/t1403-show-ref.sh
+++ b/t/t1403-show-ref.sh
@@ -1,6 +1,9 @@
 #!/bin/sh
 
 test_description='show-ref'
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 test_expect_success setup '
diff --git a/t/t1405-main-ref-store.sh b/t/t1405-main-ref-store.sh
index 74af927fba..531059b871 100755
--- a/t/t1405-main-ref-store.sh
+++ b/t/t1405-main-ref-store.sh
@@ -2,6 +2,9 @@
 
 test_description='test main ref store api'
 
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 RUN="test-tool ref-store main"
diff --git a/t/t1406-submodule-ref-store.sh b/t/t1406-submodule-ref-store.sh
index 36b7ef5046..126518c155 100755
--- a/t/t1406-submodule-ref-store.sh
+++ b/t/t1406-submodule-ref-store.sh
@@ -2,6 +2,9 @@
 
 test_description='test submodule ref store api'
 
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 RUN="test-tool ref-store submodule:sub"
diff --git a/t/t1407-worktree-ref-store.sh b/t/t1407-worktree-ref-store.sh
index 9a84858118..aede1c20d7 100755
--- a/t/t1407-worktree-ref-store.sh
+++ b/t/t1407-worktree-ref-store.sh
@@ -2,6 +2,9 @@
 
 test_description='test worktree ref store api'
 
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 RWT="test-tool ref-store worktree:wt"
diff --git a/t/t1408-packed-refs.sh b/t/t1408-packed-refs.sh
index 1e44a17eea..fd58388232 100755
--- a/t/t1408-packed-refs.sh
+++ b/t/t1408-packed-refs.sh
@@ -2,6 +2,9 @@
 
 test_description='packed-refs entries are covered by loose refs'
 
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 test_expect_success setup '
diff --git a/t/t1410-reflog.sh b/t/t1410-reflog.sh
index 730a43d9dd..aa02ca488d 100755
--- a/t/t1410-reflog.sh
+++ b/t/t1410-reflog.sh
@@ -4,6 +4,9 @@
 #
 
 test_description='Test prune and reflog expiration'
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 check_have () {
diff --git a/t/t1411-reflog-show.sh b/t/t1411-reflog-show.sh
index 985daf1def..f6fecff671 100755
--- a/t/t1411-reflog-show.sh
+++ b/t/t1411-reflog-show.sh
@@ -1,6 +1,9 @@
 #!/bin/sh
 
 test_description='Test reflog display routines'
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 test_expect_success 'setup' '
diff --git a/t/t1413-reflog-detach.sh b/t/t1413-reflog-detach.sh
index c730600d8a..140914aa29 100755
--- a/t/t1413-reflog-detach.sh
+++ b/t/t1413-reflog-detach.sh
@@ -1,6 +1,9 @@
 #!/bin/sh
 
 test_description='Test reflog interaction with detached HEAD'
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 reset_state () {
diff --git a/t/t1414-reflog-walk.sh b/t/t1414-reflog-walk.sh
index 1181a9fb28..c463b5fc29 100755
--- a/t/t1414-reflog-walk.sh
+++ b/t/t1414-reflog-walk.sh
@@ -1,6 +1,9 @@
 #!/bin/sh
 
 test_description='various tests of reflog walk (log -g) behavior'
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 test_expect_success 'set up some reflog entries' '
diff --git a/t/t1416-ref-transaction-hooks.sh b/t/t1416-ref-transaction-hooks.sh
index f6e741c6c0..a26a6b782d 100755
--- a/t/t1416-ref-transaction-hooks.sh
+++ b/t/t1416-ref-transaction-hooks.sh
@@ -2,6 +2,9 @@
 
 test_description='reference transaction hooks'
 
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 test_expect_success setup '
diff --git a/t/t1430-bad-ref-name.sh b/t/t1430-bad-ref-name.sh
index c7878a60ed..8c4353746b 100755
--- a/t/t1430-bad-ref-name.sh
+++ b/t/t1430-bad-ref-name.sh
@@ -1,6 +1,9 @@
 #!/bin/sh
 
 test_description='Test handling of ref names that check-ref-format rejects'
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 test_expect_success setup '
diff --git a/t/t1500-rev-parse.sh b/t/t1500-rev-parse.sh
index 408b97d5af..d23da4e8de 100755
--- a/t/t1500-rev-parse.sh
+++ b/t/t1500-rev-parse.sh
@@ -1,6 +1,9 @@
 #!/bin/sh
 
 test_description='test git rev-parse'
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 # usage: [options] label is-bare is-inside-git is-inside-work prefix git-dir absolute-git-dir
diff --git a/t/t1503-rev-parse-verify.sh b/t/t1503-rev-parse-verify.sh
index dc9fe3cbf1..e4343c49b2 100755
--- a/t/t1503-rev-parse-verify.sh
+++ b/t/t1503-rev-parse-verify.sh
@@ -6,6 +6,9 @@ test_description='test git rev-parse --verify'
 
 exec </dev/null
 
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 add_line_into_file()
diff --git a/t/t1505-rev-parse-last.sh b/t/t1505-rev-parse-last.sh
index 4969edb314..9bd0307b5d 100755
--- a/t/t1505-rev-parse-last.sh
+++ b/t/t1505-rev-parse-last.sh
@@ -2,6 +2,9 @@
 
 test_description='test @{-N} syntax'
 
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 
diff --git a/t/t1506-rev-parse-diagnosis.sh b/t/t1506-rev-parse-diagnosis.sh
index e2ae15a2cf..694d74fc01 100755
--- a/t/t1506-rev-parse-diagnosis.sh
+++ b/t/t1506-rev-parse-diagnosis.sh
@@ -4,6 +4,9 @@ test_description='test git rev-parse diagnosis for invalid argument'
 
 exec </dev/null
 
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 test_did_you_mean ()
diff --git a/t/t1507-rev-parse-upstream.sh b/t/t1507-rev-parse-upstream.sh
index dfc0d96d8a..521233a3c3 100755
--- a/t/t1507-rev-parse-upstream.sh
+++ b/t/t1507-rev-parse-upstream.sh
@@ -2,6 +2,9 @@
 
 test_description='test <branch>@{upstream} syntax'
 
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 
diff --git a/t/t1508-at-combinations.sh b/t/t1508-at-combinations.sh
index 4a9964e9dc..8e73633761 100755
--- a/t/t1508-at-combinations.sh
+++ b/t/t1508-at-combinations.sh
@@ -1,6 +1,9 @@
 #!/bin/sh
 
 test_description='test various @{X} syntax combinations together'
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 check() {
diff --git a/t/t1511-rev-parse-caret.sh b/t/t1511-rev-parse-caret.sh
index e0a49a651f..cfb2ea5e04 100755
--- a/t/t1511-rev-parse-caret.sh
+++ b/t/t1511-rev-parse-caret.sh
@@ -2,6 +2,9 @@
 
 test_description='tests for ref^{stuff}'
 
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 test_expect_success 'setup' '
diff --git a/t/t1512-rev-parse-disambiguation.sh b/t/t1512-rev-parse-disambiguation.sh
index 18fa6cf40d..2ef1f2b7e8 100755
--- a/t/t1512-rev-parse-disambiguation.sh
+++ b/t/t1512-rev-parse-disambiguation.sh
@@ -20,6 +20,9 @@ one tagged as v1.0.0.  They all have one regular file each.
 
 '
 
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 if ! test_have_prereq SHA1
diff --git a/t/t1513-rev-parse-prefix.sh b/t/t1513-rev-parse-prefix.sh
index 87ec3ae714..d151ef9218 100755
--- a/t/t1513-rev-parse-prefix.sh
+++ b/t/t1513-rev-parse-prefix.sh
@@ -2,6 +2,9 @@
 
 test_description='Tests for rev-parse --prefix'
 
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 test_expect_success 'setup' '
diff --git a/t/t1514-rev-parse-push.sh b/t/t1514-rev-parse-push.sh
index 788cc91e45..173ba2792b 100755
--- a/t/t1514-rev-parse-push.sh
+++ b/t/t1514-rev-parse-push.sh
@@ -1,6 +1,9 @@
 #!/bin/sh
 
 test_description='test <branch>@{push} syntax'
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 resolve () {
diff --git a/t/t1700-split-index.sh b/t/t1700-split-index.sh
index 12a5568844..7d4a6f1e93 100755
--- a/t/t1700-split-index.sh
+++ b/t/t1700-split-index.sh
@@ -2,6 +2,9 @@
 
 test_description='split index mode tests'
 
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 # We need total control of index splitting here
diff --git a/t/t2007-checkout-symlink.sh b/t/t2007-checkout-symlink.sh
index fc9aad530e..8879a78b85 100755
--- a/t/t2007-checkout-symlink.sh
+++ b/t/t2007-checkout-symlink.sh
@@ -4,6 +4,9 @@
 
 test_description='git checkout to switch between branches with symlink<->dir'
 
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 test_expect_success setup '
diff --git a/t/t2009-checkout-statinfo.sh b/t/t2009-checkout-statinfo.sh
index f3c2152087..9af4d6ca5e 100755
--- a/t/t2009-checkout-statinfo.sh
+++ b/t/t2009-checkout-statinfo.sh
@@ -2,6 +2,9 @@
 
 test_description='checkout should leave clean stat info'
 
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 test_expect_success 'setup' '
diff --git a/t/t2010-checkout-ambiguous.sh b/t/t2010-checkout-ambiguous.sh
index 2e47fe01cf..3f5431e033 100755
--- a/t/t2010-checkout-ambiguous.sh
+++ b/t/t2010-checkout-ambiguous.sh
@@ -2,6 +2,9 @@
 
 test_description='checkout and pathspecs/refspecs ambiguities'
 
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 test_expect_success 'setup' '
diff --git a/t/t2011-checkout-invalid-head.sh b/t/t2011-checkout-invalid-head.sh
index 0e8d56aa76..fede33ff1f 100755
--- a/t/t2011-checkout-invalid-head.sh
+++ b/t/t2011-checkout-invalid-head.sh
@@ -2,6 +2,9 @@
 
 test_description='checkout switching away from an invalid branch'
 
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 test_expect_success 'setup' '
diff --git a/t/t2012-checkout-last.sh b/t/t2012-checkout-last.sh
index e7ba8c505f..16bf19f7ee 100755
--- a/t/t2012-checkout-last.sh
+++ b/t/t2012-checkout-last.sh
@@ -2,6 +2,9 @@
 
 test_description='checkout can switch to last branch and merge base'
 
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 test_expect_success 'setup' '
diff --git a/t/t2015-checkout-unborn.sh b/t/t2015-checkout-unborn.sh
index 37bdcedcc9..669a70c76f 100755
--- a/t/t2015-checkout-unborn.sh
+++ b/t/t2015-checkout-unborn.sh
@@ -1,6 +1,9 @@
 #!/bin/sh
 
 test_description='checkout from unborn branch'
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 test_expect_success 'setup' '
diff --git a/t/t2017-checkout-orphan.sh b/t/t2017-checkout-orphan.sh
index 655f278c5f..999e976c62 100755
--- a/t/t2017-checkout-orphan.sh
+++ b/t/t2017-checkout-orphan.sh
@@ -7,6 +7,9 @@ test_description='git checkout --orphan
 
 Main Tests for --orphan functionality.'
 
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 TEST_FILE=foo
diff --git a/t/t2020-checkout-detach.sh b/t/t2020-checkout-detach.sh
index b748db9946..45d87c23b1 100755
--- a/t/t2020-checkout-detach.sh
+++ b/t/t2020-checkout-detach.sh
@@ -1,6 +1,9 @@
 #!/bin/sh
 
 test_description='checkout into detached HEAD state'
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 check_detached () {
diff --git a/t/t2022-checkout-paths.sh b/t/t2022-checkout-paths.sh
index 6844afafc0..fc0f5b775c 100755
--- a/t/t2022-checkout-paths.sh
+++ b/t/t2022-checkout-paths.sh
@@ -1,6 +1,9 @@
 #!/bin/sh
 
 test_description='checkout $tree -- $paths'
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 test_expect_success setup '
diff --git a/t/t2023-checkout-m.sh b/t/t2023-checkout-m.sh
index fca3f85824..f2f4f5b3ac 100755
--- a/t/t2023-checkout-m.sh
+++ b/t/t2023-checkout-m.sh
@@ -4,6 +4,9 @@ test_description='checkout -m -- <conflicted path>
 
 Ensures that checkout -m on a resolved file restores the conflicted file'
 
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 test_expect_success setup '
diff --git a/t/t2027-checkout-track.sh b/t/t2027-checkout-track.sh
index bcba1bf90c..4e1419ca98 100755
--- a/t/t2027-checkout-track.sh
+++ b/t/t2027-checkout-track.sh
@@ -2,6 +2,9 @@
 
 test_description='tests for git branch --track'
 
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 test_expect_success 'setup' '
diff --git a/t/t2030-unresolve-info.sh b/t/t2030-unresolve-info.sh
index 309199bca2..3fe29fc3ee 100755
--- a/t/t2030-unresolve-info.sh
+++ b/t/t2030-unresolve-info.sh
@@ -2,6 +2,9 @@
 
 test_description='undoing resolution'
 
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 check_resolve_undo () {
diff --git a/t/t2060-switch.sh b/t/t2060-switch.sh
index 68c9101b02..4de9299705 100755
--- a/t/t2060-switch.sh
+++ b/t/t2060-switch.sh
@@ -2,6 +2,9 @@
 
 test_description='switch basic functionality'
 
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 test_expect_success 'setup' '
diff --git a/t/t2070-restore.sh b/t/t2070-restore.sh
index 89e5a142c9..6941769c9a 100755
--- a/t/t2070-restore.sh
+++ b/t/t2070-restore.sh
@@ -2,6 +2,9 @@
 
 test_description='restore basic functionality'
 
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 test_expect_success 'setup' '
diff --git a/t/t2400-worktree-add.sh b/t/t2400-worktree-add.sh
index 5a7495474a..35cef266e9 100755
--- a/t/t2400-worktree-add.sh
+++ b/t/t2400-worktree-add.sh
@@ -2,6 +2,9 @@
 
 test_description='test git worktree add'
 
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 . "$TEST_DIRECTORY"/lib-rebase.sh
diff --git a/t/t2401-worktree-prune.sh b/t/t2401-worktree-prune.sh
index a6ce7f590b..e6fc27de1e 100755
--- a/t/t2401-worktree-prune.sh
+++ b/t/t2401-worktree-prune.sh
@@ -2,6 +2,9 @@
 
 test_description='prune $GIT_DIR/worktrees'
 
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 test_expect_success initialize '
diff --git a/t/t2402-worktree-list.sh b/t/t2402-worktree-list.sh
index 795ddca2e4..3b23b0fdb7 100755
--- a/t/t2402-worktree-list.sh
+++ b/t/t2402-worktree-list.sh
@@ -2,6 +2,9 @@
 
 test_description='test git worktree list'
 
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 test_expect_success 'setup' '
diff --git a/t/t2405-worktree-submodule.sh b/t/t2405-worktree-submodule.sh
index e1b2bfd87e..cca2aea658 100755
--- a/t/t2405-worktree-submodule.sh
+++ b/t/t2405-worktree-submodule.sh
@@ -2,6 +2,9 @@
 
 test_description='Combination of submodules and multiple worktrees'
 
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 base_path=$(pwd -P)
diff --git a/t/t3200-branch.sh b/t/t3200-branch.sh
index a0b832d59e..04b568cf21 100755
--- a/t/t3200-branch.sh
+++ b/t/t3200-branch.sh
@@ -5,6 +5,9 @@
 
 test_description='git branch assorted tests'
 
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 . "$TEST_DIRECTORY"/lib-rebase.sh
 
diff --git a/t/t3201-branch-contains.sh b/t/t3201-branch-contains.sh
index 3733cd0091..532cdbe9ae 100755
--- a/t/t3201-branch-contains.sh
+++ b/t/t3201-branch-contains.sh
@@ -2,6 +2,9 @@
 
 test_description='branch --contains <commit>, --no-contains <commit> --merged, and --no-merged'
 
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 test_expect_success setup '
diff --git a/t/t3202-show-branch-octopus.sh b/t/t3202-show-branch-octopus.sh
index 6adf47869c..bbf7129dd8 100755
--- a/t/t3202-show-branch-octopus.sh
+++ b/t/t3202-show-branch-octopus.sh
@@ -2,6 +2,9 @@
 
 test_description='test show-branch with more than 8 heads'
 
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 numbers="1 2 3 4 5 6 7 8 9 10"
diff --git a/t/t3203-branch-output.sh b/t/t3203-branch-output.sh
index d65586541d..a2144dd8e5 100755
--- a/t/t3203-branch-output.sh
+++ b/t/t3203-branch-output.sh
@@ -1,6 +1,9 @@
 #!/bin/sh
 
 test_description='git branch display tests'
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 . "$TEST_DIRECTORY"/lib-terminal.sh
 
diff --git a/t/t3204-branch-name-interpretation.sh b/t/t3204-branch-name-interpretation.sh
index 698d9cc4f3..dd315ebf04 100755
--- a/t/t3204-branch-name-interpretation.sh
+++ b/t/t3204-branch-name-interpretation.sh
@@ -6,6 +6,9 @@ Branch name arguments are usually names which are taken to be inside of
 refs/heads/, but we interpret some magic syntax like @{-1}, @{upstream}, etc.
 This script aims to check the behavior of those corner cases.
 '
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 expect_branch() {
diff --git a/t/t3205-branch-color.sh b/t/t3205-branch-color.sh
index 289625c464..8b54a9252b 100755
--- a/t/t3205-branch-color.sh
+++ b/t/t3205-branch-color.sh
@@ -1,6 +1,9 @@
 #!/bin/sh
 
 test_description='basic branch output coloring'
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 test_expect_success 'set up some sample branches' '
diff --git a/t/t3206-range-diff.sh b/t/t3206-range-diff.sh
index 6eb344be03..3813ddc85e 100755
--- a/t/t3206-range-diff.sh
+++ b/t/t3206-range-diff.sh
@@ -2,6 +2,9 @@
 
 test_description='range-diff tests'
 
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 # Note that because of the range-diff's heuristics, test_commit does more
diff --git a/t/t3210-pack-refs.sh b/t/t3210-pack-refs.sh
index f41b2afb99..90eea19564 100755
--- a/t/t3210-pack-refs.sh
+++ b/t/t3210-pack-refs.sh
@@ -9,6 +9,9 @@ test_description='git pack-refs should not change the branch semantic
 This test runs git pack-refs and git show-ref and checks that the branch
 semantic is still the same.
 '
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 test_expect_success 'enable reflogs' '
diff --git a/t/t3211-peel-ref.sh b/t/t3211-peel-ref.sh
index 3b7caca421..f3d9c6b6b6 100755
--- a/t/t3211-peel-ref.sh
+++ b/t/t3211-peel-ref.sh
@@ -1,6 +1,9 @@
 #!/bin/sh
 
 test_description='tests for the peel_ref optimization of packed-refs'
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 test_expect_success 'create annotated tag in refs/tags' '
diff --git a/t/t3302-notes-index-expensive.sh b/t/t3302-notes-index-expensive.sh
index 7217c5e222..1564befe00 100755
--- a/t/t3302-notes-index-expensive.sh
+++ b/t/t3302-notes-index-expensive.sh
@@ -5,6 +5,9 @@
 
 test_description='Test commit notes index (expensive!)'
 
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 create_repo () {
diff --git a/t/t3303-notes-subtrees.sh b/t/t3303-notes-subtrees.sh
index 704aee81ef..16f3438355 100755
--- a/t/t3303-notes-subtrees.sh
+++ b/t/t3303-notes-subtrees.sh
@@ -2,6 +2,9 @@
 
 test_description='Test commit notes organized in subtrees'
 
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 number_of_commits=100
diff --git a/t/t3304-notes-mixed.sh b/t/t3304-notes-mixed.sh
index 1709e8c00b..6a7b8e2829 100755
--- a/t/t3304-notes-mixed.sh
+++ b/t/t3304-notes-mixed.sh
@@ -2,6 +2,9 @@
 
 test_description='Test notes trees that also contain non-notes'
 
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 number_of_commits=100
diff --git a/t/t3320-notes-merge-worktrees.sh b/t/t3320-notes-merge-worktrees.sh
index 823fdbda1f..f86975414c 100755
--- a/t/t3320-notes-merge-worktrees.sh
+++ b/t/t3320-notes-merge-worktrees.sh
@@ -5,6 +5,9 @@
 
 test_description='Test merging of notes trees in multiple worktrees'
 
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 test_expect_success 'setup commit' '
diff --git a/t/t3400-rebase.sh b/t/t3400-rebase.sh
index 40d2975995..61577591d0 100755
--- a/t/t3400-rebase.sh
+++ b/t/t3400-rebase.sh
@@ -8,6 +8,9 @@ test_description='git rebase assorted tests
 This test runs git rebase and checks that the author information is not lost
 among other things.
 '
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 GIT_AUTHOR_NAME=author@name
diff --git a/t/t3402-rebase-merge.sh b/t/t3402-rebase-merge.sh
index 6e032716a6..d79a11b686 100755
--- a/t/t3402-rebase-merge.sh
+++ b/t/t3402-rebase-merge.sh
@@ -5,6 +5,9 @@
 
 test_description='git rebase --merge test'
 
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 T="A quick brown fox
diff --git a/t/t3403-rebase-skip.sh b/t/t3403-rebase-skip.sh
index a927774910..c9936cb1d9 100755
--- a/t/t3403-rebase-skip.sh
+++ b/t/t3403-rebase-skip.sh
@@ -5,6 +5,9 @@
 
 test_description='git rebase --merge --skip tests'
 
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 . "$TEST_DIRECTORY"/lib-rebase.sh
diff --git a/t/t3404-rebase-interactive.sh b/t/t3404-rebase-interactive.sh
index 1e56696e4f..9c91524e12 100755
--- a/t/t3404-rebase-interactive.sh
+++ b/t/t3404-rebase-interactive.sh
@@ -25,6 +25,9 @@ Initial setup:
  where A, B, D and G all touch file1, and one, two, three, four all
  touch file "conflict".
 '
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 . "$TEST_DIRECTORY"/lib-rebase.sh
diff --git a/t/t3405-rebase-malformed.sh b/t/t3405-rebase-malformed.sh
index 860e63e444..d8f6d2e3cb 100755
--- a/t/t3405-rebase-malformed.sh
+++ b/t/t3405-rebase-malformed.sh
@@ -2,6 +2,9 @@
 
 test_description='rebase should handle arbitrary git message'
 
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 . "$TEST_DIRECTORY"/lib-rebase.sh
 
diff --git a/t/t3406-rebase-message.sh b/t/t3406-rebase-message.sh
index 4afc528165..863db3ac4c 100755
--- a/t/t3406-rebase-message.sh
+++ b/t/t3406-rebase-message.sh
@@ -2,6 +2,9 @@
 
 test_description='messages from rebase operation'
 
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 test_expect_success 'setup' '
diff --git a/t/t3407-rebase-abort.sh b/t/t3407-rebase-abort.sh
index 97efea0f56..e3c1851f40 100755
--- a/t/t3407-rebase-abort.sh
+++ b/t/t3407-rebase-abort.sh
@@ -2,6 +2,9 @@
 
 test_description='git rebase --abort tests'
 
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 ### Test that we handle space characters properly
diff --git a/t/t3408-rebase-multi-line.sh b/t/t3408-rebase-multi-line.sh
index d2bd7c17b0..6dd56c4c15 100755
--- a/t/t3408-rebase-multi-line.sh
+++ b/t/t3408-rebase-multi-line.sh
@@ -2,6 +2,9 @@
 
 test_description='rebasing a commit with multi-line first paragraph.'
 
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 test_expect_success setup '
diff --git a/t/t3409-rebase-preserve-merges.sh b/t/t3409-rebase-preserve-merges.sh
index 3b340f1ece..609efc96f9 100755
--- a/t/t3409-rebase-preserve-merges.sh
+++ b/t/t3409-rebase-preserve-merges.sh
@@ -6,6 +6,9 @@ test_description='git rebase -p should preserve merges
 
 Run "git rebase -p" and check that merges are properly carried along
 '
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 if ! test_have_prereq REBASE_P; then
diff --git a/t/t3412-rebase-root.sh b/t/t3412-rebase-root.sh
index 21632a984e..07597643c5 100755
--- a/t/t3412-rebase-root.sh
+++ b/t/t3412-rebase-root.sh
@@ -4,6 +4,9 @@ test_description='git rebase --root
 
 Tests if git rebase --root --onto <newparent> can rebase the root commit.
 '
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 log_with_names () {
diff --git a/t/t3413-rebase-hook.sh b/t/t3413-rebase-hook.sh
index b6833e9a5f..86a1b82d65 100755
--- a/t/t3413-rebase-hook.sh
+++ b/t/t3413-rebase-hook.sh
@@ -2,6 +2,9 @@
 
 test_description='git rebase with its hook(s)'
 
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 test_expect_success setup '
diff --git a/t/t3415-rebase-autosquash.sh b/t/t3415-rebase-autosquash.sh
index 7bab6000dc..35eb8e2bb2 100755
--- a/t/t3415-rebase-autosquash.sh
+++ b/t/t3415-rebase-autosquash.sh
@@ -2,6 +2,9 @@
 
 test_description='auto squash'
 
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 . "$TEST_DIRECTORY"/lib-rebase.sh
diff --git a/t/t3416-rebase-onto-threedots.sh b/t/t3416-rebase-onto-threedots.sh
index 9c2548423b..0f5b814aaf 100755
--- a/t/t3416-rebase-onto-threedots.sh
+++ b/t/t3416-rebase-onto-threedots.sh
@@ -2,6 +2,9 @@
 
 test_description='git rebase --onto A...B'
 
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 . "$TEST_DIRECTORY/lib-rebase.sh"
 
diff --git a/t/t3418-rebase-continue.sh b/t/t3418-rebase-continue.sh
index 7a2da972fd..445cb843ba 100755
--- a/t/t3418-rebase-continue.sh
+++ b/t/t3418-rebase-continue.sh
@@ -2,6 +2,9 @@
 
 test_description='git rebase --continue tests'
 
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 . "$TEST_DIRECTORY"/lib-rebase.sh
diff --git a/t/t3419-rebase-patch-id.sh b/t/t3419-rebase-patch-id.sh
index 1f32faa4a4..c5fe58d68b 100755
--- a/t/t3419-rebase-patch-id.sh
+++ b/t/t3419-rebase-patch-id.sh
@@ -2,6 +2,9 @@
 
 test_description='git rebase - test patch id computation'
 
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 scramble () {
diff --git a/t/t3420-rebase-autostash.sh b/t/t3420-rebase-autostash.sh
index ca331733fb..95facc49aa 100755
--- a/t/t3420-rebase-autostash.sh
+++ b/t/t3420-rebase-autostash.sh
@@ -4,6 +4,9 @@
 #
 
 test_description='git rebase --autostash tests'
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 test_expect_success setup '
diff --git a/t/t3427-rebase-subtree.sh b/t/t3427-rebase-subtree.sh
index 5839719ba1..254ed18452 100755
--- a/t/t3427-rebase-subtree.sh
+++ b/t/t3427-rebase-subtree.sh
@@ -4,6 +4,9 @@ test_description='git rebase tests for -Xsubtree
 
 This test runs git rebase and tests the subtree strategy.
 '
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 . "$TEST_DIRECTORY"/lib-rebase.sh
 
diff --git a/t/t3430-rebase-merges.sh b/t/t3430-rebase-merges.sh
index b454f400eb..22d929bd31 100755
--- a/t/t3430-rebase-merges.sh
+++ b/t/t3430-rebase-merges.sh
@@ -18,6 +18,9 @@ Initial setup:
      \
       Conflicting-G
 '
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 . "$TEST_DIRECTORY"/lib-rebase.sh
 . "$TEST_DIRECTORY"/lib-log-graph.sh
diff --git a/t/t3431-rebase-fork-point.sh b/t/t3431-rebase-fork-point.sh
index 172562789e..af862e5bcc 100755
--- a/t/t3431-rebase-fork-point.sh
+++ b/t/t3431-rebase-fork-point.sh
@@ -5,6 +5,9 @@
 
 test_description='git rebase --fork-point test'
 
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 # A---B---D---E    (master)
diff --git a/t/t3432-rebase-fast-forward.sh b/t/t3432-rebase-fast-forward.sh
index a29eda87e9..112a18d630 100755
--- a/t/t3432-rebase-fast-forward.sh
+++ b/t/t3432-rebase-fast-forward.sh
@@ -5,6 +5,9 @@
 
 test_description='ensure rebase fast-forwards commits when possible'
 
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 test_expect_success setup '
diff --git a/t/t3434-rebase-i18n.sh b/t/t3434-rebase-i18n.sh
index c7c835cde9..26fd33cbed 100755
--- a/t/t3434-rebase-i18n.sh
+++ b/t/t3434-rebase-i18n.sh
@@ -14,6 +14,9 @@ Initial setup:
     5 - 6          second
 '
 
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 compare_msg () {
diff --git a/t/t3435-rebase-gpg-sign.sh b/t/t3435-rebase-gpg-sign.sh
index 54120b09d6..d169bc511d 100755
--- a/t/t3435-rebase-gpg-sign.sh
+++ b/t/t3435-rebase-gpg-sign.sh
@@ -5,6 +5,9 @@
 
 test_description='test rebase --[no-]gpg-sign'
 
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 . "$TEST_DIRECTORY/lib-rebase.sh"
 . "$TEST_DIRECTORY/lib-gpg.sh"
diff --git a/t/t3500-cherry.sh b/t/t3500-cherry.sh
index 2b8d9cb38e..99905dd49a 100755
--- a/t/t3500-cherry.sh
+++ b/t/t3500-cherry.sh
@@ -8,6 +8,9 @@ test_description='git cherry should detect patches integrated upstream
 This test cherry-picks one local change of two into master branch, and
 checks that git cherry only returns the second patch in the local branch
 '
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 GIT_AUTHOR_EMAIL=bogus_email_address
diff --git a/t/t3501-revert-cherry-pick.sh b/t/t3501-revert-cherry-pick.sh
index 3669dfb1be..6a10714e22 100755
--- a/t/t3501-revert-cherry-pick.sh
+++ b/t/t3501-revert-cherry-pick.sh
@@ -10,6 +10,9 @@ test_description='test cherry-pick and revert with renames
 
 '
 
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 test_expect_success setup '
diff --git a/t/t3502-cherry-pick-merge.sh b/t/t3502-cherry-pick-merge.sh
index 8b635a196d..774ad9ce14 100755
--- a/t/t3502-cherry-pick-merge.sh
+++ b/t/t3502-cherry-pick-merge.sh
@@ -8,6 +8,9 @@ test_description='cherry picking and reverting a merge
 
 '
 
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 test_expect_success setup '
diff --git a/t/t3503-cherry-pick-root.sh b/t/t3503-cherry-pick-root.sh
index e27f39d1e5..00c622d5dc 100755
--- a/t/t3503-cherry-pick-root.sh
+++ b/t/t3503-cherry-pick-root.sh
@@ -2,6 +2,9 @@
 
 test_description='test cherry-picking (and reverting) a root commit'
 
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 test_expect_success setup '
diff --git a/t/t3504-cherry-pick-rerere.sh b/t/t3504-cherry-pick-rerere.sh
index 80a0d08706..860ba0b496 100755
--- a/t/t3504-cherry-pick-rerere.sh
+++ b/t/t3504-cherry-pick-rerere.sh
@@ -2,6 +2,9 @@
 
 test_description='cherry-pick should rerere for conflicts'
 
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 test_expect_success setup '
diff --git a/t/t3505-cherry-pick-empty.sh b/t/t3505-cherry-pick-empty.sh
index 5f911bb529..20cd4052d4 100755
--- a/t/t3505-cherry-pick-empty.sh
+++ b/t/t3505-cherry-pick-empty.sh
@@ -2,6 +2,9 @@
 
 test_description='test cherry-picking an empty commit'
 
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 test_expect_success setup '
diff --git a/t/t3506-cherry-pick-ff.sh b/t/t3506-cherry-pick-ff.sh
index 9d5adbc130..a105a782f6 100755
--- a/t/t3506-cherry-pick-ff.sh
+++ b/t/t3506-cherry-pick-ff.sh
@@ -2,6 +2,9 @@
 
 test_description='test cherry-picking with --ff option'
 
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 test_expect_success setup '
diff --git a/t/t3507-cherry-pick-conflict.sh b/t/t3507-cherry-pick-conflict.sh
index a21adcf0e4..e94264e578 100755
--- a/t/t3507-cherry-pick-conflict.sh
+++ b/t/t3507-cherry-pick-conflict.sh
@@ -9,6 +9,9 @@ test_description='test cherry-pick and revert with conflicts
 
 '
 
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 pristine_detach () {
diff --git a/t/t3508-cherry-pick-many-commits.sh b/t/t3508-cherry-pick-many-commits.sh
index 23070a7b73..b967bf0639 100755
--- a/t/t3508-cherry-pick-many-commits.sh
+++ b/t/t3508-cherry-pick-many-commits.sh
@@ -2,6 +2,9 @@
 
 test_description='test cherry-picking many commits'
 
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 check_head_differs_from() {
diff --git a/t/t3509-cherry-pick-merge-df.sh b/t/t3509-cherry-pick-merge-df.sh
index 1e5b3948df..83cab7b2ed 100755
--- a/t/t3509-cherry-pick-merge-df.sh
+++ b/t/t3509-cherry-pick-merge-df.sh
@@ -1,6 +1,9 @@
 #!/bin/sh
 
 test_description='Test cherry-pick with directory/file conflicts'
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 test_expect_success 'Initialize repository' '
diff --git a/t/t3512-cherry-pick-submodule.sh b/t/t3512-cherry-pick-submodule.sh
index 6ece1d8573..ff33c6d5c9 100755
--- a/t/t3512-cherry-pick-submodule.sh
+++ b/t/t3512-cherry-pick-submodule.sh
@@ -2,6 +2,9 @@
 
 test_description='cherry-pick can handle submodules'
 
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 . "$TEST_DIRECTORY"/lib-submodule-update.sh
 
diff --git a/t/t3600-rm.sh b/t/t3600-rm.sh
index efec8d13b6..3baa64bf99 100755
--- a/t/t3600-rm.sh
+++ b/t/t3600-rm.sh
@@ -5,6 +5,9 @@
 
 test_description='Test of the various options to git rm.'
 
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 # Setup some files to be removed, some with funny characters
diff --git a/t/t3701-add-interactive.sh b/t/t3701-add-interactive.sh
index ca04fac417..9be7527531 100755
--- a/t/t3701-add-interactive.sh
+++ b/t/t3701-add-interactive.sh
@@ -1,6 +1,9 @@
 #!/bin/sh
 
 test_description='add -i basic tests'
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 . "$TEST_DIRECTORY"/lib-terminal.sh
 
diff --git a/t/t3901-i18n-patch.sh b/t/t3901-i18n-patch.sh
index 923eb01f0e..bde27227b6 100755
--- a/t/t3901-i18n-patch.sh
+++ b/t/t3901-i18n-patch.sh
@@ -5,6 +5,9 @@
 
 test_description='i18n settings and format-patch | am pipe'
 
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 check_encoding () {
diff --git a/t/t3903-stash.sh b/t/t3903-stash.sh
index 9f7ca98967..49d52c46ad 100755
--- a/t/t3903-stash.sh
+++ b/t/t3903-stash.sh
@@ -5,6 +5,9 @@
 
 test_description='Test git stash'
 
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 diff_cmp () {
diff --git a/t/t3910-mac-os-precompose.sh b/t/t3910-mac-os-precompose.sh
index 54ce19e353..a2d1cdec6d 100755
--- a/t/t3910-mac-os-precompose.sh
+++ b/t/t3910-mac-os-precompose.sh
@@ -5,6 +5,9 @@
 
 test_description='utf-8 decomposed (nfd) converted to precomposed (nfc)'
 
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 if ! test_have_prereq UTF8_NFD_TO_NFC
diff --git a/t/t4013-diff-various.sh b/t/t4013-diff-various.sh
index f72d456d3b..45f68ebcdb 100755
--- a/t/t4013-diff-various.sh
+++ b/t/t4013-diff-various.sh
@@ -5,6 +5,9 @@
 
 test_description='Various diff formatting options'
 
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 . "$TEST_DIRECTORY"/diff-lib.sh
 
diff --git a/t/t4014-format-patch.sh b/t/t4014-format-patch.sh
index c5e5e0da3f..276aea32a6 100755
--- a/t/t4014-format-patch.sh
+++ b/t/t4014-format-patch.sh
@@ -5,6 +5,9 @@
 
 test_description='various format-patch tests'
 
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 . "$TEST_DIRECTORY"/lib-terminal.sh
 
diff --git a/t/t4017-diff-retval.sh b/t/t4017-diff-retval.sh
index 95a7ca7070..0b379c307b 100755
--- a/t/t4017-diff-retval.sh
+++ b/t/t4017-diff-retval.sh
@@ -2,6 +2,9 @@
 
 test_description='Return value of diffs'
 
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 test_expect_success 'setup' '
diff --git a/t/t4038-diff-combined.sh b/t/t4038-diff-combined.sh
index 94680836ce..e873abb1da 100755
--- a/t/t4038-diff-combined.sh
+++ b/t/t4038-diff-combined.sh
@@ -2,6 +2,9 @@
 
 test_description='combined diff'
 
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 . "$TEST_DIRECTORY"/diff-lib.sh
 
diff --git a/t/t4041-diff-submodule-option.sh b/t/t4041-diff-submodule-option.sh
index f852136585..8014cd684b 100755
--- a/t/t4041-diff-submodule-option.sh
+++ b/t/t4041-diff-submodule-option.sh
@@ -9,6 +9,9 @@ test_description='Support for verbose submodule differences in git diff
 This test tries to verify the sanity of the --submodule option of git diff.
 '
 
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 # Tested non-UTF-8 encoding
diff --git a/t/t4048-diff-combined-binary.sh b/t/t4048-diff-combined-binary.sh
index 7f9ad9fa3d..e2780e697a 100755
--- a/t/t4048-diff-combined-binary.sh
+++ b/t/t4048-diff-combined-binary.sh
@@ -1,6 +1,9 @@
 #!/bin/sh
 
 test_description='combined and merge diff handle binary files and textconv'
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 test_expect_success 'setup binary merge conflict' '
diff --git a/t/t4052-stat-output.sh b/t/t4052-stat-output.sh
index 28c053849a..a9aef7f986 100755
--- a/t/t4052-stat-output.sh
+++ b/t/t4052-stat-output.sh
@@ -5,6 +5,9 @@
 
 test_description='test --stat output of various commands'
 
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 . "$TEST_DIRECTORY"/lib-terminal.sh
 
diff --git a/t/t4056-diff-order.sh b/t/t4056-diff-order.sh
index 43dd474a12..723eee4e8e 100755
--- a/t/t4056-diff-order.sh
+++ b/t/t4056-diff-order.sh
@@ -2,6 +2,9 @@
 
 test_description='diff order'
 
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 create_files () {
diff --git a/t/t4057-diff-combined-paths.sh b/t/t4057-diff-combined-paths.sh
index 0b78573733..71af157bf9 100755
--- a/t/t4057-diff-combined-paths.sh
+++ b/t/t4057-diff-combined-paths.sh
@@ -2,6 +2,9 @@
 
 test_description='combined diff show only paths that are different to all parents'
 
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 # verify that diffc.expect matches output of
diff --git a/t/t4061-diff-indent.sh b/t/t4061-diff-indent.sh
index 0f7a6d97a8..cbe64d5f79 100755
--- a/t/t4061-diff-indent.sh
+++ b/t/t4061-diff-indent.sh
@@ -3,6 +3,9 @@
 test_description='Test diff indent heuristic.
 
 '
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 . "$TEST_DIRECTORY"/diff-lib.sh
 
diff --git a/t/t4066-diff-emit-delay.sh b/t/t4066-diff-emit-delay.sh
index 6331f63b12..1983f1ebbe 100755
--- a/t/t4066-diff-emit-delay.sh
+++ b/t/t4066-diff-emit-delay.sh
@@ -1,6 +1,9 @@
 #!/bin/sh
 
 test_description='test combined/stat/moved interaction'
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 # This test covers a weird 3-way interaction between "--cc -p", which will run
diff --git a/t/t4068-diff-symmetric-merge-base.sh b/t/t4068-diff-symmetric-merge-base.sh
index 03487cc945..55d47352ba 100755
--- a/t/t4068-diff-symmetric-merge-base.sh
+++ b/t/t4068-diff-symmetric-merge-base.sh
@@ -2,6 +2,9 @@
 
 test_description='behavior of diff with symmetric-diff setups and --merge-base'
 
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 # build these situations:
diff --git a/t/t4103-apply-binary.sh b/t/t4103-apply-binary.sh
index 1b420e3b5f..ee4a74b132 100755
--- a/t/t4103-apply-binary.sh
+++ b/t/t4103-apply-binary.sh
@@ -6,6 +6,9 @@
 test_description='git apply handling binary patches
 
 '
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 test_expect_success 'setup' '
diff --git a/t/t4108-apply-threeway.sh b/t/t4108-apply-threeway.sh
index d7349ced6b..0a091dc5a0 100755
--- a/t/t4108-apply-threeway.sh
+++ b/t/t4108-apply-threeway.sh
@@ -2,6 +2,9 @@
 
 test_description='git apply --3way'
 
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 print_sanitized_conflicted_diff () {
diff --git a/t/t4121-apply-diffs.sh b/t/t4121-apply-diffs.sh
index 66368effd5..60deb3bf78 100755
--- a/t/t4121-apply-diffs.sh
+++ b/t/t4121-apply-diffs.sh
@@ -1,6 +1,9 @@
 #!/bin/sh
 
 test_description='git apply for contextually independent diffs'
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 echo '1
diff --git a/t/t4122-apply-symlink-inside.sh b/t/t4122-apply-symlink-inside.sh
index 4acb3f336e..71deaf779d 100755
--- a/t/t4122-apply-symlink-inside.sh
+++ b/t/t4122-apply-symlink-inside.sh
@@ -1,6 +1,9 @@
 #!/bin/sh
 
 test_description='apply to deeper directory without getting fooled with symlink'
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 test_expect_success setup '
diff --git a/t/t4150-am.sh b/t/t4150-am.sh
index 3ecbef6f8e..e1ffc04852 100755
--- a/t/t4150-am.sh
+++ b/t/t4150-am.sh
@@ -2,6 +2,9 @@
 
 test_description='git am running'
 
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 test_expect_success 'setup: messages' '
diff --git a/t/t4200-rerere.sh b/t/t4200-rerere.sh
index b12b43e9e9..1f1a809c60 100755
--- a/t/t4200-rerere.sh
+++ b/t/t4200-rerere.sh
@@ -22,6 +22,9 @@ test_description='git rerere
 ++++++ [master] initial
 '
 
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 test_expect_success 'setup' '
diff --git a/t/t4201-shortlog.sh b/t/t4201-shortlog.sh
index 3d5c4a2086..ad6d3eebe5 100755
--- a/t/t4201-shortlog.sh
+++ b/t/t4201-shortlog.sh
@@ -6,6 +6,9 @@
 test_description='git shortlog
 '
 
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 test_expect_success 'setup' '
diff --git a/t/t4202-log.sh b/t/t4202-log.sh
index 56d34ed465..6c7a3cfc2c 100755
--- a/t/t4202-log.sh
+++ b/t/t4202-log.sh
@@ -2,6 +2,9 @@
 
 test_description='git log'
 
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 . "$TEST_DIRECTORY/lib-gpg.sh"
 . "$TEST_DIRECTORY/lib-terminal.sh"
diff --git a/t/t4203-mailmap.sh b/t/t4203-mailmap.sh
index 586c3a86b1..8a2f8984f6 100755
--- a/t/t4203-mailmap.sh
+++ b/t/t4203-mailmap.sh
@@ -2,6 +2,9 @@
 
 test_description='.mailmap configurations'
 
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 fuzz_blame () {
diff --git a/t/t4204-patch-id.sh b/t/t4204-patch-id.sh
index 8ff8bd84c7..46ecb777f4 100755
--- a/t/t4204-patch-id.sh
+++ b/t/t4204-patch-id.sh
@@ -2,6 +2,9 @@
 
 test_description='git patch-id'
 
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 test_expect_success 'setup' '
diff --git a/t/t4207-log-decoration-colors.sh b/t/t4207-log-decoration-colors.sh
index 60f040cab8..6c868df38d 100755
--- a/t/t4207-log-decoration-colors.sh
+++ b/t/t4207-log-decoration-colors.sh
@@ -5,6 +5,9 @@
 
 test_description='Test for "git log --decorate" colors'
 
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 test_expect_success setup '
diff --git a/t/t4208-log-magic-pathspec.sh b/t/t4208-log-magic-pathspec.sh
index 6cdbe4747a..1938d4a58f 100755
--- a/t/t4208-log-magic-pathspec.sh
+++ b/t/t4208-log-magic-pathspec.sh
@@ -2,6 +2,9 @@
 
 test_description='magic pathspec tests using git-log'
 
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 test_expect_success 'setup' '
diff --git a/t/t4211-line-log.sh b/t/t4211-line-log.sh
index 85d151423d..59c258429d 100755
--- a/t/t4211-line-log.sh
+++ b/t/t4211-line-log.sh
@@ -1,6 +1,9 @@
 #!/bin/sh
 
 test_description='test log -L'
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 test_expect_success 'setup (import history)' '
diff --git a/t/t4214-log-graph-octopus.sh b/t/t4214-log-graph-octopus.sh
index a080325098..981b83513a 100755
--- a/t/t4214-log-graph-octopus.sh
+++ b/t/t4214-log-graph-octopus.sh
@@ -2,6 +2,9 @@
 
 test_description='git log --graph of skewed left octopus merge.'
 
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 . "$TEST_DIRECTORY"/lib-log-graph.sh
 
diff --git a/t/t4216-log-bloom.sh b/t/t4216-log-bloom.sh
index d11040ce41..b3f3820dbb 100755
--- a/t/t4216-log-bloom.sh
+++ b/t/t4216-log-bloom.sh
@@ -1,6 +1,9 @@
 #!/bin/sh
 
 test_description='git log for a path with Bloom filters'
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 GIT_TEST_COMMIT_GRAPH=0
diff --git a/t/t4253-am-keep-cr-dos.sh b/t/t4253-am-keep-cr-dos.sh
index 6e1b73ec3a..ec7ba62d67 100755
--- a/t/t4253-am-keep-cr-dos.sh
+++ b/t/t4253-am-keep-cr-dos.sh
@@ -6,6 +6,9 @@
 test_description='git-am mbox with dos line ending.
 
 '
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 # Three patches which will be added as files with dos line ending.
diff --git a/t/t5150-request-pull.sh b/t/t5150-request-pull.sh
index c1811ea0f4..752e1fb2d2 100755
--- a/t/t5150-request-pull.sh
+++ b/t/t5150-request-pull.sh
@@ -2,6 +2,9 @@
 
 test_description='Test workflows involving pull request.'
 
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 if ! test_have_prereq PERL
diff --git a/t/t5304-prune.sh b/t/t5304-prune.sh
index df60f18fb8..bd5f71e396 100755
--- a/t/t5304-prune.sh
+++ b/t/t5304-prune.sh
@@ -4,6 +4,9 @@
 #
 
 test_description='prune'
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 day=$((60*60*24))
diff --git a/t/t5305-include-tag.sh b/t/t5305-include-tag.sh
index a5eca210b8..2e56887ed5 100755
--- a/t/t5305-include-tag.sh
+++ b/t/t5305-include-tag.sh
@@ -1,6 +1,9 @@
 #!/bin/sh
 
 test_description='git pack-object --include-tag'
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 TRASH=$(pwd)
diff --git a/t/t5310-pack-bitmaps.sh b/t/t5310-pack-bitmaps.sh
index 8318781d2b..7842eb0977 100755
--- a/t/t5310-pack-bitmaps.sh
+++ b/t/t5310-pack-bitmaps.sh
@@ -1,6 +1,9 @@
 #!/bin/sh
 
 test_description='exercise basic bitmap functionality'
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 objpath () {
diff --git a/t/t5312-prune-corruption.sh b/t/t5312-prune-corruption.sh
index da9d59940d..c70b5db2a0 100755
--- a/t/t5312-prune-corruption.sh
+++ b/t/t5312-prune-corruption.sh
@@ -8,6 +8,9 @@ bail out or to proceed using it as a reachable tip, but it is _not_
 OK to proceed as if it did not exist. Otherwise we might silently
 delete objects that cannot be recovered.
 '
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 test_expect_success 'disable reflogs' '
diff --git a/t/t5317-pack-objects-filter-objects.sh b/t/t5317-pack-objects-filter-objects.sh
index dc0446574b..f19c521292 100755
--- a/t/t5317-pack-objects-filter-objects.sh
+++ b/t/t5317-pack-objects-filter-objects.sh
@@ -2,6 +2,9 @@
 
 test_description='git pack-objects using object filtering'
 
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 # Test blob:none filter.
diff --git a/t/t5322-pack-objects-sparse.sh b/t/t5322-pack-objects-sparse.sh
index a581eaf529..c92658d026 100755
--- a/t/t5322-pack-objects-sparse.sh
+++ b/t/t5322-pack-objects-sparse.sh
@@ -1,6 +1,9 @@
 #!/bin/sh
 
 test_description='pack-objects object selection using sparse algorithm'
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 test_expect_success 'setup repo' '
diff --git a/t/t5400-send-pack.sh b/t/t5400-send-pack.sh
index cc86ef213e..6be028f3e2 100755
--- a/t/t5400-send-pack.sh
+++ b/t/t5400-send-pack.sh
@@ -6,6 +6,9 @@
 test_description='See why rewinding head breaks send-pack
 
 '
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 cnt=64
diff --git a/t/t5402-post-merge-hook.sh b/t/t5402-post-merge-hook.sh
index 4aeea8f5b7..27fc6ec4f3 100755
--- a/t/t5402-post-merge-hook.sh
+++ b/t/t5402-post-merge-hook.sh
@@ -4,6 +4,9 @@
 #
 
 test_description='Test the post-merge hook.'
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 test_expect_success setup '
diff --git a/t/t5403-post-checkout-hook.sh b/t/t5403-post-checkout-hook.sh
index a39b3b5c78..ed91aadd95 100755
--- a/t/t5403-post-checkout-hook.sh
+++ b/t/t5403-post-checkout-hook.sh
@@ -4,6 +4,9 @@
 #
 
 test_description='Test the post-checkout hook.'
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 test_expect_success setup '
diff --git a/t/t5404-tracking-branches.sh b/t/t5404-tracking-branches.sh
index 2762f420bc..da37b22fc5 100755
--- a/t/t5404-tracking-branches.sh
+++ b/t/t5404-tracking-branches.sh
@@ -2,6 +2,9 @@
 
 test_description='tracking branch update checks for git push'
 
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 test_expect_success 'setup' '
diff --git a/t/t5405-send-pack-rewind.sh b/t/t5405-send-pack-rewind.sh
index 235fb7686a..1f5b33b562 100755
--- a/t/t5405-send-pack-rewind.sh
+++ b/t/t5405-send-pack-rewind.sh
@@ -2,6 +2,9 @@
 
 test_description='forced push to replace commit we do not have'
 
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 test_expect_success setup '
diff --git a/t/t5407-post-rewrite-hook.sh b/t/t5407-post-rewrite-hook.sh
index 80750a817e..78bffa64d7 100755
--- a/t/t5407-post-rewrite-hook.sh
+++ b/t/t5407-post-rewrite-hook.sh
@@ -4,6 +4,9 @@
 #
 
 test_description='Test the post-rewrite hook.'
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 test_expect_success 'setup' '
diff --git a/t/t5410-receive-pack-alternates.sh b/t/t5410-receive-pack-alternates.sh
index f00d0da860..30a4e6bb1a 100755
--- a/t/t5410-receive-pack-alternates.sh
+++ b/t/t5410-receive-pack-alternates.sh
@@ -2,6 +2,9 @@
 
 test_description='git receive-pack with alternate ref filtering'
 
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 test_expect_success 'setup' '
diff --git a/t/t5500-fetch-pack.sh b/t/t5500-fetch-pack.sh
index 3557374312..4edb8c196e 100755
--- a/t/t5500-fetch-pack.sh
+++ b/t/t5500-fetch-pack.sh
@@ -5,6 +5,9 @@
 
 test_description='Testing multi_ack pack fetching'
 
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 # Test fetch-pack/upload-pack pair.
diff --git a/t/t5501-fetch-push-alternates.sh b/t/t5501-fetch-push-alternates.sh
index 1bc57ac03f..96ce28b6ba 100755
--- a/t/t5501-fetch-push-alternates.sh
+++ b/t/t5501-fetch-push-alternates.sh
@@ -1,6 +1,9 @@
 #!/bin/sh
 
 test_description='fetch/push involving alternates'
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 count_objects () {
diff --git a/t/t5502-quickfetch.sh b/t/t5502-quickfetch.sh
index 7a46cbdbe6..e15a472e4c 100755
--- a/t/t5502-quickfetch.sh
+++ b/t/t5502-quickfetch.sh
@@ -2,6 +2,9 @@
 
 test_description='test quickfetch from local'
 
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 test_expect_success setup '
diff --git a/t/t5503-tagfollow.sh b/t/t5503-tagfollow.sh
index 6041a4dd32..cd1f407174 100755
--- a/t/t5503-tagfollow.sh
+++ b/t/t5503-tagfollow.sh
@@ -2,6 +2,9 @@
 
 test_description='test automatic tag following'
 
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 # End state of the repository:
diff --git a/t/t5504-fetch-receive-strict.sh b/t/t5504-fetch-receive-strict.sh
index 1a16ac4c0d..7fe21b176d 100755
--- a/t/t5504-fetch-receive-strict.sh
+++ b/t/t5504-fetch-receive-strict.sh
@@ -1,6 +1,9 @@
 #!/bin/sh
 
 test_description='fetch/receive strict mode'
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 test_expect_success 'setup and inject "corrupt or missing" object' '
diff --git a/t/t5505-remote.sh b/t/t5505-remote.sh
index eaa6e90220..2b6e1f50f8 100755
--- a/t/t5505-remote.sh
+++ b/t/t5505-remote.sh
@@ -2,6 +2,9 @@
 
 test_description='git remote porcelain-ish'
 
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 setup_repository () {
diff --git a/t/t5506-remote-groups.sh b/t/t5506-remote-groups.sh
index 83d5558c0e..bf3aa85da5 100755
--- a/t/t5506-remote-groups.sh
+++ b/t/t5506-remote-groups.sh
@@ -1,6 +1,9 @@
 #!/bin/sh
 
 test_description='git remote group handling'
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 mark() {
diff --git a/t/t5509-fetch-push-namespaces.sh b/t/t5509-fetch-push-namespaces.sh
index a67f792adf..f234dba91a 100755
--- a/t/t5509-fetch-push-namespaces.sh
+++ b/t/t5509-fetch-push-namespaces.sh
@@ -1,6 +1,9 @@
 #!/bin/sh
 
 test_description='fetch/push involving ref namespaces'
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 test_expect_success setup '
diff --git a/t/t5510-fetch.sh b/t/t5510-fetch.sh
index 5d673358f9..4af490b6db 100755
--- a/t/t5510-fetch.sh
+++ b/t/t5510-fetch.sh
@@ -5,6 +5,9 @@ test_description='Per branch config variables affects "git fetch".
 
 '
 
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 D=$(pwd)
diff --git a/t/t5512-ls-remote.sh b/t/t5512-ls-remote.sh
index e98c3a0174..a892807de2 100755
--- a/t/t5512-ls-remote.sh
+++ b/t/t5512-ls-remote.sh
@@ -2,6 +2,9 @@
 
 test_description='git ls-remote'
 
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 generate_references () {
diff --git a/t/t5514-fetch-multiple.sh b/t/t5514-fetch-multiple.sh
index bd202ec6f3..f12a83f82b 100755
--- a/t/t5514-fetch-multiple.sh
+++ b/t/t5514-fetch-multiple.sh
@@ -2,6 +2,9 @@
 
 test_description='fetch --all works correctly'
 
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 setup_repository () {
diff --git a/t/t5516-fetch-push.sh b/t/t5516-fetch-push.sh
index d11382f769..7003467523 100755
--- a/t/t5516-fetch-push.sh
+++ b/t/t5516-fetch-push.sh
@@ -14,6 +14,9 @@ This test checks the following functionality:
 * reflogs
 '
 
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 D=$(pwd)
diff --git a/t/t5517-push-mirror.sh b/t/t5517-push-mirror.sh
index e4edd56404..aa6405b452 100755
--- a/t/t5517-push-mirror.sh
+++ b/t/t5517-push-mirror.sh
@@ -2,6 +2,9 @@
 
 test_description='pushing to a mirror repository'
 
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 D=$(pwd)
diff --git a/t/t5518-fetch-exit-status.sh b/t/t5518-fetch-exit-status.sh
index c2060bb870..a94d0744d0 100755
--- a/t/t5518-fetch-exit-status.sh
+++ b/t/t5518-fetch-exit-status.sh
@@ -5,6 +5,9 @@
 
 test_description='fetch exit status test'
 
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 test_expect_success setup '
diff --git a/t/t5519-push-alternates.sh b/t/t5519-push-alternates.sh
index 11fcd37700..0f199d0ccb 100755
--- a/t/t5519-push-alternates.sh
+++ b/t/t5519-push-alternates.sh
@@ -2,6 +2,9 @@
 
 test_description='push to a repository that borrows from elsewhere'
 
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 test_expect_success setup '
diff --git a/t/t5520-pull.sh b/t/t5520-pull.sh
index 9fae07cdfa..b6b21c6cd1 100755
--- a/t/t5520-pull.sh
+++ b/t/t5520-pull.sh
@@ -2,6 +2,9 @@
 
 test_description='pulling into void'
 
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 modify () {
diff --git a/t/t5521-pull-options.sh b/t/t5521-pull-options.sh
index db1a381cd9..f0806f3eb5 100755
--- a/t/t5521-pull-options.sh
+++ b/t/t5521-pull-options.sh
@@ -2,6 +2,9 @@
 
 test_description='pull options'
 
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 test_expect_success 'setup' '
diff --git a/t/t5523-push-upstream.sh b/t/t5523-push-upstream.sh
index e47b5db5d6..0e6c7c251b 100755
--- a/t/t5523-push-upstream.sh
+++ b/t/t5523-push-upstream.sh
@@ -1,6 +1,9 @@
 #!/bin/sh
 
 test_description='push with --set-upstream'
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 . "$TEST_DIRECTORY"/lib-terminal.sh
 
diff --git a/t/t5526-fetch-submodules.sh b/t/t5526-fetch-submodules.sh
index dd8e423d25..40fb276e0e 100755
--- a/t/t5526-fetch-submodules.sh
+++ b/t/t5526-fetch-submodules.sh
@@ -3,6 +3,9 @@
 
 test_description='Recursive "git fetch" for submodules'
 
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 pwd=$(pwd)
diff --git a/t/t5527-fetch-odd-refs.sh b/t/t5527-fetch-odd-refs.sh
index 3b0cb98422..4aa1fb7281 100755
--- a/t/t5527-fetch-odd-refs.sh
+++ b/t/t5527-fetch-odd-refs.sh
@@ -1,6 +1,9 @@
 #!/bin/sh
 
 test_description='test fetching of oddly-named refs'
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 # afterwards we will have:
diff --git a/t/t5528-push-default.sh b/t/t5528-push-default.sh
index f0a287d97d..b39b5171dc 100755
--- a/t/t5528-push-default.sh
+++ b/t/t5528-push-default.sh
@@ -1,6 +1,9 @@
 #!/bin/sh
 
 test_description='check various push.default settings'
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 test_expect_success 'setup bare remotes' '
diff --git a/t/t5531-deep-submodule-push.sh b/t/t5531-deep-submodule-push.sh
index 4ad059e6be..010f5a0207 100755
--- a/t/t5531-deep-submodule-push.sh
+++ b/t/t5531-deep-submodule-push.sh
@@ -2,6 +2,9 @@
 
 test_description='test push with submodules'
 
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 test_expect_success setup '
diff --git a/t/t5533-push-cas.sh b/t/t5533-push-cas.sh
index 7813e8470e..a7f0f098dd 100755
--- a/t/t5533-push-cas.sh
+++ b/t/t5533-push-cas.sh
@@ -2,6 +2,9 @@
 
 test_description='compare & swap push force/delete safety'
 
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 setup_srcdst_basic () {
diff --git a/t/t5534-push-signed.sh b/t/t5534-push-signed.sh
index af0385fb89..6ab458684d 100755
--- a/t/t5534-push-signed.sh
+++ b/t/t5534-push-signed.sh
@@ -2,6 +2,9 @@
 
 test_description='signed push'
 
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 . "$TEST_DIRECTORY"/lib-gpg.sh
 
diff --git a/t/t5537-fetch-shallow.sh b/t/t5537-fetch-shallow.sh
index a55202d2d3..6de384a5ea 100755
--- a/t/t5537-fetch-shallow.sh
+++ b/t/t5537-fetch-shallow.sh
@@ -2,6 +2,9 @@
 
 test_description='fetch/clone from a shallow clone'
 
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 commit() {
diff --git a/t/t5538-push-shallow.sh b/t/t5538-push-shallow.sh
index ecbf84d21c..1253429d5d 100755
--- a/t/t5538-push-shallow.sh
+++ b/t/t5538-push-shallow.sh
@@ -2,6 +2,9 @@
 
 test_description='push from/to a shallow clone'
 
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 commit() {
diff --git a/t/t5539-fetch-http-shallow.sh b/t/t5539-fetch-http-shallow.sh
index 82aa99ae87..1da2a7533e 100755
--- a/t/t5539-fetch-http-shallow.sh
+++ b/t/t5539-fetch-http-shallow.sh
@@ -2,6 +2,9 @@
 
 test_description='fetch/clone from a shallow clone over http'
 
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 . "$TEST_DIRECTORY"/lib-httpd.sh
 start_httpd
diff --git a/t/t5540-http-push-webdav.sh b/t/t5540-http-push-webdav.sh
index 450321fddb..751116e123 100755
--- a/t/t5540-http-push-webdav.sh
+++ b/t/t5540-http-push-webdav.sh
@@ -7,6 +7,9 @@ test_description='test WebDAV http-push
 
 This test runs various sanity checks on http-push.'
 
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 if git http-push > /dev/null 2>&1 || [ $? -eq 128 ]
diff --git a/t/t5541-http-push-smart.sh b/t/t5541-http-push-smart.sh
index 187454f5dd..2836b87239 100755
--- a/t/t5541-http-push-smart.sh
+++ b/t/t5541-http-push-smart.sh
@@ -4,6 +4,9 @@
 #
 
 test_description='test smart pushing over http via http-backend'
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 ROOT_PATH="$PWD"
diff --git a/t/t5542-push-http-shallow.sh b/t/t5542-push-http-shallow.sh
index ddc1db722d..0feec9c449 100755
--- a/t/t5542-push-http-shallow.sh
+++ b/t/t5542-push-http-shallow.sh
@@ -2,6 +2,9 @@
 
 test_description='push from/to a shallow clone over http'
 
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 . "$TEST_DIRECTORY"/lib-httpd.sh
 start_httpd
diff --git a/t/t5543-atomic-push.sh b/t/t5543-atomic-push.sh
index 620c30d58f..16a8fc7535 100755
--- a/t/t5543-atomic-push.sh
+++ b/t/t5543-atomic-push.sh
@@ -2,6 +2,9 @@
 
 test_description='pushing to a repository using the atomic push option'
 
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 mk_repo_pair () {
diff --git a/t/t5545-push-options.sh b/t/t5545-push-options.sh
index 38e6f7340e..202d75aebe 100755
--- a/t/t5545-push-options.sh
+++ b/t/t5545-push-options.sh
@@ -2,6 +2,9 @@
 
 test_description='pushing to a repository using push options'
 
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 mk_repo_pair () {
diff --git a/t/t5550-http-fetch-dumb.sh b/t/t5550-http-fetch-dumb.sh
index 483578b2d7..9ec91792c3 100755
--- a/t/t5550-http-fetch-dumb.sh
+++ b/t/t5550-http-fetch-dumb.sh
@@ -1,6 +1,9 @@
 #!/bin/sh
 
 test_description='test dumb fetching over http via static file'
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 . "$TEST_DIRECTORY"/lib-httpd.sh
 start_httpd
diff --git a/t/t5551-http-fetch-smart.sh b/t/t5551-http-fetch-smart.sh
index e40e9ed52f..310b89dbab 100755
--- a/t/t5551-http-fetch-smart.sh
+++ b/t/t5551-http-fetch-smart.sh
@@ -1,6 +1,9 @@
 #!/bin/sh
 
 test_description='test smart fetching over http via http-backend'
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 . "$TEST_DIRECTORY"/lib-httpd.sh
 start_httpd
diff --git a/t/t5553-set-upstream.sh b/t/t5553-set-upstream.sh
index 7622981cbf..e78a21881f 100755
--- a/t/t5553-set-upstream.sh
+++ b/t/t5553-set-upstream.sh
@@ -1,6 +1,9 @@
 #!/bin/sh
 
 test_description='"git fetch/pull --set-upstream" basic tests.'
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 check_config () {
diff --git a/t/t5560-http-backend-noserver.sh b/t/t5560-http-backend-noserver.sh
index 9fafcf1945..5561b7d012 100755
--- a/t/t5560-http-backend-noserver.sh
+++ b/t/t5560-http-backend-noserver.sh
@@ -1,6 +1,9 @@
 #!/bin/sh
 
 test_description='test git-http-backend-noserver'
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 HTTPD_DOCUMENT_ROOT_PATH="$TRASH_DIRECTORY"
diff --git a/t/t5561-http-backend.sh b/t/t5561-http-backend.sh
index 6eb0294978..cba2dffdb0 100755
--- a/t/t5561-http-backend.sh
+++ b/t/t5561-http-backend.sh
@@ -1,6 +1,9 @@
 #!/bin/sh
 
 test_description='test git-http-backend'
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 . "$TEST_DIRECTORY"/lib-httpd.sh
 
diff --git a/t/t5570-git-daemon.sh b/t/t5570-git-daemon.sh
index 8f69a7854f..2e99a331c5 100755
--- a/t/t5570-git-daemon.sh
+++ b/t/t5570-git-daemon.sh
@@ -1,6 +1,9 @@
 #!/bin/sh
 
 test_description='test fetching over git protocol'
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 . "$TEST_DIRECTORY"/lib-git-daemon.sh
diff --git a/t/t5571-pre-push-hook.sh b/t/t5571-pre-push-hook.sh
index ac53d63869..971ed3da4b 100755
--- a/t/t5571-pre-push-hook.sh
+++ b/t/t5571-pre-push-hook.sh
@@ -1,6 +1,9 @@
 #!/bin/sh
 
 test_description='check pre-push hooks'
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 # Setup hook that always succeeds
diff --git a/t/t5580-unc-paths.sh b/t/t5580-unc-paths.sh
index cf768b3a27..da4c94cce1 100755
--- a/t/t5580-unc-paths.sh
+++ b/t/t5580-unc-paths.sh
@@ -1,6 +1,9 @@
 #!/bin/sh
 
 test_description='various Windows-only path tests'
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 if test_have_prereq CYGWIN
diff --git a/t/t5581-http-curl-verbose.sh b/t/t5581-http-curl-verbose.sh
index 927aad0820..907bb062d6 100755
--- a/t/t5581-http-curl-verbose.sh
+++ b/t/t5581-http-curl-verbose.sh
@@ -1,6 +1,9 @@
 #!/bin/sh
 
 test_description='test GIT_CURL_VERBOSE'
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 . "$TEST_DIRECTORY"/lib-httpd.sh
 start_httpd
diff --git a/t/t5582-fetch-negative-refspec.sh b/t/t5582-fetch-negative-refspec.sh
index 8c61e28fec..608e9aa189 100755
--- a/t/t5582-fetch-negative-refspec.sh
+++ b/t/t5582-fetch-negative-refspec.sh
@@ -5,6 +5,9 @@ test_description='"git fetch" with negative refspecs.
 
 '
 
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 test_expect_success setup '
diff --git a/t/t5601-clone.sh b/t/t5601-clone.sh
index 7df3c5373a..e01c5fe02d 100755
--- a/t/t5601-clone.sh
+++ b/t/t5601-clone.sh
@@ -2,6 +2,9 @@
 
 test_description=clone
 
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 X=
diff --git a/t/t5604-clone-reference.sh b/t/t5604-clone-reference.sh
index 2f7be23044..20fbb1e9a3 100755
--- a/t/t5604-clone-reference.sh
+++ b/t/t5604-clone-reference.sh
@@ -4,6 +4,9 @@
 #
 
 test_description='test clone --reference'
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 base_dir=$(pwd)
diff --git a/t/t5605-clone-local.sh b/t/t5605-clone-local.sh
index af23419ebf..94028044b0 100755
--- a/t/t5605-clone-local.sh
+++ b/t/t5605-clone-local.sh
@@ -1,6 +1,9 @@
 #!/bin/sh
 
 test_description='test local clone'
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 repo_is_hardlinked() {
diff --git a/t/t5606-clone-options.sh b/t/t5606-clone-options.sh
index 7f082fb23b..3893a49e6d 100755
--- a/t/t5606-clone-options.sh
+++ b/t/t5606-clone-options.sh
@@ -1,6 +1,9 @@
 #!/bin/sh
 
 test_description='basic clone options'
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 test_expect_success 'setup' '
diff --git a/t/t5607-clone-bundle.sh b/t/t5607-clone-bundle.sh
index 26985f4b44..6e2e4adbb4 100755
--- a/t/t5607-clone-bundle.sh
+++ b/t/t5607-clone-bundle.sh
@@ -1,6 +1,9 @@
 #!/bin/sh
 
 test_description='some bundle related tests'
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 test_expect_success 'setup' '
diff --git a/t/t5609-clone-branch.sh b/t/t5609-clone-branch.sh
index 6e7a7be052..e4d5124f89 100755
--- a/t/t5609-clone-branch.sh
+++ b/t/t5609-clone-branch.sh
@@ -1,6 +1,9 @@
 #!/bin/sh
 
 test_description='clone --branch option'
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 check_HEAD() {
diff --git a/t/t5610-clone-detached.sh b/t/t5610-clone-detached.sh
index 8b0d607df1..ba63ba8f42 100755
--- a/t/t5610-clone-detached.sh
+++ b/t/t5610-clone-detached.sh
@@ -1,6 +1,9 @@
 #!/bin/sh
 
 test_description='test cloning a repository with detached HEAD'
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 head_is_detached() {
diff --git a/t/t5611-clone-config.sh b/t/t5611-clone-config.sh
index 8e0fd39823..be4ae10c82 100755
--- a/t/t5611-clone-config.sh
+++ b/t/t5611-clone-config.sh
@@ -1,6 +1,9 @@
 #!/bin/sh
 
 test_description='tests for git clone -c key=value'
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 test_expect_success 'clone -c sets config in cloned repo' '
diff --git a/t/t5612-clone-refspec.sh b/t/t5612-clone-refspec.sh
index e3b436d8ae..9e37f7fef7 100755
--- a/t/t5612-clone-refspec.sh
+++ b/t/t5612-clone-refspec.sh
@@ -1,6 +1,9 @@
 #!/bin/sh
 
 test_description='test refspec written by clone-command'
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 test_expect_success 'setup' '
diff --git a/t/t5616-partial-clone.sh b/t/t5616-partial-clone.sh
index f4d49d8335..b2c3ed4088 100755
--- a/t/t5616-partial-clone.sh
+++ b/t/t5616-partial-clone.sh
@@ -2,6 +2,9 @@
 
 test_description='git partial clone'
 
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 # create a normal "src" repo where we can later create new commits.
diff --git a/t/t5617-clone-submodules-remote.sh b/t/t5617-clone-submodules-remote.sh
index 1a041df10b..cba468fc53 100755
--- a/t/t5617-clone-submodules-remote.sh
+++ b/t/t5617-clone-submodules-remote.sh
@@ -2,6 +2,9 @@
 
 test_description='Test cloning repos with submodules using remote-tracking branches'
 
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 pwd=$(pwd)
diff --git a/t/t5700-protocol-v1.sh b/t/t5700-protocol-v1.sh
index 022901b9eb..7f0056c1ed 100755
--- a/t/t5700-protocol-v1.sh
+++ b/t/t5700-protocol-v1.sh
@@ -8,6 +8,9 @@ TEST_NO_CREATE_REPO=1
 GIT_TEST_PROTOCOL_VERSION=0
 export GIT_TEST_PROTOCOL_VERSION
 
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 # Test protocol v1 with 'git://' transport
diff --git a/t/t5701-git-serve.sh b/t/t5701-git-serve.sh
index a1f5fdc9fd..66c47e61d8 100755
--- a/t/t5701-git-serve.sh
+++ b/t/t5701-git-serve.sh
@@ -2,6 +2,9 @@
 
 test_description='test protocol v2 server commands'
 
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 test_expect_success 'test capability advertisement' '
diff --git a/t/t5702-protocol-v2.sh b/t/t5702-protocol-v2.sh
index 7d5b17909b..f1f77fe089 100755
--- a/t/t5702-protocol-v2.sh
+++ b/t/t5702-protocol-v2.sh
@@ -4,6 +4,9 @@ test_description='test git wire-protocol version 2'
 
 TEST_NO_CREATE_REPO=1
 
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 # Test protocol v2 with 'git://' transport
diff --git a/t/t5703-upload-pack-ref-in-want.sh b/t/t5703-upload-pack-ref-in-want.sh
index b46940b725..c3a52d478f 100755
--- a/t/t5703-upload-pack-ref-in-want.sh
+++ b/t/t5703-upload-pack-ref-in-want.sh
@@ -2,6 +2,9 @@
 
 test_description='upload-pack ref-in-want'
 
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 get_actual_refs () {
diff --git a/t/t5801-remote-helpers.sh b/t/t5801-remote-helpers.sh
index 0f04b6cddb..1ecefb57fe 100755
--- a/t/t5801-remote-helpers.sh
+++ b/t/t5801-remote-helpers.sh
@@ -5,6 +5,9 @@
 
 test_description='Test remote-helper import and export commands'
 
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 . "$TEST_DIRECTORY"/lib-gpg.sh
 
diff --git a/t/t6000-rev-list-misc.sh b/t/t6000-rev-list-misc.sh
index fc4d55dcb2..664000adf0 100755
--- a/t/t6000-rev-list-misc.sh
+++ b/t/t6000-rev-list-misc.sh
@@ -2,6 +2,9 @@
 
 test_description='miscellaneous rev-list tests'
 
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 test_expect_success setup '
diff --git a/t/t6001-rev-list-graft.sh b/t/t6001-rev-list-graft.sh
index 7504ba4751..67c384f1e8 100755
--- a/t/t6001-rev-list-graft.sh
+++ b/t/t6001-rev-list-graft.sh
@@ -2,6 +2,9 @@
 
 test_description='Revision traversal vs grafts and path limiter'
 
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 test_expect_success setup '
diff --git a/t/t6004-rev-list-path-optim.sh b/t/t6004-rev-list-path-optim.sh
index 3e8c42ee0b..ff788199e3 100755
--- a/t/t6004-rev-list-path-optim.sh
+++ b/t/t6004-rev-list-path-optim.sh
@@ -13,6 +13,9 @@ test_description='git rev-list trivial path optimization test
 
 '
 
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 test_expect_success setup '
diff --git a/t/t6006-rev-list-format.sh b/t/t6006-rev-list-format.sh
index 99a1eaf332..bbbd577f10 100755
--- a/t/t6006-rev-list-format.sh
+++ b/t/t6006-rev-list-format.sh
@@ -5,6 +5,9 @@
 
 test_description='git rev-list --pretty=format test'
 
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 . "$TEST_DIRECTORY"/lib-terminal.sh
 
diff --git a/t/t6007-rev-list-cherry-pick-file.sh b/t/t6007-rev-list-cherry-pick-file.sh
index f0268372d2..51547ac3a5 100755
--- a/t/t6007-rev-list-cherry-pick-file.sh
+++ b/t/t6007-rev-list-cherry-pick-file.sh
@@ -2,6 +2,9 @@
 
 test_description='test git rev-list --cherry-pick -- file'
 
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 # A---B---D---F
diff --git a/t/t6008-rev-list-submodule.sh b/t/t6008-rev-list-submodule.sh
index c4af9ca0a7..871ace31e2 100755
--- a/t/t6008-rev-list-submodule.sh
+++ b/t/t6008-rev-list-submodule.sh
@@ -5,6 +5,9 @@
 
 test_description='git rev-list involving submodules that this repo has'
 
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 test_expect_success 'setup' '
diff --git a/t/t6009-rev-list-parent.sh b/t/t6009-rev-list-parent.sh
index 916d9692bc..114f755d52 100755
--- a/t/t6009-rev-list-parent.sh
+++ b/t/t6009-rev-list-parent.sh
@@ -2,6 +2,9 @@
 
 test_description='ancestor culling and limiting by parent number'
 
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 check_revlist () {
diff --git a/t/t6012-rev-list-simplify.sh b/t/t6012-rev-list-simplify.sh
index fd202fcb94..d163c24859 100755
--- a/t/t6012-rev-list-simplify.sh
+++ b/t/t6012-rev-list-simplify.sh
@@ -2,6 +2,9 @@
 
 test_description='merge simplification'
 
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 note () {
diff --git a/t/t6013-rev-list-reverse-parents.sh b/t/t6013-rev-list-reverse-parents.sh
index 89458d370f..0298174956 100755
--- a/t/t6013-rev-list-reverse-parents.sh
+++ b/t/t6013-rev-list-reverse-parents.sh
@@ -2,6 +2,9 @@
 
 test_description='--reverse combines with --parents'
 
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 
diff --git a/t/t6016-rev-list-graph-simplify-history.sh b/t/t6016-rev-list-graph-simplify-history.sh
index f5e6e92f5b..3fb7ee0be4 100755
--- a/t/t6016-rev-list-graph-simplify-history.sh
+++ b/t/t6016-rev-list-graph-simplify-history.sh
@@ -7,6 +7,9 @@
 
 test_description='--graph and simplified history'
 
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 test_expect_success 'set up rev-list --graph test' '
diff --git a/t/t6017-rev-list-stdin.sh b/t/t6017-rev-list-stdin.sh
index 667b37564e..e51fe7b9bc 100755
--- a/t/t6017-rev-list-stdin.sh
+++ b/t/t6017-rev-list-stdin.sh
@@ -5,6 +5,9 @@
 
 test_description='log family learns --stdin'
 
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 check () {
diff --git a/t/t6018-rev-list-glob.sh b/t/t6018-rev-list-glob.sh
index fe2f3cec3d..60a351c26a 100755
--- a/t/t6018-rev-list-glob.sh
+++ b/t/t6018-rev-list-glob.sh
@@ -2,6 +2,9 @@
 
 test_description='rev-list/rev-parse --glob'
 
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 commit () {
diff --git a/t/t6019-rev-list-ancestry-path.sh b/t/t6019-rev-list-ancestry-path.sh
index 353f84313f..aeb7defaa3 100755
--- a/t/t6019-rev-list-ancestry-path.sh
+++ b/t/t6019-rev-list-ancestry-path.sh
@@ -21,6 +21,9 @@ test_description='--ancestry-path'
 #  --ancestry-path G..M -- G.t == L
 #  --ancestry-path --simplify-merges G^..M -- G.t == G L
 
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 test_merge () {
diff --git a/t/t6030-bisect-porcelain.sh b/t/t6030-bisect-porcelain.sh
index aa226381be..7dc65c73cd 100755
--- a/t/t6030-bisect-porcelain.sh
+++ b/t/t6030-bisect-porcelain.sh
@@ -6,6 +6,9 @@ test_description='Tests git bisect functionality'
 
 exec </dev/null
 
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 add_line_into_file()
diff --git a/t/t6040-tracking-info.sh b/t/t6040-tracking-info.sh
index 50a934e1b2..bc95ff6f54 100755
--- a/t/t6040-tracking-info.sh
+++ b/t/t6040-tracking-info.sh
@@ -2,6 +2,9 @@
 
 test_description='remote tracking stats'
 
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 advance () {
diff --git a/t/t6050-replace.sh b/t/t6050-replace.sh
index c80dc10b8f..0a53462a61 100755
--- a/t/t6050-replace.sh
+++ b/t/t6050-replace.sh
@@ -4,6 +4,9 @@
 #
 test_description='Tests replace refs functionality'
 
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 . "$TEST_DIRECTORY/lib-gpg.sh"
 
diff --git a/t/t6101-rev-parse-parents.sh b/t/t6101-rev-parse-parents.sh
index 7531262a5e..19a56f4a4d 100755
--- a/t/t6101-rev-parse-parents.sh
+++ b/t/t6101-rev-parse-parents.sh
@@ -5,6 +5,9 @@
 
 test_description='Test git rev-parse with different parent options'
 
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 test_cmp_rev_output () {
diff --git a/t/t6110-rev-list-sparse.sh b/t/t6110-rev-list-sparse.sh
index 656ac7fe9d..69411862d6 100755
--- a/t/t6110-rev-list-sparse.sh
+++ b/t/t6110-rev-list-sparse.sh
@@ -1,6 +1,9 @@
 #!/bin/sh
 
 test_description='operations that cull histories in unusual ways'
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 test_expect_success setup '
diff --git a/t/t6111-rev-list-treesame.sh b/t/t6111-rev-list-treesame.sh
index 4244638285..58b8d42bf3 100755
--- a/t/t6111-rev-list-treesame.sh
+++ b/t/t6111-rev-list-treesame.sh
@@ -13,6 +13,9 @@
 
 test_description='TREESAME and limiting'
 
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 note () {
diff --git a/t/t6112-rev-list-filters-objects.sh b/t/t6112-rev-list-filters-objects.sh
index de0e5a5d36..5f39c3adb3 100755
--- a/t/t6112-rev-list-filters-objects.sh
+++ b/t/t6112-rev-list-filters-objects.sh
@@ -2,6 +2,9 @@
 
 test_description='git rev-list using object filtering'
 
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 # Test the blob:none filter.
diff --git a/t/t6120-describe.sh b/t/t6120-describe.sh
index f822d5d328..360e65d3b9 100755
--- a/t/t6120-describe.sh
+++ b/t/t6120-describe.sh
@@ -11,6 +11,9 @@ test_description='test describe'
 #
 # First parent of a merge commit is on the same line, second parent below.
 
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 check_describe () {
diff --git a/t/t6200-fmt-merge-msg.sh b/t/t6200-fmt-merge-msg.sh
index f3e66eaf9b..725b356d1e 100755
--- a/t/t6200-fmt-merge-msg.sh
+++ b/t/t6200-fmt-merge-msg.sh
@@ -5,6 +5,9 @@
 
 test_description='fmt-merge-msg test'
 
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 . "$TEST_DIRECTORY/lib-gpg.sh"
 
diff --git a/t/t6300-for-each-ref.sh b/t/t6300-for-each-ref.sh
index b359023189..b03740d634 100755
--- a/t/t6300-for-each-ref.sh
+++ b/t/t6300-for-each-ref.sh
@@ -5,6 +5,9 @@
 
 test_description='for-each-ref test'
 
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 . "$TEST_DIRECTORY"/lib-gpg.sh
 . "$TEST_DIRECTORY"/lib-terminal.sh
diff --git a/t/t6302-for-each-ref-filter.sh b/t/t6302-for-each-ref-filter.sh
index 0a21669f56..0f3e6aa011 100755
--- a/t/t6302-for-each-ref-filter.sh
+++ b/t/t6302-for-each-ref-filter.sh
@@ -2,6 +2,9 @@
 
 test_description='test for-each-refs usage of ref-filter APIs'
 
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 . "$TEST_DIRECTORY"/lib-gpg.sh
 
diff --git a/t/t6400-merge-df.sh b/t/t6400-merge-df.sh
index 9da0838216..5fab2d2dd7 100755
--- a/t/t6400-merge-df.sh
+++ b/t/t6400-merge-df.sh
@@ -4,6 +4,9 @@
 #
 
 test_description='Test merge with directory/file conflicts'
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 test_expect_success 'prepare repository' '
diff --git a/t/t6402-merge-rename.sh b/t/t6402-merge-rename.sh
index 3f64f62224..227c2feb08 100755
--- a/t/t6402-merge-rename.sh
+++ b/t/t6402-merge-rename.sh
@@ -1,6 +1,9 @@
 #!/bin/sh
 
 test_description='Merge-recursive merging renames'
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 modify () {
diff --git a/t/t6404-recursive-merge.sh b/t/t6404-recursive-merge.sh
index b1c3d4dda4..bdf8169456 100755
--- a/t/t6404-recursive-merge.sh
+++ b/t/t6404-recursive-merge.sh
@@ -1,6 +1,9 @@
 #!/bin/sh
 
 test_description='Test merge without common ancestors'
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 # This scenario is based on a real-world repository of Shawn Pearce.
diff --git a/t/t6405-merge-symlinks.sh b/t/t6405-merge-symlinks.sh
index 6c0a90d044..140e9e6ce6 100755
--- a/t/t6405-merge-symlinks.sh
+++ b/t/t6405-merge-symlinks.sh
@@ -8,6 +8,9 @@ test_description='merging symlinks on filesystem w/o symlink support.
 This tests that git merge-recursive writes merge results as plain files
 if core.symlinks is false.'
 
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 test_expect_success 'setup' '
diff --git a/t/t6406-merge-attr.sh b/t/t6406-merge-attr.sh
index 76a55f838c..7fe4034d58 100755
--- a/t/t6406-merge-attr.sh
+++ b/t/t6406-merge-attr.sh
@@ -5,6 +5,9 @@
 
 test_description='per path merge controlled by merge attribute'
 
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 test_expect_success setup '
diff --git a/t/t6407-merge-binary.sh b/t/t6407-merge-binary.sh
index 4e6c7cb77e..826deacfd7 100755
--- a/t/t6407-merge-binary.sh
+++ b/t/t6407-merge-binary.sh
@@ -2,6 +2,9 @@
 
 test_description='ask merge-recursive to merge binary files'
 
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 test_expect_success setup '
diff --git a/t/t6409-merge-subtree.sh b/t/t6409-merge-subtree.sh
index b8e8b6f642..e2c1cfc9fe 100755
--- a/t/t6409-merge-subtree.sh
+++ b/t/t6409-merge-subtree.sh
@@ -2,6 +2,9 @@
 
 test_description='subtree merge strategy'
 
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 test_expect_success setup '
diff --git a/t/t6411-merge-filemode.sh b/t/t6411-merge-filemode.sh
index 87741efad3..7b66abfdbb 100755
--- a/t/t6411-merge-filemode.sh
+++ b/t/t6411-merge-filemode.sh
@@ -1,6 +1,9 @@
 #!/bin/sh
 
 test_description='merge: handle file mode'
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 test_expect_success 'set up mode change in one branch' '
diff --git a/t/t6412-merge-large-rename.sh b/t/t6412-merge-large-rename.sh
index 80777386dc..d6840078c4 100755
--- a/t/t6412-merge-large-rename.sh
+++ b/t/t6412-merge-large-rename.sh
@@ -1,6 +1,9 @@
 #!/bin/sh
 
 test_description='merging with large rename matrix'
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 count() {
diff --git a/t/t6413-merge-crlf.sh b/t/t6413-merge-crlf.sh
index e8d65eefb5..3bd8e3e899 100755
--- a/t/t6413-merge-crlf.sh
+++ b/t/t6413-merge-crlf.sh
@@ -8,6 +8,9 @@ test_description='merge conflict in crlf repo
 
 '
 
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 test_expect_success setup '
diff --git a/t/t6414-merge-rename-nocruft.sh b/t/t6414-merge-rename-nocruft.sh
index a25e730460..42824dcf49 100755
--- a/t/t6414-merge-rename-nocruft.sh
+++ b/t/t6414-merge-rename-nocruft.sh
@@ -1,6 +1,9 @@
 #!/bin/sh
 
 test_description='Merge-recursive merging renames'
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 test_expect_success 'setup' '
diff --git a/t/t6415-merge-dir-to-symlink.sh b/t/t6415-merge-dir-to-symlink.sh
index 2eddcc7664..32c0b62496 100755
--- a/t/t6415-merge-dir-to-symlink.sh
+++ b/t/t6415-merge-dir-to-symlink.sh
@@ -1,6 +1,9 @@
 #!/bin/sh
 
 test_description='merging when a directory was replaced with a symlink'
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 test_expect_success 'create a commit where dir a/b changed to symlink' '
diff --git a/t/t6416-recursive-corner-cases.sh b/t/t6416-recursive-corner-cases.sh
index 887c2195a9..6a740771ed 100755
--- a/t/t6416-recursive-corner-cases.sh
+++ b/t/t6416-recursive-corner-cases.sh
@@ -2,6 +2,9 @@
 
 test_description='recursive merge corner cases involving criss-cross merges'
 
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 . "$TEST_DIRECTORY"/lib-merge.sh
 
diff --git a/t/t6417-merge-ours-theirs.sh b/t/t6417-merge-ours-theirs.sh
index 0aebc6c028..e7883f890a 100755
--- a/t/t6417-merge-ours-theirs.sh
+++ b/t/t6417-merge-ours-theirs.sh
@@ -1,6 +1,9 @@
 #!/bin/sh
 
 test_description='Merge-recursive ours and theirs variants'
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 test_expect_success setup '
diff --git a/t/t6418-merge-text-auto.sh b/t/t6418-merge-text-auto.sh
index 30983d18b1..91b43de00d 100755
--- a/t/t6418-merge-text-auto.sh
+++ b/t/t6418-merge-text-auto.sh
@@ -12,6 +12,9 @@ test_description='CRLF merge conflict across text=auto change
 *+ [side^] Initial
 '
 
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 test_have_prereq SED_STRIPS_CR && SED_OPTIONS=-b
diff --git a/t/t6419-merge-ignorecase.sh b/t/t6419-merge-ignorecase.sh
index 531850d834..9996a94431 100755
--- a/t/t6419-merge-ignorecase.sh
+++ b/t/t6419-merge-ignorecase.sh
@@ -2,6 +2,9 @@
 
 test_description='git-merge with case-changing rename on case-insensitive file system'
 
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 if ! test_have_prereq CASE_INSENSITIVE_FS
diff --git a/t/t6422-merge-rename-corner-cases.sh b/t/t6422-merge-rename-corner-cases.sh
index 78bfaf17f0..70c8af7f51 100755
--- a/t/t6422-merge-rename-corner-cases.sh
+++ b/t/t6422-merge-rename-corner-cases.sh
@@ -3,6 +3,9 @@
 test_description="recursive merge corner cases w/ renames but not criss-crosses"
 # t6036 has corner cases that involve both criss-cross merges and renames
 
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 . "$TEST_DIRECTORY"/lib-merge.sh
 
diff --git a/t/t6425-merge-rename-delete.sh b/t/t6425-merge-rename-delete.sh
index f79d021590..e58e3dfba1 100755
--- a/t/t6425-merge-rename-delete.sh
+++ b/t/t6425-merge-rename-delete.sh
@@ -1,6 +1,9 @@
 #!/bin/sh
 
 test_description='Merge-recursive rename/delete conflict message'
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 test_expect_success 'rename/delete' '
diff --git a/t/t6427-diff3-conflict-markers.sh b/t/t6427-diff3-conflict-markers.sh
index f4655bb358..c192ee4e42 100755
--- a/t/t6427-diff3-conflict-markers.sh
+++ b/t/t6427-diff3-conflict-markers.sh
@@ -2,6 +2,9 @@
 
 test_description='recursive merge diff3 style conflict markers'
 
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 # Setup:
diff --git a/t/t6430-merge-recursive.sh b/t/t6430-merge-recursive.sh
index 9c08e63af2..acb2868260 100755
--- a/t/t6430-merge-recursive.sh
+++ b/t/t6430-merge-recursive.sh
@@ -2,6 +2,9 @@
 
 test_description='merge-recursive backend test'
 
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 . "$TEST_DIRECTORY"/lib-merge.sh
 
diff --git a/t/t6432-merge-recursive-space-options.sh b/t/t6432-merge-recursive-space-options.sh
index b56180ee4a..1333cbb148 100755
--- a/t/t6432-merge-recursive-space-options.sh
+++ b/t/t6432-merge-recursive-space-options.sh
@@ -11,6 +11,9 @@ test_description='merge-recursive space options
 *   ok 1: setup
 '
 
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 test_have_prereq SED_STRIPS_CR && SED_OPTIONS=-b
diff --git a/t/t6433-merge-toplevel.sh b/t/t6433-merge-toplevel.sh
index e29c284b9b..2d51b2d08c 100755
--- a/t/t6433-merge-toplevel.sh
+++ b/t/t6433-merge-toplevel.sh
@@ -2,6 +2,9 @@
 
 test_description='"git merge" top-level frontend'
 
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 t3033_reset () {
diff --git a/t/t6434-merge-recursive-rename-options.sh b/t/t6434-merge-recursive-rename-options.sh
index 3d9fae68c4..7e877e96e2 100755
--- a/t/t6434-merge-recursive-rename-options.sh
+++ b/t/t6434-merge-recursive-rename-options.sh
@@ -26,6 +26,9 @@ they are rounded down (see, e.g., Documentation/diff-generate-patch.txt, which
 mentions this in a different context).
 '
 
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 get_expected_stages () {
diff --git a/t/t6436-merge-overwrite.sh b/t/t6436-merge-overwrite.sh
index dd9376842f..7d5691c1b4 100755
--- a/t/t6436-merge-overwrite.sh
+++ b/t/t6436-merge-overwrite.sh
@@ -4,6 +4,9 @@ test_description='git-merge
 
 Do not overwrite changes.'
 
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 test_expect_success 'setup' '
diff --git a/t/t6437-submodule-merge.sh b/t/t6437-submodule-merge.sh
index 3ead2b726f..14fa46edf3 100755
--- a/t/t6437-submodule-merge.sh
+++ b/t/t6437-submodule-merge.sh
@@ -2,6 +2,9 @@
 
 test_description='merging with submodules'
 
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 #
diff --git a/t/t6439-merge-co-error-msgs.sh b/t/t6439-merge-co-error-msgs.sh
index 5c8894d94f..e5542ceb24 100755
--- a/t/t6439-merge-co-error-msgs.sh
+++ b/t/t6439-merge-co-error-msgs.sh
@@ -2,6 +2,9 @@
 
 test_description='unpack-trees error messages'
 
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 
diff --git a/t/t6501-freshen-objects.sh b/t/t6501-freshen-objects.sh
index 8a3bb4105b..bda5069044 100755
--- a/t/t6501-freshen-objects.sh
+++ b/t/t6501-freshen-objects.sh
@@ -25,6 +25,9 @@
 #      to refer to an existing tree).
 
 test_description='check pruning of dependent objects'
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 # We care about reachability, so we do not want to use
diff --git a/t/t7003-filter-branch.sh b/t/t7003-filter-branch.sh
index 36477cb1f4..db496fa039 100755
--- a/t/t7003-filter-branch.sh
+++ b/t/t7003-filter-branch.sh
@@ -1,6 +1,9 @@
 #!/bin/sh
 
 test_description='git filter-branch'
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 . "$TEST_DIRECTORY/lib-gpg.sh"
 
diff --git a/t/t7004-tag.sh b/t/t7004-tag.sh
index 05f411c821..0e3086c4a6 100755
--- a/t/t7004-tag.sh
+++ b/t/t7004-tag.sh
@@ -7,6 +7,9 @@ test_description='git tag
 
 Tests for operations with tags.'
 
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 . "$TEST_DIRECTORY"/lib-gpg.sh
 . "$TEST_DIRECTORY"/lib-terminal.sh
diff --git a/t/t7030-verify-tag.sh b/t/t7030-verify-tag.sh
index 5c5bc32ccb..bcb3c4f035 100755
--- a/t/t7030-verify-tag.sh
+++ b/t/t7030-verify-tag.sh
@@ -1,6 +1,9 @@
 #!/bin/sh
 
 test_description='signed tag tests'
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 . "$TEST_DIRECTORY/lib-gpg.sh"
 
diff --git a/t/t7060-wtstatus.sh b/t/t7060-wtstatus.sh
index d5218743e9..e65ca019eb 100755
--- a/t/t7060-wtstatus.sh
+++ b/t/t7060-wtstatus.sh
@@ -2,6 +2,9 @@
 
 test_description='basic work tree status reporting'
 
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 test_expect_success setup '
diff --git a/t/t7063-status-untracked-cache.sh b/t/t7063-status-untracked-cache.sh
index a682a3d826..ae60942347 100755
--- a/t/t7063-status-untracked-cache.sh
+++ b/t/t7063-status-untracked-cache.sh
@@ -2,6 +2,9 @@
 
 test_description='test untracked cache'
 
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 # On some filesystems (e.g. FreeBSD's ext2 and ufs) directory mtime
diff --git a/t/t7064-wtstatus-pv2.sh b/t/t7064-wtstatus-pv2.sh
index 537787e598..07954b2142 100755
--- a/t/t7064-wtstatus-pv2.sh
+++ b/t/t7064-wtstatus-pv2.sh
@@ -5,6 +5,9 @@ test_description='git status --porcelain=v2
 This test exercises porcelain V2 output for git status.'
 
 
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 
diff --git a/t/t7102-reset.sh b/t/t7102-reset.sh
index b1affb001f..4af43d26f1 100755
--- a/t/t7102-reset.sh
+++ b/t/t7102-reset.sh
@@ -7,6 +7,9 @@ test_description='git reset
 
 Documented tests for git reset'
 
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 commit_msg () {
diff --git a/t/t7113-post-index-change-hook.sh b/t/t7113-post-index-change-hook.sh
index f011ad7eec..8872c32f94 100755
--- a/t/t7113-post-index-change-hook.sh
+++ b/t/t7113-post-index-change-hook.sh
@@ -2,6 +2,9 @@
 
 test_description='post index change hook'
 
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 test_expect_success 'setup' '
diff --git a/t/t7201-co.sh b/t/t7201-co.sh
index b36a93056f..12567543c4 100755
--- a/t/t7201-co.sh
+++ b/t/t7201-co.sh
@@ -20,6 +20,9 @@ Test switching across them.
 
 '
 
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 test_tick
diff --git a/t/t7400-submodule-basic.sh b/t/t7400-submodule-basic.sh
index fec7e0299d..8addc0c8c9 100755
--- a/t/t7400-submodule-basic.sh
+++ b/t/t7400-submodule-basic.sh
@@ -9,6 +9,9 @@ This test tries to verify basic sanity of the init, update and status
 subcommands of git submodule.
 '
 
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 test_expect_success 'submodule deinit works on empty repository' '
diff --git a/t/t7403-submodule-sync.sh b/t/t7403-submodule-sync.sh
index 0726799e74..c95559bed5 100755
--- a/t/t7403-submodule-sync.sh
+++ b/t/t7403-submodule-sync.sh
@@ -8,6 +8,9 @@ test_description='git submodule sync
 These tests exercise the "git submodule sync" subcommand.
 '
 
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 test_expect_success setup '
diff --git a/t/t7406-submodule-update.sh b/t/t7406-submodule-update.sh
index acb8766ac2..825b1a7e0c 100755
--- a/t/t7406-submodule-update.sh
+++ b/t/t7406-submodule-update.sh
@@ -9,6 +9,9 @@ This test verifies that "git submodule update" detaches the HEAD of the
 submodule and "git submodule update --rebase/--merge" does not detach the HEAD.
 '
 
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 
diff --git a/t/t7407-submodule-foreach.sh b/t/t7407-submodule-foreach.sh
index 6b2aa917e1..632defc53b 100755
--- a/t/t7407-submodule-foreach.sh
+++ b/t/t7407-submodule-foreach.sh
@@ -9,6 +9,9 @@ This test verifies that "git submodule foreach" correctly visits all submodules
 that are currently checked out.
 '
 
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 
diff --git a/t/t7409-submodule-detached-work-tree.sh b/t/t7409-submodule-detached-work-tree.sh
index fc018e3638..e9428e2b59 100755
--- a/t/t7409-submodule-detached-work-tree.sh
+++ b/t/t7409-submodule-detached-work-tree.sh
@@ -10,6 +10,9 @@ on detached working trees
 '
 
 TEST_NO_CREATE_REPO=1
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 test_expect_success 'submodule on detached working tree' '
diff --git a/t/t7417-submodule-path-url.sh b/t/t7417-submodule-path-url.sh
index f7e7e94d7b..0a514e951c 100755
--- a/t/t7417-submodule-path-url.sh
+++ b/t/t7417-submodule-path-url.sh
@@ -1,6 +1,9 @@
 #!/bin/sh
 
 test_description='check handling of .gitmodule path with dash'
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 test_expect_success 'create submodule with dash in path' '
diff --git a/t/t7501-commit-basic-functionality.sh b/t/t7501-commit-basic-functionality.sh
index 110b4bf459..9a1414f31d 100755
--- a/t/t7501-commit-basic-functionality.sh
+++ b/t/t7501-commit-basic-functionality.sh
@@ -7,6 +7,9 @@
 # signoff
 
 test_description='git commit'
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 . "$TEST_DIRECTORY/diff-lib.sh"
 
diff --git a/t/t7502-commit-porcelain.sh b/t/t7502-commit-porcelain.sh
index 14c92e4c25..c8c16bf1c9 100755
--- a/t/t7502-commit-porcelain.sh
+++ b/t/t7502-commit-porcelain.sh
@@ -2,6 +2,9 @@
 
 test_description='git commit porcelain-ish'
 
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 commit_msg_is () {
diff --git a/t/t7503-pre-commit-and-pre-merge-commit-hooks.sh b/t/t7503-pre-commit-and-pre-merge-commit-hooks.sh
index b3485450a2..8d3f4ab0d7 100755
--- a/t/t7503-pre-commit-and-pre-merge-commit-hooks.sh
+++ b/t/t7503-pre-commit-and-pre-merge-commit-hooks.sh
@@ -2,6 +2,9 @@
 
 test_description='pre-commit and pre-merge-commit hooks'
 
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 HOOKDIR="$(git rev-parse --git-dir)/hooks"
diff --git a/t/t7504-commit-msg-hook.sh b/t/t7504-commit-msg-hook.sh
index 31b9c6a2c1..17fb1d8499 100755
--- a/t/t7504-commit-msg-hook.sh
+++ b/t/t7504-commit-msg-hook.sh
@@ -2,6 +2,9 @@
 
 test_description='commit-msg hook'
 
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 test_expect_success 'with no hook' '
diff --git a/t/t7505-prepare-commit-msg-hook.sh b/t/t7505-prepare-commit-msg-hook.sh
index 94f85cdf83..978c90abbb 100755
--- a/t/t7505-prepare-commit-msg-hook.sh
+++ b/t/t7505-prepare-commit-msg-hook.sh
@@ -2,6 +2,9 @@
 
 test_description='prepare-commit-msg hook'
 
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 test_expect_success 'set up commits for rebasing' '
diff --git a/t/t7510-signed-commit.sh b/t/t7510-signed-commit.sh
index 6baaa1ad91..a5a36cab85 100755
--- a/t/t7510-signed-commit.sh
+++ b/t/t7510-signed-commit.sh
@@ -1,6 +1,9 @@
 #!/bin/sh
 
 test_description='signed commit tests'
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 GNUPGHOME_NOT_USED=$GNUPGHOME
 . "$TEST_DIRECTORY/lib-gpg.sh"
diff --git a/t/t7512-status-help.sh b/t/t7512-status-help.sh
index 29518e0949..fbd760f7e6 100755
--- a/t/t7512-status-help.sh
+++ b/t/t7512-status-help.sh
@@ -7,6 +7,9 @@
 
 test_description='git status advice'
 
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 . "$TEST_DIRECTORY"/lib-rebase.sh
diff --git a/t/t7517-per-repo-email.sh b/t/t7517-per-repo-email.sh
index b2401cec3e..344d72a5c0 100755
--- a/t/t7517-per-repo-email.sh
+++ b/t/t7517-per-repo-email.sh
@@ -6,6 +6,9 @@
 
 test_description='per-repo forced setting of email address'
 
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 test_expect_success 'setup a likely user.useConfigOnly use case' '
diff --git a/t/t7600-merge.sh b/t/t7600-merge.sh
index 1c85f75555..0ad866c08c 100755
--- a/t/t7600-merge.sh
+++ b/t/t7600-merge.sh
@@ -26,6 +26,9 @@ Testing basic merge operations/option parsing.
 +++++++* [c0] commit 0
 '
 
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 . "$TEST_DIRECTORY"/lib-gpg.sh
 
diff --git a/t/t7608-merge-messages.sh b/t/t7608-merge-messages.sh
index 8e7e0a5865..7059c2a54b 100755
--- a/t/t7608-merge-messages.sh
+++ b/t/t7608-merge-messages.sh
@@ -1,6 +1,9 @@
 #!/bin/sh
 
 test_description='test auto-generated merge messages'
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 check_oneline() {
diff --git a/t/t7610-mergetool.sh b/t/t7610-mergetool.sh
index 70afdd06fa..e65645d5e9 100755
--- a/t/t7610-mergetool.sh
+++ b/t/t7610-mergetool.sh
@@ -7,6 +7,9 @@ test_description='git mergetool
 
 Testing basic merge tool invocation'
 
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 # All the mergetool test work by checking out a temporary branch based
diff --git a/t/t7611-merge-abort.sh b/t/t7611-merge-abort.sh
index 7c84a518aa..ed072bfb19 100755
--- a/t/t7611-merge-abort.sh
+++ b/t/t7611-merge-abort.sh
@@ -22,6 +22,9 @@ Next, test git merge --abort with the following variables:
 - changed/unchanged worktree after merge
 - changed/unchanged index after merge
 '
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 test_expect_success 'setup' '
diff --git a/t/t7612-merge-verify-signatures.sh b/t/t7612-merge-verify-signatures.sh
index a426f3a89a..b4ec88f996 100755
--- a/t/t7612-merge-verify-signatures.sh
+++ b/t/t7612-merge-verify-signatures.sh
@@ -1,6 +1,9 @@
 #!/bin/sh
 
 test_description='merge signature verification tests'
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 . "$TEST_DIRECTORY/lib-gpg.sh"
 
diff --git a/t/t7614-merge-signoff.sh b/t/t7614-merge-signoff.sh
index c1b8446f49..ea4eeee35f 100755
--- a/t/t7614-merge-signoff.sh
+++ b/t/t7614-merge-signoff.sh
@@ -5,6 +5,9 @@ test_description='git merge --signoff
 This test runs git merge --signoff and makes sure that it works.
 '
 
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 # Setup test files
diff --git a/t/t7701-repack-unpack-unreachable.sh b/t/t7701-repack-unpack-unreachable.sh
index 48261ba080..375f43a721 100755
--- a/t/t7701-repack-unpack-unreachable.sh
+++ b/t/t7701-repack-unpack-unreachable.sh
@@ -2,6 +2,9 @@
 
 test_description='git repack works correctly'
 
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 fsha1=
diff --git a/t/t7800-difftool.sh b/t/t7800-difftool.sh
index a578b35761..f938efa296 100755
--- a/t/t7800-difftool.sh
+++ b/t/t7800-difftool.sh
@@ -8,6 +8,9 @@ test_description='git-difftool
 Testing basic diff tool invocation
 '
 
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 difftool_test_setup ()
diff --git a/t/t7810-grep.sh b/t/t7810-grep.sh
index 991d5bd9c0..47ec993962 100755
--- a/t/t7810-grep.sh
+++ b/t/t7810-grep.sh
@@ -6,6 +6,9 @@
 test_description='git grep various.
 '
 
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 cat >hello.c <<EOF
diff --git a/t/t8001-annotate.sh b/t/t8001-annotate.sh
index 72176e42c1..f661007c85 100755
--- a/t/t8001-annotate.sh
+++ b/t/t8001-annotate.sh
@@ -1,6 +1,9 @@
 #!/bin/sh
 
 test_description='git annotate'
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 PROG='git annotate'
diff --git a/t/t8002-blame.sh b/t/t8002-blame.sh
index 015973e8fe..89a319d2c7 100755
--- a/t/t8002-blame.sh
+++ b/t/t8002-blame.sh
@@ -1,6 +1,9 @@
 #!/bin/sh
 
 test_description='git blame'
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 PROG='git blame -c'
diff --git a/t/t8003-blame-corner-cases.sh b/t/t8003-blame-corner-cases.sh
index ba8013b002..0613d889db 100755
--- a/t/t8003-blame-corner-cases.sh
+++ b/t/t8003-blame-corner-cases.sh
@@ -1,6 +1,9 @@
 #!/bin/sh
 
 test_description='git blame corner cases'
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 pick_fc='s/^[0-9a-f^]* *\([^ ]*\) *(\([^ ]*\) .*/\1-\2/'
diff --git a/t/t8004-blame-with-conflicts.sh b/t/t8004-blame-with-conflicts.sh
index 9c353ab222..ffce1d1195 100755
--- a/t/t8004-blame-with-conflicts.sh
+++ b/t/t8004-blame-with-conflicts.sh
@@ -3,6 +3,9 @@
 # Based on a test case submitted by Björn Steinbrink.
 
 test_description='git blame on conflicted files'
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 test_expect_success 'setup first case' '
diff --git a/t/t8012-blame-colors.sh b/t/t8012-blame-colors.sh
index ed38f74de9..d55b3e22c9 100755
--- a/t/t8012-blame-colors.sh
+++ b/t/t8012-blame-colors.sh
@@ -1,6 +1,9 @@
 #!/bin/sh
 
 test_description='colored git blame'
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 PROG='git blame -c'
diff --git a/t/t9001-send-email.sh b/t/t9001-send-email.sh
index a08f72596a..3d160d939e 100755
--- a/t/t9001-send-email.sh
+++ b/t/t9001-send-email.sh
@@ -1,6 +1,9 @@
 #!/bin/sh
 
 test_description='git send-email'
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 # May be altered later in the test
diff --git a/t/t9100-git-svn-basic.sh b/t/t9100-git-svn-basic.sh
index e4bb22034e..9a6f2c38f1 100755
--- a/t/t9100-git-svn-basic.sh
+++ b/t/t9100-git-svn-basic.sh
@@ -6,6 +6,9 @@
 test_description='git svn basic tests'
 GIT_SVN_LC_ALL=${LC_ALL:-$LANG}
 
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./lib-git-svn.sh
 
 case "$GIT_SVN_LC_ALL" in
diff --git a/t/t9145-git-svn-master-branch.sh b/t/t9145-git-svn-master-branch.sh
index 3bbf341f6a..053571ca5c 100755
--- a/t/t9145-git-svn-master-branch.sh
+++ b/t/t9145-git-svn-master-branch.sh
@@ -3,6 +3,9 @@
 # Copyright (c) 2009 Eric Wong
 #
 test_description='git svn initial master branch is "trunk" if possible'
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./lib-git-svn.sh
 
 test_expect_success 'setup test repository' '
diff --git a/t/t9151-svn-mergeinfo.sh b/t/t9151-svn-mergeinfo.sh
index 4f6c06ecb2..9188c761de 100755
--- a/t/t9151-svn-mergeinfo.sh
+++ b/t/t9151-svn-mergeinfo.sh
@@ -5,6 +5,9 @@
 
 test_description='git-svn svn mergeinfo properties'
 
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./lib-git-svn.sh
 
 test_expect_success 'load svn dump' "
diff --git a/t/t9155-git-svn-fetch-deleted-tag.sh b/t/t9155-git-svn-fetch-deleted-tag.sh
index 184336f346..9d6cc40add 100755
--- a/t/t9155-git-svn-fetch-deleted-tag.sh
+++ b/t/t9155-git-svn-fetch-deleted-tag.sh
@@ -2,6 +2,9 @@
 
 test_description='git svn fetch deleted tag'
 
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./lib-git-svn.sh
 
 test_expect_success 'setup svn repo' '
diff --git a/t/t9156-git-svn-fetch-deleted-tag-2.sh b/t/t9156-git-svn-fetch-deleted-tag-2.sh
index 7a6e33ba3c..ba78bfb676 100755
--- a/t/t9156-git-svn-fetch-deleted-tag-2.sh
+++ b/t/t9156-git-svn-fetch-deleted-tag-2.sh
@@ -2,6 +2,9 @@
 
 test_description='git svn fetch deleted tag 2'
 
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./lib-git-svn.sh
 
 test_expect_success 'setup svn repo' '
diff --git a/t/t9163-git-svn-reset-clears-caches.sh b/t/t9163-git-svn-reset-clears-caches.sh
index d6245cee08..e48faf92af 100755
--- a/t/t9163-git-svn-reset-clears-caches.sh
+++ b/t/t9163-git-svn-reset-clears-caches.sh
@@ -4,6 +4,9 @@
 #
 
 test_description='git svn reset clears memoized caches'
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./lib-git-svn.sh
 
 svn_ver="$(svn --version --quiet)"
diff --git a/t/t9169-git-svn-dcommit-crlf.sh b/t/t9169-git-svn-dcommit-crlf.sh
index 54b1f61a2a..47ae51c54f 100755
--- a/t/t9169-git-svn-dcommit-crlf.sh
+++ b/t/t9169-git-svn-dcommit-crlf.sh
@@ -1,6 +1,9 @@
 #!/bin/sh
 
 test_description='git svn dcommit CRLF'
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./lib-git-svn.sh
 
 test_expect_success 'setup commit repository' '
diff --git a/t/t9300-fast-import.sh b/t/t9300-fast-import.sh
index 308c1ef42c..404a42999e 100755
--- a/t/t9300-fast-import.sh
+++ b/t/t9300-fast-import.sh
@@ -4,6 +4,9 @@
 #
 
 test_description='test git fast-import utility'
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 . "$TEST_DIRECTORY"/diff-lib.sh ;# test-lib chdir's into trash
 
diff --git a/t/t9301-fast-import-notes.sh b/t/t9301-fast-import-notes.sh
index 14c1baa739..0c5bfbde0e 100755
--- a/t/t9301-fast-import-notes.sh
+++ b/t/t9301-fast-import-notes.sh
@@ -4,6 +4,9 @@
 #
 
 test_description='test git fast-import of notes objects'
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 
diff --git a/t/t9350-fast-export.sh b/t/t9350-fast-export.sh
index 1372842559..6c8830ece5 100755
--- a/t/t9350-fast-export.sh
+++ b/t/t9350-fast-export.sh
@@ -4,6 +4,9 @@
 #
 
 test_description='git fast-export'
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 test_expect_success 'setup' '
diff --git a/t/t9351-fast-export-anonymize.sh b/t/t9351-fast-export-anonymize.sh
index 5ac2c3b5ee..4130c8a837 100755
--- a/t/t9351-fast-export-anonymize.sh
+++ b/t/t9351-fast-export-anonymize.sh
@@ -1,6 +1,9 @@
 #!/bin/sh
 
 test_description='basic tests for fast-export --anonymize'
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 test_expect_success 'setup simple repo' '
diff --git a/t/t9400-git-cvsserver-server.sh b/t/t9400-git-cvsserver-server.sh
index 4a46f31c41..7d23e6ba94 100755
--- a/t/t9400-git-cvsserver-server.sh
+++ b/t/t9400-git-cvsserver-server.sh
@@ -8,6 +8,9 @@ test_description='git-cvsserver access
 tests read access to a git repository with the
 cvs CLI client via git-cvsserver server'
 
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 if ! test_have_prereq PERL; then
diff --git a/t/t9401-git-cvsserver-crlf.sh b/t/t9401-git-cvsserver-crlf.sh
index c7a0dd84a4..0062341dbf 100755
--- a/t/t9401-git-cvsserver-crlf.sh
+++ b/t/t9401-git-cvsserver-crlf.sh
@@ -9,6 +9,9 @@ test_description='git-cvsserver -kb modes
 tests -kb mode for binary files when accessing a git
 repository using cvs CLI client via git-cvsserver server'
 
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 marked_as () {
diff --git a/t/t9402-git-cvsserver-refs.sh b/t/t9402-git-cvsserver-refs.sh
index 6436c91a3c..33b6db1648 100755
--- a/t/t9402-git-cvsserver-refs.sh
+++ b/t/t9402-git-cvsserver-refs.sh
@@ -5,6 +5,9 @@ test_description='git-cvsserver and git refspecs
 tests ability for git-cvsserver to switch between and compare
 tags, branches and other git refspecs'
 
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 #########
diff --git a/t/t9500-gitweb-standalone-no-errors.sh b/t/t9500-gitweb-standalone-no-errors.sh
index b484e3e250..fa36bf5e83 100755
--- a/t/t9500-gitweb-standalone-no-errors.sh
+++ b/t/t9500-gitweb-standalone-no-errors.sh
@@ -10,6 +10,9 @@ commandline, and checks that it would not write any errors
 or warnings to log.'
 
 
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./gitweb-lib.sh
 
 # ----------------------------------------------------------------------
diff --git a/t/t9501-gitweb-standalone-http-status.sh b/t/t9501-gitweb-standalone-http-status.sh
index 2a0ffed870..6b0adf28d2 100755
--- a/t/t9501-gitweb-standalone-http-status.sh
+++ b/t/t9501-gitweb-standalone-http-status.sh
@@ -10,6 +10,9 @@ commandline, and checks that it returns the expected HTTP status
 code and message.'
 
 
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./gitweb-lib.sh
 
 #
diff --git a/t/t9502-gitweb-standalone-parse-output.sh b/t/t9502-gitweb-standalone-parse-output.sh
index e38cbc97d3..76d90eccd8 100755
--- a/t/t9502-gitweb-standalone-parse-output.sh
+++ b/t/t9502-gitweb-standalone-parse-output.sh
@@ -10,6 +10,9 @@ commandline, and checks that it produces the correct output, either
 in the HTTP header or the actual script output.'
 
 
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./gitweb-lib.sh
 
 # ----------------------------------------------------------------------
diff --git a/t/t9600-cvsimport.sh b/t/t9600-cvsimport.sh
index 251fdd66c4..9257d664f2 100755
--- a/t/t9600-cvsimport.sh
+++ b/t/t9600-cvsimport.sh
@@ -1,6 +1,9 @@
 #!/bin/sh
 
 test_description='git cvsimport basic tests'
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./lib-cvs.sh
 
 if ! test_have_prereq NOT_ROOT; then
diff --git a/t/t9601-cvsimport-vendor-branch.sh b/t/t9601-cvsimport-vendor-branch.sh
index 827d39f5bf..700c2688d2 100755
--- a/t/t9601-cvsimport-vendor-branch.sh
+++ b/t/t9601-cvsimport-vendor-branch.sh
@@ -32,6 +32,9 @@
 #       tag has been removed.
 
 test_description='git cvsimport handling of vendor branches'
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./lib-cvs.sh
 
 setup_cvs_test_repository t9601
diff --git a/t/t9602-cvsimport-branches-tags.sh b/t/t9602-cvsimport-branches-tags.sh
index e1db323f54..7b1fb36e67 100755
--- a/t/t9602-cvsimport-branches-tags.sh
+++ b/t/t9602-cvsimport-branches-tags.sh
@@ -4,6 +4,9 @@
 # t9602/README.
 
 test_description='git cvsimport handling of branches and tags'
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./lib-cvs.sh
 
 setup_cvs_test_repository t9602
diff --git a/t/t9603-cvsimport-patchsets.sh b/t/t9603-cvsimport-patchsets.sh
index e7a91611dc..87cd8c0c6b 100755
--- a/t/t9603-cvsimport-patchsets.sh
+++ b/t/t9603-cvsimport-patchsets.sh
@@ -12,6 +12,9 @@
 # bug.
 
 test_description='git cvsimport testing for correct patchset estimation'
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./lib-cvs.sh
 
 setup_cvs_test_repository t9603
diff --git a/t/t9800-git-p4-basic.sh b/t/t9800-git-p4-basic.sh
index c98c1dfc23..c920b84778 100755
--- a/t/t9800-git-p4-basic.sh
+++ b/t/t9800-git-p4-basic.sh
@@ -2,6 +2,9 @@
 
 test_description='git p4 tests'
 
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./lib-git-p4.sh
 
 test_expect_success 'start p4d' '
diff --git a/t/t9801-git-p4-branch.sh b/t/t9801-git-p4-branch.sh
index a3abd778f9..ebfe9d8195 100755
--- a/t/t9801-git-p4-branch.sh
+++ b/t/t9801-git-p4-branch.sh
@@ -2,6 +2,9 @@
 
 test_description='git p4 tests for p4 branches'
 
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./lib-git-p4.sh
 
 test_expect_success 'start p4d' '
diff --git a/t/t9806-git-p4-options.sh b/t/t9806-git-p4-options.sh
index 4e794a01bf..c7629b6c7d 100755
--- a/t/t9806-git-p4-options.sh
+++ b/t/t9806-git-p4-options.sh
@@ -2,6 +2,9 @@
 
 test_description='git p4 options'
 
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./lib-git-p4.sh
 
 test_expect_success 'start p4d' '
diff --git a/t/t9807-git-p4-submit.sh b/t/t9807-git-p4-submit.sh
index eaaae414a1..f12e6f7206 100755
--- a/t/t9807-git-p4-submit.sh
+++ b/t/t9807-git-p4-submit.sh
@@ -2,6 +2,9 @@
 
 test_description='git p4 submit'
 
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./lib-git-p4.sh
 
 test_expect_success 'start p4d' '
diff --git a/t/t9811-git-p4-label-import.sh b/t/t9811-git-p4-label-import.sh
index c1446f26ab..c53952ac14 100755
--- a/t/t9811-git-p4-label-import.sh
+++ b/t/t9811-git-p4-label-import.sh
@@ -2,6 +2,9 @@
 
 test_description='git p4 label tests'
 
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./lib-git-p4.sh
 
 test_expect_success 'start p4d' '
diff --git a/t/t9902-completion.sh b/t/t9902-completion.sh
index 5c01c75d40..ac436df3b4 100755
--- a/t/t9902-completion.sh
+++ b/t/t9902-completion.sh
@@ -5,6 +5,9 @@
 
 test_description='test bash completion'
 
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./lib-bash.sh
 
 complete ()
diff --git a/t/t9903-bash-prompt.sh b/t/t9903-bash-prompt.sh
index ab5da2cabc..f5b5935c2c 100755
--- a/t/t9903-bash-prompt.sh
+++ b/t/t9903-bash-prompt.sh
@@ -5,6 +5,9 @@
 
 test_description='test git-specific bash prompt functions'
 
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./lib-bash.sh
 
 . "$GIT_BUILD_DIR/contrib/completion/git-prompt.sh"
-- 
gitgitgadget


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH v3 02/28] t0060: preemptively adjust alignment
  2020-11-18 23:44   ` [PATCH v3 00/28] tests: use main as default branch name Johannes Schindelin via GitGitGadget
  2020-11-18 23:44     ` [PATCH v3 01/28] tests: mark tests relying on the current default for `init.defaultBranch` Johannes Schindelin via GitGitGadget
@ 2020-11-18 23:44     ` Johannes Schindelin via GitGitGadget
  2020-11-18 23:44     ` [PATCH v3 03/28] t[01]*: adjust the references to the default branch name "main" Johannes Schindelin via GitGitGadget
                       ` (26 subsequent siblings)
  28 siblings, 0 replies; 163+ messages in thread
From: Johannes Schindelin via GitGitGadget @ 2020-11-18 23:44 UTC (permalink / raw)
  To: git
  Cc: Felipe Contreras, Ævar Arnfjörð Bjarmason,
	Johannes Schindelin, Jeff King, Jonathan Nieder,
	Johannes Schindelin, Johannes Schindelin

From: Johannes Schindelin <johannes.schindelin@gmx.de>

We are about to adjust t0060 for the new default branch name `main`.
This name is two characters shorter and therefore needs two spaces more
padding to align correctly.

Adjusting the alignment before the big search-and-replace makes it
easier to verify that the final result does not leave any misaligned
lines behind.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
---
 t/t0060-path-utils.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/t/t0060-path-utils.sh b/t/t0060-path-utils.sh
index b2e3cf3f4c..928eebbdc0 100755
--- a/t/t0060-path-utils.sh
+++ b/t/t0060-path-utils.sh
@@ -312,8 +312,8 @@ test_git_path GIT_COMMON_DIR=bar info/sparse-checkout     .git/info/sparse-check
 test_git_path GIT_COMMON_DIR=bar info//sparse-checkout    .git/info//sparse-checkout
 test_git_path GIT_COMMON_DIR=bar remotes/bar              bar/remotes/bar
 test_git_path GIT_COMMON_DIR=bar branches/bar             bar/branches/bar
-test_git_path GIT_COMMON_DIR=bar logs/refs/heads/master   bar/logs/refs/heads/master
-test_git_path GIT_COMMON_DIR=bar refs/heads/master        bar/refs/heads/master
+test_git_path GIT_COMMON_DIR=bar logs/refs/heads/master     bar/logs/refs/heads/master
+test_git_path GIT_COMMON_DIR=bar refs/heads/master          bar/refs/heads/master
 test_git_path GIT_COMMON_DIR=bar refs/bisect/foo          .git/refs/bisect/foo
 test_git_path GIT_COMMON_DIR=bar hooks/me                 bar/hooks/me
 test_git_path GIT_COMMON_DIR=bar config                   bar/config
-- 
gitgitgadget


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH v3 03/28] t[01]*: adjust the references to the default branch name "main"
  2020-11-18 23:44   ` [PATCH v3 00/28] tests: use main as default branch name Johannes Schindelin via GitGitGadget
  2020-11-18 23:44     ` [PATCH v3 01/28] tests: mark tests relying on the current default for `init.defaultBranch` Johannes Schindelin via GitGitGadget
  2020-11-18 23:44     ` [PATCH v3 02/28] t0060: preemptively adjust alignment Johannes Schindelin via GitGitGadget
@ 2020-11-18 23:44     ` Johannes Schindelin via GitGitGadget
  2020-11-18 23:44     ` [PATCH v3 04/28] t2*: " Johannes Schindelin via GitGitGadget
                       ` (25 subsequent siblings)
  28 siblings, 0 replies; 163+ messages in thread
From: Johannes Schindelin via GitGitGadget @ 2020-11-18 23:44 UTC (permalink / raw)
  To: git
  Cc: Felipe Contreras, Ævar Arnfjörð Bjarmason,
	Johannes Schindelin, Jeff King, Jonathan Nieder,
	Johannes Schindelin, Johannes Schindelin

From: Johannes Schindelin <johannes.schindelin@gmx.de>

Carefully excluding t1309, which sees independent development elsewhere
at the time of writing, we transition above-mentioned tests 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' -e 's/naster/nain/g' -- t[01]*.sh &&
	   git checkout HEAD -- t1309\*)

Note that t5533 contains a variation of the name `master` (`naster`)
that we rename here, too.

This allows us to define `GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main`
for those tests.

Helped-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
---
 t/t0002-gitfile.sh                   |  8 ++--
 t/t0020-crlf.sh                      | 10 ++--
 t/t0021-conversion.sh                | 42 ++++++++---------
 t/t0027-auto-crlf.sh                 |  4 +-
 t/t0028-working-tree-encoding.sh     |  6 +--
 t/t0041-usage.sh                     | 12 ++---
 t/t0050-filesystem.sh                |  8 ++--
 t/t0060-path-utils.sh                |  4 +-
 t/t0100-previous.sh                  | 20 ++++----
 t/t1004-read-tree-m-u-wf.sh          | 42 ++++++++---------
 t/t1008-read-tree-overlay.sh         |  4 +-
 t/t1009-read-tree-new-index.sh       |  6 +--
 t/t1011-read-tree-sparse-checkout.sh |  2 +-
 t/t1021-rerere-in-workdir.sh         |  4 +-
 t/t1090-sparse-checkout-scope.sh     | 12 ++---
 t/t1091-sparse-checkout-builtin.sh   |  4 +-
 t/t1300-config.sh                    | 10 ++--
 t/t1301-shared-repo.sh               |  6 +--
 t/t1305-config-include.sh            |  2 +-
 t/t1400-update-ref.sh                | 70 ++++++++++++++--------------
 t/t1402-check-ref-format.sh          | 32 ++++++-------
 t/t1403-show-ref.sh                  | 20 ++++----
 t/t1405-main-ref-store.sh            | 44 ++++++++---------
 t/t1406-submodule-ref-store.sh       | 32 ++++++-------
 t/t1407-worktree-ref-store.sh        | 34 +++++++-------
 t/t1408-packed-refs.sh               | 14 +++---
 t/t1410-reflog.sh                    | 58 +++++++++++------------
 t/t1411-reflog-show.sh               |  4 +-
 t/t1413-reflog-detach.sh             | 26 +++++------
 t/t1414-reflog-walk.sh               | 14 +++---
 t/t1416-ref-transaction-hooks.sh     | 12 ++---
 t/t1430-bad-ref-name.sh              | 54 ++++++++++-----------
 t/t1450-fsck.sh                      |  2 +-
 t/t1500-rev-parse.sh                 |  6 +--
 t/t1503-rev-parse-verify.sh          | 30 ++++++------
 t/t1505-rev-parse-last.sh            | 10 ++--
 t/t1506-rev-parse-diagnosis.sh       |  6 +--
 t/t1507-rev-parse-upstream.sh        | 42 ++++++++---------
 t/t1508-at-combinations.sh           | 12 ++---
 t/t1511-rev-parse-caret.sh           | 28 +++++------
 t/t1512-rev-parse-disambiguation.sh  |  4 +-
 t/t1513-rev-parse-prefix.sh          |  6 +--
 t/t1514-rev-parse-push.sh            | 18 +++----
 t/t1700-split-index.sh               |  4 +-
 44 files changed, 394 insertions(+), 394 deletions(-)

diff --git a/t/t0002-gitfile.sh b/t/t0002-gitfile.sh
index 0a396c95e5..8440e6add1 100755
--- a/t/t0002-gitfile.sh
+++ b/t/t0002-gitfile.sh
@@ -4,7 +4,7 @@ test_description='.git file
 
 Verify that plumbing commands work when .git is a file
 '
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -99,7 +99,7 @@ test_expect_success 'enter_repo non-strict mode' '
 	git ls-remote enter_repo >actual &&
 	cat >expected <<-EOF &&
 	$head	HEAD
-	$head	refs/heads/master
+	$head	refs/heads/main
 	$head	refs/tags/foo
 	EOF
 	test_cmp expected actual
@@ -114,7 +114,7 @@ test_expect_success 'enter_repo linked checkout' '
 	git ls-remote foo >actual &&
 	cat >expected <<-EOF &&
 	$head	HEAD
-	$head	refs/heads/master
+	$head	refs/heads/main
 	$head	refs/tags/foo
 	EOF
 	test_cmp expected actual
@@ -125,7 +125,7 @@ test_expect_success 'enter_repo strict mode' '
 	git ls-remote --upload-pack="git upload-pack --strict" foo/.git >actual &&
 	cat >expected <<-EOF &&
 	$head	HEAD
-	$head	refs/heads/master
+	$head	refs/heads/main
 	$head	refs/tags/foo
 	EOF
 	test_cmp expected actual
diff --git a/t/t0020-crlf.sh b/t/t0020-crlf.sh
index 0d43189048..375cf94398 100755
--- a/t/t0020-crlf.sh
+++ b/t/t0020-crlf.sh
@@ -2,7 +2,7 @@
 
 test_description='CRLF conversion'
 
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -321,8 +321,8 @@ test_expect_success 'checkout with existing .gitattributes' '
 	git add .gitattributes .file &&
 	git commit -m second &&
 
-	git checkout master~1 &&
-	git checkout master &&
+	git checkout main~1 &&
+	git checkout main &&
 	test "$(git diff-files --raw)" = ""
 
 '
@@ -334,8 +334,8 @@ test_expect_success 'checkout when deleting .gitattributes' '
 	git add .file2 &&
 	git commit -m third &&
 
-	git checkout master~1 &&
-	git checkout master &&
+	git checkout main~1 &&
+	git checkout main &&
 	has_cr .file2
 
 '
diff --git a/t/t0021-conversion.sh b/t/t0021-conversion.sh
index adf862aef1..e4c4de5c74 100755
--- a/t/t0021-conversion.sh
+++ b/t/t0021-conversion.sh
@@ -2,7 +2,7 @@
 
 test_description='blob conversion via gitattributes'
 
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -381,8 +381,8 @@ test_expect_success PERL 'required process filter should filter data' '
 		test_cmp_count expected.log debug.log &&
 
 		git commit -m "test commit 2" &&
-		MASTER=$(git rev-parse --verify master) &&
-		META="ref=refs/heads/master treeish=$MASTER" &&
+		MAIN=$(git rev-parse --verify main) &&
+		META="ref=refs/heads/main treeish=$MAIN" &&
 		rm -f test2.r "testsubdir/test3 '\''sq'\'',\$x=.r" &&
 
 		filter_git checkout --quiet --no-progress . &&
@@ -407,7 +407,7 @@ test_expect_success PERL 'required process filter should filter data' '
 		EOF
 		test_cmp_exclude_clean expected.log debug.log &&
 
-		filter_git checkout --quiet --no-progress master &&
+		filter_git checkout --quiet --no-progress main &&
 		cat >expected.log <<-EOF &&
 			START
 			init handshake complete
@@ -439,15 +439,15 @@ test_expect_success PERL 'required process filter should filter data for various
 		M3=$(git hash-object "testsubdir/test3 '\''sq'\'',\$x=.r") &&
 		EMPTY=$(git hash-object /dev/null) &&
 
-		MASTER=$(git rev-parse --verify master) &&
+		MAIN=$(git rev-parse --verify main) &&
 
 		cp "$TEST_ROOT/test.o" test5.r &&
 		git add test5.r &&
 		git commit -m "test commit 3" &&
 		git checkout empty-branch &&
-		filter_git rebase --onto empty-branch master^^ master &&
-		MASTER2=$(git rev-parse --verify master) &&
-		META="ref=refs/heads/master treeish=$MASTER2" &&
+		filter_git rebase --onto empty-branch main^^ main &&
+		MAIN2=$(git rev-parse --verify main) &&
+		META="ref=refs/heads/main treeish=$MAIN2" &&
 		cat >expected.log <<-EOF &&
 			START
 			init handshake complete
@@ -461,8 +461,8 @@ test_expect_success PERL 'required process filter should filter data for various
 		test_cmp_exclude_clean expected.log debug.log &&
 
 		git reset --hard empty-branch &&
-		filter_git reset --hard $MASTER &&
-		META="treeish=$MASTER" &&
+		filter_git reset --hard $MAIN &&
+		META="treeish=$MAIN" &&
 		cat >expected.log <<-EOF &&
 			START
 			init handshake complete
@@ -474,10 +474,10 @@ test_expect_success PERL 'required process filter should filter data for various
 		EOF
 		test_cmp_exclude_clean expected.log debug.log &&
 
-		git branch old-master $MASTER &&
+		git branch old-main $MAIN &&
 		git reset --hard empty-branch &&
-		filter_git reset --hard old-master &&
-		META="ref=refs/heads/old-master treeish=$MASTER" &&
+		filter_git reset --hard old-main &&
+		META="ref=refs/heads/old-main treeish=$MAIN" &&
 		cat >expected.log <<-EOF &&
 			START
 			init handshake complete
@@ -490,9 +490,9 @@ test_expect_success PERL 'required process filter should filter data for various
 		test_cmp_exclude_clean expected.log debug.log &&
 
 		git checkout -b merge empty-branch &&
-		git branch -f master $MASTER2 &&
-		filter_git merge master &&
-		META="treeish=$MASTER2" &&
+		git branch -f main $MAIN2 &&
+		filter_git merge main &&
+		META="treeish=$MAIN2" &&
 		cat >expected.log <<-EOF &&
 			START
 			init handshake complete
@@ -505,8 +505,8 @@ test_expect_success PERL 'required process filter should filter data for various
 		EOF
 		test_cmp_exclude_clean expected.log debug.log &&
 
-		filter_git archive master >/dev/null &&
-		META="ref=refs/heads/master treeish=$MASTER2" &&
+		filter_git archive main >/dev/null &&
+		META="ref=refs/heads/main treeish=$MAIN2" &&
 		cat >expected.log <<-EOF &&
 			START
 			init handshake complete
@@ -519,7 +519,7 @@ test_expect_success PERL 'required process filter should filter data for various
 		EOF
 		test_cmp_exclude_clean expected.log debug.log &&
 
-		TREE="$(git rev-parse $MASTER2^{tree})" &&
+		TREE="$(git rev-parse $MAIN2^{tree})" &&
 		filter_git archive $TREE >/dev/null &&
 		META="treeish=$TREE" &&
 		cat >expected.log <<-EOF &&
@@ -859,8 +859,8 @@ test_expect_success PERL 'delayed checkout in process filter' '
 	) &&
 
 	S=$(test_file_size "$TEST_ROOT/test.o") &&
-	PM="ref=refs/heads/master treeish=$(git -C repo rev-parse --verify master) " &&
-	M="${PM}blob=$(git -C repo rev-parse --verify master:test.a)" &&
+	PM="ref=refs/heads/main treeish=$(git -C repo rev-parse --verify main) " &&
+	M="${PM}blob=$(git -C repo rev-parse --verify main:test.a)" &&
 	cat >a.exp <<-EOF &&
 		START
 		init handshake complete
diff --git a/t/t0027-auto-crlf.sh b/t/t0027-auto-crlf.sh
index 9fcd56fab3..51f74a3ddf 100755
--- a/t/t0027-auto-crlf.sh
+++ b/t/t0027-auto-crlf.sh
@@ -368,9 +368,9 @@ test_expect_success 'ls-files --eol -o Text/Binary' '
 	test_cmp expect actual
 '
 
-test_expect_success 'setup master' '
+test_expect_success 'setup main' '
 	echo >.gitattributes &&
-	git checkout -b master &&
+	git checkout -b main &&
 	git add .gitattributes &&
 	git commit -m "add .gitattributes" . &&
 	printf "\$Id: 0000000000000000000000000000000000000000 \$\nLINEONE\nLINETWO\nLINETHREE"     >LF &&
diff --git a/t/t0028-working-tree-encoding.sh b/t/t0028-working-tree-encoding.sh
index ccdc91c41c..f970a9806b 100755
--- a/t/t0028-working-tree-encoding.sh
+++ b/t/t0028-working-tree-encoding.sh
@@ -2,7 +2,7 @@
 
 test_description='working-tree-encoding conversion via gitattributes'
 
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -218,7 +218,7 @@ test_expect_success 'error if encoding round trip is not the same during refresh
 	TEST_HASH=$(git hash-object --no-filters -w nonsense.utf16le) &&
 	git update-index --add --cacheinfo 100644 $TEST_HASH nonsense.utf16le &&
 	COMMIT=$(git commit-tree -p $(git rev-parse HEAD) -m "plain commit" $(git write-tree)) &&
-	git update-ref refs/heads/master $COMMIT &&
+	git update-ref refs/heads/main $COMMIT &&
 
 	test_must_fail git checkout HEAD^ 2>err.out &&
 	test_i18ngrep "error: .* overwritten by checkout:" err.out
@@ -234,7 +234,7 @@ test_expect_success 'error if encoding garbage is already in Git' '
 	TEST_HASH=$(git hash-object --no-filters -w nonsense.utf16) &&
 	git update-index --add --cacheinfo 100644 $TEST_HASH nonsense.utf16 &&
 	COMMIT=$(git commit-tree -p $(git rev-parse HEAD) -m "plain commit" $(git write-tree)) &&
-	git update-ref refs/heads/master $COMMIT &&
+	git update-ref refs/heads/main $COMMIT &&
 
 	git diff 2>err.out &&
 	test_i18ngrep "error: BOM is required" err.out
diff --git a/t/t0041-usage.sh b/t/t0041-usage.sh
index 068b784e72..c4fc34eb18 100755
--- a/t/t0041-usage.sh
+++ b/t/t0041-usage.sh
@@ -2,7 +2,7 @@
 
 test_description='Test commands behavior when given invalid argument value'
 
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -44,8 +44,8 @@ test_expect_success 'tag usage error' '
 '
 
 test_expect_success 'branch --contains <existent_commit>' '
-	git branch --contains "master" >actual 2>actual.err &&
-	test_i18ngrep "master" actual &&
+	git branch --contains "main" >actual 2>actual.err &&
+	test_i18ngrep "main" actual &&
 	test_line_count = 0 actual.err
 '
 
@@ -57,7 +57,7 @@ test_expect_success 'branch --contains <inexistent_commit>' '
 '
 
 test_expect_success 'branch --no-contains <existent_commit>' '
-	git branch --no-contains "master" >actual 2>actual.err &&
+	git branch --no-contains "main" >actual 2>actual.err &&
 	test_line_count = 0 actual &&
 	test_line_count = 0 actual.err
 '
@@ -76,7 +76,7 @@ test_expect_success 'branch usage error' '
 '
 
 test_expect_success 'for-each-ref --contains <existent_object>' '
-	git for-each-ref --contains "master" >actual 2>actual.err &&
+	git for-each-ref --contains "main" >actual 2>actual.err &&
 	test_line_count = 2 actual &&
 	test_line_count = 0 actual.err
 '
@@ -89,7 +89,7 @@ test_expect_success 'for-each-ref --contains <inexistent_object>' '
 '
 
 test_expect_success 'for-each-ref --no-contains <existent_object>' '
-	git for-each-ref --no-contains "master" >actual 2>actual.err &&
+	git for-each-ref --no-contains "main" >actual 2>actual.err &&
 	test_line_count = 0 actual &&
 	test_line_count = 0 actual.err
 '
diff --git a/t/t0050-filesystem.sh b/t/t0050-filesystem.sh
index 368f7d515b..afc343cf9b 100755
--- a/t/t0050-filesystem.sh
+++ b/t/t0050-filesystem.sh
@@ -2,7 +2,7 @@
 
 test_description='Various filesystem issues'
 
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -68,7 +68,7 @@ test_expect_success "setup case tests" '
 	git mv camelcase tmp &&
 	git mv tmp CamelCase &&
 	git commit -m "rename" &&
-	git checkout -f master
+	git checkout -f main
 '
 
 test_expect_success 'rename (case change)' '
@@ -121,7 +121,7 @@ test_expect_success "setup unicode normalization tests" '
 	git mv $aumlcdiar tmp &&
 	git mv tmp "$auml" &&
 	git commit -m rename &&
-	git checkout -f master
+	git checkout -f main
 '
 
 $test_unicode 'rename (silent unicode normalization)' '
@@ -150,7 +150,7 @@ test_expect_success CASE_INSENSITIVE_FS 'checkout with no pathspec and a case in
 		git add gitweb &&
 		git commit -m "add gitweb/subdir/file" &&
 
-		git checkout master
+		git checkout main
 	)
 '
 
diff --git a/t/t0060-path-utils.sh b/t/t0060-path-utils.sh
index 928eebbdc0..fab077b6f7 100755
--- a/t/t0060-path-utils.sh
+++ b/t/t0060-path-utils.sh
@@ -312,8 +312,8 @@ test_git_path GIT_COMMON_DIR=bar info/sparse-checkout     .git/info/sparse-check
 test_git_path GIT_COMMON_DIR=bar info//sparse-checkout    .git/info//sparse-checkout
 test_git_path GIT_COMMON_DIR=bar remotes/bar              bar/remotes/bar
 test_git_path GIT_COMMON_DIR=bar branches/bar             bar/branches/bar
-test_git_path GIT_COMMON_DIR=bar logs/refs/heads/master     bar/logs/refs/heads/master
-test_git_path GIT_COMMON_DIR=bar refs/heads/master          bar/refs/heads/master
+test_git_path GIT_COMMON_DIR=bar logs/refs/heads/main     bar/logs/refs/heads/main
+test_git_path GIT_COMMON_DIR=bar refs/heads/main          bar/refs/heads/main
 test_git_path GIT_COMMON_DIR=bar refs/bisect/foo          .git/refs/bisect/foo
 test_git_path GIT_COMMON_DIR=bar hooks/me                 bar/hooks/me
 test_git_path GIT_COMMON_DIR=bar config                   bar/config
diff --git a/t/t0100-previous.sh b/t/t0100-previous.sh
index c3c2770ab3..69beb59f62 100755
--- a/t/t0100-previous.sh
+++ b/t/t0100-previous.sh
@@ -2,7 +2,7 @@
 
 test_description='previous branch syntax @{-n}'
 
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -11,7 +11,7 @@ test_expect_success 'branch -d @{-1}' '
 	test_commit A &&
 	git checkout -b junk &&
 	git checkout - &&
-	test "$(git symbolic-ref HEAD)" = refs/heads/master &&
+	test "$(git symbolic-ref HEAD)" = refs/heads/main &&
 	git branch -d @{-1} &&
 	test_must_fail git rev-parse --verify refs/heads/junk
 '
@@ -20,9 +20,9 @@ test_expect_success 'branch -d @{-12} when there is not enough switches yet' '
 	git reflog expire --expire=now &&
 	git checkout -b junk2 &&
 	git checkout - &&
-	test "$(git symbolic-ref HEAD)" = refs/heads/master &&
+	test "$(git symbolic-ref HEAD)" = refs/heads/main &&
 	test_must_fail git branch -d @{-12} &&
-	git rev-parse --verify refs/heads/master
+	git rev-parse --verify refs/heads/main
 '
 
 test_expect_success 'merge @{-1}' '
@@ -31,19 +31,19 @@ test_expect_success 'merge @{-1}' '
 	git checkout A &&
 	test_commit C &&
 	test_commit D &&
-	git branch -f master B &&
+	git branch -f main B &&
 	git branch -f other &&
 	git checkout other &&
-	git checkout master &&
+	git checkout main &&
 	git merge @{-1} &&
 	git cat-file commit HEAD | grep "Merge branch '\''other'\''"
 '
 
 test_expect_success 'merge @{-1}~1' '
-	git checkout master &&
+	git checkout main &&
 	git reset --hard B &&
 	git checkout other &&
-	git checkout master &&
+	git checkout main &&
 	git merge @{-1}~1 &&
 	git cat-file commit HEAD >actual &&
 	grep "Merge branch '\''other'\''" actual
@@ -51,11 +51,11 @@ test_expect_success 'merge @{-1}~1' '
 
 test_expect_success 'merge @{-100} before checking out that many branches yet' '
 	git reflog expire --expire=now &&
-	git checkout -f master &&
+	git checkout -f main &&
 	git reset --hard B &&
 	git branch -f other C &&
 	git checkout other &&
-	git checkout master &&
+	git checkout main &&
 	test_must_fail git merge @{-100}
 '
 
diff --git a/t/t1004-read-tree-m-u-wf.sh b/t/t1004-read-tree-m-u-wf.sh
index 57caa3a73f..11bf10424f 100755
--- a/t/t1004-read-tree-m-u-wf.sh
+++ b/t/t1004-read-tree-m-u-wf.sh
@@ -2,7 +2,7 @@
 
 test_description='read-tree -m -u checks working tree files'
 
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -23,17 +23,17 @@ test_expect_success 'two-way setup' '
 	git branch side &&
 	git tag -f branch-point &&
 
-	echo file2 is not tracked on the master branch anymore &&
+	echo file2 is not tracked on the main branch anymore &&
 	rm -f file2 subdir/file2 &&
 	git update-index --remove file2 subdir/file2 &&
-	git commit -a -m "master removes file2 and subdir/file2"
+	git commit -a -m "main removes file2 and subdir/file2"
 '
 
 test_expect_success 'two-way not clobbering' '
 
-	echo >file2 master creates untracked file2 &&
-	echo >subdir/file2 master creates untracked subdir/file2 &&
-	if err=$(read_tree_u_must_succeed -m -u master side 2>&1)
+	echo >file2 main creates untracked file2 &&
+	echo >subdir/file2 main creates untracked subdir/file2 &&
+	if err=$(read_tree_u_must_succeed -m -u main side 2>&1)
 	then
 		echo should have complained
 		false
@@ -46,7 +46,7 @@ echo file2 >.gitignore
 
 test_expect_success 'two-way with incorrect --exclude-per-directory (1)' '
 
-	if err=$(read_tree_u_must_succeed -m --exclude-per-directory=.gitignore master side 2>&1)
+	if err=$(read_tree_u_must_succeed -m --exclude-per-directory=.gitignore main side 2>&1)
 	then
 		echo should have complained
 		false
@@ -57,7 +57,7 @@ test_expect_success 'two-way with incorrect --exclude-per-directory (1)' '
 
 test_expect_success 'two-way with incorrect --exclude-per-directory (2)' '
 
-	if err=$(read_tree_u_must_succeed -m -u --exclude-per-directory=foo --exclude-per-directory=.gitignore master side 2>&1)
+	if err=$(read_tree_u_must_succeed -m -u --exclude-per-directory=foo --exclude-per-directory=.gitignore main side 2>&1)
 	then
 		echo should have complained
 		false
@@ -68,7 +68,7 @@ test_expect_success 'two-way with incorrect --exclude-per-directory (2)' '
 
 test_expect_success 'two-way clobbering a ignored file' '
 
-	read_tree_u_must_succeed -m -u --exclude-per-directory=.gitignore master side
+	read_tree_u_must_succeed -m -u --exclude-per-directory=.gitignore main side
 '
 
 rm -f .gitignore
@@ -84,21 +84,21 @@ test_expect_success 'three-way not complaining on an untracked path in both' '
 	git update-index --add file3 subdir/file3 &&
 	git commit -a -m "side adds file3 and removes file2" &&
 
-	git checkout master &&
-	echo >file2 file two is untracked on the master side &&
-	echo >subdir/file2 file two is untracked on the master side &&
+	git checkout main &&
+	echo >file2 file two is untracked on the main side &&
+	echo >subdir/file2 file two is untracked on the main side &&
 
-	read_tree_u_must_succeed -m -u branch-point master side
+	read_tree_u_must_succeed -m -u branch-point main side
 '
 
 test_expect_success 'three-way not clobbering a working tree file' '
 
 	git reset --hard &&
 	rm -f file2 subdir/file2 file3 subdir/file3 &&
-	git checkout master &&
-	echo >file3 file three created in master, untracked &&
-	echo >subdir/file3 file three created in master, untracked &&
-	if err=$(read_tree_u_must_succeed -m -u branch-point master side 2>&1)
+	git checkout main &&
+	echo >file3 file three created in main, untracked &&
+	echo >subdir/file3 file three created in main, untracked &&
+	if err=$(read_tree_u_must_succeed -m -u branch-point main side 2>&1)
 	then
 		echo should have complained
 		false
@@ -113,11 +113,11 @@ test_expect_success 'three-way not complaining on an untracked file' '
 
 	git reset --hard &&
 	rm -f file2 subdir/file2 file3 subdir/file3 &&
-	git checkout master &&
-	echo >file3 file three created in master, untracked &&
-	echo >subdir/file3 file three created in master, untracked &&
+	git checkout main &&
+	echo >file3 file three created in main, untracked &&
+	echo >subdir/file3 file three created in main, untracked &&
 
-	read_tree_u_must_succeed -m -u --exclude-per-directory=.gitignore branch-point master side
+	read_tree_u_must_succeed -m -u --exclude-per-directory=.gitignore branch-point main side
 '
 
 test_expect_success '3-way not overwriting local changes (setup)' '
diff --git a/t/t1008-read-tree-overlay.sh b/t/t1008-read-tree-overlay.sh
index edb89447c7..4512fb0b6e 100755
--- a/t/t1008-read-tree-overlay.sh
+++ b/t/t1008-read-tree-overlay.sh
@@ -2,7 +2,7 @@
 
 test_description='test multi-tree read-tree without merging'
 
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -25,7 +25,7 @@ test_expect_success setup '
 '
 
 test_expect_success 'multi-read' '
-	read_tree_must_succeed initial master side &&
+	read_tree_must_succeed initial main side &&
 	test_write_lines a b/c >expect &&
 	git ls-files >actual &&
 	test_cmp expect actual
diff --git a/t/t1009-read-tree-new-index.sh b/t/t1009-read-tree-new-index.sh
index b9bab37ac0..2935f68f8d 100755
--- a/t/t1009-read-tree-new-index.sh
+++ b/t/t1009-read-tree-new-index.sh
@@ -2,7 +2,7 @@
 
 test_description='test read-tree into a fresh index file'
 
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -15,13 +15,13 @@ test_expect_success setup '
 
 test_expect_success 'non-existent index file' '
 	rm -f new-index &&
-	GIT_INDEX_FILE=new-index git read-tree master
+	GIT_INDEX_FILE=new-index git read-tree main
 '
 
 test_expect_success 'empty index file' '
 	rm -f new-index &&
 	> new-index &&
-	GIT_INDEX_FILE=new-index git read-tree master
+	GIT_INDEX_FILE=new-index git read-tree main
 '
 
 test_done
diff --git a/t/t1011-read-tree-sparse-checkout.sh b/t/t1011-read-tree-sparse-checkout.sh
index 140f459977..dfe9794a74 100755
--- a/t/t1011-read-tree-sparse-checkout.sh
+++ b/t/t1011-read-tree-sparse-checkout.sh
@@ -2,7 +2,7 @@
 
 test_description='sparse checkout tests
 
-* (tag: removed, master) removed
+* (tag: removed, main) removed
 | D	sub/added
 * (HEAD, tag: top) modified and added
 | M	init.t
diff --git a/t/t1021-rerere-in-workdir.sh b/t/t1021-rerere-in-workdir.sh
index 9177871c99..0b892894eb 100755
--- a/t/t1021-rerere-in-workdir.sh
+++ b/t/t1021-rerere-in-workdir.sh
@@ -1,7 +1,7 @@
 #!/bin/sh
 
 test_description='rerere run in a workdir'
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -22,7 +22,7 @@ test_expect_success SYMLINKS setup '
 	test_tick &&
 	git commit -a -m goodbye &&
 
-	git checkout master
+	git checkout main
 '
 
 test_expect_success SYMLINKS 'rerere in workdir' '
diff --git a/t/t1090-sparse-checkout-scope.sh b/t/t1090-sparse-checkout-scope.sh
index d731322633..3deb490187 100755
--- a/t/t1090-sparse-checkout-scope.sh
+++ b/t/t1090-sparse-checkout-scope.sh
@@ -2,7 +2,7 @@
 
 test_description='sparse checkout scope tests'
 
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -23,18 +23,18 @@ test_expect_success 'create feature branch' '
 	git commit -m "modification"
 '
 
-test_expect_success 'perform sparse checkout of master' '
+test_expect_success 'perform sparse checkout of main' '
 	git config --local --bool core.sparsecheckout true &&
 	echo "!/*" >.git/info/sparse-checkout &&
 	echo "/a" >>.git/info/sparse-checkout &&
 	echo "/c" >>.git/info/sparse-checkout &&
-	git checkout master &&
+	git checkout main &&
 	test_path_is_file a &&
 	test_path_is_missing b &&
 	test_path_is_file c
 '
 
-test_expect_success 'merge feature branch into sparse checkout of master' '
+test_expect_success 'merge feature branch into sparse checkout of main' '
 	git merge feature &&
 	test_path_is_file a &&
 	test_path_is_missing b &&
@@ -42,10 +42,10 @@ test_expect_success 'merge feature branch into sparse checkout of master' '
 	test "$(cat c)" = "modified"
 '
 
-test_expect_success 'return to full checkout of master' '
+test_expect_success 'return to full checkout of main' '
 	git checkout feature &&
 	echo "/*" >.git/info/sparse-checkout &&
-	git checkout master &&
+	git checkout main &&
 	test_path_is_file a &&
 	test_path_is_file b &&
 	test_path_is_file c &&
diff --git a/t/t1091-sparse-checkout-builtin.sh b/t/t1091-sparse-checkout-builtin.sh
index 25e68ca036..fc64e9ed99 100755
--- a/t/t1091-sparse-checkout-builtin.sh
+++ b/t/t1091-sparse-checkout-builtin.sh
@@ -2,7 +2,7 @@
 
 test_description='sparse checkout builtin tests'
 
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -120,7 +120,7 @@ test_expect_success 'interaction with clone --no-checkout (unborn index)' '
 	test_path_is_missing clone_no_checkout/.git/index &&
 
 	# No branch is checked out until we manually switch to one
-	git -C clone_no_checkout switch master &&
+	git -C clone_no_checkout switch main &&
 	test_path_is_file clone_no_checkout/.git/index &&
 	check_files clone_no_checkout a folder1
 '
diff --git a/t/t1300-config.sh b/t/t1300-config.sh
index 67e201b5c1..c809ab90f9 100755
--- a/t/t1300-config.sh
+++ b/t/t1300-config.sh
@@ -5,7 +5,7 @@
 
 test_description='Test git config in different settings'
 
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -1057,8 +1057,8 @@ test_expect_success 'check split_cmdline return' "
 	echo foo > foo &&
 	git add foo &&
 	git commit -m 'initial commit' &&
-	git config branch.master.mergeoptions 'echo \"' &&
-	test_must_fail git merge master
+	git config branch.main.mergeoptions 'echo \"' &&
+	test_must_fail git merge main
 "
 
 test_expect_success 'git -c "key=value" support' '
@@ -1772,11 +1772,11 @@ test_expect_success '--show-origin blob' '
 
 test_expect_success '--show-origin blob ref' '
 	cat >expect <<-\EOF &&
-	blob:master:custom.conf	user.custom=true
+	blob:main:custom.conf	user.custom=true
 	EOF
 	git add "$CUSTOM_CONFIG_FILE" &&
 	git commit -m "new config file" &&
-	git config --blob=master:"$CUSTOM_CONFIG_FILE" --show-origin --list >output &&
+	git config --blob=main:"$CUSTOM_CONFIG_FILE" --show-origin --list >output &&
 	test_cmp expect output
 '
 
diff --git a/t/t1301-shared-repo.sh b/t/t1301-shared-repo.sh
index c573438f98..ac947bff9f 100755
--- a/t/t1301-shared-repo.sh
+++ b/t/t1301-shared-repo.sh
@@ -5,7 +5,7 @@
 
 test_description='Test shared repository initialization'
 
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -118,13 +118,13 @@ test_expect_success POSIXPERM 'git reflog expire honors core.sharedRepository' '
 	umask 077 &&
 	git config core.sharedRepository group &&
 	git reflog expire --all &&
-	actual="$(ls -l .git/logs/refs/heads/master)" &&
+	actual="$(ls -l .git/logs/refs/heads/main)" &&
 	case "$actual" in
 	-rw-rw-*)
 		: happy
 		;;
 	*)
-		echo Ooops, .git/logs/refs/heads/master is not 0662 [$actual]
+		echo Ooops, .git/logs/refs/heads/main is not 0662 [$actual]
 		false
 		;;
 	esac
diff --git a/t/t1305-config-include.sh b/t/t1305-config-include.sh
index f1e1b289f9..938ca17d78 100755
--- a/t/t1305-config-include.sh
+++ b/t/t1305-config-include.sh
@@ -312,7 +312,7 @@ test_expect_success SYMLINKS 'conditional include, gitdir matching symlink, icas
 test_expect_success 'conditional include, onbranch' '
 	echo "[includeIf \"onbranch:foo-branch\"]path=bar9" >>.git/config &&
 	echo "[test]nine=9" >.git/bar9 &&
-	git checkout -b master &&
+	git checkout -b main &&
 	test_must_fail git config test.nine &&
 	git checkout -b foo-branch &&
 	echo 9 >expect &&
diff --git a/t/t1400-update-ref.sh b/t/t1400-update-ref.sh
index 4ae6f50c02..1ad0bbbc53 100755
--- a/t/t1400-update-ref.sh
+++ b/t/t1400-update-ref.sh
@@ -4,14 +4,14 @@
 #
 
 test_description='Test git update-ref and basic ref logging'
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
 
 Z=$ZERO_OID
 
-m=refs/heads/master
+m=refs/heads/main
 n_dir=refs/heads/gu
 n=$n_dir/fixes
 outside=refs/foo
@@ -261,7 +261,7 @@ test_expect_success "(not) changed .git/$m" '
 	! test $B = $(git show-ref -s --verify $m)
 '
 
-rm -f .git/logs/refs/heads/master
+rm -f .git/logs/refs/heads/main
 test_expect_success "create $m (logged by touch)" '
 	test_config core.logAllRefUpdates false &&
 	GIT_COMMITTER_DATE="2005-05-26 23:30" \
@@ -297,7 +297,7 @@ test_expect_success 'symref empty directory removal' '
 	git branch e1/e2/r1 HEAD &&
 	git branch e1/r2 HEAD &&
 	git checkout e1/e2/r1 &&
-	test_when_finished "git checkout master" &&
+	test_when_finished "git checkout main" &&
 	test_path_is_file .git/refs/heads/e1/e2/r1 &&
 	test_path_is_file .git/logs/refs/heads/e1/e2/r1 &&
 	git update-ref -d HEAD &&
@@ -361,68 +361,68 @@ test_expect_success 'set up for querying the reflog' '
 ed="Thu, 26 May 2005 18:32:00 -0500"
 gd="Thu, 26 May 2005 18:33:00 -0500"
 ld="Thu, 26 May 2005 18:43:00 -0500"
-test_expect_success 'Query "master@{May 25 2005}" (before history)' '
+test_expect_success 'Query "main@{May 25 2005}" (before history)' '
 	test_when_finished "rm -f o e" &&
-	git rev-parse --verify "master@{May 25 2005}" >o 2>e &&
+	git rev-parse --verify "main@{May 25 2005}" >o 2>e &&
 	echo "$C" >expect &&
 	test_cmp expect o &&
-	echo "warning: log for '\''master'\'' only goes back to $ed" >expect &&
+	echo "warning: log for '\''main'\'' only goes back to $ed" >expect &&
 	test_i18ncmp expect e
 '
-test_expect_success 'Query master@{2005-05-25} (before history)' '
+test_expect_success 'Query main@{2005-05-25} (before history)' '
 	test_when_finished "rm -f o e" &&
-	git rev-parse --verify master@{2005-05-25} >o 2>e &&
+	git rev-parse --verify main@{2005-05-25} >o 2>e &&
 	echo "$C" >expect &&
 	test_cmp expect o &&
-	echo "warning: log for '\''master'\'' only goes back to $ed" >expect &&
+	echo "warning: log for '\''main'\'' only goes back to $ed" >expect &&
 	test_i18ncmp expect e
 '
-test_expect_success 'Query "master@{May 26 2005 23:31:59}" (1 second before history)' '
+test_expect_success 'Query "main@{May 26 2005 23:31:59}" (1 second before history)' '
 	test_when_finished "rm -f o e" &&
-	git rev-parse --verify "master@{May 26 2005 23:31:59}" >o 2>e &&
+	git rev-parse --verify "main@{May 26 2005 23:31:59}" >o 2>e &&
 	echo "$C" >expect &&
 	test_cmp expect o &&
-	echo "warning: log for '\''master'\'' only goes back to $ed" >expect &&
+	echo "warning: log for '\''main'\'' only goes back to $ed" >expect &&
 	test_i18ncmp expect e
 '
-test_expect_success 'Query "master@{May 26 2005 23:32:00}" (exactly history start)' '
+test_expect_success 'Query "main@{May 26 2005 23:32:00}" (exactly history start)' '
 	test_when_finished "rm -f o e" &&
-	git rev-parse --verify "master@{May 26 2005 23:32:00}" >o 2>e &&
+	git rev-parse --verify "main@{May 26 2005 23:32:00}" >o 2>e &&
 	echo "$C" >expect &&
 	test_cmp expect o &&
 	test_must_be_empty e
 '
-test_expect_success 'Query "master@{May 26 2005 23:32:30}" (first non-creation change)' '
+test_expect_success 'Query "main@{May 26 2005 23:32:30}" (first non-creation change)' '
 	test_when_finished "rm -f o e" &&
-	git rev-parse --verify "master@{May 26 2005 23:32:30}" >o 2>e &&
+	git rev-parse --verify "main@{May 26 2005 23:32:30}" >o 2>e &&
 	echo "$A" >expect &&
 	test_cmp expect o &&
 	test_must_be_empty e
 '
-test_expect_success 'Query "master@{2005-05-26 23:33:01}" (middle of history with gap)' '
+test_expect_success 'Query "main@{2005-05-26 23:33:01}" (middle of history with gap)' '
 	test_when_finished "rm -f o e" &&
-	git rev-parse --verify "master@{2005-05-26 23:33:01}" >o 2>e &&
+	git rev-parse --verify "main@{2005-05-26 23:33:01}" >o 2>e &&
 	echo "$B" >expect &&
 	test_cmp expect o &&
 	test_i18ngrep -F "warning: log for ref $m has gap after $gd" e
 '
-test_expect_success 'Query "master@{2005-05-26 23:38:00}" (middle of history)' '
+test_expect_success 'Query "main@{2005-05-26 23:38:00}" (middle of history)' '
 	test_when_finished "rm -f o e" &&
-	git rev-parse --verify "master@{2005-05-26 23:38:00}" >o 2>e &&
+	git rev-parse --verify "main@{2005-05-26 23:38:00}" >o 2>e &&
 	echo "$Z" >expect &&
 	test_cmp expect o &&
 	test_must_be_empty e
 '
-test_expect_success 'Query "master@{2005-05-26 23:43:00}" (exact end of history)' '
+test_expect_success 'Query "main@{2005-05-26 23:43:00}" (exact end of history)' '
 	test_when_finished "rm -f o e" &&
-	git rev-parse --verify "master@{2005-05-26 23:43:00}" >o 2>e &&
+	git rev-parse --verify "main@{2005-05-26 23:43:00}" >o 2>e &&
 	echo "$E" >expect &&
 	test_cmp expect o &&
 	test_must_be_empty e
 '
-test_expect_success 'Query "master@{2005-05-28}" (past end of history)' '
+test_expect_success 'Query "main@{2005-05-28}" (past end of history)' '
 	test_when_finished "rm -f o e" &&
-	git rev-parse --verify "master@{2005-05-28}" >o 2>e &&
+	git rev-parse --verify "main@{2005-05-28}" >o 2>e &&
 	echo "$D" >expect &&
 	test_cmp expect o &&
 	test_i18ngrep -F "warning: log for ref $m unexpectedly ended on $ld" e
@@ -464,14 +464,14 @@ test_expect_success 'git commit logged updates' '
 '
 unset h_TEST h_OTHER h_FIXED h_MERGED
 
-test_expect_success 'git cat-file blob master:F (expect OTHER)' '
-	test OTHER = $(git cat-file blob master:F)
+test_expect_success 'git cat-file blob main:F (expect OTHER)' '
+	test OTHER = $(git cat-file blob main:F)
 '
-test_expect_success 'git cat-file blob master@{2005-05-26 23:30}:F (expect TEST)' '
-	test TEST = $(git cat-file blob "master@{2005-05-26 23:30}:F")
+test_expect_success 'git cat-file blob main@{2005-05-26 23:30}:F (expect TEST)' '
+	test TEST = $(git cat-file blob "main@{2005-05-26 23:30}:F")
 '
-test_expect_success 'git cat-file blob master@{2005-05-26 23:42}:F (expect OTHER)' '
-	test OTHER = $(git cat-file blob "master@{2005-05-26 23:42}:F")
+test_expect_success 'git cat-file blob main@{2005-05-26 23:42}:F (expect OTHER)' '
+	test OTHER = $(git cat-file blob "main@{2005-05-26 23:42}:F")
 '
 
 # Test adding and deleting pseudorefs
@@ -583,9 +583,9 @@ test_expect_success 'stdin fails on unknown command' '
 '
 
 test_expect_success 'stdin fails on unbalanced quotes' '
-	echo "create $a \"master" >stdin &&
+	echo "create $a \"main" >stdin &&
 	test_must_fail git update-ref --stdin <stdin 2>err &&
-	grep "fatal: badly quoted argument: \\\"master" err
+	grep "fatal: badly quoted argument: \\\"main" err
 '
 
 test_expect_success PREPARE_FOR_MAIN_BRANCH 'stdin fails on invalid escape' '
@@ -595,9 +595,9 @@ test_expect_success PREPARE_FOR_MAIN_BRANCH 'stdin fails on invalid escape' '
 '
 
 test_expect_success 'stdin fails on junk after quoted argument' '
-	echo "create \"$a\"master" >stdin &&
+	echo "create \"$a\"main" >stdin &&
 	test_must_fail git update-ref --stdin <stdin 2>err &&
-	grep "fatal: unexpected character after quoted argument: \\\"$a\\\"master" err
+	grep "fatal: unexpected character after quoted argument: \\\"$a\\\"main" err
 '
 
 test_expect_success 'stdin fails create with no ref' '
diff --git a/t/t1402-check-ref-format.sh b/t/t1402-check-ref-format.sh
index 98e4a8613b..cabc516ae9 100755
--- a/t/t1402-check-ref-format.sh
+++ b/t/t1402-check-ref-format.sh
@@ -134,18 +134,18 @@ valid_ref !MINGW "$ref" '--refspec-pattern --allow-onelevel --normalize'
 test_expect_success "check-ref-format --branch @{-1}" '
 	T=$(git write-tree) &&
 	sha1=$(echo A | git commit-tree $T) &&
-	git update-ref refs/heads/master $sha1 &&
-	git update-ref refs/remotes/origin/master $sha1 &&
-	git checkout master &&
-	git checkout origin/master &&
-	git checkout master &&
+	git update-ref refs/heads/main $sha1 &&
+	git update-ref refs/remotes/origin/main $sha1 &&
+	git checkout main &&
+	git checkout origin/main &&
+	git checkout main &&
 	refname=$(git check-ref-format --branch @{-1}) &&
 	test "$refname" = "$sha1" &&
 	refname2=$(git check-ref-format --branch @{-2}) &&
-	test "$refname2" = master'
+	test "$refname2" = main'
 
-test_expect_success 'check-ref-format --branch -naster' '
-	test_must_fail git check-ref-format --branch -naster >actual &&
+test_expect_success 'check-ref-format --branch -nain' '
+	test_must_fail git check-ref-format --branch -nain >actual &&
 	test_must_be_empty actual
 '
 
@@ -154,11 +154,11 @@ test_expect_success 'check-ref-format --branch from subdir' '
 
 	T=$(git write-tree) &&
 	sha1=$(echo A | git commit-tree $T) &&
-	git update-ref refs/heads/master $sha1 &&
-	git update-ref refs/remotes/origin/master $sha1 &&
-	git checkout master &&
-	git checkout origin/master &&
-	git checkout master &&
+	git update-ref refs/heads/main $sha1 &&
+	git update-ref refs/remotes/origin/main $sha1 &&
+	git checkout main &&
+	git checkout origin/main &&
+	git checkout main &&
 	refname=$(
 		cd subdir &&
 		git check-ref-format --branch @{-1}
@@ -171,9 +171,9 @@ test_expect_success 'check-ref-format --branch @{-1} from non-repo' '
 	test_must_be_empty actual
 '
 
-test_expect_success 'check-ref-format --branch master from non-repo' '
-	echo master >expect &&
-	nongit git check-ref-format --branch master >actual &&
+test_expect_success 'check-ref-format --branch main from non-repo' '
+	echo main >expect &&
+	nongit git check-ref-format --branch main >actual &&
 	test_cmp expect actual
 '
 
diff --git a/t/t1403-show-ref.sh b/t/t1403-show-ref.sh
index aaf32f3b07..6ce62f878c 100755
--- a/t/t1403-show-ref.sh
+++ b/t/t1403-show-ref.sh
@@ -1,7 +1,7 @@
 #!/bin/sh
 
 test_description='show-ref'
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -12,7 +12,7 @@ test_expect_success setup '
 	git checkout -b side &&
 	test_commit B &&
 	git tag -f -a -m "annotated B" B &&
-	git checkout master &&
+	git checkout main &&
 	test_commit C &&
 	git branch B A^0
 '
@@ -95,23 +95,23 @@ test_expect_success 'show-ref -d' '
 	git show-ref --verify -d refs/tags/A refs/tags/C >actual &&
 	test_cmp expect actual &&
 
-	echo $(git rev-parse refs/heads/master) refs/heads/master >expect &&
-	git show-ref -d master >actual &&
+	echo $(git rev-parse refs/heads/main) refs/heads/main >expect &&
+	git show-ref -d main >actual &&
 	test_cmp expect actual &&
 
-	git show-ref -d heads/master >actual &&
+	git show-ref -d heads/main >actual &&
 	test_cmp expect actual &&
 
-	git show-ref -d refs/heads/master >actual &&
+	git show-ref -d refs/heads/main >actual &&
 	test_cmp expect actual &&
 
-	git show-ref -d --verify refs/heads/master >actual &&
+	git show-ref -d --verify refs/heads/main >actual &&
 	test_cmp expect actual &&
 
-	test_must_fail git show-ref -d --verify master >actual &&
+	test_must_fail git show-ref -d --verify main >actual &&
 	test_must_be_empty actual &&
 
-	test_must_fail git show-ref -d --verify heads/master >actual &&
+	test_must_fail git show-ref -d --verify heads/main >actual &&
 	test_must_be_empty actual &&
 
 	test_must_fail git show-ref --verify -d A C >actual &&
@@ -123,7 +123,7 @@ test_expect_success 'show-ref -d' '
 '
 
 test_expect_success 'show-ref --heads, --tags, --head, pattern' '
-	for branch in B master side
+	for branch in B main side
 	do
 		echo $(git rev-parse refs/heads/$branch) refs/heads/$branch
 	done >expect.heads &&
diff --git a/t/t1405-main-ref-store.sh b/t/t1405-main-ref-store.sh
index 531059b871..602e21957b 100755
--- a/t/t1405-main-ref-store.sh
+++ b/t/t1405-main-ref-store.sh
@@ -2,7 +2,7 @@
 
 test_description='test main ref store api'
 
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -24,9 +24,9 @@ test_expect_success 'peel_ref(new-tag)' '
 	test_cmp expected actual
 '
 
-test_expect_success 'create_symref(FOO, refs/heads/master)' '
-	$RUN create-symref FOO refs/heads/master nothing &&
-	echo refs/heads/master >expected &&
+test_expect_success 'create_symref(FOO, refs/heads/main)' '
+	$RUN create-symref FOO refs/heads/main nothing &&
+	echo refs/heads/main >expected &&
 	git symbolic-ref FOO >actual &&
 	test_cmp expected actual
 '
@@ -34,7 +34,7 @@ test_expect_success 'create_symref(FOO, refs/heads/master)' '
 test_expect_success 'delete_refs(FOO, refs/tags/new-tag)' '
 	git rev-parse FOO -- &&
 	git rev-parse refs/tags/new-tag -- &&
-	m=$(git rev-parse master) &&
+	m=$(git rev-parse main) &&
 	REF_NO_DEREF=1 &&
 	$RUN delete-refs $REF_NO_DEREF nothing FOO refs/tags/new-tag &&
 	test_must_fail git rev-parse --symbolic-full-name FOO &&
@@ -42,19 +42,19 @@ test_expect_success 'delete_refs(FOO, refs/tags/new-tag)' '
 	test_must_fail git rev-parse refs/tags/new-tag --
 '
 
-test_expect_success 'rename_refs(master, new-master)' '
-	git rev-parse master >expected &&
-	$RUN rename-ref refs/heads/master refs/heads/new-master &&
-	git rev-parse new-master >actual &&
+test_expect_success 'rename_refs(main, new-main)' '
+	git rev-parse main >expected &&
+	$RUN rename-ref refs/heads/main refs/heads/new-main &&
+	git rev-parse new-main >actual &&
 	test_cmp expected actual &&
-	test_commit recreate-master
+	test_commit recreate-main
 '
 
 test_expect_success 'for_each_ref(refs/heads/)' '
 	$RUN for-each-ref refs/heads/ | cut -d" " -f 2- >actual &&
 	cat >expected <<-\EOF &&
-	master 0x0
-	new-master 0x0
+	main 0x0
+	new-main 0x0
 	EOF
 	test_cmp expected actual
 '
@@ -65,23 +65,23 @@ test_expect_success 'for_each_ref() is sorted' '
 	test_cmp expected actual
 '
 
-test_expect_success 'resolve_ref(new-master)' '
-	SHA1=`git rev-parse new-master` &&
-	echo "$SHA1 refs/heads/new-master 0x0" >expected &&
-	$RUN resolve-ref refs/heads/new-master 0 >actual &&
+test_expect_success 'resolve_ref(new-main)' '
+	SHA1=`git rev-parse new-main` &&
+	echo "$SHA1 refs/heads/new-main 0x0" >expected &&
+	$RUN resolve-ref refs/heads/new-main 0 >actual &&
 	test_cmp expected actual
 '
 
-test_expect_success 'verify_ref(new-master)' '
-	$RUN verify-ref refs/heads/new-master
+test_expect_success 'verify_ref(new-main)' '
+	$RUN verify-ref refs/heads/new-main
 '
 
 test_expect_success 'for_each_reflog()' '
 	$RUN for-each-reflog | sort -k2 | cut -d" " -f 2- >actual &&
 	cat >expected <<-\EOF &&
 	HEAD 0x1
-	refs/heads/master 0x0
-	refs/heads/new-master 0x0
+	refs/heads/main 0x0
+	refs/heads/new-main 0x0
 	EOF
 	test_cmp expected actual
 '
@@ -89,12 +89,12 @@ test_expect_success 'for_each_reflog()' '
 test_expect_success 'for_each_reflog_ent()' '
 	$RUN for-each-reflog-ent HEAD >actual &&
 	head -n1 actual | grep one &&
-	tail -n2 actual | head -n1 | grep recreate-master
+	tail -n2 actual | head -n1 | grep recreate-main
 '
 
 test_expect_success 'for_each_reflog_ent_reverse()' '
 	$RUN for-each-reflog-ent-reverse HEAD >actual &&
-	head -n1 actual | grep recreate-master &&
+	head -n1 actual | grep recreate-main &&
 	tail -n2 actual | head -n1 | grep one
 '
 
diff --git a/t/t1406-submodule-ref-store.sh b/t/t1406-submodule-ref-store.sh
index 126518c155..a68c8f11a2 100755
--- a/t/t1406-submodule-ref-store.sh
+++ b/t/t1406-submodule-ref-store.sh
@@ -2,7 +2,7 @@
 
 test_description='test submodule ref store api'
 
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -14,7 +14,7 @@ test_expect_success 'setup' '
 	(
 		cd sub &&
 		test_commit first &&
-		git checkout -b new-master
+		git checkout -b new-main
 	)
 '
 
@@ -30,7 +30,7 @@ test_expect_success 'peel_ref(new-tag)' '
 '
 
 test_expect_success 'create_symref() not allowed' '
-	test_must_fail $RUN create-symref FOO refs/heads/master nothing
+	test_must_fail $RUN create-symref FOO refs/heads/main nothing
 '
 
 test_expect_success 'delete_refs() not allowed' '
@@ -38,14 +38,14 @@ test_expect_success 'delete_refs() not allowed' '
 '
 
 test_expect_success 'rename_refs() not allowed' '
-	test_must_fail $RUN rename-ref refs/heads/master refs/heads/new-master
+	test_must_fail $RUN rename-ref refs/heads/main refs/heads/new-main
 '
 
 test_expect_success 'for_each_ref(refs/heads/)' '
 	$RUN for-each-ref refs/heads/ | cut -d" " -f 2- >actual &&
 	cat >expected <<-\EOF &&
-	master 0x0
-	new-master 0x0
+	main 0x0
+	new-main 0x0
 	EOF
 	test_cmp expected actual
 '
@@ -56,23 +56,23 @@ test_expect_success 'for_each_ref() is sorted' '
 	test_cmp expected actual
 '
 
-test_expect_success 'resolve_ref(master)' '
-	SHA1=`git -C sub rev-parse master` &&
-	echo "$SHA1 refs/heads/master 0x0" >expected &&
-	$RUN resolve-ref refs/heads/master 0 >actual &&
+test_expect_success 'resolve_ref(main)' '
+	SHA1=`git -C sub rev-parse main` &&
+	echo "$SHA1 refs/heads/main 0x0" >expected &&
+	$RUN resolve-ref refs/heads/main 0 >actual &&
 	test_cmp expected actual
 '
 
-test_expect_success 'verify_ref(new-master)' '
-	$RUN verify-ref refs/heads/new-master
+test_expect_success 'verify_ref(new-main)' '
+	$RUN verify-ref refs/heads/new-main
 '
 
 test_expect_success 'for_each_reflog()' '
 	$RUN for-each-reflog | sort | cut -d" " -f 2- >actual &&
 	cat >expected <<-\EOF &&
 	HEAD 0x1
-	refs/heads/master 0x0
-	refs/heads/new-master 0x0
+	refs/heads/main 0x0
+	refs/heads/new-main 0x0
 	EOF
 	test_cmp expected actual
 '
@@ -80,12 +80,12 @@ test_expect_success 'for_each_reflog()' '
 test_expect_success 'for_each_reflog_ent()' '
 	$RUN for-each-reflog-ent HEAD >actual &&
 	head -n1 actual | grep first &&
-	tail -n2 actual | head -n1 | grep master.to.new
+	tail -n2 actual | head -n1 | grep main.to.new
 '
 
 test_expect_success 'for_each_reflog_ent_reverse()' '
 	$RUN for-each-reflog-ent-reverse HEAD >actual &&
-	head -n1 actual | grep master.to.new &&
+	head -n1 actual | grep main.to.new &&
 	tail -n2 actual | head -n1 | grep first
 '
 
diff --git a/t/t1407-worktree-ref-store.sh b/t/t1407-worktree-ref-store.sh
index aede1c20d7..d3fe777511 100755
--- a/t/t1407-worktree-ref-store.sh
+++ b/t/t1407-worktree-ref-store.sh
@@ -2,7 +2,7 @@
 
 test_description='test worktree ref store api'
 
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -12,7 +12,7 @@ RMAIN="test-tool ref-store worktree:main"
 
 test_expect_success 'setup' '
 	test_commit first &&
-	git worktree add -b wt-master wt &&
+	git worktree add -b wt-main wt &&
 	(
 		cd wt &&
 		test_commit second
@@ -20,34 +20,34 @@ test_expect_success 'setup' '
 '
 
 test_expect_success 'resolve_ref(<shared-ref>)' '
-	SHA1=`git rev-parse master` &&
-	echo "$SHA1 refs/heads/master 0x0" >expected &&
-	$RWT resolve-ref refs/heads/master 0 >actual &&
+	SHA1=`git rev-parse main` &&
+	echo "$SHA1 refs/heads/main 0x0" >expected &&
+	$RWT resolve-ref refs/heads/main 0 >actual &&
 	test_cmp expected actual &&
-	$RMAIN resolve-ref refs/heads/master 0 >actual &&
+	$RMAIN resolve-ref refs/heads/main 0 >actual &&
 	test_cmp expected actual
 '
 
 test_expect_success 'resolve_ref(<per-worktree-ref>)' '
 	SHA1=`git -C wt rev-parse HEAD` &&
-	echo "$SHA1 refs/heads/wt-master 0x1" >expected &&
+	echo "$SHA1 refs/heads/wt-main 0x1" >expected &&
 	$RWT resolve-ref HEAD 0 >actual &&
 	test_cmp expected actual &&
 
 	SHA1=`git rev-parse HEAD` &&
-	echo "$SHA1 refs/heads/master 0x1" >expected &&
+	echo "$SHA1 refs/heads/main 0x1" >expected &&
 	$RMAIN resolve-ref HEAD 0 >actual &&
 	test_cmp expected actual
 '
 
-test_expect_success 'create_symref(FOO, refs/heads/master)' '
-	$RWT create-symref FOO refs/heads/master nothing &&
-	echo refs/heads/master >expected &&
+test_expect_success 'create_symref(FOO, refs/heads/main)' '
+	$RWT create-symref FOO refs/heads/main nothing &&
+	echo refs/heads/main >expected &&
 	git -C wt symbolic-ref FOO >actual &&
 	test_cmp expected actual &&
 
-	$RMAIN create-symref FOO refs/heads/wt-master nothing &&
-	echo refs/heads/wt-master >expected &&
+	$RMAIN create-symref FOO refs/heads/wt-main nothing &&
+	echo refs/heads/wt-main >expected &&
 	git symbolic-ref FOO >actual &&
 	test_cmp expected actual
 '
@@ -66,8 +66,8 @@ test_expect_success 'for_each_reflog()' '
 	HEAD 0x1
 	PSEUDO-WT 0x0
 	refs/bisect/wt-random 0x0
-	refs/heads/master 0x0
-	refs/heads/wt-master 0x0
+	refs/heads/main 0x0
+	refs/heads/wt-main 0x0
 	EOF
 	test_cmp expected actual &&
 
@@ -76,8 +76,8 @@ test_expect_success 'for_each_reflog()' '
 	HEAD 0x1
 	PSEUDO-MAIN 0x0
 	refs/bisect/random 0x0
-	refs/heads/master 0x0
-	refs/heads/wt-master 0x0
+	refs/heads/main 0x0
+	refs/heads/wt-main 0x0
 	EOF
 	test_cmp expected actual
 '
diff --git a/t/t1408-packed-refs.sh b/t/t1408-packed-refs.sh
index fd58388232..41ba1f1d7f 100755
--- a/t/t1408-packed-refs.sh
+++ b/t/t1408-packed-refs.sh
@@ -2,7 +2,7 @@
 
 test_description='packed-refs entries are covered by loose refs'
 
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -12,32 +12,32 @@ test_expect_success setup '
 	git commit --allow-empty -m one &&
 	one=$(git rev-parse HEAD) &&
 	git for-each-ref >actual &&
-	echo "$one commit	refs/heads/master" >expect &&
+	echo "$one commit	refs/heads/main" >expect &&
 	test_cmp expect actual &&
 
 	git pack-refs --all &&
 	git for-each-ref >actual &&
-	echo "$one commit	refs/heads/master" >expect &&
+	echo "$one commit	refs/heads/main" >expect &&
 	test_cmp expect actual &&
 
 	git checkout --orphan another &&
 	test_tick &&
 	git commit --allow-empty -m two &&
 	two=$(git rev-parse HEAD) &&
-	git checkout -B master &&
+	git checkout -B main &&
 	git branch -D another &&
 
 	git for-each-ref >actual &&
-	echo "$two commit	refs/heads/master" >expect &&
+	echo "$two commit	refs/heads/main" >expect &&
 	test_cmp expect actual &&
 
 	git reflog expire --expire=now --all &&
 	git prune &&
-	git tag -m v1.0 v1.0 master
+	git tag -m v1.0 v1.0 main
 '
 
 test_expect_success 'no error from stale entry in packed-refs' '
-	git describe master >actual 2>&1 &&
+	git describe main >actual 2>&1 &&
 	echo "v1.0" >expect &&
 	test_cmp expect actual
 '
diff --git a/t/t1410-reflog.sh b/t/t1410-reflog.sh
index aa02ca488d..ecccaa0634 100755
--- a/t/t1410-reflog.sh
+++ b/t/t1410-reflog.sh
@@ -4,7 +4,7 @@
 #
 
 test_description='Test prune and reflog expiration'
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -102,7 +102,7 @@ test_expect_success setup '
 
 	check_fsck &&
 
-	git reflog refs/heads/master >output &&
+	git reflog refs/heads/main >output &&
 	test_line_count = 4 output
 '
 
@@ -119,7 +119,7 @@ test_expect_success rewind '
 
 	check_have A B C D E F G H I J K L &&
 
-	git reflog refs/heads/master >output &&
+	git reflog refs/heads/main >output &&
 	test_line_count = 5 output
 '
 
@@ -138,7 +138,7 @@ test_expect_success 'reflog expire --dry-run should not touch reflog' '
 		--stale-fix \
 		--all &&
 
-	git reflog refs/heads/master >output &&
+	git reflog refs/heads/main >output &&
 	test_line_count = 5 output &&
 
 	check_fsck "missing blob $F"
@@ -152,7 +152,7 @@ test_expect_success 'reflog expire' '
 		--stale-fix \
 		--all &&
 
-	git reflog refs/heads/master >output &&
+	git reflog refs/heads/main >output &&
 	test_line_count = 2 output &&
 
 	check_fsck "dangling commit $K"
@@ -189,29 +189,29 @@ test_expect_success 'delete' '
 	git commit -m tiger C &&
 
 	HEAD_entry_count=$(git reflog | wc -l) &&
-	master_entry_count=$(git reflog show master | wc -l) &&
+	main_entry_count=$(git reflog show main | wc -l) &&
 
 	test $HEAD_entry_count = 5 &&
-	test $master_entry_count = 5 &&
+	test $main_entry_count = 5 &&
 
 
-	git reflog delete master@{1} &&
-	git reflog show master > output &&
-	test_line_count = $(($master_entry_count - 1)) output &&
+	git reflog delete main@{1} &&
+	git reflog show main > output &&
+	test_line_count = $(($main_entry_count - 1)) output &&
 	test $HEAD_entry_count = $(git reflog | wc -l) &&
 	! grep ox < output &&
 
-	master_entry_count=$(wc -l < output) &&
+	main_entry_count=$(wc -l < output) &&
 
 	git reflog delete HEAD@{1} &&
 	test $(($HEAD_entry_count -1)) = $(git reflog | wc -l) &&
-	test $master_entry_count = $(git reflog show master | wc -l) &&
+	test $main_entry_count = $(git reflog show main | wc -l) &&
 
 	HEAD_entry_count=$(git reflog | wc -l) &&
 
-	git reflog delete master@{07.04.2005.15:15:00.-0700} &&
-	git reflog show master > output &&
-	test_line_count = $(($master_entry_count - 1)) output &&
+	git reflog delete main@{07.04.2005.15:15:00.-0700} &&
+	git reflog show main > output &&
+	test_line_count = $(($main_entry_count - 1)) output &&
 	! grep dragon < output
 
 '
@@ -219,7 +219,7 @@ test_expect_success 'delete' '
 test_expect_success 'rewind2' '
 
 	test_tick && git reset --hard HEAD~2 &&
-	git reflog refs/heads/master >output &&
+	git reflog refs/heads/main >output &&
 	test_line_count = 4 output
 '
 
@@ -229,7 +229,7 @@ test_expect_success '--expire=never' '
 		--expire=never \
 		--expire-unreachable=never \
 		--all &&
-	git reflog refs/heads/master >output &&
+	git reflog refs/heads/main >output &&
 	test_line_count = 4 output
 '
 
@@ -240,7 +240,7 @@ test_expect_success 'gc.reflogexpire=never' '
 	git reflog expire --verbose --all >output &&
 	test_line_count = 9 output &&
 
-	git reflog refs/heads/master >output &&
+	git reflog refs/heads/main >output &&
 	test_line_count = 4 output
 '
 
@@ -249,7 +249,7 @@ test_expect_success 'gc.reflogexpire=false' '
 	test_config gc.reflogexpireunreachable false &&
 
 	git reflog expire --verbose --all &&
-	git reflog refs/heads/master >output &&
+	git reflog refs/heads/main >output &&
 	test_line_count = 4 output
 
 '
@@ -258,33 +258,33 @@ test_expect_success 'git reflog expire unknown reference' '
 	test_config gc.reflogexpire never &&
 	test_config gc.reflogexpireunreachable never &&
 
-	test_must_fail git reflog expire master@{123} 2>stderr &&
+	test_must_fail git reflog expire main@{123} 2>stderr &&
 	test_i18ngrep "points nowhere" stderr &&
 	test_must_fail git reflog expire does-not-exist 2>stderr &&
 	test_i18ngrep "points nowhere" stderr
 '
 
 test_expect_success 'checkout should not delete log for packed ref' '
-	test $(git reflog master | wc -l) = 4 &&
+	test $(git reflog main | wc -l) = 4 &&
 	git branch foo &&
 	git pack-refs --all &&
 	git checkout foo &&
-	test $(git reflog master | wc -l) = 4
+	test $(git reflog main | wc -l) = 4
 '
 
 test_expect_success 'stale dirs do not cause d/f conflicts (reflogs on)' '
 	test_when_finished "git branch -d one || git branch -d one/two" &&
 
-	git branch one/two master &&
-	echo "one/two@{0} branch: Created from master" >expect &&
+	git branch one/two main &&
+	echo "one/two@{0} branch: Created from main" >expect &&
 	git log -g --format="%gd %gs" one/two >actual &&
 	test_cmp expect actual &&
 	git branch -d one/two &&
 
 	# now logs/refs/heads/one is a stale directory, but
 	# we should move it out of the way to create "one" reflog
-	git branch one master &&
-	echo "one@{0} branch: Created from master" >expect &&
+	git branch one main &&
+	echo "one@{0} branch: Created from main" >expect &&
 	git log -g --format="%gd %gs" one >actual &&
 	test_cmp expect actual
 '
@@ -292,15 +292,15 @@ test_expect_success 'stale dirs do not cause d/f conflicts (reflogs on)' '
 test_expect_success 'stale dirs do not cause d/f conflicts (reflogs off)' '
 	test_when_finished "git branch -d one || git branch -d one/two" &&
 
-	git branch one/two master &&
-	echo "one/two@{0} branch: Created from master" >expect &&
+	git branch one/two main &&
+	echo "one/two@{0} branch: Created from main" >expect &&
 	git log -g --format="%gd %gs" one/two >actual &&
 	test_cmp expect actual &&
 	git branch -d one/two &&
 
 	# same as before, but we only create a reflog for "one" if
 	# it already exists, which it does not
-	git -c core.logallrefupdates=false branch one master &&
+	git -c core.logallrefupdates=false branch one main &&
 	git log -g --format="%gd %gs" one >actual &&
 	test_must_be_empty actual
 '
diff --git a/t/t1411-reflog-show.sh b/t/t1411-reflog-show.sh
index f6fecff671..0bb319b944 100755
--- a/t/t1411-reflog-show.sh
+++ b/t/t1411-reflog-show.sh
@@ -1,7 +1,7 @@
 #!/bin/sh
 
 test_description='Test reflog display routines'
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -170,7 +170,7 @@ test_expect_success 'git log -g -p shows diffs vs. parents' '
 '
 
 test_expect_success 'reflog exists works' '
-	git reflog exists refs/heads/master &&
+	git reflog exists refs/heads/main &&
 	! git reflog exists refs/heads/nonexistent
 '
 
diff --git a/t/t1413-reflog-detach.sh b/t/t1413-reflog-detach.sh
index 140914aa29..bde05208ae 100755
--- a/t/t1413-reflog-detach.sh
+++ b/t/t1413-reflog-detach.sh
@@ -1,13 +1,13 @@
 #!/bin/sh
 
 test_description='Test reflog interaction with detached HEAD'
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
 
 reset_state () {
-	git checkout master &&
+	git checkout main &&
 	cp saved_reflog .git/logs/HEAD
 }
 
@@ -22,14 +22,14 @@ test_expect_success setup '
 
 test_expect_success baseline '
 	reset_state &&
-	git rev-parse master master^ >expect &&
+	git rev-parse main main^ >expect &&
 	git log -g --format=%H >actual &&
 	test_cmp expect actual
 '
 
 test_expect_success 'switch to branch' '
 	reset_state &&
-	git rev-parse side master master^ >expect &&
+	git rev-parse side main main^ >expect &&
 	git checkout side &&
 	git log -g --format=%H >actual &&
 	test_cmp expect actual
@@ -37,34 +37,34 @@ test_expect_success 'switch to branch' '
 
 test_expect_success 'detach to other' '
 	reset_state &&
-	git rev-parse master side master master^ >expect &&
+	git rev-parse main side main main^ >expect &&
 	git checkout side &&
-	git checkout master^0 &&
+	git checkout main^0 &&
 	git log -g --format=%H >actual &&
 	test_cmp expect actual
 '
 
 test_expect_success 'detach to self' '
 	reset_state &&
-	git rev-parse master master master^ >expect &&
-	git checkout master^0 &&
+	git rev-parse main main main^ >expect &&
+	git checkout main^0 &&
 	git log -g --format=%H >actual &&
 	test_cmp expect actual
 '
 
 test_expect_success 'attach to self' '
 	reset_state &&
-	git rev-parse master master master master^ >expect &&
-	git checkout master^0 &&
-	git checkout master &&
+	git rev-parse main main main main^ >expect &&
+	git checkout main^0 &&
+	git checkout main &&
 	git log -g --format=%H >actual &&
 	test_cmp expect actual
 '
 
 test_expect_success 'attach to other' '
 	reset_state &&
-	git rev-parse side master master master^ >expect &&
-	git checkout master^0 &&
+	git rev-parse side main main main^ >expect &&
+	git checkout main^0 &&
 	git checkout side &&
 	git log -g --format=%H >actual &&
 	test_cmp expect actual
diff --git a/t/t1414-reflog-walk.sh b/t/t1414-reflog-walk.sh
index c463b5fc29..80d94704d0 100755
--- a/t/t1414-reflog-walk.sh
+++ b/t/t1414-reflog-walk.sh
@@ -1,7 +1,7 @@
 #!/bin/sh
 
 test_description='various tests of reflog walk (log -g) behavior'
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -11,7 +11,7 @@ test_expect_success 'set up some reflog entries' '
 	test_commit two &&
 	git checkout -b side HEAD^ &&
 	test_commit three &&
-	git merge --no-commit master &&
+	git merge --no-commit main &&
 	echo evil-merge-content >>one.t &&
 	test_tick &&
 	git commit --no-edit -a
@@ -23,9 +23,9 @@ do_walk () {
 
 test_expect_success 'set up expected reflog' '
 	cat >expect.all <<-EOF
-	HEAD@{0} commit (merge): Merge branch ${SQ}master${SQ} into side
+	HEAD@{0} commit (merge): Merge branch ${SQ}main${SQ} into side
 	HEAD@{1} commit: three
-	HEAD@{2} checkout: moving from master to side
+	HEAD@{2} checkout: moving from main to side
 	HEAD@{3} commit: two
 	HEAD@{4} commit (initial): one
 	EOF
@@ -76,15 +76,15 @@ test_expect_success 'walking multiple reflogs shows all' '
 	#      sort ignores the bits after the timestamp.
 	#
 	#   2. POSIX leaves undefined whether this is a stable sort or not. So
-	#      we use "-k 1" to ensure that we see HEAD before master before
+	#      we use "-k 1" to ensure that we see HEAD before main before
 	#      side when breaking ties.
 	{
 		do_walk --date=unix HEAD &&
 		do_walk --date=unix side &&
-		do_walk --date=unix master
+		do_walk --date=unix main
 	} >expect.raw &&
 	sort -t "{" -k 2nr -k 1 <expect.raw >expect &&
-	do_walk --date=unix HEAD master side >actual &&
+	do_walk --date=unix HEAD main side >actual &&
 	test_cmp expect actual
 '
 
diff --git a/t/t1416-ref-transaction-hooks.sh b/t/t1416-ref-transaction-hooks.sh
index a26a6b782d..6c941027a8 100755
--- a/t/t1416-ref-transaction-hooks.sh
+++ b/t/t1416-ref-transaction-hooks.sh
@@ -2,7 +2,7 @@
 
 test_description='reference transaction hooks'
 
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -56,11 +56,11 @@ test_expect_success 'hook gets all queued updates in prepared state' '
 	EOF
 	cat >expect <<-EOF &&
 		$ZERO_OID $POST_OID HEAD
-		$ZERO_OID $POST_OID refs/heads/master
+		$ZERO_OID $POST_OID refs/heads/main
 	EOF
 	git update-ref HEAD POST <<-EOF &&
 		update HEAD $ZERO_OID $POST_OID
-		update refs/heads/master $ZERO_OID $POST_OID
+		update refs/heads/main $ZERO_OID $POST_OID
 	EOF
 	test_cmp expect actual
 '
@@ -79,7 +79,7 @@ test_expect_success 'hook gets all queued updates in committed state' '
 	EOF
 	cat >expect <<-EOF &&
 		$ZERO_OID $POST_OID HEAD
-		$ZERO_OID $POST_OID refs/heads/master
+		$ZERO_OID $POST_OID refs/heads/main
 	EOF
 	git update-ref HEAD POST &&
 	test_cmp expect actual
@@ -99,12 +99,12 @@ test_expect_success 'hook gets all queued updates in aborted state' '
 	EOF
 	cat >expect <<-EOF &&
 		$ZERO_OID $POST_OID HEAD
-		$ZERO_OID $POST_OID refs/heads/master
+		$ZERO_OID $POST_OID refs/heads/main
 	EOF
 	git update-ref --stdin <<-EOF &&
 		start
 		update HEAD POST $ZERO_OID
-		update refs/heads/master POST $ZERO_OID
+		update refs/heads/main POST $ZERO_OID
 		abort
 	EOF
 	test_cmp expect actual
diff --git a/t/t1430-bad-ref-name.sh b/t/t1430-bad-ref-name.sh
index 8c4353746b..354902e514 100755
--- a/t/t1430-bad-ref-name.sh
+++ b/t/t1430-bad-ref-name.sh
@@ -1,7 +1,7 @@
 #!/bin/sh
 
 test_description='Test handling of ref names that check-ref-format rejects'
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -20,7 +20,7 @@ test_expect_success 'fast-import: fail on invalid branch name ".badbranchname"'
 		corrupt
 		COMMIT
 
-		from refs/heads/master
+		from refs/heads/main
 
 	INPUT_END
 	test_must_fail git fast-import <input
@@ -35,14 +35,14 @@ test_expect_success 'fast-import: fail on invalid branch name "bad[branch]name"'
 		corrupt
 		COMMIT
 
-		from refs/heads/master
+		from refs/heads/main
 
 	INPUT_END
 	test_must_fail git fast-import <input
 '
 
 test_expect_success 'git branch shows badly named ref as warning' '
-	cp .git/refs/heads/master .git/refs/heads/broken...ref &&
+	cp .git/refs/heads/main .git/refs/heads/broken...ref &&
 	test_when_finished "rm -f .git/refs/heads/broken...ref" &&
 	git branch >output 2>error &&
 	test_i18ngrep -e "ignoring ref with broken name refs/heads/broken\.\.\.ref" error &&
@@ -50,7 +50,7 @@ test_expect_success 'git branch shows badly named ref as warning' '
 '
 
 test_expect_success 'branch -d can delete badly named ref' '
-	cp .git/refs/heads/master .git/refs/heads/broken...ref &&
+	cp .git/refs/heads/main .git/refs/heads/broken...ref &&
 	test_when_finished "rm -f .git/refs/heads/broken...ref" &&
 	git branch -d broken...ref &&
 	git branch >output 2>error &&
@@ -59,7 +59,7 @@ test_expect_success 'branch -d can delete badly named ref' '
 '
 
 test_expect_success 'branch -D can delete badly named ref' '
-	cp .git/refs/heads/master .git/refs/heads/broken...ref &&
+	cp .git/refs/heads/main .git/refs/heads/broken...ref &&
 	test_when_finished "rm -f .git/refs/heads/broken...ref" &&
 	git branch -D broken...ref &&
 	git branch >output 2>error &&
@@ -101,17 +101,17 @@ test_expect_success 'branch -m cannot rename to a bad ref name' '
 	test_might_fail git branch -D goodref &&
 	git branch goodref &&
 	test_must_fail git branch -m goodref broken...ref &&
-	test_cmp_rev master goodref &&
+	test_cmp_rev main goodref &&
 	git branch >output 2>error &&
 	! grep -e "broken\.\.\.ref" error &&
 	! grep -e "broken\.\.\.ref" output
 '
 
 test_expect_failure 'branch -m can rename from a bad ref name' '
-	cp .git/refs/heads/master .git/refs/heads/broken...ref &&
+	cp .git/refs/heads/main .git/refs/heads/broken...ref &&
 	test_when_finished "rm -f .git/refs/heads/broken...ref" &&
 	git branch -m broken...ref renamed &&
-	test_cmp_rev master renamed &&
+	test_cmp_rev main renamed &&
 	git branch >output 2>error &&
 	! grep -e "broken\.\.\.ref" error &&
 	! grep -e "broken\.\.\.ref" output
@@ -138,7 +138,7 @@ test_expect_failure C_LOCALE_OUTPUT 'push --mirror can delete badly named ref' '
 		cd dest &&
 		test_commit two &&
 		git checkout --detach &&
-		cp .git/refs/heads/master .git/refs/heads/broken...ref
+		cp .git/refs/heads/main .git/refs/heads/broken...ref
 	) &&
 	git -C src push --mirror "file://$top/dest" &&
 	git -C dest branch >output 2>error &&
@@ -149,7 +149,7 @@ test_expect_failure C_LOCALE_OUTPUT 'push --mirror can delete badly named ref' '
 test_expect_success 'rev-parse skips symref pointing to broken name' '
 	test_when_finished "rm -f .git/refs/heads/broken...ref" &&
 	git branch shadow one &&
-	cp .git/refs/heads/master .git/refs/heads/broken...ref &&
+	cp .git/refs/heads/main .git/refs/heads/broken...ref &&
 	printf "ref: refs/heads/broken...ref\n" >.git/refs/tags/shadow &&
 	test_when_finished "rm -f .git/refs/tags/shadow" &&
 	git rev-parse --verify one >expect &&
@@ -159,11 +159,11 @@ test_expect_success 'rev-parse skips symref pointing to broken name' '
 '
 
 test_expect_success 'for-each-ref emits warnings for broken names' '
-	cp .git/refs/heads/master .git/refs/heads/broken...ref &&
+	cp .git/refs/heads/main .git/refs/heads/broken...ref &&
 	test_when_finished "rm -f .git/refs/heads/broken...ref" &&
 	printf "ref: refs/heads/broken...ref\n" >.git/refs/heads/badname &&
 	test_when_finished "rm -f .git/refs/heads/badname" &&
-	printf "ref: refs/heads/master\n" >.git/refs/heads/broken...symref &&
+	printf "ref: refs/heads/main\n" >.git/refs/heads/broken...symref &&
 	test_when_finished "rm -f .git/refs/heads/broken...symref" &&
 	git for-each-ref >output 2>error &&
 	! grep -e "broken\.\.\.ref" output &&
@@ -175,7 +175,7 @@ test_expect_success 'for-each-ref emits warnings for broken names' '
 '
 
 test_expect_success 'update-ref -d can delete broken name' '
-	cp .git/refs/heads/master .git/refs/heads/broken...ref &&
+	cp .git/refs/heads/main .git/refs/heads/broken...ref &&
 	test_when_finished "rm -f .git/refs/heads/broken...ref" &&
 	git update-ref -d refs/heads/broken...ref >output 2>error &&
 	test_must_be_empty output &&
@@ -186,7 +186,7 @@ test_expect_success 'update-ref -d can delete broken name' '
 '
 
 test_expect_success 'branch -d can delete broken name' '
-	cp .git/refs/heads/master .git/refs/heads/broken...ref &&
+	cp .git/refs/heads/main .git/refs/heads/broken...ref &&
 	test_when_finished "rm -f .git/refs/heads/broken...ref" &&
 	git branch -d broken...ref >output 2>error &&
 	test_i18ngrep "Deleted branch broken...ref (was broken)" output &&
@@ -197,7 +197,7 @@ test_expect_success 'branch -d can delete broken name' '
 '
 
 test_expect_success 'update-ref --no-deref -d can delete symref to broken name' '
-	cp .git/refs/heads/master .git/refs/heads/broken...ref &&
+	cp .git/refs/heads/main .git/refs/heads/broken...ref &&
 	test_when_finished "rm -f .git/refs/heads/broken...ref" &&
 	printf "ref: refs/heads/broken...ref\n" >.git/refs/heads/badname &&
 	test_when_finished "rm -f .git/refs/heads/badname" &&
@@ -208,7 +208,7 @@ test_expect_success 'update-ref --no-deref -d can delete symref to broken name'
 '
 
 test_expect_success 'branch -d can delete symref to broken name' '
-	cp .git/refs/heads/master .git/refs/heads/broken...ref &&
+	cp .git/refs/heads/main .git/refs/heads/broken...ref &&
 	test_when_finished "rm -f .git/refs/heads/broken...ref" &&
 	printf "ref: refs/heads/broken...ref\n" >.git/refs/heads/badname &&
 	test_when_finished "rm -f .git/refs/heads/badname" &&
@@ -237,7 +237,7 @@ test_expect_success 'branch -d can delete dangling symref to broken name' '
 '
 
 test_expect_success 'update-ref -d can delete broken name through symref' '
-	cp .git/refs/heads/master .git/refs/heads/broken...ref &&
+	cp .git/refs/heads/main .git/refs/heads/broken...ref &&
 	test_when_finished "rm -f .git/refs/heads/broken...ref" &&
 	printf "ref: refs/heads/broken...ref\n" >.git/refs/heads/badname &&
 	test_when_finished "rm -f .git/refs/heads/badname" &&
@@ -248,7 +248,7 @@ test_expect_success 'update-ref -d can delete broken name through symref' '
 '
 
 test_expect_success 'update-ref --no-deref -d can delete symref with broken name' '
-	printf "ref: refs/heads/master\n" >.git/refs/heads/broken...symref &&
+	printf "ref: refs/heads/main\n" >.git/refs/heads/broken...symref &&
 	test_when_finished "rm -f .git/refs/heads/broken...symref" &&
 	git update-ref --no-deref -d refs/heads/broken...symref >output 2>error &&
 	test_path_is_missing .git/refs/heads/broken...symref &&
@@ -257,11 +257,11 @@ test_expect_success 'update-ref --no-deref -d can delete symref with broken name
 '
 
 test_expect_success 'branch -d can delete symref with broken name' '
-	printf "ref: refs/heads/master\n" >.git/refs/heads/broken...symref &&
+	printf "ref: refs/heads/main\n" >.git/refs/heads/broken...symref &&
 	test_when_finished "rm -f .git/refs/heads/broken...symref" &&
 	git branch -d broken...symref >output 2>error &&
 	test_path_is_missing .git/refs/heads/broken...symref &&
-	test_i18ngrep "Deleted branch broken...symref (was refs/heads/master)" output &&
+	test_i18ngrep "Deleted branch broken...symref (was refs/heads/main)" output &&
 	test_must_be_empty error
 '
 
@@ -299,37 +299,37 @@ test_expect_success 'update-ref -d cannot delete absolute path' '
 '
 
 test_expect_success 'update-ref --stdin fails create with bad ref name' '
-	echo "create ~a refs/heads/master" >stdin &&
+	echo "create ~a refs/heads/main" >stdin &&
 	test_must_fail git update-ref --stdin <stdin 2>err &&
 	grep "fatal: invalid ref format: ~a" err
 '
 
 test_expect_success 'update-ref --stdin fails update with bad ref name' '
-	echo "update ~a refs/heads/master" >stdin &&
+	echo "update ~a refs/heads/main" >stdin &&
 	test_must_fail git update-ref --stdin <stdin 2>err &&
 	grep "fatal: invalid ref format: ~a" err
 '
 
 test_expect_success 'update-ref --stdin fails delete with bad ref name' '
-	echo "delete ~a refs/heads/master" >stdin &&
+	echo "delete ~a refs/heads/main" >stdin &&
 	test_must_fail git update-ref --stdin <stdin 2>err &&
 	grep "fatal: invalid ref format: ~a" err
 '
 
 test_expect_success 'update-ref --stdin -z fails create with bad ref name' '
-	printf "%s\0" "create ~a " refs/heads/master >stdin &&
+	printf "%s\0" "create ~a " refs/heads/main >stdin &&
 	test_must_fail git update-ref -z --stdin <stdin 2>err &&
 	grep "fatal: invalid ref format: ~a " err
 '
 
 test_expect_success 'update-ref --stdin -z fails update with bad ref name' '
-	printf "%s\0" "update ~a" refs/heads/master "" >stdin &&
+	printf "%s\0" "update ~a" refs/heads/main "" >stdin &&
 	test_must_fail git update-ref -z --stdin <stdin 2>err &&
 	grep "fatal: invalid ref format: ~a" err
 '
 
 test_expect_success 'update-ref --stdin -z fails delete with bad ref name' '
-	printf "%s\0" "delete ~a" refs/heads/master >stdin &&
+	printf "%s\0" "delete ~a" refs/heads/main >stdin &&
 	test_must_fail git update-ref -z --stdin <stdin 2>err &&
 	grep "fatal: invalid ref format: ~a" err
 '
diff --git a/t/t1450-fsck.sh b/t/t1450-fsck.sh
index b17f5c21fb..a30fc5f74a 100755
--- a/t/t1450-fsck.sh
+++ b/t/t1450-fsck.sh
@@ -3,7 +3,7 @@
 test_description='git fsck random collection of tests
 
 * (HEAD) B
-* (master) A
+* (main) A
 '
 
 . ./test-lib.sh
diff --git a/t/t1500-rev-parse.sh b/t/t1500-rev-parse.sh
index d23da4e8de..9e911e0054 100755
--- a/t/t1500-rev-parse.sh
+++ b/t/t1500-rev-parse.sh
@@ -1,7 +1,7 @@
 #!/bin/sh
 
 test_description='test git rev-parse'
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -177,8 +177,8 @@ test_expect_success 'showing the superproject correctly' '
 	test_commit -C super/dir/sub branch1_commit &&
 	git -C super add dir/sub &&
 	test_commit -C super branch1_commit &&
-	git -C super checkout -b branch2 master &&
-	git -C super/dir/sub checkout -b branch2 master &&
+	git -C super checkout -b branch2 main &&
+	git -C super/dir/sub checkout -b branch2 main &&
 	test_commit -C super/dir/sub branch2_commit &&
 	git -C super add dir/sub &&
 	test_commit -C super branch2_commit &&
diff --git a/t/t1503-rev-parse-verify.sh b/t/t1503-rev-parse-verify.sh
index e4343c49b2..a3d6877588 100755
--- a/t/t1503-rev-parse-verify.sh
+++ b/t/t1503-rev-parse-verify.sh
@@ -6,7 +6,7 @@ test_description='test git rev-parse --verify'
 
 exec </dev/null
 
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -54,8 +54,8 @@ test_expect_success 'works with one good rev' '
 	test "$rev_hash3" = "$HASH3" &&
 	rev_hash4=$(git rev-parse --verify $HASH4) &&
 	test "$rev_hash4" = "$HASH4" &&
-	rev_master=$(git rev-parse --verify master) &&
-	test "$rev_master" = "$HASH4" &&
+	rev_main=$(git rev-parse --verify main) &&
+	test "$rev_main" = "$HASH4" &&
 	rev_head=$(git rev-parse --verify HEAD) &&
 	test "$rev_head" = "$HASH4"
 '
@@ -119,27 +119,27 @@ test_expect_success 'no stdout output on error' '
 '
 
 test_expect_success 'use --default' '
-	git rev-parse --verify --default master &&
-	git rev-parse --verify --default master HEAD &&
-	git rev-parse --default master --verify &&
-	git rev-parse --default master --verify HEAD &&
-	git rev-parse --verify HEAD --default master &&
-	test_must_fail git rev-parse --verify foo --default master &&
+	git rev-parse --verify --default main &&
+	git rev-parse --verify --default main HEAD &&
+	git rev-parse --default main --verify &&
+	git rev-parse --default main --verify HEAD &&
+	git rev-parse --verify HEAD --default main &&
+	test_must_fail git rev-parse --verify foo --default main &&
 	test_must_fail git rev-parse --default HEAD --verify bar &&
 	test_must_fail git rev-parse --verify --default HEAD baz &&
 	test_must_fail git rev-parse --default foo --verify &&
 	test_must_fail git rev-parse --verify --default bar
 '
 
-test_expect_success 'master@{n} for various n' '
+test_expect_success 'main@{n} for various n' '
 	N=$(git reflog | wc -l) &&
 	Nm1=$(($N-1)) &&
 	Np1=$(($N+1)) &&
-	git rev-parse --verify master@{0} &&
-	git rev-parse --verify master@{1} &&
-	git rev-parse --verify master@{$Nm1} &&
-	test_must_fail git rev-parse --verify master@{$N} &&
-	test_must_fail git rev-parse --verify master@{$Np1}
+	git rev-parse --verify main@{0} &&
+	git rev-parse --verify main@{1} &&
+	git rev-parse --verify main@{$Nm1} &&
+	test_must_fail git rev-parse --verify main@{$N} &&
+	test_must_fail git rev-parse --verify main@{$Np1}
 '
 
 test_expect_success SYMLINKS 'ref resolution not confused by broken symlinks' '
diff --git a/t/t1505-rev-parse-last.sh b/t/t1505-rev-parse-last.sh
index 9bd0307b5d..2803ca9489 100755
--- a/t/t1505-rev-parse-last.sh
+++ b/t/t1505-rev-parse-last.sh
@@ -2,7 +2,7 @@
 
 test_description='test @{-N} syntax'
 
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -23,12 +23,12 @@ test_expect_success 'setup' '
 	make_commit 3 &&
 	git checkout side &&
 	make_commit 4 &&
-	git merge master &&
-	git checkout master
+	git merge main &&
+	git checkout main
 
 '
 
-# 1 -- 2 -- 3 master
+# 1 -- 2 -- 3 main
 #  \         \
 #   \         \
 #    --- 4 --- 5 side
@@ -52,7 +52,7 @@ test_expect_success '@{-1}@{1} works' '
 '
 
 test_expect_success '@{-2} works' '
-	test_cmp_rev master @{-2}
+	test_cmp_rev main @{-2}
 '
 
 test_expect_success '@{-3} fails' '
diff --git a/t/t1506-rev-parse-diagnosis.sh b/t/t1506-rev-parse-diagnosis.sh
index 694d74fc01..f6e6f23f7e 100755
--- a/t/t1506-rev-parse-diagnosis.sh
+++ b/t/t1506-rev-parse-diagnosis.sh
@@ -4,7 +4,7 @@ test_description='test git rev-parse diagnosis for invalid argument'
 
 exec </dev/null
 
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -140,10 +140,10 @@ test_expect_success 'incorrect file in :path and :N:path' '
 '
 
 test_expect_success 'invalid @{n} reference' '
-	test_must_fail git rev-parse master@{99999} >output 2>error &&
+	test_must_fail git rev-parse main@{99999} >output 2>error &&
 	test_must_be_empty output &&
 	test_i18ngrep "log for [^ ]* only has [0-9][0-9]* entries" error  &&
-	test_must_fail git rev-parse --verify master@{99999} >output 2>error &&
+	test_must_fail git rev-parse --verify main@{99999} >output 2>error &&
 	test_must_be_empty output &&
 	test_i18ngrep "log for [^ ]* only has [0-9][0-9]* entries" error
 '
diff --git a/t/t1507-rev-parse-upstream.sh b/t/t1507-rev-parse-upstream.sh
index 521233a3c3..73b4f34c6e 100755
--- a/t/t1507-rev-parse-upstream.sh
+++ b/t/t1507-rev-parse-upstream.sh
@@ -2,7 +2,7 @@
 
 test_description='test <branch>@{upstream} syntax'
 
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -13,20 +13,20 @@ test_expect_success 'setup' '
 	test_commit 1 &&
 	git checkout -b side &&
 	test_commit 2 &&
-	git checkout master &&
+	git checkout main &&
 	git clone . clone &&
 	test_commit 3 &&
 	(cd clone &&
 	 test_commit 4 &&
 	 git branch --track my-side origin/side &&
-	 git branch --track local-master master &&
+	 git branch --track local-main main &&
 	 git branch --track fun@ny origin/side &&
 	 git branch --track @funny origin/side &&
 	 git branch --track funny@ origin/side &&
-	 git remote add -t master master-only .. &&
-	 git fetch master-only &&
+	 git remote add -t main main-only .. &&
+	 git fetch main-only &&
 	 git branch bad-upstream &&
-	 git config branch.bad-upstream.remote master-only &&
+	 git config branch.bad-upstream.remote main-only &&
 	 git config branch.bad-upstream.merge refs/heads/side
 	)
 '
@@ -42,7 +42,7 @@ error_message () {
 }
 
 test_expect_success '@{upstream} resolves to correct full name' '
-	echo refs/remotes/origin/master >expect &&
+	echo refs/remotes/origin/main >expect &&
 	git -C clone rev-parse --symbolic-full-name @{upstream} >actual &&
 	test_cmp expect actual &&
 	git -C clone rev-parse --symbolic-full-name @{UPSTREAM} >actual &&
@@ -52,7 +52,7 @@ test_expect_success '@{upstream} resolves to correct full name' '
 '
 
 test_expect_success '@{u} resolves to correct full name' '
-	echo refs/remotes/origin/master >expect &&
+	echo refs/remotes/origin/main >expect &&
 	git -C clone rev-parse --symbolic-full-name @{u} >actual &&
 	test_cmp expect actual &&
 	git -C clone rev-parse --symbolic-full-name @{U} >actual &&
@@ -135,7 +135,7 @@ test_expect_success 'checkout -b new my-side@{u} forks from the same' '
 test_expect_success 'merge my-side@{u} records the correct name' '
 (
 	cd clone &&
-	git checkout master &&
+	git checkout main &&
 	test_might_fail git branch -D new &&
 	git branch -t new my-side@{u} &&
 	git merge -s ours new@{u} &&
@@ -146,24 +146,24 @@ test_expect_success 'merge my-side@{u} records the correct name' '
 '
 
 test_expect_success 'branch -d other@{u}' '
-	git checkout -t -b other master &&
+	git checkout -t -b other main &&
 	git branch -d @{u} &&
-	git for-each-ref refs/heads/master >actual &&
+	git for-each-ref refs/heads/main >actual &&
 	test_must_be_empty actual
 '
 
 test_expect_success 'checkout other@{u}' '
-	git branch -f master HEAD &&
-	git checkout -t -b another master &&
+	git branch -f main HEAD &&
+	git checkout -t -b another main &&
 	git checkout @{u} &&
 	git symbolic-ref HEAD >actual &&
-	echo refs/heads/master >expect &&
+	echo refs/heads/main >expect &&
 	test_cmp expect actual
 '
 
 test_expect_success 'branch@{u} works when tracking a local branch' '
-	echo refs/heads/master >expect &&
-	git -C clone rev-parse --symbolic-full-name local-master@{u} >actual &&
+	echo refs/heads/main >expect &&
+	git -C clone rev-parse --symbolic-full-name local-main@{u} >actual &&
 	test_cmp expect actual
 '
 
@@ -177,7 +177,7 @@ test_expect_success 'branch@{u} error message when no upstream' '
 
 test_expect_success '@{u} error message when no upstream' '
 	cat >expect <<-EOF &&
-	fatal: no upstream configured for branch ${SQ}master${SQ}
+	fatal: no upstream configured for branch ${SQ}main${SQ}
 	EOF
 	test_must_fail git rev-parse --verify @{u} 2>actual &&
 	test_i18ncmp expect actual
@@ -211,14 +211,14 @@ test_expect_success 'branch@{u} error message if upstream branch not fetched' '
 test_expect_success 'pull works when tracking a local branch' '
 (
 	cd clone &&
-	git checkout local-master &&
+	git checkout local-main &&
 	git pull
 )
 '
 
 # makes sense if the previous one succeeded
 test_expect_success '@{u} works when tracking a local branch' '
-	echo refs/heads/master >expect &&
+	echo refs/heads/main >expect &&
 	git -C clone rev-parse --symbolic-full-name @{u} >actual &&
 	test_cmp expect actual
 '
@@ -227,7 +227,7 @@ test_expect_success 'log -g other@{u}' '
 	commit=$(git rev-parse HEAD) &&
 	cat >expect <<-EOF &&
 	commit $commit
-	Reflog: master@{0} (C O Mitter <committer@example.com>)
+	Reflog: main@{0} (C O Mitter <committer@example.com>)
 	Reflog message: branch: Created from HEAD
 	Author: A U Thor <author@example.com>
 	Date:   Thu Apr 7 15:15:13 2005 -0700
@@ -242,7 +242,7 @@ test_expect_success 'log -g other@{u}@{now}' '
 	commit=$(git rev-parse HEAD) &&
 	cat >expect <<-EOF &&
 	commit $commit
-	Reflog: master@{Thu Apr 7 15:17:13 2005 -0700} (C O Mitter <committer@example.com>)
+	Reflog: main@{Thu Apr 7 15:17:13 2005 -0700} (C O Mitter <committer@example.com>)
 	Reflog message: branch: Created from HEAD
 	Author: A U Thor <author@example.com>
 	Date:   Thu Apr 7 15:15:13 2005 -0700
diff --git a/t/t1508-at-combinations.sh b/t/t1508-at-combinations.sh
index 8e73633761..17421a368d 100755
--- a/t/t1508-at-combinations.sh
+++ b/t/t1508-at-combinations.sh
@@ -1,7 +1,7 @@
 #!/bin/sh
 
 test_description='test various @{X} syntax combinations together'
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -33,8 +33,8 @@ fail() {
 }
 
 test_expect_success 'setup' '
-	test_commit master-one &&
-	test_commit master-two &&
+	test_commit main-one &&
+	test_commit main-two &&
 	git checkout -b upstream-branch &&
 	test_commit upstream-one &&
 	test_commit upstream-two &&
@@ -50,7 +50,7 @@ test_expect_success 'setup' '
 	git checkout -b new-branch &&
 	test_commit new-one &&
 	test_commit new-two &&
-	git branch -u master old-branch &&
+	git branch -u main old-branch &&
 	git branch -u upstream-branch new-branch
 '
 
@@ -65,8 +65,8 @@ check "@{-1}@{1}" commit old-one
 check "@{u}" ref refs/heads/upstream-branch
 check "HEAD@{u}" ref refs/heads/upstream-branch
 check "@{u}@{1}" commit upstream-one
-check "@{-1}@{u}" ref refs/heads/master
-check "@{-1}@{u}@{1}" commit master-one
+check "@{-1}@{u}" ref refs/heads/main
+check "@{-1}@{u}@{1}" commit main-one
 check "@" commit new-two
 check "@@{u}" ref refs/heads/upstream-branch
 check "@@/at-test" ref refs/heads/@@/at-test
diff --git a/t/t1511-rev-parse-caret.sh b/t/t1511-rev-parse-caret.sh
index cfb2ea5e04..6ecfed86bc 100755
--- a/t/t1511-rev-parse-caret.sh
+++ b/t/t1511-rev-parse-caret.sh
@@ -2,7 +2,7 @@
 
 test_description='tests for ref^{stuff}'
 
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -18,7 +18,7 @@ test_expect_success 'setup' '
 	git commit -m Initial &&
 	git tag -a -m commit commit-tag &&
 	git branch ref &&
-	git checkout master &&
+	git checkout main &&
 	echo modified >>a-blob &&
 	git add -u &&
 	git commit -m Modified &&
@@ -76,52 +76,52 @@ test_expect_success 'ref^{tag}' '
 '
 
 test_expect_success 'ref^{/.}' '
-	git rev-parse master >expected &&
-	git rev-parse master^{/.} >actual &&
+	git rev-parse main >expected &&
+	git rev-parse main^{/.} >actual &&
 	test_cmp expected actual
 '
 
 test_expect_success 'ref^{/non-existent}' '
-	test_must_fail git rev-parse master^{/non-existent}
+	test_must_fail git rev-parse main^{/non-existent}
 '
 
 test_expect_success 'ref^{/Initial}' '
 	git rev-parse ref >expected &&
-	git rev-parse master^{/Initial} >actual &&
+	git rev-parse main^{/Initial} >actual &&
 	test_cmp expected actual
 '
 
 test_expect_success 'ref^{/!Exp}' '
-	test_must_fail git rev-parse master^{/!Exp}
+	test_must_fail git rev-parse main^{/!Exp}
 '
 
 test_expect_success 'ref^{/!}' '
-	test_must_fail git rev-parse master^{/!}
+	test_must_fail git rev-parse main^{/!}
 '
 
 test_expect_success 'ref^{/!!Exp}' '
 	git rev-parse expref >expected &&
-	git rev-parse master^{/!!Exp} >actual &&
+	git rev-parse main^{/!!Exp} >actual &&
 	test_cmp expected actual
 '
 
 test_expect_success 'ref^{/!-}' '
-	test_must_fail git rev-parse master^{/!-}
+	test_must_fail git rev-parse main^{/!-}
 '
 
 test_expect_success 'ref^{/!-.}' '
-	test_must_fail git rev-parse master^{/!-.}
+	test_must_fail git rev-parse main^{/!-.}
 '
 
 test_expect_success 'ref^{/!-non-existent}' '
-	git rev-parse master >expected &&
-	git rev-parse master^{/!-non-existent} >actual &&
+	git rev-parse main >expected &&
+	git rev-parse main^{/!-non-existent} >actual &&
 	test_cmp expected actual
 '
 
 test_expect_success 'ref^{/!-Changed}' '
 	git rev-parse expref >expected &&
-	git rev-parse master^{/!-Changed} >actual &&
+	git rev-parse main^{/!-Changed} >actual &&
 	test_cmp expected actual
 '
 
diff --git a/t/t1512-rev-parse-disambiguation.sh b/t/t1512-rev-parse-disambiguation.sh
index 2ef1f2b7e8..b70c9dbce8 100755
--- a/t/t1512-rev-parse-disambiguation.sh
+++ b/t/t1512-rev-parse-disambiguation.sh
@@ -20,7 +20,7 @@ one tagged as v1.0.0.  They all have one regular file each.
 
 '
 
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -215,7 +215,7 @@ test_expect_success 'more history' '
 	side=$(git rev-parse HEAD) &&
 
 	# commit 000000000066
-	git checkout master &&
+	git checkout main &&
 
 	# If you use recursive, merge will fail and you will need to
 	# clean up a0blgqsjc as well.  If you use resolve, merge will
diff --git a/t/t1513-rev-parse-prefix.sh b/t/t1513-rev-parse-prefix.sh
index d151ef9218..5f437be8c9 100755
--- a/t/t1513-rev-parse-prefix.sh
+++ b/t/t1513-rev-parse-prefix.sh
@@ -2,7 +2,7 @@
 
 test_description='Tests for rev-parse --prefix'
 
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -79,9 +79,9 @@ test_expect_success 'disambiguate path with valid prefix' '
 '
 
 test_expect_success 'file and refs with prefix' '
-	git rev-parse --prefix sub1/ master file1 >actual &&
+	git rev-parse --prefix sub1/ main file1 >actual &&
 	cat <<-EOF >expected &&
-	$(git rev-parse master)
+	$(git rev-parse main)
 	sub1/file1
 	EOF
 	test_cmp expected actual
diff --git a/t/t1514-rev-parse-push.sh b/t/t1514-rev-parse-push.sh
index 173ba2792b..d868a08110 100755
--- a/t/t1514-rev-parse-push.sh
+++ b/t/t1514-rev-parse-push.sh
@@ -1,7 +1,7 @@
 #!/bin/sh
 
 test_description='test <branch>@{push} syntax'
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -19,24 +19,24 @@ test_expect_success 'setup' '
 	git remote add other other.git &&
 	test_commit base &&
 	git push origin HEAD &&
-	git branch --set-upstream-to=origin/master master &&
-	git branch --track topic origin/master &&
+	git branch --set-upstream-to=origin/main main &&
+	git branch --track topic origin/main &&
 	git push origin topic &&
 	git push other topic
 '
 
 test_expect_success '@{push} with default=nothing' '
 	test_config push.default nothing &&
-	test_must_fail git rev-parse master@{push} &&
-	test_must_fail git rev-parse master@{PUSH} &&
-	test_must_fail git rev-parse master@{PuSH}
+	test_must_fail git rev-parse main@{push} &&
+	test_must_fail git rev-parse main@{PUSH} &&
+	test_must_fail git rev-parse main@{PuSH}
 '
 
 test_expect_success '@{push} with default=simple' '
 	test_config push.default simple &&
-	resolve master@{push} refs/remotes/origin/master &&
-	resolve master@{PUSH} refs/remotes/origin/master &&
-	resolve master@{pUSh} refs/remotes/origin/master
+	resolve main@{push} refs/remotes/origin/main &&
+	resolve main@{PUSH} refs/remotes/origin/main &&
+	resolve main@{pUSh} refs/remotes/origin/main
 '
 
 test_expect_success 'triangular @{push} fails with default=simple' '
diff --git a/t/t1700-split-index.sh b/t/t1700-split-index.sh
index 7d4a6f1e93..986baa612e 100755
--- a/t/t1700-split-index.sh
+++ b/t/t1700-split-index.sh
@@ -2,7 +2,7 @@
 
 test_description='split index mode tests'
 
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -499,7 +499,7 @@ test_expect_success 'do not refresh null base index' '
 		test_commit initial &&
 		git checkout -b side-branch &&
 		test_commit extra &&
-		git checkout master &&
+		git checkout main &&
 		git update-index --split-index &&
 		test_commit more &&
 		# must not write a new shareindex, or we wont catch the problem
-- 
gitgitgadget


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH v3 04/28] t2*: adjust the references to the default branch name "main"
  2020-11-18 23:44   ` [PATCH v3 00/28] tests: use main as default branch name Johannes Schindelin via GitGitGadget
                       ` (2 preceding siblings ...)
  2020-11-18 23:44     ` [PATCH v3 03/28] t[01]*: adjust the references to the default branch name "main" Johannes Schindelin via GitGitGadget
@ 2020-11-18 23:44     ` Johannes Schindelin via GitGitGadget
  2020-11-18 23:44     ` [PATCH v3 05/28] t3[0-3]*: " Johannes Schindelin via GitGitGadget
                       ` (24 subsequent siblings)
  28 siblings, 0 replies; 163+ messages in thread
From: Johannes Schindelin via GitGitGadget @ 2020-11-18 23:44 UTC (permalink / raw)
  To: git
  Cc: Felipe Contreras, Ævar Arnfjörð Bjarmason,
	Johannes Schindelin, Jeff King, Jonathan Nieder,
	Johannes Schindelin, Johannes Schindelin

From: Johannes Schindelin <johannes.schindelin@gmx.de>

Carefully excluding t2106, which sees independent development elsewhere
at the time of writing, we transition above-mentioned tests 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' -- t2*.sh &&
	   git checkout HEAD -- t2106\*)

This allows us to define `GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main`
for those tests.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
---
 t/t2007-checkout-symlink.sh      | 12 +++---
 t/t2009-checkout-statinfo.sh     | 10 ++---
 t/t2010-checkout-ambiguous.sh    |  6 +--
 t/t2011-checkout-invalid-head.sh | 18 ++++----
 t/t2012-checkout-last.sh         | 50 +++++++++++------------
 t/t2015-checkout-unborn.sh       |  4 +-
 t/t2017-checkout-orphan.sh       | 46 ++++++++++-----------
 t/t2020-checkout-detach.sh       | 30 +++++++-------
 t/t2022-checkout-paths.sh        | 24 +++++------
 t/t2023-checkout-m.sh            | 12 +++---
 t/t2024-checkout-dwim.sh         | 70 ++++++++++++++++----------------
 t/t2027-checkout-track.sh        |  8 ++--
 t/t2030-unresolve-info.sh        |  8 ++--
 t/t2060-switch.sh                | 32 +++++++--------
 t/t2070-restore.sh               |  6 +--
 t/t2400-worktree-add.sh          | 68 +++++++++++++++----------------
 t/t2401-worktree-prune.sh        |  4 +-
 t/t2402-worktree-list.sh         | 22 +++++-----
 t/t2405-worktree-submodule.sh    |  8 ++--
 19 files changed, 219 insertions(+), 219 deletions(-)

diff --git a/t/t2007-checkout-symlink.sh b/t/t2007-checkout-symlink.sh
index 8879a78b85..6f0b90ce12 100755
--- a/t/t2007-checkout-symlink.sh
+++ b/t/t2007-checkout-symlink.sh
@@ -4,7 +4,7 @@
 
 test_description='git checkout to switch between branches with symlink<->dir'
 
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -15,14 +15,14 @@ test_expect_success setup '
 	echo hello >frotz/filfre &&
 	git add frotz/filfre &&
 	test_tick &&
-	git commit -m "master has file frotz/filfre" &&
+	git commit -m "main has file frotz/filfre" &&
 
 	git branch side &&
 
 	echo goodbye >nitfol &&
 	git add nitfol &&
 	test_tick &&
-	git commit -m "master adds file nitfol" &&
+	git commit -m "main adds file nitfol" &&
 
 	git checkout side &&
 
@@ -37,13 +37,13 @@ test_expect_success setup '
 
 test_expect_success 'switch from symlink to dir' '
 
-	git checkout master
+	git checkout main
 
 '
 
-test_expect_success 'Remove temporary directories & switch to master' '
+test_expect_success 'Remove temporary directories & switch to main' '
 	rm -fr frotz xyzzy nitfol &&
-	git checkout -f master
+	git checkout -f main
 '
 
 test_expect_success 'switch from dir to symlink' '
diff --git a/t/t2009-checkout-statinfo.sh b/t/t2009-checkout-statinfo.sh
index 9af4d6ca5e..b0540636ae 100755
--- a/t/t2009-checkout-statinfo.sh
+++ b/t/t2009-checkout-statinfo.sh
@@ -2,7 +2,7 @@
 
 test_description='checkout should leave clean stat info'
 
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -24,13 +24,13 @@ test_expect_success 'branch switching' '
 	git reset --hard &&
 	test "$(git diff-files --raw)" = "" &&
 
-	git checkout master &&
+	git checkout main &&
 	test "$(git diff-files --raw)" = "" &&
 
 	git checkout side &&
 	test "$(git diff-files --raw)" = "" &&
 
-	git checkout master &&
+	git checkout main &&
 	test "$(git diff-files --raw)" = ""
 
 '
@@ -40,13 +40,13 @@ test_expect_success 'path checkout' '
 	git reset --hard &&
 	test "$(git diff-files --raw)" = "" &&
 
-	git checkout master world &&
+	git checkout main world &&
 	test "$(git diff-files --raw)" = "" &&
 
 	git checkout side world &&
 	test "$(git diff-files --raw)" = "" &&
 
-	git checkout master world &&
+	git checkout main world &&
 	test "$(git diff-files --raw)" = ""
 
 '
diff --git a/t/t2010-checkout-ambiguous.sh b/t/t2010-checkout-ambiguous.sh
index 3f5431e033..6e8757387d 100755
--- a/t/t2010-checkout-ambiguous.sh
+++ b/t/t2010-checkout-ambiguous.sh
@@ -2,7 +2,7 @@
 
 test_description='checkout and pathspecs/refspecs ambiguities'
 
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -20,7 +20,7 @@ test_expect_success 'reference must be a tree' '
 '
 
 test_expect_success 'branch switching' '
-	test "refs/heads/master" = "$(git symbolic-ref HEAD)" &&
+	test "refs/heads/main" = "$(git symbolic-ref HEAD)" &&
 	git checkout world -- &&
 	test "refs/heads/world" = "$(git symbolic-ref HEAD)"
 '
@@ -60,7 +60,7 @@ test_expect_success 'disambiguate checking out from a tree-ish' '
 '
 
 test_expect_success 'accurate error message with more than one ref' '
-	test_must_fail git checkout HEAD master -- 2>actual &&
+	test_must_fail git checkout HEAD main -- 2>actual &&
 	test_i18ngrep 2 actual &&
 	test_i18ngrep "one reference expected, 2 given" actual
 '
diff --git a/t/t2011-checkout-invalid-head.sh b/t/t2011-checkout-invalid-head.sh
index fede33ff1f..e52022e152 100755
--- a/t/t2011-checkout-invalid-head.sh
+++ b/t/t2011-checkout-invalid-head.sh
@@ -2,7 +2,7 @@
 
 test_description='checkout switching away from an invalid branch'
 
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -14,12 +14,12 @@ test_expect_success 'setup' '
 '
 
 test_expect_success 'checkout should not start branch from a tree' '
-	test_must_fail git checkout -b newbranch master^{tree}
+	test_must_fail git checkout -b newbranch main^{tree}
 '
 
-test_expect_success 'checkout master from invalid HEAD' '
+test_expect_success 'checkout main from invalid HEAD' '
 	echo $ZERO_OID >.git/HEAD &&
-	git checkout master --
+	git checkout main --
 '
 
 test_expect_success 'checkout notices failure to lock HEAD' '
@@ -29,7 +29,7 @@ test_expect_success 'checkout notices failure to lock HEAD' '
 '
 
 test_expect_success 'create ref directory/file conflict scenario' '
-	git update-ref refs/heads/outer/inner master &&
+	git update-ref refs/heads/outer/inner main &&
 
 	# do not rely on symbolic-ref to get a known state,
 	# as it may use the same code we are testing
@@ -40,12 +40,12 @@ test_expect_success 'create ref directory/file conflict scenario' '
 
 test_expect_success 'checkout away from d/f HEAD (unpacked, to branch)' '
 	reset_to_df &&
-	git checkout master
+	git checkout main
 '
 
 test_expect_success 'checkout away from d/f HEAD (unpacked, to detached)' '
 	reset_to_df &&
-	git checkout --detach master
+	git checkout --detach main
 '
 
 test_expect_success 'pack refs' '
@@ -54,11 +54,11 @@ test_expect_success 'pack refs' '
 
 test_expect_success 'checkout away from d/f HEAD (packed, to branch)' '
 	reset_to_df &&
-	git checkout master
+	git checkout main
 '
 
 test_expect_success 'checkout away from d/f HEAD (packed, to detached)' '
 	reset_to_df &&
-	git checkout --detach master
+	git checkout --detach main
 '
 test_done
diff --git a/t/t2012-checkout-last.sh b/t/t2012-checkout-last.sh
index 16bf19f7ee..028a00d6ba 100755
--- a/t/t2012-checkout-last.sh
+++ b/t/t2012-checkout-last.sh
@@ -2,7 +2,7 @@
 
 test_description='checkout can switch to last branch and merge base'
 
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -27,7 +27,7 @@ test_expect_success 'first branch switch' '
 
 test_expect_success '"checkout -" switches back' '
 	git checkout - &&
-	test "z$(git symbolic-ref HEAD)" = "zrefs/heads/master"
+	test "z$(git symbolic-ref HEAD)" = "zrefs/heads/main"
 '
 
 test_expect_success '"checkout -" switches forth' '
@@ -101,56 +101,56 @@ test_expect_success 'merge base test setup' '
 	git commit -m third
 '
 
-test_expect_success 'another...master' '
+test_expect_success 'another...main' '
 	git checkout another &&
-	git checkout another...master &&
-	test "z$(git rev-parse --verify HEAD)" = "z$(git rev-parse --verify master^)"
+	git checkout another...main &&
+	test "z$(git rev-parse --verify HEAD)" = "z$(git rev-parse --verify main^)"
 '
 
-test_expect_success '...master' '
+test_expect_success '...main' '
 	git checkout another &&
-	git checkout ...master &&
-	test "z$(git rev-parse --verify HEAD)" = "z$(git rev-parse --verify master^)"
+	git checkout ...main &&
+	test "z$(git rev-parse --verify HEAD)" = "z$(git rev-parse --verify main^)"
 '
 
-test_expect_success 'master...' '
+test_expect_success 'main...' '
 	git checkout another &&
-	git checkout master... &&
-	test "z$(git rev-parse --verify HEAD)" = "z$(git rev-parse --verify master^)"
+	git checkout main... &&
+	test "z$(git rev-parse --verify HEAD)" = "z$(git rev-parse --verify main^)"
 '
 
 test_expect_success '"checkout -" works after a rebase A' '
-	git checkout master &&
+	git checkout main &&
 	git checkout other &&
-	git rebase master &&
+	git rebase main &&
 	git checkout - &&
-	test "z$(git symbolic-ref HEAD)" = "zrefs/heads/master"
+	test "z$(git symbolic-ref HEAD)" = "zrefs/heads/main"
 '
 
 test_expect_success '"checkout -" works after a rebase A B' '
-	git branch moodle master~1 &&
-	git checkout master &&
+	git branch moodle main~1 &&
+	git checkout main &&
 	git checkout other &&
-	git rebase master moodle &&
+	git rebase main moodle &&
 	git checkout - &&
-	test "z$(git symbolic-ref HEAD)" = "zrefs/heads/master"
+	test "z$(git symbolic-ref HEAD)" = "zrefs/heads/main"
 '
 
 test_expect_success '"checkout -" works after a rebase -i A' '
-	git checkout master &&
+	git checkout main &&
 	git checkout other &&
-	git rebase -i master &&
+	git rebase -i main &&
 	git checkout - &&
-	test "z$(git symbolic-ref HEAD)" = "zrefs/heads/master"
+	test "z$(git symbolic-ref HEAD)" = "zrefs/heads/main"
 '
 
 test_expect_success '"checkout -" works after a rebase -i A B' '
-	git branch foodle master~1 &&
-	git checkout master &&
+	git branch foodle main~1 &&
+	git checkout main &&
 	git checkout other &&
-	git rebase master foodle &&
+	git rebase main foodle &&
 	git checkout - &&
-	test "z$(git symbolic-ref HEAD)" = "zrefs/heads/master"
+	test "z$(git symbolic-ref HEAD)" = "zrefs/heads/main"
 '
 
 test_done
diff --git a/t/t2015-checkout-unborn.sh b/t/t2015-checkout-unborn.sh
index 669a70c76f..a9721215fa 100755
--- a/t/t2015-checkout-unborn.sh
+++ b/t/t2015-checkout-unborn.sh
@@ -1,7 +1,7 @@
 #!/bin/sh
 
 test_description='checkout from unborn branch'
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -14,7 +14,7 @@ test_expect_success 'setup' '
 	 git add file &&
 	 git commit -m base
 	) &&
-	git fetch parent master:origin
+	git fetch parent main:origin
 '
 
 test_expect_success 'checkout from unborn preserves untracked files' '
diff --git a/t/t2017-checkout-orphan.sh b/t/t2017-checkout-orphan.sh
index 999e976c62..c7adbdd39a 100755
--- a/t/t2017-checkout-orphan.sh
+++ b/t/t2017-checkout-orphan.sh
@@ -7,7 +7,7 @@ test_description='git checkout --orphan
 
 Main Tests for --orphan functionality.'
 
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -32,34 +32,34 @@ test_expect_success '--orphan creates a new orphan branch from HEAD' '
 	test_tick &&
 	git commit -m "Third Commit" &&
 	test_must_fail git rev-parse --verify HEAD^ &&
-	git diff-tree --quiet master alpha
+	git diff-tree --quiet main alpha
 '
 
 test_expect_success '--orphan creates a new orphan branch from <start_point>' '
-	git checkout master &&
-	git checkout --orphan beta master^ &&
+	git checkout main &&
+	git checkout --orphan beta main^ &&
 	test_must_fail git rev-parse --verify HEAD &&
 	test "refs/heads/beta" = "$(git symbolic-ref HEAD)" &&
 	test_tick &&
 	git commit -m "Fourth Commit" &&
 	test_must_fail git rev-parse --verify HEAD^ &&
-	git diff-tree --quiet master^ beta
+	git diff-tree --quiet main^ beta
 '
 
 test_expect_success '--orphan must be rejected with -b' '
-	git checkout master &&
+	git checkout main &&
 	test_must_fail git checkout --orphan new -b newer &&
-	test refs/heads/master = "$(git symbolic-ref HEAD)"
+	test refs/heads/main = "$(git symbolic-ref HEAD)"
 '
 
 test_expect_success '--orphan must be rejected with -t' '
-	git checkout master &&
-	test_must_fail git checkout --orphan new -t master &&
-	test refs/heads/master = "$(git symbolic-ref HEAD)"
+	git checkout main &&
+	test_must_fail git checkout --orphan new -t main &&
+	test refs/heads/main = "$(git symbolic-ref HEAD)"
 '
 
 test_expect_success '--orphan ignores branch.autosetupmerge' '
-	git checkout master &&
+	git checkout main &&
 	git config branch.autosetupmerge always &&
 	git checkout --orphan gamma &&
 	test -z "$(git config branch.gamma.merge)" &&
@@ -68,7 +68,7 @@ test_expect_success '--orphan ignores branch.autosetupmerge' '
 '
 
 test_expect_success '--orphan makes reflog by default' '
-	git checkout master &&
+	git checkout main &&
 	git config --unset core.logAllRefUpdates &&
 	git checkout --orphan delta &&
 	test_must_fail git rev-parse --verify delta@{0} &&
@@ -77,7 +77,7 @@ test_expect_success '--orphan makes reflog by default' '
 '
 
 test_expect_success '--orphan does not make reflog when core.logAllRefUpdates = false' '
-	git checkout master &&
+	git checkout main &&
 	git config core.logAllRefUpdates false &&
 	git checkout --orphan epsilon &&
 	test_must_fail git rev-parse --verify epsilon@{0} &&
@@ -86,7 +86,7 @@ test_expect_success '--orphan does not make reflog when core.logAllRefUpdates =
 '
 
 test_expect_success '--orphan with -l makes reflog when core.logAllRefUpdates = false' '
-	git checkout master &&
+	git checkout main &&
 	git checkout -l --orphan zeta &&
 	test_must_fail git rev-parse --verify zeta@{0} &&
 	git commit -m Zeta &&
@@ -94,33 +94,33 @@ test_expect_success '--orphan with -l makes reflog when core.logAllRefUpdates =
 '
 
 test_expect_success 'giving up --orphan not committed when -l and core.logAllRefUpdates = false deletes reflog' '
-	git checkout master &&
+	git checkout main &&
 	git checkout -l --orphan eta &&
 	test_must_fail git rev-parse --verify eta@{0} &&
-	git checkout master &&
+	git checkout main &&
 	test_must_fail git rev-parse --verify eta@{0}
 '
 
 test_expect_success '--orphan is rejected with an existing name' '
-	git checkout master &&
-	test_must_fail git checkout --orphan master &&
-	test refs/heads/master = "$(git symbolic-ref HEAD)"
+	git checkout main &&
+	test_must_fail git checkout --orphan main &&
+	test refs/heads/main = "$(git symbolic-ref HEAD)"
 '
 
 test_expect_success '--orphan refuses to switch if a merge is needed' '
-	git checkout master &&
+	git checkout main &&
 	git reset --hard &&
 	echo local >>"$TEST_FILE" &&
 	cat "$TEST_FILE" >"$TEST_FILE.saved" &&
-	test_must_fail git checkout --orphan new master^ &&
-	test refs/heads/master = "$(git symbolic-ref HEAD)" &&
+	test_must_fail git checkout --orphan new main^ &&
+	test refs/heads/main = "$(git symbolic-ref HEAD)" &&
 	test_cmp "$TEST_FILE" "$TEST_FILE.saved" &&
 	git diff-index --quiet --cached HEAD &&
 	git reset --hard
 '
 
 test_expect_success 'cannot --detach on an unborn branch' '
-	git checkout master &&
+	git checkout main &&
 	git checkout --orphan new &&
 	test_must_fail git checkout --detach
 '
diff --git a/t/t2020-checkout-detach.sh b/t/t2020-checkout-detach.sh
index 45d87c23b1..b432b6427b 100755
--- a/t/t2020-checkout-detach.sh
+++ b/t/t2020-checkout-detach.sh
@@ -1,7 +1,7 @@
 #!/bin/sh
 
 test_description='checkout into detached HEAD state'
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -25,7 +25,7 @@ check_no_orphan_warning() {
 }
 
 reset () {
-	git checkout master &&
+	git checkout main &&
 	check_not_detached
 }
 
@@ -88,7 +88,7 @@ test_expect_success 'checkout --detach errors out for non-commit' '
 
 test_expect_success 'checkout --detach errors out for extra argument' '
 	reset &&
-	git checkout master &&
+	git checkout main &&
 	test_must_fail git checkout --detach tag one.t &&
 	check_not_detached
 '
@@ -116,7 +116,7 @@ test_expect_success 'checkout warns on orphan commits' '
 	echo new content >orphan &&
 	git commit -a -m orphan2 &&
 	orphan2=$(git rev-parse HEAD) &&
-	git checkout master 2>stderr
+	git checkout main 2>stderr
 '
 
 test_expect_success 'checkout warns on orphan commits: output' '
@@ -135,7 +135,7 @@ test_expect_success 'checkout warns orphaning 1 of 2 commits: output' '
 test_expect_success 'checkout does not warn leaving ref tip' '
 	reset &&
 	git checkout --detach two &&
-	git checkout master 2>stderr
+	git checkout main 2>stderr
 '
 
 test_expect_success 'checkout does not warn leaving ref tip' '
@@ -145,7 +145,7 @@ test_expect_success 'checkout does not warn leaving ref tip' '
 test_expect_success 'checkout does not warn leaving reachable commit' '
 	reset &&
 	git checkout --detach HEAD^ &&
-	git checkout master 2>stderr
+	git checkout main 2>stderr
 '
 
 test_expect_success 'checkout does not warn leaving reachable commit' '
@@ -153,14 +153,14 @@ test_expect_success 'checkout does not warn leaving reachable commit' '
 '
 
 cat >expect <<'EOF'
-Your branch is behind 'master' by 1 commit, and can be fast-forwarded.
+Your branch is behind 'main' by 1 commit, and can be fast-forwarded.
   (use "git pull" to update your local branch)
 EOF
 test_expect_success 'tracking count is accurate after orphan check' '
 	reset &&
-	git branch child master^ &&
+	git branch child main^ &&
 	git config branch.child.remote . &&
-	git config branch.child.merge refs/heads/master &&
+	git config branch.child.merge refs/heads/main &&
 	git checkout child^ &&
 	git checkout child >stdout &&
 	test_i18ncmp expect stdout
@@ -192,9 +192,9 @@ test_expect_success 'no advice given for explicit detached head state' '
 # Detached HEAD tests for GIT_PRINT_SHA1_ELLIPSIS (new format)
 test_expect_success 'describe_detached_head prints no SHA-1 ellipsis when not asked to' "
 
-	commit=$(git rev-parse --short=12 master^) &&
-	commit2=$(git rev-parse --short=12 master~2) &&
-	commit3=$(git rev-parse --short=12 master~3) &&
+	commit=$(git rev-parse --short=12 main^) &&
+	commit2=$(git rev-parse --short=12 main~2) &&
+	commit3=$(git rev-parse --short=12 main~3) &&
 
 	# The first detach operation is more chatty than the following ones.
 	cat >1st_detach <<-EOF &&
@@ -274,9 +274,9 @@ test_expect_success 'describe_detached_head prints no SHA-1 ellipsis when not as
 # Detached HEAD tests for GIT_PRINT_SHA1_ELLIPSIS (old format)
 test_expect_success 'describe_detached_head does print SHA-1 ellipsis when asked to' "
 
-	commit=$(git rev-parse --short=12 master^) &&
-	commit2=$(git rev-parse --short=12 master~2) &&
-	commit3=$(git rev-parse --short=12 master~3) &&
+	commit=$(git rev-parse --short=12 main^) &&
+	commit2=$(git rev-parse --short=12 main~2) &&
+	commit3=$(git rev-parse --short=12 main~3) &&
 
 	# The first detach operation is more chatty than the following ones.
 	cat >1st_detach <<-EOF &&
diff --git a/t/t2022-checkout-paths.sh b/t/t2022-checkout-paths.sh
index fc0f5b775c..c49ba7f9bd 100755
--- a/t/t2022-checkout-paths.sh
+++ b/t/t2022-checkout-paths.sh
@@ -1,22 +1,22 @@
 #!/bin/sh
 
 test_description='checkout $tree -- $paths'
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
 
 test_expect_success setup '
 	mkdir dir &&
-	>dir/master &&
+	>dir/main &&
 	echo common >dir/common &&
-	git add dir/master dir/common &&
-	test_tick && git commit -m "master has dir/master" &&
+	git add dir/main dir/common &&
+	test_tick && git commit -m "main has dir/main" &&
 	git checkout -b next &&
-	git mv dir/master dir/next0 &&
+	git mv dir/main dir/next0 &&
 	echo next >dir/next1 &&
 	git add dir &&
-	test_tick && git commit -m "next has dir/next but not dir/master"
+	test_tick && git commit -m "next has dir/next but not dir/main"
 '
 
 test_expect_success 'checking out paths out of a tree does not clobber unrelated paths' '
@@ -29,11 +29,11 @@ test_expect_success 'checking out paths out of a tree does not clobber unrelated
 	echo untracked >expect.next2 &&
 	cat expect.next2 >dir/next2 &&
 
-	git checkout master dir &&
+	git checkout main dir &&
 
 	test_cmp expect.common dir/common &&
-	test_path_is_file dir/master &&
-	git diff --exit-code master dir/master &&
+	test_path_is_file dir/main &&
+	git diff --exit-code main dir/main &&
 
 	test_path_is_missing dir/next0 &&
 	test_cmp expect.next1 dir/next1 &&
@@ -55,11 +55,11 @@ test_expect_success 'do not touch unmerged entries matching $path but not in $tr
 	EOF
 	git update-index --index-info <expect.next0 &&
 
-	git checkout master dir &&
+	git checkout main dir &&
 
 	test_cmp expect.common dir/common &&
-	test_path_is_file dir/master &&
-	git diff --exit-code master dir/master &&
+	test_path_is_file dir/main &&
+	git diff --exit-code main dir/main &&
 	git ls-files -s dir/next0 >actual.next0 &&
 	test_cmp expect.next0 actual.next0
 '
diff --git a/t/t2023-checkout-m.sh b/t/t2023-checkout-m.sh
index f2f4f5b3ac..7b327b7544 100755
--- a/t/t2023-checkout-m.sh
+++ b/t/t2023-checkout-m.sh
@@ -4,7 +4,7 @@ test_description='checkout -m -- <conflicted path>
 
 Ensures that checkout -m on a resolved file restores the conflicted file'
 
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -13,15 +13,15 @@ test_expect_success setup '
 	test_tick &&
 	test_commit both.txt both.txt initial &&
 	git branch topic &&
-	test_commit modified_in_master both.txt in_master &&
-	test_commit added_in_master each.txt in_master &&
+	test_commit modified_in_main both.txt in_main &&
+	test_commit added_in_main each.txt in_main &&
 	git checkout topic &&
 	test_commit modified_in_topic both.txt in_topic &&
 	test_commit added_in_topic each.txt in_topic
 '
 
-test_expect_success 'git merge master' '
-    test_must_fail git merge master
+test_expect_success 'git merge main' '
+    test_must_fail git merge main
 '
 
 clean_branchnames () {
@@ -64,7 +64,7 @@ test_expect_success 'force checkout a conflict file creates stage zero entry' '
 		git checkout topic &&
 		echo c >a &&
 		C_OBJ=$(git hash-object a) &&
-		git checkout -m master &&
+		git checkout -m main &&
 		test_cmp_rev :1:a $A_OBJ &&
 		test_cmp_rev :2:a $B_OBJ &&
 		test_cmp_rev :3:a $C_OBJ &&
diff --git a/t/t2024-checkout-dwim.sh b/t/t2024-checkout-dwim.sh
index a4f8d3a67e..4a1c901456 100755
--- a/t/t2024-checkout-dwim.sh
+++ b/t/t2024-checkout-dwim.sh
@@ -29,11 +29,11 @@ status_uno_is_clean () {
 }
 
 test_expect_success 'setup' '
-	test_commit my_master &&
+	test_commit my_main &&
 	git init repo_a &&
 	(
 		cd repo_a &&
-		test_commit a_master &&
+		test_commit a_main &&
 		git checkout -b foo &&
 		test_commit a_foo &&
 		git checkout -b bar &&
@@ -44,7 +44,7 @@ test_expect_success 'setup' '
 	git init repo_b &&
 	(
 		cd repo_b &&
-		test_commit b_master &&
+		test_commit b_main &&
 		git checkout -b foo &&
 		test_commit b_foo &&
 		git checkout -b baz &&
@@ -60,23 +60,23 @@ test_expect_success 'setup' '
 '
 
 test_expect_success 'checkout of non-existing branch fails' '
-	git checkout -B master &&
+	git checkout -B main &&
 	test_might_fail git branch -D xyzzy &&
 
 	test_must_fail git checkout xyzzy &&
 	status_uno_is_clean &&
 	test_must_fail git rev-parse --verify refs/heads/xyzzy &&
-	test_branch master
+	test_branch main
 '
 
 test_expect_success 'checkout of branch from multiple remotes fails #1' '
-	git checkout -B master &&
+	git checkout -B main &&
 	test_might_fail git branch -D foo &&
 
 	test_must_fail git checkout foo &&
 	status_uno_is_clean &&
 	test_must_fail git rev-parse --verify refs/heads/foo &&
-	test_branch master
+	test_branch main
 '
 
 test_expect_success 'when arg matches multiple remotes, do not fallback to interpreting as pathspec' '
@@ -100,21 +100,21 @@ test_expect_success 'when arg matches multiple remotes, do not fallback to inter
 '
 
 test_expect_success 'checkout of branch from multiple remotes fails with advice' '
-	git checkout -B master &&
+	git checkout -B main &&
 	test_might_fail git branch -D foo &&
 	test_must_fail git checkout foo 2>stderr &&
-	test_branch master &&
+	test_branch main &&
 	status_uno_is_clean &&
 	test_i18ngrep "^hint: " stderr &&
 	test_must_fail git -c advice.checkoutAmbiguousRemoteBranchName=false \
 		checkout foo 2>stderr &&
-	test_branch master &&
+	test_branch main &&
 	status_uno_is_clean &&
 	test_i18ngrep ! "^hint: " stderr
 '
 
 test_expect_success PERL 'checkout -p with multiple remotes does not print advice' '
-	git checkout -B master &&
+	git checkout -B main &&
 	test_might_fail git branch -D foo &&
 
 	git checkout -p foo 2>stderr &&
@@ -123,7 +123,7 @@ test_expect_success PERL 'checkout -p with multiple remotes does not print advic
 '
 
 test_expect_success 'checkout of branch from multiple remotes succeeds with checkout.defaultRemote #1' '
-	git checkout -B master &&
+	git checkout -B main &&
 	status_uno_is_clean &&
 	test_might_fail git branch -D foo &&
 
@@ -135,7 +135,7 @@ test_expect_success 'checkout of branch from multiple remotes succeeds with chec
 '
 
 test_expect_success 'checkout of branch from a single remote succeeds #1' '
-	git checkout -B master &&
+	git checkout -B main &&
 	test_might_fail git branch -D bar &&
 
 	git checkout bar &&
@@ -146,7 +146,7 @@ test_expect_success 'checkout of branch from a single remote succeeds #1' '
 '
 
 test_expect_success 'checkout of branch from a single remote succeeds #2' '
-	git checkout -B master &&
+	git checkout -B main &&
 	test_might_fail git branch -D baz &&
 
 	git checkout baz &&
@@ -157,33 +157,33 @@ test_expect_success 'checkout of branch from a single remote succeeds #2' '
 '
 
 test_expect_success '--no-guess suppresses branch auto-vivification' '
-	git checkout -B master &&
+	git checkout -B main &&
 	status_uno_is_clean &&
 	test_might_fail git branch -D bar &&
 
 	test_must_fail git checkout --no-guess bar &&
 	test_must_fail git rev-parse --verify refs/heads/bar &&
-	test_branch master
+	test_branch main
 '
 
 test_expect_success 'checkout.guess = false suppresses branch auto-vivification' '
-	git checkout -B master &&
+	git checkout -B main &&
 	status_uno_is_clean &&
 	test_might_fail git branch -D bar &&
 
 	test_config checkout.guess false &&
 	test_must_fail git checkout bar &&
 	test_must_fail git rev-parse --verify refs/heads/bar &&
-	test_branch master
+	test_branch main
 '
 
 test_expect_success 'setup more remotes with unconventional refspecs' '
-	git checkout -B master &&
+	git checkout -B main &&
 	status_uno_is_clean &&
 	git init repo_c &&
 	(
 		cd repo_c &&
-		test_commit c_master &&
+		test_commit c_main &&
 		git checkout -b bar &&
 		test_commit c_bar &&
 		git checkout -b spam &&
@@ -192,7 +192,7 @@ test_expect_success 'setup more remotes with unconventional refspecs' '
 	git init repo_d &&
 	(
 		cd repo_d &&
-		test_commit d_master &&
+		test_commit d_main &&
 		git checkout -b baz &&
 		test_commit d_baz &&
 		git checkout -b eggs &&
@@ -208,29 +208,29 @@ test_expect_success 'setup more remotes with unconventional refspecs' '
 '
 
 test_expect_success 'checkout of branch from multiple remotes fails #2' '
-	git checkout -B master &&
+	git checkout -B main &&
 	status_uno_is_clean &&
 	test_might_fail git branch -D bar &&
 
 	test_must_fail git checkout bar &&
 	status_uno_is_clean &&
 	test_must_fail git rev-parse --verify refs/heads/bar &&
-	test_branch master
+	test_branch main
 '
 
 test_expect_success 'checkout of branch from multiple remotes fails #3' '
-	git checkout -B master &&
+	git checkout -B main &&
 	status_uno_is_clean &&
 	test_might_fail git branch -D baz &&
 
 	test_must_fail git checkout baz &&
 	status_uno_is_clean &&
 	test_must_fail git rev-parse --verify refs/heads/baz &&
-	test_branch master
+	test_branch main
 '
 
 test_expect_success 'checkout of branch from a single remote succeeds #3' '
-	git checkout -B master &&
+	git checkout -B main &&
 	status_uno_is_clean &&
 	test_might_fail git branch -D spam &&
 
@@ -242,7 +242,7 @@ test_expect_success 'checkout of branch from a single remote succeeds #3' '
 '
 
 test_expect_success 'checkout of branch from a single remote succeeds #4' '
-	git checkout -B master &&
+	git checkout -B main &&
 	status_uno_is_clean &&
 	test_might_fail git branch -D eggs &&
 
@@ -254,7 +254,7 @@ test_expect_success 'checkout of branch from a single remote succeeds #4' '
 '
 
 test_expect_success 'checkout of branch with a file having the same name fails' '
-	git checkout -B master &&
+	git checkout -B main &&
 	status_uno_is_clean &&
 	test_might_fail git branch -D spam &&
 
@@ -262,11 +262,11 @@ test_expect_success 'checkout of branch with a file having the same name fails'
 	test_must_fail git checkout spam &&
 	status_uno_is_clean &&
 	test_must_fail git rev-parse --verify refs/heads/spam &&
-	test_branch master
+	test_branch main
 '
 
 test_expect_success 'checkout of branch with a file in subdir having the same name fails' '
-	git checkout -B master &&
+	git checkout -B main &&
 	status_uno_is_clean &&
 	test_might_fail git branch -D spam &&
 
@@ -276,11 +276,11 @@ test_expect_success 'checkout of branch with a file in subdir having the same na
 	test_must_fail git -C sub checkout spam &&
 	status_uno_is_clean &&
 	test_must_fail git rev-parse --verify refs/heads/spam &&
-	test_branch master
+	test_branch main
 '
 
 test_expect_success 'checkout <branch> -- succeeds, even if a file with the same name exists' '
-	git checkout -B master &&
+	git checkout -B main &&
 	status_uno_is_clean &&
 	test_might_fail git branch -D spam &&
 
@@ -294,7 +294,7 @@ test_expect_success 'checkout <branch> -- succeeds, even if a file with the same
 
 test_expect_success 'loosely defined local base branch is reported correctly' '
 
-	git checkout master &&
+	git checkout main &&
 	status_uno_is_clean &&
 	git branch strict &&
 	git branch loose &&
@@ -302,8 +302,8 @@ test_expect_success 'loosely defined local base branch is reported correctly' '
 
 	test_config branch.strict.remote . &&
 	test_config branch.loose.remote . &&
-	test_config branch.strict.merge refs/heads/master &&
-	test_config branch.loose.merge master &&
+	test_config branch.strict.merge refs/heads/main &&
+	test_config branch.loose.merge main &&
 
 	git checkout strict | sed -e "s/strict/BRANCHNAME/g" >expect &&
 	status_uno_is_clean &&
diff --git a/t/t2027-checkout-track.sh b/t/t2027-checkout-track.sh
index 4e1419ca98..4453741b96 100755
--- a/t/t2027-checkout-track.sh
+++ b/t/t2027-checkout-track.sh
@@ -2,7 +2,7 @@
 
 test_description='tests for git branch --track'
 
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -13,14 +13,14 @@ test_expect_success 'setup' '
 '
 
 test_expect_success 'checkout --track -b creates a new tracking branch' '
-	git checkout --track -b branch1 master &&
+	git checkout --track -b branch1 main &&
 	test $(git rev-parse --abbrev-ref HEAD) = branch1 &&
 	test $(git config --get branch.branch1.remote) = . &&
-	test $(git config --get branch.branch1.merge) = refs/heads/master
+	test $(git config --get branch.branch1.merge) = refs/heads/main
 '
 
 test_expect_success 'checkout --track -b rejects an extra path argument' '
-	test_must_fail git checkout --track -b branch2 master one.t 2>err &&
+	test_must_fail git checkout --track -b branch2 main one.t 2>err &&
 	test_i18ngrep "cannot be used with updating paths" err
 '
 
diff --git a/t/t2030-unresolve-info.sh b/t/t2030-unresolve-info.sh
index 3fe29fc3ee..be6c84c52a 100755
--- a/t/t2030-unresolve-info.sh
+++ b/t/t2030-unresolve-info.sh
@@ -2,7 +2,7 @@
 
 test_description='undoing resolution'
 
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -62,7 +62,7 @@ test_expect_success setup '
 	test_commit fourth fi/le fourth &&
 	git checkout add-add &&
 	test_commit fifth add-differently &&
-	git checkout master
+	git checkout main
 '
 
 test_expect_success 'add records switch clears' '
@@ -186,8 +186,8 @@ test_expect_success 'rerere forget (binary)' '
 '
 
 test_expect_success 'rerere forget (add-add conflict)' '
-	git checkout -f master &&
-	echo master >add-differently &&
+	git checkout -f main &&
+	echo main >add-differently &&
 	git add add-differently &&
 	git commit -m "add differently" &&
 	test_must_fail git merge fifth &&
diff --git a/t/t2060-switch.sh b/t/t2060-switch.sh
index 4de9299705..9bc6a3aa5c 100755
--- a/t/t2060-switch.sh
+++ b/t/t2060-switch.sh
@@ -2,7 +2,7 @@
 
 test_description='switch basic functionality'
 
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -26,41 +26,41 @@ test_expect_success 'switch branch' '
 '
 
 test_expect_success 'switch and detach' '
-	test_when_finished git switch master &&
-	test_must_fail git switch master^{commit} &&
-	git switch --detach master^{commit} &&
+	test_when_finished git switch main &&
+	test_must_fail git switch main^{commit} &&
+	git switch --detach main^{commit} &&
 	test_must_fail git symbolic-ref HEAD
 '
 
 test_expect_success 'switch and detach current branch' '
-	test_when_finished git switch master &&
-	git switch master &&
+	test_when_finished git switch main &&
+	git switch main &&
 	git switch --detach &&
 	test_must_fail git symbolic-ref HEAD
 '
 
 test_expect_success 'switch and create branch' '
-	test_when_finished git switch master &&
-	git switch -c temp master^ &&
-	test_cmp_rev master^ refs/heads/temp &&
+	test_when_finished git switch main &&
+	git switch -c temp main^ &&
+	test_cmp_rev main^ refs/heads/temp &&
 	echo refs/heads/temp >expected-branch &&
 	git symbolic-ref HEAD >actual-branch &&
 	test_cmp expected-branch actual-branch
 '
 
 test_expect_success 'force create branch from HEAD' '
-	test_when_finished git switch master &&
-	git switch --detach master &&
+	test_when_finished git switch main &&
+	git switch --detach main &&
 	test_must_fail git switch -c temp &&
 	git switch -C temp &&
-	test_cmp_rev master refs/heads/temp &&
+	test_cmp_rev main refs/heads/temp &&
 	echo refs/heads/temp >expected-branch &&
 	git symbolic-ref HEAD >actual-branch &&
 	test_cmp expected-branch actual-branch
 '
 
 test_expect_success 'new orphan branch from empty' '
-	test_when_finished git switch master &&
+	test_when_finished git switch main &&
 	test_must_fail git switch --orphan new-orphan HEAD &&
 	git switch --orphan new-orphan &&
 	test_commit orphan &&
@@ -72,7 +72,7 @@ test_expect_success 'new orphan branch from empty' '
 '
 
 test_expect_success 'orphan branch works with --discard-changes' '
-	test_when_finished git switch master &&
+	test_when_finished git switch main &&
 	echo foo >foo.txt &&
 	git switch --discard-changes --orphan new-orphan2 &&
 	git ls-files >tracked-files &&
@@ -80,7 +80,7 @@ test_expect_success 'orphan branch works with --discard-changes' '
 '
 
 test_expect_success 'switching ignores file of same branch name' '
-	test_when_finished git switch master &&
+	test_when_finished git switch main &&
 	: >first-branch &&
 	git switch first-branch &&
 	echo refs/heads/first-branch >expected &&
@@ -89,7 +89,7 @@ test_expect_success 'switching ignores file of same branch name' '
 '
 
 test_expect_success 'guess and create branch' '
-	test_when_finished git switch master &&
+	test_when_finished git switch main &&
 	test_must_fail git switch --no-guess foo &&
 	test_config checkout.guess false &&
 	test_must_fail git switch foo &&
diff --git a/t/t2070-restore.sh b/t/t2070-restore.sh
index 6941769c9a..7c43ddf1d9 100755
--- a/t/t2070-restore.sh
+++ b/t/t2070-restore.sh
@@ -2,7 +2,7 @@
 
 test_description='restore basic functionality'
 
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -18,7 +18,7 @@ test_expect_success 'setup' '
 	echo ignored >ignored &&
 	echo /ignored >.gitignore &&
 	git add one two .gitignore &&
-	git update-ref refs/heads/one master
+	git update-ref refs/heads/one main
 '
 
 test_expect_success 'restore without pathspec is not ok' '
@@ -94,7 +94,7 @@ test_expect_success 'restore --ignore-unmerged ignores unmerged entries' '
 		git switch -c first &&
 		echo first >unmerged &&
 		git commit -am first &&
-		git switch -c second master &&
+		git switch -c second main &&
 		echo second >unmerged &&
 		git commit -am second &&
 		test_must_fail git merge first &&
diff --git a/t/t2400-worktree-add.sh b/t/t2400-worktree-add.sh
index 35cef266e9..96dfca1554 100755
--- a/t/t2400-worktree-add.sh
+++ b/t/t2400-worktree-add.sh
@@ -2,7 +2,7 @@
 
 test_description='test git worktree add'
 
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -15,12 +15,12 @@ test_expect_success 'setup' '
 
 test_expect_success '"add" an existing worktree' '
 	mkdir -p existing/subtree &&
-	test_must_fail git worktree add --detach existing master
+	test_must_fail git worktree add --detach existing main
 '
 
 test_expect_success '"add" an existing empty worktree' '
 	mkdir existing_empty &&
-	git worktree add --detach existing_empty master
+	git worktree add --detach existing_empty main
 '
 
 test_expect_success '"add" using shorthand - fails when no previous branch' '
@@ -32,7 +32,7 @@ test_expect_success '"add" using - shorthand' '
 	echo hello >myworld &&
 	git add myworld &&
 	git commit -m myworld &&
-	git checkout master &&
+	git checkout main &&
 	git worktree add short-hand - &&
 	echo refs/heads/newbranch >expect &&
 	git -C short-hand rev-parse --symbolic-full-name HEAD >actual &&
@@ -40,7 +40,7 @@ test_expect_success '"add" using - shorthand' '
 '
 
 test_expect_success '"add" refuses to checkout locked branch' '
-	test_must_fail git worktree add zere master &&
+	test_must_fail git worktree add zere main &&
 	! test -d zere &&
 	! test -d .git/worktrees/zere
 '
@@ -49,13 +49,13 @@ test_expect_success 'checking out paths not complaining about linked checkouts'
 	(
 	cd existing_empty &&
 	echo dirty >>init.t &&
-	git checkout master -- init.t
+	git checkout main -- init.t
 	)
 '
 
 test_expect_success '"add" worktree' '
 	git rev-parse HEAD >expect &&
-	git worktree add --detach here master &&
+	git worktree add --detach here main &&
 	(
 		cd here &&
 		test_cmp ../init.t init.t &&
@@ -68,7 +68,7 @@ test_expect_success '"add" worktree' '
 
 test_expect_success '"add" worktree with lock' '
 	git rev-parse HEAD >expect &&
-	git worktree add --detach --lock here-with-lock master &&
+	git worktree add --detach --lock here-with-lock main &&
 	test -f .git/worktrees/here-with-lock/locked
 '
 
@@ -76,7 +76,7 @@ test_expect_success '"add" worktree from a subdir' '
 	(
 		mkdir sub &&
 		cd sub &&
-		git worktree add --detach here master &&
+		git worktree add --detach here main &&
 		cd here &&
 		test_cmp ../../init.t init.t
 	)
@@ -85,19 +85,19 @@ test_expect_success '"add" worktree from a subdir' '
 test_expect_success '"add" from a linked checkout' '
 	(
 		cd here &&
-		git worktree add --detach nested-here master &&
+		git worktree add --detach nested-here main &&
 		cd nested-here &&
 		git fsck
 	)
 '
 
 test_expect_success '"add" worktree creating new branch' '
-	git worktree add -b newmaster there master &&
+	git worktree add -b newmain there main &&
 	(
 		cd there &&
 		test_cmp ../init.t init.t &&
 		git symbolic-ref HEAD >actual &&
-		echo refs/heads/newmaster >expect &&
+		echo refs/heads/newmain >expect &&
 		test_cmp expect actual &&
 		git fsck
 	)
@@ -106,7 +106,7 @@ test_expect_success '"add" worktree creating new branch' '
 test_expect_success 'die the same branch is already checked out' '
 	(
 		cd here &&
-		test_must_fail git checkout newmaster
+		test_must_fail git checkout newmain
 	)
 '
 
@@ -115,20 +115,20 @@ test_expect_success SYMLINKS 'die the same branch is already checked out (symlin
 	ref=$(git -C there symbolic-ref HEAD) &&
 	rm "$head" &&
 	ln -s "$ref" "$head" &&
-	test_must_fail git -C here checkout newmaster
+	test_must_fail git -C here checkout newmain
 '
 
 test_expect_success 'not die the same branch is already checked out' '
 	(
 		cd here &&
-		git worktree add --force anothernewmaster newmaster
+		git worktree add --force anothernewmain newmain
 	)
 '
 
 test_expect_success 'not die on re-checking out current branch' '
 	(
 		cd there &&
-		git checkout newmaster
+		git checkout newmain
 	)
 '
 
@@ -136,14 +136,14 @@ test_expect_success '"add" from a bare repo' '
 	(
 		git clone --bare . bare &&
 		cd bare &&
-		git worktree add -b bare-master ../there2 master
+		git worktree add -b bare-main ../there2 main
 	)
 '
 
 test_expect_success 'checkout from a bare repo without "add"' '
 	(
 		cd bare &&
-		test_must_fail git checkout master
+		test_must_fail git checkout main
 	)
 '
 
@@ -151,7 +151,7 @@ test_expect_success '"add" default branch of a bare repo' '
 	(
 		git clone --bare . bare2 &&
 		cd bare2 &&
-		git worktree add ../there3 master
+		git worktree add ../there3 main
 	)
 '
 
@@ -168,7 +168,7 @@ test_expect_success 'checkout with grafts' '
 	EOF
 	git log --format=%s -2 >actual &&
 	test_cmp expected actual &&
-	git worktree add --detach grafted master &&
+	git worktree add --detach grafted main &&
 	git --git-dir=grafted/.git log --format=%s -2 >actual &&
 	test_cmp expected actual
 '
@@ -229,34 +229,34 @@ test_expect_success '"add" no auto-vivify with --detach and <branch> omitted' '
 '
 
 test_expect_success '"add" -b/-B mutually exclusive' '
-	test_must_fail git worktree add -b poodle -B poodle bamboo master
+	test_must_fail git worktree add -b poodle -B poodle bamboo main
 '
 
 test_expect_success '"add" -b/--detach mutually exclusive' '
-	test_must_fail git worktree add -b poodle --detach bamboo master
+	test_must_fail git worktree add -b poodle --detach bamboo main
 '
 
 test_expect_success '"add" -B/--detach mutually exclusive' '
-	test_must_fail git worktree add -B poodle --detach bamboo master
+	test_must_fail git worktree add -B poodle --detach bamboo main
 '
 
 test_expect_success '"add -B" fails if the branch is checked out' '
-	git rev-parse newmaster >before &&
-	test_must_fail git worktree add -B newmaster bamboo master &&
-	git rev-parse newmaster >after &&
+	git rev-parse newmain >before &&
+	test_must_fail git worktree add -B newmain bamboo main &&
+	git rev-parse newmain >after &&
 	test_cmp before after
 '
 
 test_expect_success 'add -B' '
-	git worktree add -B poodle bamboo2 master^ &&
+	git worktree add -B poodle bamboo2 main^ &&
 	git -C bamboo2 symbolic-ref HEAD >actual &&
 	echo refs/heads/poodle >expected &&
 	test_cmp expected actual &&
-	test_cmp_rev master^ poodle
+	test_cmp_rev main^ poodle
 '
 
 test_expect_success 'add --quiet' '
-	git worktree add --quiet another-worktree master 2>actual &&
+	git worktree add --quiet another-worktree main 2>actual &&
 	test_must_be_empty actual
 '
 
@@ -351,24 +351,24 @@ test_branch_upstream () {
 
 test_expect_success '--track sets up tracking' '
 	test_when_finished rm -rf track &&
-	git worktree add --track -b track track master &&
-	test_branch_upstream track . master
+	git worktree add --track -b track track main &&
+	test_branch_upstream track . main
 '
 
 # setup remote repository $1 and repository $2 with $1 set up as
-# remote.  The remote has two branches, master and foo.
+# remote.  The remote has two branches, main and foo.
 setup_remote_repo () {
 	git init $1 &&
 	(
 		cd $1 &&
-		test_commit $1_master &&
+		test_commit $1_main &&
 		git checkout -b foo &&
 		test_commit upstream_foo
 	) &&
 	git init $2 &&
 	(
 		cd $2 &&
-		test_commit $2_master &&
+		test_commit $2_main &&
 		git remote add $1 ../$1 &&
 		git config remote.$1.fetch \
 			"refs/heads/*:refs/remotes/$1/*" &&
diff --git a/t/t2401-worktree-prune.sh b/t/t2401-worktree-prune.sh
index e6fc27de1e..aff877590d 100755
--- a/t/t2401-worktree-prune.sh
+++ b/t/t2401-worktree-prune.sh
@@ -2,7 +2,7 @@
 
 test_description='prune $GIT_DIR/worktrees'
 
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -90,7 +90,7 @@ test_expect_success 'not prune recent checkouts' '
 
 test_expect_success 'not prune proper checkouts' '
 	test_when_finished rm -r .git/worktrees &&
-	git worktree add --detach "$PWD/nop" master &&
+	git worktree add --detach "$PWD/nop" main &&
 	git worktree prune &&
 	test -d .git/worktrees/nop
 '
diff --git a/t/t2402-worktree-list.sh b/t/t2402-worktree-list.sh
index 3b23b0fdb7..821a20f3d6 100755
--- a/t/t2402-worktree-list.sh
+++ b/t/t2402-worktree-list.sh
@@ -2,7 +2,7 @@
 
 test_description='test git worktree list'
 
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -24,7 +24,7 @@ test_expect_success 'rev-parse --git-common-dir on main worktree' '
 test_expect_success 'rev-parse --git-path objects linked worktree' '
 	echo "$(git rev-parse --show-toplevel)/.git/objects" >expect &&
 	test_when_finished "rm -rf linked-tree actual expect && git worktree prune" &&
-	git worktree add --detach linked-tree master &&
+	git worktree add --detach linked-tree main &&
 	git -C linked-tree rev-parse --git-path objects >actual &&
 	test_cmp expect actual
 '
@@ -32,7 +32,7 @@ test_expect_success 'rev-parse --git-path objects linked worktree' '
 test_expect_success '"list" all worktrees from main' '
 	echo "$(git rev-parse --show-toplevel) $(git rev-parse --short HEAD) [$(git symbolic-ref --short HEAD)]" >expect &&
 	test_when_finished "rm -rf here out actual expect && git worktree prune" &&
-	git worktree add --detach here master &&
+	git worktree add --detach here main &&
 	echo "$(git -C here rev-parse --show-toplevel) $(git rev-parse --short HEAD) (detached HEAD)" >>expect &&
 	git worktree list >out &&
 	sed "s/  */ /g" <out >actual &&
@@ -42,7 +42,7 @@ test_expect_success '"list" all worktrees from main' '
 test_expect_success '"list" all worktrees from linked' '
 	echo "$(git rev-parse --show-toplevel) $(git rev-parse --short HEAD) [$(git symbolic-ref --short HEAD)]" >expect &&
 	test_when_finished "rm -rf here out actual expect && git worktree prune" &&
-	git worktree add --detach here master &&
+	git worktree add --detach here main &&
 	echo "$(git -C here rev-parse --show-toplevel) $(git rev-parse --short HEAD) (detached HEAD)" >>expect &&
 	git -C here worktree list >out &&
 	sed "s/  */ /g" <out >actual &&
@@ -55,7 +55,7 @@ test_expect_success '"list" all worktrees --porcelain' '
 	echo "branch $(git symbolic-ref HEAD)" >>expect &&
 	echo >>expect &&
 	test_when_finished "rm -rf here actual expect && git worktree prune" &&
-	git worktree add --detach here master &&
+	git worktree add --detach here main &&
 	echo "worktree $(git -C here rev-parse --show-toplevel)" >>expect &&
 	echo "HEAD $(git rev-parse HEAD)" >>expect &&
 	echo "detached" >>expect &&
@@ -66,8 +66,8 @@ test_expect_success '"list" all worktrees --porcelain' '
 
 test_expect_success '"list" all worktrees with locked annotation' '
 	test_when_finished "rm -rf locked unlocked out && git worktree prune" &&
-	git worktree add --detach locked master &&
-	git worktree add --detach unlocked master &&
+	git worktree add --detach locked main &&
+	git worktree add --detach unlocked main &&
 	git worktree lock locked &&
 	git worktree list >out &&
 	grep "/locked  *[0-9a-f].* locked$" out &&
@@ -79,13 +79,13 @@ test_expect_success 'bare repo setup' '
 	echo "data" >file1 &&
 	git add file1 &&
 	git commit -m"File1: add data" &&
-	git push bare1 master &&
+	git push bare1 main &&
 	git reset --hard HEAD^
 '
 
 test_expect_success '"list" all worktrees from bare main' '
 	test_when_finished "rm -rf there out actual expect && git -C bare1 worktree prune" &&
-	git -C bare1 worktree add --detach ../there master &&
+	git -C bare1 worktree add --detach ../there main &&
 	echo "$(pwd)/bare1 (bare)" >expect &&
 	echo "$(git -C there rev-parse --show-toplevel) $(git -C there rev-parse --short HEAD) (detached HEAD)" >>expect &&
 	git -C bare1 worktree list >out &&
@@ -95,7 +95,7 @@ test_expect_success '"list" all worktrees from bare main' '
 
 test_expect_success '"list" all worktrees --porcelain from bare main' '
 	test_when_finished "rm -rf there actual expect && git -C bare1 worktree prune" &&
-	git -C bare1 worktree add --detach ../there master &&
+	git -C bare1 worktree add --detach ../there main &&
 	echo "worktree $(pwd)/bare1" >expect &&
 	echo "bare" >>expect &&
 	echo >>expect &&
@@ -109,7 +109,7 @@ test_expect_success '"list" all worktrees --porcelain from bare main' '
 
 test_expect_success '"list" all worktrees from linked with a bare main' '
 	test_when_finished "rm -rf there out actual expect && git -C bare1 worktree prune" &&
-	git -C bare1 worktree add --detach ../there master &&
+	git -C bare1 worktree add --detach ../there main &&
 	echo "$(pwd)/bare1 (bare)" >expect &&
 	echo "$(git -C there rev-parse --show-toplevel) $(git -C there rev-parse --short HEAD) (detached HEAD)" >>expect &&
 	git -C there worktree list >out &&
diff --git a/t/t2405-worktree-submodule.sh b/t/t2405-worktree-submodule.sh
index cca2aea658..b172c26ca4 100755
--- a/t/t2405-worktree-submodule.sh
+++ b/t/t2405-worktree-submodule.sh
@@ -2,7 +2,7 @@
 
 test_description='Combination of submodules and multiple worktrees'
 
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -34,7 +34,7 @@ test_expect_success 'add superproject worktree' '
 '
 
 test_expect_failure 'submodule is checked out just after worktree add' '
-	git -C worktree diff --submodule master"^!" >out &&
+	git -C worktree diff --submodule main"^!" >out &&
 	grep "file1 updated" out
 '
 
@@ -44,7 +44,7 @@ test_expect_success 'add superproject worktree and initialize submodules' '
 '
 
 test_expect_success 'submodule is checked out just after submodule update in linked worktree' '
-	git -C worktree-submodule-update diff --submodule master"^!" >out &&
+	git -C worktree-submodule-update diff --submodule main"^!" >out &&
 	grep "file1 updated" out
 '
 
@@ -54,7 +54,7 @@ test_expect_success 'add superproject worktree and manually add submodule worktr
 '
 
 test_expect_success 'submodule is checked out after manually adding submodule worktree' '
-	git -C linked_submodule diff --submodule master"^!" >out &&
+	git -C linked_submodule diff --submodule main"^!" >out &&
 	grep "file1 updated" out
 '
 
-- 
gitgitgadget


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH v3 05/28] t3[0-3]*: adjust the references to the default branch name "main"
  2020-11-18 23:44   ` [PATCH v3 00/28] tests: use main as default branch name Johannes Schindelin via GitGitGadget
                       ` (3 preceding siblings ...)
  2020-11-18 23:44     ` [PATCH v3 04/28] t2*: " Johannes Schindelin via GitGitGadget
@ 2020-11-18 23:44     ` Johannes Schindelin via GitGitGadget
  2020-11-18 23:44     ` [PATCH v3 06/28] t3416: preemptively adjust alignment in a comment Johannes Schindelin via GitGitGadget
                       ` (23 subsequent siblings)
  28 siblings, 0 replies; 163+ messages in thread
From: Johannes Schindelin via GitGitGadget @ 2020-11-18 23:44 UTC (permalink / raw)
  To: git
  Cc: Felipe Contreras, Ævar Arnfjörð Bjarmason,
	Johannes Schindelin, Jeff King, Jonathan Nieder,
	Johannes Schindelin, Johannes Schindelin

From: Johannes Schindelin <johannes.schindelin@gmx.de>

Carefully excluding t3040, which sees independent development elsewhere
at the time of writing, we transition above-mentioned tests 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[0-3]*.sh t3206/* &&
	   git checkout HEAD -- t3040\*)

This allows us to define `GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main`
for those tests.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
---
 t/t3200-branch.sh                     | 244 +++++++++++++-------------
 t/t3201-branch-contains.sh            |  82 ++++-----
 t/t3202-show-branch-octopus.sh        |   4 +-
 t/t3203-branch-output.sh              |  40 ++---
 t/t3204-branch-name-interpretation.sh |   8 +-
 t/t3205-branch-color.sh               |   8 +-
 t/t3206-range-diff.sh                 |  42 ++---
 t/t3206/history.export                |   2 +-
 t/t3210-pack-refs.sh                  |   6 +-
 t/t3211-peel-ref.sh                   |   6 +-
 t/t3301-notes.sh                      |   6 +-
 t/t3302-notes-index-expensive.sh      |   4 +-
 t/t3303-notes-subtrees.sh             |  10 +-
 t/t3304-notes-mixed.sh                |  10 +-
 t/t3308-notes-merge.sh                |   2 +-
 t/t3320-notes-merge-worktrees.sh      |   6 +-
 16 files changed, 240 insertions(+), 240 deletions(-)

diff --git a/t/t3200-branch.sh b/t/t3200-branch.sh
index 04b568cf21..56517dd9c3 100755
--- a/t/t3200-branch.sh
+++ b/t/t3200-branch.sh
@@ -5,7 +5,7 @@
 
 test_description='git branch assorted tests'
 
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -31,7 +31,7 @@ test_expect_success 'branch -h in broken repository' '
 	(
 		cd broken &&
 		git init &&
-		>.git/refs/heads/master &&
+		>.git/refs/heads/main &&
 		test_expect_code 129 git branch -h >usage 2>&1
 	) &&
 	test_i18ngrep "[Uu]sage" broken/usage
@@ -45,8 +45,8 @@ test_expect_success 'git branch a/b/c should create a branch' '
 	git branch a/b/c && test_path_is_file .git/refs/heads/a/b/c
 '
 
-test_expect_success 'git branch mb master... should create a branch' '
-	git branch mb master... && test_path_is_file .git/refs/heads/mb
+test_expect_success 'git branch mb main... should create a branch' '
+	git branch mb main... && test_path_is_file .git/refs/heads/mb
 '
 
 test_expect_success 'git branch HEAD should fail' '
@@ -54,7 +54,7 @@ test_expect_success 'git branch HEAD should fail' '
 '
 
 cat >expect <<EOF
-$ZERO_OID $HEAD $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> 1117150200 +0000	branch: Created from master
+$ZERO_OID $HEAD $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> 1117150200 +0000	branch: Created from main
 EOF
 test_expect_success 'git branch --create-reflog d/e/f should create a branch and a log' '
 	GIT_COMMITTER_DATE="2005-05-26 23:30" \
@@ -113,7 +113,7 @@ test_expect_success 'git branch -m n/n n should work' '
 
 test_expect_success 'git branch -m bbb should rename checked out branch' '
 	test_when_finished git branch -D bbb &&
-	test_when_finished git checkout master &&
+	test_when_finished git checkout main &&
 	git checkout -b aaa &&
 	git commit --allow-empty -m "a new commit" &&
 	git rev-parse aaa@{0} >expect &&
@@ -127,7 +127,7 @@ test_expect_success 'git branch -m bbb should rename checked out branch' '
 
 test_expect_success 'renaming checked out branch works with d/f conflict' '
 	test_when_finished "git branch -D foo/bar || git branch -D foo" &&
-	test_when_finished git checkout master &&
+	test_when_finished git checkout main &&
 	git checkout -b foo &&
 	git branch -m foo/bar &&
 	git symbolic-ref HEAD >actual &&
@@ -188,7 +188,7 @@ test_expect_success 'git branch -M should leave orphaned HEAD alone' '
 		git checkout --orphan lonely &&
 		grep lonely .git/HEAD &&
 		test_path_is_missing .git/refs/head/lonely &&
-		git branch -M master mistress &&
+		git branch -M main mistress &&
 		grep lonely .git/HEAD
 	)
 '
@@ -204,7 +204,7 @@ test_expect_success 'resulting reflog can be shown by log -g' '
 '
 
 test_expect_success 'git branch -M baz bam should succeed when baz is checked out as linked working tree' '
-	git checkout master &&
+	git checkout main &&
 	git worktree add -b baz bazdir &&
 	git worktree add -f bazdir2 baz &&
 	git branch -M baz bam &&
@@ -227,18 +227,18 @@ test_expect_success 'git branch -M baz bam should succeed within a worktree in w
 	git worktree prune
 '
 
-test_expect_success 'git branch -M master should work when master is checked out' '
-	git checkout master &&
-	git branch -M master
+test_expect_success 'git branch -M main should work when main is checked out' '
+	git checkout main &&
+	git branch -M main
 '
 
-test_expect_success 'git branch -M master master should work when master is checked out' '
-	git checkout master &&
-	git branch -M master master
+test_expect_success 'git branch -M main main should work when main is checked out' '
+	git checkout main &&
+	git branch -M main main
 '
 
-test_expect_success 'git branch -M topic topic should work when master is checked out' '
-	git checkout master &&
+test_expect_success 'git branch -M topic topic should work when main is checked out' '
+	git checkout main &&
 	git branch topic &&
 	git branch -M topic topic
 '
@@ -295,8 +295,8 @@ test_expect_success 'bare main worktree has HEAD at branch deleted by secondary
 	git init nonbare &&
 	test_commit -C nonbare x &&
 	git clone --bare nonbare bare &&
-	git -C bare worktree add --detach ../secondary master &&
-	git -C secondary branch -D master
+	git -C bare worktree add --detach ../secondary main &&
+	git -C secondary branch -D main
 '
 
 test_expect_success 'git branch --list -v with --abbrev' '
@@ -348,7 +348,7 @@ test_expect_success 'git branch --column with an extremely long branch name' '
   j/k
   l
   m/m
-* master
+* main
   mb
   n
   o/o
@@ -391,7 +391,7 @@ test_expect_success PREPARE_FOR_MAIN_BRANCH 'git branch -v with column.ui ignore
   j/k
   l
   m/m
-* master
+* main
   mb
   n
   o/o
@@ -430,8 +430,8 @@ test_expect_success 'config information was renamed, too' '
 '
 
 test_expect_success 'git branch -m correctly renames multiple config sections' '
-	test_when_finished "git checkout master" &&
-	git checkout -b source master &&
+	test_when_finished "git checkout main" &&
+	git checkout -b source main &&
 
 	# Assert that a config file with multiple config sections has
 	# those sections preserved...
@@ -590,18 +590,18 @@ test_expect_success 'git branch -C c1 c2 should never touch HEAD' '
 	! grep "$msg$" .git/logs/HEAD
 '
 
-test_expect_success 'git branch -C master should work when master is checked out' '
-	git checkout master &&
-	git branch -C master
+test_expect_success 'git branch -C main should work when main is checked out' '
+	git checkout main &&
+	git branch -C main
 '
 
-test_expect_success 'git branch -C master master should work when master is checked out' '
-	git checkout master &&
-	git branch -C master master
+test_expect_success 'git branch -C main main should work when main is checked out' '
+	git checkout main &&
+	git branch -C main main
 '
 
-test_expect_success 'git branch -C main5 main5 should work when master is checked out' '
-	git checkout master &&
+test_expect_success 'git branch -C main5 main5 should work when main is checked out' '
+	git checkout main &&
 	git branch main5 &&
 	git branch -C main5 main5
 '
@@ -623,8 +623,8 @@ test_expect_success 'git branch -C ab cd should overwrite existing config for cd
 test_expect_success 'git branch -c correctly copies multiple config sections' '
 	FOO=1 &&
 	export FOO &&
-	test_when_finished "git checkout master" &&
-	git checkout -b source2 master &&
+	test_when_finished "git checkout main" &&
+	git checkout -b source2 main &&
 
 	# Assert that a config file with multiple config sections has
 	# those sections preserved...
@@ -714,10 +714,10 @@ test_expect_success 'deleting a self-referential symref' '
 '
 
 test_expect_success 'renaming a symref is not allowed' '
-	git symbolic-ref refs/heads/topic refs/heads/master &&
+	git symbolic-ref refs/heads/topic refs/heads/main &&
 	test_must_fail git branch -m topic new-topic &&
 	git symbolic-ref refs/heads/topic &&
-	test_path_is_file .git/refs/heads/master &&
+	test_path_is_file .git/refs/heads/main &&
 	test_path_is_missing .git/refs/heads/new-topic
 '
 
@@ -731,27 +731,27 @@ test_expect_success SYMLINKS 'git branch -m u v should fail when the reflog for
 test_expect_success 'test tracking setup via --track' '
 	git config remote.local.url . &&
 	git config remote.local.fetch refs/heads/*:refs/remotes/local/* &&
-	(git show-ref -q refs/remotes/local/master || git fetch local) &&
-	git branch --track my1 local/master &&
+	(git show-ref -q refs/remotes/local/main || git fetch local) &&
+	git branch --track my1 local/main &&
 	test $(git config branch.my1.remote) = local &&
-	test $(git config branch.my1.merge) = refs/heads/master
+	test $(git config branch.my1.merge) = refs/heads/main
 '
 
 test_expect_success 'test tracking setup (non-wildcard, matching)' '
 	git config remote.local.url . &&
-	git config remote.local.fetch refs/heads/master:refs/remotes/local/master &&
-	(git show-ref -q refs/remotes/local/master || git fetch local) &&
-	git branch --track my4 local/master &&
+	git config remote.local.fetch refs/heads/main:refs/remotes/local/main &&
+	(git show-ref -q refs/remotes/local/main || git fetch local) &&
+	git branch --track my4 local/main &&
 	test $(git config branch.my4.remote) = local &&
-	test $(git config branch.my4.merge) = refs/heads/master
+	test $(git config branch.my4.merge) = refs/heads/main
 '
 
 test_expect_success 'tracking setup fails on non-matching refspec' '
 	git config remote.local.url . &&
 	git config remote.local.fetch refs/heads/*:refs/remotes/local/* &&
-	(git show-ref -q refs/remotes/local/master || git fetch local) &&
+	(git show-ref -q refs/remotes/local/main || git fetch local) &&
 	git config remote.local.fetch refs/heads/s:refs/remotes/local/s &&
-	test_must_fail git branch --track my5 local/master &&
+	test_must_fail git branch --track my5 local/main &&
 	test_must_fail git config branch.my5.remote &&
 	test_must_fail git config branch.my5.merge
 '
@@ -760,21 +760,21 @@ test_expect_success 'test tracking setup via config' '
 	git config branch.autosetupmerge true &&
 	git config remote.local.url . &&
 	git config remote.local.fetch refs/heads/*:refs/remotes/local/* &&
-	(git show-ref -q refs/remotes/local/master || git fetch local) &&
-	git branch my3 local/master &&
+	(git show-ref -q refs/remotes/local/main || git fetch local) &&
+	git branch my3 local/main &&
 	test $(git config branch.my3.remote) = local &&
-	test $(git config branch.my3.merge) = refs/heads/master
+	test $(git config branch.my3.merge) = refs/heads/main
 '
 
 test_expect_success 'test overriding tracking setup via --no-track' '
 	git config branch.autosetupmerge true &&
 	git config remote.local.url . &&
 	git config remote.local.fetch refs/heads/*:refs/remotes/local/* &&
-	(git show-ref -q refs/remotes/local/master || git fetch local) &&
-	git branch --no-track my2 local/master &&
+	(git show-ref -q refs/remotes/local/main || git fetch local) &&
+	git branch --no-track my2 local/main &&
 	git config branch.autosetupmerge false &&
 	! test "$(git config branch.my2.remote)" = local &&
-	! test "$(git config branch.my2.merge)" = refs/heads/master
+	! test "$(git config branch.my2.merge)" = refs/heads/main
 '
 
 test_expect_success 'no tracking without .fetch entries' '
@@ -839,26 +839,26 @@ test_expect_success 'branch from tag w/--track causes failure' '
 
 test_expect_success '--set-upstream-to fails on multiple branches' '
 	echo "fatal: too many arguments to set new upstream" >expect &&
-	test_must_fail git branch --set-upstream-to master a b c 2>err &&
+	test_must_fail git branch --set-upstream-to main a b c 2>err &&
 	test_i18ncmp expect err
 '
 
 test_expect_success '--set-upstream-to fails on detached HEAD' '
 	git checkout HEAD^{} &&
 	test_when_finished git checkout - &&
-	echo "fatal: could not set upstream of HEAD to master when it does not point to any branch." >expect &&
-	test_must_fail git branch --set-upstream-to master 2>err &&
+	echo "fatal: could not set upstream of HEAD to main when it does not point to any branch." >expect &&
+	test_must_fail git branch --set-upstream-to main 2>err &&
 	test_i18ncmp expect err
 '
 
 test_expect_success '--set-upstream-to fails on a missing dst branch' '
 	echo "fatal: branch '"'"'does-not-exist'"'"' does not exist" >expect &&
-	test_must_fail git branch --set-upstream-to master does-not-exist 2>err &&
+	test_must_fail git branch --set-upstream-to main does-not-exist 2>err &&
 	test_i18ncmp expect err
 '
 
 test_expect_success '--set-upstream-to fails on a missing src branch' '
-	test_must_fail git branch --set-upstream-to does-not-exist master 2>err &&
+	test_must_fail git branch --set-upstream-to does-not-exist main 2>err &&
 	test_i18ngrep "the requested upstream branch '"'"'does-not-exist'"'"' does not exist" err
 '
 
@@ -877,20 +877,20 @@ test_expect_success '--set-upstream-to fails on locked config' '
 '
 
 test_expect_success 'use --set-upstream-to modify HEAD' '
-	test_config branch.master.remote foo &&
-	test_config branch.master.merge foo &&
+	test_config branch.main.remote foo &&
+	test_config branch.main.merge foo &&
 	git branch my12 &&
 	git branch --set-upstream-to my12 &&
-	test "$(git config branch.master.remote)" = "." &&
-	test "$(git config branch.master.merge)" = "refs/heads/my12"
+	test "$(git config branch.main.remote)" = "." &&
+	test "$(git config branch.main.merge)" = "refs/heads/my12"
 '
 
 test_expect_success 'use --set-upstream-to modify a particular branch' '
 	git branch my13 &&
-	git branch --set-upstream-to master my13 &&
+	git branch --set-upstream-to main my13 &&
 	test_when_finished "git branch --unset-upstream my13" &&
 	test "$(git config branch.my13.remote)" = "." &&
-	test "$(git config branch.my13.merge)" = "refs/heads/master"
+	test "$(git config branch.my13.merge)" = "refs/heads/main"
 '
 
 test_expect_success '--unset-upstream should fail if given a non-existent branch' '
@@ -909,14 +909,14 @@ test_expect_success '--unset-upstream should fail if config is locked' '
 
 test_expect_success 'test --unset-upstream on HEAD' '
 	git branch my14 &&
-	test_config branch.master.remote foo &&
-	test_config branch.master.merge foo &&
+	test_config branch.main.remote foo &&
+	test_config branch.main.merge foo &&
 	git branch --set-upstream-to my14 &&
 	git branch --unset-upstream &&
-	test_must_fail git config branch.master.remote &&
-	test_must_fail git config branch.master.merge &&
+	test_must_fail git config branch.main.remote &&
+	test_must_fail git config branch.main.merge &&
 	# fail for a branch without upstream set
-	echo "fatal: Branch '"'"'master'"'"' has no upstream information" >expect &&
+	echo "fatal: Branch '"'"'main'"'"' has no upstream information" >expect &&
 	test_must_fail git branch --unset-upstream 2>err &&
 	test_i18ncmp expect err
 '
@@ -937,14 +937,14 @@ test_expect_success '--unset-upstream should fail on detached HEAD' '
 
 test_expect_success 'test --unset-upstream on a particular branch' '
 	git branch my15 &&
-	git branch --set-upstream-to master my14 &&
+	git branch --set-upstream-to main my14 &&
 	git branch --unset-upstream my14 &&
 	test_must_fail git config branch.my14.remote &&
 	test_must_fail git config branch.my14.merge
 '
 
 test_expect_success 'disabled option --set-upstream fails' '
-	test_must_fail git branch --set-upstream origin/master
+	test_must_fail git branch --set-upstream origin/main
 '
 
 test_expect_success '--set-upstream-to notices an error to set branch as own upstream' '
@@ -959,32 +959,32 @@ test_expect_success '--set-upstream-to notices an error to set branch as own ups
 
 # Keep this test last, as it changes the current branch
 cat >expect <<EOF
-$ZERO_OID $HEAD $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> 1117150200 +0000	branch: Created from master
+$ZERO_OID $HEAD $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> 1117150200 +0000	branch: Created from main
 EOF
 test_expect_success 'git checkout -b g/h/i -l should create a branch and a log' '
 	GIT_COMMITTER_DATE="2005-05-26 23:30" \
-	git checkout -b g/h/i -l master &&
+	git checkout -b g/h/i -l main &&
 	test_path_is_file .git/refs/heads/g/h/i &&
 	test_path_is_file .git/logs/refs/heads/g/h/i &&
 	test_cmp expect .git/logs/refs/heads/g/h/i
 '
 
 test_expect_success 'checkout -b makes reflog by default' '
-	git checkout master &&
+	git checkout main &&
 	git config --unset core.logAllRefUpdates &&
 	git checkout -b alpha &&
 	git rev-parse --verify alpha@{0}
 '
 
 test_expect_success 'checkout -b does not make reflog when core.logAllRefUpdates = false' '
-	git checkout master &&
+	git checkout main &&
 	git config core.logAllRefUpdates false &&
 	git checkout -b beta &&
 	test_must_fail git rev-parse --verify beta@{0}
 '
 
 test_expect_success 'checkout -b with -l makes reflog when core.logAllRefUpdates = false' '
-	git checkout master &&
+	git checkout main &&
 	git checkout -lb gamma &&
 	git config --unset core.logAllRefUpdates &&
 	git rev-parse --verify gamma@{0}
@@ -993,10 +993,10 @@ test_expect_success 'checkout -b with -l makes reflog when core.logAllRefUpdates
 test_expect_success 'avoid ambiguous track' '
 	git config branch.autosetupmerge true &&
 	git config remote.ambi1.url lalala &&
-	git config remote.ambi1.fetch refs/heads/lalala:refs/heads/master &&
+	git config remote.ambi1.fetch refs/heads/lalala:refs/heads/main &&
 	git config remote.ambi2.url lilili &&
-	git config remote.ambi2.fetch refs/heads/lilili:refs/heads/master &&
-	test_must_fail git branch all1 master &&
+	git config remote.ambi2.fetch refs/heads/lilili:refs/heads/main &&
+	test_must_fail git branch all1 main &&
 	test -z "$(git config branch.all1.merge)"
 '
 
@@ -1052,10 +1052,10 @@ test_expect_success 'autosetuprebase local on a tracked remote branch' '
 	git config remote.local.url . &&
 	git config remote.local.fetch refs/heads/*:refs/remotes/local/* &&
 	git config branch.autosetuprebase local &&
-	(git show-ref -q refs/remotes/local/master || git fetch local) &&
-	git branch --track myr5 local/master &&
+	(git show-ref -q refs/remotes/local/main || git fetch local) &&
+	git branch --track myr5 local/main &&
 	test "$(git config branch.myr5.remote)" = local &&
-	test "$(git config branch.myr5.merge)" = refs/heads/master &&
+	test "$(git config branch.myr5.merge)" = refs/heads/main &&
 	! test "$(git config branch.myr5.rebase)" = true
 '
 
@@ -1063,10 +1063,10 @@ test_expect_success 'autosetuprebase never on a tracked remote branch' '
 	git config remote.local.url . &&
 	git config remote.local.fetch refs/heads/*:refs/remotes/local/* &&
 	git config branch.autosetuprebase never &&
-	(git show-ref -q refs/remotes/local/master || git fetch local) &&
-	git branch --track myr6 local/master &&
+	(git show-ref -q refs/remotes/local/main || git fetch local) &&
+	git branch --track myr6 local/main &&
 	test "$(git config branch.myr6.remote)" = local &&
-	test "$(git config branch.myr6.merge)" = refs/heads/master &&
+	test "$(git config branch.myr6.merge)" = refs/heads/main &&
 	! test "$(git config branch.myr6.rebase)" = true
 '
 
@@ -1074,10 +1074,10 @@ test_expect_success 'autosetuprebase remote on a tracked remote branch' '
 	git config remote.local.url . &&
 	git config remote.local.fetch refs/heads/*:refs/remotes/local/* &&
 	git config branch.autosetuprebase remote &&
-	(git show-ref -q refs/remotes/local/master || git fetch local) &&
-	git branch --track myr7 local/master &&
+	(git show-ref -q refs/remotes/local/main || git fetch local) &&
+	git branch --track myr7 local/main &&
 	test "$(git config branch.myr7.remote)" = local &&
-	test "$(git config branch.myr7.merge)" = refs/heads/master &&
+	test "$(git config branch.myr7.merge)" = refs/heads/main &&
 	test "$(git config branch.myr7.rebase)" = true
 '
 
@@ -1085,10 +1085,10 @@ test_expect_success 'autosetuprebase always on a tracked remote branch' '
 	git config remote.local.url . &&
 	git config remote.local.fetch refs/heads/*:refs/remotes/local/* &&
 	git config branch.autosetuprebase remote &&
-	(git show-ref -q refs/remotes/local/master || git fetch local) &&
-	git branch --track myr8 local/master &&
+	(git show-ref -q refs/remotes/local/main || git fetch local) &&
+	git branch --track myr8 local/main &&
 	test "$(git config branch.myr8.remote)" = local &&
-	test "$(git config branch.myr8.merge)" = refs/heads/master &&
+	test "$(git config branch.myr8.merge)" = refs/heads/main &&
 	test "$(git config branch.myr8.rebase)" = true
 '
 
@@ -1096,10 +1096,10 @@ test_expect_success 'autosetuprebase unconfigured on a tracked remote branch' '
 	git config --unset branch.autosetuprebase &&
 	git config remote.local.url . &&
 	git config remote.local.fetch refs/heads/*:refs/remotes/local/* &&
-	(git show-ref -q refs/remotes/local/master || git fetch local) &&
-	git branch --track myr9 local/master &&
+	(git show-ref -q refs/remotes/local/main || git fetch local) &&
+	git branch --track myr9 local/main &&
 	test "$(git config branch.myr9.remote)" = local &&
-	test "$(git config branch.myr9.merge)" = refs/heads/master &&
+	test "$(git config branch.myr9.merge)" = refs/heads/main &&
 	test "z$(git config branch.myr9.rebase)" = z
 '
 
@@ -1117,7 +1117,7 @@ test_expect_success 'autosetuprebase unconfigured on a tracked local branch' '
 test_expect_success 'autosetuprebase unconfigured on untracked local branch' '
 	git config remote.local.url . &&
 	git config remote.local.fetch refs/heads/*:refs/remotes/local/* &&
-	(git show-ref -q refs/remotes/local/master || git fetch local) &&
+	(git show-ref -q refs/remotes/local/main || git fetch local) &&
 	git branch --no-track myr11 mybase2 &&
 	test "z$(git config branch.myr11.remote)" = z &&
 	test "z$(git config branch.myr11.merge)" = z &&
@@ -1127,8 +1127,8 @@ test_expect_success 'autosetuprebase unconfigured on untracked local branch' '
 test_expect_success 'autosetuprebase unconfigured on untracked remote branch' '
 	git config remote.local.url . &&
 	git config remote.local.fetch refs/heads/*:refs/remotes/local/* &&
-	(git show-ref -q refs/remotes/local/master || git fetch local) &&
-	git branch --no-track myr12 local/master &&
+	(git show-ref -q refs/remotes/local/main || git fetch local) &&
+	git branch --no-track myr12 local/main &&
 	test "z$(git config branch.myr12.remote)" = z &&
 	test "z$(git config branch.myr12.merge)" = z &&
 	test "z$(git config branch.myr12.rebase)" = z
@@ -1138,7 +1138,7 @@ test_expect_success 'autosetuprebase never on an untracked local branch' '
 	git config branch.autosetuprebase never &&
 	git config remote.local.url . &&
 	git config remote.local.fetch refs/heads/*:refs/remotes/local/* &&
-	(git show-ref -q refs/remotes/local/master || git fetch local) &&
+	(git show-ref -q refs/remotes/local/main || git fetch local) &&
 	git branch --no-track myr13 mybase2 &&
 	test "z$(git config branch.myr13.remote)" = z &&
 	test "z$(git config branch.myr13.merge)" = z &&
@@ -1149,7 +1149,7 @@ test_expect_success 'autosetuprebase local on an untracked local branch' '
 	git config branch.autosetuprebase local &&
 	git config remote.local.url . &&
 	git config remote.local.fetch refs/heads/*:refs/remotes/local/* &&
-	(git show-ref -q refs/remotes/local/master || git fetch local) &&
+	(git show-ref -q refs/remotes/local/main || git fetch local) &&
 	git branch --no-track myr14 mybase2 &&
 	test "z$(git config branch.myr14.remote)" = z &&
 	test "z$(git config branch.myr14.merge)" = z &&
@@ -1160,7 +1160,7 @@ test_expect_success 'autosetuprebase remote on an untracked local branch' '
 	git config branch.autosetuprebase remote &&
 	git config remote.local.url . &&
 	git config remote.local.fetch refs/heads/*:refs/remotes/local/* &&
-	(git show-ref -q refs/remotes/local/master || git fetch local) &&
+	(git show-ref -q refs/remotes/local/main || git fetch local) &&
 	git branch --no-track myr15 mybase2 &&
 	test "z$(git config branch.myr15.remote)" = z &&
 	test "z$(git config branch.myr15.merge)" = z &&
@@ -1171,7 +1171,7 @@ test_expect_success 'autosetuprebase always on an untracked local branch' '
 	git config branch.autosetuprebase always &&
 	git config remote.local.url . &&
 	git config remote.local.fetch refs/heads/*:refs/remotes/local/* &&
-	(git show-ref -q refs/remotes/local/master || git fetch local) &&
+	(git show-ref -q refs/remotes/local/main || git fetch local) &&
 	git branch --no-track myr16 mybase2 &&
 	test "z$(git config branch.myr16.remote)" = z &&
 	test "z$(git config branch.myr16.merge)" = z &&
@@ -1182,8 +1182,8 @@ test_expect_success 'autosetuprebase never on an untracked remote branch' '
 	git config branch.autosetuprebase never &&
 	git config remote.local.url . &&
 	git config remote.local.fetch refs/heads/*:refs/remotes/local/* &&
-	(git show-ref -q refs/remotes/local/master || git fetch local) &&
-	git branch --no-track myr17 local/master &&
+	(git show-ref -q refs/remotes/local/main || git fetch local) &&
+	git branch --no-track myr17 local/main &&
 	test "z$(git config branch.myr17.remote)" = z &&
 	test "z$(git config branch.myr17.merge)" = z &&
 	test "z$(git config branch.myr17.rebase)" = z
@@ -1193,8 +1193,8 @@ test_expect_success 'autosetuprebase local on an untracked remote branch' '
 	git config branch.autosetuprebase local &&
 	git config remote.local.url . &&
 	git config remote.local.fetch refs/heads/*:refs/remotes/local/* &&
-	(git show-ref -q refs/remotes/local/master || git fetch local) &&
-	git branch --no-track myr18 local/master &&
+	(git show-ref -q refs/remotes/local/main || git fetch local) &&
+	git branch --no-track myr18 local/main &&
 	test "z$(git config branch.myr18.remote)" = z &&
 	test "z$(git config branch.myr18.merge)" = z &&
 	test "z$(git config branch.myr18.rebase)" = z
@@ -1204,8 +1204,8 @@ test_expect_success 'autosetuprebase remote on an untracked remote branch' '
 	git config branch.autosetuprebase remote &&
 	git config remote.local.url . &&
 	git config remote.local.fetch refs/heads/*:refs/remotes/local/* &&
-	(git show-ref -q refs/remotes/local/master || git fetch local) &&
-	git branch --no-track myr19 local/master &&
+	(git show-ref -q refs/remotes/local/main || git fetch local) &&
+	git branch --no-track myr19 local/main &&
 	test "z$(git config branch.myr19.remote)" = z &&
 	test "z$(git config branch.myr19.merge)" = z &&
 	test "z$(git config branch.myr19.rebase)" = z
@@ -1215,8 +1215,8 @@ test_expect_success 'autosetuprebase always on an untracked remote branch' '
 	git config branch.autosetuprebase always &&
 	git config remote.local.url . &&
 	git config remote.local.fetch refs/heads/*:refs/remotes/local/* &&
-	(git show-ref -q refs/remotes/local/master || git fetch local) &&
-	git branch --no-track myr20 local/master &&
+	(git show-ref -q refs/remotes/local/main || git fetch local) &&
+	git branch --no-track myr20 local/main &&
 	test "z$(git config branch.myr20.remote)" = z &&
 	test "z$(git config branch.myr20.merge)" = z &&
 	test "z$(git config branch.myr20.rebase)" = z
@@ -1224,7 +1224,7 @@ test_expect_success 'autosetuprebase always on an untracked remote branch' '
 
 test_expect_success 'autosetuprebase always on detached HEAD' '
 	git config branch.autosetupmerge always &&
-	test_when_finished git checkout master &&
+	test_when_finished git checkout main &&
 	git checkout HEAD^0 &&
 	git branch my11 &&
 	test -z "$(git config branch.my11.remote)" &&
@@ -1252,18 +1252,18 @@ test_expect_success 'attempt to delete a branch without base and unmerged to HEA
 test_expect_success 'attempt to delete a branch merged to its base' '
 	# we are on my9 which is the initial commit; traditionally
 	# we would not have allowed deleting my8 that is not merged
-	# to my9, but it is set to track master that already has my8
-	git config branch.my8.merge refs/heads/master &&
+	# to my9, but it is set to track main that already has my8
+	git config branch.my8.merge refs/heads/main &&
 	git branch -d my8
 '
 
 test_expect_success 'attempt to delete a branch merged to its base' '
-	git checkout master &&
+	git checkout main &&
 	echo Third >>A &&
 	git commit -m "Third commit" A &&
 	git branch -t my10 my9 &&
 	git branch -f my10 HEAD^ &&
-	# we are on master which is at the third commit, and my10
+	# we are on main which is at the third commit, and my10
 	# is behind us, so traditionally we would have allowed deleting
 	# it; but my10 is set to track my9 that is further behind.
 	test_must_fail git branch -d my10
@@ -1290,7 +1290,7 @@ test_expect_success 'detect typo in branch name when using --edit-description' '
 '
 
 test_expect_success 'refuse --edit-description on unborn branch for now' '
-	test_when_finished "git checkout master" &&
+	test_when_finished "git checkout main" &&
 	write_script editor <<-\EOF &&
 		echo "New contents" >"$1"
 	EOF
@@ -1304,18 +1304,18 @@ test_expect_success '--merged catches invalid object names' '
 
 test_expect_success '--list during rebase' '
 	test_when_finished "reset_rebase" &&
-	git checkout master &&
+	git checkout main &&
 	FAKE_LINES="1 edit 2" &&
 	export FAKE_LINES &&
 	set_fake_editor &&
 	git rebase -i HEAD~2 &&
 	git branch --list >actual &&
-	test_i18ngrep "rebasing master" actual
+	test_i18ngrep "rebasing main" actual
 '
 
 test_expect_success '--list during rebase from detached HEAD' '
-	test_when_finished "reset_rebase && git checkout master" &&
-	git checkout master^0 &&
+	test_when_finished "reset_rebase && git checkout main" &&
+	git checkout main^0 &&
 	oid=$(git rev-parse --short HEAD) &&
 	FAKE_LINES="1 edit 2" &&
 	export FAKE_LINES &&
@@ -1351,11 +1351,11 @@ test_expect_success 'tracking with unexpected .fetch refspec' '
 		git remote add c ../c &&
 		git config remote.c.fetch "+refs/remotes/*:refs/remotes/*" &&
 		git fetch c &&
-		git branch --track local/a/master remotes/a/master &&
-		test "$(git config branch.local/a/master.remote)" = "c" &&
-		test "$(git config branch.local/a/master.merge)" = "refs/remotes/a/master" &&
+		git branch --track local/a/main remotes/a/main &&
+		test "$(git config branch.local/a/main.remote)" = "c" &&
+		test "$(git config branch.local/a/main.merge)" = "refs/remotes/a/main" &&
 		git rev-parse --verify a >expect &&
-		git rev-parse --verify local/a/master >actual &&
+		git rev-parse --verify local/a/main >actual &&
 		test_cmp expect actual
 	)
 '
@@ -1374,7 +1374,7 @@ test_expect_success 'configured committerdate sort' '
 		test_commit b &&
 		git branch >actual &&
 		cat >expect <<-\EOF &&
-		  master
+		  main
 		  a
 		  c
 		* b
@@ -1392,7 +1392,7 @@ test_expect_success 'option override configured sort' '
 		  a
 		* b
 		  c
-		  master
+		  main
 		EOF
 		test_cmp expect actual
 	)
diff --git a/t/t3201-branch-contains.sh b/t/t3201-branch-contains.sh
index 532cdbe9ae..8e626afbb9 100755
--- a/t/t3201-branch-contains.sh
+++ b/t/t3201-branch-contains.sh
@@ -2,7 +2,7 @@
 
 test_description='branch --contains <commit>, --no-contains <commit> --merged, and --no-merged'
 
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -17,47 +17,47 @@ test_expect_success setup '
 
 	echo 1 >file &&
 	test_tick &&
-	git commit -a -m "second on master" &&
+	git commit -a -m "second on main" &&
 
 	git checkout side &&
 	echo 1 >file &&
 	test_tick &&
 	git commit -a -m "second on side" &&
 
-	git merge master
+	git merge main
 
 '
 
-test_expect_success 'branch --contains=master' '
+test_expect_success 'branch --contains=main' '
 
-	git branch --contains=master >actual &&
+	git branch --contains=main >actual &&
 	{
-		echo "  master" && echo "* side"
+		echo "  main" && echo "* side"
 	} >expect &&
 	test_cmp expect actual
 
 '
 
-test_expect_success 'branch --contains master' '
+test_expect_success 'branch --contains main' '
 
-	git branch --contains master >actual &&
+	git branch --contains main >actual &&
 	{
-		echo "  master" && echo "* side"
+		echo "  main" && echo "* side"
 	} >expect &&
 	test_cmp expect actual
 
 '
 
-test_expect_success 'branch --no-contains=master' '
+test_expect_success 'branch --no-contains=main' '
 
-	git branch --no-contains=master >actual &&
+	git branch --no-contains=main >actual &&
 	test_must_be_empty actual
 
 '
 
-test_expect_success 'branch --no-contains master' '
+test_expect_success 'branch --no-contains main' '
 
-	git branch --no-contains master >actual &&
+	git branch --no-contains main >actual &&
 	test_must_be_empty actual
 
 '
@@ -76,7 +76,7 @@ test_expect_success 'branch --no-contains=side' '
 
 	git branch --no-contains=side >actual &&
 	{
-		echo "  master"
+		echo "  main"
 	} >expect &&
 	test_cmp expect actual
 
@@ -84,9 +84,9 @@ test_expect_success 'branch --no-contains=side' '
 
 test_expect_success 'branch --contains with pattern implies --list' '
 
-	git branch --contains=master master >actual &&
+	git branch --contains=main main >actual &&
 	{
-		echo "  master"
+		echo "  main"
 	} >expect &&
 	test_cmp expect actual
 
@@ -94,7 +94,7 @@ test_expect_success 'branch --contains with pattern implies --list' '
 
 test_expect_success 'branch --no-contains with pattern implies --list' '
 
-	git branch --no-contains=master master >actual &&
+	git branch --no-contains=main main >actual &&
 	test_must_be_empty actual
 
 '
@@ -103,7 +103,7 @@ test_expect_success 'side: branch --merged' '
 
 	git branch --merged >actual &&
 	{
-		echo "  master" &&
+		echo "  main" &&
 		echo "* side"
 	} >expect &&
 	test_cmp expect actual
@@ -112,9 +112,9 @@ test_expect_success 'side: branch --merged' '
 
 test_expect_success 'branch --merged with pattern implies --list' '
 
-	git branch --merged=side master >actual &&
+	git branch --merged=side main >actual &&
 	{
-		echo "  master"
+		echo "  main"
 	} >expect &&
 	test_cmp expect actual
 
@@ -127,18 +127,18 @@ test_expect_success 'side: branch --no-merged' '
 
 '
 
-test_expect_success 'master: branch --merged' '
+test_expect_success 'main: branch --merged' '
 
-	git checkout master &&
+	git checkout main &&
 	git branch --merged >actual &&
 	{
-		echo "* master"
+		echo "* main"
 	} >expect &&
 	test_cmp expect actual
 
 '
 
-test_expect_success 'master: branch --no-merged' '
+test_expect_success 'main: branch --no-merged' '
 
 	git branch --no-merged >actual &&
 	{
@@ -150,22 +150,22 @@ test_expect_success 'master: branch --no-merged' '
 
 test_expect_success 'branch --no-merged with pattern implies --list' '
 
-	git branch --no-merged=master master >actual &&
+	git branch --no-merged=main main >actual &&
 	test_must_be_empty actual
 
 '
 
 test_expect_success 'implicit --list conflicts with modification options' '
 
-	test_must_fail git branch --contains=master -d &&
-	test_must_fail git branch --contains=master -m foo &&
-	test_must_fail git branch --no-contains=master -d &&
-	test_must_fail git branch --no-contains=master -m foo
+	test_must_fail git branch --contains=main -d &&
+	test_must_fail git branch --contains=main -m foo &&
+	test_must_fail git branch --no-contains=main -d &&
+	test_must_fail git branch --no-contains=main -m foo
 
 '
 
 test_expect_success 'Assert that --contains only works on commits, not trees & blobs' '
-	test_must_fail git branch --contains master^{tree} &&
+	test_must_fail git branch --contains main^{tree} &&
 	blob=$(git hash-object -w --stdin <<-\EOF
 	Some blob
 	EOF
@@ -175,11 +175,11 @@ test_expect_success 'Assert that --contains only works on commits, not trees & b
 '
 
 test_expect_success 'multiple branch --contains' '
-	git checkout -b side2 master &&
+	git checkout -b side2 main &&
 	>feature &&
 	git add feature &&
 	git commit -m "add feature" &&
-	git checkout -b next master &&
+	git checkout -b next main &&
 	git merge side &&
 	git branch --contains side --contains side2 >actual &&
 	cat >expect <<-\EOF &&
@@ -191,9 +191,9 @@ test_expect_success 'multiple branch --contains' '
 '
 
 test_expect_success 'multiple branch --merged' '
-	git branch --merged next --merged master >actual &&
+	git branch --merged next --merged main >actual &&
 	cat >expect <<-\EOF &&
-	  master
+	  main
 	* next
 	  side
 	EOF
@@ -203,13 +203,13 @@ test_expect_success 'multiple branch --merged' '
 test_expect_success 'multiple branch --no-contains' '
 	git branch --no-contains side --no-contains side2 >actual &&
 	cat >expect <<-\EOF &&
-	  master
+	  main
 	EOF
 	test_cmp expect actual
 '
 
 test_expect_success 'multiple branch --no-merged' '
-	git branch --no-merged next --no-merged master >actual &&
+	git branch --no-merged next --no-merged main >actual &&
 	cat >expect <<-\EOF &&
 	  side2
 	EOF
@@ -217,7 +217,7 @@ test_expect_success 'multiple branch --no-merged' '
 '
 
 test_expect_success 'branch --contains combined with --no-contains' '
-	git checkout -b seen master &&
+	git checkout -b seen main &&
 	git merge side &&
 	git merge side2 &&
 	git branch --contains side --no-contains side2 >actual &&
@@ -242,17 +242,17 @@ test_expect_success 'branch --merged combined with --no-merged' '
 # that the latter walk does not mess up our flag to see if it was
 # merged).
 #
-# Here "topic" tracks "master" with one extra commit, and "zzz" points to the
-# same tip as master The name "zzz" must come alphabetically after "topic"
+# Here "topic" tracks "main" with one extra commit, and "zzz" points to the
+# same tip as main The name "zzz" must come alphabetically after "topic"
 # as we process them in that order.
 test_expect_success PREPARE_FOR_MAIN_BRANCH 'branch --merged with --verbose' '
-	git branch --track topic master &&
+	git branch --track topic main &&
 	git branch zzz topic &&
 	git checkout topic &&
 	test_commit foo &&
 	git branch --merged topic >actual &&
 	cat >expect <<-\EOF &&
-	  master
+	  main
 	* topic
 	  zzz
 	EOF
diff --git a/t/t3202-show-branch-octopus.sh b/t/t3202-show-branch-octopus.sh
index bbf7129dd8..5cb0126cfe 100755
--- a/t/t3202-show-branch-octopus.sh
+++ b/t/t3202-show-branch-octopus.sh
@@ -2,7 +2,7 @@
 
 test_description='test show-branch with more than 8 heads'
 
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -18,7 +18,7 @@ test_expect_success 'setup' '
 
 	for i in $numbers
 	do
-		git checkout -b branch$i master &&
+		git checkout -b branch$i main &&
 		> file$i &&
 		git add file$i &&
 		test_tick &&
diff --git a/t/t3203-branch-output.sh b/t/t3203-branch-output.sh
index a2144dd8e5..a7d2edd988 100755
--- a/t/t3203-branch-output.sh
+++ b/t/t3203-branch-output.sh
@@ -1,7 +1,7 @@
 #!/bin/sh
 
 test_description='git branch display tests'
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -29,7 +29,7 @@ test_expect_success 'make remote branches' '
 cat >expect <<'EOF'
   branch-one
   branch-two
-* master
+* main
 EOF
 test_expect_success 'git branch shows local branches' '
 	git branch >actual &&
@@ -63,7 +63,7 @@ test_expect_success 'git branch -r shows remote branches' '
 cat >expect <<'EOF'
   branch-one
   branch-two
-* master
+* main
   remotes/origin/HEAD -> origin/branch-one
   remotes/origin/branch-one
   remotes/origin/branch-two
@@ -155,7 +155,7 @@ test_expect_success 'git branch shows detached HEAD properly' '
 * (HEAD detached at $(git rev-parse --short HEAD^0))
   branch-one
   branch-two
-  master
+  main
 EOF
 	git checkout HEAD^0 &&
 	git branch >actual &&
@@ -163,12 +163,12 @@ EOF
 '
 
 test_expect_success 'git branch shows detached HEAD properly after checkout --detach' '
-	git checkout master &&
+	git checkout main &&
 	cat >expect <<EOF &&
 * (HEAD detached at $(git rev-parse --short HEAD^0))
   branch-one
   branch-two
-  master
+  main
 EOF
 	git checkout --detach &&
 	git branch >actual &&
@@ -180,7 +180,7 @@ test_expect_success 'git branch shows detached HEAD properly after moving' '
 * (HEAD detached from $(git rev-parse --short HEAD))
   branch-one
   branch-two
-  master
+  main
 EOF
 	git reset --hard HEAD^1 &&
 	git branch >actual &&
@@ -192,9 +192,9 @@ test_expect_success 'git branch shows detached HEAD properly from tag' '
 * (HEAD detached at fromtag)
   branch-one
   branch-two
-  master
+  main
 EOF
-	git tag fromtag master &&
+	git tag fromtag main &&
 	git checkout fromtag &&
 	git branch >actual &&
 	test_i18ncmp expect actual
@@ -205,7 +205,7 @@ test_expect_success 'git branch shows detached HEAD properly after moving from t
 * (HEAD detached from fromtag)
   branch-one
   branch-two
-  master
+  main
 EOF
 	git reset --hard HEAD^1 &&
 	git branch >actual &&
@@ -217,7 +217,7 @@ test_expect_success 'git branch `--sort` option' '
 	* (HEAD detached from fromtag)
 	  branch-two
 	  branch-one
-	  master
+	  main
 	EOF
 	git branch --sort=objectsize >actual &&
 	test_i18ncmp expect actual
@@ -226,7 +226,7 @@ test_expect_success 'git branch `--sort` option' '
 test_expect_success 'git branch --points-at option' '
 	cat >expect <<-\EOF &&
 	  branch-one
-	  master
+	  main
 	EOF
 	git branch --points-at=branch-one >actual &&
 	test_cmp expect actual
@@ -263,14 +263,14 @@ test_expect_success 'sort branches, ignore case' '
 		cat >expected <<-\EOF &&
 		BRANCH-two
 		branch-one
-		master
+		main
 		EOF
 		test_cmp expected actual &&
 		git branch --list -i | awk "{print \$NF}" >actual &&
 		cat >expected <<-\EOF &&
 		branch-one
 		BRANCH-two
-		master
+		main
 		EOF
 		test_cmp expected actual
 	)
@@ -282,7 +282,7 @@ test_expect_success 'git branch --format option' '
 	Refname is refs/heads/ambiguous
 	Refname is refs/heads/branch-one
 	Refname is refs/heads/branch-two
-	Refname is refs/heads/master
+	Refname is refs/heads/main
 	Refname is refs/heads/ref-to-branch
 	Refname is refs/heads/ref-to-remote
 	EOF
@@ -296,7 +296,7 @@ test_expect_success 'worktree colors correct' '
 	  ambiguous<RESET>
 	  branch-one<RESET>
 	+ <CYAN>branch-two<RESET>
-	  master<RESET>
+	  main<RESET>
 	  ref-to-branch<RESET> -> branch-one
 	  ref-to-remote<RESET> -> origin/branch-one
 	EOF
@@ -309,9 +309,9 @@ test_expect_success 'worktree colors correct' '
 '
 
 test_expect_success "set up color tests" '
-	echo "<RED>master<RESET>" >expect.color &&
-	echo "master" >expect.bare &&
-	color_args="--format=%(color:red)%(refname:short) --list master"
+	echo "<RED>main<RESET>" >expect.color &&
+	echo "main" >expect.bare &&
+	color_args="--format=%(color:red)%(refname:short) --list main"
 '
 
 test_expect_success '%(color) omitted without tty' '
@@ -334,7 +334,7 @@ test_expect_success '--color overrides auto-color' '
 
 test_expect_success PREPARE_FOR_MAIN_BRANCH 'verbose output lists worktree path' '
 	one=$(git rev-parse --short HEAD) &&
-	two=$(git rev-parse --short master) &&
+	two=$(git rev-parse --short main) &&
 	cat >expect <<-EOF &&
 	* (HEAD detached from fromtag) $one one
 	  ambiguous                    $one one
diff --git a/t/t3204-branch-name-interpretation.sh b/t/t3204-branch-name-interpretation.sh
index dd315ebf04..993a6b5eff 100755
--- a/t/t3204-branch-name-interpretation.sh
+++ b/t/t3204-branch-name-interpretation.sh
@@ -6,7 +6,7 @@ Branch name arguments are usually names which are taken to be inside of
 refs/heads/, but we interpret some magic syntax like @{-1}, @{upstream}, etc.
 This script aims to check the behavior of those corner cases.
 '
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -31,7 +31,7 @@ test_expect_success 'update branch via @{-1}' '
 	git branch previous one &&
 
 	git checkout previous &&
-	git checkout master &&
+	git checkout main &&
 
 	git branch -f @{-1} two &&
 	expect_branch previous two
@@ -61,7 +61,7 @@ test_expect_success 'delete branch via @{-1}' '
 	git branch previous-del &&
 
 	git checkout previous-del &&
-	git checkout master &&
+	git checkout main &&
 
 	git branch -D @{-1} &&
 	expect_deleted previous-del
@@ -101,7 +101,7 @@ test_expect_success 'disallow deleting remote branch via @{-1}' '
 	git update-ref refs/remotes/origin/previous one &&
 
 	git checkout -b origin/previous two &&
-	git checkout master &&
+	git checkout main &&
 
 	test_must_fail git branch -r -D @{-1} &&
 	expect_branch refs/remotes/origin/previous one &&
diff --git a/t/t3205-branch-color.sh b/t/t3205-branch-color.sh
index 8b54a9252b..b905dc4867 100755
--- a/t/t3205-branch-color.sh
+++ b/t/t3205-branch-color.sh
@@ -1,14 +1,14 @@
 #!/bin/sh
 
 test_description='basic branch output coloring'
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
 
 test_expect_success 'set up some sample branches' '
 	test_commit foo &&
-	git update-ref refs/remotes/origin/master HEAD &&
+	git update-ref refs/remotes/origin/main HEAD &&
 	git update-ref refs/heads/other HEAD
 '
 
@@ -22,9 +22,9 @@ test_expect_success 'set up some color config' '
 
 test_expect_success 'regular output shows colors' '
 	cat >expect <<-\EOF &&
-	* <CYAN>master<RESET>
+	* <CYAN>main<RESET>
 	  <BLUE>other<RESET>
-	  <YELLOW>remotes/origin/master<RESET>
+	  <YELLOW>remotes/origin/main<RESET>
 	EOF
 	git branch --color -a >actual.raw &&
 	test_decode_color <actual.raw >actual &&
diff --git a/t/t3206-range-diff.sh b/t/t3206-range-diff.sh
index 3813ddc85e..ce24b5d735 100755
--- a/t/t3206-range-diff.sh
+++ b/t/t3206-range-diff.sh
@@ -2,7 +2,7 @@
 
 test_description='range-diff tests'
 
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -130,7 +130,7 @@ test_expect_success 'setup' '
 '
 
 test_expect_success 'simple A..B A..C (unmodified)' '
-	git range-diff --no-color master..topic master..unmodified \
+	git range-diff --no-color main..topic main..unmodified \
 		>actual &&
 	cat >expect <<-EOF &&
 	1:  $(test_oid t1) = 1:  $(test_oid u1) s/5/A/
@@ -148,13 +148,13 @@ test_expect_success 'simple B...C (unmodified)' '
 '
 
 test_expect_success 'simple A B C (unmodified)' '
-	git range-diff --no-color master topic unmodified >actual &&
+	git range-diff --no-color main topic unmodified >actual &&
 	# same "expect" as above
 	test_cmp expect actual
 '
 
 test_expect_success 'trivial reordering' '
-	git range-diff --no-color master topic reordered >actual &&
+	git range-diff --no-color main topic reordered >actual &&
 	cat >expect <<-EOF &&
 	1:  $(test_oid t1) = 1:  $(test_oid r1) s/5/A/
 	3:  $(test_oid t3) = 2:  $(test_oid r2) s/11/B/
@@ -165,7 +165,7 @@ test_expect_success 'trivial reordering' '
 '
 
 test_expect_success 'removed a commit' '
-	git range-diff --no-color master topic removed >actual &&
+	git range-diff --no-color main topic removed >actual &&
 	cat >expect <<-EOF &&
 	1:  $(test_oid t1) = 1:  $(test_oid d1) s/5/A/
 	2:  $(test_oid t2) < -:  $(test_oid __) s/4/A/
@@ -176,7 +176,7 @@ test_expect_success 'removed a commit' '
 '
 
 test_expect_success 'added a commit' '
-	git range-diff --no-color master topic added >actual &&
+	git range-diff --no-color main topic added >actual &&
 	cat >expect <<-EOF &&
 	1:  $(test_oid t1) = 1:  $(test_oid a1) s/5/A/
 	2:  $(test_oid t2) = 2:  $(test_oid a2) s/4/A/
@@ -188,7 +188,7 @@ test_expect_success 'added a commit' '
 '
 
 test_expect_success 'new base, A B C' '
-	git range-diff --no-color master topic rebased >actual &&
+	git range-diff --no-color main topic rebased >actual &&
 	cat >expect <<-EOF &&
 	1:  $(test_oid t1) = 1:  $(test_oid b1) s/5/A/
 	2:  $(test_oid t2) = 2:  $(test_oid b2) s/4/A/
@@ -199,7 +199,7 @@ test_expect_success 'new base, A B C' '
 '
 
 test_expect_success 'new base, B...C' '
-	# this syntax includes the commits from master!
+	# this syntax includes the commits from main!
 	git range-diff --no-color topic...rebased >actual &&
 	cat >expect <<-EOF &&
 	-:  $(test_oid __) > 1:  $(test_oid b5) unrelated
@@ -423,7 +423,7 @@ test_expect_success 'file added and later removed' '
 
 test_expect_success 'no commits on one side' '
 	git commit --amend -m "new message" &&
-	git range-diff master HEAD@{1} HEAD
+	git range-diff main HEAD@{1} HEAD
 '
 
 test_expect_success 'changed message' '
@@ -485,11 +485,11 @@ test_expect_success 'dual-coloring' '
 	test_cmp expect actual
 '
 
-for prev in topic master..topic
+for prev in topic main..topic
 do
 	test_expect_success "format-patch --range-diff=$prev" '
 		git format-patch --cover-letter --range-diff=$prev \
-			master..unmodified >actual &&
+			main..unmodified >actual &&
 		test_when_finished "rm 000?-*" &&
 		test_line_count = 5 actual &&
 		test_i18ngrep "^Range-diff:$" 0000-* &&
@@ -514,19 +514,19 @@ test_expect_success 'range-diff overrides diff.noprefix internally' '
 
 test_expect_success 'basic with modified format.pretty with suffix' '
 	git -c format.pretty="format:commit %H%d%n" range-diff \
-		master..topic master..unmodified
+		main..topic main..unmodified
 '
 
 test_expect_success 'basic with modified format.pretty without "commit "' '
 	git -c format.pretty="format:%H%n" range-diff \
-		master..topic master..unmodified
+		main..topic main..unmodified
 '
 
 test_expect_success 'range-diff compares notes by default' '
 	git notes add -m "topic note" topic &&
 	git notes add -m "unmodified note" unmodified &&
 	test_when_finished git notes remove topic unmodified &&
-	git range-diff --no-color master..topic master..unmodified \
+	git range-diff --no-color main..topic main..unmodified \
 		>actual &&
 	sed s/Z/\ /g >expect <<-EOF &&
 	1:  $(test_oid t1) = 1:  $(test_oid u1) s/5/A/
@@ -550,7 +550,7 @@ test_expect_success 'range-diff with --no-notes' '
 	git notes add -m "topic note" topic &&
 	git notes add -m "unmodified note" unmodified &&
 	test_when_finished git notes remove topic unmodified &&
-	git range-diff --no-color --no-notes master..topic master..unmodified \
+	git range-diff --no-color --no-notes main..topic main..unmodified \
 		>actual &&
 	cat >expect <<-EOF &&
 	1:  $(test_oid t1) = 1:  $(test_oid u1) s/5/A/
@@ -568,7 +568,7 @@ test_expect_success 'range-diff with multiple --notes' '
 	git notes --ref=note2 add -m "topic note2" topic &&
 	git notes --ref=note2 add -m "unmodified note2" unmodified &&
 	test_when_finished git notes --ref=note2 remove topic unmodified &&
-	git range-diff --no-color --notes=note1 --notes=note2 master..topic master..unmodified \
+	git range-diff --no-color --notes=note1 --notes=note2 main..topic main..unmodified \
 		>actual &&
 	sed s/Z/\ /g >expect <<-EOF &&
 	1:  $(test_oid t1) = 1:  $(test_oid u1) s/5/A/
@@ -598,7 +598,7 @@ test_expect_success 'format-patch --range-diff does not compare notes by default
 	git notes add -m "unmodified note" unmodified &&
 	test_when_finished git notes remove topic unmodified &&
 	git format-patch --cover-letter --range-diff=$prev \
-		master..unmodified >actual &&
+		main..unmodified >actual &&
 	test_when_finished "rm 000?-*" &&
 	test_line_count = 5 actual &&
 	test_i18ngrep "^Range-diff:$" 0000-* &&
@@ -615,7 +615,7 @@ test_expect_success 'format-patch --range-diff with --no-notes' '
 	git notes add -m "unmodified note" unmodified &&
 	test_when_finished git notes remove topic unmodified &&
 	git format-patch --no-notes --cover-letter --range-diff=$prev \
-		master..unmodified >actual &&
+		main..unmodified >actual &&
 	test_when_finished "rm 000?-*" &&
 	test_line_count = 5 actual &&
 	test_i18ngrep "^Range-diff:$" 0000-* &&
@@ -632,7 +632,7 @@ test_expect_success 'format-patch --range-diff with --notes' '
 	git notes add -m "unmodified note" unmodified &&
 	test_when_finished git notes remove topic unmodified &&
 	git format-patch --notes --cover-letter --range-diff=$prev \
-		master..unmodified >actual &&
+		main..unmodified >actual &&
 	test_when_finished "rm 000?-*" &&
 	test_line_count = 5 actual &&
 	test_i18ngrep "^Range-diff:$" 0000-* &&
@@ -661,7 +661,7 @@ test_expect_success 'format-patch --range-diff with format.notes config' '
 	test_when_finished git notes remove topic unmodified &&
 	test_config format.notes true &&
 	git format-patch --cover-letter --range-diff=$prev \
-		master..unmodified >actual &&
+		main..unmodified >actual &&
 	test_when_finished "rm 000?-*" &&
 	test_line_count = 5 actual &&
 	test_i18ngrep "^Range-diff:$" 0000-* &&
@@ -692,7 +692,7 @@ test_expect_success 'format-patch --range-diff with multiple notes' '
 	git notes --ref=note2 add -m "unmodified note2" unmodified &&
 	test_when_finished git notes --ref=note2 remove topic unmodified &&
 	git format-patch --notes=note1 --notes=note2 --cover-letter --range-diff=$prev \
-		master..unmodified >actual &&
+		main..unmodified >actual &&
 	test_when_finished "rm 000?-*" &&
 	test_line_count = 5 actual &&
 	test_i18ngrep "^Range-diff:$" 0000-* &&
diff --git a/t/t3206/history.export b/t/t3206/history.export
index 4c808e5b3b..4485adc37b 100644
--- a/t/t3206/history.export
+++ b/t/t3206/history.export
@@ -168,7 +168,7 @@ mark :11
 data 10
 unrelated
 
-commit refs/heads/master
+commit refs/heads/main
 mark :12
 author Thomas Rast <trast@inf.ethz.ch> 1374485127 +0200
 committer Thomas Rast <trast@inf.ethz.ch> 1374485127 +0200
diff --git a/t/t3210-pack-refs.sh b/t/t3210-pack-refs.sh
index 90eea19564..3b7cdc56ec 100755
--- a/t/t3210-pack-refs.sh
+++ b/t/t3210-pack-refs.sh
@@ -9,7 +9,7 @@ test_description='git pack-refs should not change the branch semantic
 This test runs git pack-refs and git show-ref and checks that the branch
 semantic is still the same.
 '
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -138,7 +138,7 @@ test_expect_success 'delete ref with dangling packed version' '
 	git commit --allow-empty -m "future garbage" &&
 	git pack-refs --all &&
 	git reset --hard HEAD^ &&
-	git checkout master &&
+	git checkout main &&
 	git reflog expire --expire=all --all &&
 	git prune --expire=all &&
 	git branch -d lamb 2>result &&
@@ -243,7 +243,7 @@ test_expect_success 'retry acquiring packed-refs.lock' '
 
 test_expect_success SYMLINKS 'pack symlinked packed-refs' '
 	# First make sure that symlinking works when reading:
-	git update-ref refs/heads/lossy refs/heads/master &&
+	git update-ref refs/heads/lossy refs/heads/main &&
 	git for-each-ref >all-refs-before &&
 	mv .git/packed-refs .git/my-deviant-packed-refs &&
 	ln -s my-deviant-packed-refs .git/packed-refs &&
diff --git a/t/t3211-peel-ref.sh b/t/t3211-peel-ref.sh
index f3d9c6b6b6..37b9d26f4b 100755
--- a/t/t3211-peel-ref.sh
+++ b/t/t3211-peel-ref.sh
@@ -1,7 +1,7 @@
 #!/bin/sh
 
 test_description='tests for the peel_ref optimization of packed-refs'
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -22,7 +22,7 @@ print_ref() {
 
 test_expect_success 'set up expected show-ref output' '
 	{
-		print_ref "refs/heads/master" &&
+		print_ref "refs/heads/main" &&
 		print_ref "refs/outside/foo" &&
 		print_ref "refs/outside/foo^{}" &&
 		print_ref "refs/tags/base" &&
@@ -50,7 +50,7 @@ test_expect_success 'create old-style pack-refs without fully-peeled' '
 	# know we are emulating exactly what an older git would have written.
 	{
 		echo "# pack-refs with: peeled " &&
-		print_ref "refs/heads/master" &&
+		print_ref "refs/heads/main" &&
 		print_ref "refs/outside/foo" &&
 		print_ref "refs/tags/base" &&
 		print_ref "refs/tags/foo" &&
diff --git a/t/t3301-notes.sh b/t/t3301-notes.sh
index 8f43303007..2b685580b6 100755
--- a/t/t3301-notes.sh
+++ b/t/t3301-notes.sh
@@ -1295,11 +1295,11 @@ test_expect_success 'git notes copy diagnoses too many or too few parameters' '
 	test_i18ngrep "too many parameters" error
 '
 
-test_expect_success 'git notes get-ref expands refs/heads/master to refs/notes/refs/heads/master' '
+test_expect_success 'git notes get-ref expands refs/heads/main to refs/notes/refs/heads/main' '
 	test_unconfig core.notesRef &&
 	sane_unset GIT_NOTES_REF &&
-	echo refs/notes/refs/heads/master >expect &&
-	git notes --ref=refs/heads/master get-ref >actual &&
+	echo refs/notes/refs/heads/main >expect &&
+	git notes --ref=refs/heads/main get-ref >actual &&
 	test_cmp expect actual
 '
 
diff --git a/t/t3302-notes-index-expensive.sh b/t/t3302-notes-index-expensive.sh
index 1564befe00..ef8b63952e 100755
--- a/t/t3302-notes-index-expensive.sh
+++ b/t/t3302-notes-index-expensive.sh
@@ -5,7 +5,7 @@
 
 test_description='Test commit notes index (expensive!)'
 
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -23,7 +23,7 @@ create_repo () {
 			notemark=$(($mark+1))
 			test_tick &&
 			cat <<-INPUT_END &&
-			commit refs/heads/master
+			commit refs/heads/main
 			mark :$mark
 			committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
 			data <<COMMIT
diff --git a/t/t3303-notes-subtrees.sh b/t/t3303-notes-subtrees.sh
index 16f3438355..d47ce00f69 100755
--- a/t/t3303-notes-subtrees.sh
+++ b/t/t3303-notes-subtrees.sh
@@ -2,7 +2,7 @@
 
 test_description='Test commit notes organized in subtrees'
 
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -43,7 +43,7 @@ test_expect_success "setup: create $number_of_commits commits" '
 			nr=$(($nr+1)) &&
 			test_tick &&
 			cat <<INPUT_END
-commit refs/heads/master
+commit refs/heads/main
 committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
 data <<COMMIT
 commit #$nr
@@ -78,7 +78,7 @@ test_sha1_based () {
 	(
 		start_note_commit &&
 		nr=$number_of_commits &&
-		git rev-list refs/heads/master |
+		git rev-list refs/heads/main |
 		while read sha1; do
 			note_path=$(echo "$sha1" | sed "$1")
 			cat <<INPUT_END &&
@@ -108,7 +108,7 @@ test_same_notes () {
 	(
 		start_note_commit &&
 		nr=$number_of_commits &&
-		git rev-list refs/heads/master |
+		git rev-list refs/heads/main |
 		while read sha1; do
 			first_note_path=$(echo "$sha1" | sed "$1")
 			second_note_path=$(echo "$sha1" | sed "$2")
@@ -147,7 +147,7 @@ test_concatenated_notes () {
 	(
 		start_note_commit &&
 		nr=$number_of_commits &&
-		git rev-list refs/heads/master |
+		git rev-list refs/heads/main |
 		while read sha1; do
 			first_note_path=$(echo "$sha1" | sed "$1")
 			second_note_path=$(echo "$sha1" | sed "$2")
diff --git a/t/t3304-notes-mixed.sh b/t/t3304-notes-mixed.sh
index 6a7b8e2829..03dfcd3954 100755
--- a/t/t3304-notes-mixed.sh
+++ b/t/t3304-notes-mixed.sh
@@ -2,7 +2,7 @@
 
 test_description='Test notes trees that also contain non-notes'
 
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -39,7 +39,7 @@ test_expect_success "setup: create a couple of commits" '
 
 	test_tick &&
 	cat <<INPUT_END >input &&
-commit refs/heads/master
+commit refs/heads/main
 committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
 data <<COMMIT
 commit #1
@@ -54,7 +54,7 @@ INPUT_END
 
 	test_tick &&
 	cat <<INPUT_END >>input &&
-commit refs/heads/master
+commit refs/heads/main
 committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
 data <<COMMIT
 commit #2
@@ -71,8 +71,8 @@ INPUT_END
 
 test_expect_success "create a notes tree with both notes and non-notes" '
 
-	commit1=$(git rev-parse refs/heads/master^) &&
-	commit2=$(git rev-parse refs/heads/master) &&
+	commit1=$(git rev-parse refs/heads/main^) &&
+	commit2=$(git rev-parse refs/heads/main) &&
 	test_tick &&
 	cat <<INPUT_END >input &&
 commit refs/notes/commits
diff --git a/t/t3308-notes-merge.sh b/t/t3308-notes-merge.sh
index d69c84c640..202702be1a 100755
--- a/t/t3308-notes-merge.sh
+++ b/t/t3308-notes-merge.sh
@@ -108,7 +108,7 @@ test_expect_success 'fail to merge into various non-notes refs' '
 	git update-ref refs/notes/dir/foo HEAD &&
 	test_must_fail git -c "core.notesRef=refs/notes/dir" notes merge x &&
 	test_must_fail git -c "core.notesRef=refs/notes/dir/" notes merge x &&
-	test_must_fail git -c "core.notesRef=refs/heads/master" notes merge x &&
+	test_must_fail git -c "core.notesRef=refs/heads/main" notes merge x &&
 	test_must_fail git -c "core.notesRef=refs/notes/y:" notes merge x &&
 	test_must_fail git -c "core.notesRef=refs/notes/y:foo" notes merge x &&
 	test_must_fail git -c "core.notesRef=refs/notes/foo^{bar" notes merge x
diff --git a/t/t3320-notes-merge-worktrees.sh b/t/t3320-notes-merge-worktrees.sh
index f86975414c..052516e6c6 100755
--- a/t/t3320-notes-merge-worktrees.sh
+++ b/t/t3320-notes-merge-worktrees.sh
@@ -5,7 +5,7 @@
 
 test_description='Test merging of notes trees in multiple worktrees'
 
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -39,8 +39,8 @@ test_expect_success 'modify notes ref ourselves (x)' '
 '
 
 test_expect_success 'create some new worktrees' '
-	git worktree add -b newbranch worktree master &&
-	git worktree add -b newbranch2 worktree2 master
+	git worktree add -b newbranch worktree main &&
+	git worktree add -b newbranch2 worktree2 main
 '
 
 test_expect_success 'merge z into y fails and sets NOTES_MERGE_REF' '
-- 
gitgitgadget


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH v3 06/28] t3416: preemptively adjust alignment in a comment
  2020-11-18 23:44   ` [PATCH v3 00/28] tests: use main as default branch name Johannes Schindelin via GitGitGadget
                       ` (4 preceding siblings ...)
  2020-11-18 23:44     ` [PATCH v3 05/28] t3[0-3]*: " Johannes Schindelin via GitGitGadget
@ 2020-11-18 23:44     ` Johannes Schindelin via GitGitGadget
  2020-11-18 23:44     ` [PATCH v3 07/28] t34*: adjust the references to the default branch name "main" Johannes Schindelin via GitGitGadget
                       ` (22 subsequent siblings)
  28 siblings, 0 replies; 163+ messages in thread
From: Johannes Schindelin via GitGitGadget @ 2020-11-18 23:44 UTC (permalink / raw)
  To: git
  Cc: Felipe Contreras, Ævar Arnfjörð Bjarmason,
	Johannes Schindelin, Jeff King, Jonathan Nieder,
	Johannes Schindelin, Johannes Schindelin

From: Johannes Schindelin <johannes.schindelin@gmx.de>

We are about to adjust t3416 for the new default branch name `main`.
This name is two characters shorter and therefore needs two spaces more
padding to align correctly.

Adjusting the alignment before the big search-and-replace makes it
easier to verify that the final result does not leave any misaligned
lines behind.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
---
 t/t3416-rebase-onto-threedots.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/t/t3416-rebase-onto-threedots.sh b/t/t3416-rebase-onto-threedots.sh
index 0f5b814aaf..d0476fbb28 100755
--- a/t/t3416-rebase-onto-threedots.sh
+++ b/t/t3416-rebase-onto-threedots.sh
@@ -15,7 +15,7 @@ export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 #
 #	    F---G topic                             G'
 #	   /                                       /
-# A---B---C---D---E master      -->       A---B---C---D---E
+# A---B---C---D---E master        -->       A---B---C---D---E
 #      \   \ /
 #	\   x
 #	 \ / \
-- 
gitgitgadget


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH v3 07/28] t34*: adjust the references to the default branch name "main"
  2020-11-18 23:44   ` [PATCH v3 00/28] tests: use main as default branch name Johannes Schindelin via GitGitGadget
                       ` (5 preceding siblings ...)
  2020-11-18 23:44     ` [PATCH v3 06/28] t3416: preemptively adjust alignment in a comment Johannes Schindelin via GitGitGadget
@ 2020-11-18 23:44     ` Johannes Schindelin via GitGitGadget
  2020-11-18 23:44     ` [PATCH v3 08/28] t3[5-9]*: " Johannes Schindelin via GitGitGadget
                       ` (21 subsequent siblings)
  28 siblings, 0 replies; 163+ messages in thread
From: Johannes Schindelin via GitGitGadget @ 2020-11-18 23:44 UTC (permalink / raw)
  To: git
  Cc: Felipe Contreras, Ævar Arnfjörð Bjarmason,
	Johannes Schindelin, Jeff King, Jonathan Nieder,
	Johannes Schindelin, Johannes Schindelin

From: Johannes Schindelin <johannes.schindelin@gmx.de>

Carefully excluding t3404, which sees independent development elsewhere
at the time of writing, we use `main` as the default branch name in
t34*. This trick was performed via

	$ (cd t &&
	   sed -i -e 's/master/main/g' -e 's/MASTER/MAIN/g' \
		-e 's/Master/Main/g' -- t34*.sh &&
	   git checkout HEAD -- t34\*)

This allows us to define `GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main`
for those tests.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
---
 t/t3400-rebase.sh                 | 62 +++++++++++++++----------------
 t/t3402-rebase-merge.sh           | 46 +++++++++++------------
 t/t3403-rebase-skip.sh            |  8 ++--
 t/t3405-rebase-malformed.sh       | 10 ++---
 t/t3406-rebase-message.sh         | 26 ++++++-------
 t/t3407-rebase-abort.sh           | 20 +++++-----
 t/t3408-rebase-multi-line.sh      |  4 +-
 t/t3409-rebase-preserve-merges.sh | 12 +++---
 t/t3412-rebase-root.sh            | 30 +++++++--------
 t/t3413-rebase-hook.sh            | 44 +++++++++++-----------
 t/t3415-rebase-autosquash.sh      |  4 +-
 t/t3416-rebase-onto-threedots.sh  | 56 ++++++++++++++--------------
 t/t3418-rebase-continue.sh        | 26 ++++++-------
 t/t3419-rebase-patch-id.sh        | 14 +++----
 t/t3420-rebase-autostash.sh       | 10 ++---
 t/t3423-rebase-reword.sh          |  6 +--
 t/t3427-rebase-subtree.sh         | 22 +++++------
 t/t3430-rebase-merges.sh          | 18 ++++-----
 t/t3431-rebase-fork-point.sh      | 34 ++++++++---------
 t/t3432-rebase-fast-forward.sh    | 36 +++++++++---------
 t/t3434-rebase-i18n.sh            | 10 ++---
 t/t3435-rebase-gpg-sign.sh        |  6 +--
 t/t3436-rebase-more-options.sh    |  2 +-
 23 files changed, 253 insertions(+), 253 deletions(-)

diff --git a/t/t3400-rebase.sh b/t/t3400-rebase.sh
index 61577591d0..5e88a10f8d 100755
--- a/t/t3400-rebase.sh
+++ b/t/t3400-rebase.sh
@@ -8,7 +8,7 @@ test_description='git rebase assorted tests
 This test runs git rebase and checks that the author information is not lost
 among other things.
 '
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -27,15 +27,15 @@ test_expect_success 'prepare repository with topic branches' '
 	git update-index --add Y &&
 	git commit -m "Add Y." &&
 	git checkout -b filemove &&
-	git reset --soft master &&
+	git reset --soft main &&
 	mkdir D &&
 	git mv A D/A &&
 	git commit -m "Move A." &&
-	git checkout -b my-topic-branch master &&
+	git checkout -b my-topic-branch main &&
 	echo Second >B &&
 	git update-index --add B &&
 	git commit -m "Add B." &&
-	git checkout -f master &&
+	git checkout -f main &&
 	echo Third >>A &&
 	git update-index A &&
 	git commit -m "Modify A." &&
@@ -49,23 +49,23 @@ test_expect_success 'prepare repository with topic branches' '
 
 test_expect_success 'rebase on dirty worktree' '
 	echo dirty >>A &&
-	test_must_fail git rebase master
+	test_must_fail git rebase main
 '
 
 test_expect_success 'rebase on dirty cache' '
 	git add A &&
-	test_must_fail git rebase master
+	test_must_fail git rebase main
 '
 
-test_expect_success 'rebase against master' '
+test_expect_success 'rebase against main' '
 	git reset --hard HEAD &&
-	git rebase master
+	git rebase main
 '
 
 test_expect_success 'rebase sets ORIG_HEAD to pre-rebase state' '
 	git checkout -b orig-head topic &&
 	pre="$(git rev-parse --verify HEAD)" &&
-	git rebase master &&
+	git rebase main &&
 	test_cmp_rev "$pre" ORIG_HEAD &&
 	test_cmp_rev ! "$pre" HEAD
 '
@@ -96,19 +96,19 @@ test_expect_success 'HEAD was detached during rebase' '
 
 test_expect_success 'rebase from ambiguous branch name' '
 	git checkout -b topic side &&
-	git rebase master
+	git rebase main
 '
 
 test_expect_success 'rebase off of the previous branch using "-"' '
-	git checkout master &&
+	git checkout main &&
 	git checkout HEAD^ &&
 	git rebase @{-1} >expect.messages &&
-	git merge-base master HEAD >expect.forkpoint &&
+	git merge-base main HEAD >expect.forkpoint &&
 
-	git checkout master &&
+	git checkout main &&
 	git checkout HEAD^ &&
 	git rebase - >actual.messages &&
-	git merge-base master HEAD >actual.forkpoint &&
+	git merge-base main HEAD >actual.forkpoint &&
 
 	test_cmp expect.forkpoint actual.forkpoint &&
 	# the next one is dubious---we may want to say "-",
@@ -117,7 +117,7 @@ test_expect_success 'rebase off of the previous branch using "-"' '
 '
 
 test_expect_success 'rebase a single mode change' '
-	git checkout master &&
+	git checkout main &&
 	git branch -D topic &&
 	echo 1 >X &&
 	git add X &&
@@ -129,7 +129,7 @@ test_expect_success 'rebase a single mode change' '
 	test_chmod +x A &&
 	test_tick &&
 	git commit -m modechange &&
-	GIT_TRACE=1 git rebase master
+	GIT_TRACE=1 git rebase main
 '
 
 test_expect_success 'rebase is not broken by diff.renames' '
@@ -165,11 +165,11 @@ test_expect_success 'fail when upstream arg is missing and not configured' '
 test_expect_success 'rebase works with format.useAutoBase' '
 	test_config format.useAutoBase true &&
 	git checkout topic &&
-	git rebase master
+	git rebase main
 '
 
 test_expect_success 'default to common base in @{upstream}s reflog if no upstream arg (--merge)' '
-	git checkout -b default-base master &&
+	git checkout -b default-base main &&
 	git checkout -b default topic &&
 	git config branch.default.remote . &&
 	git config branch.default.merge refs/heads/default-base &&
@@ -187,7 +187,7 @@ test_expect_success 'default to common base in @{upstream}s reflog if no upstrea
 '
 
 test_expect_success 'default to common base in @{upstream}s reflog if no upstream arg (--apply)' '
-	git checkout -B default-base master &&
+	git checkout -B default-base main &&
 	git checkout -B default topic &&
 	git config branch.default.remote . &&
 	git config branch.default.merge refs/heads/default-base &&
@@ -229,13 +229,13 @@ test_expect_success 'cherry-picked commits and fork-point work together' '
 
 test_expect_success 'rebase --apply -q is quiet' '
 	git checkout -b quiet topic &&
-	git rebase --apply -q master >output.out 2>&1 &&
+	git rebase --apply -q main >output.out 2>&1 &&
 	test_must_be_empty output.out
 '
 
 test_expect_success 'rebase --merge -q is quiet' '
 	git checkout -B quiet topic &&
-	git rebase --merge -q master >output.out 2>&1 &&
+	git rebase --merge -q main >output.out 2>&1 &&
 	test_must_be_empty output.out
 '
 
@@ -297,7 +297,7 @@ test_expect_success 'rebase commit with an ancient timestamp' '
 '
 
 test_expect_success 'rebase with "From " line in commit message' '
-	git checkout -b preserve-from master~1 &&
+	git checkout -b preserve-from main~1 &&
 	cat >From_.msg <<EOF &&
 Somebody embedded an mbox in a commit message
 
@@ -313,7 +313,7 @@ EOF
 	>From_ &&
 	git add From_ &&
 	git commit -F From_.msg &&
-	git rebase master &&
+	git rebase main &&
 	git log -1 --pretty=format:%B >out &&
 	test_cmp From_.msg out
 '
@@ -360,12 +360,12 @@ test_expect_success 'rebase --apply and .gitattributes' '
 		git cherry-pick test &&
 
 		git checkout test &&
-		git rebase master &&
+		git rebase main &&
 		grep "smudged" a.txt &&
 
 		git checkout removal &&
 		git reset --hard &&
-		git rebase master &&
+		git rebase main &&
 		grep "clean" a.txt
 	)
 '
@@ -405,20 +405,20 @@ test_expect_success 'rebase -c rebase.useBuiltin=false warning' '
 '
 
 test_expect_success 'switch to branch checked out here' '
-	git checkout master &&
-	git rebase master master
+	git checkout main &&
+	git rebase main main
 '
 
 test_expect_success 'switch to branch not checked out' '
-	git checkout master &&
+	git checkout main &&
 	git branch other &&
-	git rebase master other
+	git rebase main other
 '
 
 test_expect_success 'refuse to switch to branch checked out elsewhere' '
-	git checkout master &&
+	git checkout main &&
 	git worktree add wt &&
-	test_must_fail git -C wt rebase master master 2>err &&
+	test_must_fail git -C wt rebase main main 2>err &&
 	test_i18ngrep "already checked out" err
 '
 
diff --git a/t/t3402-rebase-merge.sh b/t/t3402-rebase-merge.sh
index d79a11b686..cfde68f193 100755
--- a/t/t3402-rebase-merge.sh
+++ b/t/t3402-rebase-merge.sh
@@ -5,7 +5,7 @@
 
 test_description='git rebase --merge test'
 
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -22,10 +22,10 @@ test_expect_success setup '
 	git commit -m"initial" &&
 	git branch side &&
 	echo "11 $T" >>original &&
-	git commit -a -m"master updates a bit." &&
+	git commit -a -m"main updates a bit." &&
 
 	echo "12 $T" >>original &&
-	git commit -a -m"master updates a bit more." &&
+	git commit -a -m"main updates a bit more." &&
 
 	git checkout side &&
 	(echo "0 $T" && cat original) >renamed &&
@@ -50,13 +50,13 @@ test_expect_success setup '
 '
 
 test_expect_success 'reference merge' '
-	git merge -s recursive -m "reference merge" master
+	git merge -s recursive -m "reference merge" main
 '
 
 PRE_REBASE=$(git rev-parse test-rebase)
 test_expect_success rebase '
 	git checkout test-rebase &&
-	GIT_TRACE=1 git rebase --merge master
+	GIT_TRACE=1 git rebase --merge main
 '
 
 test_expect_success 'test-rebase@{1} is pre rebase' '
@@ -75,24 +75,24 @@ test_expect_success 'merge and rebase should match' '
 '
 
 test_expect_success 'rebase the other way' '
-	git reset --hard master &&
+	git reset --hard main &&
 	git rebase --merge side
 '
 
 test_expect_success 'rebase -Xtheirs' '
-	git checkout -b conflicting master~2 &&
+	git checkout -b conflicting main~2 &&
 	echo "AB $T" >> original &&
 	git commit -mconflicting original &&
-	git rebase -Xtheirs master &&
+	git rebase -Xtheirs main &&
 	grep AB original &&
 	! grep 11 original
 '
 
 test_expect_success 'rebase -Xtheirs from orphan' '
-	git checkout --orphan orphan-conflicting master~2 &&
+	git checkout --orphan orphan-conflicting main~2 &&
 	echo "AB $T" >> original &&
 	git commit -morphan-conflicting original &&
-	git rebase -Xtheirs master &&
+	git rebase -Xtheirs main &&
 	grep AB original &&
 	! grep 11 original
 '
@@ -110,9 +110,9 @@ test_expect_success 'merge and rebase should match' '
 
 test_expect_success 'picking rebase' '
 	git reset --hard side &&
-	git rebase --merge --onto master side^^ &&
-	mb=$(git merge-base master HEAD) &&
-	if test "$mb" = "$(git rev-parse master)"
+	git rebase --merge --onto main side^^ &&
+	mb=$(git merge-base main HEAD) &&
+	if test "$mb" = "$(git rev-parse main)"
 	then
 		echo happy
 	else
@@ -143,11 +143,11 @@ test_expect_success 'rebase -s funny -Xopt' '
 	EOF
 	chmod +x test-bin/git-merge-funny &&
 	git reset --hard &&
-	git checkout -b test-funny master^ &&
+	git checkout -b test-funny main^ &&
 	test_commit funny &&
 	(
 		PATH=./test-bin:$PATH &&
-		git rebase -s funny -Xopt master
+		git rebase -s funny -Xopt main
 	) &&
 	test -f funny.was.run
 '
@@ -168,7 +168,7 @@ test_expect_success 'rebase --skip works with two conflicts in a row' '
 test_expect_success '--reapply-cherry-picks' '
 	git init repo &&
 
-	# O(1-10) -- O(1-11) -- O(0-10) master
+	# O(1-10) -- O(1-11) -- O(0-10) main
 	#        \
 	#         -- O(1-11) -- O(1-12) otherbranch
 
@@ -190,18 +190,18 @@ test_expect_success '--reapply-cherry-picks' '
 	git -C repo commit -a -m "add 12 in another branch" &&
 
 	# Regular rebase fails, because the 1-11 commit is deduplicated
-	test_must_fail git -C repo rebase --merge master 2> err &&
+	test_must_fail git -C repo rebase --merge main 2> err &&
 	test_i18ngrep "error: could not apply.*add 12 in another branch" err &&
 	git -C repo rebase --abort &&
 
 	# With --reapply-cherry-picks, it works
-	git -C repo rebase --merge --reapply-cherry-picks master
+	git -C repo rebase --merge --reapply-cherry-picks main
 '
 
 test_expect_success '--reapply-cherry-picks refrains from reading unneeded blobs' '
 	git init server &&
 
-	# O(1-10) -- O(1-11) -- O(1-12) master
+	# O(1-10) -- O(1-11) -- O(1-12) main
 	#        \
 	#         -- O(0-10) otherbranch
 
@@ -223,18 +223,18 @@ test_expect_success '--reapply-cherry-picks refrains from reading unneeded blobs
 	test_config -C server uploadpack.allowanysha1inwant 1 &&
 
 	git clone --filter=blob:none "file://$(pwd)/server" client &&
-	git -C client checkout origin/master &&
+	git -C client checkout origin/main &&
 	git -C client checkout origin/otherbranch &&
 
 	# Sanity check to ensure that the blobs from the merge base and "add
 	# 11" are missing
 	git -C client rev-list --objects --all --missing=print >missing_list &&
-	MERGE_BASE_BLOB=$(git -C server rev-parse master^^:file.txt) &&
-	ADD_11_BLOB=$(git -C server rev-parse master^:file.txt) &&
+	MERGE_BASE_BLOB=$(git -C server rev-parse main^^:file.txt) &&
+	ADD_11_BLOB=$(git -C server rev-parse main^:file.txt) &&
 	grep "[?]$MERGE_BASE_BLOB" missing_list &&
 	grep "[?]$ADD_11_BLOB" missing_list &&
 
-	git -C client rebase --merge --reapply-cherry-picks origin/master &&
+	git -C client rebase --merge --reapply-cherry-picks origin/main &&
 
 	# The blob from the merge base had to be fetched, but not "add 11"
 	git -C client rev-list --objects --all --missing=print >missing_list &&
diff --git a/t/t3403-rebase-skip.sh b/t/t3403-rebase-skip.sh
index c9936cb1d9..e26762d0b2 100755
--- a/t/t3403-rebase-skip.sh
+++ b/t/t3403-rebase-skip.sh
@@ -5,7 +5,7 @@
 
 test_description='git rebase --merge --skip tests'
 
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -51,7 +51,7 @@ test_expect_success setup '
 	'
 
 test_expect_success 'rebase with git am -3 (default)' '
-	test_must_fail git rebase master
+	test_must_fail git rebase main
 '
 
 test_expect_success 'rebase --skip can not be used with other options' '
@@ -67,7 +67,7 @@ test_expect_success 'rebase moves back to skip-reference' '
 	test refs/heads/skip-reference = $(git symbolic-ref HEAD) &&
 	git branch post-rebase &&
 	git reset --hard pre-rebase &&
-	test_must_fail git rebase master &&
+	test_must_fail git rebase main &&
 	echo "hello" > hello &&
 	git add hello &&
 	git rebase --continue &&
@@ -78,7 +78,7 @@ test_expect_success 'rebase moves back to skip-reference' '
 test_expect_success 'checkout skip-merge' 'git checkout -f skip-merge'
 
 test_expect_success 'rebase with --merge' '
-	test_must_fail git rebase --merge master
+	test_must_fail git rebase --merge main
 '
 
 test_expect_success 'rebase --skip with --merge' '
diff --git a/t/t3405-rebase-malformed.sh b/t/t3405-rebase-malformed.sh
index d8f6d2e3cb..2524331861 100755
--- a/t/t3405-rebase-malformed.sh
+++ b/t/t3405-rebase-malformed.sh
@@ -2,7 +2,7 @@
 
 test_description='rebase should handle arbitrary git message'
 
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -55,7 +55,7 @@ test_expect_success setup '
 	git add file3 &&
 	git commit --allow-empty-message -m "" &&
 
-	git checkout master &&
+	git checkout main &&
 
 	echo One >file1 &&
 	test_tick &&
@@ -65,7 +65,7 @@ test_expect_success setup '
 
 test_expect_success 'rebase commit with multi-line subject' '
 
-	git rebase master multi-line-subject &&
+	git rebase main multi-line-subject &&
 	git cat-file commit HEAD | sed -e "1,/^\$/d" >F1 &&
 
 	test_cmp F0 F1 &&
@@ -73,14 +73,14 @@ test_expect_success 'rebase commit with multi-line subject' '
 '
 
 test_expect_success 'rebase commit with diff in message' '
-	git rebase master diff-in-message &&
+	git rebase main diff-in-message &&
 	git cat-file commit HEAD | sed -e "1,/^$/d" >G1 &&
 	test_cmp G0 G1 &&
 	test_cmp G G0
 '
 
 test_expect_success 'rebase -m commit with empty message' '
-	git rebase -m master empty-message-merge
+	git rebase -m main empty-message-merge
 '
 
 test_expect_success 'rebase -i commit with empty message' '
diff --git a/t/t3406-rebase-message.sh b/t/t3406-rebase-message.sh
index 863db3ac4c..c02729d5ea 100755
--- a/t/t3406-rebase-message.sh
+++ b/t/t3406-rebase-message.sh
@@ -2,7 +2,7 @@
 
 test_description='messages from rebase operation'
 
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -21,27 +21,27 @@ test_expect_success 'setup' '
 '
 
 test_expect_success 'rebase -m' '
-	git rebase -m master >actual &&
+	git rebase -m main >actual &&
 	test_must_be_empty actual
 '
 
-test_expect_success 'rebase against master twice' '
-	git rebase --apply master >out &&
+test_expect_success 'rebase against main twice' '
+	git rebase --apply main >out &&
 	test_i18ngrep "Current branch topic is up to date" out
 '
 
-test_expect_success 'rebase against master twice with --force' '
-	git rebase --force-rebase --apply master >out &&
+test_expect_success 'rebase against main twice with --force' '
+	git rebase --force-rebase --apply main >out &&
 	test_i18ngrep "Current branch topic is up to date, rebase forced" out
 '
 
-test_expect_success 'rebase against master twice from another branch' '
+test_expect_success 'rebase against main twice from another branch' '
 	git checkout topic^ &&
-	git rebase --apply master topic >out &&
+	git rebase --apply main topic >out &&
 	test_i18ngrep "Current branch topic is up to date" out
 '
 
-test_expect_success 'rebase fast-forward to master' '
+test_expect_success 'rebase fast-forward to main' '
 	git checkout topic^ &&
 	git rebase --apply topic >out &&
 	test_i18ngrep "Fast-forwarded HEAD to topic" out
@@ -49,21 +49,21 @@ test_expect_success 'rebase fast-forward to master' '
 
 test_expect_success 'rebase --stat' '
 	git reset --hard start &&
-	git rebase --stat master >diffstat.txt &&
+	git rebase --stat main >diffstat.txt &&
 	grep "^ fileX |  *1 +$" diffstat.txt
 '
 
 test_expect_success 'rebase w/config rebase.stat' '
 	git reset --hard start &&
 	git config rebase.stat true &&
-	git rebase master >diffstat.txt &&
+	git rebase main >diffstat.txt &&
 	grep "^ fileX |  *1 +$" diffstat.txt
 '
 
 test_expect_success 'rebase -n overrides config rebase.stat config' '
 	git reset --hard start &&
 	git config rebase.stat true &&
-	git rebase -n master >diffstat.txt &&
+	git rebase -n main >diffstat.txt &&
 	! grep "^ fileX |  *1 +$" diffstat.txt
 '
 
@@ -116,7 +116,7 @@ test_expect_success 'rebase -i onto unrelated history' '
 	git init unrelated &&
 	test_commit -C unrelated 1 &&
 	git -C unrelated remote add -f origin "$PWD" &&
-	git -C unrelated branch --set-upstream-to=origin/master &&
+	git -C unrelated branch --set-upstream-to=origin/main &&
 	git -C unrelated -c core.editor=true rebase -i -v --stat >actual &&
 	test_i18ngrep "Changes to " actual &&
 	test_i18ngrep "5 files changed" actual
diff --git a/t/t3407-rebase-abort.sh b/t/t3407-rebase-abort.sh
index e3c1851f40..7c381fbc89 100755
--- a/t/t3407-rebase-abort.sh
+++ b/t/t3407-rebase-abort.sh
@@ -2,7 +2,7 @@
 
 test_description='git rebase --abort tests'
 
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -40,7 +40,7 @@ testrebase() {
 		cd "$work_dir" &&
 		# Clean up the state from the previous one
 		git reset --hard pre-rebase &&
-		test_must_fail git rebase$type master &&
+		test_must_fail git rebase$type main &&
 		test_path_is_dir "$dotest" &&
 		git rebase --abort &&
 		test $(git rev-parse to-rebase) = $(git rev-parse pre-rebase) &&
@@ -51,10 +51,10 @@ testrebase() {
 		cd "$work_dir" &&
 		# Clean up the state from the previous one
 		git reset --hard pre-rebase &&
-		test_must_fail git rebase$type master &&
+		test_must_fail git rebase$type main &&
 		test_path_is_dir "$dotest" &&
 		test_must_fail git rebase --skip &&
-		test $(git rev-parse HEAD) = $(git rev-parse master) &&
+		test $(git rev-parse HEAD) = $(git rev-parse main) &&
 		git rebase --abort &&
 		test $(git rev-parse to-rebase) = $(git rev-parse pre-rebase) &&
 		test ! -d "$dotest"
@@ -64,13 +64,13 @@ testrebase() {
 		cd "$work_dir" &&
 		# Clean up the state from the previous one
 		git reset --hard pre-rebase &&
-		test_must_fail git rebase$type master &&
+		test_must_fail git rebase$type main &&
 		test_path_is_dir "$dotest" &&
 		echo c > a &&
 		echo d >> a &&
 		git add a &&
 		test_must_fail git rebase --continue &&
-		test $(git rev-parse HEAD) != $(git rev-parse master) &&
+		test $(git rev-parse HEAD) != $(git rev-parse main) &&
 		git rebase --abort &&
 		test $(git rev-parse to-rebase) = $(git rev-parse pre-rebase) &&
 		test ! -d "$dotest"
@@ -81,7 +81,7 @@ testrebase() {
 		# Clean up the state from the previous one
 		git reset --hard pre-rebase &&
 		git reflog show to-rebase > reflog_before &&
-		test_must_fail git rebase$type master &&
+		test_must_fail git rebase$type main &&
 		git rebase --abort &&
 		git reflog show to-rebase > reflog_after &&
 		test_cmp reflog_before reflog_after &&
@@ -92,7 +92,7 @@ testrebase() {
 		cd "$work_dir" &&
 		# Clean up the state from the previous one
 		git reset --hard pre-rebase &&
-		test_must_fail git rebase$type master &&
+		test_must_fail git rebase$type main &&
 		test_must_fail git rebase -v --abort &&
 		test_must_fail git rebase --abort -v &&
 		git rebase --abort
@@ -106,7 +106,7 @@ test_expect_success 'rebase --apply --quit' '
 	cd "$work_dir" &&
 	# Clean up the state from the previous one
 	git reset --hard pre-rebase &&
-	test_must_fail git rebase --apply master &&
+	test_must_fail git rebase --apply main &&
 	test_path_is_dir .git/rebase-apply &&
 	head_before=$(git rev-parse HEAD) &&
 	git rebase --quit &&
@@ -118,7 +118,7 @@ test_expect_success 'rebase --merge --quit' '
 	cd "$work_dir" &&
 	# Clean up the state from the previous one
 	git reset --hard pre-rebase &&
-	test_must_fail git rebase --merge master &&
+	test_must_fail git rebase --merge main &&
 	test_path_is_dir .git/rebase-merge &&
 	head_before=$(git rev-parse HEAD) &&
 	git rebase --quit &&
diff --git a/t/t3408-rebase-multi-line.sh b/t/t3408-rebase-multi-line.sh
index 6dd56c4c15..ab0960e6d9 100755
--- a/t/t3408-rebase-multi-line.sh
+++ b/t/t3408-rebase-multi-line.sh
@@ -2,7 +2,7 @@
 
 test_description='rebasing a commit with multi-line first paragraph.'
 
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -49,7 +49,7 @@ But otherwise with a sane description." side2 &&
 test_expect_success rebase '
 
 	git checkout side &&
-	git rebase master &&
+	git rebase main &&
 	git cat-file commit HEAD | sed -e "1,/^\$/d" >actual &&
 	git cat-file commit side@{1} | sed -e "1,/^\$/d" >expect &&
 	test_cmp expect actual
diff --git a/t/t3409-rebase-preserve-merges.sh b/t/t3409-rebase-preserve-merges.sh
index 609efc96f9..ec8062a66a 100755
--- a/t/t3409-rebase-preserve-merges.sh
+++ b/t/t3409-rebase-preserve-merges.sh
@@ -6,7 +6,7 @@ test_description='git rebase -p should preserve merges
 
 Run "git rebase -p" and check that merges are properly carried along
 '
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -21,7 +21,7 @@ export GIT_AUTHOR_EMAIL
 
 # Clone 2 (conflicting merge):
 #
-# A1--A2--B3   <-- origin/master
+# A1--A2--B3   <-- origin/main
 #  \       \
 #   B1------M  <-- topic
 #    \
@@ -29,7 +29,7 @@ export GIT_AUTHOR_EMAIL
 #
 # Clone 3 (no-ff merge):
 #
-# A1--A2--B3   <-- origin/master
+# A1--A2--B3   <-- origin/main
 #  \
 #   B1------M  <-- topic
 #    \     /
@@ -47,7 +47,7 @@ test_expect_success 'setup for merge-preserving rebase' \
 	echo Second > B &&
 	git add B &&
 	git commit -m "Add B1" &&
-	git checkout -f master &&
+	git checkout -f main &&
 	echo Third >> A &&
 	git commit -a -m "Modify A2" &&
 	echo Fifth > B &&
@@ -58,10 +58,10 @@ test_expect_success 'setup for merge-preserving rebase' \
 	(
 		cd clone2 &&
 		git checkout -b topic origin/topic &&
-		test_must_fail git merge origin/master &&
+		test_must_fail git merge origin/main &&
 		echo Resolved >B &&
 		git add B &&
-		git commit -m "Merge origin/master into topic"
+		git commit -m "Merge origin/main into topic"
 	) &&
 
 	git clone ./. clone3 &&
diff --git a/t/t3412-rebase-root.sh b/t/t3412-rebase-root.sh
index 07597643c5..fda62c65bd 100755
--- a/t/t3412-rebase-root.sh
+++ b/t/t3412-rebase-root.sh
@@ -4,7 +4,7 @@ test_description='git rebase --root
 
 Tests if git rebase --root --onto <newparent> can rebase the root commit.
 '
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -27,7 +27,7 @@ test_expect_success 'prepare repository' '
 
 test_expect_success 'rebase --root fails with too many args' '
 	git checkout -B fail other &&
-	test_must_fail git rebase --onto master --root fail fail
+	test_must_fail git rebase --onto main --root fail fail
 '
 
 test_expect_success 'setup pre-rebase hook' '
@@ -47,7 +47,7 @@ EOF
 
 test_expect_success 'rebase --root --onto <newbase>' '
 	git checkout -b work other &&
-	git rebase --root --onto master &&
+	git rebase --root --onto main &&
 	git log --pretty=tformat:"%s" > rebased &&
 	test_cmp expect rebased
 '
@@ -58,7 +58,7 @@ test_expect_success 'pre-rebase got correct input (1)' '
 
 test_expect_success 'rebase --root --onto <newbase> <branch>' '
 	git branch work2 other &&
-	git rebase --root --onto master work2 &&
+	git rebase --root --onto main work2 &&
 	git log --pretty=tformat:"%s" > rebased2 &&
 	test_cmp expect rebased2
 '
@@ -69,7 +69,7 @@ test_expect_success 'pre-rebase got correct input (2)' '
 
 test_expect_success 'rebase -i --root --onto <newbase>' '
 	git checkout -b work3 other &&
-	git rebase -i --root --onto master &&
+	git rebase -i --root --onto main &&
 	git log --pretty=tformat:"%s" > rebased3 &&
 	test_cmp expect rebased3
 '
@@ -80,7 +80,7 @@ test_expect_success 'pre-rebase got correct input (3)' '
 
 test_expect_success 'rebase -i --root --onto <newbase> <branch>' '
 	git branch work4 other &&
-	git rebase -i --root --onto master work4 &&
+	git rebase -i --root --onto main work4 &&
 	git log --pretty=tformat:"%s" > rebased4 &&
 	test_cmp expect rebased4
 '
@@ -91,7 +91,7 @@ test_expect_success 'pre-rebase got correct input (4)' '
 
 test_expect_success REBASE_P 'rebase -i -p with linear history' '
 	git checkout -b work5 other &&
-	git rebase -i -p --root --onto master &&
+	git rebase -i -p --root --onto main &&
 	git log --pretty=tformat:"%s" > rebased5 &&
 	test_cmp expect rebased5
 '
@@ -125,7 +125,7 @@ EOF
 
 test_expect_success REBASE_P 'rebase -i -p with merge' '
 	git checkout -b work6 other &&
-	git rebase -i -p --root --onto master &&
+	git rebase -i -p --root --onto main &&
 	log_with_names work6 > rebased6 &&
 	test_cmp expect-side rebased6
 '
@@ -160,7 +160,7 @@ EOF
 
 test_expect_success REBASE_P 'rebase -i -p with two roots' '
 	git checkout -b work7 other &&
-	git rebase -i -p --root --onto master &&
+	git rebase -i -p --root --onto main &&
 	log_with_names work7 > rebased7 &&
 	test_cmp expect-third rebased7
 '
@@ -176,14 +176,14 @@ EOF
 
 test_expect_success 'pre-rebase hook stops rebase' '
 	git checkout -b stops1 other &&
-	test_must_fail git rebase --root --onto master &&
+	test_must_fail git rebase --root --onto main &&
 	test "z$(git symbolic-ref HEAD)" = zrefs/heads/stops1 &&
 	test 0 = $(git rev-list other...stops1 | wc -l)
 '
 
 test_expect_success 'pre-rebase hook stops rebase -i' '
 	git checkout -b stops2 other &&
-	test_must_fail git rebase --root --onto master &&
+	test_must_fail git rebase --root --onto main &&
 	test "z$(git symbolic-ref HEAD)" = zrefs/heads/stops2 &&
 	test 0 = $(git rev-list other...stops2 | wc -l)
 '
@@ -193,7 +193,7 @@ test_expect_success 'remove pre-rebase hook' '
 '
 
 test_expect_success 'set up a conflict' '
-	git checkout master &&
+	git checkout main &&
 	echo conflict > B &&
 	git add B &&
 	git commit -m conflict
@@ -201,7 +201,7 @@ test_expect_success 'set up a conflict' '
 
 test_expect_success 'rebase --root with conflict (first part)' '
 	git checkout -b conflict1 other &&
-	test_must_fail git rebase --root --onto master &&
+	test_must_fail git rebase --root --onto main &&
 	git ls-files -u | grep "B$"
 '
 
@@ -228,7 +228,7 @@ test_expect_success 'rebase --root with conflict (second part)' '
 
 test_expect_success 'rebase -i --root with conflict (first part)' '
 	git checkout -b conflict2 other &&
-	test_must_fail git rebase -i --root --onto master &&
+	test_must_fail git rebase -i --root --onto main &&
 	git ls-files -u | grep "B$"
 '
 
@@ -266,7 +266,7 @@ EOF
 
 test_expect_success REBASE_P 'rebase -i -p --root with conflict (first part)' '
 	git checkout -b conflict3 other &&
-	test_must_fail git rebase -i -p --root --onto master &&
+	test_must_fail git rebase -i -p --root --onto main &&
 	git ls-files -u | grep "B$"
 '
 
diff --git a/t/t3413-rebase-hook.sh b/t/t3413-rebase-hook.sh
index 86a1b82d65..b4acb3be5c 100755
--- a/t/t3413-rebase-hook.sh
+++ b/t/t3413-rebase-hook.sh
@@ -2,7 +2,7 @@
 
 test_description='git rebase with its hook(s)'
 
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -21,7 +21,7 @@ test_expect_success setup '
 	git add git &&
 	test_tick &&
 	git commit -m side &&
-	git checkout master &&
+	git checkout main &&
 	git log --pretty=oneline --abbrev-commit --graph --all &&
 	git branch test side
 '
@@ -29,14 +29,14 @@ test_expect_success setup '
 test_expect_success 'rebase' '
 	git checkout test &&
 	git reset --hard side &&
-	git rebase master &&
+	git rebase main &&
 	test "z$(cat git)" = zworld
 '
 
 test_expect_success 'rebase -i' '
 	git checkout test &&
 	git reset --hard side &&
-	EDITOR=true git rebase -i master &&
+	EDITOR=true git rebase -i main &&
 	test "z$(cat git)" = zworld
 '
 
@@ -52,53 +52,53 @@ EOF
 test_expect_success 'pre-rebase hook gets correct input (1)' '
 	git checkout test &&
 	git reset --hard side &&
-	git rebase master &&
+	git rebase main &&
 	test "z$(cat git)" = zworld &&
-	test "z$(cat .git/PRE-REBASE-INPUT)" = zmaster,
+	test "z$(cat .git/PRE-REBASE-INPUT)" = zmain,
 
 '
 
 test_expect_success 'pre-rebase hook gets correct input (2)' '
 	git checkout test &&
 	git reset --hard side &&
-	git rebase master test &&
+	git rebase main test &&
 	test "z$(cat git)" = zworld &&
-	test "z$(cat .git/PRE-REBASE-INPUT)" = zmaster,test
+	test "z$(cat .git/PRE-REBASE-INPUT)" = zmain,test
 '
 
 test_expect_success 'pre-rebase hook gets correct input (3)' '
 	git checkout test &&
 	git reset --hard side &&
-	git checkout master &&
-	git rebase master test &&
+	git checkout main &&
+	git rebase main test &&
 	test "z$(cat git)" = zworld &&
-	test "z$(cat .git/PRE-REBASE-INPUT)" = zmaster,test
+	test "z$(cat .git/PRE-REBASE-INPUT)" = zmain,test
 '
 
 test_expect_success 'pre-rebase hook gets correct input (4)' '
 	git checkout test &&
 	git reset --hard side &&
-	EDITOR=true git rebase -i master &&
+	EDITOR=true git rebase -i main &&
 	test "z$(cat git)" = zworld &&
-	test "z$(cat .git/PRE-REBASE-INPUT)" = zmaster,
+	test "z$(cat .git/PRE-REBASE-INPUT)" = zmain,
 
 '
 
 test_expect_success 'pre-rebase hook gets correct input (5)' '
 	git checkout test &&
 	git reset --hard side &&
-	EDITOR=true git rebase -i master test &&
+	EDITOR=true git rebase -i main test &&
 	test "z$(cat git)" = zworld &&
-	test "z$(cat .git/PRE-REBASE-INPUT)" = zmaster,test
+	test "z$(cat .git/PRE-REBASE-INPUT)" = zmain,test
 '
 
 test_expect_success 'pre-rebase hook gets correct input (6)' '
 	git checkout test &&
 	git reset --hard side &&
-	git checkout master &&
-	EDITOR=true git rebase -i master test &&
+	git checkout main &&
+	EDITOR=true git rebase -i main test &&
 	test "z$(cat git)" = zworld &&
-	test "z$(cat .git/PRE-REBASE-INPUT)" = zmaster,test
+	test "z$(cat .git/PRE-REBASE-INPUT)" = zmain,test
 '
 
 test_expect_success 'setup pre-rebase hook that fails' '
@@ -113,7 +113,7 @@ EOF
 test_expect_success 'pre-rebase hook stops rebase (1)' '
 	git checkout test &&
 	git reset --hard side &&
-	test_must_fail git rebase master &&
+	test_must_fail git rebase main &&
 	test "z$(git symbolic-ref HEAD)" = zrefs/heads/test &&
 	test 0 = $(git rev-list HEAD...side | wc -l)
 '
@@ -121,7 +121,7 @@ test_expect_success 'pre-rebase hook stops rebase (1)' '
 test_expect_success 'pre-rebase hook stops rebase (2)' '
 	git checkout test &&
 	git reset --hard side &&
-	test_must_fail env EDITOR=: git rebase -i master &&
+	test_must_fail env EDITOR=: git rebase -i main &&
 	test "z$(git symbolic-ref HEAD)" = zrefs/heads/test &&
 	test 0 = $(git rev-list HEAD...side | wc -l)
 '
@@ -129,7 +129,7 @@ test_expect_success 'pre-rebase hook stops rebase (2)' '
 test_expect_success 'rebase --no-verify overrides pre-rebase (1)' '
 	git checkout test &&
 	git reset --hard side &&
-	git rebase --no-verify master &&
+	git rebase --no-verify main &&
 	test "z$(git symbolic-ref HEAD)" = zrefs/heads/test &&
 	test "z$(cat git)" = zworld
 '
@@ -137,7 +137,7 @@ test_expect_success 'rebase --no-verify overrides pre-rebase (1)' '
 test_expect_success 'rebase --no-verify overrides pre-rebase (2)' '
 	git checkout test &&
 	git reset --hard side &&
-	EDITOR=true git rebase --no-verify -i master &&
+	EDITOR=true git rebase --no-verify -i main &&
 	test "z$(git symbolic-ref HEAD)" = zrefs/heads/test &&
 	test "z$(cat git)" = zworld
 '
diff --git a/t/t3415-rebase-autosquash.sh b/t/t3415-rebase-autosquash.sh
index 35eb8e2bb2..e7087befd4 100755
--- a/t/t3415-rebase-autosquash.sh
+++ b/t/t3415-rebase-autosquash.sh
@@ -2,7 +2,7 @@
 
 test_description='auto squash'
 
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -410,7 +410,7 @@ test_expect_success 'wrapped original subject' '
 
 test_expect_success 'abort last squash' '
 	test_when_finished "test_might_fail git rebase --abort" &&
-	test_when_finished "git checkout master" &&
+	test_when_finished "git checkout main" &&
 
 	git checkout -b some-squashes &&
 	git commit --allow-empty -m first &&
diff --git a/t/t3416-rebase-onto-threedots.sh b/t/t3416-rebase-onto-threedots.sh
index d0476fbb28..3716a42e81 100755
--- a/t/t3416-rebase-onto-threedots.sh
+++ b/t/t3416-rebase-onto-threedots.sh
@@ -2,20 +2,20 @@
 
 test_description='git rebase --onto A...B'
 
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
 . "$TEST_DIRECTORY/lib-rebase.sh"
 
-# Rebase only the tip commit of "topic" on merge base between "master"
-# and "topic".  Cannot do this for "side" with "master" because there
+# Rebase only the tip commit of "topic" on merge base between "main"
+# and "topic".  Cannot do this for "side" with "main" because there
 # is no single merge base.
 #
 #
 #	    F---G topic                             G'
 #	   /                                       /
-# A---B---C---D---E master        -->       A---B---C---D---E
+# A---B---C---D---E main        -->       A---B---C---D---E
 #      \   \ /
 #	\   x
 #	 \ / \
@@ -29,7 +29,7 @@ test_expect_success setup '
 	git branch topic &&
 	git checkout side &&
 	test_commit H &&
-	git checkout master &&
+	git checkout main &&
 	test_tick &&
 	git merge H &&
 	git tag D &&
@@ -45,83 +45,83 @@ test_expect_success setup '
 	test_commit K
 '
 
-test_expect_success 'rebase --onto master...topic' '
+test_expect_success 'rebase --onto main...topic' '
 	git reset --hard &&
 	git checkout topic &&
 	git reset --hard G &&
 
-	git rebase --onto master...topic F &&
+	git rebase --onto main...topic F &&
 	git rev-parse HEAD^1 >actual &&
 	git rev-parse C^0 >expect &&
 	test_cmp expect actual
 '
 
-test_expect_success 'rebase --onto master...' '
+test_expect_success 'rebase --onto main...' '
 	git reset --hard &&
 	git checkout topic &&
 	git reset --hard G &&
 
-	git rebase --onto master... F &&
+	git rebase --onto main... F &&
 	git rev-parse HEAD^1 >actual &&
 	git rev-parse C^0 >expect &&
 	test_cmp expect actual
 '
 
-test_expect_success 'rebase --onto master...side' '
+test_expect_success 'rebase --onto main...side' '
 	git reset --hard &&
 	git checkout side &&
 	git reset --hard K &&
 
-	test_must_fail git rebase --onto master...side J
+	test_must_fail git rebase --onto main...side J
 '
 
-test_expect_success 'rebase -i --onto master...topic' '
+test_expect_success 'rebase -i --onto main...topic' '
 	git reset --hard &&
 	git checkout topic &&
 	git reset --hard G &&
 	set_fake_editor &&
-	EXPECT_COUNT=1 git rebase -i --onto master...topic F &&
+	EXPECT_COUNT=1 git rebase -i --onto main...topic F &&
 	git rev-parse HEAD^1 >actual &&
 	git rev-parse C^0 >expect &&
 	test_cmp expect actual
 '
 
-test_expect_success 'rebase -i --onto master...' '
+test_expect_success 'rebase -i --onto main...' '
 	git reset --hard &&
 	git checkout topic &&
 	git reset --hard G &&
 	set_fake_editor &&
-	EXPECT_COUNT=1 git rebase -i --onto master... F &&
+	EXPECT_COUNT=1 git rebase -i --onto main... F &&
 	git rev-parse HEAD^1 >actual &&
 	git rev-parse C^0 >expect &&
 	test_cmp expect actual
 '
 
-test_expect_success 'rebase -i --onto master...side' '
+test_expect_success 'rebase -i --onto main...side' '
 	git reset --hard &&
 	git checkout side &&
 	git reset --hard K &&
 
 	set_fake_editor &&
-	test_must_fail git rebase -i --onto master...side J
+	test_must_fail git rebase -i --onto main...side J
 '
 
 test_expect_success 'rebase --keep-base --onto incompatible' '
-	test_must_fail git rebase --keep-base --onto master...
+	test_must_fail git rebase --keep-base --onto main...
 '
 
 test_expect_success 'rebase --keep-base --root incompatible' '
 	test_must_fail git rebase --keep-base --root
 '
 
-test_expect_success 'rebase --keep-base master from topic' '
+test_expect_success 'rebase --keep-base main from topic' '
 	git reset --hard &&
 	git checkout topic &&
 	git reset --hard G &&
 
-	git rebase --keep-base master &&
+	git rebase --keep-base main &&
 	git rev-parse C >base.expect &&
-	git merge-base master HEAD >base.actual &&
+	git merge-base main HEAD >base.actual &&
 	test_cmp base.expect base.actual &&
 
 	git rev-parse HEAD~2 >actual &&
@@ -129,23 +129,23 @@ test_expect_success 'rebase --keep-base master from topic' '
 	test_cmp expect actual
 '
 
-test_expect_success 'rebase --keep-base master from side' '
+test_expect_success 'rebase --keep-base main from side' '
 	git reset --hard &&
 	git checkout side &&
 	git reset --hard K &&
 
-	test_must_fail git rebase --keep-base master
+	test_must_fail git rebase --keep-base main
 '
 
-test_expect_success 'rebase -i --keep-base master from topic' '
+test_expect_success 'rebase -i --keep-base main from topic' '
 	git reset --hard &&
 	git checkout topic &&
 	git reset --hard G &&
 
 	set_fake_editor &&
-	EXPECT_COUNT=2 git rebase -i --keep-base master &&
+	EXPECT_COUNT=2 git rebase -i --keep-base main &&
 	git rev-parse C >base.expect &&
-	git merge-base master HEAD >base.actual &&
+	git merge-base main HEAD >base.actual &&
 	test_cmp base.expect base.actual &&
 
 	git rev-parse HEAD~2 >actual &&
@@ -153,13 +153,13 @@ test_expect_success 'rebase -i --keep-base master from topic' '
 	test_cmp expect actual
 '
 
-test_expect_success 'rebase -i --keep-base master from side' '
+test_expect_success 'rebase -i --keep-base main from side' '
 	git reset --hard &&
 	git checkout side &&
 	git reset --hard K &&
 
 	set_fake_editor &&
-	test_must_fail git rebase -i --keep-base master
+	test_must_fail git rebase -i --keep-base main
 '
 
 test_done
diff --git a/t/t3418-rebase-continue.sh b/t/t3418-rebase-continue.sh
index 445cb843ba..0838f4e798 100755
--- a/t/t3418-rebase-continue.sh
+++ b/t/t3418-rebase-continue.sh
@@ -2,7 +2,7 @@
 
 test_description='git rebase --continue tests'
 
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -18,13 +18,13 @@ test_expect_success 'setup' '
 	git checkout -b topic HEAD^ &&
 	test_commit "commit-new-file-F2-on-topic-branch" F2 22 &&
 
-	git checkout master
+	git checkout main
 '
 
 test_expect_success 'interactive rebase --continue works with touched file' '
 	rm -fr .git/rebase-* &&
 	git reset --hard &&
-	git checkout master &&
+	git checkout main &&
 
 	FAKE_LINES="edit 1" git rebase -i HEAD^ &&
 	test-tool chmtime =-60 F1 &&
@@ -34,9 +34,9 @@ test_expect_success 'interactive rebase --continue works with touched file' '
 test_expect_success 'non-interactive rebase --continue works with touched file' '
 	rm -fr .git/rebase-* &&
 	git reset --hard &&
-	git checkout master &&
+	git checkout main &&
 
-	test_must_fail git rebase --onto master master topic &&
+	test_must_fail git rebase --onto main main topic &&
 	echo "Resolved" >F2 &&
 	git add F2 &&
 	test-tool chmtime =-60 F1 &&
@@ -64,7 +64,7 @@ test_expect_success 'rebase --continue remembers merge strategy and options' '
 	chmod +x test-bin/git-merge-funny &&
 	(
 		PATH=./test-bin:$PATH &&
-		test_must_fail git rebase -s funny -Xopt master topic
+		test_must_fail git rebase -s funny -Xopt main topic
 	) &&
 	test -f funny.was.run &&
 	rm funny.was.run &&
@@ -96,7 +96,7 @@ test_expect_success 'rebase -i --continue handles merge strategy and options' '
 	chmod +x test-bin/git-merge-funny &&
 	(
 		PATH=./test-bin:$PATH &&
-		test_must_fail git rebase -i -s funny -Xopt -Xfoo master topic
+		test_must_fail git rebase -i -s funny -Xopt -Xfoo main topic
 	) &&
 	test -f funny.was.run &&
 	rm funny.was.run &&
@@ -191,11 +191,11 @@ test_expect_success '--skip after failed fixup cleans commit message' '
 test_expect_success 'setup rerere database' '
 	rm -fr .git/rebase-* &&
 	git reset --hard commit-new-file-F3-on-topic-branch &&
-	git checkout master &&
+	git checkout main &&
 	test_commit "commit-new-file-F3" F3 3 &&
 	test_config rerere.enabled true &&
 	git update-ref refs/heads/topic commit-new-file-F3-on-topic-branch &&
-	test_must_fail git rebase -m master topic &&
+	test_must_fail git rebase -m main topic &&
 	echo "Resolved" >F2 &&
 	cp F2 expected-F2 &&
 	git add F2 &&
@@ -210,7 +210,7 @@ test_expect_success 'setup rerere database' '
 prepare () {
 	rm -fr .git/rebase-* &&
 	git reset --hard commit-new-file-F3-on-topic-branch &&
-	git checkout master &&
+	git checkout main &&
 	test_config rerere.enabled true
 }
 
@@ -218,7 +218,7 @@ test_rerere_autoupdate () {
 	action=$1 &&
 	test_expect_success "rebase $action --continue remembers --rerere-autoupdate" '
 		prepare &&
-		test_must_fail git rebase $action --rerere-autoupdate master topic &&
+		test_must_fail git rebase $action --rerere-autoupdate main topic &&
 		test_cmp expected-F2 F2 &&
 		git diff-files --quiet &&
 		test_must_fail git rebase --continue &&
@@ -230,7 +230,7 @@ test_rerere_autoupdate () {
 	test_expect_success "rebase $action --continue honors rerere.autoUpdate" '
 		prepare &&
 		test_config rerere.autoupdate true &&
-		test_must_fail git rebase $action master topic &&
+		test_must_fail git rebase $action main topic &&
 		test_cmp expected-F2 F2 &&
 		git diff-files --quiet &&
 		test_must_fail git rebase --continue &&
@@ -242,7 +242,7 @@ test_rerere_autoupdate () {
 	test_expect_success "rebase $action --continue remembers --no-rerere-autoupdate" '
 		prepare &&
 		test_config rerere.autoupdate true &&
-		test_must_fail git rebase $action --no-rerere-autoupdate master topic &&
+		test_must_fail git rebase $action --no-rerere-autoupdate main topic &&
 		test_cmp expected-F2 F2 &&
 		test_must_fail git diff-files --quiet &&
 		git add F2 &&
diff --git a/t/t3419-rebase-patch-id.sh b/t/t3419-rebase-patch-id.sh
index c5fe58d68b..295040f2fe 100755
--- a/t/t3419-rebase-patch-id.sh
+++ b/t/t3419-rebase-patch-id.sh
@@ -2,7 +2,7 @@
 
 test_description='git rebase - test patch id computation'
 
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -27,7 +27,7 @@ test_expect_success 'setup' '
 
 test_expect_success 'setup: 500 lines' '
 	rm -f .gitattributes &&
-	git checkout -q -f master &&
+	git checkout -q -f main &&
 	git reset --hard root &&
 	test_seq 500 >file &&
 	git add file &&
@@ -43,7 +43,7 @@ test_expect_success 'setup: 500 lines' '
 	git add newfile &&
 	git commit -q -m "add small file" &&
 
-	git cherry-pick master >/dev/null 2>&1
+	git cherry-pick main >/dev/null 2>&1
 '
 
 test_expect_success 'setup attributes' '
@@ -51,18 +51,18 @@ test_expect_success 'setup attributes' '
 '
 
 test_expect_success 'detect upstream patch' '
-	git checkout -q master &&
+	git checkout -q main &&
 	scramble file &&
 	git add file &&
 	git commit -q -m "change big file again" &&
 	git checkout -q other^{} &&
-	git rebase master &&
-	git rev-list master...HEAD~ >revs &&
+	git rebase main &&
+	git rev-list main...HEAD~ >revs &&
 	test_must_be_empty revs
 '
 
 test_expect_success 'do not drop patch' '
-	git branch -f squashed master &&
+	git branch -f squashed main &&
 	git checkout -q -f squashed &&
 	git reset -q --soft HEAD~2 &&
 	git commit -q -m squashed &&
diff --git a/t/t3420-rebase-autostash.sh b/t/t3420-rebase-autostash.sh
index 95facc49aa..4caa014c71 100755
--- a/t/t3420-rebase-autostash.sh
+++ b/t/t3420-rebase-autostash.sh
@@ -4,7 +4,7 @@
 #
 
 test_description='git rebase --autostash tests'
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -24,12 +24,12 @@ test_expect_success setup '
 	git add . &&
 	test_tick &&
 	git commit -m "third commit" &&
-	git checkout -b unrelated-onto-branch master &&
+	git checkout -b unrelated-onto-branch main &&
 	echo unrelated >file4 &&
 	git add . &&
 	test_tick &&
 	git commit -m "unrelated commit" &&
-	git checkout -b related-onto-branch master &&
+	git checkout -b related-onto-branch main &&
 	echo conflicting-change >file2 &&
 	git add . &&
 	test_tick &&
@@ -308,7 +308,7 @@ test_expect_success 'autostash is saved on editor failure with conflict' '
 '
 
 test_expect_success 'autostash with dirty submodules' '
-	test_when_finished "git reset --hard && git checkout master" &&
+	test_when_finished "git reset --hard && git checkout main" &&
 	git checkout -b with-submodule &&
 	git submodule add ./ sub &&
 	test_tick &&
@@ -327,7 +327,7 @@ test_expect_success 'branch is left alone when possible' '
 
 test_expect_success 'never change active branch' '
 	git checkout -b not-the-feature-branch unrelated-onto-branch &&
-	test_when_finished "git reset --hard && git checkout master" &&
+	test_when_finished "git reset --hard && git checkout main" &&
 	echo changed >file0 &&
 	git rebase --autostash not-the-feature-branch feature-branch &&
 	test_cmp_rev not-the-feature-branch unrelated-onto-branch
diff --git a/t/t3423-rebase-reword.sh b/t/t3423-rebase-reword.sh
index 6963750794..4859bb8f72 100755
--- a/t/t3423-rebase-reword.sh
+++ b/t/t3423-rebase-reword.sh
@@ -7,7 +7,7 @@ test_description='git rebase interactive with rewording'
 . "$TEST_DIRECTORY"/lib-rebase.sh
 
 test_expect_success 'setup' '
-	test_commit master file-1 test &&
+	test_commit main file-1 test &&
 
 	git checkout -b stuff &&
 
@@ -22,7 +22,7 @@ test_expect_success 'reword without issues functions as intended' '
 
 	set_fake_editor &&
 	FAKE_LINES="pick 1 reword 2" FAKE_COMMIT_MESSAGE="feature_b_reworded" \
-		git rebase -i -v master &&
+		git rebase -i -v main &&
 
 	test "$(git log -1 --format=%B)" = "feature_b_reworded" &&
 	test $(git rev-list --count HEAD) = 3
@@ -35,7 +35,7 @@ test_expect_success 'reword after a conflict preserves commit' '
 
 	set_fake_editor &&
 	test_must_fail env FAKE_LINES="reword 2" \
-		git rebase -i -v master &&
+		git rebase -i -v main &&
 
 	git checkout --theirs file-2 &&
 	git add file-2 &&
diff --git a/t/t3427-rebase-subtree.sh b/t/t3427-rebase-subtree.sh
index 254ed18452..e78c7e3796 100755
--- a/t/t3427-rebase-subtree.sh
+++ b/t/t3427-rebase-subtree.sh
@@ -4,7 +4,7 @@ test_description='git rebase tests for -Xsubtree
 
 This test runs git rebase and tests the subtree strategy.
 '
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -20,7 +20,7 @@ commit_message() {
 #
 # topic_1 - topic_2 - topic_3
 #                             \
-# README ---------------------- Add subproject master - topic_4 - files_subtree/topic_5
+# README ---------------------- Add subproject main - topic_4 - files_subtree/topic_5
 #
 # Where the merge moves the files topic_[123].t into the subdirectory
 # files_subtree/ and topic_4 as well as files_subtree/topic_5 add files to that
@@ -31,7 +31,7 @@ commit_message() {
 # an empty commit is added on top. The pre-rebase commit history looks like
 # this:
 #
-# Add subproject master - topic_4 - files_subtree/topic_5 - Empty commit
+# Add subproject main - topic_4 - files_subtree/topic_5 - Empty commit
 #
 # where the root commit adds three files: topic_1.t, topic_2.t and topic_3.t.
 #
@@ -51,11 +51,11 @@ test_expect_success 'setup' '
 	test_commit -C files topic_3 &&
 
 	: perform subtree merge into files_subtree/ &&
-	git fetch files refs/heads/master:refs/heads/files-master &&
+	git fetch files refs/heads/main:refs/heads/files-main &&
 	git merge -s ours --no-commit --allow-unrelated-histories \
-		files-master &&
-	git read-tree --prefix=files_subtree -u files-master &&
-	git commit -m "Add subproject master" &&
+		files-main &&
+	git read-tree --prefix=files_subtree -u files-main &&
+	git commit -m "Add subproject main" &&
 
 	: add two extra commits to rebase &&
 	test_commit -C files_subtree topic_4 &&
@@ -73,7 +73,7 @@ test_expect_success 'setup' '
 test_expect_failure REBASE_P 'Rebase -Xsubtree --preserve-merges --onto commit' '
 	reset_rebase &&
 	git checkout -b rebase-preserve-merges to-rebase &&
-	git rebase -Xsubtree=files_subtree --preserve-merges --onto files-master master &&
+	git rebase -Xsubtree=files_subtree --preserve-merges --onto files-main main &&
 	verbose test "$(commit_message HEAD~)" = "topic_4" &&
 	verbose test "$(commit_message HEAD)" = "files_subtree/topic_5"
 '
@@ -82,7 +82,7 @@ test_expect_failure REBASE_P 'Rebase -Xsubtree --preserve-merges --onto commit'
 test_expect_failure REBASE_P 'Rebase -Xsubtree --keep-empty --preserve-merges --onto commit' '
 	reset_rebase &&
 	git checkout -b rebase-keep-empty to-rebase &&
-	git rebase -Xsubtree=files_subtree --keep-empty --preserve-merges --onto files-master master &&
+	git rebase -Xsubtree=files_subtree --keep-empty --preserve-merges --onto files-main main &&
 	verbose test "$(commit_message HEAD~2)" = "topic_4" &&
 	verbose test "$(commit_message HEAD~)" = "files_subtree/topic_5" &&
 	verbose test "$(commit_message HEAD)" = "Empty commit"
@@ -91,7 +91,7 @@ test_expect_failure REBASE_P 'Rebase -Xsubtree --keep-empty --preserve-merges --
 test_expect_success 'Rebase -Xsubtree --empty=ask --onto commit' '
 	reset_rebase &&
 	git checkout -b rebase-onto to-rebase &&
-	test_must_fail git rebase -Xsubtree=files_subtree --empty=ask --onto files-master master &&
+	test_must_fail git rebase -Xsubtree=files_subtree --empty=ask --onto files-main main &&
 	: first pick results in no changes &&
 	git rebase --skip &&
 	verbose test "$(commit_message HEAD~2)" = "topic_4" &&
@@ -102,7 +102,7 @@ test_expect_success 'Rebase -Xsubtree --empty=ask --onto commit' '
 test_expect_success 'Rebase -Xsubtree --empty=ask --rebase-merges --onto commit' '
 	reset_rebase &&
 	git checkout -b rebase-merges-onto to-rebase &&
-	test_must_fail git rebase -Xsubtree=files_subtree --empty=ask --rebase-merges --onto files-master --root &&
+	test_must_fail git rebase -Xsubtree=files_subtree --empty=ask --rebase-merges --onto files-main --root &&
 	: first pick results in no changes &&
 	git rebase --skip &&
 	verbose test "$(commit_message HEAD~2)" = "topic_4" &&
diff --git a/t/t3430-rebase-merges.sh b/t/t3430-rebase-merges.sh
index 22d929bd31..6748070df5 100755
--- a/t/t3430-rebase-merges.sh
+++ b/t/t3430-rebase-merges.sh
@@ -12,13 +12,13 @@ Initial setup:
 
     -- B --                   (first)
    /       \
- A - C - D - E - H            (master)
+ A - C - D - E - H            (main)
    \    \       /
     \    F - G                (second)
      \
       Conflicting-G
 '
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -40,7 +40,7 @@ test_expect_success 'setup' '
 	git checkout -b first &&
 	test_commit B &&
 	b=$(git rev-parse --short HEAD) &&
-	git checkout master &&
+	git checkout main &&
 	test_commit C &&
 	c=$(git rev-parse --short HEAD) &&
 	test_commit D &&
@@ -55,7 +55,7 @@ test_expect_success 'setup' '
 	f=$(git rev-parse --short HEAD) &&
 	test_commit G &&
 	g=$(git rev-parse --short HEAD) &&
-	git checkout master &&
+	git checkout main &&
 	git merge --no-commit G &&
 	test_tick &&
 	git commit -m H &&
@@ -85,7 +85,7 @@ test_expect_success 'create completely different structure' '
 	EOF
 	test_config sequence.editor \""$PWD"/replace-editor.sh\" &&
 	test_tick &&
-	git rebase -i -r A master &&
+	git rebase -i -r A main &&
 	test_cmp_graph <<-\EOF
 	*   Merge the topic branch '\''onebranch'\''
 	|\
@@ -186,7 +186,7 @@ test_expect_success 'fast-forward merge -c still rewords' '
 '
 
 test_expect_success 'with a branch tip that was cherry-picked already' '
-	git checkout -b already-upstream master &&
+	git checkout -b already-upstream main &&
 	base="$(git rev-parse --verify HEAD)" &&
 
 	test_commit A1 &&
@@ -214,7 +214,7 @@ test_expect_success 'with a branch tip that was cherry-picked already' '
 '
 
 test_expect_success 'do not rebase cousins unless asked for' '
-	git checkout -b cousins master &&
+	git checkout -b cousins main &&
 	before="$(git rev-parse --verify HEAD)" &&
 	test_tick &&
 	git rebase -r HEAD^ &&
@@ -343,7 +343,7 @@ test_expect_success 'a "merge" into a root commit is a fast-forward' '
 test_expect_success 'A root commit can be a cousin, treat it that way' '
 	git checkout --orphan khnum &&
 	test_commit yama &&
-	git checkout -b asherah master &&
+	git checkout -b asherah main &&
 	test_commit shamkat &&
 	git merge --allow-unrelated-histories khnum &&
 	test_tick &&
@@ -370,7 +370,7 @@ test_expect_success 'labels that are object IDs are rewritten' '
 	git checkout -b third B &&
 	test_commit I &&
 	third=$(git rev-parse HEAD) &&
-	git checkout -b labels master &&
+	git checkout -b labels main &&
 	git merge --no-commit third &&
 	test_tick &&
 	git commit -m "Merge commit '\''$third'\'' into labels" &&
diff --git a/t/t3431-rebase-fork-point.sh b/t/t3431-rebase-fork-point.sh
index af862e5bcc..2dab893c75 100755
--- a/t/t3431-rebase-fork-point.sh
+++ b/t/t3431-rebase-fork-point.sh
@@ -5,16 +5,16 @@
 
 test_description='git rebase --fork-point test'
 
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
 
-# A---B---D---E    (master)
+# A---B---D---E    (main)
 #      \
 #       C*---F---G (side)
 #
-# C was formerly part of master but master was rewound to remove C
+# C was formerly part of main but main was rewound to remove C
 #
 test_expect_success setup '
 	test_commit A &&
@@ -33,7 +33,7 @@ test_rebase () {
 	expected="$1" &&
 	shift &&
 	test_expect_success "git rebase $*" "
-		git checkout master &&
+		git checkout main &&
 		git reset --hard E &&
 		git checkout side &&
 		git reset --hard G &&
@@ -51,26 +51,26 @@ test_rebase 'G F C E D B A' --no-fork-point
 test_rebase 'G F C D B A' --no-fork-point --onto D
 test_rebase 'G F C B A' --no-fork-point --keep-base
 
-test_rebase 'G F E D B A' --fork-point refs/heads/master
-test_rebase 'G F E D B A' --fork-point master
+test_rebase 'G F E D B A' --fork-point refs/heads/main
+test_rebase 'G F E D B A' --fork-point main
 
-test_rebase 'G F D B A' --fork-point --onto D refs/heads/master
-test_rebase 'G F D B A' --fork-point --onto D master
+test_rebase 'G F D B A' --fork-point --onto D refs/heads/main
+test_rebase 'G F D B A' --fork-point --onto D main
 
-test_rebase 'G F B A' --fork-point --keep-base refs/heads/master
-test_rebase 'G F B A' --fork-point --keep-base master
+test_rebase 'G F B A' --fork-point --keep-base refs/heads/main
+test_rebase 'G F B A' --fork-point --keep-base main
 
-test_rebase 'G F C E D B A' refs/heads/master
-test_rebase 'G F C E D B A' master
+test_rebase 'G F C E D B A' refs/heads/main
+test_rebase 'G F C E D B A' main
 
-test_rebase 'G F C D B A' --onto D refs/heads/master
-test_rebase 'G F C D B A' --onto D master
+test_rebase 'G F C D B A' --onto D refs/heads/main
+test_rebase 'G F C D B A' --onto D main
 
-test_rebase 'G F C B A' --keep-base refs/heads/master
-test_rebase 'G F C B A' --keep-base master
+test_rebase 'G F C B A' --keep-base refs/heads/main
+test_rebase 'G F C B A' --keep-base main
 
 test_expect_success 'git rebase --fork-point with ambigous refname' '
-	git checkout master &&
+	git checkout main &&
 	git checkout -b one &&
 	git checkout side &&
 	git tag one &&
diff --git a/t/t3432-rebase-fast-forward.sh b/t/t3432-rebase-fast-forward.sh
index 112a18d630..5086e14c02 100755
--- a/t/t3432-rebase-fast-forward.sh
+++ b/t/t3432-rebase-fast-forward.sh
@@ -5,7 +5,7 @@
 
 test_description='ensure rebase fast-forwards commits when possible'
 
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -87,19 +87,19 @@ test_rebase_same_head_ () {
 
 changes='no changes'
 test_rebase_same_head success noop same success work same
-test_rebase_same_head success noop same success work same master
+test_rebase_same_head success noop same success work same main
 test_rebase_same_head success noop same success work diff --onto B B
 test_rebase_same_head success noop same success work diff --onto B... B
-test_rebase_same_head success noop same success work same --onto master... master
-test_rebase_same_head success noop same success work same --keep-base master
+test_rebase_same_head success noop same success work same --onto main... main
+test_rebase_same_head success noop same success work same --keep-base main
 test_rebase_same_head success noop same success work same --keep-base
 test_rebase_same_head success noop same success work same --no-fork-point
 test_rebase_same_head success noop same success work same --keep-base --no-fork-point
-test_rebase_same_head success noop same success work same --fork-point master
+test_rebase_same_head success noop same success work same --fork-point main
 test_rebase_same_head success noop same success work diff --fork-point --onto B B
 test_rebase_same_head success noop same success work diff --fork-point --onto B... B
-test_rebase_same_head success noop same success work same --fork-point --onto master... master
-test_rebase_same_head success noop same success work same --keep-base --keep-base master
+test_rebase_same_head success noop same success work same --fork-point --onto main... main
+test_rebase_same_head success noop same success work same --keep-base --keep-base main
 
 test_expect_success 'add work same to side' '
 	test_commit E
@@ -107,22 +107,22 @@ test_expect_success 'add work same to side' '
 
 changes='our changes'
 test_rebase_same_head success noop same success work same
-test_rebase_same_head success noop same success work same master
+test_rebase_same_head success noop same success work same main
 test_rebase_same_head success noop same success work diff --onto B B
 test_rebase_same_head success noop same success work diff --onto B... B
-test_rebase_same_head success noop same success work same --onto master... master
-test_rebase_same_head success noop same success work same --keep-base master
+test_rebase_same_head success noop same success work same --onto main... main
+test_rebase_same_head success noop same success work same --keep-base main
 test_rebase_same_head success noop same success work same --keep-base
 test_rebase_same_head success noop same success work same --no-fork-point
 test_rebase_same_head success noop same success work same --keep-base --no-fork-point
-test_rebase_same_head success noop same success work same --fork-point master
+test_rebase_same_head success noop same success work same --fork-point main
 test_rebase_same_head success noop same success work diff --fork-point --onto B B
 test_rebase_same_head success noop same success work diff --fork-point --onto B... B
-test_rebase_same_head success noop same success work same --fork-point --onto master... master
-test_rebase_same_head success noop same success work same --fork-point --keep-base master
+test_rebase_same_head success noop same success work same --fork-point --onto main... main
+test_rebase_same_head success noop same success work same --fork-point --keep-base main
 
 test_expect_success 'add work same to upstream' '
-	git checkout master &&
+	git checkout main &&
 	test_commit F &&
 	git checkout side
 '
@@ -130,12 +130,12 @@ test_expect_success 'add work same to upstream' '
 changes='our and their changes'
 test_rebase_same_head success noop same success work diff --onto B B
 test_rebase_same_head success noop same success work diff --onto B... B
-test_rebase_same_head success noop same success work diff --onto master... master
-test_rebase_same_head success noop same success work diff --keep-base master
+test_rebase_same_head success noop same success work diff --onto main... main
+test_rebase_same_head success noop same success work diff --keep-base main
 test_rebase_same_head success noop same success work diff --keep-base
 test_rebase_same_head failure work same success work diff --fork-point --onto B B
 test_rebase_same_head failure work same success work diff --fork-point --onto B... B
-test_rebase_same_head success noop same success work diff --fork-point --onto master... master
-test_rebase_same_head success noop same success work diff --fork-point --keep-base master
+test_rebase_same_head success noop same success work diff --fork-point --onto main... main
+test_rebase_same_head success noop same success work diff --fork-point --keep-base main
 
 test_done
diff --git a/t/t3434-rebase-i18n.sh b/t/t3434-rebase-i18n.sh
index 26fd33cbed..e6fef696bb 100755
--- a/t/t3434-rebase-i18n.sh
+++ b/t/t3434-rebase-i18n.sh
@@ -7,14 +7,14 @@ test_description='rebase with changing encoding
 
 Initial setup:
 
-1 - 2              master
+1 - 2              main
  \
   3 - 4            first
    \
     5 - 6          second
 '
 
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -44,7 +44,7 @@ test_expect_success 'rebase --rebase-merges update encoding eucJP to UTF-8' '
 	git config i18n.commitencoding eucJP &&
 	git merge -F "$TEST_DIRECTORY/t3434/eucJP.txt" second &&
 	git config i18n.commitencoding UTF-8 &&
-	git rebase --rebase-merges master &&
+	git rebase --rebase-merges main &&
 	compare_msg eucJP.txt eucJP UTF-8
 '
 
@@ -53,7 +53,7 @@ test_expect_success 'rebase --rebase-merges update encoding eucJP to ISO-2022-JP
 	git config i18n.commitencoding eucJP &&
 	git merge -F "$TEST_DIRECTORY/t3434/eucJP.txt" second &&
 	git config i18n.commitencoding ISO-2022-JP &&
-	git rebase --rebase-merges master &&
+	git rebase --rebase-merges main &&
 	compare_msg eucJP.txt eucJP ISO-2022-JP
 '
 
@@ -69,7 +69,7 @@ test_rebase_continue_update_encode () {
 		git config i18n.commitencoding $old &&
 		git commit -F "$TEST_DIRECTORY/t3434/$msgfile" &&
 		git config i18n.commitencoding $new &&
-		test_must_fail git rebase -m master &&
+		test_must_fail git rebase -m main &&
 		test -f .git/rebase-merge/message &&
 		git stripspace <.git/rebase-merge/message >two.t &&
 		git add two.t &&
diff --git a/t/t3435-rebase-gpg-sign.sh b/t/t3435-rebase-gpg-sign.sh
index d169bc511d..ec10766858 100755
--- a/t/t3435-rebase-gpg-sign.sh
+++ b/t/t3435-rebase-gpg-sign.sh
@@ -5,7 +5,7 @@
 
 test_description='test rebase --[no-]gpg-sign'
 
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -49,7 +49,7 @@ test_expect_success 'setup: merge commit' '
 	test_commit fork-point &&
 	git switch -c side &&
 	test_commit three &&
-	git switch master &&
+	git switch main &&
 	git merge --no-ff side &&
 	git tag merged
 '
@@ -67,7 +67,7 @@ test_rebase_gpg_sign   false -i --no-gpg-sign --gpg-sign
 test_expect_failure 'rebase -p --no-gpg-sign override commit.gpgsign' '
 	git reset --hard merged &&
 	git config commit.gpgsign true &&
-	git rebase -p --no-gpg-sign --onto=one fork-point master &&
+	git rebase -p --no-gpg-sign --onto=one fork-point main &&
 	test_must_fail git verify-commit HEAD
 '
 
diff --git a/t/t3436-rebase-more-options.sh b/t/t3436-rebase-more-options.sh
index eaaf4c8d1d..4d106642ba 100755
--- a/t/t3436-rebase-more-options.sh
+++ b/t/t3436-rebase-more-options.sh
@@ -28,7 +28,7 @@ test_expect_success 'setup' '
 	test_commit commit2 foo foo2 &&
 	test_commit commit3 foo foo3 &&
 
-	git checkout --orphan master &&
+	git checkout --orphan main &&
 	rm foo &&
 	test_write_lines "line 1" "        line 2" "line 3" >file &&
 	git commit -am "add file" &&
-- 
gitgitgadget


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH v3 08/28] t3[5-9]*: adjust the references to the default branch name "main"
  2020-11-18 23:44   ` [PATCH v3 00/28] tests: use main as default branch name Johannes Schindelin via GitGitGadget
                       ` (6 preceding siblings ...)
  2020-11-18 23:44     ` [PATCH v3 07/28] t34*: adjust the references to the default branch name "main" Johannes Schindelin via GitGitGadget
@ 2020-11-18 23:44     ` Johannes Schindelin via GitGitGadget
  2020-11-18 23:44     ` [PATCH v3 09/28] t4*: " Johannes Schindelin via GitGitGadget
                       ` (20 subsequent siblings)
  28 siblings, 0 replies; 163+ messages in thread
From: Johannes Schindelin via GitGitGadget @ 2020-11-18 23:44 UTC (permalink / raw)
  To: git
  Cc: Felipe Contreras, Ævar Arnfjörð Bjarmason,
	Johannes Schindelin, Jeff King, Jonathan Nieder,
	Johannes Schindelin, Johannes Schindelin

From: Johannes Schindelin <johannes.schindelin@gmx.de>

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>
---
 t/t3500-cherry.sh                   | 14 +++++-----
 t/t3501-revert-cherry-pick.sh       |  6 ++---
 t/t3502-cherry-pick-merge.sh        |  4 +--
 t/t3503-cherry-pick-root.sh         | 12 ++++-----
 t/t3504-cherry-pick-rerere.sh       | 26 +++++++++---------
 t/t3505-cherry-pick-empty.sh        | 26 +++++++++---------
 t/t3506-cherry-pick-ff.sh           | 10 +++----
 t/t3507-cherry-pick-conflict.sh     |  4 +--
 t/t3508-cherry-pick-many-commits.sh | 40 +++++++++++++--------------
 t/t3509-cherry-pick-merge-df.sh     |  4 +--
 t/t3512-cherry-pick-submodule.sh    |  4 +--
 t/t3600-rm.sh                       | 12 ++++-----
 t/t3701-add-interactive.sh          |  6 ++---
 t/t3901-i18n-patch.sh               | 42 ++++++++++++++---------------
 t/t3903-stash.sh                    | 34 +++++++++++------------
 t/t3910-mac-os-precompose.sh        |  8 +++---
 16 files changed, 126 insertions(+), 126 deletions(-)

diff --git a/t/t3500-cherry.sh b/t/t3500-cherry.sh
index 99905dd49a..0458a58b4b 100755
--- a/t/t3500-cherry.sh
+++ b/t/t3500-cherry.sh
@@ -5,10 +5,10 @@
 
 test_description='git cherry should detect patches integrated upstream
 
-This test cherry-picks one local change of two into master branch, and
+This test cherry-picks one local change of two into main branch, and
 checks that git cherry only returns the second patch in the local branch
 '
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -35,7 +35,7 @@ test_expect_success \
      test_tick &&
      git commit -m "Add C." &&
 
-     git checkout -f master &&
+     git checkout -f main &&
      rm -f B C &&
 
      echo Third >> A &&
@@ -43,19 +43,19 @@ test_expect_success \
      test_tick &&
      git commit -m "Modify A." &&
 
-     expr "$(echo $(git cherry master my-topic-branch) )" : "+ [^ ]* + .*"
+     expr "$(echo $(git cherry main my-topic-branch) )" : "+ [^ ]* + .*"
 '
 
 test_expect_success \
     'check that cherry with limit returns only the top patch'\
-    'expr "$(echo $(git cherry master my-topic-branch my-topic-branch^1) )" : "+ [^ ]*"
+    'expr "$(echo $(git cherry main my-topic-branch my-topic-branch^1) )" : "+ [^ ]*"
 '
 
 test_expect_success \
     'cherry-pick one of the 2 patches, and check cherry recognized one and only one as new' \
     'git cherry-pick my-topic-branch^0 &&
-     echo $(git cherry master my-topic-branch) &&
-     expr "$(echo $(git cherry master my-topic-branch) )" : "+ [^ ]* - .*"
+     echo $(git cherry main my-topic-branch) &&
+     expr "$(echo $(git cherry main my-topic-branch) )" : "+ [^ ]* - .*"
 '
 
 test_expect_success 'cherry ignores whitespace' '
diff --git a/t/t3501-revert-cherry-pick.sh b/t/t3501-revert-cherry-pick.sh
index 6a10714e22..9d100cd188 100755
--- a/t/t3501-revert-cherry-pick.sh
+++ b/t/t3501-revert-cherry-pick.sh
@@ -10,7 +10,7 @@ test_description='test cherry-pick and revert with renames
 
 '
 
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -115,7 +115,7 @@ test_expect_success 'cherry-pick on unborn branch' '
 test_expect_success 'cherry-pick "-" to pick from previous branch' '
 	git checkout unborn &&
 	test_commit to-pick actual content &&
-	git checkout master &&
+	git checkout main &&
 	git cherry-pick - &&
 	echo content >expect &&
 	test_cmp expect actual
@@ -135,7 +135,7 @@ test_expect_success 'cherry-pick "-" is meaningless without checkout' '
 test_expect_success 'cherry-pick "-" works with arguments' '
 	git checkout -b side-branch &&
 	test_commit change actual change &&
-	git checkout master &&
+	git checkout main &&
 	git cherry-pick -s - &&
 	echo "Signed-off-by: C O Mitter <committer@example.com>" >expect &&
 	git cat-file commit HEAD | grep ^Signed-off-by: >signoff &&
diff --git a/t/t3502-cherry-pick-merge.sh b/t/t3502-cherry-pick-merge.sh
index 774ad9ce14..5495eacfec 100755
--- a/t/t3502-cherry-pick-merge.sh
+++ b/t/t3502-cherry-pick-merge.sh
@@ -8,7 +8,7 @@ test_description='cherry picking and reverting a merge
 
 '
 
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -28,7 +28,7 @@ test_expect_success setup '
 	echo new line >B &&
 	git commit -m "add line to B" B &&
 	git tag b &&
-	git checkout master &&
+	git checkout main &&
 	git merge side &&
 	git tag c
 
diff --git a/t/t3503-cherry-pick-root.sh b/t/t3503-cherry-pick-root.sh
index 00c622d5dc..95fe4feaee 100755
--- a/t/t3503-cherry-pick-root.sh
+++ b/t/t3503-cherry-pick-root.sh
@@ -2,7 +2,7 @@
 
 test_description='test cherry-picking (and reverting) a root commit'
 
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -33,7 +33,7 @@ test_expect_success setup '
 test_expect_success 'cherry-pick a root commit' '
 
 	git checkout second^0 &&
-	git cherry-pick master &&
+	git cherry-pick main &&
 	echo first >expect &&
 	test_cmp expect file1
 
@@ -41,14 +41,14 @@ test_expect_success 'cherry-pick a root commit' '
 
 test_expect_success 'revert a root commit' '
 
-	git revert master &&
+	git revert main &&
 	test_path_is_missing file1
 
 '
 
 test_expect_success 'cherry-pick a root commit with an external strategy' '
 
-	git cherry-pick --strategy=resolve master &&
+	git cherry-pick --strategy=resolve main &&
 	echo first >expect &&
 	test_cmp expect file1
 
@@ -56,7 +56,7 @@ test_expect_success 'cherry-pick a root commit with an external strategy' '
 
 test_expect_success 'revert a root commit with an external strategy' '
 
-	git revert --strategy=resolve master &&
+	git revert --strategy=resolve main &&
 	test_path_is_missing file1
 
 '
@@ -68,7 +68,7 @@ test_expect_success 'cherry-pick two root commits' '
 	echo third >expect.file3 &&
 
 	git checkout second^0 &&
-	git cherry-pick master third &&
+	git cherry-pick main third &&
 
 	test_cmp expect.file1 file1 &&
 	test_cmp expect.file2 file2 &&
diff --git a/t/t3504-cherry-pick-rerere.sh b/t/t3504-cherry-pick-rerere.sh
index 860ba0b496..9198535874 100755
--- a/t/t3504-cherry-pick-rerere.sh
+++ b/t/t3504-cherry-pick-rerere.sh
@@ -2,15 +2,15 @@
 
 test_description='cherry-pick should rerere for conflicts'
 
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
 
 test_expect_success setup '
 	test_commit foo &&
-	test_commit foo-master foo &&
-	test_commit bar-master bar &&
+	test_commit foo-main foo &&
+	test_commit bar-main bar &&
 
 	git checkout -b dev foo &&
 	test_commit foo-dev foo &&
@@ -19,7 +19,7 @@ test_expect_success setup '
 '
 
 test_expect_success 'conflicting merge' '
-	test_must_fail git merge master
+	test_must_fail git merge main
 '
 
 test_expect_success 'fixup' '
@@ -32,7 +32,7 @@ test_expect_success 'fixup' '
 '
 
 test_expect_success 'cherry-pick conflict with --rerere-autoupdate' '
-	test_must_fail git cherry-pick --rerere-autoupdate foo..bar-master &&
+	test_must_fail git cherry-pick --rerere-autoupdate foo..bar-main &&
 	test_cmp foo-expect foo &&
 	git diff-files --quiet &&
 	test_must_fail git cherry-pick --continue &&
@@ -44,7 +44,7 @@ test_expect_success 'cherry-pick conflict with --rerere-autoupdate' '
 
 test_expect_success 'cherry-pick conflict repsects rerere.autoUpdate' '
 	test_config rerere.autoUpdate true &&
-	test_must_fail git cherry-pick foo..bar-master &&
+	test_must_fail git cherry-pick foo..bar-main &&
 	test_cmp foo-expect foo &&
 	git diff-files --quiet &&
 	test_must_fail git cherry-pick --continue &&
@@ -56,7 +56,7 @@ test_expect_success 'cherry-pick conflict repsects rerere.autoUpdate' '
 
 test_expect_success 'cherry-pick conflict with --no-rerere-autoupdate' '
 	test_config rerere.autoUpdate true &&
-	test_must_fail git cherry-pick --no-rerere-autoupdate foo..bar-master &&
+	test_must_fail git cherry-pick --no-rerere-autoupdate foo..bar-main &&
 	test_cmp foo-expect foo &&
 	test_must_fail git diff-files --quiet &&
 	git add foo &&
@@ -69,7 +69,7 @@ test_expect_success 'cherry-pick conflict with --no-rerere-autoupdate' '
 '
 
 test_expect_success 'cherry-pick --continue rejects --rerere-autoupdate' '
-	test_must_fail git cherry-pick --rerere-autoupdate foo..bar-master &&
+	test_must_fail git cherry-pick --rerere-autoupdate foo..bar-main &&
 	test_cmp foo-expect foo &&
 	git diff-files --quiet &&
 	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' '
 '
 
 test_expect_success 'cherry-pick --rerere-autoupdate more than once' '
-	test_must_fail git cherry-pick --rerere-autoupdate --rerere-autoupdate foo..bar-master &&
+	test_must_fail git cherry-pick --rerere-autoupdate --rerere-autoupdate foo..bar-main &&
 	test_cmp foo-expect foo &&
 	git diff-files --quiet &&
 	git cherry-pick --abort &&
-	test_must_fail git cherry-pick --rerere-autoupdate --no-rerere-autoupdate --rerere-autoupdate foo..bar-master &&
+	test_must_fail git cherry-pick --rerere-autoupdate --no-rerere-autoupdate --rerere-autoupdate foo..bar-main &&
 	test_cmp foo-expect foo &&
 	git diff-files --quiet &&
 	git cherry-pick --abort &&
-	test_must_fail git cherry-pick --rerere-autoupdate --no-rerere-autoupdate foo..bar-master &&
+	test_must_fail git cherry-pick --rerere-autoupdate --no-rerere-autoupdate foo..bar-main &&
 	test_must_fail git diff-files --quiet &&
 	git cherry-pick --abort
 '
 
 test_expect_success 'cherry-pick conflict without rerere' '
 	test_config rerere.enabled false &&
-	test_must_fail git cherry-pick foo-master &&
+	test_must_fail git cherry-pick foo-main &&
 	grep ===== foo &&
 	grep foo-dev foo &&
-	grep foo-master foo
+	grep foo-main foo
 '
 
 test_done
diff --git a/t/t3505-cherry-pick-empty.sh b/t/t3505-cherry-pick-empty.sh
index 20cd4052d4..eba3c38d5a 100755
--- a/t/t3505-cherry-pick-empty.sh
+++ b/t/t3505-cherry-pick-empty.sh
@@ -2,7 +2,7 @@
 
 test_description='test cherry-picking an empty commit'
 
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -20,7 +20,7 @@ test_expect_success setup '
 	test_tick &&
 	git commit --allow-empty-message -m "" &&
 
-	git checkout master &&
+	git checkout main &&
 	git checkout -b empty-change-branch &&
 	test_tick &&
 	git commit --allow-empty -m "empty"
@@ -28,7 +28,7 @@ test_expect_success setup '
 '
 
 test_expect_success 'cherry-pick an empty commit' '
-	git checkout master &&
+	git checkout main &&
 	test_expect_code 1 git cherry-pick empty-change-branch
 '
 
@@ -38,7 +38,7 @@ test_expect_success 'index lockfile was removed' '
 
 test_expect_success 'cherry-pick a commit with an empty message' '
 	test_when_finished "git reset --hard empty-message-branch~1" &&
-	git checkout master &&
+	git checkout main &&
 	git cherry-pick empty-message-branch
 '
 
@@ -47,12 +47,12 @@ test_expect_success 'index lockfile was removed' '
 '
 
 test_expect_success 'cherry-pick a commit with an empty message with --allow-empty-message' '
-	git checkout -f master &&
+	git checkout -f main &&
 	git cherry-pick --allow-empty-message empty-message-branch
 '
 
 test_expect_success 'cherry pick an empty non-ff commit without --allow-empty' '
-	git checkout master &&
+	git checkout main &&
 	echo fourth >>file2 &&
 	git add file2 &&
 	git commit -m "fourth" &&
@@ -60,22 +60,22 @@ test_expect_success 'cherry pick an empty non-ff commit without --allow-empty' '
 '
 
 test_expect_success 'cherry pick an empty non-ff commit with --allow-empty' '
-	git checkout master &&
+	git checkout main &&
 	git cherry-pick --allow-empty empty-change-branch
 '
 
 test_expect_success 'cherry pick with --keep-redundant-commits' '
-	git checkout master &&
+	git checkout main &&
 	git cherry-pick --keep-redundant-commits HEAD^
 '
 
 test_expect_success 'cherry-pick a commit that becomes no-op (prep)' '
-	git checkout master &&
+	git checkout main &&
 	git branch fork &&
 	echo foo >file2 &&
 	git add file2 &&
 	test_tick &&
-	git commit -m "add file2 on master" &&
+	git commit -m "add file2 on main" &&
 
 	git checkout fork &&
 	echo foo >file2 &&
@@ -87,15 +87,15 @@ test_expect_success 'cherry-pick a commit that becomes no-op (prep)' '
 test_expect_success 'cherry-pick a no-op without --keep-redundant' '
 	git reset --hard &&
 	git checkout fork^0 &&
-	test_must_fail git cherry-pick master
+	test_must_fail git cherry-pick main
 '
 
 test_expect_success 'cherry-pick a no-op with --keep-redundant' '
 	git reset --hard &&
 	git checkout fork^0 &&
-	git cherry-pick --keep-redundant-commits master &&
+	git cherry-pick --keep-redundant-commits main &&
 	git show -s --format=%s >actual &&
-	echo "add file2 on master" >expect &&
+	echo "add file2 on main" >expect &&
 	test_cmp expect actual
 '
 
diff --git a/t/t3506-cherry-pick-ff.sh b/t/t3506-cherry-pick-ff.sh
index a105a782f6..7e11bd4a4c 100755
--- a/t/t3506-cherry-pick-ff.sh
+++ b/t/t3506-cherry-pick-ff.sh
@@ -2,7 +2,7 @@
 
 test_description='test cherry-picking with --ff option'
 
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -27,7 +27,7 @@ test_expect_success setup '
 '
 
 test_expect_success 'cherry-pick using --ff fast forwards' '
-	git checkout master &&
+	git checkout main &&
 	git reset --hard first &&
 	test_tick &&
 	git cherry-pick --ff second &&
@@ -35,7 +35,7 @@ test_expect_success 'cherry-pick using --ff fast forwards' '
 '
 
 test_expect_success 'cherry-pick not using --ff does not fast forwards' '
-	git checkout master &&
+	git checkout main &&
 	git reset --hard first &&
 	test_tick &&
 	git cherry-pick second &&
@@ -52,7 +52,7 @@ test_expect_success 'cherry-pick not using --ff does not fast forwards' '
 # (This has been taken from t3502-cherry-pick-merge.sh)
 #
 test_expect_success 'merge setup' '
-	git checkout master &&
+	git checkout main &&
 	git reset --hard first &&
 	echo new line >A &&
 	git add A &&
@@ -65,7 +65,7 @@ test_expect_success 'merge setup' '
 	test_tick &&
 	git commit -m "add line to B" B &&
 	git tag B &&
-	git checkout master &&
+	git checkout main &&
 	git merge side &&
 	git tag C &&
 	git checkout -b new A
diff --git a/t/t3507-cherry-pick-conflict.sh b/t/t3507-cherry-pick-conflict.sh
index e94264e578..5f4564c830 100755
--- a/t/t3507-cherry-pick-conflict.sh
+++ b/t/t3507-cherry-pick-conflict.sh
@@ -9,7 +9,7 @@ test_description='test cherry-pick and revert with conflicts
 
 '
 
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -32,7 +32,7 @@ test_expect_success setup '
 	test_commit redundant-pick foo c redundant &&
 	git commit --allow-empty --allow-empty-message &&
 	git tag empty &&
-	git checkout master &&
+	git checkout main &&
 	git config advice.detachedhead false
 
 '
diff --git a/t/t3508-cherry-pick-many-commits.sh b/t/t3508-cherry-pick-many-commits.sh
index b967bf0639..ec7a2c9fcf 100755
--- a/t/t3508-cherry-pick-many-commits.sh
+++ b/t/t3508-cherry-pick-many-commits.sh
@@ -2,7 +2,7 @@
 
 test_description='test cherry-picking many commits'
 
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -34,7 +34,7 @@ test_expect_success setup '
 '
 
 test_expect_success 'cherry-pick first..fourth works' '
-	git checkout -f master &&
+	git checkout -f main &&
 	git reset --hard first &&
 	test_tick &&
 	git cherry-pick first..fourth &&
@@ -48,7 +48,7 @@ test_expect_success 'cherry-pick three one two works' '
 	test_commit one &&
 	test_commit two &&
 	test_commit three &&
-	git checkout -f master &&
+	git checkout -f main &&
 	git reset --hard first &&
 	git cherry-pick three one two &&
 	git diff --quiet three &&
@@ -59,28 +59,28 @@ two"
 '
 
 test_expect_success 'cherry-pick three one two: fails' '
-	git checkout -f master &&
+	git checkout -f main &&
 	git reset --hard first &&
 	test_must_fail git cherry-pick three one two:
 '
 
 test_expect_success 'output to keep user entertained during multi-pick' '
 	cat <<-\EOF >expected &&
-	[master OBJID] second
+	[main OBJID] second
 	 Author: A U Thor <author@example.com>
 	 Date: Thu Apr 7 15:14:13 2005 -0700
 	 1 file changed, 1 insertion(+)
-	[master OBJID] third
+	[main OBJID] third
 	 Author: A U Thor <author@example.com>
 	 Date: Thu Apr 7 15:15:13 2005 -0700
 	 1 file changed, 1 insertion(+)
-	[master OBJID] fourth
+	[main OBJID] fourth
 	 Author: A U Thor <author@example.com>
 	 Date: Thu Apr 7 15:16:13 2005 -0700
 	 1 file changed, 1 insertion(+)
 	EOF
 
-	git checkout -f master &&
+	git checkout -f main &&
 	git reset --hard first &&
 	test_tick &&
 	git cherry-pick first..fourth >actual &&
@@ -90,7 +90,7 @@ test_expect_success 'output to keep user entertained during multi-pick' '
 '
 
 test_expect_success 'cherry-pick --strategy resolve first..fourth works' '
-	git checkout -f master &&
+	git checkout -f main &&
 	git reset --hard first &&
 	test_tick &&
 	git cherry-pick --strategy resolve first..fourth &&
@@ -102,23 +102,23 @@ test_expect_success 'cherry-pick --strategy resolve first..fourth works' '
 test_expect_success 'output during multi-pick indicates merge strategy' '
 	cat <<-\EOF >expected &&
 	Trying simple merge.
-	[master OBJID] second
+	[main OBJID] second
 	 Author: A U Thor <author@example.com>
 	 Date: Thu Apr 7 15:14:13 2005 -0700
 	 1 file changed, 1 insertion(+)
 	Trying simple merge.
-	[master OBJID] third
+	[main OBJID] third
 	 Author: A U Thor <author@example.com>
 	 Date: Thu Apr 7 15:15:13 2005 -0700
 	 1 file changed, 1 insertion(+)
 	Trying simple merge.
-	[master OBJID] fourth
+	[main OBJID] fourth
 	 Author: A U Thor <author@example.com>
 	 Date: Thu Apr 7 15:16:13 2005 -0700
 	 1 file changed, 1 insertion(+)
 	EOF
 
-	git checkout -f master &&
+	git checkout -f main &&
 	git reset --hard first &&
 	test_tick &&
 	git cherry-pick --strategy resolve first..fourth >actual &&
@@ -127,7 +127,7 @@ test_expect_success 'output during multi-pick indicates merge strategy' '
 '
 
 test_expect_success 'cherry-pick --ff first..fourth works' '
-	git checkout -f master &&
+	git checkout -f main &&
 	git reset --hard first &&
 	test_tick &&
 	git cherry-pick --ff first..fourth &&
@@ -137,7 +137,7 @@ test_expect_success 'cherry-pick --ff first..fourth works' '
 '
 
 test_expect_success 'cherry-pick -n first..fourth works' '
-	git checkout -f master &&
+	git checkout -f main &&
 	git reset --hard first &&
 	test_tick &&
 	git cherry-pick -n first..fourth &&
@@ -147,7 +147,7 @@ test_expect_success 'cherry-pick -n first..fourth works' '
 '
 
 test_expect_success 'revert first..fourth works' '
-	git checkout -f master &&
+	git checkout -f main &&
 	git reset --hard fourth &&
 	test_tick &&
 	git revert first..fourth &&
@@ -157,7 +157,7 @@ test_expect_success 'revert first..fourth works' '
 '
 
 test_expect_success 'revert ^first fourth works' '
-	git checkout -f master &&
+	git checkout -f main &&
 	git reset --hard fourth &&
 	test_tick &&
 	git revert ^first fourth &&
@@ -167,7 +167,7 @@ test_expect_success 'revert ^first fourth works' '
 '
 
 test_expect_success 'revert fourth fourth~1 fourth~2 works' '
-	git checkout -f master &&
+	git checkout -f main &&
 	git reset --hard fourth &&
 	test_tick &&
 	git revert fourth fourth~1 fourth~2 &&
@@ -177,7 +177,7 @@ test_expect_success 'revert fourth fourth~1 fourth~2 works' '
 '
 
 test_expect_success 'cherry-pick -3 fourth works' '
-	git checkout -f master &&
+	git checkout -f main &&
 	git reset --hard first &&
 	test_tick &&
 	git cherry-pick -3 fourth &&
@@ -187,7 +187,7 @@ test_expect_success 'cherry-pick -3 fourth works' '
 '
 
 test_expect_success 'cherry-pick --stdin works' '
-	git checkout -f master &&
+	git checkout -f main &&
 	git reset --hard first &&
 	test_tick &&
 	git rev-list --reverse first..fourth | git cherry-pick --stdin &&
diff --git a/t/t3509-cherry-pick-merge-df.sh b/t/t3509-cherry-pick-merge-df.sh
index 83cab7b2ed..f4159246e1 100755
--- a/t/t3509-cherry-pick-merge-df.sh
+++ b/t/t3509-cherry-pick-merge-df.sh
@@ -1,7 +1,7 @@
 #!/bin/sh
 
 test_description='Test cherry-pick with directory/file conflicts'
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -31,7 +31,7 @@ test_expect_success 'Setup rename across paths each below D/F conflicts' '
 
 test_expect_success 'Cherry-pick succeeds with rename across D/F conflicts' '
 	git reset --hard &&
-	git checkout master^0 &&
+	git checkout main^0 &&
 	git cherry-pick branch
 '
 
diff --git a/t/t3512-cherry-pick-submodule.sh b/t/t3512-cherry-pick-submodule.sh
index ff33c6d5c9..822f2d4bfb 100755
--- a/t/t3512-cherry-pick-submodule.sh
+++ b/t/t3512-cherry-pick-submodule.sh
@@ -2,7 +2,7 @@
 
 test_description='cherry-pick can handle submodules'
 
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -38,7 +38,7 @@ test_expect_success 'unrelated submodule/file conflict is ignored' '
 		git add a_file &&
 		git commit -m "modify a file" &&
 
-		git checkout master &&
+		git checkout main &&
 
 		git submodule add ../sub sub &&
 		git submodule update sub &&
diff --git a/t/t3600-rm.sh b/t/t3600-rm.sh
index 3baa64bf99..dff1228669 100755
--- a/t/t3600-rm.sh
+++ b/t/t3600-rm.sh
@@ -5,7 +5,7 @@
 
 test_description='Test of the various options to git rm.'
 
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -486,16 +486,16 @@ test_expect_success 'setup submodule conflict' '
 	echo 1 >nitfol &&
 	git add nitfol &&
 	git commit -m "added nitfol 1" &&
-	git checkout -b branch2 master &&
+	git checkout -b branch2 main &&
 	echo 2 >nitfol &&
 	git add nitfol &&
 	git commit -m "added nitfol 2" &&
-	git checkout -b conflict1 master &&
+	git checkout -b conflict1 main &&
 	git -C submod fetch &&
 	git -C submod checkout branch1 &&
 	git add submod &&
 	git commit -m "submod 1" &&
-	git checkout -b conflict2 master &&
+	git checkout -b conflict2 main &&
 	git -C submod checkout branch2 &&
 	git add submod &&
 	git commit -m "submod 2"
@@ -607,7 +607,7 @@ test_expect_success 'rm of a conflicted unpopulated submodule succeeds' '
 '
 
 test_expect_success 'rm of a populated submodule with a .git directory migrates git dir' '
-	git checkout -f master &&
+	git checkout -f main &&
 	git reset --hard &&
 	git submodule update &&
 	(
@@ -720,7 +720,7 @@ test_expect_success 'checking out a commit after submodule removal needs manual
 	git checkout HEAD^ &&
 	git submodule update &&
 	git checkout -q HEAD^ &&
-	git checkout -q master 2>actual &&
+	git checkout -q main 2>actual &&
 	test_i18ngrep "^warning: unable to rmdir '\''submod'\'':" actual &&
 	git status -s submod >actual &&
 	echo "?? submod/" >expected &&
diff --git a/t/t3701-add-interactive.sh b/t/t3701-add-interactive.sh
index 9be7527531..8c7f23cc53 100755
--- a/t/t3701-add-interactive.sh
+++ b/t/t3701-add-interactive.sh
@@ -1,7 +1,7 @@
 #!/bin/sh
 
 test_description='add -i basic tests'
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -552,8 +552,8 @@ test_expect_success 'patch mode ignores unmerged entries' '
 	test_commit non-conflict &&
 	git checkout -b side &&
 	test_commit side conflict.t &&
-	git checkout master &&
-	test_commit master conflict.t &&
+	git checkout main &&
+	test_commit main conflict.t &&
 	test_must_fail git merge side &&
 	echo changed >non-conflict.t &&
 	echo y | git add -p >output &&
diff --git a/t/t3901-i18n-patch.sh b/t/t3901-i18n-patch.sh
index bde27227b6..4f16a735d9 100755
--- a/t/t3901-i18n-patch.sh
+++ b/t/t3901-i18n-patch.sh
@@ -5,7 +5,7 @@
 
 test_description='i18n settings and format-patch | am pipe'
 
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -48,7 +48,7 @@ test_expect_success setup '
 
 	# the first commit on the side branch is UTF-8
 	test_tick &&
-	git checkout -b side master^ &&
+	git checkout -b side main^ &&
 	echo Another file >yours &&
 	git add yours &&
 	git commit -s -m "Second on side" &&
@@ -72,7 +72,7 @@ test_expect_success setup '
 test_expect_success 'format-patch output (ISO-8859-1)' '
 	git config i18n.logoutputencoding ISO8859-1 &&
 
-	git format-patch --stdout master..HEAD^ >out-l1 &&
+	git format-patch --stdout main..HEAD^ >out-l1 &&
 	git format-patch --stdout HEAD^ >out-l2 &&
 	grep "^Content-Type: text/plain; charset=ISO8859-1" out-l1 &&
 	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)' '
 test_expect_success 'format-patch output (UTF-8)' '
 	git config i18n.logoutputencoding UTF-8 &&
 
-	git format-patch --stdout master..HEAD^ >out-u1 &&
+	git format-patch --stdout main..HEAD^ >out-u1 &&
 	git format-patch --stdout HEAD^ >out-u2 &&
 	grep "^Content-Type: text/plain; charset=UTF-8" out-u1 &&
 	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)' '
 	# we want UTF-8 encoded name.
 	. "$TEST_DIRECTORY"/t3901/utf8.txt &&
 	git checkout -b test &&
-	git rebase master &&
+	git rebase main &&
 
 	check_encoding 2
 '
@@ -116,7 +116,7 @@ test_expect_success 'rebase (U/L)' '
 	. "$TEST_DIRECTORY"/t3901/utf8.txt &&
 
 	git reset --hard side &&
-	git rebase master &&
+	git rebase main &&
 
 	check_encoding 2
 '
@@ -128,7 +128,7 @@ test_expect_success !MINGW 'rebase (L/L)' '
 	. "$TEST_DIRECTORY"/t3901/8859-1.txt &&
 
 	git reset --hard side &&
-	git rebase master &&
+	git rebase main &&
 
 	check_encoding 2 8859
 '
@@ -141,7 +141,7 @@ test_expect_success !MINGW 'rebase (L/U)' '
 	. "$TEST_DIRECTORY"/t3901/8859-1.txt &&
 
 	git reset --hard side &&
-	git rebase master &&
+	git rebase main &&
 
 	check_encoding 2 8859
 '
@@ -153,7 +153,7 @@ test_expect_success 'cherry-pick(U/U)' '
 	git config i18n.logoutputencoding UTF-8 &&
 	. "$TEST_DIRECTORY"/t3901/utf8.txt &&
 
-	git reset --hard master &&
+	git reset --hard main &&
 	git cherry-pick side^ &&
 	git cherry-pick side &&
 	git revert HEAD &&
@@ -168,7 +168,7 @@ test_expect_success !MINGW 'cherry-pick(L/L)' '
 	git config i18n.logoutputencoding ISO8859-1 &&
 	. "$TEST_DIRECTORY"/t3901/8859-1.txt &&
 
-	git reset --hard master &&
+	git reset --hard main &&
 	git cherry-pick side^ &&
 	git cherry-pick side &&
 	git revert HEAD &&
@@ -183,7 +183,7 @@ test_expect_success 'cherry-pick(U/L)' '
 	git config i18n.logoutputencoding ISO8859-1 &&
 	. "$TEST_DIRECTORY"/t3901/utf8.txt &&
 
-	git reset --hard master &&
+	git reset --hard main &&
 	git cherry-pick side^ &&
 	git cherry-pick side &&
 	git revert HEAD &&
@@ -199,7 +199,7 @@ test_expect_success !MINGW 'cherry-pick(L/U)' '
 	git config i18n.logoutputencoding UTF-8 &&
 	. "$TEST_DIRECTORY"/t3901/8859-1.txt &&
 
-	git reset --hard master &&
+	git reset --hard main &&
 	git cherry-pick side^ &&
 	git cherry-pick side &&
 	git revert HEAD &&
@@ -213,7 +213,7 @@ test_expect_success 'rebase --merge (U/U)' '
 	. "$TEST_DIRECTORY"/t3901/utf8.txt &&
 
 	git reset --hard side &&
-	git rebase --merge master &&
+	git rebase --merge main &&
 
 	check_encoding 2
 '
@@ -224,7 +224,7 @@ test_expect_success 'rebase --merge (U/L)' '
 	. "$TEST_DIRECTORY"/t3901/utf8.txt &&
 
 	git reset --hard side &&
-	git rebase --merge master &&
+	git rebase --merge main &&
 
 	check_encoding 2
 '
@@ -236,7 +236,7 @@ test_expect_success 'rebase --merge (L/L)' '
 	. "$TEST_DIRECTORY"/t3901/8859-1.txt &&
 
 	git reset --hard side &&
-	git rebase --merge master &&
+	git rebase --merge main &&
 
 	check_encoding 2 8859
 '
@@ -249,7 +249,7 @@ test_expect_success 'rebase --merge (L/U)' '
 	. "$TEST_DIRECTORY"/t3901/8859-1.txt &&
 
 	git reset --hard side &&
-	git rebase --merge master &&
+	git rebase --merge main &&
 
 	check_encoding 2 8859
 '
@@ -259,7 +259,7 @@ test_expect_success 'am (U/U)' '
 	git config i18n.commitencoding UTF-8 &&
 	. "$TEST_DIRECTORY"/t3901/utf8.txt &&
 
-	git reset --hard master &&
+	git reset --hard main &&
 	git am out-u1 out-u2 &&
 
 	check_encoding 2
@@ -270,7 +270,7 @@ test_expect_success !MINGW 'am (L/L)' '
 	git config i18n.commitencoding ISO8859-1 &&
 	. "$TEST_DIRECTORY"/t3901/8859-1.txt &&
 
-	git reset --hard master &&
+	git reset --hard main &&
 	git am out-l1 out-l2 &&
 
 	check_encoding 2 8859
@@ -280,7 +280,7 @@ test_expect_success 'am (U/L)' '
 	# Apply ISO-8859-1 patches with UTF-8 commitencoding
 	git config i18n.commitencoding UTF-8 &&
 	. "$TEST_DIRECTORY"/t3901/utf8.txt &&
-	git reset --hard master &&
+	git reset --hard main &&
 
 	# am specifies --utf8 by default.
 	git am out-l1 out-l2 &&
@@ -293,7 +293,7 @@ test_expect_success 'am --no-utf8 (U/L)' '
 	git config i18n.commitencoding UTF-8 &&
 	. "$TEST_DIRECTORY"/t3901/utf8.txt &&
 
-	git reset --hard master &&
+	git reset --hard main &&
 	git am --no-utf8 out-l1 out-l2 2>err &&
 
 	# 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)' '
 	git config i18n.commitencoding ISO8859-1 &&
 	. "$TEST_DIRECTORY"/t3901/8859-1.txt &&
 
-	git reset --hard master &&
+	git reset --hard main &&
 	# mailinfo will re-code the commit message to the charset specified by
 	# i18n.commitencoding
 	git am out-u1 out-u2 &&
diff --git a/t/t3903-stash.sh b/t/t3903-stash.sh
index 49d52c46ad..84b039e573 100755
--- a/t/t3903-stash.sh
+++ b/t/t3903-stash.sh
@@ -5,7 +5,7 @@
 
 test_description='Test git stash'
 
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -223,14 +223,14 @@ test_expect_success 'stash branch' '
 	git commit file -m second &&
 	git stash branch stashbranch &&
 	test refs/heads/stashbranch = $(git symbolic-ref HEAD) &&
-	test $(git rev-parse HEAD) = $(git rev-parse master^) &&
+	test $(git rev-parse HEAD) = $(git rev-parse main^) &&
 	git diff --cached >output &&
 	diff_cmp expect output &&
 	git diff >output &&
 	diff_cmp expect1 output &&
 	git add file &&
 	git commit -m alternate\ second &&
-	git diff master..stashbranch >output &&
+	git diff main..stashbranch >output &&
 	diff_cmp output expect2 &&
 	test 0 = $(git stash list | wc -l)
 '
@@ -523,7 +523,7 @@ test_expect_success 'stash branch - no stashes on stack, stash-like argument' '
 	STASH_ID=$(git stash create) &&
 	git reset --hard &&
 	git stash branch stash-branch ${STASH_ID} &&
-	test_when_finished "git reset --hard HEAD && git checkout master &&
+	test_when_finished "git reset --hard HEAD && git checkout main &&
 	git branch -D stash-branch" &&
 	test $(git ls-files --modified | wc -l) -eq 1
 '
@@ -539,7 +539,7 @@ test_expect_success 'stash branch - stashes on stack, stash-like argument' '
 	STASH_ID=$(git stash create) &&
 	git reset --hard &&
 	git stash branch stash-branch ${STASH_ID} &&
-	test_when_finished "git reset --hard HEAD && git checkout master &&
+	test_when_finished "git reset --hard HEAD && git checkout main &&
 	git branch -D stash-branch" &&
 	test $(git ls-files --modified | wc -l) -eq 1
 '
@@ -741,7 +741,7 @@ test_expect_success 'valid ref of the form "n", n < N' '
 	git stash &&
 	git stash show 0 &&
 	git stash branch tmp 0 &&
-	git checkout master &&
+	git checkout main &&
 	git stash &&
 	git stash apply 0 &&
 	git reset --hard &&
@@ -758,7 +758,7 @@ test_expect_success 'branch: do not drop the stash if the branch exists' '
 	git commit -m initial &&
 	echo bar >file &&
 	git stash &&
-	test_must_fail git stash branch master stash@{0} &&
+	test_must_fail git stash branch main stash@{0} &&
 	git rev-parse stash@{0} --
 '
 
@@ -771,7 +771,7 @@ test_expect_success 'branch: should not drop the stash if the apply fails' '
 	echo bar >file &&
 	git stash &&
 	echo baz >file &&
-	test_when_finished "git checkout master" &&
+	test_when_finished "git checkout main" &&
 	test_must_fail git stash branch new_branch stash@{0} &&
 	git rev-parse stash@{0} --
 '
@@ -905,7 +905,7 @@ test_expect_success 'push -m shows right message' '
 	>foo &&
 	git add foo &&
 	git stash push -m "test message" &&
-	echo "stash@{0}: On master: test message" >expect &&
+	echo "stash@{0}: On main: test message" >expect &&
 	git stash list -1 >actual &&
 	test_cmp expect actual
 '
@@ -914,7 +914,7 @@ test_expect_success 'push -m also works without space' '
 	>foo &&
 	git add foo &&
 	git stash push -m"unspaced test message" &&
-	echo "stash@{0}: On master: unspaced test message" >expect &&
+	echo "stash@{0}: On main: unspaced test message" >expect &&
 	git stash list -1 >actual &&
 	test_cmp expect actual
 '
@@ -971,7 +971,7 @@ test_expect_success 'push -mfoo uses right message' '
 	>foo &&
 	git add foo &&
 	git stash push -m"test mfoo" &&
-	echo "stash@{0}: On master: test mfoo" >expect &&
+	echo "stash@{0}: On main: test mfoo" >expect &&
 	git stash list -1 >actual &&
 	test_cmp expect actual
 '
@@ -980,7 +980,7 @@ test_expect_success 'push --message foo is synonym for -mfoo' '
 	>foo &&
 	git add foo &&
 	git stash push --message "test message foo" &&
-	echo "stash@{0}: On master: test message foo" >expect &&
+	echo "stash@{0}: On main: test message foo" >expect &&
 	git stash list -1 >actual &&
 	test_cmp expect actual
 '
@@ -989,7 +989,7 @@ test_expect_success 'push --message=foo is synonym for -mfoo' '
 	>foo &&
 	git add foo &&
 	git stash push --message="test message=foo" &&
-	echo "stash@{0}: On master: test message=foo" >expect &&
+	echo "stash@{0}: On main: test message=foo" >expect &&
 	git stash list -1 >actual &&
 	test_cmp expect actual
 '
@@ -998,7 +998,7 @@ test_expect_success 'push -m shows right message' '
 	>foo &&
 	git add foo &&
 	git stash push -m "test m foo" &&
-	echo "stash@{0}: On master: test m foo" >expect &&
+	echo "stash@{0}: On main: test m foo" >expect &&
 	git stash list -1 >actual &&
 	test_cmp expect actual
 '
@@ -1007,7 +1007,7 @@ test_expect_success 'create stores correct message' '
 	>foo &&
 	git add foo &&
 	STASH_ID=$(git stash create "create test message") &&
-	echo "On master: create test message" >expect &&
+	echo "On main: create test message" >expect &&
 	git show --pretty=%s -s ${STASH_ID} >actual &&
 	test_cmp expect actual
 '
@@ -1016,13 +1016,13 @@ test_expect_success 'create with multiple arguments for the message' '
 	>foo &&
 	git add foo &&
 	STASH_ID=$(git stash create test untracked) &&
-	echo "On master: test untracked" >expect &&
+	echo "On main: test untracked" >expect &&
 	git show --pretty=%s -s ${STASH_ID} >actual &&
 	test_cmp expect actual
 '
 
 test_expect_success 'create in a detached state' '
-	test_when_finished "git checkout master" &&
+	test_when_finished "git checkout main" &&
 	git checkout HEAD~1 &&
 	>foo &&
 	git add foo &&
diff --git a/t/t3910-mac-os-precompose.sh b/t/t3910-mac-os-precompose.sh
index a2d1cdec6d..a0b9208ce8 100755
--- a/t/t3910-mac-os-precompose.sh
+++ b/t/t3910-mac-os-precompose.sh
@@ -5,7 +5,7 @@
 
 test_description='utf-8 decomposed (nfd) converted to precomposed (nfc)'
 
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -154,7 +154,7 @@ test_expect_success "git checkout link nfd" '
 	git checkout l.$Odiarnfd
 '
 test_expect_success "setup case mac2" '
-	git checkout master &&
+	git checkout main &&
 	git reset --hard &&
 	git checkout -b mac_os_2
 '
@@ -166,7 +166,7 @@ test_expect_success "commit file d2.Adiarnfd/f.Adiarnfd" '
 	git commit -m "add d2.$Adiarnfd/f.$Adiarnfd" -- d2.$Adiarnfd/f.$Adiarnfd
 '
 test_expect_success "setup for long decomposed filename" '
-	git checkout master &&
+	git checkout main &&
 	git reset --hard &&
 	git checkout -b mac_os_long_nfd_fn
 '
@@ -176,7 +176,7 @@ test_expect_success "Add long decomposed filename" '
 	git commit -m "Long filename"
 '
 test_expect_success "setup for long precomposed filename" '
-	git checkout master &&
+	git checkout main &&
 	git reset --hard &&
 	git checkout -b mac_os_long_nfc_fn
 '
-- 
gitgitgadget


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH v3 09/28] t4*: adjust the references to the default branch name "main"
  2020-11-18 23:44   ` [PATCH v3 00/28] tests: use main as default branch name Johannes Schindelin via GitGitGadget
                       ` (7 preceding siblings ...)
  2020-11-18 23:44     ` [PATCH v3 08/28] t3[5-9]*: " Johannes Schindelin via GitGitGadget
@ 2020-11-18 23:44     ` Johannes Schindelin via GitGitGadget
  2020-11-18 23:44     ` [PATCH v3 10/28] t5323: prepare centered comment for `master` -> `main` Johannes Schindelin via GitGitGadget
                       ` (19 subsequent siblings)
  28 siblings, 0 replies; 163+ messages in thread
From: Johannes Schindelin via GitGitGadget @ 2020-11-18 23:44 UTC (permalink / raw)
  To: git
  Cc: Felipe Contreras, Ævar Arnfjörð Bjarmason,
	Johannes Schindelin, Jeff King, Jonathan Nieder,
	Johannes Schindelin, Johannes Schindelin

From: Johannes Schindelin <johannes.schindelin@gmx.de>

Carefully excluding t4013 and t4015, which see independent development
elsewhere at the time of writing, we use `main` as the default branch
name in t4*. This trick was performed via

	$ (cd t &&
	   sed -i -e 's/master/main/g' -e 's/MASTER/MAIN/g' \
		-e 's/Master/Main/g' -- t4*.sh t4211/*.export &&
	   git checkout HEAD -- t4013\*)

This allows us to define `GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main`
for those tests.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
---
 t/t4014-format-patch.sh              | 178 +++++++++++++--------------
 t/t4017-diff-retval.sh               |   4 +-
 t/t4038-diff-combined.sh             |  16 +--
 t/t4041-diff-submodule-option.sh     |   4 +-
 t/t4048-diff-combined-binary.sh      |  12 +-
 t/t4052-stat-output.sh               |   6 +-
 t/t4056-diff-order.sh                |   4 +-
 t/t4057-diff-combined-paths.sh       |  22 ++--
 t/t4061-diff-indent.sh               |  26 ++--
 t/t4066-diff-emit-delay.sh           |   4 +-
 t/t4068-diff-symmetric-merge-base.sh |  50 ++++----
 t/t4103-apply-binary.sh              |  38 +++---
 t/t4108-apply-threeway.sh            |  16 +--
 t/t4121-apply-diffs.sh               |   4 +-
 t/t4122-apply-symlink-inside.sh      |   8 +-
 t/t4150-am.sh                        |  28 ++---
 t/t4200-rerere.sh                    |  22 ++--
 t/t4201-shortlog.sh                  |   4 +-
 t/t4202-log.sh                       | 108 ++++++++--------
 t/t4203-mailmap.sh                   |   4 +-
 t/t4204-patch-id.sh                  |  28 ++---
 t/t4207-log-decoration-colors.sh     |   8 +-
 t/t4208-log-magic-pathspec.sh        |   6 +-
 t/t4211-line-log.sh                  |   2 +-
 t/t4211/history.export               |   2 +-
 t/t4214-log-graph-octopus.sh         |   4 +-
 t/t4216-log-bloom.sh                 |   6 +-
 t/t4253-am-keep-cr-dos.sh            |  22 ++--
 t/t4257-am-interactive.sh            |   2 +-
 29 files changed, 319 insertions(+), 319 deletions(-)

diff --git a/t/t4014-format-patch.sh b/t/t4014-format-patch.sh
index 276aea32a6..66630c8413 100755
--- a/t/t4014-format-patch.sh
+++ b/t/t4014-format-patch.sh
@@ -5,7 +5,7 @@
 
 test_description='various format-patch tests'
 
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -35,11 +35,11 @@ test_expect_success setup '
 	test_tick &&
 	git commit -m "Side changes #3 with \\n backslash-n in it." &&
 
-	git checkout master &&
+	git checkout main &&
 	git diff-tree -p C2 >patch &&
 	git apply --index <patch &&
 	test_tick &&
-	git commit -m "Master accepts moral equivalent of #2" &&
+	git commit -m "Main accepts moral equivalent of #2" &&
 
 	git checkout side &&
 	git checkout -b patchid &&
@@ -59,39 +59,39 @@ test_expect_success setup '
 	test_tick &&
 	git commit -m "patchid 3" &&
 
-	git checkout master
+	git checkout main
 '
 
 test_expect_success 'format-patch --ignore-if-in-upstream' '
-	git format-patch --stdout master..side >patch0 &&
+	git format-patch --stdout main..side >patch0 &&
 	grep "^From " patch0 >from0 &&
 	test_line_count = 3 from0
 '
 
 test_expect_success 'format-patch --ignore-if-in-upstream' '
 	git format-patch --stdout \
-		--ignore-if-in-upstream master..side >patch1 &&
+		--ignore-if-in-upstream main..side >patch1 &&
 	grep "^From " patch1 >from1 &&
 	test_line_count = 2 from1
 '
 
 test_expect_success 'format-patch --ignore-if-in-upstream handles tags' '
 	git tag -a v1 -m tag side &&
-	git tag -a v2 -m tag master &&
+	git tag -a v2 -m tag main &&
 	git format-patch --stdout --ignore-if-in-upstream v2..v1 >patch1 &&
 	grep "^From " patch1 >from1 &&
 	test_line_count = 2 from1
 '
 
 test_expect_success "format-patch doesn't consider merge commits" '
-	git checkout -b feature master &&
+	git checkout -b feature main &&
 	echo "Another line" >>file &&
 	test_tick &&
 	git commit -am "Feature branch change #1" &&
 	echo "Yet another line" >>file &&
 	test_tick &&
 	git commit -am "Feature branch change #2" &&
-	git checkout -b merger master &&
+	git checkout -b merger main &&
 	test_tick &&
 	git merge --no-ff feature &&
 	git format-patch -3 --stdout >patch &&
@@ -100,16 +100,16 @@ test_expect_success "format-patch doesn't consider merge commits" '
 '
 
 test_expect_success 'format-patch result applies' '
-	git checkout -b rebuild-0 master &&
+	git checkout -b rebuild-0 main &&
 	git am -3 patch0 &&
-	git rev-list master.. >list &&
+	git rev-list main.. >list &&
 	test_line_count = 2 list
 '
 
 test_expect_success 'format-patch --ignore-if-in-upstream result applies' '
-	git checkout -b rebuild-1 master &&
+	git checkout -b rebuild-1 main &&
 	git am -3 patch1 &&
-	git rev-list master.. >list &&
+	git rev-list main.. >list &&
 	test_line_count = 2 list
 '
 
@@ -133,7 +133,7 @@ test_expect_success 'extra headers' '
 " &&
 	git config --add format.headers "Cc: S E Cipient <scipient@example.com>
 " &&
-	git format-patch --stdout master..side >patch2 &&
+	git format-patch --stdout main..side >patch2 &&
 	sed -e "/^\$/q" patch2 >hdrs2 &&
 	grep "^To: R E Cipient <rcipient@example.com>\$" hdrs2 &&
 	grep "^Cc: S E Cipient <scipient@example.com>\$" hdrs2
@@ -142,7 +142,7 @@ test_expect_success 'extra headers' '
 test_expect_success 'extra headers without newlines' '
 	git config --replace-all format.headers "To: R E Cipient <rcipient@example.com>" &&
 	git config --add format.headers "Cc: S E Cipient <scipient@example.com>" &&
-	git format-patch --stdout master..side >patch3 &&
+	git format-patch --stdout main..side >patch3 &&
 	sed -e "/^\$/q" patch3 >hdrs3 &&
 	grep "^To: R E Cipient <rcipient@example.com>\$" hdrs3 &&
 	grep "^Cc: S E Cipient <scipient@example.com>\$" hdrs3
@@ -151,7 +151,7 @@ test_expect_success 'extra headers without newlines' '
 test_expect_success 'extra headers with multiple To:s' '
 	git config --replace-all format.headers "To: R E Cipient <rcipient@example.com>" &&
 	git config --add format.headers "To: S E Cipient <scipient@example.com>" &&
-	git format-patch --stdout master..side >patch4 &&
+	git format-patch --stdout main..side >patch4 &&
 	sed -e "/^\$/q" patch4 >hdrs4 &&
 	grep "^To: R E Cipient <rcipient@example.com>,\$" hdrs4 &&
 	grep "^ *S E Cipient <scipient@example.com>\$" hdrs4
@@ -159,7 +159,7 @@ test_expect_success 'extra headers with multiple To:s' '
 
 test_expect_success 'additional command line cc (ascii)' '
 	git config --replace-all format.headers "Cc: R E Cipient <rcipient@example.com>" &&
-	git format-patch --cc="S E Cipient <scipient@example.com>" --stdout master..side >patch5 &&
+	git format-patch --cc="S E Cipient <scipient@example.com>" --stdout main..side >patch5 &&
 	sed -e "/^\$/q" patch5 >hdrs5 &&
 	grep "^Cc: R E Cipient <rcipient@example.com>,\$" hdrs5 &&
 	grep "^ *S E Cipient <scipient@example.com>\$" hdrs5
@@ -167,7 +167,7 @@ test_expect_success 'additional command line cc (ascii)' '
 
 test_expect_failure 'additional command line cc (rfc822)' '
 	git config --replace-all format.headers "Cc: R E Cipient <rcipient@example.com>" &&
-	git format-patch --cc="S. E. Cipient <scipient@example.com>" --stdout master..side >patch5 &&
+	git format-patch --cc="S. E. Cipient <scipient@example.com>" --stdout main..side >patch5 &&
 	sed -e "/^\$/q" patch5 >hdrs5 &&
 	grep "^Cc: R E Cipient <rcipient@example.com>,\$" hdrs5 &&
 	grep "^ *\"S. E. Cipient\" <scipient@example.com>\$" hdrs5
@@ -175,14 +175,14 @@ test_expect_failure 'additional command line cc (rfc822)' '
 
 test_expect_success 'command line headers' '
 	git config --unset-all format.headers &&
-	git format-patch --add-header="Cc: R E Cipient <rcipient@example.com>" --stdout master..side >patch6 &&
+	git format-patch --add-header="Cc: R E Cipient <rcipient@example.com>" --stdout main..side >patch6 &&
 	sed -e "/^\$/q" patch6 >hdrs6 &&
 	grep "^Cc: R E Cipient <rcipient@example.com>\$" hdrs6
 '
 
 test_expect_success 'configuration headers and command line headers' '
 	git config --replace-all format.headers "Cc: R E Cipient <rcipient@example.com>" &&
-	git format-patch --add-header="Cc: S E Cipient <scipient@example.com>" --stdout master..side >patch7 &&
+	git format-patch --add-header="Cc: S E Cipient <scipient@example.com>" --stdout main..side >patch7 &&
 	sed -e "/^\$/q" patch7 >hdrs7 &&
 	grep "^Cc: R E Cipient <rcipient@example.com>,\$" hdrs7 &&
 	grep "^ *S E Cipient <scipient@example.com>\$" hdrs7
@@ -190,40 +190,40 @@ test_expect_success 'configuration headers and command line headers' '
 
 test_expect_success 'command line To: header (ascii)' '
 	git config --unset-all format.headers &&
-	git format-patch --to="R E Cipient <rcipient@example.com>" --stdout master..side >patch8 &&
+	git format-patch --to="R E Cipient <rcipient@example.com>" --stdout main..side >patch8 &&
 	sed -e "/^\$/q" patch8 >hdrs8 &&
 	grep "^To: R E Cipient <rcipient@example.com>\$" hdrs8
 '
 
 test_expect_failure 'command line To: header (rfc822)' '
-	git format-patch --to="R. E. Cipient <rcipient@example.com>" --stdout master..side >patch8 &&
+	git format-patch --to="R. E. Cipient <rcipient@example.com>" --stdout main..side >patch8 &&
 	sed -e "/^\$/q" patch8 >hdrs8 &&
 	grep "^To: \"R. E. Cipient\" <rcipient@example.com>\$" hdrs8
 '
 
 test_expect_failure 'command line To: header (rfc2047)' '
-	git format-patch --to="R Ä Cipient <rcipient@example.com>" --stdout master..side >patch8 &&
+	git format-patch --to="R Ä Cipient <rcipient@example.com>" --stdout main..side >patch8 &&
 	sed -e "/^\$/q" patch8 >hdrs8 &&
 	grep "^To: =?UTF-8?q?R=20=C3=84=20Cipient?= <rcipient@example.com>\$" hdrs8
 '
 
 test_expect_success 'configuration To: header (ascii)' '
 	git config format.to "R E Cipient <rcipient@example.com>" &&
-	git format-patch --stdout master..side >patch9 &&
+	git format-patch --stdout main..side >patch9 &&
 	sed -e "/^\$/q" patch9 >hdrs9 &&
 	grep "^To: R E Cipient <rcipient@example.com>\$" hdrs9
 '
 
 test_expect_failure 'configuration To: header (rfc822)' '
 	git config format.to "R. E. Cipient <rcipient@example.com>" &&
-	git format-patch --stdout master..side >patch9 &&
+	git format-patch --stdout main..side >patch9 &&
 	sed -e "/^\$/q" patch9 >hdrs9 &&
 	grep "^To: \"R. E. Cipient\" <rcipient@example.com>\$" hdrs9
 '
 
 test_expect_failure 'configuration To: header (rfc2047)' '
 	git config format.to "R Ä Cipient <rcipient@example.com>" &&
-	git format-patch --stdout master..side >patch9 &&
+	git format-patch --stdout main..side >patch9 &&
 	sed -e "/^\$/q" patch9 >hdrs9 &&
 	grep "^To: =?UTF-8?q?R=20=C3=84=20Cipient?= <rcipient@example.com>\$" hdrs9
 '
@@ -237,35 +237,35 @@ check_patch () {
 }
 
 test_expect_success 'format.from=false' '
-	git -c format.from=false format-patch --stdout master..side >patch &&
+	git -c format.from=false format-patch --stdout main..side >patch &&
 	sed -e "/^\$/q" patch >hdrs &&
 	check_patch patch &&
 	! grep "^From: C O Mitter <committer@example.com>\$" hdrs
 '
 
 test_expect_success 'format.from=true' '
-	git -c format.from=true format-patch --stdout master..side >patch &&
+	git -c format.from=true format-patch --stdout main..side >patch &&
 	sed -e "/^\$/q" patch >hdrs &&
 	check_patch hdrs &&
 	grep "^From: C O Mitter <committer@example.com>\$" hdrs
 '
 
 test_expect_success 'format.from with address' '
-	git -c format.from="F R Om <from@example.com>" format-patch --stdout master..side >patch &&
+	git -c format.from="F R Om <from@example.com>" format-patch --stdout main..side >patch &&
 	sed -e "/^\$/q" patch >hdrs &&
 	check_patch hdrs &&
 	grep "^From: F R Om <from@example.com>\$" hdrs
 '
 
 test_expect_success '--no-from overrides format.from' '
-	git -c format.from="F R Om <from@example.com>" format-patch --no-from --stdout master..side >patch &&
+	git -c format.from="F R Om <from@example.com>" format-patch --no-from --stdout main..side >patch &&
 	sed -e "/^\$/q" patch >hdrs &&
 	check_patch hdrs &&
 	! grep "^From: F R Om <from@example.com>\$" hdrs
 '
 
 test_expect_success '--from overrides format.from' '
-	git -c format.from="F R Om <from@example.com>" format-patch --from --stdout master..side >patch &&
+	git -c format.from="F R Om <from@example.com>" format-patch --from --stdout main..side >patch &&
 	sed -e "/^\$/q" patch >hdrs &&
 	check_patch hdrs &&
 	! grep "^From: F R Om <from@example.com>\$" hdrs
@@ -274,7 +274,7 @@ test_expect_success '--from overrides format.from' '
 test_expect_success '--no-to overrides config.to' '
 	git config --replace-all format.to \
 		"R E Cipient <rcipient@example.com>" &&
-	git format-patch --no-to --stdout master..side >patch10 &&
+	git format-patch --no-to --stdout main..side >patch10 &&
 	sed -e "/^\$/q" patch10 >hdrs10 &&
 	check_patch hdrs10 &&
 	! grep "^To: R E Cipient <rcipient@example.com>\$" hdrs10
@@ -284,7 +284,7 @@ test_expect_success '--no-to and --to replaces config.to' '
 	git config --replace-all format.to \
 		"Someone <someone@out.there>" &&
 	git format-patch --no-to --to="Someone Else <else@out.there>" \
-		--stdout master..side >patch11 &&
+		--stdout main..side >patch11 &&
 	sed -e "/^\$/q" patch11 >hdrs11 &&
 	check_patch hdrs11 &&
 	! grep "^To: Someone <someone@out.there>\$" hdrs11 &&
@@ -294,7 +294,7 @@ test_expect_success '--no-to and --to replaces config.to' '
 test_expect_success '--no-cc overrides config.cc' '
 	git config --replace-all format.cc \
 		"C E Cipient <rcipient@example.com>" &&
-	git format-patch --no-cc --stdout master..side >patch12 &&
+	git format-patch --no-cc --stdout main..side >patch12 &&
 	sed -e "/^\$/q" patch12 >hdrs12 &&
 	check_patch hdrs12 &&
 	! grep "^Cc: C E Cipient <rcipient@example.com>\$" hdrs12
@@ -303,7 +303,7 @@ test_expect_success '--no-cc overrides config.cc' '
 test_expect_success '--no-add-header overrides config.headers' '
 	git config --replace-all format.headers \
 		"Header1: B E Cipient <rcipient@example.com>" &&
-	git format-patch --no-add-header --stdout master..side >patch13 &&
+	git format-patch --no-add-header --stdout main..side >patch13 &&
 	sed -e "/^\$/q" patch13 >hdrs13 &&
 	check_patch hdrs13 &&
 	! grep "^Header1: B E Cipient <rcipient@example.com>\$" hdrs13
@@ -312,7 +312,7 @@ test_expect_success '--no-add-header overrides config.headers' '
 test_expect_success 'multiple files' '
 	rm -rf patches/ &&
 	git checkout side &&
-	git format-patch -o patches/ master &&
+	git format-patch -o patches/ main &&
 	ls patches/0001-Side-changes-1.patch patches/0002-Side-changes-2.patch patches/0003-Side-changes-3-with-n-backslash-n-in-it.patch
 '
 
@@ -372,7 +372,7 @@ test_expect_success 'filename limit applies only to basename' '
 
 test_expect_success 'reroll count' '
 	rm -fr patches &&
-	git format-patch -o patches --cover-letter --reroll-count 4 master..side >list &&
+	git format-patch -o patches --cover-letter --reroll-count 4 main..side >list &&
 	! grep -v "^patches/v4-000[0-3]-" list &&
 	sed -n -e "/^Subject: /p" $(cat list) >subjects &&
 	! grep -v "^Subject: \[PATCH v4 [0-3]/3\] " subjects
@@ -380,7 +380,7 @@ test_expect_success 'reroll count' '
 
 test_expect_success 'reroll count (-v)' '
 	rm -fr patches &&
-	git format-patch -o patches --cover-letter -v4 master..side >list &&
+	git format-patch -o patches --cover-letter -v4 main..side >list &&
 	! grep -v "^patches/v4-000[0-3]-" list &&
 	sed -n -e "/^Subject: /p" $(cat list) >subjects &&
 	! grep -v "^Subject: \[PATCH v4 [0-3]/3\] " subjects
@@ -416,7 +416,7 @@ EOF
 
 test_expect_success 'no threading' '
 	git checkout side &&
-	check_threading expect.no-threading master
+	check_threading expect.no-threading main
 '
 
 cat >expect.thread <<EOF
@@ -433,7 +433,7 @@ References: <0>
 EOF
 
 test_expect_success 'thread' '
-	check_threading expect.thread --thread master
+	check_threading expect.thread --thread main
 '
 
 cat >expect.in-reply-to <<EOF
@@ -453,7 +453,7 @@ EOF
 
 test_expect_success 'thread in-reply-to' '
 	check_threading expect.in-reply-to --in-reply-to="<test.message>" \
-		--thread master
+		--thread main
 '
 
 cat >expect.cover-letter <<EOF
@@ -474,7 +474,7 @@ References: <0>
 EOF
 
 test_expect_success 'thread cover-letter' '
-	check_threading expect.cover-letter --cover-letter --thread master
+	check_threading expect.cover-letter --cover-letter --thread main
 '
 
 cat >expect.cl-irt <<EOF
@@ -501,12 +501,12 @@ EOF
 
 test_expect_success 'thread cover-letter in-reply-to' '
 	check_threading expect.cl-irt --cover-letter \
-		--in-reply-to="<test.message>" --thread master
+		--in-reply-to="<test.message>" --thread main
 '
 
 test_expect_success 'thread explicit shallow' '
 	check_threading expect.cl-irt --cover-letter \
-		--in-reply-to="<test.message>" --thread=shallow master
+		--in-reply-to="<test.message>" --thread=shallow main
 '
 
 cat >expect.deep <<EOF
@@ -524,7 +524,7 @@ References: <0>
 EOF
 
 test_expect_success 'thread deep' '
-	check_threading expect.deep --thread=deep master
+	check_threading expect.deep --thread=deep main
 '
 
 cat >expect.deep-irt <<EOF
@@ -547,7 +547,7 @@ EOF
 
 test_expect_success 'thread deep in-reply-to' '
 	check_threading expect.deep-irt  --thread=deep \
-		--in-reply-to="<test.message>" master
+		--in-reply-to="<test.message>" main
 '
 
 cat >expect.deep-cl <<EOF
@@ -571,7 +571,7 @@ References: <0>
 EOF
 
 test_expect_success 'thread deep cover-letter' '
-	check_threading expect.deep-cl --cover-letter --thread=deep master
+	check_threading expect.deep-cl --cover-letter --thread=deep main
 '
 
 cat >expect.deep-cl-irt <<EOF
@@ -601,27 +601,27 @@ EOF
 
 test_expect_success 'thread deep cover-letter in-reply-to' '
 	check_threading expect.deep-cl-irt --cover-letter \
-		--in-reply-to="<test.message>" --thread=deep master
+		--in-reply-to="<test.message>" --thread=deep main
 '
 
 test_expect_success 'thread via config' '
 	test_config format.thread true &&
-	check_threading expect.thread master
+	check_threading expect.thread main
 '
 
 test_expect_success 'thread deep via config' '
 	test_config format.thread deep &&
-	check_threading expect.deep master
+	check_threading expect.deep main
 '
 
 test_expect_success 'thread config + override' '
 	test_config format.thread deep &&
-	check_threading expect.thread --thread master
+	check_threading expect.thread --thread main
 '
 
 test_expect_success 'thread config + --no-thread' '
 	test_config format.thread deep &&
-	check_threading expect.no-threading --no-thread master
+	check_threading expect.no-threading --no-thread main
 '
 
 test_expect_success 'excessive subject' '
@@ -634,7 +634,7 @@ test_expect_success 'excessive subject' '
 	after=$(git rev-parse --short $after) &&
 	git update-index file &&
 	git commit -m "This is an excessively long subject line for a message due to the habit some projects have of not having a short, one-line subject at the start of the commit message, but rather sticking a whole paragraph right at the start as the only thing in the commit message. It had better not become the filename for the patch." &&
-	git format-patch -o patches/ master..side &&
+	git format-patch -o patches/ main..side &&
 	ls patches/0004-This-is-an-excessively-long-subject-line-for-a-messa.patch
 '
 
@@ -896,13 +896,13 @@ test_expect_success 'options no longer allowed for format-patch' '
 '
 
 test_expect_success 'format-patch --numstat should produce a patch' '
-	git format-patch --numstat --stdout master..side >output &&
+	git format-patch --numstat --stdout main..side >output &&
 	grep "^diff --git a/" output >diff &&
 	test_line_count = 5 diff
 '
 
 test_expect_success 'format-patch -- <path>' '
-	git format-patch master..side -- file 2>error &&
+	git format-patch main..side -- file 2>error &&
 	! grep "Use .--" error
 '
 
@@ -1676,9 +1676,9 @@ test_expect_success 'cover letter with invalid --cover-from-description and conf
 	test_config branch.rebuild-1.description "config subject
 
 body" &&
-	test_must_fail git format-patch --cover-letter --cover-from-description garbage master &&
+	test_must_fail git format-patch --cover-letter --cover-from-description garbage main &&
 	test_config format.coverFromDescription garbage &&
-	test_must_fail git format-patch --cover-letter master
+	test_must_fail git format-patch --cover-letter main
 '
 
 test_expect_success 'cover letter with format.coverFromDescription = default' '
@@ -1687,7 +1687,7 @@ test_expect_success 'cover letter with format.coverFromDescription = default' '
 body" &&
 	test_config format.coverFromDescription default &&
 	git checkout rebuild-1 &&
-	git format-patch --stdout --cover-letter master >actual &&
+	git format-patch --stdout --cover-letter main >actual &&
 	grep "^Subject: \[PATCH 0/2\] \*\*\* SUBJECT HERE \*\*\*$" actual &&
 	! grep "^\*\*\* BLURB HERE \*\*\*$" actual &&
 	grep "^config subject$" actual &&
@@ -1699,7 +1699,7 @@ test_expect_success 'cover letter with --cover-from-description default' '
 
 body" &&
 	git checkout rebuild-1 &&
-	git format-patch --stdout --cover-letter --cover-from-description default master >actual &&
+	git format-patch --stdout --cover-letter --cover-from-description default main >actual &&
 	grep "^Subject: \[PATCH 0/2\] \*\*\* SUBJECT HERE \*\*\*$" actual &&
 	! grep "^\*\*\* BLURB HERE \*\*\*$" actual &&
 	grep "^config subject$" actual &&
@@ -1712,7 +1712,7 @@ test_expect_success 'cover letter with format.coverFromDescription = none' '
 body" &&
 	test_config format.coverFromDescription none &&
 	git checkout rebuild-1 &&
-	git format-patch --stdout --cover-letter master >actual &&
+	git format-patch --stdout --cover-letter main >actual &&
 	grep "^Subject: \[PATCH 0/2\] \*\*\* SUBJECT HERE \*\*\*$" actual &&
 	grep "^\*\*\* BLURB HERE \*\*\*$" actual &&
 	! grep "^config subject$" actual &&
@@ -1724,7 +1724,7 @@ test_expect_success 'cover letter with --cover-from-description none' '
 
 body" &&
 	git checkout rebuild-1 &&
-	git format-patch --stdout --cover-letter --cover-from-description none master >actual &&
+	git format-patch --stdout --cover-letter --cover-from-description none main >actual &&
 	grep "^Subject: \[PATCH 0/2\] \*\*\* SUBJECT HERE \*\*\*$" actual &&
 	grep "^\*\*\* BLURB HERE \*\*\*$" actual &&
 	! grep "^config subject$" actual &&
@@ -1737,7 +1737,7 @@ test_expect_success 'cover letter with format.coverFromDescription = message' '
 body" &&
 	test_config format.coverFromDescription message &&
 	git checkout rebuild-1 &&
-	git format-patch --stdout --cover-letter master >actual &&
+	git format-patch --stdout --cover-letter main >actual &&
 	grep "^Subject: \[PATCH 0/2\] \*\*\* SUBJECT HERE \*\*\*$" actual &&
 	! grep "^\*\*\* BLURB HERE \*\*\*$" actual &&
 	grep "^config subject$" actual &&
@@ -1749,7 +1749,7 @@ test_expect_success 'cover letter with --cover-from-description message' '
 
 body" &&
 	git checkout rebuild-1 &&
-	git format-patch --stdout --cover-letter --cover-from-description message master >actual &&
+	git format-patch --stdout --cover-letter --cover-from-description message main >actual &&
 	grep "^Subject: \[PATCH 0/2\] \*\*\* SUBJECT HERE \*\*\*$" actual &&
 	! grep "^\*\*\* BLURB HERE \*\*\*$" actual &&
 	grep "^config subject$" actual &&
@@ -1762,7 +1762,7 @@ test_expect_success 'cover letter with format.coverFromDescription = subject' '
 body" &&
 	test_config format.coverFromDescription subject &&
 	git checkout rebuild-1 &&
-	git format-patch --stdout --cover-letter master >actual &&
+	git format-patch --stdout --cover-letter main >actual &&
 	grep "^Subject: \[PATCH 0/2\] config subject$" actual &&
 	! grep "^\*\*\* BLURB HERE \*\*\*$" actual &&
 	! grep "^config subject$" actual &&
@@ -1774,7 +1774,7 @@ test_expect_success 'cover letter with --cover-from-description subject' '
 
 body" &&
 	git checkout rebuild-1 &&
-	git format-patch --stdout --cover-letter --cover-from-description subject master >actual &&
+	git format-patch --stdout --cover-letter --cover-from-description subject main >actual &&
 	grep "^Subject: \[PATCH 0/2\] config subject$" actual &&
 	! grep "^\*\*\* BLURB HERE \*\*\*$" actual &&
 	! grep "^config subject$" actual &&
@@ -1787,7 +1787,7 @@ test_expect_success 'cover letter with format.coverFromDescription = auto (short
 body" &&
 	test_config format.coverFromDescription auto &&
 	git checkout rebuild-1 &&
-	git format-patch --stdout --cover-letter master >actual &&
+	git format-patch --stdout --cover-letter main >actual &&
 	grep "^Subject: \[PATCH 0/2\] config subject$" actual &&
 	! grep "^\*\*\* BLURB HERE \*\*\*$" actual &&
 	! grep "^config subject$" actual &&
@@ -1799,7 +1799,7 @@ test_expect_success 'cover letter with --cover-from-description auto (short subj
 
 body" &&
 	git checkout rebuild-1 &&
-	git format-patch --stdout --cover-letter --cover-from-description auto master >actual &&
+	git format-patch --stdout --cover-letter --cover-from-description auto main >actual &&
 	grep "^Subject: \[PATCH 0/2\] config subject$" actual &&
 	! grep "^\*\*\* BLURB HERE \*\*\*$" actual &&
 	! grep "^config subject$" actual &&
@@ -1812,7 +1812,7 @@ test_expect_success 'cover letter with format.coverFromDescription = auto (long
 body" &&
 	test_config format.coverFromDescription auto &&
 	git checkout rebuild-1 &&
-	git format-patch --stdout --cover-letter master >actual &&
+	git format-patch --stdout --cover-letter main >actual &&
 	grep "^Subject: \[PATCH 0/2\] \*\*\* SUBJECT HERE \*\*\*$" actual &&
 	! grep "^\*\*\* BLURB HERE \*\*\*$" actual &&
 	grep "^this is a really long first line and it is over 100 characters long which is the threshold for long subjects$" actual &&
@@ -1824,7 +1824,7 @@ test_expect_success 'cover letter with --cover-from-description auto (long subje
 
 body" &&
 	git checkout rebuild-1 &&
-	git format-patch --stdout --cover-letter --cover-from-description auto master >actual &&
+	git format-patch --stdout --cover-letter --cover-from-description auto main >actual &&
 	grep "^Subject: \[PATCH 0/2\] \*\*\* SUBJECT HERE \*\*\*$" actual &&
 	! grep "^\*\*\* BLURB HERE \*\*\*$" actual &&
 	grep "^this is a really long first line and it is over 100 characters long which is the threshold for long subjects$" actual &&
@@ -1837,7 +1837,7 @@ test_expect_success 'cover letter with command-line --cover-from-description ove
 body" &&
 	test_config format.coverFromDescription none &&
 	git checkout rebuild-1 &&
-	git format-patch --stdout --cover-letter --cover-from-description subject master >actual &&
+	git format-patch --stdout --cover-letter --cover-from-description subject main >actual &&
 	grep "^Subject: \[PATCH 0/2\] config subject$" actual &&
 	! grep "^\*\*\* BLURB HERE \*\*\*$" actual &&
 	! grep "^config subject$" actual &&
@@ -1847,7 +1847,7 @@ body" &&
 test_expect_success 'cover letter using branch description (1)' '
 	git checkout rebuild-1 &&
 	test_config branch.rebuild-1.description hello &&
-	git format-patch --stdout --cover-letter master >actual &&
+	git format-patch --stdout --cover-letter main >actual &&
 	grep hello actual
 '
 
@@ -1861,14 +1861,14 @@ test_expect_success 'cover letter using branch description (2)' '
 test_expect_success 'cover letter using branch description (3)' '
 	git checkout rebuild-1 &&
 	test_config branch.rebuild-1.description hello &&
-	git format-patch --stdout --cover-letter ^master rebuild-1 >actual &&
+	git format-patch --stdout --cover-letter ^main rebuild-1 >actual &&
 	grep hello actual
 '
 
 test_expect_success 'cover letter using branch description (4)' '
 	git checkout rebuild-1 &&
 	test_config branch.rebuild-1.description hello &&
-	git format-patch --stdout --cover-letter master.. >actual &&
+	git format-patch --stdout --cover-letter main.. >actual &&
 	grep hello actual
 '
 
@@ -1935,8 +1935,8 @@ test_expect_success 'From line has expected format' '
 
 test_expect_success 'format-patch -o with no leading directories' '
 	rm -fr patches &&
-	git format-patch -o patches master..side &&
-	count=$(git rev-list --count master..side) &&
+	git format-patch -o patches main..side &&
+	count=$(git rev-list --count main..side) &&
 	ls patches >list &&
 	test_line_count = $count list
 '
@@ -1944,16 +1944,16 @@ test_expect_success 'format-patch -o with no leading directories' '
 test_expect_success 'format-patch -o with leading existing directories' '
 	rm -rf existing-dir &&
 	mkdir existing-dir &&
-	git format-patch -o existing-dir/patches master..side &&
-	count=$(git rev-list --count master..side) &&
+	git format-patch -o existing-dir/patches main..side &&
+	count=$(git rev-list --count main..side) &&
 	ls existing-dir/patches >list &&
 	test_line_count = $count list
 '
 
 test_expect_success 'format-patch -o with leading non-existing directories' '
 	rm -rf non-existing-dir &&
-	git format-patch -o non-existing-dir/patches master..side &&
-	count=$(git rev-list --count master..side) &&
+	git format-patch -o non-existing-dir/patches main..side &&
+	count=$(git rev-list --count main..side) &&
 	test_path_is_dir non-existing-dir &&
 	ls non-existing-dir/patches >list &&
 	test_line_count = $count list
@@ -1962,8 +1962,8 @@ test_expect_success 'format-patch -o with leading non-existing directories' '
 test_expect_success 'format-patch format.outputDirectory option' '
 	test_config format.outputDirectory patches &&
 	rm -fr patches &&
-	git format-patch master..side &&
-	count=$(git rev-list --count master..side) &&
+	git format-patch main..side &&
+	count=$(git rev-list --count main..side) &&
 	ls patches >list &&
 	test_line_count = $count list
 '
@@ -1971,7 +1971,7 @@ test_expect_success 'format-patch format.outputDirectory option' '
 test_expect_success 'format-patch -o overrides format.outputDirectory' '
 	test_config format.outputDirectory patches &&
 	rm -fr patches patchset &&
-	git format-patch master..side -o patchset &&
+	git format-patch main..side -o patchset &&
 	test_path_is_missing patches &&
 	test_path_is_dir patchset
 '
@@ -2068,14 +2068,14 @@ test_expect_success 'format-patch --base errors out when base commit is not ance
 	#	  ------------W
 	#
 	# If "format-patch Z..X" is given, P and Z can not be specified as the base commit
-	git checkout -b topic1 master &&
+	git checkout -b topic1 main &&
 	git rev-parse HEAD >commit-id-base &&
 	test_commit P &&
 	git rev-parse HEAD >commit-id-P &&
 	test_commit Z &&
 	git rev-parse HEAD >commit-id-Z &&
 	test_commit Y &&
-	git checkout -b topic2 master &&
+	git checkout -b topic2 main &&
 	test_commit W &&
 	git merge topic1 &&
 	test_commit X &&
@@ -2088,7 +2088,7 @@ test_expect_success 'format-patch --base errors out when base commit is not ance
 '
 
 test_expect_success 'format-patch --base=auto' '
-	git checkout -b upstream master &&
+	git checkout -b upstream main &&
 	git checkout -b local upstream &&
 	git branch --set-upstream-to=upstream &&
 	test_commit N1 &&
@@ -2109,11 +2109,11 @@ test_expect_success 'format-patch errors out when history involves criss-cross'
 	#  \ / \
 	#   C---M2---E
 	#
-	git checkout master &&
+	git checkout main &&
 	test_commit A &&
-	git checkout -b xb master &&
+	git checkout -b xb main &&
 	test_commit B &&
-	git checkout -b xc master &&
+	git checkout -b xc main &&
 	test_commit C &&
 	git checkout -b xbc xb -- &&
 	git merge xc &&
@@ -2233,7 +2233,7 @@ test_expect_success 'format-patch --pretty=mboxrd' '
 '
 
 test_expect_success 'interdiff: setup' '
-	git checkout -b boop master &&
+	git checkout -b boop main &&
 	test_commit fnorp blorp &&
 	test_commit fleep blorp
 '
diff --git a/t/t4017-diff-retval.sh b/t/t4017-diff-retval.sh
index 0b379c307b..ed461f481e 100755
--- a/t/t4017-diff-retval.sh
+++ b/t/t4017-diff-retval.sh
@@ -2,7 +2,7 @@
 
 test_description='Return value of diffs'
 
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -114,7 +114,7 @@ test_expect_success 'check detects leftover conflict markers' '
 	git checkout HEAD^ &&
 	echo binary >>b &&
 	git commit -m "side" b &&
-	test_must_fail git merge master &&
+	test_must_fail git merge main &&
 	git add b &&
 	test_expect_code 2 git --no-pager diff --cached --check >test.out &&
 	test 3 = $(grep "conflict marker" test.out | wc -l) &&
diff --git a/t/t4038-diff-combined.sh b/t/t4038-diff-combined.sh
index e873abb1da..09ad491a59 100755
--- a/t/t4038-diff-combined.sh
+++ b/t/t4038-diff-combined.sh
@@ -2,7 +2,7 @@
 
 test_description='combined diff'
 
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -118,7 +118,7 @@ test_expect_success 'check --cc --raw with forty trees' '
 '
 
 test_expect_success 'setup combined ignore spaces' '
-	git checkout master &&
+	git checkout main &&
 	>test &&
 	git add test &&
 	git commit -m initial &&
@@ -146,7 +146,7 @@ test_expect_success 'setup combined ignore spaces' '
 	EOF
 	git commit -m "test other space changes" -a &&
 
-	test_must_fail git merge master &&
+	test_must_fail git merge main &&
 	tr -d Q <<-\EOF >test &&
 	eol spaces Q
 	space  change
@@ -407,7 +407,7 @@ test_expect_success 'combine diff missing delete bug' '
 test_expect_success 'combine diff gets tree sorting right' '
 	# create a directory and a file that sort differently in trees
 	# versus byte-wise (implied "/" sorts after ".")
-	git checkout -f master &&
+	git checkout -f main &&
 	mkdir foo &&
 	echo base >foo/one &&
 	echo base >foo/two &&
@@ -417,9 +417,9 @@ test_expect_success 'combine diff gets tree sorting right' '
 
 	# one side modifies a file in the directory, along with the root
 	# file...
-	echo master >foo/one &&
-	echo master >foo.ext &&
-	git commit -a -m master &&
+	echo main >foo/one &&
+	echo main >foo.ext &&
+	git commit -a -m main &&
 
 	# the other side modifies the other file in the directory
 	git checkout -b other HEAD^ &&
@@ -429,7 +429,7 @@ test_expect_success 'combine diff gets tree sorting right' '
 	# And now we merge. The files in the subdirectory will resolve cleanly,
 	# meaning that a combined diff will not find them interesting. But it
 	# will find the tree itself interesting, because it had to be merged.
-	git checkout master &&
+	git checkout main &&
 	git merge other &&
 
 	printf "MM\tfoo\n" >expect &&
diff --git a/t/t4041-diff-submodule-option.sh b/t/t4041-diff-submodule-option.sh
index 8014cd684b..9b326fe935 100755
--- a/t/t4041-diff-submodule-option.sh
+++ b/t/t4041-diff-submodule-option.sh
@@ -9,7 +9,7 @@ test_description='Support for verbose submodule differences in git diff
 This test tries to verify the sanity of the --submodule option of git diff.
 '
 
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -541,7 +541,7 @@ test_expect_success 'diff --submodule with objects referenced by alternates' '
 	(cd super &&
 		(cd sub &&
 			git fetch &&
-			git checkout origin/master
+			git checkout origin/main
 		) &&
 		git diff --submodule > ../actual
 	) &&
diff --git a/t/t4048-diff-combined-binary.sh b/t/t4048-diff-combined-binary.sh
index e2780e697a..0260cf64f5 100755
--- a/t/t4048-diff-combined-binary.sh
+++ b/t/t4048-diff-combined-binary.sh
@@ -1,7 +1,7 @@
 #!/bin/sh
 
 test_description='combined and merge diff handle binary files and textconv'
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -17,7 +17,7 @@ test_expect_success 'setup binary merge conflict' '
 	echo threeQ3 | q_to_nul >binary &&
 	git commit -a -m three &&
 	three=$(git rev-parse --short HEAD:binary) &&
-	test_must_fail git merge master &&
+	test_must_fail git merge main &&
 	echo resolvedQhooray | q_to_nul >binary &&
 	git commit -a -m resolved &&
 	res=$(git rev-parse --short HEAD:binary)
@@ -65,14 +65,14 @@ test_expect_success 'diff --cc indicates binary-ness' '
 '
 
 test_expect_success 'setup non-binary with binary attribute' '
-	git checkout master &&
+	git checkout main &&
 	test_commit one text &&
 	test_commit two text &&
 	two=$(git rev-parse --short HEAD:text) &&
 	git checkout -b branch-text HEAD^ &&
 	test_commit three text &&
 	three=$(git rev-parse --short HEAD:text) &&
-	test_must_fail git merge master &&
+	test_must_fail git merge main &&
 	test_commit resolved text &&
 	res=$(git rev-parse --short HEAD:text) &&
 	echo text -diff >.gitattributes
@@ -209,11 +209,11 @@ index $three,$two..0000000
  +THREE
 ++=======
 + TWO
-++>>>>>>> MASTER
+++>>>>>>> MAIN
 EOF
 test_expect_success 'diff --cc respects textconv on worktree file' '
 	git reset --hard HEAD^ &&
-	test_must_fail git merge master &&
+	test_must_fail git merge main &&
 	git diff >actual &&
 	test_cmp expect actual
 '
diff --git a/t/t4052-stat-output.sh b/t/t4052-stat-output.sh
index a9aef7f986..9eba436211 100755
--- a/t/t4052-stat-output.sh
+++ b/t/t4052-stat-output.sh
@@ -5,7 +5,7 @@
 
 test_description='test --stat output of various commands'
 
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -356,7 +356,7 @@ cat >expect <<'EOF'
 EOF
 test_expect_success 'merge --stat respects COLUMNS (big change)' '
 	git checkout -b branch HEAD^^ &&
-	COLUMNS=100 git merge --stat --no-ff master^ >output &&
+	COLUMNS=100 git merge --stat --no-ff main^ >output &&
 	grep " | " output >actual &&
 	test_cmp expect actual
 '
@@ -365,7 +365,7 @@ cat >expect <<'EOF'
  aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa | 1000 +++++++++++++++++++++++++++++++++++++++
 EOF
 test_expect_success 'merge --stat respects COLUMNS (long filename)' '
-	COLUMNS=100 git merge --stat --no-ff master >output &&
+	COLUMNS=100 git merge --stat --no-ff main >output &&
 	grep " | " output >actual &&
 	test_cmp expect actual
 '
diff --git a/t/t4056-diff-order.sh b/t/t4056-diff-order.sh
index 723eee4e8e..63ea7144bb 100755
--- a/t/t4056-diff-order.sh
+++ b/t/t4056-diff-order.sh
@@ -2,7 +2,7 @@
 
 test_description='diff order'
 
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -109,7 +109,7 @@ done
 test_expect_success 'setup for testing combine-diff order' '
 	git checkout -b tmp HEAD~ &&
 	create_files 3 &&
-	git checkout master &&
+	git checkout main &&
 	git merge --no-commit -s ours tmp &&
 	create_files 5
 '
diff --git a/t/t4057-diff-combined-paths.sh b/t/t4057-diff-combined-paths.sh
index 71af157bf9..7e5b74f72e 100755
--- a/t/t4057-diff-combined-paths.sh
+++ b/t/t4057-diff-combined-paths.sh
@@ -2,7 +2,7 @@
 
 test_description='combined diff show only paths that are different to all parents'
 
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -27,9 +27,9 @@ test_expect_success 'trivial merge - combine-diff empty' '
 		echo $i/2 >>$i.txt
 	done &&
 	git commit -a -m "side 2-9" &&
-	git checkout master &&
+	git checkout main &&
 	echo 1/2 >1.txt &&
-	git commit -a -m "master 1" &&
+	git commit -a -m "main 1" &&
 	git merge side &&
 	>diffc.expect &&
 	diffc_verify
@@ -44,19 +44,19 @@ test_expect_success 'only one truly conflicting path' '
 	done &&
 	echo "4side" >>4.txt &&
 	git commit -a -m "side 2-9 +4" &&
-	git checkout master &&
+	git checkout main &&
 	for i in $(test_seq 1 9)
 	do
 		echo $i/3 >>$i.txt
 	done &&
-	echo "4master" >>4.txt &&
-	git commit -a -m "master 1-9 +4" &&
+	echo "4main" >>4.txt &&
+	git commit -a -m "main 1-9 +4" &&
 	test_must_fail git merge side &&
 	cat <<-\EOF >4.txt &&
 	4
 	4/2
 	4/3
-	4master
+	4main
 	4side
 	EOF
 	git add 4.txt &&
@@ -72,12 +72,12 @@ test_expect_success 'merge introduces new file' '
 		echo $i/4 >>$i.txt
 	done &&
 	git commit -a -m "side 5-9" &&
-	git checkout master &&
+	git checkout main &&
 	for i in $(test_seq 1 3)
 	do
 		echo $i/4 >>$i.txt
 	done &&
-	git commit -a -m "master 1-3 +4hello" &&
+	git commit -a -m "main 1-3 +4hello" &&
 	git merge side &&
 	echo "Hello World" >4hello.txt &&
 	git add 4hello.txt &&
@@ -93,12 +93,12 @@ test_expect_success 'merge removed a file' '
 		echo $i/5 >>$i.txt
 	done &&
 	git commit -a -m "side 5-9" &&
-	git checkout master &&
+	git checkout main &&
 	for i in $(test_seq 1 3)
 	do
 		echo $i/4 >>$i.txt
 	done &&
-	git commit -a -m "master 1-3" &&
+	git commit -a -m "main 1-3" &&
 	git merge side &&
 	git rm 4.txt &&
 	git commit --amend &&
diff --git a/t/t4061-diff-indent.sh b/t/t4061-diff-indent.sh
index cbe64d5f79..bcf7493740 100755
--- a/t/t4061-diff-indent.sh
+++ b/t/t4061-diff-indent.sh
@@ -3,7 +3,7 @@
 test_description='Test diff indent heuristic.
 
 '
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -269,7 +269,7 @@ test_expect_success 'diff-index: nice spaces with --indent-heuristic' '
 	git reset --soft HEAD~ &&
 	git diff-index --indent-heuristic -p old -- spaces.txt >out-diff-index-compacted &&
 	compare_diff spaces-compacted-expect out-diff-index-compacted &&
-	git checkout -f master
+	git checkout -f main
 '
 
 test_expect_success 'diff-index: nice spaces with diff.indentHeuristic=true' '
@@ -277,7 +277,7 @@ test_expect_success 'diff-index: nice spaces with diff.indentHeuristic=true' '
 	git reset --soft HEAD~ &&
 	git -c diff.indentHeuristic=true diff-index -p old -- spaces.txt >out-diff-index-compacted2 &&
 	compare_diff spaces-compacted-expect out-diff-index-compacted2 &&
-	git checkout -f master
+	git checkout -f main
 '
 
 test_expect_success 'diff-index: ugly spaces with --no-indent-heuristic' '
@@ -285,7 +285,7 @@ test_expect_success 'diff-index: ugly spaces with --no-indent-heuristic' '
 	git reset --soft HEAD~ &&
 	git diff-index --no-indent-heuristic -p old -- spaces.txt >out-diff-index &&
 	compare_diff spaces-expect out-diff-index &&
-	git checkout -f master
+	git checkout -f main
 '
 
 test_expect_success 'diff-index: ugly spaces with diff.indentHeuristic=false' '
@@ -293,7 +293,7 @@ test_expect_success 'diff-index: ugly spaces with diff.indentHeuristic=false' '
 	git reset --soft HEAD~ &&
 	git -c diff.indentHeuristic=false diff-index -p old -- spaces.txt >out-diff-index2 &&
 	compare_diff spaces-expect out-diff-index2 &&
-	git checkout -f master
+	git checkout -f main
 '
 
 test_expect_success 'diff-index: --indent-heuristic overrides config' '
@@ -301,7 +301,7 @@ test_expect_success 'diff-index: --indent-heuristic overrides config' '
 	git reset --soft HEAD~ &&
 	git -c diff.indentHeuristic=false diff-index --indent-heuristic -p old -- spaces.txt >out-diff-index-compacted3 &&
 	compare_diff spaces-compacted-expect out-diff-index-compacted3 &&
-	git checkout -f master
+	git checkout -f main
 '
 
 test_expect_success 'diff-index: --no-indent-heuristic overrides config' '
@@ -309,7 +309,7 @@ test_expect_success 'diff-index: --no-indent-heuristic overrides config' '
 	git reset --soft HEAD~ &&
 	git -c diff.indentHeuristic=true diff-index --no-indent-heuristic -p old -- spaces.txt >out-diff-index3 &&
 	compare_diff spaces-expect out-diff-index3 &&
-	git checkout -f master
+	git checkout -f main
 '
 
 # --- diff-files tests ----------------------------------------------------
@@ -320,7 +320,7 @@ test_expect_success 'diff-files: nice spaces with --indent-heuristic' '
 	git diff-files --indent-heuristic -p spaces.txt >out-diff-files-raw &&
 	grep -v index out-diff-files-raw >out-diff-files-compacted &&
 	compare_diff spaces-compacted-expect out-diff-files-compacted &&
-	git checkout -f master
+	git checkout -f main
 '
 
 test_expect_success 'diff-files: nice spaces with diff.indentHeuristic=true' '
@@ -329,7 +329,7 @@ test_expect_success 'diff-files: nice spaces with diff.indentHeuristic=true' '
 	git -c diff.indentHeuristic=true diff-files -p spaces.txt >out-diff-files-raw2 &&
 	grep -v index out-diff-files-raw2 >out-diff-files-compacted2 &&
 	compare_diff spaces-compacted-expect out-diff-files-compacted2 &&
-	git checkout -f master
+	git checkout -f main
 '
 
 test_expect_success 'diff-files: ugly spaces with --no-indent-heuristic' '
@@ -338,7 +338,7 @@ test_expect_success 'diff-files: ugly spaces with --no-indent-heuristic' '
 	git diff-files --no-indent-heuristic -p spaces.txt >out-diff-files-raw &&
 	grep -v index out-diff-files-raw >out-diff-files &&
 	compare_diff spaces-expect out-diff-files &&
-	git checkout -f master
+	git checkout -f main
 '
 
 test_expect_success 'diff-files: ugly spaces with diff.indentHeuristic=false' '
@@ -347,7 +347,7 @@ test_expect_success 'diff-files: ugly spaces with diff.indentHeuristic=false' '
 	git -c diff.indentHeuristic=false diff-files -p spaces.txt >out-diff-files-raw2 &&
 	grep -v index out-diff-files-raw2 >out-diff-files &&
 	compare_diff spaces-expect out-diff-files &&
-	git checkout -f master
+	git checkout -f main
 '
 
 test_expect_success 'diff-files: --indent-heuristic overrides config' '
@@ -356,7 +356,7 @@ test_expect_success 'diff-files: --indent-heuristic overrides config' '
 	git -c diff.indentHeuristic=false diff-files --indent-heuristic -p spaces.txt >out-diff-files-raw3 &&
 	grep -v index out-diff-files-raw3 >out-diff-files-compacted &&
 	compare_diff spaces-compacted-expect out-diff-files-compacted &&
-	git checkout -f master
+	git checkout -f main
 '
 
 test_expect_success 'diff-files: --no-indent-heuristic overrides config' '
@@ -365,7 +365,7 @@ test_expect_success 'diff-files: --no-indent-heuristic overrides config' '
 	git -c diff.indentHeuristic=true diff-files --no-indent-heuristic -p spaces.txt >out-diff-files-raw4 &&
 	grep -v index out-diff-files-raw4 >out-diff-files &&
 	compare_diff spaces-expect out-diff-files &&
-	git checkout -f master
+	git checkout -f main
 '
 
 test_done
diff --git a/t/t4066-diff-emit-delay.sh b/t/t4066-diff-emit-delay.sh
index 1983f1ebbe..a1de63b77f 100755
--- a/t/t4066-diff-emit-delay.sh
+++ b/t/t4066-diff-emit-delay.sh
@@ -1,7 +1,7 @@
 #!/bin/sh
 
 test_description='test combined/stat/moved interaction'
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -16,7 +16,7 @@ test_expect_success 'set up history with a merge' '
 	test_commit B &&
 	git checkout -b side HEAD^ &&
 	test_commit C &&
-	git merge -m M master &&
+	git merge -m M main &&
 	test_commit D
 '
 
diff --git a/t/t4068-diff-symmetric-merge-base.sh b/t/t4068-diff-symmetric-merge-base.sh
index 55d47352ba..2d650d8f10 100755
--- a/t/t4068-diff-symmetric-merge-base.sh
+++ b/t/t4068-diff-symmetric-merge-base.sh
@@ -2,17 +2,17 @@
 
 test_description='behavior of diff with symmetric-diff setups and --merge-base'
 
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
 
 # build these situations:
 #  - normal merge with one merge base (br1...b2r);
-#  - criss-cross merge ie 2 merge bases (br1...master);
-#  - disjoint subgraph (orphan branch, br3...master).
+#  - criss-cross merge ie 2 merge bases (br1...main);
+#  - disjoint subgraph (orphan branch, br3...main).
 #
-#     B---E   <-- master
+#     B---E   <-- main
 #    / \ /
 #   A   X
 #    \ / \
@@ -35,9 +35,9 @@ test_expect_success setup '
 	git add c &&
 	git commit -m C &&
 	git tag commit-C &&
-	git merge -m D master &&
+	git merge -m D main &&
 	git tag commit-D &&
-	git checkout master &&
+	git checkout main &&
 	git merge -m E commit-C &&
 	git checkout -b br2 commit-C &&
 	echo f >f &&
@@ -61,7 +61,7 @@ test_expect_success 'diff with one merge base' '
 # It should have one of those two, which comes out
 # to seven lines.
 test_expect_success 'diff with two merge bases' '
-	git diff br1...master >tmp 2>err &&
+	git diff br1...main >tmp 2>err &&
 	test_line_count = 7 tmp &&
 	test_line_count = 1 err
 '
@@ -72,22 +72,22 @@ test_expect_success 'diff with no merge bases' '
 '
 
 test_expect_success 'diff with too many symmetric differences' '
-	test_must_fail git diff br1...master br2...br3 2>err &&
+	test_must_fail git diff br1...main br2...br3 2>err &&
 	test_i18ngrep "usage" err
 '
 
 test_expect_success 'diff with symmetric difference and extraneous arg' '
-	test_must_fail git diff master br1...master 2>err &&
+	test_must_fail git diff main br1...main 2>err &&
 	test_i18ngrep "usage" err
 '
 
 test_expect_success 'diff with two ranges' '
-	test_must_fail git diff master br1..master br2..br3 2>err &&
+	test_must_fail git diff main br1..main br2..br3 2>err &&
 	test_i18ngrep "usage" err
 '
 
 test_expect_success 'diff with ranges and extra arg' '
-	test_must_fail git diff master br1..master commit-D 2>err &&
+	test_must_fail git diff main br1..main commit-D 2>err &&
 	test_i18ngrep "usage" err
 '
 
@@ -96,21 +96,21 @@ test_expect_success 'diff --merge-base with no commits' '
 '
 
 test_expect_success 'diff --merge-base with three commits' '
-	test_must_fail git diff --merge-base br1 br2 master 2>err &&
+	test_must_fail git diff --merge-base br1 br2 main 2>err &&
 	test_i18ngrep "usage" err
 '
 
 for cmd in diff-index diff
 do
 	test_expect_success "$cmd --merge-base with one commit" '
-		git checkout master &&
+		git checkout main &&
 		git $cmd commit-C >expect &&
 		git $cmd --merge-base br2 >actual &&
 		test_cmp expect actual
 	'
 
 	test_expect_success "$cmd --merge-base with one commit and unstaged changes" '
-		git checkout master &&
+		git checkout main &&
 		test_when_finished git reset --hard &&
 		echo unstaged >>c &&
 		git $cmd commit-C >expect &&
@@ -119,7 +119,7 @@ do
 	'
 
 	test_expect_success "$cmd --merge-base with one commit and staged and unstaged changes" '
-		git checkout master &&
+		git checkout main &&
 		test_when_finished git reset --hard &&
 		echo staged >>c &&
 		git add c &&
@@ -130,7 +130,7 @@ do
 	'
 
 	test_expect_success "$cmd --merge-base --cached with one commit and staged and unstaged changes" '
-		git checkout master &&
+		git checkout main &&
 		test_when_finished git reset --hard &&
 		echo staged >>c &&
 		git add c &&
@@ -141,19 +141,19 @@ do
 	'
 
 	test_expect_success "$cmd --merge-base with non-commit" '
-		git checkout master &&
-		test_must_fail git $cmd --merge-base master^{tree} 2>err &&
+		git checkout main &&
+		test_must_fail git $cmd --merge-base main^{tree} 2>err &&
 		test_i18ngrep "fatal: --merge-base only works with commits" err
 	'
 
 	test_expect_success "$cmd --merge-base with no merge bases and one commit" '
-		git checkout master &&
+		git checkout main &&
 		test_must_fail git $cmd --merge-base br3 2>err &&
 		test_i18ngrep "fatal: no merge base found" err
 	'
 
 	test_expect_success "$cmd --merge-base with multiple merge bases and one commit" '
-		git checkout master &&
+		git checkout main &&
 		test_must_fail git $cmd --merge-base br1 2>err &&
 		test_i18ngrep "fatal: multiple merge bases found" err
 	'
@@ -162,13 +162,13 @@ done
 for cmd in diff-tree diff
 do
 	test_expect_success "$cmd --merge-base with two commits" '
-		git $cmd commit-C master >expect &&
-		git $cmd --merge-base br2 master >actual &&
+		git $cmd commit-C main >expect &&
+		git $cmd --merge-base br2 main >actual &&
 		test_cmp expect actual
 	'
 
 	test_expect_success "$cmd --merge-base commit and non-commit" '
-		test_must_fail git $cmd --merge-base br2 master^{tree} 2>err &&
+		test_must_fail git $cmd --merge-base br2 main^{tree} 2>err &&
 		test_i18ngrep "fatal: --merge-base only works with commits" err
 	'
 
@@ -178,13 +178,13 @@ do
 	'
 
 	test_expect_success "$cmd --merge-base with multiple merge bases and two commits" '
-		test_must_fail git $cmd --merge-base master br1 2>err &&
+		test_must_fail git $cmd --merge-base main br1 2>err &&
 		test_i18ngrep "fatal: multiple merge bases found" err
 	'
 done
 
 test_expect_success 'diff-tree --merge-base with one commit' '
-	test_must_fail git diff-tree --merge-base master 2>err &&
+	test_must_fail git diff-tree --merge-base main 2>err &&
 	test_i18ngrep "fatal: --merge-base only works with two commits" err
 '
 
diff --git a/t/t4103-apply-binary.sh b/t/t4103-apply-binary.sh
index ee4a74b132..fad6d3f542 100755
--- a/t/t4103-apply-binary.sh
+++ b/t/t4103-apply-binary.sh
@@ -6,7 +6,7 @@
 test_description='git apply handling binary patches
 
 '
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -34,64 +34,64 @@ test_expect_success 'setup' '
 	git update-index --add --remove file1 file2 file3 file4 &&
 	git commit -m "Second Version" &&
 
-	git diff-tree -p master binary >B.diff &&
-	git diff-tree -p -C master binary >C.diff &&
+	git diff-tree -p main binary >B.diff &&
+	git diff-tree -p -C main binary >C.diff &&
 
-	git diff-tree -p --binary master binary >BF.diff &&
-	git diff-tree -p --binary -C master binary >CF.diff &&
+	git diff-tree -p --binary main binary >BF.diff &&
+	git diff-tree -p --binary -C main binary >CF.diff &&
 
-	git diff-tree -p --full-index master binary >B-index.diff &&
-	git diff-tree -p -C --full-index master binary >C-index.diff &&
+	git diff-tree -p --full-index main binary >B-index.diff &&
+	git diff-tree -p -C --full-index main binary >C-index.diff &&
 
-	git diff-tree -p --binary --no-prefix master binary -- file3 >B0.diff &&
+	git diff-tree -p --binary --no-prefix main binary -- file3 >B0.diff &&
 
 	git init other-repo &&
 	(
 		cd other-repo &&
-		git fetch .. master &&
+		git fetch .. main &&
 		git reset --hard FETCH_HEAD
 	)
 '
 
 test_expect_success 'stat binary diff -- should not fail.' \
-	'git checkout master &&
+	'git checkout main &&
 	 git apply --stat --summary B.diff'
 
 test_expect_success 'stat binary -p0 diff -- should not fail.' '
-	 git checkout master &&
+	 git checkout main &&
 	 git apply --stat -p0 B0.diff
 '
 
 test_expect_success 'stat binary diff (copy) -- should not fail.' \
-	'git checkout master &&
+	'git checkout main &&
 	 git apply --stat --summary C.diff'
 
 test_expect_success 'check binary diff -- should fail.' \
-	'git checkout master &&
+	'git checkout main &&
 	 test_must_fail git apply --check B.diff'
 
 test_expect_success 'check binary diff (copy) -- should fail.' \
-	'git checkout master &&
+	'git checkout main &&
 	 test_must_fail git apply --check C.diff'
 
 test_expect_success \
 	'check incomplete binary diff with replacement -- should fail.' '
-	git checkout master &&
+	git checkout main &&
 	test_must_fail git apply --check --allow-binary-replacement B.diff
 '
 
 test_expect_success \
     'check incomplete binary diff with replacement (copy) -- should fail.' '
-	 git checkout master &&
+	 git checkout main &&
 	 test_must_fail git apply --check --allow-binary-replacement C.diff
 '
 
 test_expect_success 'check binary diff with replacement.' \
-	'git checkout master &&
+	'git checkout main &&
 	 git apply --check --allow-binary-replacement BF.diff'
 
 test_expect_success 'check binary diff with replacement (copy).' \
-	'git checkout master &&
+	'git checkout main &&
 	 git apply --check --allow-binary-replacement CF.diff'
 
 # Now we start applying them.
@@ -99,7 +99,7 @@ test_expect_success 'check binary diff with replacement (copy).' \
 do_reset () {
 	rm -f file? &&
 	git reset --hard &&
-	git checkout -f master
+	git checkout -f main
 }
 
 test_expect_success 'apply binary diff -- should fail.' \
diff --git a/t/t4108-apply-threeway.sh b/t/t4108-apply-threeway.sh
index 0a091dc5a0..d62db3fbe1 100755
--- a/t/t4108-apply-threeway.sh
+++ b/t/t4108-apply-threeway.sh
@@ -2,7 +2,7 @@
 
 test_description='git apply --3way'
 
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -27,14 +27,14 @@ test_expect_success setup '
 	test_tick &&
 	test_write_lines 1 two 3 4 5 six 7 >one &&
 	test_write_lines 1 two 3 4 5 6 7 >two &&
-	git commit -a -m master &&
+	git commit -a -m main &&
 
 	git checkout side &&
 	test_write_lines 1 2 3 4 five 6 7 >one &&
 	test_write_lines 1 2 3 4 five 6 7 >two &&
 	git commit -a -m side &&
 
-	git checkout master
+	git checkout main
 '
 
 test_expect_success 'apply without --3way' '
@@ -42,7 +42,7 @@ test_expect_success 'apply without --3way' '
 
 	# should fail to apply
 	git reset --hard &&
-	git checkout master^0 &&
+	git checkout main^0 &&
 	test_must_fail git apply --index P.diff &&
 	# should leave things intact
 	git diff-files --exit-code &&
@@ -55,14 +55,14 @@ test_apply_with_3way () {
 
 	# The corresponding conflicted merge
 	git reset --hard &&
-	git checkout master^0 &&
+	git checkout main^0 &&
 	test_must_fail git merge --no-commit side &&
 	git ls-files -s >expect.ls &&
 	print_sanitized_conflicted_diff >expect.diff &&
 
 	# should fail to apply
 	git reset --hard &&
-	git checkout master^0 &&
+	git checkout main^0 &&
 	test_must_fail git apply --index --3way P.diff &&
 	git ls-files -s >actual.ls &&
 	print_sanitized_conflicted_diff >actual.diff &&
@@ -89,7 +89,7 @@ test_expect_success 'apply with --3way with rerere enabled' '
 
 	# The corresponding conflicted merge
 	git reset --hard &&
-	git checkout master^0 &&
+	git checkout main^0 &&
 	test_must_fail git merge --no-commit side &&
 
 	# Manually resolve and record the resolution
@@ -99,7 +99,7 @@ test_expect_success 'apply with --3way with rerere enabled' '
 
 	# should fail to apply
 	git reset --hard &&
-	git checkout master^0 &&
+	git checkout main^0 &&
 	test_must_fail git apply --index --3way P.diff &&
 
 	# but rerere should have replayed the recorded resolution
diff --git a/t/t4121-apply-diffs.sh b/t/t4121-apply-diffs.sh
index 60deb3bf78..b45454aaf4 100755
--- a/t/t4121-apply-diffs.sh
+++ b/t/t4121-apply-diffs.sh
@@ -1,7 +1,7 @@
 #!/bin/sh
 
 test_description='git apply for contextually independent diffs'
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -26,7 +26,7 @@ test_expect_success 'setup' \
 	git commit -a -q -m 2 &&
 	echo 9 >>file &&
 	git commit -a -q -m 3 &&
-	git checkout master'
+	git checkout main'
 
 test_expect_success \
 	'check if contextually independent diffs for the same file apply' \
diff --git a/t/t4122-apply-symlink-inside.sh b/t/t4122-apply-symlink-inside.sh
index 71deaf779d..aa52de401b 100755
--- a/t/t4122-apply-symlink-inside.sh
+++ b/t/t4122-apply-symlink-inside.sh
@@ -1,7 +1,7 @@
 #!/bin/sh
 
 test_description='apply to deeper directory without getting fooled with symlink'
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -38,11 +38,11 @@ test_expect_success apply '
 
 test_expect_success 'check result' '
 
-	git diff --exit-code master &&
-	git diff --exit-code --cached master &&
+	git diff --exit-code main &&
+	git diff --exit-code --cached main &&
 	test_tick &&
 	git commit -m replay &&
-	T1=$(git rev-parse "master^{tree}") &&
+	T1=$(git rev-parse "main^{tree}") &&
 	T2=$(git rev-parse "HEAD^{tree}") &&
 	test "z$T1" = "z$T2"
 
diff --git a/t/t4150-am.sh b/t/t4150-am.sh
index e1ffc04852..99987515dc 100755
--- a/t/t4150-am.sh
+++ b/t/t4150-am.sh
@@ -2,7 +2,7 @@
 
 test_description='git am running'
 
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -182,8 +182,8 @@ test_expect_success setup '
 	test_tick &&
 	git commit -m "added another file" &&
 
-	git format-patch --stdout master >lorem-move.patch &&
-	git format-patch --no-prefix --stdout master >lorem-zero.patch &&
+	git format-patch --stdout main >lorem-move.patch &&
+	git format-patch --no-prefix --stdout main >lorem-zero.patch &&
 
 	git checkout -b rename &&
 	git mv file renamed &&
@@ -456,11 +456,11 @@ test_expect_success 'am changes committer and keeps author' '
 	git checkout first &&
 	git am patch2 &&
 	test_path_is_missing .git/rebase-apply &&
-	test "$(git rev-parse master^^)" = "$(git rev-parse HEAD^^)" &&
-	git diff --exit-code master..HEAD &&
-	git diff --exit-code master^..HEAD^ &&
-	compare author master HEAD &&
-	compare author master^ HEAD^ &&
+	test "$(git rev-parse main^^)" = "$(git rev-parse HEAD^^)" &&
+	git diff --exit-code main..HEAD &&
+	git diff --exit-code main^..HEAD^ &&
+	compare author main HEAD &&
+	compare author main^ HEAD^ &&
 	test "$GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL>" = \
 	     "$(git log -1 --pretty=format:"%cn <%ce>" HEAD)"
 '
@@ -762,7 +762,7 @@ test_expect_success 'am takes patches from a Pine mailbox' '
 	git checkout first &&
 	cat pine patch1 | git am &&
 	test_path_is_missing .git/rebase-apply &&
-	git diff --exit-code master^..HEAD
+	git diff --exit-code main^..HEAD
 '
 
 test_expect_success 'am fails on mail without patch' '
@@ -1115,21 +1115,21 @@ test_expect_success 'am and .gitattibutes' '
 		test_commit sixth &&
 
 		git checkout test &&
-		git format-patch --stdout master..HEAD >patches &&
-		git reset --hard master &&
+		git format-patch --stdout main..HEAD >patches &&
+		git reset --hard main &&
 		git am patches &&
 		grep "smudged" a.txt &&
 
 		git checkout removal &&
 		git reset --hard &&
-		git format-patch --stdout master..HEAD >patches &&
-		git reset --hard master &&
+		git format-patch --stdout main..HEAD >patches &&
+		git reset --hard main &&
 		git am patches &&
 		grep "clean" a.txt &&
 
 		git checkout conflict &&
 		git reset --hard &&
-		git format-patch --stdout master..HEAD >patches &&
+		git format-patch --stdout main..HEAD >patches &&
 		git reset --hard fourth &&
 		test_must_fail git am -3 patches &&
 		grep "<<<<<<<<<<" a.txt
diff --git a/t/t4200-rerere.sh b/t/t4200-rerere.sh
index 1f1a809c60..9f8c76dffb 100755
--- a/t/t4200-rerere.sh
+++ b/t/t4200-rerere.sh
@@ -8,7 +8,7 @@ test_description='git rerere
 ! [fifth] version1
  ! [first] first
   ! [fourth] version1
-   ! [master] initial
+   ! [main] initial
     ! [second] prefer first over second
      ! [third] version2
 ------
@@ -19,10 +19,10 @@ test_description='git rerere
     -  [second] prefer first over second
  +  +  [first] first
     +  [second^] second
-++++++ [master] initial
+++++++ [main] initial
 '
 
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -60,7 +60,7 @@ test_expect_success 'setup' '
 	test_tick &&
 	git commit -q -a -m first &&
 
-	git checkout -b second master &&
+	git checkout -b second main &&
 	git show first:a1 |
 	sed -e "s/To die, t/To die! T/" -e "s/Some title/Some Title/" >a1 &&
 	echo "* END *" >>a1 &&
@@ -171,7 +171,7 @@ test_expect_success 'first postimage wins' '
 
 	oldmtimepost=$(test-tool chmtime --get -60 $rr/postimage) &&
 
-	git checkout -b third master &&
+	git checkout -b third main &&
 	git show second^:a1 | sed "s/To die: t/To die! T/" >a1 &&
 	git commit -q -a -m third &&
 
@@ -583,13 +583,13 @@ test_expect_success 'multiple identical conflicts' '
 test_expect_success 'rerere with unexpected conflict markers does not crash' '
 	git reset --hard &&
 
-	git checkout -b branch-1 master &&
+	git checkout -b branch-1 main &&
 	echo "bar" >test &&
 	git add test &&
 	git commit -q -m two &&
 
 	git reset --hard &&
-	git checkout -b branch-2 master &&
+	git checkout -b branch-2 main &&
 	echo "foo" >test &&
 	git add test &&
 	git commit -q -a -m one &&
@@ -604,7 +604,7 @@ test_expect_success 'rerere with unexpected conflict markers does not crash' '
 test_expect_success 'rerere with inner conflict markers' '
 	git reset --hard &&
 
-	git checkout -b A master &&
+	git checkout -b A main &&
 	echo "bar" >test &&
 	git add test &&
 	git commit -q -m two &&
@@ -613,7 +613,7 @@ test_expect_success 'rerere with inner conflict markers' '
 	git commit -q -m three &&
 
 	git reset --hard &&
-	git checkout -b B master &&
+	git checkout -b B main &&
 	echo "foo" >test &&
 	git add test &&
 	git commit -q -a -m one &&
@@ -654,11 +654,11 @@ test_expect_success 'setup simple stage 1 handling' '
 		git add original &&
 		git commit -m original &&
 
-		git checkout -b A master &&
+		git checkout -b A main &&
 		git mv original A &&
 		git commit -m "rename to A" &&
 
-		git checkout -b B master &&
+		git checkout -b B main &&
 		git mv original B &&
 		git commit -m "rename to B"
 	)
diff --git a/t/t4201-shortlog.sh b/t/t4201-shortlog.sh
index ad6d3eebe5..3095b1b2ff 100755
--- a/t/t4201-shortlog.sh
+++ b/t/t4201-shortlog.sh
@@ -6,7 +6,7 @@
 test_description='git shortlog
 '
 
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -194,7 +194,7 @@ test_expect_success 'shortlog with revision pseudo options' '
 '
 
 test_expect_success 'shortlog with --output=<file>' '
-	git shortlog --output=shortlog -1 master >output &&
+	git shortlog --output=shortlog -1 main >output &&
 	test_must_be_empty output &&
 	test_line_count = 3 shortlog
 '
diff --git a/t/t4202-log.sh b/t/t4202-log.sh
index 6c7a3cfc2c..350cfa3593 100755
--- a/t/t4202-log.sh
+++ b/t/t4202-log.sh
@@ -2,7 +2,7 @@
 
 test_description='git log'
 
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -481,7 +481,7 @@ test_expect_success 'set up merge history' '
 	git checkout -b side HEAD~4 &&
 	test_commit side-1 1 1 &&
 	test_commit side-2 2 2 &&
-	git checkout master &&
+	git checkout main &&
 	git merge side
 '
 
@@ -544,17 +544,17 @@ test_expect_success 'log --graph with merge with log.graphColors' '
 '
 
 test_expect_success 'log --raw --graph -m with merge' '
-	git log --raw --graph --oneline -m master | head -n 500 >actual &&
+	git log --raw --graph --oneline -m main | head -n 500 >actual &&
 	grep "initial" actual
 '
 
 test_expect_success 'diff-tree --graph' '
-	git diff-tree --graph master^ | head -n 500 >actual &&
+	git diff-tree --graph main^ | head -n 500 >actual &&
 	grep "one" actual
 '
 
 cat > expect <<\EOF
-*   commit master
+*   commit main
 |\  Merge: A B
 | | Author: A U Thor <author@example.com>
 | |
@@ -570,22 +570,22 @@ cat > expect <<\EOF
 | |
 | |     side-1
 | |
-* | commit master~1
+* | commit main~1
 | | Author: A U Thor <author@example.com>
 | |
 | |     Second
 | |
-* | commit master~2
+* | commit main~2
 | | Author: A U Thor <author@example.com>
 | |
 | |     sixth
 | |
-* | commit master~3
+* | commit main~3
 | | Author: A U Thor <author@example.com>
 | |
 | |     fifth
 | |
-* | commit master~4
+* | commit main~4
 |/  Author: A U Thor <author@example.com>
 |
 |       fourth
@@ -616,19 +616,19 @@ test_expect_success 'log --graph with full output' '
 test_expect_success 'set up more tangled history' '
 	git checkout -b tangle HEAD~6 &&
 	test_commit tangle-a tangle-a a &&
-	git merge master~3 &&
+	git merge main~3 &&
 	git merge side~1 &&
-	git checkout master &&
+	git checkout main &&
 	git merge tangle &&
 	git checkout -b reach &&
 	test_commit reach &&
-	git checkout master &&
+	git checkout main &&
 	git checkout -b octopus-a &&
 	test_commit octopus-a &&
-	git checkout master &&
+	git checkout main &&
 	git checkout -b octopus-b &&
 	test_commit octopus-b &&
-	git checkout master &&
+	git checkout main &&
 	test_commit seventh &&
 	git merge octopus-a octopus-b &&
 	git merge reach
@@ -653,7 +653,7 @@ cat > expect <<\EOF
 |\
 | *   Merge branch 'side' (early part) into tangle
 | |\
-| * \   Merge branch 'master' (early part) into tangle
+| * \   Merge branch 'main' (early part) into tangle
 | |\ \
 | * | | tangle-a
 * | | |   Merge branch 'side'
@@ -797,7 +797,7 @@ test_expect_success 'multiple decorate-refs' '
 
 test_expect_success 'decorate-refs-exclude with glob' '
 	cat >expect.decorate <<-\EOF &&
-	Merge-tag-reach (HEAD -> master)
+	Merge-tag-reach (HEAD -> main)
 	Merge-tags-octopus-a-and-octopus-b
 	seventh (tag: seventh)
 	octopus-b (tag: octopus-b)
@@ -814,7 +814,7 @@ test_expect_success 'decorate-refs-exclude with glob' '
 
 test_expect_success 'decorate-refs-exclude without globs' '
 	cat >expect.decorate <<-\EOF &&
-	Merge-tag-reach (HEAD -> master)
+	Merge-tag-reach (HEAD -> main)
 	Merge-tags-octopus-a-and-octopus-b
 	seventh (tag: seventh)
 	octopus-b (tag: octopus-b, octopus-b)
@@ -831,7 +831,7 @@ test_expect_success 'decorate-refs-exclude without globs' '
 
 test_expect_success 'multiple decorate-refs-exclude' '
 	cat >expect.decorate <<-\EOF &&
-	Merge-tag-reach (HEAD -> master)
+	Merge-tag-reach (HEAD -> main)
 	Merge-tags-octopus-a-and-octopus-b
 	seventh (tag: seventh)
 	octopus-b (tag: octopus-b)
@@ -854,7 +854,7 @@ test_expect_success 'multiple decorate-refs-exclude' '
 
 test_expect_success 'decorate-refs and decorate-refs-exclude' '
 	cat >expect.no-decorate <<-\EOF &&
-	Merge-tag-reach (master)
+	Merge-tag-reach (main)
 	Merge-tags-octopus-a-and-octopus-b
 	seventh
 	octopus-b
@@ -869,7 +869,7 @@ test_expect_success 'decorate-refs and decorate-refs-exclude' '
 
 test_expect_success 'deocrate-refs and log.excludeDecoration' '
 	cat >expect.decorate <<-\EOF &&
-	Merge-tag-reach (master)
+	Merge-tag-reach (main)
 	Merge-tags-octopus-a-and-octopus-b
 	seventh
 	octopus-b (octopus-b)
@@ -884,7 +884,7 @@ test_expect_success 'deocrate-refs and log.excludeDecoration' '
 
 test_expect_success 'decorate-refs-exclude and simplify-by-decoration' '
 	cat >expect.decorate <<-\EOF &&
-	Merge-tag-reach (HEAD -> master)
+	Merge-tag-reach (HEAD -> main)
 	reach (tag: reach, reach)
 	seventh (tag: seventh)
 	Merge-branch-tangle
@@ -1083,7 +1083,7 @@ cat >expect <<\EOF
 | |\ \  Merge: MERGE_PARENTS
 | | | | Author: A U Thor <author@example.com>
 | | | |
-| | | |     Merge branch 'master' (early part) into tangle
+| | | |     Merge branch 'main' (early part) into tangle
 | | | |
 | * | | commit COMMIT_OBJECT_NAME
 | | | | Author: A U Thor <author@example.com>
@@ -1358,7 +1358,7 @@ cat >expect <<\EOF
 *** | |\ \  Merge: MERGE_PARENTS
 *** | | | | Author: A U Thor <author@example.com>
 *** | | | |
-*** | | | |     Merge branch 'master' (early part) into tangle
+*** | | | |     Merge branch 'main' (early part) into tangle
 *** | | | |
 *** | * | | commit COMMIT_OBJECT_NAME
 *** | | | | Author: A U Thor <author@example.com>
@@ -1591,24 +1591,24 @@ test_expect_success 'dotdot is a parent directory' '
 '
 
 test_expect_success GPG 'setup signed branch' '
-	test_when_finished "git reset --hard && git checkout master" &&
-	git checkout -b signed master &&
+	test_when_finished "git reset --hard && git checkout main" &&
+	git checkout -b signed main &&
 	echo foo >foo &&
 	git add foo &&
 	git commit -S -m signed_commit
 '
 
 test_expect_success GPG 'setup signed branch with subkey' '
-	test_when_finished "git reset --hard && git checkout master" &&
-	git checkout -b signed-subkey master &&
+	test_when_finished "git reset --hard && git checkout main" &&
+	git checkout -b signed-subkey main &&
 	echo foo >foo &&
 	git add foo &&
 	git commit -SB7227189 -m signed_commit
 '
 
 test_expect_success GPGSM 'setup signed branch x509' '
-	test_when_finished "git reset --hard && git checkout master" &&
-	git checkout -b signed-x509 master &&
+	test_when_finished "git reset --hard && git checkout main" &&
+	git checkout -b signed-x509 main &&
 	echo foo >foo &&
 	git add foo &&
 	test_config gpg.format x509 &&
@@ -1641,12 +1641,12 @@ test_expect_success GPGSM 'log --graph --show-signature x509' '
 '
 
 test_expect_success GPG 'log --graph --show-signature for merged tag' '
-	test_when_finished "git reset --hard && git checkout master" &&
-	git checkout -b plain master &&
+	test_when_finished "git reset --hard && git checkout main" &&
+	git checkout -b plain main &&
 	echo aaa >bar &&
 	git add bar &&
 	git commit -m bar_commit &&
-	git checkout -b tagged master &&
+	git checkout -b tagged main &&
 	echo bbb >baz &&
 	git add baz &&
 	git commit -m baz_commit &&
@@ -1660,12 +1660,12 @@ test_expect_success GPG 'log --graph --show-signature for merged tag' '
 '
 
 test_expect_success GPG 'log --graph --show-signature for merged tag in shallow clone' '
-	test_when_finished "git reset --hard && git checkout master" &&
-	git checkout -b plain-shallow master &&
+	test_when_finished "git reset --hard && git checkout main" &&
+	git checkout -b plain-shallow main &&
 	echo aaa >bar &&
 	git add bar &&
 	git commit -m bar_commit &&
-	git checkout --detach master &&
+	git checkout --detach main &&
 	echo bbb >baz &&
 	git add baz &&
 	git commit -m baz_commit &&
@@ -1680,12 +1680,12 @@ test_expect_success GPG 'log --graph --show-signature for merged tag in shallow
 '
 
 test_expect_success GPG 'log --graph --show-signature for merged tag with missing key' '
-	test_when_finished "git reset --hard && git checkout master" &&
-	git checkout -b plain-nokey master &&
+	test_when_finished "git reset --hard && git checkout main" &&
+	git checkout -b plain-nokey main &&
 	echo aaa >bar &&
 	git add bar &&
 	git commit -m bar_commit &&
-	git checkout -b tagged-nokey master &&
+	git checkout -b tagged-nokey main &&
 	echo bbb >baz &&
 	git add baz &&
 	git commit -m baz_commit &&
@@ -1699,12 +1699,12 @@ test_expect_success GPG 'log --graph --show-signature for merged tag with missin
 '
 
 test_expect_success GPG 'log --graph --show-signature for merged tag with bad signature' '
-	test_when_finished "git reset --hard && git checkout master" &&
-	git checkout -b plain-bad master &&
+	test_when_finished "git reset --hard && git checkout main" &&
+	git checkout -b plain-bad main &&
 	echo aaa >bar &&
 	git add bar &&
 	git commit -m bar_commit &&
-	git checkout -b tagged-bad master &&
+	git checkout -b tagged-bad main &&
 	echo bbb >baz &&
 	git add baz &&
 	git commit -m baz_commit &&
@@ -1721,12 +1721,12 @@ test_expect_success GPG 'log --graph --show-signature for merged tag with bad si
 '
 
 test_expect_success GPG 'log --show-signature for merged tag with GPG failure' '
-	test_when_finished "git reset --hard && git checkout master" &&
-	git checkout -b plain-fail master &&
+	test_when_finished "git reset --hard && git checkout main" &&
+	git checkout -b plain-fail main &&
 	echo aaa >bar &&
 	git add bar &&
 	git commit -m bar_commit &&
-	git checkout -b tagged-fail master &&
+	git checkout -b tagged-fail main &&
 	echo bbb >baz &&
 	git add baz &&
 	git commit -m baz_commit &&
@@ -1740,14 +1740,14 @@ test_expect_success GPG 'log --show-signature for merged tag with GPG failure' '
 '
 
 test_expect_success GPGSM 'log --graph --show-signature for merged tag x509' '
-	test_when_finished "git reset --hard && git checkout master" &&
+	test_when_finished "git reset --hard && git checkout main" &&
 	test_config gpg.format x509 &&
 	test_config user.signingkey $GIT_COMMITTER_EMAIL &&
-	git checkout -b plain-x509 master &&
+	git checkout -b plain-x509 main &&
 	echo aaa >bar &&
 	git add bar &&
 	git commit -m bar_commit &&
-	git checkout -b tagged-x509 master &&
+	git checkout -b tagged-x509 main &&
 	echo bbb >baz &&
 	git add baz &&
 	git commit -m baz_commit &&
@@ -1761,14 +1761,14 @@ test_expect_success GPGSM 'log --graph --show-signature for merged tag x509' '
 '
 
 test_expect_success GPGSM 'log --graph --show-signature for merged tag x509 missing key' '
-	test_when_finished "git reset --hard && git checkout master" &&
+	test_when_finished "git reset --hard && git checkout main" &&
 	test_config gpg.format x509 &&
 	test_config user.signingkey $GIT_COMMITTER_EMAIL &&
-	git checkout -b plain-x509-nokey master &&
+	git checkout -b plain-x509-nokey main &&
 	echo aaa >bar &&
 	git add bar &&
 	git commit -m bar_commit &&
-	git checkout -b tagged-x509-nokey master &&
+	git checkout -b tagged-x509-nokey main &&
 	echo bbb >baz &&
 	git add baz &&
 	git commit -m baz_commit &&
@@ -1781,14 +1781,14 @@ test_expect_success GPGSM 'log --graph --show-signature for merged tag x509 miss
 '
 
 test_expect_success GPGSM 'log --graph --show-signature for merged tag x509 bad signature' '
-	test_when_finished "git reset --hard && git checkout master" &&
+	test_when_finished "git reset --hard && git checkout main" &&
 	test_config gpg.format x509 &&
 	test_config user.signingkey $GIT_COMMITTER_EMAIL &&
-	git checkout -b plain-x509-bad master &&
+	git checkout -b plain-x509-bad main &&
 	echo aaa >bar &&
 	git add bar &&
 	git commit -m bar_commit &&
-	git checkout -b tagged-x509-bad master &&
+	git checkout -b tagged-x509-bad main &&
 	echo bbb >baz &&
 	git add baz &&
 	git commit -m baz_commit &&
@@ -1838,7 +1838,7 @@ test_expect_success 'log diagnoses bogus HEAD' '
 	git init empty &&
 	test_must_fail git -C empty log 2>stderr &&
 	test_i18ngrep does.not.have.any.commits stderr &&
-	echo 1234abcd >empty/.git/refs/heads/master &&
+	echo 1234abcd >empty/.git/refs/heads/main &&
 	test_must_fail git -C empty log 2>stderr &&
 	test_i18ngrep broken stderr &&
 	echo "ref: refs/heads/invalid.lock" >empty/.git/HEAD &&
diff --git a/t/t4203-mailmap.sh b/t/t4203-mailmap.sh
index 8a2f8984f6..3f82c651b4 100755
--- a/t/t4203-mailmap.sh
+++ b/t/t4203-mailmap.sh
@@ -2,7 +2,7 @@
 
 test_description='.mailmap configurations'
 
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -197,7 +197,7 @@ test_expect_success 'No mailmap files, but configured' '
 
 test_expect_success 'setup mailmap blob tests' '
 	git checkout -b map &&
-	test_when_finished "git checkout master" &&
+	test_when_finished "git checkout main" &&
 	cat >just-bugs <<- EOF &&
 	Blob Guy <bugs@company.xx>
 	EOF
diff --git a/t/t4204-patch-id.sh b/t/t4204-patch-id.sh
index 46ecb777f4..f120857c20 100755
--- a/t/t4204-patch-id.sh
+++ b/t/t4204-patch-id.sh
@@ -2,7 +2,7 @@
 
 test_description='git patch-id'
 
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -16,9 +16,9 @@ test_expect_success 'setup' '
 	test_write_lines $as b >foo &&
 	test_write_lines $as b >bar &&
 	git commit -a -m first &&
-	git checkout -b same master &&
+	git checkout -b same main &&
 	git commit --amend -m same-msg &&
-	git checkout -b notsame master &&
+	git checkout -b notsame main &&
 	echo c >foo &&
 	echo c >bar &&
 	git commit --amend -a -m notsame-msg &&
@@ -49,31 +49,31 @@ get_patch_id () {
 }
 
 test_expect_success 'patch-id detects equality' '
-	get_patch_id master &&
+	get_patch_id main &&
 	get_patch_id same &&
-	test_cmp patch-id_master patch-id_same
+	test_cmp patch-id_main patch-id_same
 '
 
 test_expect_success 'patch-id detects inequality' '
-	get_patch_id master &&
+	get_patch_id main &&
 	get_patch_id notsame &&
-	! test_cmp patch-id_master patch-id_notsame
+	! test_cmp patch-id_main patch-id_notsame
 '
 
 test_expect_success 'patch-id supports git-format-patch output' '
-	get_patch_id master &&
+	get_patch_id main &&
 	git checkout same &&
 	git format-patch -1 --stdout | calc_patch_id same &&
-	test_cmp patch-id_master patch-id_same &&
+	test_cmp patch-id_main patch-id_same &&
 	set $(git format-patch -1 --stdout | git patch-id) &&
 	test "$2" = $(git rev-parse HEAD)
 '
 
 test_expect_success 'whitespace is irrelevant in footer' '
-	get_patch_id master &&
+	get_patch_id main &&
 	git checkout same &&
 	git format-patch -1 --stdout | sed "s/ \$//" | calc_patch_id same &&
-	test_cmp patch-id_master patch-id_same
+	test_cmp patch-id_main patch-id_same
 '
 
 cmp_patch_id () {
@@ -91,7 +91,7 @@ test_patch_id_file_order () {
 	shift
 	name="order-${1}-$relevant"
 	shift
-	get_top_diff "master" | calc_patch_id "$name" "$@" &&
+	get_top_diff "main" | calc_patch_id "$name" "$@" &&
 	git checkout same &&
 	git format-patch -1 --stdout -O foo-then-bar |
 		calc_patch_id "ordered-$name" "$@" &&
@@ -140,10 +140,10 @@ test_expect_success '--stable overrides patchid.stable = false' '
 '
 
 test_expect_success 'patch-id supports git-format-patch MIME output' '
-	get_patch_id master &&
+	get_patch_id main &&
 	git checkout same &&
 	git format-patch -1 --attach --stdout | calc_patch_id same &&
-	test_cmp patch-id_master patch-id_same
+	test_cmp patch-id_main patch-id_same
 '
 
 test_expect_success 'patch-id respects config from subdir' '
diff --git a/t/t4207-log-decoration-colors.sh b/t/t4207-log-decoration-colors.sh
index 6c868df38d..b870942498 100755
--- a/t/t4207-log-decoration-colors.sh
+++ b/t/t4207-log-decoration-colors.sh
@@ -5,7 +5,7 @@
 
 test_description='Test for "git log --decorate" colors'
 
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -43,13 +43,13 @@ test_expect_success setup '
 
 cat >expected <<EOF
 ${c_commit}COMMIT_ID${c_reset}${c_commit} (${c_reset}${c_HEAD}HEAD ->\
- ${c_reset}${c_branch}master${c_reset}${c_commit},\
+ ${c_reset}${c_branch}main${c_reset}${c_commit},\
  ${c_reset}${c_tag}tag: v1.0${c_reset}${c_commit},\
  ${c_reset}${c_tag}tag: B${c_reset}${c_commit})${c_reset} B
 ${c_commit}COMMIT_ID${c_reset}${c_commit} (${c_reset}${c_tag}tag: A1${c_reset}${c_commit},\
- ${c_reset}${c_remoteBranch}other/master${c_reset}${c_commit})${c_reset} A1
+ ${c_reset}${c_remoteBranch}other/main${c_reset}${c_commit})${c_reset} A1
 ${c_commit}COMMIT_ID${c_reset}${c_commit} (${c_reset}${c_stash}refs/stash${c_reset}${c_commit})${c_reset}\
- On master: Changes to A.t
+ On main: Changes to A.t
 ${c_commit}COMMIT_ID${c_reset}${c_commit} (${c_reset}${c_tag}tag: A${c_reset}${c_commit})${c_reset} A
 EOF
 
diff --git a/t/t4208-log-magic-pathspec.sh b/t/t4208-log-magic-pathspec.sh
index 1938d4a58f..5e10136e9a 100755
--- a/t/t4208-log-magic-pathspec.sh
+++ b/t/t4208-log-magic-pathspec.sh
@@ -2,7 +2,7 @@
 
 test_description='magic pathspec tests using git-log'
 
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -29,7 +29,7 @@ test_expect_success '"git log :/a -- " should not be ambiguous' '
 '
 
 test_expect_success '"git log :/detached -- " should find a commit only in HEAD' '
-	test_when_finished "git checkout master" &&
+	test_when_finished "git checkout main" &&
 	git checkout --detach &&
 	# Must manually call `test_tick` instead of using `test_commit`,
 	# because the latter additionally creates a tag, which would make
@@ -122,7 +122,7 @@ test_expect_success 'command line pathspec parsing for "git log"' '
 	git checkout HEAD^ &&
 	echo 2 >a &&
 	git commit -a -m "update a to 2" &&
-	test_must_fail git merge master &&
+	test_must_fail git merge main &&
 	git add a &&
 	git log --merge -- a
 '
diff --git a/t/t4211-line-log.sh b/t/t4211-line-log.sh
index 59c258429d..560127cc07 100755
--- a/t/t4211-line-log.sh
+++ b/t/t4211-line-log.sh
@@ -1,7 +1,7 @@
 #!/bin/sh
 
 test_description='test log -L'
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
diff --git a/t/t4211/history.export b/t/t4211/history.export
index f9f41e211e..006972a1f2 100644
--- a/t/t4211/history.export
+++ b/t/t4211/history.export
@@ -316,7 +316,7 @@ long f(long x)
 	return s;
 }
 
-commit refs/heads/master
+commit refs/heads/main
 mark :19
 author Thomas Rast <trast@student.ethz.ch> 1362045024 +0100
 committer Thomas Rast <trast@student.ethz.ch> 1362045024 +0100
diff --git a/t/t4214-log-graph-octopus.sh b/t/t4214-log-graph-octopus.sh
index 981b83513a..f70c46bbbf 100755
--- a/t/t4214-log-graph-octopus.sh
+++ b/t/t4214-log-graph-octopus.sh
@@ -2,7 +2,7 @@
 
 test_description='git log --graph of skewed left octopus merge.'
 
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -20,7 +20,7 @@ test_cmp_colored_graph () {
 test_expect_success 'set up merge history' '
 	test_commit initial &&
 	for i in 1 2 3 4 ; do
-		git checkout master -b $i || return $?
+		git checkout main -b $i || return $?
 		# Make tag name different from branch name, to avoid
 		# ambiguity error when calling checkout.
 		test_commit $i $i $i tag$i || return $?
diff --git a/t/t4216-log-bloom.sh b/t/t4216-log-bloom.sh
index b3f3820dbb..0f16c4b9d5 100755
--- a/t/t4216-log-bloom.sh
+++ b/t/t4216-log-bloom.sh
@@ -1,7 +1,7 @@
 #!/bin/sh
 
 test_description='git log for a path with Bloom filters'
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -24,7 +24,7 @@ test_expect_success 'setup test - repo, commits, commit graph, log outputs' '
 	test_commit c10 file_to_be_deleted &&
 	git checkout -b side HEAD~4 &&
 	test_commit side-1 file4 &&
-	git checkout master &&
+	git checkout main &&
 	git merge side &&
 	test_commit c11 file5 &&
 	mv file5 file5_renamed &&
@@ -97,7 +97,7 @@ do
 		      "--topo-order" \
 		      "--date-order" \
 		      "--author-date-order" \
-		      "--ancestry-path side..master"
+		      "--ancestry-path side..main"
 	do
 		test_expect_success "git log option: $option for path: $path" '
 			test_bloom_filters_used "$option -- $path" &&
diff --git a/t/t4253-am-keep-cr-dos.sh b/t/t4253-am-keep-cr-dos.sh
index ec7ba62d67..0ee69d2a0c 100755
--- a/t/t4253-am-keep-cr-dos.sh
+++ b/t/t4253-am-keep-cr-dos.sh
@@ -6,7 +6,7 @@
 test_description='git-am mbox with dos line ending.
 
 '
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -46,7 +46,7 @@ test_expect_success 'setup repository with dos files' '
 
 test_expect_success 'am with dos files without --keep-cr' '
 	git checkout -b dosfiles initial &&
-	git format-patch -k initial..master &&
+	git format-patch -k initial..main &&
 	test_must_fail git am -k -3 000*.patch &&
 	git am --abort &&
 	rm -rf .git/rebase-apply 000*.patch
@@ -54,23 +54,23 @@ test_expect_success 'am with dos files without --keep-cr' '
 
 test_expect_success 'am with dos files with --keep-cr' '
 	git checkout -b dosfiles-keep-cr initial &&
-	git format-patch -k --stdout initial..master >output &&
+	git format-patch -k --stdout initial..main >output &&
 	git am --keep-cr -k -3 output &&
-	git diff --exit-code master
+	git diff --exit-code main
 '
 
 test_expect_success 'am with dos files config am.keepcr' '
 	git config am.keepcr 1 &&
 	git checkout -b dosfiles-conf-keepcr initial &&
-	git format-patch -k --stdout initial..master >output &&
+	git format-patch -k --stdout initial..main >output &&
 	git am -k -3 output &&
-	git diff --exit-code master
+	git diff --exit-code main
 '
 
 test_expect_success 'am with dos files config am.keepcr overridden by --no-keep-cr' '
 	git config am.keepcr 1 &&
 	git checkout -b dosfiles-conf-keepcr-override initial &&
-	git format-patch -k initial..master &&
+	git format-patch -k initial..main &&
 	test_must_fail git am -k -3 --no-keep-cr 000*.patch &&
 	git am --abort &&
 	rm -rf .git/rebase-apply 000*.patch
@@ -78,14 +78,14 @@ test_expect_success 'am with dos files config am.keepcr overridden by --no-keep-
 
 test_expect_success 'am with dos files with --keep-cr continue' '
 	git checkout -b dosfiles-keep-cr-continue initial &&
-	git format-patch -k initial..master &&
+	git format-patch -k initial..main &&
 	append_cr <file1a >file &&
 	git commit -m "different patch" file &&
 	test_must_fail git am --keep-cr -k -3 000*.patch &&
 	append_cr <file2 >file &&
 	git add file &&
 	git am -3 --resolved &&
-	git diff --exit-code master
+	git diff --exit-code main
 '
 
 test_expect_success 'am with unix files config am.keepcr overridden by --no-keep-cr' '
@@ -93,9 +93,9 @@ test_expect_success 'am with unix files config am.keepcr overridden by --no-keep
 	git checkout -b unixfiles-conf-keepcr-override initial &&
 	cp -f file1 file &&
 	git commit -m "line ending to unix" file &&
-	git format-patch -k initial..master &&
+	git format-patch -k initial..main &&
 	git am -k -3 --no-keep-cr 000*.patch &&
-	git diff --exit-code -w master
+	git diff --exit-code -w main
 '
 
 test_done
diff --git a/t/t4257-am-interactive.sh b/t/t4257-am-interactive.sh
index 5344bd248a..aed8f4de3d 100755
--- a/t/t4257-am-interactive.sh
+++ b/t/t4257-am-interactive.sh
@@ -10,7 +10,7 @@ test_expect_success 'set up patches to apply' '
 	git format-patch --stdout -2 >mbox &&
 
 	git reset --hard unrelated &&
-	test_commit conflict-master file master base
+	test_commit conflict-main file main base
 '
 
 # Sanity check our setup.
-- 
gitgitgadget


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH v3 10/28] t5323: prepare centered comment for `master` -> `main`
  2020-11-18 23:44   ` [PATCH v3 00/28] tests: use main as default branch name Johannes Schindelin via GitGitGadget
                       ` (8 preceding siblings ...)
  2020-11-18 23:44     ` [PATCH v3 09/28] t4*: " Johannes Schindelin via GitGitGadget
@ 2020-11-18 23:44     ` Johannes Schindelin via GitGitGadget
  2020-11-18 23:44     ` [PATCH v3 11/28] t5[0-4]*: adjust the references to the default branch name "main" Johannes Schindelin via GitGitGadget
                       ` (18 subsequent siblings)
  28 siblings, 0 replies; 163+ messages in thread
From: Johannes Schindelin via GitGitGadget @ 2020-11-18 23:44 UTC (permalink / raw)
  To: git
  Cc: Felipe Contreras, Ævar Arnfjörð Bjarmason,
	Johannes Schindelin, Jeff King, Jonathan Nieder,
	Johannes Schindelin, Johannes Schindelin

From: Johannes Schindelin <johannes.schindelin@gmx.de>

We are about to search-and-replace all mentions of `master` in t5323 by
`main`, which is two characters shorter. To prepare for that, let's add
padding to centered lines that will make them briefly uncentered, but
will be re-centered in the commit that performs that rename.

Doing it this way (instead of padding after replacing) makes it easier
to verify the validity of the patch that replaces `master` by `main`.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
---
 t/t5323-pack-redundant.sh | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/t/t5323-pack-redundant.sh b/t/t5323-pack-redundant.sh
index 6b4d1ca353..3903148926 100755
--- a/t/t5323-pack-redundant.sh
+++ b/t/t5323-pack-redundant.sh
@@ -312,7 +312,7 @@ test_expect_success 'shared: all packs are redundant, but no output without --al
 #############################################################################
 # Chart of packs and objects for this test case
 #
-#     ================ master.git ===============
+#     ================= master.git ================
 #         | T A B C D E F G H I J K L M N O P Q R  <----------+
 #     ----+--------------------------------------             |
 #     P1  | x x x x x x x                       x             |
@@ -394,7 +394,7 @@ test_expect_success 'shared: no redundant without --alt-odb' '
 #############################################################################
 # Chart of packs and objects for this test case
 #
-#     ================ master.git ===============
+#     ================= master.git ================
 #         | T A B C D E F G H I J K L M N O P Q R  <----------------+
 #     ----+--------------------------------------                   |
 #     P1  | x x x x x x x                       x                   |
@@ -426,7 +426,7 @@ test_expect_success 'shared: one pack is redundant with --alt-odb' '
 #############################################################################
 # Chart of packs and objects for this test case
 #
-#     ================ master.git ===============
+#     ================= master.git ================
 #         | T A B C D E F G H I J K L M N O P Q R  <----------------+
 #     ----+--------------------------------------                   |
 #     P1  | x x x x x x x                       x                   |
-- 
gitgitgadget


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH v3 11/28] t5[0-4]*: adjust the references to the default branch name "main"
  2020-11-18 23:44   ` [PATCH v3 00/28] tests: use main as default branch name Johannes Schindelin via GitGitGadget
                       ` (9 preceding siblings ...)
  2020-11-18 23:44     ` [PATCH v3 10/28] t5323: prepare centered comment for `master` -> `main` Johannes Schindelin via GitGitGadget
@ 2020-11-18 23:44     ` Johannes Schindelin via GitGitGadget
  2020-11-18 23:44     ` [PATCH v3 12/28] t5503: prepare aligned comment for replacing `master` with `main` Johannes Schindelin via GitGitGadget
                       ` (17 subsequent siblings)
  28 siblings, 0 replies; 163+ messages in thread
From: Johannes Schindelin via GitGitGadget @ 2020-11-18 23:44 UTC (permalink / raw)
  To: git
  Cc: Felipe Contreras, Ævar Arnfjörð Bjarmason,
	Johannes Schindelin, Jeff King, Jonathan Nieder,
	Johannes Schindelin, Johannes Schindelin

From: Johannes Schindelin <johannes.schindelin@gmx.de>

Carefully excluding t5310, which is developed independently of the
current patch series at the time of writing, we now use `main` as
default branch in t5[0-4]*. 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[0-4]*.sh &&
	   git checkout HEAD -- t5310\*)

This allows us to define `GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main`
for those tests.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
---
 t/t5150-request-pull.sh                | 36 +++++++-------
 t/t5304-prune.sh                       |  4 +-
 t/t5305-include-tag.sh                 |  4 +-
 t/t5312-prune-corruption.sh            | 18 +++----
 t/t5317-pack-objects-filter-objects.sh |  4 +-
 t/t5322-pack-objects-sparse.sh         |  4 +-
 t/t5323-pack-redundant.sh              | 66 +++++++++++++-------------
 t/t5400-send-pack.sh                   | 62 ++++++++++++------------
 t/t5401-update-hooks.sh                | 24 +++++-----
 t/t5402-post-merge-hook.sh             |  4 +-
 t/t5403-post-checkout-hook.sh          |  8 ++--
 t/t5404-tracking-branches.sh           | 10 ++--
 t/t5405-send-pack-rewind.sh            |  8 ++--
 t/t5407-post-rewrite-hook.sh           |  4 +-
 t/t5410-receive-pack-alternates.sh     |  6 +--
 15 files changed, 131 insertions(+), 131 deletions(-)

diff --git a/t/t5150-request-pull.sh b/t/t5150-request-pull.sh
index 752e1fb2d2..db4e15fd59 100755
--- a/t/t5150-request-pull.sh
+++ b/t/t5150-request-pull.sh
@@ -2,7 +2,7 @@
 
 test_description='Test workflows involving pull request.'
 
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -34,13 +34,13 @@ test_expect_success 'setup' '
 		test_tick &&
 		git commit -m "\"Thirty days\", a reminder of month lengths" &&
 		git tag -m "version 1" -a initial &&
-		git push --tags origin master
+		git push --tags origin main
 	) &&
 	(
 		cd local &&
 		git remote add upstream "$trash_url/upstream.git" &&
 		git fetch upstream &&
-		git pull upstream master &&
+		git pull upstream main &&
 		cat <<-\EOT >>mnemonic.txt &&
 		Of twyecescore-eightt is but eine,
 		And all the remnante be thrycescore-eine.
@@ -62,7 +62,7 @@ test_expect_success 'setup' '
 		git commit -a -m "Adapt to use modern, simpler English
 
 But keep the old version, too, in case some people prefer it." &&
-		git checkout master
+		git checkout main
 	)
 
 '
@@ -132,7 +132,7 @@ test_expect_success 'pull request when forgot to push' '
 	(
 		cd local &&
 		git checkout initial &&
-		git merge --ff-only master &&
+		git merge --ff-only main &&
 		test_must_fail git request-pull initial "$downstream_url" \
 			2>../err
 	) &&
@@ -148,9 +148,9 @@ test_expect_success 'pull request after push' '
 	(
 		cd local &&
 		git checkout initial &&
-		git merge --ff-only master &&
-		git push origin master:for-upstream &&
-		git request-pull initial origin master:for-upstream >../request
+		git merge --ff-only main &&
+		git push origin main:for-upstream &&
+		git request-pull initial origin main:for-upstream >../request
 	) &&
 	sed -nf read-request.sed <request >digest &&
 	{
@@ -175,9 +175,9 @@ test_expect_success 'request asks HEAD to be pulled' '
 	(
 		cd local &&
 		git checkout initial &&
-		git merge --ff-only master &&
-		git push --tags origin master simplify &&
-		git push origin master:for-upstream &&
+		git merge --ff-only main &&
+		git push --tags origin main simplify &&
+		git push origin main:for-upstream &&
 		git request-pull initial "$downstream_url" >../request
 	) &&
 	sed -nf read-request.sed <request >digest &&
@@ -218,7 +218,7 @@ test_expect_success 'pull request format' '
 	(
 		cd local &&
 		git checkout initial &&
-		git merge --ff-only master &&
+		git merge --ff-only main &&
 		git push origin tags/full &&
 		git request-pull initial "$downstream_url" tags/full >../request
 	) &&
@@ -246,9 +246,9 @@ test_expect_success 'request-pull ignores OPTIONS_KEEPDASHDASH poison' '
 		OPTIONS_KEEPDASHDASH=Yes &&
 		export OPTIONS_KEEPDASHDASH &&
 		git checkout initial &&
-		git merge --ff-only master &&
-		git push origin master:for-upstream &&
-		git request-pull -- initial "$downstream_url" master:for-upstream >../request
+		git merge --ff-only main &&
+		git push origin main:for-upstream &&
+		git request-pull -- initial "$downstream_url" main:for-upstream >../request
 	)
 
 '
@@ -260,7 +260,7 @@ test_expect_success 'request-pull quotes regex metacharacters properly' '
 	(
 		cd local &&
 		git checkout initial &&
-		git merge --ff-only master &&
+		git merge --ff-only main &&
 		git tag -mrelease v2.0 &&
 		git push origin refs/tags/v2.0:refs/tags/v2-0 &&
 		test_must_fail git request-pull initial "$downstream_url" tags/v2.0 \
@@ -278,7 +278,7 @@ test_expect_success 'pull request with mismatched object' '
 	(
 		cd local &&
 		git checkout initial &&
-		git merge --ff-only master &&
+		git merge --ff-only main &&
 		git push origin HEAD:refs/tags/full &&
 		test_must_fail git request-pull initial "$downstream_url" tags/full \
 			2>../err
@@ -295,7 +295,7 @@ test_expect_success 'pull request with stale object' '
 	(
 		cd local &&
 		git checkout initial &&
-		git merge --ff-only master &&
+		git merge --ff-only main &&
 		git push origin refs/tags/full &&
 		git tag -f -m"Thirty-one days" full &&
 		test_must_fail git request-pull initial "$downstream_url" tags/full \
diff --git a/t/t5304-prune.sh b/t/t5304-prune.sh
index bd5f71e396..b447ce56a9 100755
--- a/t/t5304-prune.sh
+++ b/t/t5304-prune.sh
@@ -4,7 +4,7 @@
 #
 
 test_description='prune'
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -122,7 +122,7 @@ test_expect_success 'prune: do not prune detached HEAD with no reflog' '
 test_expect_success 'prune: prune former HEAD after checking out branch' '
 
 	head_oid=$(git rev-parse HEAD) &&
-	git checkout --quiet master &&
+	git checkout --quiet main &&
 	git prune -v >prune_actual &&
 	grep "$head_oid" prune_actual
 
diff --git a/t/t5305-include-tag.sh b/t/t5305-include-tag.sh
index 2e56887ed5..44bd9ef45f 100755
--- a/t/t5305-include-tag.sh
+++ b/t/t5305-include-tag.sh
@@ -1,7 +1,7 @@
 #!/bin/sh
 
 test_description='git pack-object --include-tag'
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -114,7 +114,7 @@ test_expect_success 'check unpacked result (have all objects)' '
 
 test_expect_success 'single-branch clone can transfer tag' '
 	rm -rf clone.git &&
-	git clone --no-local --single-branch -b master . clone.git &&
+	git clone --no-local --single-branch -b main . clone.git &&
 	git -C clone.git fsck
 '
 
diff --git a/t/t5312-prune-corruption.sh b/t/t5312-prune-corruption.sh
index c70b5db2a0..11423b3cb2 100755
--- a/t/t5312-prune-corruption.sh
+++ b/t/t5312-prune-corruption.sh
@@ -8,7 +8,7 @@ bail out or to proceed using it as a reachable tip, but it is _not_
 OK to proceed as if it did not exist. Otherwise we might silently
 delete objects that cannot be recovered.
 '
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -19,7 +19,7 @@ test_expect_success 'disable reflogs' '
 '
 
 test_expect_success 'create history reachable only from a bogus-named ref' '
-	test_tick && git commit --allow-empty -m master &&
+	test_tick && git commit --allow-empty -m main &&
 	base=$(git rev-parse HEAD) &&
 	test_tick && git commit --allow-empty -m bogus &&
 	bogus=$(git rev-parse HEAD) &&
@@ -54,7 +54,7 @@ test_expect_success 'clean up bogus ref' '
 '
 
 # We create two new objects here, "one" and "two". Our
-# master branch points to "two", which is deleted,
+# main branch points to "two", which is deleted,
 # corrupting the repository. But we'd like to make sure
 # that the otherwise unreachable "one" is not pruned
 # (since it is the user's best bet for recovering
@@ -84,7 +84,7 @@ test_expect_success 'pruning with a corrupted tip does not drop history' '
 test_expect_success 'pack-refs does not silently delete broken loose ref' '
 	git pack-refs --all --prune &&
 	echo $missing >expect &&
-	git rev-parse refs/heads/master >actual &&
+	git rev-parse refs/heads/main >actual &&
 	test_cmp expect actual
 '
 
@@ -92,25 +92,25 @@ test_expect_success 'pack-refs does not silently delete broken loose ref' '
 # actually pack it, as it is perfectly reasonable to
 # skip processing a broken ref
 test_expect_success 'create packed-refs file with broken ref' '
-	rm -f .git/refs/heads/master &&
+	rm -f .git/refs/heads/main &&
 	cat >.git/packed-refs <<-EOF &&
-	$missing refs/heads/master
+	$missing refs/heads/main
 	$recoverable refs/heads/other
 	EOF
 	echo $missing >expect &&
-	git rev-parse refs/heads/master >actual &&
+	git rev-parse refs/heads/main >actual &&
 	test_cmp expect actual
 '
 
 test_expect_success 'pack-refs does not silently delete broken packed ref' '
 	git pack-refs --all --prune &&
-	git rev-parse refs/heads/master >actual &&
+	git rev-parse refs/heads/main >actual &&
 	test_cmp expect actual
 '
 
 test_expect_success 'pack-refs does not drop broken refs during deletion' '
 	git update-ref -d refs/heads/other &&
-	git rev-parse refs/heads/master >actual &&
+	git rev-parse refs/heads/main >actual &&
 	test_cmp expect actual
 '
 
diff --git a/t/t5317-pack-objects-filter-objects.sh b/t/t5317-pack-objects-filter-objects.sh
index f19c521292..13ed3eb136 100755
--- a/t/t5317-pack-objects-filter-objects.sh
+++ b/t/t5317-pack-objects-filter-objects.sh
@@ -2,7 +2,7 @@
 
 test_description='git pack-objects using object filtering'
 
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -385,7 +385,7 @@ test_expect_success 'verify sparse:oid=oid-ish' '
 	awk -f print_2.awk ls_files_result |
 	sort >expected &&
 
-	git -C r4 pack-objects --revs --stdout --filter=sparse:oid=master:pattern >filter.pack <<-EOF &&
+	git -C r4 pack-objects --revs --stdout --filter=sparse:oid=main:pattern >filter.pack <<-EOF &&
 	HEAD
 	EOF
 	git -C r4 index-pack ../filter.pack &&
diff --git a/t/t5322-pack-objects-sparse.sh b/t/t5322-pack-objects-sparse.sh
index c92658d026..61cb907a90 100755
--- a/t/t5322-pack-objects-sparse.sh
+++ b/t/t5322-pack-objects-sparse.sh
@@ -1,7 +1,7 @@
 #!/bin/sh
 
 test_description='pack-objects object selection using sparse algorithm'
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -21,7 +21,7 @@ test_expect_success 'setup repo' '
 	git commit -m "Initialized trees" &&
 	for i in $(test_seq 1 3)
 	do
-		git checkout -b topic$i master &&
+		git checkout -b topic$i main &&
 		echo change-$i >f$i/f$i/data.txt &&
 		git commit -a -m "Changed f$i/f$i/data.txt"
 	done &&
diff --git a/t/t5323-pack-redundant.sh b/t/t5323-pack-redundant.sh
index 3903148926..89c8688647 100755
--- a/t/t5323-pack-redundant.sh
+++ b/t/t5323-pack-redundant.sh
@@ -6,7 +6,7 @@
 test_description='Test git pack-redundant
 
 In order to test git-pack-redundant, we will create a number of objects and
-packs in the repository `master.git`. The relationship between packs (P1-P8)
+packs in the repository `main.git`. The relationship between packs (P1-P8)
 and objects (T, A-R) is showed in the following chart. Objects of a pack will
 be marked with letter x, while objects of redundant packs will be marked with
 exclamation point, and redundant pack itself will be marked with asterisk.
@@ -25,7 +25,7 @@ exclamation point, and redundant pack itself will be marked with asterisk.
     ALL | x x x x x x x x x x x x x x x x x x x
 
 Another repository `shared.git` has unique objects (X-Z), while other objects
-(marked with letter s) are shared through alt-odb (of `master.git`). The
+(marked with letter s) are shared through alt-odb (of `main.git`). The
 relationship between packs and objects is as follows:
 
 	| T A B C D E F G H I J K L M N O P Q R   X Y Z
@@ -36,7 +36,7 @@ relationship between packs and objects is as follows:
 
 . ./test-lib.sh
 
-master_repo=master.git
+main_repo=main.git
 shared_repo=shared.git
 
 # Create commits in <repo> and assign each commit's oid to shell variables
@@ -69,7 +69,7 @@ create_commits_in () {
 		shift ||
 		return 1
 	done &&
-	git -C "$repo" update-ref refs/heads/master $oid
+	git -C "$repo" update-ref refs/heads/main $oid
 }
 
 # Create pack in <repo> and assign pack id to variable given in the 2nd argument
@@ -107,9 +107,9 @@ format_packfiles () {
 	sort
 }
 
-test_expect_success 'setup master repo' '
-	git init --bare "$master_repo" &&
-	create_commits_in "$master_repo" A B C D E F G H I J K L M N O P Q R
+test_expect_success 'setup main repo' '
+	git init --bare "$main_repo" &&
+	create_commits_in "$main_repo" A B C D E F G H I J K L M N O P Q R
 '
 
 #############################################################################
@@ -124,8 +124,8 @@ test_expect_success 'setup master repo' '
 #     ALL | x x x x x x x x x x x x x x         x
 #
 #############################################################################
-test_expect_success 'master: no redundant for pack 1, 2, 3' '
-	create_pack_in "$master_repo" P1 <<-EOF &&
+test_expect_success 'main: no redundant for pack 1, 2, 3' '
+	create_pack_in "$main_repo" P1 <<-EOF &&
 		$T
 		$A
 		$B
@@ -135,7 +135,7 @@ test_expect_success 'master: no redundant for pack 1, 2, 3' '
 		$F
 		$R
 		EOF
-	create_pack_in "$master_repo" P2 <<-EOF &&
+	create_pack_in "$main_repo" P2 <<-EOF &&
 		$B
 		$C
 		$D
@@ -144,7 +144,7 @@ test_expect_success 'master: no redundant for pack 1, 2, 3' '
 		$H
 		$I
 		EOF
-	create_pack_in "$master_repo" P3 <<-EOF &&
+	create_pack_in "$main_repo" P3 <<-EOF &&
 		$F
 		$I
 		$J
@@ -153,7 +153,7 @@ test_expect_success 'master: no redundant for pack 1, 2, 3' '
 		$M
 		EOF
 	(
-		cd "$master_repo" &&
+		cd "$main_repo" &&
 		git pack-redundant --all >out &&
 		test_must_be_empty out
 	)
@@ -173,22 +173,22 @@ test_expect_success 'master: no redundant for pack 1, 2, 3' '
 #     ALL | x x x x x x x x x x x x x x x x x   x
 #
 #############################################################################
-test_expect_success 'master: one of pack-2/pack-3 is redundant' '
-	create_pack_in "$master_repo" P4 <<-EOF &&
+test_expect_success 'main: one of pack-2/pack-3 is redundant' '
+	create_pack_in "$main_repo" P4 <<-EOF &&
 		$J
 		$K
 		$L
 		$M
 		$P
 		EOF
-	create_pack_in "$master_repo" P5 <<-EOF &&
+	create_pack_in "$main_repo" P5 <<-EOF &&
 		$G
 		$H
 		$N
 		$O
 		EOF
 	(
-		cd "$master_repo" &&
+		cd "$main_repo" &&
 		cat >expect <<-EOF &&
 			P3:$P3
 			EOF
@@ -214,18 +214,18 @@ test_expect_success 'master: one of pack-2/pack-3 is redundant' '
 #     ALL | x x x x x x x x x x x x x x x x x x x
 #
 #############################################################################
-test_expect_success 'master: pack 2, 4, and 6 are redundant' '
-	create_pack_in "$master_repo" P6 <<-EOF &&
+test_expect_success 'main: pack 2, 4, and 6 are redundant' '
+	create_pack_in "$main_repo" P6 <<-EOF &&
 		$N
 		$O
 		$Q
 		EOF
-	create_pack_in "$master_repo" P7 <<-EOF &&
+	create_pack_in "$main_repo" P7 <<-EOF &&
 		$P
 		$Q
 		EOF
 	(
-		cd "$master_repo" &&
+		cd "$main_repo" &&
 		cat >expect <<-EOF &&
 			P2:$P2
 			P4:$P4
@@ -254,12 +254,12 @@ test_expect_success 'master: pack 2, 4, and 6 are redundant' '
 #     ALL | x x x x x x x x x x x x x x x x x x x
 #
 #############################################################################
-test_expect_success 'master: pack-8 (subset of pack-1) is also redundant' '
-	create_pack_in "$master_repo" P8 <<-EOF &&
+test_expect_success 'main: pack-8 (subset of pack-1) is also redundant' '
+	create_pack_in "$main_repo" P8 <<-EOF &&
 		$A
 		EOF
 	(
-		cd "$master_repo" &&
+		cd "$main_repo" &&
 		cat >expect <<-EOF &&
 			P2:$P2
 			P4:$P4
@@ -272,18 +272,18 @@ test_expect_success 'master: pack-8 (subset of pack-1) is also redundant' '
 	)
 '
 
-test_expect_success 'master: clean loose objects' '
+test_expect_success 'main: clean loose objects' '
 	(
-		cd "$master_repo" &&
+		cd "$main_repo" &&
 		git prune-packed &&
 		find objects -type f | sed -e "/objects\/pack\//d" >out &&
 		test_must_be_empty out
 	)
 '
 
-test_expect_success 'master: remove redundant packs and pass fsck' '
+test_expect_success 'main: remove redundant packs and pass fsck' '
 	(
-		cd "$master_repo" &&
+		cd "$main_repo" &&
 		git pack-redundant --all | xargs rm &&
 		git fsck &&
 		git pack-redundant --all >out &&
@@ -292,12 +292,12 @@ test_expect_success 'master: remove redundant packs and pass fsck' '
 '
 
 # The following test cases will execute inside `shared.git`, instead of
-# inside `master.git`.
+# inside `main.git`.
 test_expect_success 'setup shared.git' '
-	git clone --mirror "$master_repo" "$shared_repo" &&
+	git clone --mirror "$main_repo" "$shared_repo" &&
 	(
 		cd "$shared_repo" &&
-		printf "../../$master_repo/objects\n" >objects/info/alternates
+		printf "../../$main_repo/objects\n" >objects/info/alternates
 	)
 '
 
@@ -312,7 +312,7 @@ test_expect_success 'shared: all packs are redundant, but no output without --al
 #############################################################################
 # Chart of packs and objects for this test case
 #
-#     ================= master.git ================
+#     ================= main.git ================
 #         | T A B C D E F G H I J K L M N O P Q R  <----------+
 #     ----+--------------------------------------             |
 #     P1  | x x x x x x x                       x             |
@@ -394,7 +394,7 @@ test_expect_success 'shared: no redundant without --alt-odb' '
 #############################################################################
 # Chart of packs and objects for this test case
 #
-#     ================= master.git ================
+#     ================= main.git ================
 #         | T A B C D E F G H I J K L M N O P Q R  <----------------+
 #     ----+--------------------------------------                   |
 #     P1  | x x x x x x x                       x                   |
@@ -426,7 +426,7 @@ test_expect_success 'shared: one pack is redundant with --alt-odb' '
 #############################################################################
 # Chart of packs and objects for this test case
 #
-#     ================= master.git ================
+#     ================= main.git ================
 #         | T A B C D E F G H I J K L M N O P Q R  <----------------+
 #     ----+--------------------------------------                   |
 #     P1  | x x x x x x x                       x                   |
diff --git a/t/t5400-send-pack.sh b/t/t5400-send-pack.sh
index 6be028f3e2..3f81f16e13 100755
--- a/t/t5400-send-pack.sh
+++ b/t/t5400-send-pack.sh
@@ -6,7 +6,7 @@
 test_description='See why rewinding head breaks send-pack
 
 '
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -69,20 +69,20 @@ test_expect_success 'pack the destination repository' '
 '
 
 test_expect_success 'refuse pushing rewound head without --force' '
-	pushed_head=$(git rev-parse --verify master) &&
-	victim_orig=$(cd victim && git rev-parse --verify master) &&
-	test_must_fail git send-pack ./victim master &&
-	victim_head=$(cd victim && git rev-parse --verify master) &&
+	pushed_head=$(git rev-parse --verify main) &&
+	victim_orig=$(cd victim && git rev-parse --verify main) &&
+	test_must_fail git send-pack ./victim main &&
+	victim_head=$(cd victim && git rev-parse --verify main) &&
 	test "$victim_head" = "$victim_orig" &&
 	# this should update
-	git send-pack --force ./victim master &&
-	victim_head=$(cd victim && git rev-parse --verify master) &&
+	git send-pack --force ./victim main &&
+	victim_head=$(cd victim && git rev-parse --verify main) &&
 	test "$victim_head" = "$pushed_head"
 '
 
 test_expect_success 'push can be used to delete a ref' '
-	( cd victim && git branch extra master ) &&
-	git send-pack ./victim :extra master &&
+	( cd victim && git branch extra main ) &&
+	git send-pack ./victim :extra main &&
 	( cd victim &&
 	  test_must_fail git rev-parse --verify extra )
 '
@@ -92,9 +92,9 @@ test_expect_success 'refuse deleting push with denyDeletes' '
 		cd victim &&
 		test_might_fail git branch -D extra &&
 		git config receive.denyDeletes true &&
-		git branch extra master
+		git branch extra main
 	) &&
-	test_must_fail git send-pack ./victim :extra master
+	test_must_fail git send-pack ./victim :extra main
 '
 
 test_expect_success 'cannot override denyDeletes with git -c send-pack' '
@@ -102,10 +102,10 @@ test_expect_success 'cannot override denyDeletes with git -c send-pack' '
 		cd victim &&
 		test_might_fail git branch -D extra &&
 		git config receive.denyDeletes true &&
-		git branch extra master
+		git branch extra main
 	) &&
 	test_must_fail git -c receive.denyDeletes=false \
-					send-pack ./victim :extra master
+					send-pack ./victim :extra main
 '
 
 test_expect_success 'override denyDeletes with git -c receive-pack' '
@@ -113,11 +113,11 @@ test_expect_success 'override denyDeletes with git -c receive-pack' '
 		cd victim &&
 		test_might_fail git branch -D extra &&
 		git config receive.denyDeletes true &&
-		git branch extra master
+		git branch extra main
 	) &&
 	git send-pack \
 		--receive-pack="git -c receive.denyDeletes=false receive-pack" \
-		./victim :extra master
+		./victim :extra main
 '
 
 test_expect_success 'denyNonFastforwards trumps --force' '
@@ -126,9 +126,9 @@ test_expect_success 'denyNonFastforwards trumps --force' '
 		test_might_fail git branch -D extra &&
 		git config receive.denyNonFastforwards true
 	) &&
-	victim_orig=$(cd victim && git rev-parse --verify master) &&
-	test_must_fail git send-pack --force ./victim master^:master &&
-	victim_head=$(cd victim && git rev-parse --verify master) &&
+	victim_orig=$(cd victim && git rev-parse --verify main) &&
+	test_must_fail git send-pack --force ./victim main^:main &&
+	victim_head=$(cd victim && git rev-parse --verify main) &&
 	test "$victim_orig" = "$victim_head"
 '
 
@@ -213,41 +213,41 @@ rewound_push_setup() {
 
 test_expect_success 'pushing explicit refspecs respects forcing' '
 	rewound_push_setup &&
-	parent_orig=$(cd parent && git rev-parse --verify master) &&
+	parent_orig=$(cd parent && git rev-parse --verify main) &&
 	(
 		cd child &&
 		test_must_fail git send-pack ../parent \
-			refs/heads/master:refs/heads/master
+			refs/heads/main:refs/heads/main
 	) &&
-	parent_head=$(cd parent && git rev-parse --verify master) &&
+	parent_head=$(cd parent && git rev-parse --verify main) &&
 	test "$parent_orig" = "$parent_head" &&
 	(
 		cd child &&
 		git send-pack ../parent \
-			+refs/heads/master:refs/heads/master
+			+refs/heads/main:refs/heads/main
 	) &&
-	parent_head=$(cd parent && git rev-parse --verify master) &&
-	child_head=$(cd child && git rev-parse --verify master) &&
+	parent_head=$(cd parent && git rev-parse --verify main) &&
+	child_head=$(cd child && git rev-parse --verify main) &&
 	test "$parent_head" = "$child_head"
 '
 
 test_expect_success 'pushing wildcard refspecs respects forcing' '
 	rewound_push_setup &&
-	parent_orig=$(cd parent && git rev-parse --verify master) &&
+	parent_orig=$(cd parent && git rev-parse --verify main) &&
 	(
 		cd child &&
 		test_must_fail git send-pack ../parent \
 			"refs/heads/*:refs/heads/*"
 	) &&
-	parent_head=$(cd parent && git rev-parse --verify master) &&
+	parent_head=$(cd parent && git rev-parse --verify main) &&
 	test "$parent_orig" = "$parent_head" &&
 	(
 		cd child &&
 		git send-pack ../parent \
 			"+refs/heads/*:refs/heads/*"
 	) &&
-	parent_head=$(cd parent && git rev-parse --verify master) &&
-	child_head=$(cd child && git rev-parse --verify master) &&
+	parent_head=$(cd parent && git rev-parse --verify main) &&
+	child_head=$(cd child && git rev-parse --verify main) &&
 	test "$parent_head" = "$child_head"
 '
 
@@ -255,7 +255,7 @@ test_expect_success 'deny pushing to delete current branch' '
 	rewound_push_setup &&
 	(
 		cd child &&
-		test_must_fail git send-pack ../parent :refs/heads/master 2>errs
+		test_must_fail git send-pack ../parent :refs/heads/main 2>errs
 	)
 '
 
@@ -286,9 +286,9 @@ test_expect_success 'receive-pack de-dupes .have lines' '
 	local=$(git -C fork rev-parse HEAD) &&
 	shared=$(git -C shared rev-parse only-shared) &&
 	cat >expect <<-EOF &&
-	$local refs/heads/master
+	$local refs/heads/main
 	$local refs/remotes/origin/HEAD
-	$local refs/remotes/origin/master
+	$local refs/remotes/origin/main
 	$shared .have
 	EOF
 
diff --git a/t/t5401-update-hooks.sh b/t/t5401-update-hooks.sh
index 956d69f5b1..6012cc8172 100755
--- a/t/t5401-update-hooks.sh
+++ b/t/t5401-update-hooks.sh
@@ -15,11 +15,11 @@ test_expect_success setup '
 	git update-index a &&
 	tree1=$(git write-tree) &&
 	commit1=$(echo modify | git commit-tree $tree1 -p $commit0) &&
-	git update-ref refs/heads/master $commit0 &&
+	git update-ref refs/heads/main $commit0 &&
 	git update-ref refs/heads/tofail $commit1 &&
 	git clone --bare ./. victim.git &&
 	GIT_DIR=victim.git git update-ref refs/heads/tofail $commit1 &&
-	git update-ref refs/heads/master $commit1 &&
+	git update-ref refs/heads/main $commit1 &&
 	git update-ref refs/heads/tofail $commit0
 '
 
@@ -38,7 +38,7 @@ echo "$@" >>$GIT_DIR/update.args
 read x; printf %s "$x" >$GIT_DIR/update.stdin
 echo STDOUT update $1
 echo STDERR update $1 >&2
-test "$1" = refs/heads/master || exit
+test "$1" = refs/heads/main || exit
 EOF
 chmod u+x victim.git/hooks/update
 
@@ -62,11 +62,11 @@ chmod u+x victim.git/hooks/post-update
 
 test_expect_success push '
 	test_must_fail git send-pack --force ./victim.git \
-		master tofail >send.out 2>send.err
+		main tofail >send.out 2>send.err
 '
 
 test_expect_success 'updated as expected' '
-	test $(GIT_DIR=victim.git git rev-parse master) = $commit1 &&
+	test $(GIT_DIR=victim.git git rev-parse main) = $commit1 &&
 	test $(GIT_DIR=victim.git git rev-parse tofail) = $commit1
 '
 
@@ -82,24 +82,24 @@ test_expect_success 'hooks ran' '
 '
 
 test_expect_success 'pre-receive hook input' '
-	(echo $commit0 $commit1 refs/heads/master &&
+	(echo $commit0 $commit1 refs/heads/main &&
 	 echo $commit1 $commit0 refs/heads/tofail
 	) | test_cmp - victim.git/pre-receive.stdin
 '
 
 test_expect_success 'update hook arguments' '
-	(echo refs/heads/master $commit0 $commit1 &&
+	(echo refs/heads/main $commit0 $commit1 &&
 	 echo refs/heads/tofail $commit1 $commit0
 	) | test_cmp - victim.git/update.args
 '
 
 test_expect_success 'post-receive hook input' '
-	echo $commit0 $commit1 refs/heads/master |
+	echo $commit0 $commit1 refs/heads/main |
 	test_cmp - victim.git/post-receive.stdin
 '
 
 test_expect_success 'post-update hook arguments' '
-	echo refs/heads/master |
+	echo refs/heads/main |
 	test_cmp - victim.git/post-update.args
 '
 
@@ -120,8 +120,8 @@ test_expect_success 'send-pack produced no output' '
 cat <<EOF >expect
 remote: STDOUT pre-receive
 remote: STDERR pre-receive
-remote: STDOUT update refs/heads/master
-remote: STDERR update refs/heads/master
+remote: STDOUT update refs/heads/main
+remote: STDERR update refs/heads/main
 remote: STDOUT update refs/heads/tofail
 remote: STDERR update refs/heads/tofail
 remote: error: hook declined to update refs/heads/tofail
@@ -143,7 +143,7 @@ test_expect_success 'pre-receive hook that forgets to read its input' '
 
 	for v in $(test_seq 100 999)
 	do
-		git branch branch_$v master || return
+		git branch branch_$v main || return
 	done &&
 	git push ./victim.git "+refs/heads/*:refs/heads/*"
 '
diff --git a/t/t5402-post-merge-hook.sh b/t/t5402-post-merge-hook.sh
index 27fc6ec4f3..3e5e19c719 100755
--- a/t/t5402-post-merge-hook.sh
+++ b/t/t5402-post-merge-hook.sh
@@ -4,7 +4,7 @@
 #
 
 test_description='Test the post-merge hook.'
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -18,7 +18,7 @@ test_expect_success setup '
 	git update-index a &&
 	tree1=$(git write-tree) &&
 	commit1=$(echo modify | git commit-tree $tree1 -p $commit0) &&
-	git update-ref refs/heads/master $commit0 &&
+	git update-ref refs/heads/main $commit0 &&
 	git clone ./. clone1 &&
 	GIT_DIR=clone1/.git git update-index --add a &&
 	git clone ./. clone2 &&
diff --git a/t/t5403-post-checkout-hook.sh b/t/t5403-post-checkout-hook.sh
index ed91aadd95..1ec9e23be7 100755
--- a/t/t5403-post-checkout-hook.sh
+++ b/t/t5403-post-checkout-hook.sh
@@ -4,7 +4,7 @@
 #
 
 test_description='Test the post-checkout hook.'
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -23,7 +23,7 @@ test_expect_success setup '
 
 test_expect_success 'post-checkout receives the right arguments with HEAD unchanged ' '
 	test_when_finished "rm -f .git/post-checkout.args" &&
-	git checkout master &&
+	git checkout main &&
 	read old new flag <.git/post-checkout.args &&
 	test $old = $new && test $flag = 1
 '
@@ -44,14 +44,14 @@ test_expect_success 'post-checkout receives the right args with HEAD changed ' '
 
 test_expect_success 'post-checkout receives the right args when not switching branches ' '
 	test_when_finished "rm -f .git/post-checkout.args" &&
-	git checkout master -- three.t &&
+	git checkout main -- three.t &&
 	read old new flag <.git/post-checkout.args &&
 	test $old = $new && test $flag = 0
 '
 
 test_expect_success 'post-checkout is triggered on rebase' '
 	test_when_finished "rm -f .git/post-checkout.args" &&
-	git checkout -b rebase-test master &&
+	git checkout -b rebase-test main &&
 	rm -f .git/post-checkout.args &&
 	git rebase rebase-on-me &&
 	read old new flag <.git/post-checkout.args &&
diff --git a/t/t5404-tracking-branches.sh b/t/t5404-tracking-branches.sh
index da37b22fc5..cc07889667 100755
--- a/t/t5404-tracking-branches.sh
+++ b/t/t5404-tracking-branches.sh
@@ -2,7 +2,7 @@
 
 test_description='tracking branch update checks for git push'
 
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -33,9 +33,9 @@ test_expect_success 'prepare pushable branches' '
 	git checkout -b b2 origin/b2 &&
 	echo aa-b2 >>file &&
 	git commit -a -m aa-b2 &&
-	git checkout master &&
-	echo aa-master >>file &&
-	git commit -a -m aa-master
+	git checkout main &&
+	echo aa-main >>file &&
+	git commit -a -m aa-main
 '
 
 test_expect_success 'mixed-success push returns error' '
@@ -43,7 +43,7 @@ test_expect_success 'mixed-success push returns error' '
 '
 
 test_expect_success 'check tracking branches updated correctly after push' '
-	test "$(git rev-parse origin/master)" = "$(git rev-parse master)"
+	test "$(git rev-parse origin/main)" = "$(git rev-parse main)"
 '
 
 test_expect_success 'check tracking branches not updated for failed refs' '
diff --git a/t/t5405-send-pack-rewind.sh b/t/t5405-send-pack-rewind.sh
index 1f5b33b562..11f03239a0 100755
--- a/t/t5405-send-pack-rewind.sh
+++ b/t/t5405-send-pack-rewind.sh
@@ -2,7 +2,7 @@
 
 test_description='forced push to replace commit we do not have'
 
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -16,7 +16,7 @@ test_expect_success setup '
 	mkdir another && (
 		cd another &&
 		git init &&
-		git fetch --update-head-ok .. master:master
+		git fetch --update-head-ok .. main:main
 	) &&
 
 	>file2 && git add file2 && test_tick &&
@@ -28,7 +28,7 @@ test_expect_success 'non forced push should die not segfault' '
 
 	(
 		cd another &&
-		test_must_fail git push .. master:master
+		test_must_fail git push .. main:main
 	)
 
 '
@@ -37,7 +37,7 @@ test_expect_success 'forced push should succeed' '
 
 	(
 		cd another &&
-		git push .. +master:master
+		git push .. +main:main
 	)
 
 '
diff --git a/t/t5407-post-rewrite-hook.sh b/t/t5407-post-rewrite-hook.sh
index 78bffa64d7..5bb23cc3a4 100755
--- a/t/t5407-post-rewrite-hook.sh
+++ b/t/t5407-post-rewrite-hook.sh
@@ -4,7 +4,7 @@
 #
 
 test_description='Test the post-rewrite hook.'
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -17,7 +17,7 @@ test_expect_success 'setup' '
 	git checkout A^0 &&
 	test_commit E bar E &&
 	test_commit F foo F &&
-	git checkout master
+	git checkout main
 '
 
 mkdir .git/hooks
diff --git a/t/t5410-receive-pack-alternates.sh b/t/t5410-receive-pack-alternates.sh
index 30a4e6bb1a..0b28e4e452 100755
--- a/t/t5410-receive-pack-alternates.sh
+++ b/t/t5410-receive-pack-alternates.sh
@@ -2,7 +2,7 @@
 
 test_description='git receive-pack with alternate ref filtering'
 
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -10,9 +10,9 @@ export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 test_expect_success 'setup' '
 	test_commit base &&
 	git clone -s --bare . fork &&
-	git checkout -b public/branch master &&
+	git checkout -b public/branch main &&
 	test_commit public &&
-	git checkout -b private/branch master &&
+	git checkout -b private/branch main &&
 	test_commit private
 '
 
-- 
gitgitgadget


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH v3 12/28] t5503: prepare aligned comment for replacing `master` with `main`
  2020-11-18 23:44   ` [PATCH v3 00/28] tests: use main as default branch name Johannes Schindelin via GitGitGadget
                       ` (10 preceding siblings ...)
  2020-11-18 23:44     ` [PATCH v3 11/28] t5[0-4]*: adjust the references to the default branch name "main" Johannes Schindelin via GitGitGadget
@ 2020-11-18 23:44     ` Johannes Schindelin via GitGitGadget
  2020-11-18 23:44     ` [PATCH v3 13/28] t550*: adjust the references to the default branch name "main" Johannes Schindelin via GitGitGadget
                       ` (16 subsequent siblings)
  28 siblings, 0 replies; 163+ messages in thread
From: Johannes Schindelin via GitGitGadget @ 2020-11-18 23:44 UTC (permalink / raw)
  To: git
  Cc: Felipe Contreras, Ævar Arnfjörð Bjarmason,
	Johannes Schindelin, Jeff King, Jonathan Nieder,
	Johannes Schindelin, Johannes Schindelin

From: Johannes Schindelin <johannes.schindelin@gmx.de>

In an upcoming commit, we will use `main` as the default branch name in
t5503 instead of `master`. This will require extra padding in ASCII-art
commit graphs, which we hereby add preemptively.

By doing this preemptively rather than after the commit applying the
search-and-replace, it is more obvious that we caught all aligned
comments that are affected by the latter commit.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
---
 t/t5503-tagfollow.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/t/t5503-tagfollow.sh b/t/t5503-tagfollow.sh
index cd1f407174..525dd21ecb 100755
--- a/t/t5503-tagfollow.sh
+++ b/t/t5503-tagfollow.sh
@@ -14,7 +14,7 @@ export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 #   L - A ------ O ------ B
 #    \   \                 \
 #     \   C - origin/cat    \
-#      origin/master         master
+#      origin/master           master
 
 test_expect_success setup '
 	test_tick &&
-- 
gitgitgadget


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH v3 13/28] t550*: adjust the references to the default branch name "main"
  2020-11-18 23:44   ` [PATCH v3 00/28] tests: use main as default branch name Johannes Schindelin via GitGitGadget
                       ` (11 preceding siblings ...)
  2020-11-18 23:44     ` [PATCH v3 12/28] t5503: prepare aligned comment for replacing `master` with `main` Johannes Schindelin via GitGitGadget
@ 2020-11-18 23:44     ` Johannes Schindelin via GitGitGadget
  2020-11-18 23:44     ` [PATCH v3 14/28] t551*: " Johannes Schindelin via GitGitGadget
                       ` (15 subsequent siblings)
  28 siblings, 0 replies; 163+ messages in thread
From: Johannes Schindelin via GitGitGadget @ 2020-11-18 23:44 UTC (permalink / raw)
  To: git
  Cc: Felipe Contreras, Ævar Arnfjörð Bjarmason,
	Johannes Schindelin, Jeff King, Jonathan Nieder,
	Johannes Schindelin, Johannes Schindelin

From: Johannes Schindelin <johannes.schindelin@gmx.de>

This trick was performed via

	$ (cd t &&
	   sed -i -e 's/master/main/g' -e 's/MASTER/MAIN/g' \
		-e 's/Master/Main/g' -- t550*.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>
---
 t/t5500-fetch-pack.sh            |  30 +++----
 t/t5501-fetch-push-alternates.sh |   6 +-
 t/t5502-quickfetch.sh            |   8 +-
 t/t5503-tagfollow.sh             |  14 +--
 t/t5504-fetch-receive-strict.sh  |  22 ++---
 t/t5505-remote.sh                | 142 +++++++++++++++----------------
 t/t5506-remote-groups.sh         |   6 +-
 t/t5509-fetch-push-namespaces.sh |  32 +++----
 8 files changed, 130 insertions(+), 130 deletions(-)

diff --git a/t/t5500-fetch-pack.sh b/t/t5500-fetch-pack.sh
index 4edb8c196e..1f4cc873a8 100755
--- a/t/t5500-fetch-pack.sh
+++ b/t/t5500-fetch-pack.sh
@@ -5,7 +5,7 @@
 
 test_description='Testing multi_ack pack fetching'
 
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -410,14 +410,14 @@ test_expect_success 'in_vain resetted upon ACK' '
 	rm -rf myserver myclient &&
 	git init myserver &&
 
-	# Linked list of commits on master. The first is common; the rest are
+	# Linked list of commits on main. The first is common; the rest are
 	# not.
-	test_commit -C myserver first_master_commit &&
+	test_commit -C myserver first_main_commit &&
 	git clone "file://$(pwd)/myserver" myclient &&
 	test_commit_bulk -C myclient 255 &&
 
 	# Another linked list of commits on anotherbranch with no connection to
-	# master. The first is common; the rest are not.
+	# main. The first is common; the rest are not.
 	git -C myserver checkout --orphan anotherbranch &&
 	test_commit -C myserver first_anotherbranch_commit &&
 	git -C myclient fetch origin anotherbranch:refs/heads/anotherbranch &&
@@ -425,14 +425,14 @@ test_expect_success 'in_vain resetted upon ACK' '
 	test_commit_bulk -C myclient 255 &&
 
 	# The new commit that the client wants to fetch.
-	git -C myserver checkout master &&
+	git -C myserver checkout main &&
 	test_commit -C myserver to_fetch &&
 
 	# The client will send (as "have"s) all 256 commits in anotherbranch
 	# first. The 256th commit is common between the client and the server,
 	# and should reset in_vain. This allows negotiation to continue until
 	# the client reports that first_anotherbranch_commit is common.
-	git -C myclient fetch --progress origin master 2>log &&
+	git -C myclient fetch --progress origin main 2>log &&
 	test_i18ngrep "Total 3 " log
 '
 
@@ -640,7 +640,7 @@ test_expect_success 'shallow fetch with tags does not break the repository' '
 		mkdir repo2 &&
 		cd repo2 &&
 		git init &&
-		git fetch --depth=2 ../.git master:branch &&
+		git fetch --depth=2 ../.git main:branch &&
 		git fsck
 	)
 '
@@ -665,7 +665,7 @@ test_expect_success 'fetch-pack can fetch a raw sha1 that is advertised as a ref
 
 	git init client &&
 	git -C client fetch-pack ../server \
-		$(git -C server rev-parse refs/heads/master)
+		$(git -C server rev-parse refs/heads/main)
 '
 
 test_expect_success 'fetch-pack can fetch a raw sha1 overlapping a named ref' '
@@ -691,7 +691,7 @@ test_expect_success 'fetch-pack cannot fetch a raw sha1 that is not advertised a
 	# Some protocol versions (e.g. 2) support fetching
 	# unadvertised objects, so restrict this test to v0.
 	test_must_fail env GIT_TEST_PROTOCOL_VERSION=0 git -C client fetch-pack ../server \
-		$(git -C server rev-parse refs/heads/master^) 2>err &&
+		$(git -C server rev-parse refs/heads/main^) 2>err &&
 	test_i18ngrep "Server does not allow request for unadvertised object" err
 '
 
@@ -825,7 +825,7 @@ test_expect_success 'clone shallow since ...' '
 
 test_expect_success 'fetch shallow since ...' '
 	git -C shallow11 fetch --shallow-since "200000000 +0700" origin &&
-	git -C shallow11 log --pretty=tformat:%s origin/master >actual &&
+	git -C shallow11 log --pretty=tformat:%s origin/main >actual &&
 	cat >expected <<-\EOF &&
 	three
 	two
@@ -866,7 +866,7 @@ test_expect_success 'shallow since with commit graph and already-seen commit' '
 	(
 	cd shallow-since-graph &&
 	test_commit base &&
-	test_commit master &&
+	test_commit main &&
 	git checkout -b other HEAD^ &&
 	test_commit other &&
 	git commit-graph write --reachable &&
@@ -877,7 +877,7 @@ test_expect_success 'shallow since with commit graph and already-seen commit' '
 	$(echo "object-format=$(test_oid algo)" | packetize)
 	00010013deepen-since 1
 	$(echo "want $(git rev-parse other)" | packetize)
-	$(echo "have $(git rev-parse master)" | packetize)
+	$(echo "have $(git rev-parse main)" | packetize)
 	0000
 	EOF
 	)
@@ -899,7 +899,7 @@ test_expect_success 'shallow clone exclude tag two' '
 
 test_expect_success 'fetch exclude tag one' '
 	git -C shallow12 fetch --shallow-exclude one origin &&
-	git -C shallow12 log --pretty=tformat:%s origin/master >actual &&
+	git -C shallow12 log --pretty=tformat:%s origin/main >actual &&
 	test_write_lines three two >expected &&
 	test_cmp expected actual
 '
@@ -913,11 +913,11 @@ test_expect_success 'fetching deepen' '
 	test_commit three &&
 	git clone --depth 1 "file://$(pwd)/." deepen &&
 	test_commit four &&
-	git -C deepen log --pretty=tformat:%s master >actual &&
+	git -C deepen log --pretty=tformat:%s main >actual &&
 	echo three >expected &&
 	test_cmp expected actual &&
 	git -C deepen fetch --deepen=1 &&
-	git -C deepen log --pretty=tformat:%s origin/master >actual &&
+	git -C deepen log --pretty=tformat:%s origin/main >actual &&
 	cat >expected <<-\EOF &&
 	four
 	three
diff --git a/t/t5501-fetch-push-alternates.sh b/t/t5501-fetch-push-alternates.sh
index 96ce28b6ba..66f19a4ef2 100755
--- a/t/t5501-fetch-push-alternates.sh
+++ b/t/t5501-fetch-push-alternates.sh
@@ -1,7 +1,7 @@
 #!/bin/sh
 
 test_description='fetch/push involving alternates'
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -48,7 +48,7 @@ test_expect_success setup '
 test_expect_success 'pushing into a repository with the same alternate' '
 	(
 		cd one &&
-		git push ../receiver master:refs/heads/it
+		git push ../receiver main:refs/heads/it
 	) &&
 	(
 		cd receiver &&
@@ -60,7 +60,7 @@ test_expect_success 'pushing into a repository with the same alternate' '
 test_expect_success 'fetching from a repository with the same alternate' '
 	(
 		cd fetcher &&
-		git fetch ../one master:refs/heads/it &&
+		git fetch ../one main:refs/heads/it &&
 		count_objects >../fetcher.count
 	) &&
 	test_cmp one.count fetcher.count
diff --git a/t/t5502-quickfetch.sh b/t/t5502-quickfetch.sh
index e15a472e4c..8c05c7715b 100755
--- a/t/t5502-quickfetch.sh
+++ b/t/t5502-quickfetch.sh
@@ -2,7 +2,7 @@
 
 test_description='test quickfetch from local'
 
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -111,14 +111,14 @@ test_expect_success 'quickfetch should not copy from alternate' '
 				q
 			}"
 	) ) &&
-	origin_master=$( (
+	origin_main=$( (
 		cd quickclone &&
-		git rev-parse origin/master
+		git rev-parse origin/main
 	) ) &&
 	echo "loose objects: $obj_cnt, packfiles: $pck_cnt" &&
 	test $obj_cnt -eq 0 &&
 	test $pck_cnt -eq 0 &&
-	test z$origin_master = z$(git rev-parse master)
+	test z$origin_main = z$(git rev-parse main)
 
 '
 
diff --git a/t/t5503-tagfollow.sh b/t/t5503-tagfollow.sh
index 525dd21ecb..195fc64dd4 100755
--- a/t/t5503-tagfollow.sh
+++ b/t/t5503-tagfollow.sh
@@ -2,7 +2,7 @@
 
 test_description='test automatic tag following'
 
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -14,7 +14,7 @@ export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 #   L - A ------ O ------ B
 #    \   \                 \
 #     \   C - origin/cat    \
-#      origin/master           master
+#      origin/main           main
 
 test_expect_success setup '
 	test_tick &&
@@ -60,7 +60,7 @@ test_expect_success 'fetch A (new commit : 1 connection)' '
 	(
 		cd cloned &&
 		GIT_TRACE_PACKET=$UPATH git fetch &&
-		test $A = $(git rev-parse --verify origin/master)
+		test $A = $(git rev-parse --verify origin/main)
 	) &&
 	get_needs $U >actual &&
 	test_cmp expect actual
@@ -75,7 +75,7 @@ test_expect_success "create tag T on A, create C on branch cat" '
 	git add file &&
 	git commit -m C &&
 	C=$(git rev-parse --verify HEAD) &&
-	git checkout master
+	git checkout main
 '
 
 test_expect_success 'setup expect' '
@@ -126,7 +126,7 @@ test_expect_success 'fetch B, S (commit and tag : 1 connection)' '
 	(
 		cd cloned &&
 		GIT_TRACE_PACKET=$UPATH git fetch &&
-		test $B = $(git rev-parse --verify origin/master) &&
+		test $B = $(git rev-parse --verify origin/main) &&
 		test $B = $(git rev-parse --verify tag2^0) &&
 		test $S = $(git rev-parse --verify tag2)
 	) &&
@@ -141,7 +141,7 @@ want $S
 EOF
 '
 
-test_expect_success 'new clone fetch master and tags' '
+test_expect_success 'new clone fetch main and tags' '
 	test_might_fail git branch -D cat &&
 	rm -f $U &&
 	(
@@ -150,7 +150,7 @@ test_expect_success 'new clone fetch master and tags' '
 		git init &&
 		git remote add origin .. &&
 		GIT_TRACE_PACKET=$UPATH git fetch &&
-		test $B = $(git rev-parse --verify origin/master) &&
+		test $B = $(git rev-parse --verify origin/main) &&
 		test $S = $(git rev-parse --verify tag2) &&
 		test $B = $(git rev-parse --verify tag2^0) &&
 		test $T = $(git rev-parse --verify tag1) &&
diff --git a/t/t5504-fetch-receive-strict.sh b/t/t5504-fetch-receive-strict.sh
index 7fe21b176d..6e5a9c20e7 100755
--- a/t/t5504-fetch-receive-strict.sh
+++ b/t/t5504-fetch-receive-strict.sh
@@ -1,7 +1,7 @@
 #!/bin/sh
 
 test_description='fetch/receive strict mode'
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -28,7 +28,7 @@ test_expect_success 'fetch without strict' '
 		cd dst &&
 		git config fetch.fsckobjects false &&
 		git config transfer.fsckobjects false &&
-		test_must_fail git fetch ../.git master
+		test_must_fail git fetch ../.git main
 	)
 '
 
@@ -39,7 +39,7 @@ test_expect_success 'fetch with !fetch.fsckobjects' '
 		cd dst &&
 		git config fetch.fsckobjects false &&
 		git config transfer.fsckobjects true &&
-		test_must_fail git fetch ../.git master
+		test_must_fail git fetch ../.git main
 	)
 '
 
@@ -50,7 +50,7 @@ test_expect_success 'fetch with fetch.fsckobjects' '
 		cd dst &&
 		git config fetch.fsckobjects true &&
 		git config transfer.fsckobjects false &&
-		test_must_fail git fetch ../.git master
+		test_must_fail git fetch ../.git main
 	)
 '
 
@@ -60,13 +60,13 @@ test_expect_success 'fetch with transfer.fsckobjects' '
 	(
 		cd dst &&
 		git config transfer.fsckobjects true &&
-		test_must_fail git fetch ../.git master
+		test_must_fail git fetch ../.git main
 	)
 '
 
 cat >exp <<EOF
 To dst
-!	refs/heads/master:refs/heads/test	[remote rejected] (missing necessary objects)
+!	refs/heads/main:refs/heads/test	[remote rejected] (missing necessary objects)
 Done
 EOF
 
@@ -78,7 +78,7 @@ test_expect_success 'push without strict' '
 		git config fetch.fsckobjects false &&
 		git config transfer.fsckobjects false
 	) &&
-	test_must_fail git push --porcelain dst master:refs/heads/test >act &&
+	test_must_fail git push --porcelain dst main:refs/heads/test >act &&
 	test_cmp exp act
 '
 
@@ -90,13 +90,13 @@ test_expect_success 'push with !receive.fsckobjects' '
 		git config receive.fsckobjects false &&
 		git config transfer.fsckobjects true
 	) &&
-	test_must_fail git push --porcelain dst master:refs/heads/test >act &&
+	test_must_fail git push --porcelain dst main:refs/heads/test >act &&
 	test_cmp exp act
 '
 
 cat >exp <<EOF
 To dst
-!	refs/heads/master:refs/heads/test	[remote rejected] (unpacker error)
+!	refs/heads/main:refs/heads/test	[remote rejected] (unpacker error)
 EOF
 
 test_expect_success 'push with receive.fsckobjects' '
@@ -107,7 +107,7 @@ test_expect_success 'push with receive.fsckobjects' '
 		git config receive.fsckobjects true &&
 		git config transfer.fsckobjects false
 	) &&
-	test_must_fail git push --porcelain dst master:refs/heads/test >act &&
+	test_must_fail git push --porcelain dst main:refs/heads/test >act &&
 	test_cmp exp act
 '
 
@@ -118,7 +118,7 @@ test_expect_success 'push with transfer.fsckobjects' '
 		cd dst &&
 		git config transfer.fsckobjects true
 	) &&
-	test_must_fail git push --porcelain dst master:refs/heads/test >act &&
+	test_must_fail git push --porcelain dst main:refs/heads/test >act &&
 	test_cmp exp act
 '
 
diff --git a/t/t5505-remote.sh b/t/t5505-remote.sh
index 2b6e1f50f8..f7e3c9b1e7 100755
--- a/t/t5505-remote.sh
+++ b/t/t5505-remote.sh
@@ -2,7 +2,7 @@
 
 test_description='git remote porcelain-ish'
 
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -20,7 +20,7 @@ setup_repository () {
 	git add elif &&
 	test_tick &&
 	git commit -m "Second" &&
-	git checkout master
+	git checkout main
 	)
 }
 
@@ -63,8 +63,8 @@ test_expect_success C_LOCALE_OUTPUT 'remote information for the origin' '
 	(
 		cd test &&
 		tokens_match origin "$(git remote)" &&
-		check_remote_track origin master side &&
-		check_tracking_branch origin HEAD master side
+		check_remote_track origin main side &&
+		check_tracking_branch origin HEAD main side
 	)
 '
 
@@ -73,7 +73,7 @@ test_expect_success 'add another remote' '
 		cd test &&
 		git remote add -f second ../two &&
 		tokens_match "origin second" "$(git remote)" &&
-		check_tracking_branch second master side another &&
+		check_tracking_branch second main side another &&
 		git for-each-ref "--format=%(refname)" refs/remotes |
 		sed -e "/^refs\/remotes\/origin\//d" \
 		    -e "/^refs\/remotes\/second\//d" >actual &&
@@ -84,8 +84,8 @@ test_expect_success 'add another remote' '
 test_expect_success C_LOCALE_OUTPUT 'check remote-tracking' '
 	(
 		cd test &&
-		check_remote_track origin master side &&
-		check_remote_track second master side another
+		check_remote_track origin main side &&
+		check_remote_track second main side another
 	)
 '
 
@@ -102,7 +102,7 @@ test_expect_success 'remote forces tracking branches' '
 test_expect_success 'remove remote' '
 	(
 		cd test &&
-		git symbolic-ref refs/remotes/second/HEAD refs/remotes/second/master &&
+		git symbolic-ref refs/remotes/second/HEAD refs/remotes/second/main &&
 		git remote rm second
 	)
 '
@@ -111,7 +111,7 @@ test_expect_success C_LOCALE_OUTPUT 'remove remote' '
 	(
 		cd test &&
 		tokens_match origin "$(git remote)" &&
-		check_remote_track origin master side &&
+		check_remote_track origin main side &&
 		git for-each-ref "--format=%(refname)" refs/remotes |
 		sed -e "/^refs\/remotes\/origin\//d" >actual &&
 		test_must_be_empty actual
@@ -124,13 +124,13 @@ test_expect_success 'remove remote protects local branches' '
 		cat >expect1 <<-\EOF &&
 		Note: A branch outside the refs/remotes/ hierarchy was not removed;
 		to delete it, use:
-		  git branch -d master
+		  git branch -d main
 		EOF
 		cat >expect2 <<-\EOF &&
 		Note: Some branches outside the refs/remotes/ hierarchy were not removed;
 		to delete them, use:
 		  git branch -d foobranch
-		  git branch -d master
+		  git branch -d main
 		EOF
 		git tag footag &&
 		git config --add remote.oops.fetch "+refs/*:refs/*" &&
@@ -156,7 +156,7 @@ test_expect_success 'remove errors out early when deleting non-existent branch'
 
 test_expect_success 'remove remote with a branch without configured merge' '
 	test_when_finished "(
-		git -C test checkout master;
+		git -C test checkout main;
 		git -C test branch -D two;
 		git -C test config --remove-section remote.two;
 		git -C test config --remove-section branch.second;
@@ -166,9 +166,9 @@ test_expect_success 'remove remote with a branch without configured merge' '
 		cd test &&
 		git remote add two ../two &&
 		git fetch two &&
-		git checkout -b second two/master^0 &&
+		git checkout -b second two/main^0 &&
 		git config branch.second.remote two &&
-		git checkout master &&
+		git checkout main &&
 		git remote rm two
 	)
 '
@@ -214,7 +214,7 @@ cat >test/expect <<EOF
 * remote origin
   Fetch URL: $(pwd)/one
   Push  URL: $(pwd)/one
-  HEAD branch: master
+  HEAD branch: main
   Remote branches:
     main new (next fetch will store in remotes/origin)
     side tracked
@@ -224,14 +224,14 @@ cat >test/expect <<EOF
     octopus  merges with remote topic-a
                 and with remote topic-b
                 and with remote topic-c
-    rebase  rebases onto remote master
+    rebase  rebases onto remote main
   Local refs configured for 'git push':
     main pushes to main     (local out of date)
     main pushes to upstream (create)
 * remote two
   Fetch URL: ../two
   Push  URL: ../three
-  HEAD branch: master
+  HEAD branch: main
   Local refs configured for 'git push':
     ahead forces to main    (fast-forwardable)
     main  pushes to another (up to date)
@@ -240,16 +240,16 @@ EOF
 test_expect_success PREPARE_FOR_MAIN_BRANCH 'show' '
 	(
 		cd test &&
-		git config --add remote.origin.fetch refs/heads/master:refs/heads/upstream &&
+		git config --add remote.origin.fetch refs/heads/main:refs/heads/upstream &&
 		git fetch &&
-		git checkout -b ahead origin/master &&
+		git checkout -b ahead origin/main &&
 		echo 1 >>file &&
 		test_tick &&
 		git commit -m update file &&
-		git checkout master &&
-		git branch --track octopus origin/master &&
-		git branch --track rebase origin/master &&
-		git branch -d -r origin/master &&
+		git checkout main &&
+		git branch --track octopus origin/main &&
+		git branch --track rebase origin/main &&
+		git branch -d -r origin/main &&
 		git config --add remote.two.url ../two &&
 		git config --add remote.two.pushurl ../three &&
 		git config branch.rebase.rebase true &&
@@ -261,10 +261,10 @@ test_expect_success PREPARE_FOR_MAIN_BRANCH 'show' '
 			git commit -m update file
 		) &&
 		git config --add remote.origin.push : &&
-		git config --add remote.origin.push refs/heads/master:refs/heads/upstream &&
+		git config --add remote.origin.push refs/heads/main:refs/heads/upstream &&
 		git config --add remote.origin.push +refs/tags/lastbackup &&
-		git config --add remote.two.push +refs/heads/ahead:refs/heads/master &&
-		git config --add remote.two.push refs/heads/master:refs/heads/another &&
+		git config --add remote.two.push +refs/heads/ahead:refs/heads/main &&
+		git config --add remote.two.push refs/heads/main:refs/heads/another &&
 		git remote show origin two >output &&
 		git branch -d rebase octopus &&
 		test_i18ncmp expect output
@@ -277,7 +277,7 @@ cat >test/expect <<EOF
   Push  URL: $(pwd)/one
   HEAD branch: (not queried)
   Remote branches: (status not queried)
-    master
+    main
     side
   Local branches configured for 'git pull':
     ahead merges with remote main
@@ -325,7 +325,7 @@ test_expect_success 'set-head --auto' '
 	(
 		cd test &&
 		git remote set-head --auto origin &&
-		echo refs/remotes/origin/master >expect &&
+		echo refs/remotes/origin/main >expect &&
 		git symbolic-ref refs/remotes/origin/HEAD >output &&
 		test_cmp expect output
 	)
@@ -336,7 +336,7 @@ test_expect_success PREPARE_FOR_MAIN_BRANCH 'set-head --auto has no problem w/mu
 		cd test &&
 		git fetch two "refs/heads/*:refs/remotes/two/*" &&
 		git remote set-head --auto two >output 2>&1 &&
-		echo "two/HEAD set to master" >expect &&
+		echo "two/HEAD set to main" >expect &&
 		test_i18ncmp expect output
 	)
 '
@@ -350,7 +350,7 @@ test_expect_success 'set-head explicit' '
 		cd test &&
 		git remote set-head origin side2 &&
 		git symbolic-ref refs/remotes/origin/HEAD >output &&
-		git remote set-head origin master &&
+		git remote set-head origin main &&
 		test_cmp expect output
 	)
 '
@@ -413,7 +413,7 @@ test_expect_success 'fetch mirrors act as mirrors during fetch' '
 	(
 		cd mirror-fetch/parent &&
 		git branch new &&
-		git branch -m master renamed
+		git branch -m main renamed
 	) &&
 	(
 		cd mirror-fetch/child &&
@@ -427,7 +427,7 @@ test_expect_success 'fetch mirrors can prune' '
 	(
 		cd mirror-fetch/child &&
 		git remote prune parent &&
-		test_must_fail git rev-parse --verify refs/heads/master
+		test_must_fail git rev-parse --verify refs/heads/main
 	)
 '
 
@@ -480,14 +480,14 @@ test_expect_success 'push mirrors act as mirrors during push' '
 	(
 		cd mirror-push/private &&
 		git branch new &&
-		git branch -m master renamed &&
+		git branch -m main renamed &&
 		git push public
 	) &&
 	(
 		cd mirror-push/private &&
 		git rev-parse --verify refs/heads/new &&
 		git rev-parse --verify refs/heads/renamed &&
-		test_must_fail git rev-parse --verify refs/heads/master
+		test_must_fail git rev-parse --verify refs/heads/main
 	)
 '
 
@@ -613,10 +613,10 @@ test_expect_success 'reject --no-no-tags' '
 '
 
 cat >one/expect <<\EOF
-  apis/master
+  apis/main
   apis/side
   drosophila/another
-  drosophila/master
+  drosophila/main
   drosophila/side
 EOF
 
@@ -633,11 +633,11 @@ test_expect_success 'update' '
 
 cat >one/expect <<\EOF
   drosophila/another
-  drosophila/master
+  drosophila/main
   drosophila/side
-  manduca/master
+  manduca/main
   manduca/side
-  megaloprepus/master
+  megaloprepus/main
   megaloprepus/side
 EOF
 
@@ -676,11 +676,11 @@ test_expect_success 'update --prune' '
 '
 
 cat >one/expect <<-\EOF
-  apis/master
+  apis/main
   apis/side
-  manduca/master
+  manduca/main
   manduca/side
-  megaloprepus/master
+  megaloprepus/main
   megaloprepus/side
 EOF
 
@@ -700,7 +700,7 @@ test_expect_success 'update default' '
 
 cat >one/expect <<\EOF
   drosophila/another
-  drosophila/master
+  drosophila/main
   drosophila/side
 EOF
 
@@ -754,14 +754,14 @@ test_expect_success 'rename a remote' '
 	git clone one four &&
 	(
 		cd four &&
-		git config branch.master.pushRemote origin &&
+		git config branch.main.pushRemote origin &&
 		git remote rename origin upstream &&
 		test -z "$(git for-each-ref refs/remotes/origin)" &&
-		test "$(git symbolic-ref refs/remotes/upstream/HEAD)" = "refs/remotes/upstream/master" &&
-		test "$(git rev-parse upstream/master)" = "$(git rev-parse master)" &&
+		test "$(git symbolic-ref refs/remotes/upstream/HEAD)" = "refs/remotes/upstream/main" &&
+		test "$(git rev-parse upstream/main)" = "$(git rev-parse main)" &&
 		test "$(git config remote.upstream.fetch)" = "+refs/heads/*:refs/remotes/upstream/*" &&
-		test "$(git config branch.master.remote)" = "upstream" &&
-		test "$(git config branch.master.pushRemote)" = "upstream" &&
+		test "$(git config branch.main.remote)" = "upstream" &&
+		test "$(git config branch.main.pushRemote)" = "upstream" &&
 		test "$(git config --global remote.pushDefault)" = "origin"
 	)
 '
@@ -807,7 +807,7 @@ test_expect_success 'rename does not update a non-default fetch refspec' '
 		git config remote.origin.fetch +refs/heads/*:refs/heads/origin/* &&
 		git remote rename origin upstream &&
 		test "$(git config remote.upstream.fetch)" = "+refs/heads/*:refs/heads/origin/*" &&
-		git rev-parse -q origin/master
+		git rev-parse -q origin/main
 	)
 '
 
@@ -827,7 +827,7 @@ test_expect_success 'rename a remote with name prefix of other remote' '
 		cd four.three &&
 		git remote add o git://example.com/repo.git &&
 		git remote rename o upstream &&
-		test "$(git rev-parse origin/master)" = "$(git rev-parse master)"
+		test "$(git rev-parse origin/main)" = "$(git rev-parse main)"
 	)
 '
 
@@ -843,11 +843,11 @@ test_expect_success 'remove a remote' '
 	git clone one four.five &&
 	(
 		cd four.five &&
-		git config branch.master.pushRemote origin &&
+		git config branch.main.pushRemote origin &&
 		git remote remove origin &&
 		test -z "$(git for-each-ref refs/remotes/origin)" &&
-		test_must_fail git config branch.master.remote &&
-		test_must_fail git config branch.master.pushRemote &&
+		test_must_fail git config branch.main.remote &&
+		test_must_fail git config branch.main.pushRemote &&
 		test "$(git config --global remote.pushDefault)" = "origin"
 	)
 '
@@ -888,9 +888,9 @@ test_expect_success 'remove a remote removes repo remote.pushDefault but keeps g
 
 cat >remotes_origin <<EOF
 URL: $(pwd)/one
-Push: refs/heads/master:refs/heads/upstream
+Push: refs/heads/main:refs/heads/upstream
 Push: refs/heads/next:refs/heads/upstream2
-Pull: refs/heads/master:refs/heads/origin
+Pull: refs/heads/main:refs/heads/origin
 Pull: refs/heads/next:refs/heads/origin2
 EOF
 
@@ -906,11 +906,11 @@ test_expect_success 'migrate a remote from named file in $GIT_DIR/remotes' '
 		test_path_is_missing .git/remotes/origin &&
 		test "$(git config remote.origin.url)" = "$origin_url" &&
 		cat >push_expected <<-\EOF &&
-		refs/heads/master:refs/heads/upstream
+		refs/heads/main:refs/heads/upstream
 		refs/heads/next:refs/heads/upstream2
 		EOF
 		cat >fetch_expected <<-\EOF &&
-		refs/heads/master:refs/heads/origin
+		refs/heads/main:refs/heads/origin
 		refs/heads/next:refs/heads/origin2
 		EOF
 		git config --get-all remote.origin.push >push_actual &&
@@ -930,8 +930,8 @@ test_expect_success 'migrate a remote from named file in $GIT_DIR/branches' '
 		git remote rename origin origin &&
 		test_path_is_missing .git/branches/origin &&
 		test "$(git config remote.origin.url)" = "$origin_url" &&
-		test "$(git config remote.origin.fetch)" = "refs/heads/master:refs/heads/origin" &&
-		test "$(git config remote.origin.push)" = "HEAD:refs/heads/master"
+		test "$(git config remote.origin.fetch)" = "refs/heads/main:refs/heads/origin" &&
+		test "$(git config remote.origin.push)" = "HEAD:refs/heads/main"
 	)
 '
 
@@ -954,7 +954,7 @@ test_expect_success 'remote prune to cause a dangling symref' '
 	(
 		cd one &&
 		git checkout side2 &&
-		git branch -D master
+		git branch -D main
 	) &&
 	(
 		cd eight &&
@@ -997,22 +997,22 @@ test_expect_success 'remote set-branches' '
 	EOF
 	sort <<-\EOF >expect.replace &&
 	+refs/heads/maint:refs/remotes/scratch/maint
-	+refs/heads/master:refs/remotes/scratch/master
+	+refs/heads/main:refs/remotes/scratch/main
 	+refs/heads/next:refs/remotes/scratch/next
 	EOF
 	sort <<-\EOF >expect.add-two &&
 	+refs/heads/maint:refs/remotes/scratch/maint
-	+refs/heads/master:refs/remotes/scratch/master
+	+refs/heads/main:refs/remotes/scratch/main
 	+refs/heads/next:refs/remotes/scratch/next
 	+refs/heads/seen:refs/remotes/scratch/seen
 	+refs/heads/t/topic:refs/remotes/scratch/t/topic
 	EOF
 	sort <<-\EOF >expect.setup-ffonly &&
-	refs/heads/master:refs/remotes/scratch/master
+	refs/heads/main:refs/remotes/scratch/main
 	+refs/heads/next:refs/remotes/scratch/next
 	EOF
 	sort <<-\EOF >expect.respect-ffonly &&
-	refs/heads/master:refs/remotes/scratch/master
+	refs/heads/main:refs/remotes/scratch/main
 	+refs/heads/next:refs/remotes/scratch/next
 	+refs/heads/seen:refs/remotes/scratch/seen
 	EOF
@@ -1028,7 +1028,7 @@ test_expect_success 'remote set-branches' '
 		git config --get-all remote.scratch.fetch >config-result &&
 		sort <config-result >../actual.add &&
 
-		git remote set-branches scratch maint master next &&
+		git remote set-branches scratch maint main next &&
 		git config --get-all remote.scratch.fetch >config-result &&
 		sort <config-result >../actual.replace &&
 
@@ -1038,7 +1038,7 @@ test_expect_success 'remote set-branches' '
 
 		git config --unset-all remote.scratch.fetch &&
 		git config remote.scratch.fetch \
-			refs/heads/master:refs/remotes/scratch/master &&
+			refs/heads/main:refs/remotes/scratch/main &&
 		git config --add remote.scratch.fetch \
 			+refs/heads/next:refs/remotes/scratch/next &&
 		git config --get-all remote.scratch.fetch >config-result &&
@@ -1058,14 +1058,14 @@ test_expect_success 'remote set-branches' '
 
 test_expect_success 'remote set-branches with --mirror' '
 	echo "+refs/*:refs/*" >expect.initial &&
-	echo "+refs/heads/master:refs/heads/master" >expect.replace &&
+	echo "+refs/heads/main:refs/heads/main" >expect.replace &&
 	git clone --mirror .git/ setbranches-mirror &&
 	(
 		cd setbranches-mirror &&
 		git remote rename origin scratch &&
 		git config --get-all remote.scratch.fetch >../actual.initial &&
 
-		git remote set-branches scratch heads/master &&
+		git remote set-branches scratch heads/main &&
 		git config --get-all remote.scratch.fetch >../actual.replace
 	) &&
 	test_cmp expect.initial actual.initial &&
@@ -1311,7 +1311,7 @@ test_extra_arg () {
 test_extra_arg add nick url
 test_extra_arg rename origin newname
 test_extra_arg remove origin
-test_extra_arg set-head origin master
+test_extra_arg set-head origin main
 # set-branches takes any number of args
 test_extra_arg get-url origin newurl
 test_extra_arg set-url origin newurl oldurl
@@ -1328,7 +1328,7 @@ test_expect_success 'unqualified <dst> refspec DWIM and advice' '
 	test_when_finished "(cd test && git tag -d some-tag)" &&
 	(
 		cd test &&
-		git tag -a -m "Some tag" some-tag master &&
+		git tag -a -m "Some tag" some-tag main &&
 		exit_with=true &&
 		for type in commit tag tree blob
 		do
@@ -1354,7 +1354,7 @@ test_expect_success 'unqualified <dst> refspec DWIM and advice' '
 test_expect_success PREPARE_FOR_MAIN_BRANCH 'refs/remotes/* <src> refspec and unqualified <dst> DWIM and advice' '
 	(
 		cd two &&
-		git tag -a -m "Some tag" my-tag master &&
+		git tag -a -m "Some tag" my-tag main &&
 		git update-ref refs/trees/my-head-tree HEAD^{tree} &&
 		git update-ref refs/blobs/my-file-blob HEAD:file
 	) &&
diff --git a/t/t5506-remote-groups.sh b/t/t5506-remote-groups.sh
index bf3aa85da5..8f150c0793 100755
--- a/t/t5506-remote-groups.sh
+++ b/t/t5506-remote-groups.sh
@@ -1,7 +1,7 @@
 #!/bin/sh
 
 test_description='git remote group handling'
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -34,8 +34,8 @@ repo_fetched() {
 test_expect_success 'setup' '
 	mkdir one && (cd one && git init) &&
 	mkdir two && (cd two && git init) &&
-	git remote add -m master one one &&
-	git remote add -m master two two
+	git remote add -m main one one &&
+	git remote add -m main two two
 '
 
 test_expect_success 'no group updates all' '
diff --git a/t/t5509-fetch-push-namespaces.sh b/t/t5509-fetch-push-namespaces.sh
index f234dba91a..31553b48df 100755
--- a/t/t5509-fetch-push-namespaces.sh
+++ b/t/t5509-fetch-push-namespaces.sh
@@ -1,7 +1,7 @@
 #!/bin/sh
 
 test_description='fetch/push involving ref namespaces'
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -30,9 +30,9 @@ test_expect_success setup '
 test_expect_success 'pushing into a repository using a ref namespace' '
 	(
 		cd original &&
-		git push pushee-namespaced master &&
+		git push pushee-namespaced main &&
 		git ls-remote pushee-namespaced >actual &&
-		printf "$commit1\trefs/heads/master\n" >expected &&
+		printf "$commit1\trefs/heads/main\n" >expected &&
 		test_cmp expected actual &&
 		git push pushee-namespaced --tags &&
 		git ls-remote pushee-namespaced >actual &&
@@ -59,7 +59,7 @@ test_expect_success 'pulling from a repository using a ref namespace' '
 		cd puller &&
 		git remote add -f pushee-namespaced "ext::git --namespace=namespace %s ../pushee" &&
 		git for-each-ref refs/ >actual &&
-		printf "$commit1 commit\trefs/remotes/pushee-namespaced/master\n" >expected &&
+		printf "$commit1 commit\trefs/remotes/pushee-namespaced/main\n" >expected &&
 		printf "$commit0 commit\trefs/tags/0\n" >>expected &&
 		printf "$commit1 commit\trefs/tags/1\n" >>expected &&
 		test_cmp expected actual
@@ -79,7 +79,7 @@ test_expect_success 'mirroring a repository using a ref namespace' '
 	(
 		cd mirror &&
 		git for-each-ref refs/ >actual &&
-		printf "$commit1 commit\trefs/namespaces/namespace/refs/heads/master\n" >expected &&
+		printf "$commit1 commit\trefs/namespaces/namespace/refs/heads/main\n" >expected &&
 		printf "$commit0 commit\trefs/namespaces/namespace/refs/tags/0\n" >>expected &&
 		printf "$commit1 commit\trefs/namespaces/namespace/refs/tags/1\n" >>expected &&
 		test_cmp expected actual
@@ -90,7 +90,7 @@ test_expect_success 'hide namespaced refs with transfer.hideRefs' '
 	GIT_NAMESPACE=namespace \
 		git -C pushee -c transfer.hideRefs=refs/tags \
 		ls-remote "ext::git %s ." >actual &&
-	printf "$commit1\trefs/heads/master\n" >expected &&
+	printf "$commit1\trefs/heads/main\n" >expected &&
 	test_cmp expected actual
 '
 
@@ -98,7 +98,7 @@ test_expect_success 'check that transfer.hideRefs does not match unstripped refs
 	GIT_NAMESPACE=namespace \
 		git -C pushee -c transfer.hideRefs=refs/namespaces/namespace/refs/tags \
 		ls-remote "ext::git %s ." >actual &&
-	printf "$commit1\trefs/heads/master\n" >expected &&
+	printf "$commit1\trefs/heads/main\n" >expected &&
 	printf "$commit0\trefs/tags/0\n" >>expected &&
 	printf "$commit1\trefs/tags/1\n" >>expected &&
 	test_cmp expected actual
@@ -108,23 +108,23 @@ test_expect_success 'hide full refs with transfer.hideRefs' '
 	GIT_NAMESPACE=namespace \
 		git -C pushee -c transfer.hideRefs="^refs/namespaces/namespace/refs/tags" \
 		ls-remote "ext::git %s ." >actual &&
-	printf "$commit1\trefs/heads/master\n" >expected &&
+	printf "$commit1\trefs/heads/main\n" >expected &&
 	test_cmp expected actual
 '
 
 test_expect_success 'try to update a hidden ref' '
-	test_config -C pushee transfer.hideRefs refs/heads/master &&
-	test_must_fail git -C original push pushee-namespaced master
+	test_config -C pushee transfer.hideRefs refs/heads/main &&
+	test_must_fail git -C original push pushee-namespaced main
 '
 
 test_expect_success 'try to update a ref that is not hidden' '
-	test_config -C pushee transfer.hideRefs refs/namespaces/namespace/refs/heads/master &&
-	git -C original push pushee-namespaced master
+	test_config -C pushee transfer.hideRefs refs/namespaces/namespace/refs/heads/main &&
+	git -C original push pushee-namespaced main
 '
 
 test_expect_success 'try to update a hidden full ref' '
-	test_config -C pushee transfer.hideRefs "^refs/namespaces/namespace/refs/heads/master" &&
-	test_must_fail git -C original push pushee-namespaced master
+	test_config -C pushee transfer.hideRefs "^refs/namespaces/namespace/refs/heads/main" &&
+	test_must_fail git -C original push pushee-namespaced main
 '
 
 test_expect_success 'set up ambiguous HEAD' '
@@ -160,9 +160,9 @@ test_expect_success 'denyCurrentBranch and unborn branch with ref namespace' '
 		cd original &&
 		git init unborn &&
 		git remote add unborn-namespaced "ext::git --namespace=namespace %s unborn" &&
-		test_must_fail git push unborn-namespaced HEAD:master &&
+		test_must_fail git push unborn-namespaced HEAD:main &&
 		git -C unborn config receive.denyCurrentBranch updateInstead &&
-		git push unborn-namespaced HEAD:master
+		git push unborn-namespaced HEAD:main
 	)
 '
 
-- 
gitgitgadget


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH v3 14/28] t551*: adjust the references to the default branch name "main"
  2020-11-18 23:44   ` [PATCH v3 00/28] tests: use main as default branch name Johannes Schindelin via GitGitGadget
                       ` (12 preceding siblings ...)
  2020-11-18 23:44     ` [PATCH v3 13/28] t550*: adjust the references to the default branch name "main" Johannes Schindelin via GitGitGadget
@ 2020-11-18 23:44     ` Johannes Schindelin via GitGitGadget
  2020-11-18 23:44     ` [PATCH v3 15/28] t55[23]*: " Johannes Schindelin via GitGitGadget
                       ` (14 subsequent siblings)
  28 siblings, 0 replies; 163+ messages in thread
From: Johannes Schindelin via GitGitGadget @ 2020-11-18 23:44 UTC (permalink / raw)
  To: git
  Cc: Felipe Contreras, Ævar Arnfjörð Bjarmason,
	Johannes Schindelin, Jeff King, Jonathan Nieder,
	Johannes Schindelin, Johannes Schindelin

From: Johannes Schindelin <johannes.schindelin@gmx.de>

This trick was performed via

	$ (cd t &&
	   sed -i -e 's/master/main/g' -e 's/MASTER/MAIN/g' \
		-e 's/Master/Main/g' -- t551*.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>
---
 t/t5510-fetch.sh             | 160 +++++------
 t/t5511-refspec.sh           |  12 +-
 t/t5512-ls-remote.sh         |  28 +-
 t/t5514-fetch-multiple.sh    |  32 +--
 t/t5516-fetch-push.sh        | 502 +++++++++++++++++------------------
 t/t5517-push-mirror.sh       | 126 ++++-----
 t/t5518-fetch-exit-status.sh |   8 +-
 t/t5519-push-alternates.sh   |  14 +-
 8 files changed, 441 insertions(+), 441 deletions(-)

diff --git a/t/t5510-fetch.sh b/t/t5510-fetch.sh
index 4af490b6db..35d9a8c279 100755
--- a/t/t5510-fetch.sh
+++ b/t/t5510-fetch.sh
@@ -5,7 +5,7 @@ test_description='Per branch config variables affects "git fetch".
 
 '
 
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -40,19 +40,19 @@ test_expect_success "clone and setup child repos" '
 	git clone . two &&
 	(
 		cd two &&
-		git config branch.master.remote one &&
+		git config branch.main.remote one &&
 		git config remote.one.url ../one/.git/ &&
-		git config remote.one.fetch refs/heads/master:refs/heads/one
+		git config remote.one.fetch refs/heads/main:refs/heads/one
 	) &&
 	git clone . three &&
 	(
 		cd three &&
-		git config branch.master.remote two &&
-		git config branch.master.merge refs/heads/one &&
+		git config branch.main.remote two &&
+		git config branch.main.merge refs/heads/one &&
 		mkdir -p .git/remotes &&
 		{
 			echo "URL: ../two/.git/"
-			echo "Pull: refs/heads/master:refs/heads/two"
+			echo "Pull: refs/heads/main:refs/heads/two"
 			echo "Pull: refs/heads/one:refs/heads/one"
 		} >.git/remotes/two
 	) &&
@@ -68,7 +68,7 @@ test_expect_success "fetch test" '
 	git fetch &&
 	git rev-parse --verify refs/heads/one &&
 	mine=$(git rev-parse refs/heads/one) &&
-	his=$(cd ../one && git rev-parse refs/heads/master) &&
+	his=$(cd ../one && git rev-parse refs/heads/main) &&
 	test "z$mine" = "z$his"
 '
 
@@ -78,11 +78,11 @@ test_expect_success "fetch test for-merge" '
 	git fetch &&
 	git rev-parse --verify refs/heads/two &&
 	git rev-parse --verify refs/heads/one &&
-	master_in_two=$(cd ../two && git rev-parse master) &&
+	main_in_two=$(cd ../two && git rev-parse main) &&
 	one_in_two=$(cd ../two && git rev-parse one) &&
 	{
 		echo "$one_in_two	"
-		echo "$master_in_two	not-for-merge"
+		echo "$main_in_two	not-for-merge"
 	} >expected &&
 	cut -f -2 .git/FETCH_HEAD >actual &&
 	test_cmp expected actual'
@@ -91,7 +91,7 @@ test_expect_success 'fetch --prune on its own works as expected' '
 	cd "$D" &&
 	git clone . prune &&
 	cd prune &&
-	git update-ref refs/remotes/origin/extrabranch master &&
+	git update-ref refs/remotes/origin/extrabranch main &&
 
 	git fetch --prune origin &&
 	test_must_fail git rev-parse origin/extrabranch
@@ -101,9 +101,9 @@ test_expect_success 'fetch --prune with a branch name keeps branches' '
 	cd "$D" &&
 	git clone . prune-branch &&
 	cd prune-branch &&
-	git update-ref refs/remotes/origin/extrabranch master &&
+	git update-ref refs/remotes/origin/extrabranch main &&
 
-	git fetch --prune origin master &&
+	git fetch --prune origin main &&
 	git rev-parse origin/extrabranch
 '
 
@@ -113,18 +113,18 @@ test_expect_success 'fetch --prune with a namespace keeps other namespaces' '
 	cd prune-namespace &&
 
 	git fetch --prune origin refs/heads/a/*:refs/remotes/origin/a/* &&
-	git rev-parse origin/master
+	git rev-parse origin/main
 '
 
 test_expect_success 'fetch --prune handles overlapping refspecs' '
 	cd "$D" &&
-	git update-ref refs/pull/42/head master &&
+	git update-ref refs/pull/42/head main &&
 	git clone . prune-overlapping &&
 	cd prune-overlapping &&
 	git config --add remote.origin.fetch refs/pull/*/head:refs/remotes/origin/pr/* &&
 
 	git fetch --prune origin &&
-	git rev-parse origin/master &&
+	git rev-parse origin/main &&
 	git rev-parse origin/pr/42 &&
 
 	git config --unset-all remote.origin.fetch &&
@@ -132,7 +132,7 @@ test_expect_success 'fetch --prune handles overlapping refspecs' '
 	git config --add remote.origin.fetch refs/heads/*:refs/remotes/origin/* &&
 
 	git fetch --prune origin &&
-	git rev-parse origin/master &&
+	git rev-parse origin/main &&
 	git rev-parse origin/pr/42
 '
 
@@ -140,13 +140,13 @@ test_expect_success 'fetch --prune --tags prunes branches but not tags' '
 	cd "$D" &&
 	git clone . prune-tags &&
 	cd prune-tags &&
-	git tag sometag master &&
+	git tag sometag main &&
 	# Create what looks like a remote-tracking branch from an earlier
 	# fetch that has since been deleted from the remote:
-	git update-ref refs/remotes/origin/fake-remote master &&
+	git update-ref refs/remotes/origin/fake-remote main &&
 
 	git fetch --prune --tags origin &&
-	git rev-parse origin/master &&
+	git rev-parse origin/main &&
 	test_must_fail git rev-parse origin/fake-remote &&
 	git rev-parse sometag
 '
@@ -155,10 +155,10 @@ test_expect_success 'fetch --prune --tags with branch does not prune other thing
 	cd "$D" &&
 	git clone . prune-tags-branch &&
 	cd prune-tags-branch &&
-	git tag sometag master &&
-	git update-ref refs/remotes/origin/extrabranch master &&
+	git tag sometag main &&
+	git update-ref refs/remotes/origin/extrabranch main &&
 
-	git fetch --prune --tags origin master &&
+	git fetch --prune --tags origin main &&
 	git rev-parse origin/extrabranch &&
 	git rev-parse sometag
 '
@@ -167,9 +167,9 @@ test_expect_success 'fetch --prune --tags with refspec prunes based on refspec'
 	cd "$D" &&
 	git clone . prune-tags-refspec &&
 	cd prune-tags-refspec &&
-	git tag sometag master &&
-	git update-ref refs/remotes/origin/foo/otherbranch master &&
-	git update-ref refs/remotes/origin/extrabranch master &&
+	git tag sometag main &&
+	git update-ref refs/remotes/origin/foo/otherbranch main &&
+	git update-ref refs/remotes/origin/extrabranch main &&
 
 	git fetch --prune --tags origin refs/heads/foo/*:refs/remotes/origin/foo/* &&
 	test_must_fail git rev-parse refs/remotes/origin/foo/otherbranch &&
@@ -180,20 +180,20 @@ test_expect_success 'fetch --prune --tags with refspec prunes based on refspec'
 test_expect_success '--refmap="" ignores configured refspec' '
 	cd "$TRASH_DIRECTORY" &&
 	git clone "$D" remote-refs &&
-	git -C remote-refs rev-parse remotes/origin/master >old &&
-	git -C remote-refs update-ref refs/remotes/origin/master master~1 &&
-	git -C remote-refs rev-parse remotes/origin/master >new &&
+	git -C remote-refs rev-parse remotes/origin/main >old &&
+	git -C remote-refs update-ref refs/remotes/origin/main main~1 &&
+	git -C remote-refs rev-parse remotes/origin/main >new &&
 	git -C remote-refs fetch --refmap= origin "+refs/heads/*:refs/hidden/origin/*" &&
-	git -C remote-refs rev-parse remotes/origin/master >actual &&
+	git -C remote-refs rev-parse remotes/origin/main >actual &&
 	test_cmp new actual &&
 	git -C remote-refs fetch origin &&
-	git -C remote-refs rev-parse remotes/origin/master >actual &&
+	git -C remote-refs rev-parse remotes/origin/main >actual &&
 	test_cmp old actual
 '
 
 test_expect_success '--refmap="" and --prune' '
-	git -C remote-refs update-ref refs/remotes/origin/foo/otherbranch master &&
-	git -C remote-refs update-ref refs/hidden/foo/otherbranch master &&
+	git -C remote-refs update-ref refs/remotes/origin/foo/otherbranch main &&
+	git -C remote-refs update-ref refs/hidden/foo/otherbranch main &&
 	git -C remote-refs fetch --prune --refmap="" origin +refs/heads/*:refs/hidden/* &&
 	git -C remote-refs rev-parse remotes/origin/foo/otherbranch &&
 	test_must_fail git -C remote-refs rev-parse refs/hidden/foo/otherbranch &&
@@ -253,7 +253,7 @@ test_expect_success 'fetch uses remote ref names to describe new refs' '
 		test_i18ngrep "new tag.* -> descriptive-tag$" actual &&
 		test_i18ngrep "new ref.* -> crazy$" actual
 	) &&
-	git checkout master
+	git checkout main
 '
 
 test_expect_success 'fetch must not resolve short tag name' '
@@ -284,7 +284,7 @@ test_expect_success 'create bundle 1' '
 	cd "$D" &&
 	echo >file updated again by origin &&
 	git commit -a -m "tip" &&
-	git bundle create --version=3 bundle1 master^..master
+	git bundle create --version=3 bundle1 main^..main
 '
 
 test_expect_success 'header of bundle looks right' '
@@ -292,7 +292,7 @@ test_expect_success 'header of bundle looks right' '
 	# v3 git bundle
 	@object-format=$(test_oid algo)
 	-OID updated by origin
-	OID refs/heads/master
+	OID refs/heads/main
 
 	EOF
 	sed -e "s/$OID_REGEX/OID/g" -e "5q" "$D"/bundle1 >actual &&
@@ -301,13 +301,13 @@ test_expect_success 'header of bundle looks right' '
 
 test_expect_success 'create bundle 2' '
 	cd "$D" &&
-	git bundle create bundle2 master~2..master
+	git bundle create bundle2 main~2..main
 '
 
 test_expect_success 'unbundle 1' '
 	cd "$D/bundle" &&
 	git checkout -b some-branch &&
-	test_must_fail git fetch "$D/bundle1" master:master
+	test_must_fail git fetch "$D/bundle1" main:main
 '
 
 
@@ -320,8 +320,8 @@ test_expect_success 'bundle 1 has only 3 files ' '
 
 test_expect_success 'unbundle 2' '
 	cd "$D/bundle" &&
-	git fetch ../bundle2 master:master &&
-	test "tip" = "$(git log -1 --pretty=oneline master | cut -d" " -f2)"
+	git fetch ../bundle2 main:main &&
+	test "tip" = "$(git log -1 --pretty=oneline main | cut -d" " -f2)"
 '
 
 test_expect_success 'bundle does not prerequisite objects' '
@@ -338,14 +338,14 @@ test_expect_success 'bundle does not prerequisite objects' '
 test_expect_success 'bundle should be able to create a full history' '
 
 	cd "$D" &&
-	git tag -a -m "1.0" v1.0 master &&
+	git tag -a -m "1.0" v1.0 main &&
 	git bundle create bundle4 v1.0
 
 '
 
 test_expect_success 'fetch with a non-applying branch.<name>.merge' '
-	git config branch.master.remote yeti &&
-	git config branch.master.merge refs/heads/bigfoot &&
+	git config branch.main.remote yeti &&
+	git config branch.main.merge refs/heads/bigfoot &&
 	git config remote.blub.url one &&
 	git config remote.blub.fetch "refs/heads/*:refs/remotes/one/*" &&
 	git fetch blub
@@ -365,8 +365,8 @@ test_expect_success 'fetch from GIT URL with a non-applying branch.<name>.merge
 # the merge spec matches the branch the remote HEAD points to
 test_expect_success 'fetch from GIT URL with a non-applying branch.<name>.merge [2]' '
 	one_ref=$(cd one && git symbolic-ref HEAD) &&
-	git config branch.master.remote blub &&
-	git config branch.master.merge "$one_ref" &&
+	git config branch.main.remote blub &&
+	git config branch.main.merge "$one_ref" &&
 	git update-ref -d FETCH_HEAD &&
 	git fetch one &&
 	test $one_head = "$(git rev-parse --verify FETCH_HEAD)" &&
@@ -376,7 +376,7 @@ test_expect_success 'fetch from GIT URL with a non-applying branch.<name>.merge
 # URL supplied to fetch matches the url of the configured branch's remote, but
 # the merge spec does not match the branch the remote HEAD points to
 test_expect_success 'fetch from GIT URL with a non-applying branch.<name>.merge [3]' '
-	git config branch.master.merge "${one_ref}_not" &&
+	git config branch.main.merge "${one_ref}_not" &&
 	git update-ref -d FETCH_HEAD &&
 	git fetch one &&
 	test $one_head = "$(git rev-parse --verify FETCH_HEAD)" &&
@@ -392,9 +392,9 @@ test_expect_success 'quoting of a strangely named repo' '
 test_expect_success 'bundle should record HEAD correctly' '
 
 	cd "$D" &&
-	git bundle create bundle5 HEAD master &&
+	git bundle create bundle5 HEAD main &&
 	git bundle list-heads bundle5 >actual &&
-	for h in HEAD refs/heads/master
+	for h in HEAD refs/heads/main
 	do
 		echo "$(git rev-parse --verify $h) $h"
 	done >expect &&
@@ -402,10 +402,10 @@ test_expect_success 'bundle should record HEAD correctly' '
 
 '
 
-test_expect_success 'mark initial state of origin/master' '
+test_expect_success 'mark initial state of origin/main' '
 	(
 		cd three &&
-		git tag base-origin-master refs/remotes/origin/master
+		git tag base-origin-main refs/remotes/origin/main
 	)
 '
 
@@ -415,10 +415,10 @@ test_expect_success 'explicit fetch should update tracking' '
 	git branch -f side &&
 	(
 		cd three &&
-		git update-ref refs/remotes/origin/master base-origin-master &&
-		o=$(git rev-parse --verify refs/remotes/origin/master) &&
-		git fetch origin master &&
-		n=$(git rev-parse --verify refs/remotes/origin/master) &&
+		git update-ref refs/remotes/origin/main base-origin-main &&
+		o=$(git rev-parse --verify refs/remotes/origin/main) &&
+		git fetch origin main &&
+		n=$(git rev-parse --verify refs/remotes/origin/main) &&
 		test "$o" != "$n" &&
 		test_must_fail git rev-parse --verify refs/remotes/origin/side
 	)
@@ -430,10 +430,10 @@ test_expect_success 'explicit pull should update tracking' '
 	git branch -f side &&
 	(
 		cd three &&
-		git update-ref refs/remotes/origin/master base-origin-master &&
-		o=$(git rev-parse --verify refs/remotes/origin/master) &&
-		git pull origin master &&
-		n=$(git rev-parse --verify refs/remotes/origin/master) &&
+		git update-ref refs/remotes/origin/main base-origin-main &&
+		o=$(git rev-parse --verify refs/remotes/origin/main) &&
+		git pull origin main &&
+		n=$(git rev-parse --verify refs/remotes/origin/main) &&
 		test "$o" != "$n" &&
 		test_must_fail git rev-parse --verify refs/remotes/origin/side
 	)
@@ -452,13 +452,13 @@ test_expect_success 'explicit --refmap option overrides remote.*.fetch' '
 	git branch -f side &&
 	(
 		cd three &&
-		git update-ref refs/remotes/origin/master base-origin-master &&
-		o=$(git rev-parse --verify refs/remotes/origin/master) &&
-		git fetch --refmap="refs/heads/*:refs/remotes/other/*" origin master &&
-		n=$(git rev-parse --verify refs/remotes/origin/master) &&
+		git update-ref refs/remotes/origin/main base-origin-main &&
+		o=$(git rev-parse --verify refs/remotes/origin/main) &&
+		git fetch --refmap="refs/heads/*:refs/remotes/other/*" origin main &&
+		n=$(git rev-parse --verify refs/remotes/origin/main) &&
 		test "$o" = "$n" &&
 		test_must_fail git rev-parse --verify refs/remotes/origin/side &&
-		git rev-parse --verify refs/remotes/other/master
+		git rev-parse --verify refs/remotes/other/main
 	)
 '
 
@@ -467,10 +467,10 @@ test_expect_success 'explicitly empty --refmap option disables remote.*.fetch' '
 	git branch -f side &&
 	(
 		cd three &&
-		git update-ref refs/remotes/origin/master base-origin-master &&
-		o=$(git rev-parse --verify refs/remotes/origin/master) &&
-		git fetch --refmap="" origin master &&
-		n=$(git rev-parse --verify refs/remotes/origin/master) &&
+		git update-ref refs/remotes/origin/main base-origin-main &&
+		o=$(git rev-parse --verify refs/remotes/origin/main) &&
+		git fetch --refmap="" origin main &&
+		n=$(git rev-parse --verify refs/remotes/origin/main) &&
 		test "$o" = "$n" &&
 		test_must_fail git rev-parse --verify refs/remotes/origin/side
 	)
@@ -482,10 +482,10 @@ test_expect_success 'configured fetch updates tracking' '
 	git branch -f side &&
 	(
 		cd three &&
-		git update-ref refs/remotes/origin/master base-origin-master &&
-		o=$(git rev-parse --verify refs/remotes/origin/master) &&
+		git update-ref refs/remotes/origin/main base-origin-main &&
+		o=$(git rev-parse --verify refs/remotes/origin/main) &&
 		git fetch origin &&
-		n=$(git rev-parse --verify refs/remotes/origin/master) &&
+		n=$(git rev-parse --verify refs/remotes/origin/main) &&
 		test "$o" != "$n" &&
 		git rev-parse --verify refs/remotes/origin/side
 	)
@@ -496,12 +496,12 @@ test_expect_success 'non-matching refspecs do not confuse tracking update' '
 	git update-ref refs/odd/location HEAD &&
 	(
 		cd three &&
-		git update-ref refs/remotes/origin/master base-origin-master &&
+		git update-ref refs/remotes/origin/main base-origin-main &&
 		git config --add remote.origin.fetch \
 			refs/odd/location:refs/remotes/origin/odd &&
-		o=$(git rev-parse --verify refs/remotes/origin/master) &&
-		git fetch origin master &&
-		n=$(git rev-parse --verify refs/remotes/origin/master) &&
+		o=$(git rev-parse --verify refs/remotes/origin/main) &&
+		git fetch origin main &&
+		n=$(git rev-parse --verify refs/remotes/origin/main) &&
 		test "$o" != "$n" &&
 		test_must_fail git rev-parse --verify refs/remotes/origin/odd
 	)
@@ -527,7 +527,7 @@ test_expect_success 'auto tag following fetches minimum' '
 			git tag -a -m $i excess-$i || exit 1
 		done
 	) &&
-	git checkout master &&
+	git checkout main &&
 	(
 		cd follow &&
 		git fetch
@@ -536,13 +536,13 @@ test_expect_success 'auto tag following fetches minimum' '
 
 test_expect_success 'refuse to fetch into the current branch' '
 
-	test_must_fail git fetch . side:master
+	test_must_fail git fetch . side:main
 
 '
 
 test_expect_success 'fetch into the current branch with --update-head-ok' '
 
-	git fetch --update-head-ok . side:master
+	git fetch --update-head-ok . side:main
 
 '
 
@@ -571,7 +571,7 @@ test_expect_success "should be able to fetch with duplicate refspecs" '
 	(
 		cd dups &&
 		git init &&
-		git config branch.master.remote three &&
+		git config branch.main.remote three &&
 		git config remote.three.url ../three/.git &&
 		git config remote.three.fetch +refs/heads/*:refs/remotes/origin/* &&
 		git config --add remote.three.fetch +refs/heads/*:refs/remotes/origin/* &&
@@ -880,11 +880,11 @@ test_expect_success 'all boundary commits are excluded' '
 	test_commit oneside &&
 	git checkout HEAD^ &&
 	test_commit otherside &&
-	git checkout master &&
+	git checkout main &&
 	test_tick &&
 	git merge otherside &&
 	ad=$(git log --no-walk --format=%ad HEAD) &&
-	git bundle create twoside-boundary.bdl master --since="$ad" &&
+	git bundle create twoside-boundary.bdl main --since="$ad" &&
 	convert_bundle_to_pack <twoside-boundary.bdl >twoside-boundary.pack &&
 	pack=$(git index-pack --fix-thin --stdin <twoside-boundary.pack) &&
 	test_bundle_object_count .git/objects/pack/pack-${pack##pack	}.pack 3
@@ -1020,7 +1020,7 @@ setup_negotiation_tip () {
 	fi &&
 
 	test_commit -C "$SERVER" beta_s &&
-	git -C "$SERVER" checkout master &&
+	git -C "$SERVER" checkout main &&
 	test_commit -C "$SERVER" alpha_s &&
 	git -C "$SERVER" tag -d alpha_1 alpha_2 beta_1 beta_2
 }
diff --git a/t/t5511-refspec.sh b/t/t5511-refspec.sh
index f541f30bc2..847a9d4c27 100755
--- a/t/t5511-refspec.sh
+++ b/t/t5511-refspec.sh
@@ -33,7 +33,7 @@ test_refspec fetch '::'						invalid
 test_refspec push 'refs/heads/*:refs/remotes/frotz/*'
 test_refspec push 'refs/heads/*:refs/remotes/frotz'		invalid
 test_refspec push 'refs/heads:refs/remotes/frotz/*'		invalid
-test_refspec push 'refs/heads/master:refs/remotes/frotz/xyzzy'
+test_refspec push 'refs/heads/main:refs/remotes/frotz/xyzzy'
 
 
 # These have invalid LHS, but we do not have a formal "valid sha-1
@@ -41,18 +41,18 @@ test_refspec push 'refs/heads/master:refs/remotes/frotz/xyzzy'
 # code.  They will be caught downstream anyway, but we may want to
 # have tighter check later...
 
-: test_refspec push 'refs/heads/master::refs/remotes/frotz/xyzzy'	invalid
+: test_refspec push 'refs/heads/main::refs/remotes/frotz/xyzzy'	invalid
 : test_refspec push 'refs/heads/maste :refs/remotes/frotz/xyzzy'	invalid
 
 test_refspec fetch 'refs/heads/*:refs/remotes/frotz/*'
 test_refspec fetch 'refs/heads/*:refs/remotes/frotz'		invalid
 test_refspec fetch 'refs/heads:refs/remotes/frotz/*'		invalid
-test_refspec fetch 'refs/heads/master:refs/remotes/frotz/xyzzy'
-test_refspec fetch 'refs/heads/master::refs/remotes/frotz/xyzzy'	invalid
+test_refspec fetch 'refs/heads/main:refs/remotes/frotz/xyzzy'
+test_refspec fetch 'refs/heads/main::refs/remotes/frotz/xyzzy'	invalid
 test_refspec fetch 'refs/heads/maste :refs/remotes/frotz/xyzzy'	invalid
 
-test_refspec push 'master~1:refs/remotes/frotz/backup'
-test_refspec fetch 'master~1:refs/remotes/frotz/backup'		invalid
+test_refspec push 'main~1:refs/remotes/frotz/backup'
+test_refspec fetch 'main~1:refs/remotes/frotz/backup'		invalid
 test_refspec push 'HEAD~4:refs/remotes/frotz/new'
 test_refspec fetch 'HEAD~4:refs/remotes/frotz/new'		invalid
 
diff --git a/t/t5512-ls-remote.sh b/t/t5512-ls-remote.sh
index a892807de2..4a568a2398 100755
--- a/t/t5512-ls-remote.sh
+++ b/t/t5512-ls-remote.sh
@@ -2,7 +2,7 @@
 
 test_description='git ls-remote'
 
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -121,7 +121,7 @@ test_expect_success 'use branch.<name>.remote if possible' '
 	echo "From $URL" >exp_err &&
 
 	git remote add other $URL &&
-	git config branch.master.remote other &&
+	git config branch.main.remote other &&
 
 	git ls-remote 2>actual_err >actual &&
 	test_cmp exp_err actual_err &&
@@ -132,9 +132,9 @@ test_expect_success 'confuses pattern as remote when no remote specified' '
 	if test_have_prereq MINGW
 	then
 		# Windows does not like asterisks in pathname
-		does_not_exist=master
+		does_not_exist=main
 	else
-		does_not_exist="refs*master"
+		does_not_exist="refs*main"
 	fi &&
 	cat >exp <<-EOF &&
 	fatal: '\''$does_not_exist'\'' does not appear to be a git repository
@@ -147,7 +147,7 @@ test_expect_success 'confuses pattern as remote when no remote specified' '
 	# Do not expect "git ls-remote <pattern>" to work; ls-remote needs
 	# <remote> if you want to feed <pattern>, just like you cannot say
 	# fetch <branch>.
-	# We could just as easily have used "master"; the "*" emphasizes its
+	# We could just as easily have used "main"; the "*" emphasizes its
 	# role as a pattern.
 	test_must_fail git ls-remote "$does_not_exist" >actual 2>&1 &&
 	test_i18ncmp exp actual
@@ -220,14 +220,14 @@ test_expect_success 'protocol v2 supports hiderefs' '
 
 test_expect_success 'ls-remote --symref' '
 	git fetch origin &&
-	echo "ref: refs/heads/master	HEAD" >expect &&
+	echo "ref: refs/heads/main	HEAD" >expect &&
 	generate_references \
 		HEAD \
-		refs/heads/master >>expect &&
+		refs/heads/main >>expect &&
 	oid=$(git rev-parse HEAD) &&
 	echo "$oid	refs/remotes/origin/HEAD" >>expect &&
 	generate_references \
-		refs/remotes/origin/master \
+		refs/remotes/origin/main \
 		refs/tags/mark \
 		refs/tags/mark1.1 \
 		refs/tags/mark1.10 \
@@ -241,7 +241,7 @@ test_expect_success 'ls-remote --symref' '
 test_expect_success 'ls-remote with filtered symref (refname)' '
 	rev=$(git rev-parse HEAD) &&
 	cat >expect <<-EOF &&
-	ref: refs/heads/master	HEAD
+	ref: refs/heads/main	HEAD
 	$rev	HEAD
 	EOF
 	# Protocol v2 supports sending symrefs for refs other than HEAD, so use
@@ -255,7 +255,7 @@ test_expect_failure 'ls-remote with filtered symref (--heads)' '
 	cat >expect <<-EOF &&
 	ref: refs/tags/mark	refs/heads/foo
 	$rev	refs/heads/foo
-	$rev	refs/heads/master
+	$rev	refs/heads/main
 	EOF
 	# Protocol v2 supports sending symrefs for refs other than HEAD, so use
 	# protocol v0 here.
@@ -266,7 +266,7 @@ test_expect_failure 'ls-remote with filtered symref (--heads)' '
 test_expect_success 'ls-remote --symref omits filtered-out matches' '
 	cat >expect <<-EOF &&
 	$rev	refs/heads/foo
-	$rev	refs/heads/master
+	$rev	refs/heads/main
 	EOF
 	# Protocol v2 supports sending symrefs for refs other than HEAD, so use
 	# protocol v0 here.
@@ -333,10 +333,10 @@ test_expect_success 'ls-remote --sort fails gracefully outside repository' '
 
 test_expect_success 'ls-remote patterns work with all protocol versions' '
 	git for-each-ref --format="%(objectname)	%(refname)" \
-		refs/heads/master refs/remotes/origin/master >expect &&
-	git -c protocol.version=1 ls-remote . master >actual.v1 &&
+		refs/heads/main refs/remotes/origin/main >expect &&
+	git -c protocol.version=1 ls-remote . main >actual.v1 &&
 	test_cmp expect actual.v1 &&
-	git -c protocol.version=2 ls-remote . master >actual.v2 &&
+	git -c protocol.version=2 ls-remote . main >actual.v2 &&
 	test_cmp expect actual.v2
 '
 
diff --git a/t/t5514-fetch-multiple.sh b/t/t5514-fetch-multiple.sh
index f12a83f82b..511ba3bd45 100755
--- a/t/t5514-fetch-multiple.sh
+++ b/t/t5514-fetch-multiple.sh
@@ -2,7 +2,7 @@
 
 test_description='fetch --all works correctly'
 
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -20,7 +20,7 @@ setup_repository () {
 	git add elif &&
 	test_tick &&
 	git commit -m "Second" &&
-	git checkout master
+	git checkout main
 	)
 }
 
@@ -35,16 +35,16 @@ test_expect_success setup '
 '
 
 cat > test/expect << EOF
-  one/master
+  one/main
   one/side
-  origin/HEAD -> origin/master
-  origin/master
+  origin/HEAD -> origin/main
+  origin/main
   origin/side
   three/another
-  three/master
+  three/main
   three/side
   two/another
-  two/master
+  two/main
   two/side
 EOF
 
@@ -73,15 +73,15 @@ test_expect_success 'git fetch --all should continue if a remote has errors' '
 test_expect_success 'git fetch --all does not allow non-option arguments' '
 	(cd test &&
 	 test_must_fail git fetch --all origin &&
-	 test_must_fail git fetch --all origin master)
+	 test_must_fail git fetch --all origin main)
 '
 
 cat > expect << EOF
-  origin/HEAD -> origin/master
-  origin/master
+  origin/HEAD -> origin/main
+  origin/main
   origin/side
   three/another
-  three/master
+  three/main
   three/side
 EOF
 
@@ -95,10 +95,10 @@ test_expect_success 'git fetch --multiple (but only one remote)' '
 '
 
 cat > expect << EOF
-  one/master
+  one/main
   one/side
   two/another
-  two/master
+  two/main
   two/side
 EOF
 
@@ -136,13 +136,13 @@ test_expect_success 'git fetch --all (skipFetchAll)' '
 '
 
 cat > expect << EOF
-  one/master
+  one/main
   one/side
   three/another
-  three/master
+  three/main
   three/side
   two/another
-  two/master
+  two/main
   two/side
 EOF
 
diff --git a/t/t5516-fetch-push.sh b/t/t5516-fetch-push.sh
index 7003467523..b037439c49 100755
--- a/t/t5516-fetch-push.sh
+++ b/t/t5516-fetch-push.sh
@@ -14,7 +14,7 @@ This test checks the following functionality:
 * reflogs
 '
 
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -123,13 +123,13 @@ test_expect_success setup '
 	git add path1 &&
 	test_tick &&
 	git commit -a -m repo &&
-	the_first_commit=$(git show-ref -s --verify refs/heads/master) &&
+	the_first_commit=$(git show-ref -s --verify refs/heads/main) &&
 
 	>path2 &&
 	git add path2 &&
 	test_tick &&
 	git commit -a -m second &&
-	the_commit=$(git show-ref -s --verify refs/heads/master)
+	the_commit=$(git show-ref -s --verify refs/heads/main)
 
 '
 
@@ -137,9 +137,9 @@ test_expect_success 'fetch without wildcard' '
 	mk_empty testrepo &&
 	(
 		cd testrepo &&
-		git fetch .. refs/heads/master:refs/remotes/origin/master &&
+		git fetch .. refs/heads/main:refs/remotes/origin/main &&
 
-		echo "$the_commit commit	refs/remotes/origin/master" >expect &&
+		echo "$the_commit commit	refs/remotes/origin/main" >expect &&
 		git for-each-ref refs/remotes/origin >actual &&
 		test_cmp expect actual
 	)
@@ -153,7 +153,7 @@ test_expect_success 'fetch with wildcard' '
 		git config remote.up.fetch "refs/heads/*:refs/remotes/origin/*" &&
 		git fetch up &&
 
-		echo "$the_commit commit	refs/remotes/origin/master" >expect &&
+		echo "$the_commit commit	refs/remotes/origin/main" >expect &&
 		git for-each-ref refs/remotes/origin >actual &&
 		test_cmp expect actual
 	)
@@ -169,7 +169,7 @@ test_expect_success 'fetch with insteadOf' '
 		git config remote.up.fetch "refs/heads/*:refs/remotes/origin/*" &&
 		git fetch up &&
 
-		echo "$the_commit commit	refs/remotes/origin/master" >expect &&
+		echo "$the_commit commit	refs/remotes/origin/main" >expect &&
 		git for-each-ref refs/remotes/origin >actual &&
 		test_cmp expect actual
 	)
@@ -185,7 +185,7 @@ test_expect_success 'fetch with pushInsteadOf (should not rewrite)' '
 		git config remote.up.fetch "refs/heads/*:refs/remotes/origin/*" &&
 		git fetch up &&
 
-		echo "$the_commit commit	refs/remotes/origin/master" >expect &&
+		echo "$the_commit commit	refs/remotes/origin/main" >expect &&
 		git for-each-ref refs/remotes/origin >actual &&
 		test_cmp expect actual
 	)
@@ -194,10 +194,10 @@ test_expect_success 'fetch with pushInsteadOf (should not rewrite)' '
 test_expect_success 'push without wildcard' '
 	mk_empty testrepo &&
 
-	git push testrepo refs/heads/master:refs/remotes/origin/master &&
+	git push testrepo refs/heads/main:refs/remotes/origin/main &&
 	(
 		cd testrepo &&
-		echo "$the_commit commit	refs/remotes/origin/master" >expect &&
+		echo "$the_commit commit	refs/remotes/origin/main" >expect &&
 		git for-each-ref refs/remotes/origin >actual &&
 		test_cmp expect actual
 	)
@@ -209,7 +209,7 @@ test_expect_success 'push with wildcard' '
 	git push testrepo "refs/heads/*:refs/remotes/origin/*" &&
 	(
 		cd testrepo &&
-		echo "$the_commit commit	refs/remotes/origin/master" >expect &&
+		echo "$the_commit commit	refs/remotes/origin/main" >expect &&
 		git for-each-ref refs/remotes/origin >actual &&
 		test_cmp expect actual
 	)
@@ -219,10 +219,10 @@ test_expect_success 'push with insteadOf' '
 	mk_empty testrepo &&
 	TRASH="$(pwd)/" &&
 	test_config "url.$TRASH.insteadOf" trash/ &&
-	git push trash/testrepo refs/heads/master:refs/remotes/origin/master &&
+	git push trash/testrepo refs/heads/main:refs/remotes/origin/main &&
 	(
 		cd testrepo &&
-		echo "$the_commit commit	refs/remotes/origin/master" >expect &&
+		echo "$the_commit commit	refs/remotes/origin/main" >expect &&
 		git for-each-ref refs/remotes/origin >actual &&
 		test_cmp expect actual
 	)
@@ -232,10 +232,10 @@ test_expect_success 'push with pushInsteadOf' '
 	mk_empty testrepo &&
 	TRASH="$(pwd)/" &&
 	test_config "url.$TRASH.pushInsteadOf" trash/ &&
-	git push trash/testrepo refs/heads/master:refs/remotes/origin/master &&
+	git push trash/testrepo refs/heads/main:refs/remotes/origin/main &&
 	(
 		cd testrepo &&
-		echo "$the_commit commit	refs/remotes/origin/master" >expect &&
+		echo "$the_commit commit	refs/remotes/origin/main" >expect &&
 		git for-each-ref refs/remotes/origin >actual &&
 		test_cmp expect actual
 	)
@@ -247,10 +247,10 @@ test_expect_success 'push with pushInsteadOf and explicit pushurl (pushInsteadOf
 	test_config "url.trash3/.pushInsteadOf" trash/wrong &&
 	test_config remote.r.url trash/wrong &&
 	test_config remote.r.pushurl "testrepo/" &&
-	git push r refs/heads/master:refs/remotes/origin/master &&
+	git push r refs/heads/main:refs/remotes/origin/main &&
 	(
 		cd testrepo &&
-		echo "$the_commit commit	refs/remotes/origin/master" >expect &&
+		echo "$the_commit commit	refs/remotes/origin/main" >expect &&
 		git for-each-ref refs/remotes/origin >actual &&
 		test_cmp expect actual
 	)
@@ -258,101 +258,101 @@ test_expect_success 'push with pushInsteadOf and explicit pushurl (pushInsteadOf
 
 test_expect_success 'push with matching heads' '
 
-	mk_test testrepo heads/master &&
+	mk_test testrepo heads/main &&
 	git push testrepo : &&
-	check_push_result testrepo $the_commit heads/master
+	check_push_result testrepo $the_commit heads/main
 
 '
 
 test_expect_success 'push with matching heads on the command line' '
 
-	mk_test testrepo heads/master &&
+	mk_test testrepo heads/main &&
 	git push testrepo : &&
-	check_push_result testrepo $the_commit heads/master
+	check_push_result testrepo $the_commit heads/main
 
 '
 
 test_expect_success 'failed (non-fast-forward) push with matching heads' '
 
-	mk_test testrepo heads/master &&
+	mk_test testrepo heads/main &&
 	git push testrepo : &&
 	git commit --amend -massaged &&
 	test_must_fail git push testrepo &&
-	check_push_result testrepo $the_commit heads/master &&
+	check_push_result testrepo $the_commit heads/main &&
 	git reset --hard $the_commit
 
 '
 
 test_expect_success 'push --force with matching heads' '
 
-	mk_test testrepo heads/master &&
+	mk_test testrepo heads/main &&
 	git push testrepo : &&
 	git commit --amend -massaged &&
 	git push --force testrepo : &&
-	! check_push_result testrepo $the_commit heads/master &&
+	! check_push_result testrepo $the_commit heads/main &&
 	git reset --hard $the_commit
 
 '
 
 test_expect_success 'push with matching heads and forced update' '
 
-	mk_test testrepo heads/master &&
+	mk_test testrepo heads/main &&
 	git push testrepo : &&
 	git commit --amend -massaged &&
 	git push testrepo +: &&
-	! check_push_result testrepo $the_commit heads/master &&
+	! check_push_result testrepo $the_commit heads/main &&
 	git reset --hard $the_commit
 
 '
 
 test_expect_success 'push with no ambiguity (1)' '
 
-	mk_test testrepo heads/master &&
-	git push testrepo master:master &&
-	check_push_result testrepo $the_commit heads/master
+	mk_test testrepo heads/main &&
+	git push testrepo main:main &&
+	check_push_result testrepo $the_commit heads/main
 
 '
 
 test_expect_success 'push with no ambiguity (2)' '
 
-	mk_test testrepo remotes/origin/master &&
-	git push testrepo master:origin/master &&
-	check_push_result testrepo $the_commit remotes/origin/master
+	mk_test testrepo remotes/origin/main &&
+	git push testrepo main:origin/main &&
+	check_push_result testrepo $the_commit remotes/origin/main
 
 '
 
 test_expect_success 'push with colon-less refspec, no ambiguity' '
 
-	mk_test testrepo heads/master heads/t/master &&
-	git branch -f t/master master &&
-	git push testrepo master &&
-	check_push_result testrepo $the_commit heads/master &&
-	check_push_result testrepo $the_first_commit heads/t/master
+	mk_test testrepo heads/main heads/t/main &&
+	git branch -f t/main main &&
+	git push testrepo main &&
+	check_push_result testrepo $the_commit heads/main &&
+	check_push_result testrepo $the_first_commit heads/t/main
 
 '
 
 test_expect_success 'push with weak ambiguity (1)' '
 
-	mk_test testrepo heads/master remotes/origin/master &&
-	git push testrepo master:master &&
-	check_push_result testrepo $the_commit heads/master &&
-	check_push_result testrepo $the_first_commit remotes/origin/master
+	mk_test testrepo heads/main remotes/origin/main &&
+	git push testrepo main:main &&
+	check_push_result testrepo $the_commit heads/main &&
+	check_push_result testrepo $the_first_commit remotes/origin/main
 
 '
 
 test_expect_success 'push with weak ambiguity (2)' '
 
-	mk_test testrepo heads/master remotes/origin/master remotes/another/master &&
-	git push testrepo master:master &&
-	check_push_result testrepo $the_commit heads/master &&
-	check_push_result testrepo $the_first_commit remotes/origin/master remotes/another/master
+	mk_test testrepo heads/main remotes/origin/main remotes/another/main &&
+	git push testrepo main:main &&
+	check_push_result testrepo $the_commit heads/main &&
+	check_push_result testrepo $the_first_commit remotes/origin/main remotes/another/main
 
 '
 
 test_expect_success 'push with ambiguity' '
 
 	mk_test testrepo heads/frotz tags/frotz &&
-	test_must_fail git push testrepo master:frotz &&
+	test_must_fail git push testrepo main:frotz &&
 	check_push_result testrepo $the_first_commit heads/frotz tags/frotz
 
 '
@@ -360,7 +360,7 @@ test_expect_success 'push with ambiguity' '
 test_expect_success 'push with colon-less refspec (1)' '
 
 	mk_test testrepo heads/frotz tags/frotz &&
-	git branch -f frotz master &&
+	git branch -f frotz main &&
 	git push testrepo frotz &&
 	check_push_result testrepo $the_commit heads/frotz &&
 	check_push_result testrepo $the_first_commit tags/frotz
@@ -388,7 +388,7 @@ test_expect_success 'push with colon-less refspec (3)' '
 	then
 		git tag -d frotz
 	fi &&
-	git branch -f frotz master &&
+	git branch -f frotz main &&
 	git push testrepo frotz &&
 	check_push_result testrepo $the_commit heads/frotz &&
 	test 1 = $( cd testrepo && git show-ref | wc -l )
@@ -411,7 +411,7 @@ test_expect_success 'push with colon-less refspec (4)' '
 test_expect_success 'push head with non-existent, incomplete dest' '
 
 	mk_test testrepo &&
-	git push testrepo master:branch &&
+	git push testrepo main:branch &&
 	check_push_result testrepo $the_commit heads/branch
 
 '
@@ -428,42 +428,42 @@ test_expect_success 'push tag with non-existent, incomplete dest' '
 test_expect_success 'push sha1 with non-existent, incomplete dest' '
 
 	mk_test testrepo &&
-	test_must_fail git push testrepo $(git rev-parse master):foo
+	test_must_fail git push testrepo $(git rev-parse main):foo
 
 '
 
 test_expect_success 'push ref expression with non-existent, incomplete dest' '
 
 	mk_test testrepo &&
-	test_must_fail git push testrepo master^:branch
+	test_must_fail git push testrepo main^:branch
 
 '
 
 test_expect_success 'push with HEAD' '
 
-	mk_test testrepo heads/master &&
-	git checkout master &&
+	mk_test testrepo heads/main &&
+	git checkout main &&
 	git push testrepo HEAD &&
-	check_push_result testrepo $the_commit heads/master
+	check_push_result testrepo $the_commit heads/main
 
 '
 
 test_expect_success 'push with HEAD nonexisting at remote' '
 
-	mk_test testrepo heads/master &&
-	git checkout -b local master &&
+	mk_test testrepo heads/main &&
+	git checkout -b local main &&
 	git push testrepo HEAD &&
 	check_push_result testrepo $the_commit heads/local
 '
 
 test_expect_success 'push with +HEAD' '
 
-	mk_test testrepo heads/master &&
-	git checkout master &&
+	mk_test testrepo heads/main &&
+	git checkout main &&
 	git branch -D local &&
 	git checkout -b local &&
-	git push testrepo master local &&
-	check_push_result testrepo $the_commit heads/master &&
+	git push testrepo main local &&
+	check_push_result testrepo $the_commit heads/main &&
 	check_push_result testrepo $the_commit heads/local &&
 
 	# Without force rewinding should fail
@@ -480,7 +480,7 @@ test_expect_success 'push with +HEAD' '
 test_expect_success 'push HEAD with non-existent, incomplete dest' '
 
 	mk_test testrepo &&
-	git checkout master &&
+	git checkout main &&
 	git push testrepo HEAD:branch &&
 	check_push_result testrepo $the_commit heads/branch
 
@@ -489,7 +489,7 @@ test_expect_success 'push HEAD with non-existent, incomplete dest' '
 test_expect_success 'push with config remote.*.push = HEAD' '
 
 	mk_test testrepo heads/local &&
-	git checkout master &&
+	git checkout main &&
 	git branch -f local $the_commit &&
 	(
 		cd testrepo &&
@@ -498,166 +498,166 @@ test_expect_success 'push with config remote.*.push = HEAD' '
 	) &&
 	test_config remote.there.url testrepo &&
 	test_config remote.there.push HEAD &&
-	test_config branch.master.remote there &&
+	test_config branch.main.remote there &&
 	git push &&
-	check_push_result testrepo $the_commit heads/master &&
+	check_push_result testrepo $the_commit heads/main &&
 	check_push_result testrepo $the_first_commit heads/local
 '
 
 test_expect_success 'push with remote.pushdefault' '
-	mk_test up_repo heads/master &&
-	mk_test down_repo heads/master &&
+	mk_test up_repo heads/main &&
+	mk_test down_repo heads/main &&
 	test_config remote.up.url up_repo &&
 	test_config remote.down.url down_repo &&
-	test_config branch.master.remote up &&
+	test_config branch.main.remote up &&
 	test_config remote.pushdefault down &&
 	test_config push.default matching &&
 	git push &&
-	check_push_result up_repo $the_first_commit heads/master &&
-	check_push_result down_repo $the_commit heads/master
+	check_push_result up_repo $the_first_commit heads/main &&
+	check_push_result down_repo $the_commit heads/main
 '
 
 test_expect_success 'push with config remote.*.pushurl' '
 
-	mk_test testrepo heads/master &&
-	git checkout master &&
+	mk_test testrepo heads/main &&
+	git checkout main &&
 	test_config remote.there.url test2repo &&
 	test_config remote.there.pushurl testrepo &&
 	git push there : &&
-	check_push_result testrepo $the_commit heads/master
+	check_push_result testrepo $the_commit heads/main
 '
 
 test_expect_success 'push with config branch.*.pushremote' '
-	mk_test up_repo heads/master &&
-	mk_test side_repo heads/master &&
-	mk_test down_repo heads/master &&
+	mk_test up_repo heads/main &&
+	mk_test side_repo heads/main &&
+	mk_test down_repo heads/main &&
 	test_config remote.up.url up_repo &&
 	test_config remote.pushdefault side_repo &&
 	test_config remote.down.url down_repo &&
-	test_config branch.master.remote up &&
-	test_config branch.master.pushremote down &&
+	test_config branch.main.remote up &&
+	test_config branch.main.pushremote down &&
 	test_config push.default matching &&
 	git push &&
-	check_push_result up_repo $the_first_commit heads/master &&
-	check_push_result side_repo $the_first_commit heads/master &&
-	check_push_result down_repo $the_commit heads/master
+	check_push_result up_repo $the_first_commit heads/main &&
+	check_push_result side_repo $the_first_commit heads/main &&
+	check_push_result down_repo $the_commit heads/main
 '
 
 test_expect_success 'branch.*.pushremote config order is irrelevant' '
-	mk_test one_repo heads/master &&
-	mk_test two_repo heads/master &&
+	mk_test one_repo heads/main &&
+	mk_test two_repo heads/main &&
 	test_config remote.one.url one_repo &&
 	test_config remote.two.url two_repo &&
-	test_config branch.master.pushremote two_repo &&
+	test_config branch.main.pushremote two_repo &&
 	test_config remote.pushdefault one_repo &&
 	test_config push.default matching &&
 	git push &&
-	check_push_result one_repo $the_first_commit heads/master &&
-	check_push_result two_repo $the_commit heads/master
+	check_push_result one_repo $the_first_commit heads/main &&
+	check_push_result two_repo $the_commit heads/main
 '
 
 test_expect_success 'push with dry-run' '
 
-	mk_test testrepo heads/master &&
-	old_commit=$(git -C testrepo show-ref -s --verify refs/heads/master) &&
+	mk_test testrepo heads/main &&
+	old_commit=$(git -C testrepo show-ref -s --verify refs/heads/main) &&
 	git push --dry-run testrepo : &&
-	check_push_result testrepo $old_commit heads/master
+	check_push_result testrepo $old_commit heads/main
 '
 
 test_expect_success 'push updates local refs' '
 
-	mk_test testrepo heads/master &&
+	mk_test testrepo heads/main &&
 	mk_child testrepo child &&
 	(
 		cd child &&
-		git pull .. master &&
+		git pull .. main &&
 		git push &&
-		test $(git rev-parse master) = \
-			$(git rev-parse remotes/origin/master)
+		test $(git rev-parse main) = \
+			$(git rev-parse remotes/origin/main)
 	)
 
 '
 
 test_expect_success 'push updates up-to-date local refs' '
 
-	mk_test testrepo heads/master &&
+	mk_test testrepo heads/main &&
 	mk_child testrepo child1 &&
 	mk_child testrepo child2 &&
-	(cd child1 && git pull .. master && git push) &&
+	(cd child1 && git pull .. main && git push) &&
 	(
 		cd child2 &&
-		git pull ../child1 master &&
+		git pull ../child1 main &&
 		git push &&
-		test $(git rev-parse master) = \
-			$(git rev-parse remotes/origin/master)
+		test $(git rev-parse main) = \
+			$(git rev-parse remotes/origin/main)
 	)
 
 '
 
 test_expect_success 'push preserves up-to-date packed refs' '
 
-	mk_test testrepo heads/master &&
+	mk_test testrepo heads/main &&
 	mk_child testrepo child &&
 	(
 		cd child &&
 		git push &&
-		! test -f .git/refs/remotes/origin/master
+		! test -f .git/refs/remotes/origin/main
 	)
 
 '
 
 test_expect_success 'push does not update local refs on failure' '
 
-	mk_test testrepo heads/master &&
+	mk_test testrepo heads/main &&
 	mk_child testrepo child &&
 	mkdir testrepo/.git/hooks &&
 	echo "#!/no/frobnication/today" >testrepo/.git/hooks/pre-receive &&
 	chmod +x testrepo/.git/hooks/pre-receive &&
 	(
 		cd child &&
-		git pull .. master &&
+		git pull .. main &&
 		test_must_fail git push &&
-		test $(git rev-parse master) != \
-			$(git rev-parse remotes/origin/master)
+		test $(git rev-parse main) != \
+			$(git rev-parse remotes/origin/main)
 	)
 
 '
 
 test_expect_success 'allow deleting an invalid remote ref' '
 
-	mk_test testrepo heads/master &&
+	mk_test testrepo heads/main &&
 	rm -f testrepo/.git/objects/??/* &&
-	git push testrepo :refs/heads/master &&
-	(cd testrepo && test_must_fail git rev-parse --verify refs/heads/master)
+	git push testrepo :refs/heads/main &&
+	(cd testrepo && test_must_fail git rev-parse --verify refs/heads/main)
 
 '
 
 test_expect_success 'pushing valid refs triggers post-receive and post-update hooks' '
-	mk_test_with_hooks testrepo heads/master heads/next &&
-	orgmaster=$(cd testrepo && git show-ref -s --verify refs/heads/master) &&
-	newmaster=$(git show-ref -s --verify refs/heads/master) &&
+	mk_test_with_hooks testrepo heads/main heads/next &&
+	orgmain=$(cd testrepo && git show-ref -s --verify refs/heads/main) &&
+	newmain=$(git show-ref -s --verify refs/heads/main) &&
 	orgnext=$(cd testrepo && git show-ref -s --verify refs/heads/next) &&
 	newnext=$ZERO_OID &&
-	git push testrepo refs/heads/master:refs/heads/master :refs/heads/next &&
+	git push testrepo refs/heads/main:refs/heads/main :refs/heads/next &&
 	(
 		cd testrepo/.git &&
 		cat >pre-receive.expect <<-EOF &&
-		$orgmaster $newmaster refs/heads/master
+		$orgmain $newmain refs/heads/main
 		$orgnext $newnext refs/heads/next
 		EOF
 
 		cat >update.expect <<-EOF &&
-		refs/heads/master $orgmaster $newmaster
+		refs/heads/main $orgmain $newmain
 		refs/heads/next $orgnext $newnext
 		EOF
 
 		cat >post-receive.expect <<-EOF &&
-		$orgmaster $newmaster refs/heads/master
+		$orgmain $newmain refs/heads/main
 		$orgnext $newnext refs/heads/next
 		EOF
 
 		cat >post-update.expect <<-EOF &&
-		refs/heads/master
+		refs/heads/main
 		refs/heads/next
 		EOF
 
@@ -669,25 +669,25 @@ test_expect_success 'pushing valid refs triggers post-receive and post-update ho
 '
 
 test_expect_success 'deleting dangling ref triggers hooks with correct args' '
-	mk_test_with_hooks testrepo heads/master &&
+	mk_test_with_hooks testrepo heads/main &&
 	rm -f testrepo/.git/objects/??/* &&
-	git push testrepo :refs/heads/master &&
+	git push testrepo :refs/heads/main &&
 	(
 		cd testrepo/.git &&
 		cat >pre-receive.expect <<-EOF &&
-		$ZERO_OID $ZERO_OID refs/heads/master
+		$ZERO_OID $ZERO_OID refs/heads/main
 		EOF
 
 		cat >update.expect <<-EOF &&
-		refs/heads/master $ZERO_OID $ZERO_OID
+		refs/heads/main $ZERO_OID $ZERO_OID
 		EOF
 
 		cat >post-receive.expect <<-EOF &&
-		$ZERO_OID $ZERO_OID refs/heads/master
+		$ZERO_OID $ZERO_OID refs/heads/main
 		EOF
 
 		cat >post-update.expect <<-EOF &&
-		refs/heads/master
+		refs/heads/main
 		EOF
 
 		test_cmp pre-receive.expect pre-receive.actual &&
@@ -698,28 +698,28 @@ test_expect_success 'deleting dangling ref triggers hooks with correct args' '
 '
 
 test_expect_success 'deletion of a non-existent ref is not fed to post-receive and post-update hooks' '
-	mk_test_with_hooks testrepo heads/master &&
-	orgmaster=$(cd testrepo && git show-ref -s --verify refs/heads/master) &&
-	newmaster=$(git show-ref -s --verify refs/heads/master) &&
-	git push testrepo master :refs/heads/nonexistent &&
+	mk_test_with_hooks testrepo heads/main &&
+	orgmain=$(cd testrepo && git show-ref -s --verify refs/heads/main) &&
+	newmain=$(git show-ref -s --verify refs/heads/main) &&
+	git push testrepo main :refs/heads/nonexistent &&
 	(
 		cd testrepo/.git &&
 		cat >pre-receive.expect <<-EOF &&
-		$orgmaster $newmaster refs/heads/master
+		$orgmain $newmain refs/heads/main
 		$ZERO_OID $ZERO_OID refs/heads/nonexistent
 		EOF
 
 		cat >update.expect <<-EOF &&
-		refs/heads/master $orgmaster $newmaster
+		refs/heads/main $orgmain $newmain
 		refs/heads/nonexistent $ZERO_OID $ZERO_OID
 		EOF
 
 		cat >post-receive.expect <<-EOF &&
-		$orgmaster $newmaster refs/heads/master
+		$orgmain $newmain refs/heads/main
 		EOF
 
 		cat >post-update.expect <<-EOF &&
-		refs/heads/master
+		refs/heads/main
 		EOF
 
 		test_cmp pre-receive.expect pre-receive.actual &&
@@ -730,7 +730,7 @@ test_expect_success 'deletion of a non-existent ref is not fed to post-receive a
 '
 
 test_expect_success 'deletion of a non-existent ref alone does trigger post-receive and post-update hooks' '
-	mk_test_with_hooks testrepo heads/master &&
+	mk_test_with_hooks testrepo heads/main &&
 	git push testrepo :refs/heads/nonexistent &&
 	(
 		cd testrepo/.git &&
@@ -750,40 +750,40 @@ test_expect_success 'deletion of a non-existent ref alone does trigger post-rece
 '
 
 test_expect_success 'mixed ref updates, deletes, invalid deletes trigger hooks with correct input' '
-	mk_test_with_hooks testrepo heads/master heads/next heads/seen &&
-	orgmaster=$(cd testrepo && git show-ref -s --verify refs/heads/master) &&
-	newmaster=$(git show-ref -s --verify refs/heads/master) &&
+	mk_test_with_hooks testrepo heads/main heads/next heads/seen &&
+	orgmain=$(cd testrepo && git show-ref -s --verify refs/heads/main) &&
+	newmain=$(git show-ref -s --verify refs/heads/main) &&
 	orgnext=$(cd testrepo && git show-ref -s --verify refs/heads/next) &&
 	newnext=$ZERO_OID &&
 	orgseen=$(cd testrepo && git show-ref -s --verify refs/heads/seen) &&
-	newseen=$(git show-ref -s --verify refs/heads/master) &&
-	git push testrepo refs/heads/master:refs/heads/master \
-	    refs/heads/master:refs/heads/seen :refs/heads/next \
+	newseen=$(git show-ref -s --verify refs/heads/main) &&
+	git push testrepo refs/heads/main:refs/heads/main \
+	    refs/heads/main:refs/heads/seen :refs/heads/next \
 	    :refs/heads/nonexistent &&
 	(
 		cd testrepo/.git &&
 		cat >pre-receive.expect <<-EOF &&
-		$orgmaster $newmaster refs/heads/master
+		$orgmain $newmain refs/heads/main
 		$orgnext $newnext refs/heads/next
 		$orgseen $newseen refs/heads/seen
 		$ZERO_OID $ZERO_OID refs/heads/nonexistent
 		EOF
 
 		cat >update.expect <<-EOF &&
-		refs/heads/master $orgmaster $newmaster
+		refs/heads/main $orgmain $newmain
 		refs/heads/next $orgnext $newnext
 		refs/heads/seen $orgseen $newseen
 		refs/heads/nonexistent $ZERO_OID $ZERO_OID
 		EOF
 
 		cat >post-receive.expect <<-EOF &&
-		$orgmaster $newmaster refs/heads/master
+		$orgmain $newmain refs/heads/main
 		$orgnext $newnext refs/heads/next
 		$orgseen $newseen refs/heads/seen
 		EOF
 
 		cat >post-update.expect <<-EOF &&
-		refs/heads/master
+		refs/heads/main
 		refs/heads/next
 		refs/heads/seen
 		EOF
@@ -796,15 +796,15 @@ test_expect_success 'mixed ref updates, deletes, invalid deletes trigger hooks w
 '
 
 test_expect_success 'allow deleting a ref using --delete' '
-	mk_test testrepo heads/master &&
+	mk_test testrepo heads/main &&
 	(cd testrepo && git config receive.denyDeleteCurrent warn) &&
-	git push testrepo --delete master &&
-	(cd testrepo && test_must_fail git rev-parse --verify refs/heads/master)
+	git push testrepo --delete main &&
+	(cd testrepo && test_must_fail git rev-parse --verify refs/heads/main)
 '
 
 test_expect_success 'allow deleting a tag using --delete' '
-	mk_test testrepo heads/master &&
-	git tag -a -m dummy_message deltag heads/master &&
+	mk_test testrepo heads/main &&
+	git tag -a -m dummy_message deltag heads/main &&
 	git push testrepo --tags &&
 	(cd testrepo && git rev-parse --verify -q refs/tags/deltag) &&
 	git push testrepo --delete tag deltag &&
@@ -812,56 +812,56 @@ test_expect_success 'allow deleting a tag using --delete' '
 '
 
 test_expect_success 'push --delete without args aborts' '
-	mk_test testrepo heads/master &&
+	mk_test testrepo heads/main &&
 	test_must_fail git push testrepo --delete
 '
 
 test_expect_success 'push --delete refuses src:dest refspecs' '
-	mk_test testrepo heads/master &&
-	test_must_fail git push testrepo --delete master:foo
+	mk_test testrepo heads/main &&
+	test_must_fail git push testrepo --delete main:foo
 '
 
 test_expect_success 'warn on push to HEAD of non-bare repository' '
-	mk_test testrepo heads/master &&
+	mk_test testrepo heads/main &&
 	(
 		cd testrepo &&
-		git checkout master &&
+		git checkout main &&
 		git config receive.denyCurrentBranch warn
 	) &&
-	git push testrepo master 2>stderr &&
+	git push testrepo main 2>stderr &&
 	grep "warning: updating the current branch" stderr
 '
 
 test_expect_success 'deny push to HEAD of non-bare repository' '
-	mk_test testrepo heads/master &&
+	mk_test testrepo heads/main &&
 	(
 		cd testrepo &&
-		git checkout master &&
+		git checkout main &&
 		git config receive.denyCurrentBranch true
 	) &&
-	test_must_fail git push testrepo master
+	test_must_fail git push testrepo main
 '
 
 test_expect_success 'allow push to HEAD of bare repository (bare)' '
-	mk_test testrepo heads/master &&
+	mk_test testrepo heads/main &&
 	(
 		cd testrepo &&
-		git checkout master &&
+		git checkout main &&
 		git config receive.denyCurrentBranch true &&
 		git config core.bare true
 	) &&
-	git push testrepo master 2>stderr &&
+	git push testrepo main 2>stderr &&
 	! grep "warning: updating the current branch" stderr
 '
 
 test_expect_success 'allow push to HEAD of non-bare repository (config)' '
-	mk_test testrepo heads/master &&
+	mk_test testrepo heads/main &&
 	(
 		cd testrepo &&
-		git checkout master &&
+		git checkout main &&
 		git config receive.denyCurrentBranch false
 	) &&
-	git push testrepo master 2>stderr &&
+	git push testrepo main 2>stderr &&
 	! grep "warning: updating the current branch" stderr
 '
 
@@ -877,7 +877,7 @@ test_expect_success 'fetch with branches' '
 		git for-each-ref refs/heads >actual &&
 		test_cmp expect actual
 	) &&
-	git checkout master
+	git checkout main
 '
 
 test_expect_success 'fetch with branches containing #' '
@@ -890,7 +890,7 @@ test_expect_success 'fetch with branches containing #' '
 		git for-each-ref refs/heads >actual &&
 		test_cmp expect actual
 	) &&
-	git checkout master
+	git checkout main
 '
 
 test_expect_success 'push with branches' '
@@ -900,7 +900,7 @@ test_expect_success 'push with branches' '
 	git push branch1 &&
 	(
 		cd testrepo &&
-		echo "$the_first_commit commit	refs/heads/master" >expect &&
+		echo "$the_first_commit commit	refs/heads/main" >expect &&
 		git for-each-ref refs/heads >actual &&
 		test_cmp expect actual
 	)
@@ -916,11 +916,11 @@ test_expect_success 'push with branches containing #' '
 		git for-each-ref refs/heads >actual &&
 		test_cmp expect actual
 	) &&
-	git checkout master
+	git checkout main
 '
 
 test_expect_success 'push into aliased refs (consistent)' '
-	mk_test testrepo heads/master &&
+	mk_test testrepo heads/main &&
 	mk_child testrepo child1 &&
 	mk_child testrepo child2 &&
 	(
@@ -942,7 +942,7 @@ test_expect_success 'push into aliased refs (consistent)' '
 '
 
 test_expect_success 'push into aliased refs (inconsistent)' '
-	mk_test testrepo heads/master &&
+	mk_test testrepo heads/main &&
 	mk_child testrepo child1 &&
 	mk_child testrepo child2 &&
 	(
@@ -973,7 +973,7 @@ test_force_push_tag () {
 	tag_args=$2
 
 	test_expect_success "force pushing required to update $tag_type_description" "
-		mk_test testrepo heads/master &&
+		mk_test testrepo heads/main &&
 		mk_child testrepo child1 &&
 		mk_child testrepo child2 &&
 		(
@@ -1019,7 +1019,7 @@ test_force_fetch_tag () {
 	tag_args=$2
 
 	test_expect_success "fetch will not clobber an existing $tag_type_description without --force" "
-		mk_test testrepo heads/master &&
+		mk_test testrepo heads/main &&
 		mk_child testrepo child1 &&
 		mk_child testrepo child2 &&
 		(
@@ -1042,12 +1042,12 @@ test_force_fetch_tag "annotated tag" "-f -a -m'tag message'"
 test_expect_success 'push --porcelain' '
 	mk_empty testrepo &&
 	echo >.git/foo  "To testrepo" &&
-	echo >>.git/foo "*	refs/heads/master:refs/remotes/origin/master	[new reference]"  &&
+	echo >>.git/foo "*	refs/heads/main:refs/remotes/origin/main	[new reference]"  &&
 	echo >>.git/foo "Done" &&
-	git push >.git/bar --porcelain  testrepo refs/heads/master:refs/remotes/origin/master &&
+	git push >.git/bar --porcelain  testrepo refs/heads/main:refs/remotes/origin/main &&
 	(
 		cd testrepo &&
-		echo "$the_commit commit	refs/remotes/origin/master" >expect &&
+		echo "$the_commit commit	refs/remotes/origin/main" >expect &&
 		git for-each-ref refs/remotes/origin >actual &&
 		test_cmp expect actual
 	) &&
@@ -1056,52 +1056,52 @@ test_expect_success 'push --porcelain' '
 
 test_expect_success 'push --porcelain bad url' '
 	mk_empty testrepo &&
-	test_must_fail git push >.git/bar --porcelain asdfasdfasd refs/heads/master:refs/remotes/origin/master &&
+	test_must_fail git push >.git/bar --porcelain asdfasdfasd refs/heads/main:refs/remotes/origin/main &&
 	! grep -q Done .git/bar
 '
 
 test_expect_success 'push --porcelain rejected' '
 	mk_empty testrepo &&
-	git push testrepo refs/heads/master:refs/remotes/origin/master &&
+	git push testrepo refs/heads/main:refs/remotes/origin/main &&
 	(cd testrepo &&
-		git reset --hard origin/master^ &&
+		git reset --hard origin/main^ &&
 		git config receive.denyCurrentBranch true) &&
 
 	echo >.git/foo  "To testrepo"  &&
-	echo >>.git/foo "!	refs/heads/master:refs/heads/master	[remote rejected] (branch is currently checked out)" &&
+	echo >>.git/foo "!	refs/heads/main:refs/heads/main	[remote rejected] (branch is currently checked out)" &&
 	echo >>.git/foo "Done" &&
 
-	test_must_fail git push >.git/bar --porcelain  testrepo refs/heads/master:refs/heads/master &&
+	test_must_fail git push >.git/bar --porcelain  testrepo refs/heads/main:refs/heads/main &&
 	test_cmp .git/foo .git/bar
 '
 
 test_expect_success 'push --porcelain --dry-run rejected' '
 	mk_empty testrepo &&
-	git push testrepo refs/heads/master:refs/remotes/origin/master &&
+	git push testrepo refs/heads/main:refs/remotes/origin/main &&
 	(cd testrepo &&
-		git reset --hard origin/master &&
+		git reset --hard origin/main &&
 		git config receive.denyCurrentBranch true) &&
 
 	echo >.git/foo  "To testrepo"  &&
-	echo >>.git/foo "!	refs/heads/master^:refs/heads/master	[rejected] (non-fast-forward)" &&
+	echo >>.git/foo "!	refs/heads/main^:refs/heads/main	[rejected] (non-fast-forward)" &&
 	echo >>.git/foo "Done" &&
 
-	test_must_fail git push >.git/bar --porcelain  --dry-run testrepo refs/heads/master^:refs/heads/master &&
+	test_must_fail git push >.git/bar --porcelain  --dry-run testrepo refs/heads/main^:refs/heads/main &&
 	test_cmp .git/foo .git/bar
 '
 
 test_expect_success 'push --prune' '
-	mk_test testrepo heads/master heads/second heads/foo heads/bar &&
+	mk_test testrepo heads/main heads/second heads/foo heads/bar &&
 	git push --prune testrepo : &&
-	check_push_result testrepo $the_commit heads/master &&
+	check_push_result testrepo $the_commit heads/main &&
 	check_push_result testrepo $the_first_commit heads/second &&
 	! check_push_result testrepo $the_first_commit heads/foo heads/bar
 '
 
 test_expect_success 'push --prune refspec' '
-	mk_test testrepo tmp/master tmp/second tmp/foo tmp/bar &&
+	mk_test testrepo tmp/main tmp/second tmp/foo tmp/bar &&
 	git push --prune testrepo "refs/heads/*:refs/tmp/*" &&
-	check_push_result testrepo $the_commit tmp/master &&
+	check_push_result testrepo $the_commit tmp/main &&
 	check_push_result testrepo $the_first_commit tmp/second &&
 	! check_push_result testrepo $the_first_commit tmp/foo tmp/bar
 '
@@ -1109,18 +1109,18 @@ test_expect_success 'push --prune refspec' '
 for configsection in transfer receive
 do
 	test_expect_success "push to update a ref hidden by $configsection.hiderefs" '
-		mk_test testrepo heads/master hidden/one hidden/two hidden/three &&
+		mk_test testrepo heads/main hidden/one hidden/two hidden/three &&
 		(
 			cd testrepo &&
 			git config $configsection.hiderefs refs/hidden
 		) &&
 
 		# push to unhidden ref succeeds normally
-		git push testrepo master:refs/heads/master &&
-		check_push_result testrepo $the_commit heads/master &&
+		git push testrepo main:refs/heads/main &&
+		check_push_result testrepo $the_commit heads/main &&
 
 		# push to update a hidden ref should fail
-		test_must_fail git push testrepo master:refs/hidden/one &&
+		test_must_fail git push testrepo main:refs/hidden/one &&
 		check_push_result testrepo $the_first_commit hidden/one &&
 
 		# push to delete a hidden ref should fail
@@ -1134,8 +1134,8 @@ do
 done
 
 test_expect_success 'fetch exact SHA1' '
-	mk_test testrepo heads/master hidden/one &&
-	git push testrepo master:refs/hidden/one &&
+	mk_test testrepo heads/main hidden/one &&
+	git push testrepo main:refs/hidden/one &&
 	(
 		cd testrepo &&
 		git config transfer.hiderefs refs/hidden
@@ -1166,7 +1166,7 @@ test_expect_success 'fetch exact SHA1' '
 			git config uploadpack.allowtipsha1inwant true
 		) &&
 
-		git fetch -v ../testrepo $the_commit:refs/heads/copy master:refs/heads/extra &&
+		git fetch -v ../testrepo $the_commit:refs/heads/copy main:refs/heads/extra &&
 		cat >expect <<-EOF &&
 		$the_commit
 		$the_first_commit
@@ -1180,8 +1180,8 @@ test_expect_success 'fetch exact SHA1' '
 '
 
 test_expect_success 'fetch exact SHA1 in protocol v2' '
-	mk_test testrepo heads/master hidden/one &&
-	git push testrepo master:refs/hidden/one &&
+	mk_test testrepo heads/main hidden/one &&
+	git push testrepo main:refs/hidden/one &&
 	git -C testrepo config transfer.hiderefs refs/hidden &&
 	check_push_result testrepo $the_commit hidden/one &&
 
@@ -1263,17 +1263,17 @@ do
 done
 
 test_expect_success 'fetch follows tags by default' '
-	mk_test testrepo heads/master &&
+	mk_test testrepo heads/main &&
 	rm -fr src dst &&
 	git init src &&
 	(
 		cd src &&
-		git pull ../testrepo master &&
+		git pull ../testrepo main &&
 		git tag -m "annotated" tag &&
 		git for-each-ref >tmp1 &&
 		(
 			cat tmp1
-			sed -n "s|refs/heads/master$|refs/remotes/origin/master|p" tmp1
+			sed -n "s|refs/heads/main$|refs/remotes/origin/main|p" tmp1
 		) |
 		sort -k 3 >../expect
 	) &&
@@ -1281,8 +1281,8 @@ test_expect_success 'fetch follows tags by default' '
 	(
 		cd dst &&
 		git remote add origin ../src &&
-		git config branch.master.remote origin &&
-		git config branch.master.merge refs/heads/master &&
+		git config branch.main.remote origin &&
+		git config branch.main.merge refs/heads/main &&
 		git pull &&
 		git for-each-ref >../actual
 	) &&
@@ -1301,74 +1301,74 @@ test_expect_success 'peeled advertisements are not considered ref tips' '
 '
 
 test_expect_success 'pushing a specific ref applies remote.$name.push as refmap' '
-	mk_test testrepo heads/master &&
+	mk_test testrepo heads/main &&
 	rm -fr src dst &&
 	git init src &&
 	git init --bare dst &&
 	(
 		cd src &&
-		git pull ../testrepo master &&
+		git pull ../testrepo main &&
 		git branch next &&
 		git config remote.dst.url ../dst &&
 		git config remote.dst.push "+refs/heads/*:refs/remotes/src/*" &&
-		git push dst master &&
-		git show-ref refs/heads/master |
+		git push dst main &&
+		git show-ref refs/heads/main |
 		sed -e "s|refs/heads/|refs/remotes/src/|" >../dst/expect
 	) &&
 	(
 		cd dst &&
 		test_must_fail git show-ref refs/heads/next &&
-		test_must_fail git show-ref refs/heads/master &&
-		git show-ref refs/remotes/src/master >actual
+		test_must_fail git show-ref refs/heads/main &&
+		git show-ref refs/remotes/src/main >actual
 	) &&
 	test_cmp dst/expect dst/actual
 '
 
 test_expect_success 'with no remote.$name.push, it is not used as refmap' '
-	mk_test testrepo heads/master &&
+	mk_test testrepo heads/main &&
 	rm -fr src dst &&
 	git init src &&
 	git init --bare dst &&
 	(
 		cd src &&
-		git pull ../testrepo master &&
+		git pull ../testrepo main &&
 		git branch next &&
 		git config remote.dst.url ../dst &&
 		git config push.default matching &&
-		git push dst master &&
-		git show-ref refs/heads/master >../dst/expect
+		git push dst main &&
+		git show-ref refs/heads/main >../dst/expect
 	) &&
 	(
 		cd dst &&
 		test_must_fail git show-ref refs/heads/next &&
-		git show-ref refs/heads/master >actual
+		git show-ref refs/heads/main >actual
 	) &&
 	test_cmp dst/expect dst/actual
 '
 
 test_expect_success 'with no remote.$name.push, upstream mapping is used' '
-	mk_test testrepo heads/master &&
+	mk_test testrepo heads/main &&
 	rm -fr src dst &&
 	git init src &&
 	git init --bare dst &&
 	(
 		cd src &&
-		git pull ../testrepo master &&
+		git pull ../testrepo main &&
 		git branch next &&
 		git config remote.dst.url ../dst &&
 		git config remote.dst.fetch "+refs/heads/*:refs/remotes/dst/*" &&
 		git config push.default upstream &&
 
-		git config branch.master.merge refs/heads/trunk &&
-		git config branch.master.remote dst &&
+		git config branch.main.merge refs/heads/trunk &&
+		git config branch.main.remote dst &&
 
-		git push dst master &&
-		git show-ref refs/heads/master |
-		sed -e "s|refs/heads/master|refs/heads/trunk|" >../dst/expect
+		git push dst main &&
+		git show-ref refs/heads/main |
+		sed -e "s|refs/heads/main|refs/heads/trunk|" >../dst/expect
 	) &&
 	(
 		cd dst &&
-		test_must_fail git show-ref refs/heads/master &&
+		test_must_fail git show-ref refs/heads/main &&
 		test_must_fail git show-ref refs/heads/next &&
 		git show-ref refs/heads/trunk >actual
 	) &&
@@ -1376,20 +1376,20 @@ test_expect_success 'with no remote.$name.push, upstream mapping is used' '
 '
 
 test_expect_success 'push does not follow tags by default' '
-	mk_test testrepo heads/master &&
+	mk_test testrepo heads/main &&
 	rm -fr src dst &&
 	git init src &&
 	git init --bare dst &&
 	(
 		cd src &&
-		git pull ../testrepo master &&
+		git pull ../testrepo main &&
 		git tag -m "annotated" tag &&
 		git checkout -b another &&
 		git commit --allow-empty -m "future commit" &&
 		git tag -m "future" future &&
-		git checkout master &&
-		git for-each-ref refs/heads/master >../expect &&
-		git push ../dst master
+		git checkout main &&
+		git for-each-ref refs/heads/main >../expect &&
+		git push ../dst main
 	) &&
 	(
 		cd dst &&
@@ -1399,20 +1399,20 @@ test_expect_success 'push does not follow tags by default' '
 '
 
 test_expect_success 'push --follow-tags only pushes relevant tags' '
-	mk_test testrepo heads/master &&
+	mk_test testrepo heads/main &&
 	rm -fr src dst &&
 	git init src &&
 	git init --bare dst &&
 	(
 		cd src &&
-		git pull ../testrepo master &&
+		git pull ../testrepo main &&
 		git tag -m "annotated" tag &&
 		git checkout -b another &&
 		git commit --allow-empty -m "future commit" &&
 		git tag -m "future" future &&
-		git checkout master &&
-		git for-each-ref refs/heads/master refs/tags/tag >../expect &&
-		git push --follow-tags ../dst master
+		git checkout main &&
+		git for-each-ref refs/heads/main refs/tags/tag >../expect &&
+		git push --follow-tags ../dst main
 	) &&
 	(
 		cd dst &&
@@ -1430,12 +1430,12 @@ EOF
 	git commit -am initial &&
 	git init no-thin &&
 	git --git-dir=no-thin/.git config receive.unpacklimit 0 &&
-	git push no-thin/.git refs/heads/master:refs/heads/foo &&
+	git push no-thin/.git refs/heads/main:refs/heads/foo &&
 	echo modified >> path1 &&
 	git commit -am modified &&
 	git repack -adf &&
 	rcvpck="git receive-pack --reject-thin-pack-for-testing" &&
-	git push --no-thin --receive-pack="$rcvpck" no-thin/.git refs/heads/master:refs/heads/foo
+	git push --no-thin --receive-pack="$rcvpck" no-thin/.git refs/heads/main:refs/heads/foo
 '
 
 test_expect_success 'pushing a tag pushes the tagged object' '
@@ -1458,12 +1458,12 @@ test_expect_success 'push into bare respects core.logallrefupdates' '
 
 	# double push to test both with and without
 	# the actual pack transfer
-	git push dst.git master:one &&
+	git push dst.git main:one &&
 	echo "one@{0} push" >expect &&
 	git -C dst.git log -g --format="%gd %gs" one >actual &&
 	test_cmp expect actual &&
 
-	git push dst.git master:two &&
+	git push dst.git main:two &&
 	echo "two@{0} push" >expect &&
 	git -C dst.git log -g --format="%gd %gs" two >actual &&
 	test_cmp expect actual
@@ -1478,20 +1478,20 @@ test_expect_success 'fetch into bare respects core.logallrefupdates' '
 
 		# as above, we double-fetch to test both
 		# with and without pack transfer
-		git fetch .. master:one &&
-		echo "one@{0} fetch .. master:one: storing head" >expect &&
+		git fetch .. main:one &&
+		echo "one@{0} fetch .. main:one: storing head" >expect &&
 		git log -g --format="%gd %gs" one >actual &&
 		test_cmp expect actual &&
 
-		git fetch .. master:two &&
-		echo "two@{0} fetch .. master:two: storing head" >expect &&
+		git fetch .. main:two &&
+		echo "two@{0} fetch .. main:two: storing head" >expect &&
 		git log -g --format="%gd %gs" two >actual &&
 		test_cmp expect actual
 	)
 '
 
 test_expect_success 'receive.denyCurrentBranch = updateInstead' '
-	git push testrepo master &&
+	git push testrepo main &&
 	(
 		cd testrepo &&
 		git reset --hard &&
@@ -1500,7 +1500,7 @@ test_expect_success 'receive.denyCurrentBranch = updateInstead' '
 	test_commit third path2 &&
 
 	# Try pushing into a repository with pristine working tree
-	git push testrepo master &&
+	git push testrepo main &&
 	(
 		cd testrepo &&
 		git update-index -q --refresh &&
@@ -1517,7 +1517,7 @@ test_expect_success 'receive.denyCurrentBranch = updateInstead' '
 		test $(git -C .. rev-parse HEAD^) = $(git rev-parse HEAD) &&
 		test-tool chmtime +100 path1
 	) &&
-	git push testrepo master &&
+	git push testrepo main &&
 	(
 		cd testrepo &&
 		git update-index -q --refresh &&
@@ -1537,7 +1537,7 @@ test_expect_success 'receive.denyCurrentBranch = updateInstead' '
 		cd testrepo &&
 		echo changed >path1
 	) &&
-	test_must_fail git push testrepo master &&
+	test_must_fail git push testrepo main &&
 	(
 		cd testrepo &&
 		test $(git -C .. rev-parse HEAD^) = $(git rev-parse HEAD) &&
@@ -1551,7 +1551,7 @@ test_expect_success 'receive.denyCurrentBranch = updateInstead' '
 		echo changed >path1 &&
 		git add path1
 	) &&
-	test_must_fail git push testrepo master &&
+	test_must_fail git push testrepo main &&
 	(
 		cd testrepo &&
 		test $(git -C .. rev-parse HEAD^) = $(git rev-parse HEAD) &&
@@ -1568,7 +1568,7 @@ test_expect_success 'receive.denyCurrentBranch = updateInstead' '
 		git reset --hard &&
 		echo changed >path3
 	) &&
-	test_must_fail git push testrepo master &&
+	test_must_fail git push testrepo main &&
 	(
 		cd testrepo &&
 		test $(git -C .. rev-parse HEAD^^) = $(git rev-parse HEAD) &&
@@ -1584,7 +1584,7 @@ test_expect_success 'receive.denyCurrentBranch = updateInstead' '
 		echo fifth >path3 &&
 		git add path3
 	) &&
-	test_must_fail git push testrepo master &&
+	test_must_fail git push testrepo main &&
 	(
 		cd testrepo &&
 		test $(git -C .. rev-parse HEAD^^) = $(git rev-parse HEAD) &&
@@ -1599,17 +1599,17 @@ test_expect_success 'receive.denyCurrentBranch = updateInstead' '
 		cd void &&
 		git config receive.denyCurrentBranch updateInstead
 	) &&
-	git push void master &&
+	git push void main &&
 	(
 		cd void &&
-		test $(git -C .. rev-parse master) = $(git rev-parse HEAD) &&
+		test $(git -C .. rev-parse main) = $(git rev-parse HEAD) &&
 		git diff --quiet &&
 		git diff --cached --quiet
 	) &&
 
 	# (6) updateInstead intervened by fast-forward check
-	test_must_fail git push void master^:master &&
-	test $(git -C void rev-parse HEAD) = $(git rev-parse master) &&
+	test_must_fail git push void main^:main &&
+	test $(git -C void rev-parse HEAD) = $(git rev-parse main) &&
 	git -C void diff --quiet &&
 	git -C void diff --cached --quiet
 '
@@ -1619,7 +1619,7 @@ test_expect_success 'updateInstead with push-to-checkout hook' '
 	git init testrepo &&
 	(
 		cd testrepo &&
-		git pull .. master &&
+		git pull .. main &&
 		git reset --hard HEAD^^ &&
 		git tag initial &&
 		git config receive.denyCurrentBranch updateInstead &&
@@ -1637,7 +1637,7 @@ test_expect_success 'updateInstead with push-to-checkout hook' '
 	) &&
 
 	# Try pushing into a pristine
-	git push testrepo master &&
+	git push testrepo main &&
 	(
 		cd testrepo &&
 		git diff --quiet &&
@@ -1651,7 +1651,7 @@ test_expect_success 'updateInstead with push-to-checkout hook' '
 		git reset --hard initial &&
 		echo conflicting >path2
 	) &&
-	test_must_fail git push testrepo master &&
+	test_must_fail git push testrepo main &&
 	(
 		cd testrepo &&
 		test $(git rev-parse initial) = $(git rev-parse HEAD) &&
@@ -1667,7 +1667,7 @@ test_expect_success 'updateInstead with push-to-checkout hook' '
 		echo irrelevant >path5 &&
 		git add path5
 	) &&
-	git push testrepo master &&
+	git push testrepo main &&
 	(
 		cd testrepo &&
 		test "$(cat path1)" = unrelated &&
@@ -1707,7 +1707,7 @@ test_expect_success 'updateInstead with push-to-checkout hook' '
 		EOF
 	) &&
 
-	git push void master &&
+	git push void main &&
 	(
 		cd void &&
 		git diff --quiet &&
diff --git a/t/t5517-push-mirror.sh b/t/t5517-push-mirror.sh
index aa6405b452..a448e169bd 100755
--- a/t/t5517-push-mirror.sh
+++ b/t/t5517-push-mirror.sh
@@ -2,7 +2,7 @@
 
 test_description='pushing to a mirror repository'
 
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -18,16 +18,16 @@ invert () {
 }
 
 mk_repo_pair () {
-	rm -rf master mirror &&
+	rm -rf main mirror &&
 	mkdir mirror &&
 	(
 		cd mirror &&
 		git init &&
 		git config receive.denyCurrentBranch warn
 	) &&
-	mkdir master &&
+	mkdir main &&
 	(
-		cd master &&
+		cd main &&
 		git init &&
 		git remote add $1 up ../mirror
 	)
@@ -39,13 +39,13 @@ test_expect_success 'push mirror creates new branches' '
 
 	mk_repo_pair &&
 	(
-		cd master &&
+		cd main &&
 		echo one >foo && git add foo && git commit -m one &&
 		git push --mirror up
 	) &&
-	master_master=$(cd master && git show-ref -s --verify refs/heads/master) &&
-	mirror_master=$(cd mirror && git show-ref -s --verify refs/heads/master) &&
-	test "$master_master" = "$mirror_master"
+	main_main=$(cd main && git show-ref -s --verify refs/heads/main) &&
+	mirror_main=$(cd mirror && git show-ref -s --verify refs/heads/main) &&
+	test "$main_main" = "$mirror_main"
 
 '
 
@@ -53,15 +53,15 @@ test_expect_success 'push mirror updates existing branches' '
 
 	mk_repo_pair &&
 	(
-		cd master &&
+		cd main &&
 		echo one >foo && git add foo && git commit -m one &&
 		git push --mirror up &&
 		echo two >foo && git add foo && git commit -m two &&
 		git push --mirror up
 	) &&
-	master_master=$(cd master && git show-ref -s --verify refs/heads/master) &&
-	mirror_master=$(cd mirror && git show-ref -s --verify refs/heads/master) &&
-	test "$master_master" = "$mirror_master"
+	main_main=$(cd main && git show-ref -s --verify refs/heads/main) &&
+	mirror_main=$(cd mirror && git show-ref -s --verify refs/heads/main) &&
+	test "$main_main" = "$mirror_main"
 
 '
 
@@ -69,7 +69,7 @@ test_expect_success 'push mirror force updates existing branches' '
 
 	mk_repo_pair &&
 	(
-		cd master &&
+		cd main &&
 		echo one >foo && git add foo && git commit -m one &&
 		git push --mirror up &&
 		echo two >foo && git add foo && git commit -m two &&
@@ -77,9 +77,9 @@ test_expect_success 'push mirror force updates existing branches' '
 		git reset --hard HEAD^ &&
 		git push --mirror up
 	) &&
-	master_master=$(cd master && git show-ref -s --verify refs/heads/master) &&
-	mirror_master=$(cd mirror && git show-ref -s --verify refs/heads/master) &&
-	test "$master_master" = "$mirror_master"
+	main_main=$(cd main && git show-ref -s --verify refs/heads/main) &&
+	mirror_main=$(cd mirror && git show-ref -s --verify refs/heads/main) &&
+	test "$main_main" = "$mirror_main"
 
 '
 
@@ -87,9 +87,9 @@ test_expect_success 'push mirror removes branches' '
 
 	mk_repo_pair &&
 	(
-		cd master &&
+		cd main &&
 		echo one >foo && git add foo && git commit -m one &&
-		git branch remove master &&
+		git branch remove main &&
 		git push --mirror up &&
 		git branch -D remove &&
 		git push --mirror up
@@ -105,21 +105,21 @@ test_expect_success 'push mirror adds, updates and removes branches together' '
 
 	mk_repo_pair &&
 	(
-		cd master &&
+		cd main &&
 		echo one >foo && git add foo && git commit -m one &&
-		git branch remove master &&
+		git branch remove main &&
 		git push --mirror up &&
 		git branch -D remove &&
-		git branch add master &&
+		git branch add main &&
 		echo two >foo && git add foo && git commit -m two &&
 		git push --mirror up
 	) &&
-	master_master=$(cd master && git show-ref -s --verify refs/heads/master) &&
-	master_add=$(cd master && git show-ref -s --verify refs/heads/add) &&
-	mirror_master=$(cd mirror && git show-ref -s --verify refs/heads/master) &&
+	main_main=$(cd main && git show-ref -s --verify refs/heads/main) &&
+	main_add=$(cd main && git show-ref -s --verify refs/heads/add) &&
+	mirror_main=$(cd mirror && git show-ref -s --verify refs/heads/main) &&
 	mirror_add=$(cd mirror && git show-ref -s --verify refs/heads/add) &&
-	test "$master_master" = "$mirror_master" &&
-	test "$master_add" = "$mirror_add" &&
+	test "$main_main" = "$mirror_main" &&
+	test "$main_add" = "$mirror_add" &&
 	(
 		cd mirror &&
 		invert git show-ref -s --verify refs/heads/remove
@@ -133,14 +133,14 @@ test_expect_success 'push mirror creates new tags' '
 
 	mk_repo_pair &&
 	(
-		cd master &&
+		cd main &&
 		echo one >foo && git add foo && git commit -m one &&
-		git tag -f tmaster master &&
+		git tag -f tmain main &&
 		git push --mirror up
 	) &&
-	master_master=$(cd master && git show-ref -s --verify refs/tags/tmaster) &&
-	mirror_master=$(cd mirror && git show-ref -s --verify refs/tags/tmaster) &&
-	test "$master_master" = "$mirror_master"
+	main_main=$(cd main && git show-ref -s --verify refs/tags/tmain) &&
+	mirror_main=$(cd mirror && git show-ref -s --verify refs/tags/tmain) &&
+	test "$main_main" = "$mirror_main"
 
 '
 
@@ -148,17 +148,17 @@ test_expect_success 'push mirror updates existing tags' '
 
 	mk_repo_pair &&
 	(
-		cd master &&
+		cd main &&
 		echo one >foo && git add foo && git commit -m one &&
-		git tag -f tmaster master &&
+		git tag -f tmain main &&
 		git push --mirror up &&
 		echo two >foo && git add foo && git commit -m two &&
-		git tag -f tmaster master &&
+		git tag -f tmain main &&
 		git push --mirror up
 	) &&
-	master_master=$(cd master && git show-ref -s --verify refs/tags/tmaster) &&
-	mirror_master=$(cd mirror && git show-ref -s --verify refs/tags/tmaster) &&
-	test "$master_master" = "$mirror_master"
+	main_main=$(cd main && git show-ref -s --verify refs/tags/tmain) &&
+	mirror_main=$(cd mirror && git show-ref -s --verify refs/tags/tmain) &&
+	test "$main_main" = "$mirror_main"
 
 '
 
@@ -166,20 +166,20 @@ test_expect_success 'push mirror force updates existing tags' '
 
 	mk_repo_pair &&
 	(
-		cd master &&
+		cd main &&
 		echo one >foo && git add foo && git commit -m one &&
-		git tag -f tmaster master &&
+		git tag -f tmain main &&
 		git push --mirror up &&
 		echo two >foo && git add foo && git commit -m two &&
-		git tag -f tmaster master &&
+		git tag -f tmain main &&
 		git push --mirror up &&
 		git reset --hard HEAD^ &&
-		git tag -f tmaster master &&
+		git tag -f tmain main &&
 		git push --mirror up
 	) &&
-	master_master=$(cd master && git show-ref -s --verify refs/tags/tmaster) &&
-	mirror_master=$(cd mirror && git show-ref -s --verify refs/tags/tmaster) &&
-	test "$master_master" = "$mirror_master"
+	main_main=$(cd main && git show-ref -s --verify refs/tags/tmain) &&
+	mirror_main=$(cd mirror && git show-ref -s --verify refs/tags/tmain) &&
+	test "$main_main" = "$mirror_main"
 
 '
 
@@ -187,9 +187,9 @@ test_expect_success 'push mirror removes tags' '
 
 	mk_repo_pair &&
 	(
-		cd master &&
+		cd main &&
 		echo one >foo && git add foo && git commit -m one &&
-		git tag -f tremove master &&
+		git tag -f tremove main &&
 		git push --mirror up &&
 		git tag -d tremove &&
 		git push --mirror up
@@ -205,23 +205,23 @@ test_expect_success 'push mirror adds, updates and removes tags together' '
 
 	mk_repo_pair &&
 	(
-		cd master &&
+		cd main &&
 		echo one >foo && git add foo && git commit -m one &&
-		git tag -f tmaster master &&
-		git tag -f tremove master &&
+		git tag -f tmain main &&
+		git tag -f tremove main &&
 		git push --mirror up &&
 		git tag -d tremove &&
-		git tag tadd master &&
+		git tag tadd main &&
 		echo two >foo && git add foo && git commit -m two &&
-		git tag -f tmaster master &&
+		git tag -f tmain main &&
 		git push --mirror up
 	) &&
-	master_master=$(cd master && git show-ref -s --verify refs/tags/tmaster) &&
-	master_add=$(cd master && git show-ref -s --verify refs/tags/tadd) &&
-	mirror_master=$(cd mirror && git show-ref -s --verify refs/tags/tmaster) &&
+	main_main=$(cd main && git show-ref -s --verify refs/tags/tmain) &&
+	main_add=$(cd main && git show-ref -s --verify refs/tags/tadd) &&
+	mirror_main=$(cd mirror && git show-ref -s --verify refs/tags/tmain) &&
 	mirror_add=$(cd mirror && git show-ref -s --verify refs/tags/tadd) &&
-	test "$master_master" = "$mirror_master" &&
-	test "$master_add" = "$mirror_add" &&
+	test "$main_main" = "$mirror_main" &&
+	test "$main_add" = "$mirror_add" &&
 	(
 		cd mirror &&
 		invert git show-ref -s --verify refs/tags/tremove
@@ -233,10 +233,10 @@ test_expect_success 'remote.foo.mirror adds and removes branches' '
 
 	mk_repo_pair --mirror &&
 	(
-		cd master &&
+		cd main &&
 		echo one >foo && git add foo && git commit -m one &&
-		git branch keep master &&
-		git branch remove master &&
+		git branch keep main &&
+		git branch remove main &&
 		git push up &&
 		git branch -D remove &&
 		git push up
@@ -253,10 +253,10 @@ test_expect_success 'remote.foo.mirror=no has no effect' '
 
 	mk_repo_pair &&
 	(
-		cd master &&
+		cd main &&
 		echo one >foo && git add foo && git commit -m one &&
 		git config --add remote.up.mirror no &&
-		git branch keep master &&
+		git branch keep main &&
 		git push --mirror up &&
 		git branch -D keep &&
 		git push up :
@@ -271,10 +271,10 @@ test_expect_success 'remote.foo.mirror=no has no effect' '
 test_expect_success 'push to mirrored repository with refspec fails' '
 	mk_repo_pair &&
 	(
-		cd master &&
+		cd main &&
 		echo one >foo && git add foo && git commit -m one &&
 		git config --add remote.up.mirror true &&
-		test_must_fail git push up master
+		test_must_fail git push up main
 	)
 '
 
diff --git a/t/t5518-fetch-exit-status.sh b/t/t5518-fetch-exit-status.sh
index a94d0744d0..5c4ac2556e 100755
--- a/t/t5518-fetch-exit-status.sh
+++ b/t/t5518-fetch-exit-status.sh
@@ -5,7 +5,7 @@
 
 test_description='fetch exit status test'
 
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -20,20 +20,20 @@ test_expect_success setup '
 	echo side >file &&
 	git commit -a -m side &&
 
-	git checkout master &&
+	git checkout main &&
 	echo next >file &&
 	git commit -a -m next
 '
 
 test_expect_success 'non-fast-forward fetch' '
 
-	test_must_fail git fetch . master:side
+	test_must_fail git fetch . main:side
 
 '
 
 test_expect_success 'forced update' '
 
-	git fetch . +master:side
+	git fetch . +main:side
 
 '
 
diff --git a/t/t5519-push-alternates.sh b/t/t5519-push-alternates.sh
index 0f199d0ccb..20ba604dfd 100755
--- a/t/t5519-push-alternates.sh
+++ b/t/t5519-push-alternates.sh
@@ -2,7 +2,7 @@
 
 test_description='push to a repository that borrows from elsewhere'
 
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -20,7 +20,7 @@ test_expect_success setup '
 		>file &&
 		git add . &&
 		git commit -m initial &&
-		git push ../alice-pub master
+		git push ../alice-pub main
 	) &&
 
 	# Project Bob is a fork of project Alice
@@ -34,7 +34,7 @@ test_expect_success setup '
 	git clone alice-pub bob-work &&
 	(
 		cd bob-work &&
-		git push ../bob-pub master
+		git push ../bob-pub main
 	)
 '
 
@@ -57,7 +57,7 @@ test_expect_success 'bob fetches from alice, works and pushes' '
 		# has at her public repository are available to it
 		# via its alternates.
 		cd bob-work &&
-		git pull ../alice-pub master &&
+		git pull ../alice-pub main &&
 		echo more bob >file &&
 		git commit -a -m third &&
 		git push ../bob-pub :
@@ -96,7 +96,7 @@ test_expect_success 'alice works and pushes again' '
 test_expect_success 'bob works and pushes' '
 	(
 		# This time Bob does not pull from Alice, and
-		# the master branch at her public repository points
+		# the main branch at her public repository points
 		# at a commit Bob does not know about.  This should
 		# not prevent the push by Bob from succeeding.
 		cd bob-work &&
@@ -125,11 +125,11 @@ test_expect_success 'alice works and pushes yet again' '
 test_expect_success 'bob works and pushes again' '
 	(
 		cd alice-pub &&
-		git cat-file commit master >../bob-work/commit
+		git cat-file commit main >../bob-work/commit
 	) &&
 	(
 		# This time Bob does not pull from Alice, and
-		# the master branch at her public repository points
+		# the main branch at her public repository points
 		# at a commit Bob does not fully know about, but
 		# he happens to have the commit object (but not the
 		# necessary tree) in his repository from Alice.
-- 
gitgitgadget


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH v3 15/28] t55[23]*: adjust the references to the default branch name "main"
  2020-11-18 23:44   ` [PATCH v3 00/28] tests: use main as default branch name Johannes Schindelin via GitGitGadget
                       ` (13 preceding siblings ...)
  2020-11-18 23:44     ` [PATCH v3 14/28] t551*: " Johannes Schindelin via GitGitGadget
@ 2020-11-18 23:44     ` Johannes Schindelin via GitGitGadget
  2020-11-18 23:44     ` [PATCH v3 16/28] t55[4-9]*: " Johannes Schindelin via GitGitGadget
                       ` (13 subsequent siblings)
  28 siblings, 0 replies; 163+ messages in thread
From: Johannes Schindelin via GitGitGadget @ 2020-11-18 23:44 UTC (permalink / raw)
  To: git
  Cc: Felipe Contreras, Ævar Arnfjörð Bjarmason,
	Johannes Schindelin, Jeff King, Jonathan Nieder,
	Johannes Schindelin, Johannes Schindelin

From: Johannes Schindelin <johannes.schindelin@gmx.de>

Carefully excluding t5526, which sees independent development elsewhere
at the time of writing, we use `main` as the default branch name in
t55[23]*. This trick was performed via

	$ (cd t &&
	   sed -i -e 's/master/main/g' -e 's/MASTER/MAIN/g' \
		-e 's/Master/Main/g' -e 's/naster/nain/g' -- \
		t55[23]*.sh &&
	   git checkout HEAD -- t5526\*)

Note that t5533 contains a variation of the name `master` (`naster`)
that we rename here, too.

This commit allows us to define
`GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main` for that range of tests.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
---
 t/t5520-pull.sh                |  32 +++---
 t/t5521-pull-options.sh        |  18 ++--
 t/t5523-push-upstream.sh       |  32 +++---
 t/t5527-fetch-odd-refs.sh      |  16 +--
 t/t5528-push-default.sh        | 100 ++++++++---------
 t/t5529-push-errors.sh         |   2 +-
 t/t5530-upload-pack-error.sh   |   2 +-
 t/t5531-deep-submodule-push.sh | 190 ++++++++++++++++-----------------
 t/t5533-push-cas.sh            | 144 ++++++++++++-------------
 t/t5534-push-signed.sh         |   6 +-
 t/t5537-fetch-shallow.sh       |  32 +++---
 t/t5538-push-shallow.sh        |  24 ++---
 t/t5539-fetch-http-shallow.sh  |  16 +--
 13 files changed, 307 insertions(+), 307 deletions(-)

diff --git a/t/t5520-pull.sh b/t/t5520-pull.sh
index b6b21c6cd1..a09411327f 100755
--- a/t/t5520-pull.sh
+++ b/t/t5520-pull.sh
@@ -2,7 +2,7 @@
 
 test_description='pulling into void'
 
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -51,11 +51,11 @@ test_expect_success 'pulling into void' '
 	test_cmp file cloned/file
 '
 
-test_expect_success 'pulling into void using master:master' '
+test_expect_success 'pulling into void using main:main' '
 	git init cloned-uho &&
 	(
 		cd cloned-uho &&
-		git pull .. master:master
+		git pull .. main:main
 	) &&
 	test_path_is_file file &&
 	test_path_is_file cloned-uho/file &&
@@ -67,7 +67,7 @@ test_expect_success 'pulling into void does not overwrite untracked files' '
 	(
 		cd cloned-untracked &&
 		echo untracked >file &&
-		test_must_fail git pull .. master &&
+		test_must_fail git pull .. main &&
 		echo untracked >expect &&
 		test_cmp expect file
 	)
@@ -79,7 +79,7 @@ test_expect_success 'pulling into void does not overwrite staged files' '
 		cd cloned-staged-colliding &&
 		echo "alternate content" >file &&
 		git add file &&
-		test_must_fail git pull .. master &&
+		test_must_fail git pull .. main &&
 		echo "alternate content" >expect &&
 		test_cmp expect file &&
 		git cat-file blob :file >file.index &&
@@ -93,7 +93,7 @@ test_expect_success 'pulling into void does not remove new staged files' '
 		cd cloned-staged-new &&
 		echo "new tracked file" >newfile &&
 		git add newfile &&
-		git pull .. master &&
+		git pull .. main &&
 		echo "new tracked file" >expect &&
 		test_cmp expect newfile &&
 		git cat-file blob :newfile >newfile.index &&
@@ -105,15 +105,15 @@ test_expect_success 'pulling into void must not create an octopus' '
 	git init cloned-octopus &&
 	(
 		cd cloned-octopus &&
-		test_must_fail git pull .. master master &&
+		test_must_fail git pull .. main main &&
 		test_path_is_missing file
 	)
 '
 
 test_expect_success 'test . as a remote' '
-	git branch copy master &&
+	git branch copy main &&
 	git config branch.copy.remote . &&
-	git config branch.copy.merge refs/heads/master &&
+	git config branch.copy.merge refs/heads/main &&
 	echo updated >file &&
 	git commit -a -m updated &&
 	git checkout copy &&
@@ -129,7 +129,7 @@ test_expect_success 'test . as a remote' '
 '
 
 test_expect_success 'the default remote . should not break explicit pull' '
-	git checkout -b second master^ &&
+	git checkout -b second main^ &&
 	echo modified >file &&
 	git commit -a -m modified &&
 	git checkout copy &&
@@ -364,7 +364,7 @@ test_expect_success 'failed --rebase shows advice' '
 
 test_expect_success '--rebase fails with multiple branches' '
 	git reset --hard before-rebase &&
-	test_must_fail git pull --rebase . copy master 2>err &&
+	test_must_fail git pull --rebase . copy main 2>err &&
 	test_cmp_rev HEAD before-rebase &&
 	test_i18ngrep "Cannot rebase onto multiple branches" err &&
 	echo modified >expect &&
@@ -503,7 +503,7 @@ test_expect_success 'pull --rebase does not warn on --no-verify-signatures' '
 	test_i18ngrep ! "verify-signatures" err
 '
 
-# add a feature branch, keep-merge, that is merged into master, so the
+# add a feature branch, keep-merge, that is merged into main, so the
 # test can try preserving the merge commit (or not) with various
 # --rebase flags/pull.rebase settings.
 test_expect_success 'preserve merge setup' '
@@ -702,12 +702,12 @@ test_expect_success 'pull --rebase dies early with dirty working directory' '
 '
 
 test_expect_success 'pull --rebase works on branch yet to be born' '
-	git rev-parse master >expect &&
+	git rev-parse main >expect &&
 	mkdir empty_repo &&
 	(
 		cd empty_repo &&
 		git init &&
-		git pull --rebase .. master &&
+		git pull --rebase .. main &&
 		git rev-parse HEAD >../actual
 	) &&
 	test_cmp expect actual
@@ -723,7 +723,7 @@ test_expect_success 'pull --rebase fails on unborn branch with staged changes' '
 		echo staged-file >expect &&
 		git ls-files >actual &&
 		test_cmp expect actual &&
-		test_must_fail git pull --rebase .. master 2>err &&
+		test_must_fail git pull --rebase .. main 2>err &&
 		git ls-files >actual &&
 		test_cmp expect actual &&
 		git show :staged-file >actual &&
@@ -782,7 +782,7 @@ test_expect_success 'setup for avoiding reapplying old patches' '
 	(
 		cd dst &&
 		test_might_fail git rebase --abort &&
-		git reset --hard origin/master
+		git reset --hard origin/main
 	) &&
 	git clone --bare src src-replace.git &&
 	rm -rf src &&
diff --git a/t/t5521-pull-options.sh b/t/t5521-pull-options.sh
index f0806f3eb5..63a688bdbf 100755
--- a/t/t5521-pull-options.sh
+++ b/t/t5521-pull-options.sh
@@ -2,7 +2,7 @@
 
 test_description='pull options'
 
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -102,13 +102,13 @@ test_expect_success 'git pull --force' '
 	cat >>.git/config <<-\EOF &&
 	[remote "one"]
 		url = ../parent
-		fetch = refs/heads/master:refs/heads/mirror
+		fetch = refs/heads/main:refs/heads/mirror
 	[remote "two"]
 		url = ../parent
-		fetch = refs/heads/master:refs/heads/origin
-	[branch "master"]
+		fetch = refs/heads/main:refs/heads/origin
+	[branch "main"]
 		remote = two
-		merge = refs/heads/master
+		merge = refs/heads/main
 	EOF
 	git pull two &&
 	test_commit A &&
@@ -127,9 +127,9 @@ test_expect_success 'git pull --all' '
 	[remote "two"]
 		url = ../parent
 		fetch = refs/heads/*:refs/remotes/two/*
-	[branch "master"]
+	[branch "main"]
 		remote = one
-		merge = refs/heads/master
+		merge = refs/heads/main
 	EOF
 	git pull --all
 	)
@@ -142,7 +142,7 @@ test_expect_success 'git pull --dry-run' '
 		cd clonedry &&
 		git pull --dry-run ../parent &&
 		test_path_is_missing .git/FETCH_HEAD &&
-		test_path_is_missing .git/refs/heads/master &&
+		test_path_is_missing .git/refs/heads/main &&
 		test_path_is_missing .git/index &&
 		test_path_is_missing file
 	)
@@ -156,7 +156,7 @@ test_expect_success 'git pull --all --dry-run' '
 		git remote add origin ../parent &&
 		git pull --all --dry-run &&
 		test_path_is_missing .git/FETCH_HEAD &&
-		test_path_is_missing .git/refs/remotes/origin/master &&
+		test_path_is_missing .git/refs/remotes/origin/main &&
 		test_path_is_missing .git/index &&
 		test_path_is_missing file
 	)
diff --git a/t/t5523-push-upstream.sh b/t/t5523-push-upstream.sh
index 0e6c7c251b..9fbe7f784d 100755
--- a/t/t5523-push-upstream.sh
+++ b/t/t5523-push-upstream.sh
@@ -1,7 +1,7 @@
 #!/bin/sh
 
 test_description='push with --set-upstream'
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -29,19 +29,19 @@ check_config() {
 	test_cmp expect.$1 actual.$1
 }
 
-test_expect_success 'push -u master:master' '
-	git push -u upstream master:master &&
-	check_config master upstream refs/heads/master
+test_expect_success 'push -u main:main' '
+	git push -u upstream main:main &&
+	check_config main upstream refs/heads/main
 '
 
-test_expect_success 'push -u master:other' '
-	git push -u upstream master:other &&
-	check_config master upstream refs/heads/other
+test_expect_success 'push -u main:other' '
+	git push -u upstream main:other &&
+	check_config main upstream refs/heads/other
 '
 
-test_expect_success 'push -u --dry-run master:otherX' '
-	git push -u --dry-run upstream master:otherX &&
-	check_config master upstream refs/heads/other
+test_expect_success 'push -u --dry-run main:otherX' '
+	git push -u --dry-run upstream main:otherX &&
+	check_config main upstream refs/heads/other
 '
 
 test_expect_success 'push -u topic_2:topic_2' '
@@ -77,7 +77,7 @@ test_expect_success 'push -u HEAD' '
 test_expect_success TTY 'progress messages go to tty' '
 	ensure_fresh_upstream &&
 
-	test_terminal git push -u upstream master >out 2>err &&
+	test_terminal git push -u upstream main >out 2>err &&
 	test_i18ngrep "Writing objects" err
 '
 
@@ -85,7 +85,7 @@ test_expect_success 'progress messages do not go to non-tty' '
 	ensure_fresh_upstream &&
 
 	# skip progress messages, since stderr is non-tty
-	git push -u upstream master >out 2>err &&
+	git push -u upstream main >out 2>err &&
 	test_i18ngrep ! "Writing objects" err
 '
 
@@ -93,21 +93,21 @@ test_expect_success 'progress messages go to non-tty (forced)' '
 	ensure_fresh_upstream &&
 
 	# force progress messages to stderr, even though it is non-tty
-	git push -u --progress upstream master >out 2>err &&
+	git push -u --progress upstream main >out 2>err &&
 	test_i18ngrep "Writing objects" err
 '
 
 test_expect_success TTY 'push -q suppresses progress' '
 	ensure_fresh_upstream &&
 
-	test_terminal git push -u -q upstream master >out 2>err &&
+	test_terminal git push -u -q upstream main >out 2>err &&
 	test_i18ngrep ! "Writing objects" err
 '
 
 test_expect_success TTY 'push --no-progress suppresses progress' '
 	ensure_fresh_upstream &&
 
-	test_terminal git push -u --no-progress upstream master >out 2>err &&
+	test_terminal git push -u --no-progress upstream main >out 2>err &&
 	test_i18ngrep ! "Unpacking objects" err &&
 	test_i18ngrep ! "Writing objects" err
 '
@@ -115,7 +115,7 @@ test_expect_success TTY 'push --no-progress suppresses progress' '
 test_expect_success TTY 'quiet push' '
 	ensure_fresh_upstream &&
 
-	test_terminal git push --quiet --no-progress upstream master 2>&1 | tee output &&
+	test_terminal git push --quiet --no-progress upstream main 2>&1 | tee output &&
 	test_must_be_empty output
 '
 
diff --git a/t/t5527-fetch-odd-refs.sh b/t/t5527-fetch-odd-refs.sh
index 4aa1fb7281..e2770e4541 100755
--- a/t/t5527-fetch-odd-refs.sh
+++ b/t/t5527-fetch-odd-refs.sh
@@ -1,20 +1,20 @@
 #!/bin/sh
 
 test_description='test fetching of oddly-named refs'
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
 
 # afterwards we will have:
 #  HEAD - two
-#  refs/for/refs/heads/master - one
-#  refs/heads/master - three
+#  refs/for/refs/heads/main - one
+#  refs/heads/main - three
 test_expect_success 'setup repo with odd suffix ref' '
 	echo content >file &&
 	git add . &&
 	git commit -m one &&
-	git update-ref refs/for/refs/heads/master HEAD &&
+	git update-ref refs/for/refs/heads/main HEAD &&
 	echo content >>file &&
 	git commit -a -m two &&
 	echo content >>file &&
@@ -25,7 +25,7 @@ test_expect_success 'setup repo with odd suffix ref' '
 test_expect_success 'suffix ref is ignored during fetch' '
 	git clone --bare file://"$PWD" suffix &&
 	echo three >expect &&
-	git --git-dir=suffix log -1 --format=%s refs/heads/master >actual &&
+	git --git-dir=suffix log -1 --format=%s refs/heads/main >actual &&
 	test_cmp expect actual
 '
 
@@ -36,7 +36,7 @@ test_expect_success 'try to create repo with absurdly long refname' '
 	(
 		cd long &&
 		test_commit long &&
-		test_commit master
+		test_commit main
 	) &&
 	if git -C long update-ref refs/heads/$ref1440 long; then
 		test_set_prereq LONG_REF
@@ -49,7 +49,7 @@ test_expect_success LONG_REF 'fetch handles extremely long refname' '
 	git fetch long refs/heads/*:refs/remotes/long/* &&
 	cat >expect <<-\EOF &&
 	long
-	master
+	main
 	EOF
 	git for-each-ref --format="%(subject)" refs/remotes/long >actual &&
 	test_cmp expect actual
@@ -58,7 +58,7 @@ test_expect_success LONG_REF 'fetch handles extremely long refname' '
 test_expect_success LONG_REF 'push handles extremely long refname' '
 	git push long :refs/heads/$ref1440 &&
 	git -C long for-each-ref --format="%(subject)" refs/heads >actual &&
-	echo master >expect &&
+	echo main >expect &&
 	test_cmp expect actual
 '
 
diff --git a/t/t5528-push-default.sh b/t/t5528-push-default.sh
index b39b5171dc..f280e00eb7 100755
--- a/t/t5528-push-default.sh
+++ b/t/t5528-push-default.sh
@@ -1,7 +1,7 @@
 #!/bin/sh
 
 test_description='check various push.default settings'
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -44,7 +44,7 @@ test_push_failure () {
 
 # $1 = success or failure
 # $2 = push.default value
-# $3 = branch to check for actual output (master or foo)
+# $3 = branch to check for actual output (main or foo)
 # $4 = [optional] switch to triangular workflow
 test_pushdefault_workflow () {
 	workflow=central
@@ -54,8 +54,8 @@ test_pushdefault_workflow () {
 		pushdefault=parent2
 	fi
 	test_expect_success "push.default = $2 $1 in $workflow workflows" "
-		test_config branch.master.remote parent1 &&
-		test_config branch.master.merge refs/heads/foo &&
+		test_config branch.main.remote parent1 &&
+		test_config branch.main.merge refs/heads/foo &&
 		test_config remote.pushdefault $pushdefault &&
 		test_commit commit-for-$2${4+-triangular} &&
 		test_push_$1 $2 $3 ${4+repo2}
@@ -63,32 +63,32 @@ test_pushdefault_workflow () {
 }
 
 test_expect_success '"upstream" pushes to configured upstream' '
-	git checkout master &&
-	test_config branch.master.remote parent1 &&
-	test_config branch.master.merge refs/heads/foo &&
+	git checkout main &&
+	test_config branch.main.remote parent1 &&
+	test_config branch.main.merge refs/heads/foo &&
 	test_commit two &&
 	test_push_success upstream foo
 '
 
 test_expect_success '"upstream" does not push on unconfigured remote' '
-	git checkout master &&
-	test_unconfig branch.master.remote &&
+	git checkout main &&
+	test_unconfig branch.main.remote &&
 	test_commit three &&
 	test_push_failure upstream
 '
 
 test_expect_success '"upstream" does not push on unconfigured branch' '
-	git checkout master &&
-	test_config branch.master.remote parent1 &&
-	test_unconfig branch.master.merge &&
+	git checkout main &&
+	test_config branch.main.remote parent1 &&
+	test_unconfig branch.main.merge &&
 	test_commit four &&
 	test_push_failure upstream
 '
 
 test_expect_success '"upstream" does not push when remotes do not match' '
-	git checkout master &&
-	test_config branch.master.remote parent1 &&
-	test_config branch.master.merge refs/heads/foo &&
+	git checkout main &&
+	test_config branch.main.remote parent1 &&
+	test_config branch.main.merge refs/heads/foo &&
 	test_config push.default upstream &&
 	test_commit five &&
 	test_must_fail git push parent2
@@ -124,99 +124,99 @@ test_expect_success 'push from/to new branch with current creates remote branch'
 '
 
 test_expect_success 'push to existing branch, with no upstream configured' '
-	test_config branch.master.remote repo1 &&
-	git checkout master &&
+	test_config branch.main.remote repo1 &&
+	git checkout main &&
 	test_push_failure simple &&
 	test_push_failure upstream
 '
 
 test_expect_success 'push to existing branch, upstream configured with same name' '
-	test_config branch.master.remote repo1 &&
-	test_config branch.master.merge refs/heads/master &&
-	git checkout master &&
+	test_config branch.main.remote repo1 &&
+	test_config branch.main.merge refs/heads/main &&
+	git checkout main &&
 	test_commit six &&
-	test_push_success upstream master &&
+	test_push_success upstream main &&
 	test_commit seven &&
-	test_push_success simple master
+	test_push_success simple main
 '
 
 test_expect_success 'push to existing branch, upstream configured with different name' '
-	test_config branch.master.remote repo1 &&
-	test_config branch.master.merge refs/heads/other-name &&
-	git checkout master &&
+	test_config branch.main.remote repo1 &&
+	test_config branch.main.merge refs/heads/other-name &&
+	git checkout main &&
 	test_commit eight &&
 	test_push_success upstream other-name &&
 	test_commit nine &&
 	test_push_failure simple &&
 	git --git-dir=repo1 log -1 --format="%h %s" "other-name" >expect-other-name &&
-	test_push_success current master &&
+	test_push_success current main &&
 	git --git-dir=repo1 log -1 --format="%h %s" "other-name" >actual-other-name &&
 	test_cmp expect-other-name actual-other-name
 '
 
-# We are on 'master', which integrates with 'foo' from parent1
+# We are on 'main', which integrates with 'foo' from parent1
 # remote (set in test_pushdefault_workflow helper).  Push to
 # parent1 in centralized, and push to parent2 in triangular workflow.
-# The parent1 repository has 'master' and 'foo' branches, while
-# the parent2 repository has only 'master' branch.
+# The parent1 repository has 'main' and 'foo' branches, while
+# the parent2 repository has only 'main' branch.
 #
 # test_pushdefault_workflow() arguments:
 # $1 = success or failure
 # $2 = push.default value
-# $3 = branch to check for actual output (master or foo)
+# $3 = branch to check for actual output (main or foo)
 # $4 = [optional] switch to triangular workflow
 
-# update parent1's master (which is not our upstream)
-test_pushdefault_workflow success current master
+# update parent1's main (which is not our upstream)
+test_pushdefault_workflow success current main
 
 # update parent1's foo (which is our upstream)
 test_pushdefault_workflow success upstream foo
 
 # upstream is foo which is not the name of the current branch
-test_pushdefault_workflow failure simple master
+test_pushdefault_workflow failure simple main
 
-# master and foo are updated
-test_pushdefault_workflow success matching master
+# main and foo are updated
+test_pushdefault_workflow success matching main
 
-# master is updated
-test_pushdefault_workflow success current master triangular
+# main is updated
+test_pushdefault_workflow success current main triangular
 
 # upstream mode cannot be used in triangular
 test_pushdefault_workflow failure upstream foo triangular
 
 # in triangular, 'simple' works as 'current' and update the branch
 # with the same name.
-test_pushdefault_workflow success simple master triangular
+test_pushdefault_workflow success simple main triangular
 
-# master is updated (parent2 does not have foo)
-test_pushdefault_workflow success matching master triangular
+# main is updated (parent2 does not have foo)
+test_pushdefault_workflow success matching main triangular
 
 # default tests, when no push-default is specified. This
 # should behave the same as "simple" in non-triangular
 # settings, and as "current" otherwise.
 
 test_expect_success 'default behavior allows "simple" push' '
-	test_config branch.master.remote parent1 &&
-	test_config branch.master.merge refs/heads/master &&
+	test_config branch.main.remote parent1 &&
+	test_config branch.main.merge refs/heads/main &&
 	test_config remote.pushdefault parent1 &&
-	test_commit default-master-master &&
-	test_push_success "" master
+	test_commit default-main-main &&
+	test_push_success "" main
 '
 
 test_expect_success 'default behavior rejects non-simple push' '
-	test_config branch.master.remote parent1 &&
-	test_config branch.master.merge refs/heads/foo &&
+	test_config branch.main.remote parent1 &&
+	test_config branch.main.merge refs/heads/foo &&
 	test_config remote.pushdefault parent1 &&
-	test_commit default-master-foo &&
+	test_commit default-main-foo &&
 	test_push_failure ""
 '
 
 test_expect_success 'default triangular behavior acts like "current"' '
-	test_config branch.master.remote parent1 &&
-	test_config branch.master.merge refs/heads/foo &&
+	test_config branch.main.remote parent1 &&
+	test_config branch.main.merge refs/heads/foo &&
 	test_config remote.pushdefault parent2 &&
 	test_commit default-triangular &&
-	test_push_success "" master repo2
+	test_push_success "" main repo2
 '
 
 test_done
diff --git a/t/t5529-push-errors.sh b/t/t5529-push-errors.sh
index 9871307fd4..ce85fd30ad 100755
--- a/t/t5529-push-errors.sh
+++ b/t/t5529-push-errors.sh
@@ -32,7 +32,7 @@ test_expect_success 'detect missing branches early' '
 test_expect_success 'detect missing sha1 expressions early' '
 	echo no >rp-ran &&
 	echo no >expect &&
-	test_must_fail git push origin master~2:master &&
+	test_must_fail git push origin main~2:main &&
 	test_cmp expect rp-ran
 '
 
diff --git a/t/t5530-upload-pack-error.sh b/t/t5530-upload-pack-error.sh
index 9dd2d2457a..7c1460eaa9 100755
--- a/t/t5530-upload-pack-error.sh
+++ b/t/t5530-upload-pack-error.sh
@@ -115,7 +115,7 @@ test_expect_success 'create empty repository' '
 
 test_expect_success 'fetch fails' '
 
-	test_must_fail git fetch .. master
+	test_must_fail git fetch .. main
 
 '
 
diff --git a/t/t5531-deep-submodule-push.sh b/t/t5531-deep-submodule-push.sh
index 010f5a0207..d573ca496a 100755
--- a/t/t5531-deep-submodule-push.sh
+++ b/t/t5531-deep-submodule-push.sh
@@ -2,7 +2,7 @@
 
 test_description='test push with submodules'
 
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -33,7 +33,7 @@ test_expect_success setup '
 test_expect_success 'push works with recorded gitlink' '
 	(
 		cd work &&
-		git push ../pub.git master
+		git push ../pub.git main
 	)
 '
 
@@ -48,7 +48,7 @@ test_expect_success 'push if submodule has no remote' '
 		cd work &&
 		git add gar/bage &&
 		git commit -m "Second commit for gar/bage" &&
-		git push --recurse-submodules=check ../pub.git master
+		git push --recurse-submodules=check ../pub.git main
 	)
 '
 
@@ -69,21 +69,21 @@ test_expect_success 'push fails if submodule commit not on remote' '
 		git commit -m "Third commit for gar/bage" &&
 		# the push should fail with --recurse-submodules=check
 		# on the command line...
-		test_must_fail git push --recurse-submodules=check ../pub.git master &&
+		test_must_fail git push --recurse-submodules=check ../pub.git main &&
 
 		# ...or if specified in the configuration..
-		test_must_fail git -c push.recurseSubmodules=check push ../pub.git master
+		test_must_fail git -c push.recurseSubmodules=check push ../pub.git main
 	)
 '
 
 test_expect_success 'push succeeds after commit was pushed to remote' '
 	(
 		cd work/gar/bage &&
-		git push origin master
+		git push origin main
 	) &&
 	(
 		cd work &&
-		git push --recurse-submodules=check ../pub.git master
+		git push --recurse-submodules=check ../pub.git main
 	)
 '
 
@@ -98,13 +98,13 @@ test_expect_success 'push succeeds if submodule commit not on remote but using o
 		cd work &&
 		git add gar/bage &&
 		git commit -m "Recurse on-demand on command line for gar/bage" &&
-		git push --recurse-submodules=on-demand ../pub.git master &&
+		git push --recurse-submodules=on-demand ../pub.git main &&
 		# Check that the supermodule commit got there
 		git fetch ../pub.git &&
-		git diff --quiet FETCH_HEAD master &&
+		git diff --quiet FETCH_HEAD main &&
 		# Check that the submodule commit got there too
 		cd gar/bage &&
-		git diff --quiet origin/master master
+		git diff --quiet origin/main main
 	)
 '
 
@@ -119,13 +119,13 @@ test_expect_success 'push succeeds if submodule commit not on remote but using o
 		cd work &&
 		git add gar/bage &&
 		git commit -m "Recurse on-demand from config for gar/bage" &&
-		git -c push.recurseSubmodules=on-demand push ../pub.git master &&
+		git -c push.recurseSubmodules=on-demand push ../pub.git main &&
 		# Check that the supermodule commit got there
 		git fetch ../pub.git &&
-		git diff --quiet FETCH_HEAD master &&
+		git diff --quiet FETCH_HEAD main &&
 		# Check that the submodule commit got there too
 		cd gar/bage &&
-		git diff --quiet origin/master master
+		git diff --quiet origin/main main
 	)
 '
 
@@ -140,13 +140,13 @@ test_expect_success 'push succeeds if submodule commit not on remote but using a
 		cd work &&
 		git add gar/bage &&
 		git commit -m "Recurse submodule.recurse from config for gar/bage" &&
-		git -c submodule.recurse push ../pub.git master &&
+		git -c submodule.recurse push ../pub.git main &&
 		# Check that the supermodule commit got there
 		git fetch ../pub.git &&
-		git diff --quiet FETCH_HEAD master &&
+		git diff --quiet FETCH_HEAD main &&
 		# Check that the submodule commit got there too
 		cd gar/bage &&
-		git diff --quiet origin/master master
+		git diff --quiet origin/main main
 	)
 '
 
@@ -164,34 +164,34 @@ test_expect_success 'push recurse-submodules on command line overrides config' '
 
 		# Ensure that we can override on-demand in the config
 		# to just check submodules
-		test_must_fail git -c push.recurseSubmodules=on-demand push --recurse-submodules=check ../pub.git master &&
+		test_must_fail git -c push.recurseSubmodules=on-demand push --recurse-submodules=check ../pub.git main &&
 		# Check that the supermodule commit did not get there
 		git fetch ../pub.git &&
-		git diff --quiet FETCH_HEAD master^ &&
+		git diff --quiet FETCH_HEAD main^ &&
 		# Check that the submodule commit did not get there
-		(cd gar/bage && git diff --quiet origin/master master^) &&
+		(cd gar/bage && git diff --quiet origin/main main^) &&
 
 		# Ensure that we can override check in the config to
 		# disable submodule recursion entirely
-		(cd gar/bage && git diff --quiet origin/master master^) &&
-		git -c push.recurseSubmodules=on-demand push --recurse-submodules=no ../pub.git master &&
+		(cd gar/bage && git diff --quiet origin/main main^) &&
+		git -c push.recurseSubmodules=on-demand push --recurse-submodules=no ../pub.git main &&
 		git fetch ../pub.git &&
-		git diff --quiet FETCH_HEAD master &&
-		(cd gar/bage && git diff --quiet origin/master master^) &&
+		git diff --quiet FETCH_HEAD main &&
+		(cd gar/bage && git diff --quiet origin/main main^) &&
 
 		# Ensure that we can override check in the config to
 		# disable submodule recursion entirely (alternative form)
-		git -c push.recurseSubmodules=on-demand push --no-recurse-submodules ../pub.git master &&
+		git -c push.recurseSubmodules=on-demand push --no-recurse-submodules ../pub.git main &&
 		git fetch ../pub.git &&
-		git diff --quiet FETCH_HEAD master &&
-		(cd gar/bage && git diff --quiet origin/master master^) &&
+		git diff --quiet FETCH_HEAD main &&
+		(cd gar/bage && git diff --quiet origin/main main^) &&
 
 		# Ensure that we can override check in the config to
 		# push the submodule too
-		git -c push.recurseSubmodules=check push --recurse-submodules=on-demand ../pub.git master &&
+		git -c push.recurseSubmodules=check push --recurse-submodules=on-demand ../pub.git main &&
 		git fetch ../pub.git &&
-		git diff --quiet FETCH_HEAD master &&
-		(cd gar/bage && git diff --quiet origin/master master)
+		git diff --quiet FETCH_HEAD main &&
+		(cd gar/bage && git diff --quiet origin/main main)
 	)
 '
 
@@ -208,31 +208,31 @@ test_expect_success 'push recurse-submodules last one wins on command line' '
 		git commit -m "Recurse on command-line overriding earlier command-line for gar/bage" &&
 
 		# should result in "check"
-		test_must_fail git push --recurse-submodules=on-demand --recurse-submodules=check ../pub.git master &&
+		test_must_fail git push --recurse-submodules=on-demand --recurse-submodules=check ../pub.git main &&
 		# Check that the supermodule commit did not get there
 		git fetch ../pub.git &&
-		git diff --quiet FETCH_HEAD master^ &&
+		git diff --quiet FETCH_HEAD main^ &&
 		# Check that the submodule commit did not get there
-		(cd gar/bage && git diff --quiet origin/master master^) &&
+		(cd gar/bage && git diff --quiet origin/main main^) &&
 
 		# should result in "no"
-		git push --recurse-submodules=on-demand --recurse-submodules=no ../pub.git master &&
+		git push --recurse-submodules=on-demand --recurse-submodules=no ../pub.git main &&
 		# Check that the supermodule commit did get there
 		git fetch ../pub.git &&
-		git diff --quiet FETCH_HEAD master &&
+		git diff --quiet FETCH_HEAD main &&
 		# Check that the submodule commit did not get there
-		(cd gar/bage && git diff --quiet origin/master master^) &&
+		(cd gar/bage && git diff --quiet origin/main main^) &&
 
 		# should result in "no"
-		git push --recurse-submodules=on-demand --no-recurse-submodules ../pub.git master &&
+		git push --recurse-submodules=on-demand --no-recurse-submodules ../pub.git main &&
 		# Check that the submodule commit did not get there
-		(cd gar/bage && git diff --quiet origin/master master^) &&
+		(cd gar/bage && git diff --quiet origin/main main^) &&
 
 		# But the options in the other order should push the submodule
-		git push --recurse-submodules=check --recurse-submodules=on-demand ../pub.git master &&
+		git push --recurse-submodules=check --recurse-submodules=on-demand ../pub.git main &&
 		# Check that the submodule commit did get there
 		git fetch ../pub.git &&
-		(cd gar/bage && git diff --quiet origin/master master)
+		(cd gar/bage && git diff --quiet origin/main main)
 	)
 '
 
@@ -247,13 +247,13 @@ test_expect_success 'push succeeds if submodule commit not on remote using on-de
 		cd work &&
 		git add gar/bage &&
 		git commit -m "Recurse on-demand on command-line overriding config for gar/bage" &&
-		git -c push.recurseSubmodules=check push --recurse-submodules=on-demand ../pub.git master &&
+		git -c push.recurseSubmodules=check push --recurse-submodules=on-demand ../pub.git main &&
 		# Check that the supermodule commit got there
 		git fetch ../pub.git &&
-		git diff --quiet FETCH_HEAD master &&
+		git diff --quiet FETCH_HEAD main &&
 		# Check that the submodule commit got there
 		cd gar/bage &&
-		git diff --quiet origin/master master
+		git diff --quiet origin/main main
 	)
 '
 
@@ -268,14 +268,14 @@ test_expect_success 'push succeeds if submodule commit disabling recursion from
 		cd work &&
 		git add gar/bage &&
 		git commit -m "Recurse disable on command-line overriding config for gar/bage" &&
-		git -c push.recurseSubmodules=check push --recurse-submodules=no ../pub.git master &&
+		git -c push.recurseSubmodules=check push --recurse-submodules=no ../pub.git main &&
 		# Check that the supermodule commit got there
 		git fetch ../pub.git &&
-		git diff --quiet FETCH_HEAD master &&
+		git diff --quiet FETCH_HEAD main &&
 		# But that the submodule commit did not
-		( cd gar/bage && git diff --quiet origin/master master^ ) &&
+		( cd gar/bage && git diff --quiet origin/main main^ ) &&
 		# Now push it to avoid confusing future tests
-		git push --recurse-submodules=on-demand ../pub.git master
+		git push --recurse-submodules=on-demand ../pub.git main
 	)
 '
 
@@ -290,14 +290,14 @@ test_expect_success 'push succeeds if submodule commit disabling recursion from
 		cd work &&
 		git add gar/bage &&
 		git commit -m "Recurse disable on command-line alternative overriding config for gar/bage" &&
-		git -c push.recurseSubmodules=check push --no-recurse-submodules ../pub.git master &&
+		git -c push.recurseSubmodules=check push --no-recurse-submodules ../pub.git main &&
 		# Check that the supermodule commit got there
 		git fetch ../pub.git &&
-		git diff --quiet FETCH_HEAD master &&
+		git diff --quiet FETCH_HEAD main &&
 		# But that the submodule commit did not
-		( cd gar/bage && git diff --quiet origin/master master^ ) &&
+		( cd gar/bage && git diff --quiet origin/main main^ ) &&
 		# Now push it to avoid confusing future tests
-		git push --recurse-submodules=on-demand ../pub.git master
+		git push --recurse-submodules=on-demand ../pub.git main
 	)
 '
 
@@ -307,7 +307,7 @@ test_expect_success 'submodule entry pointing at a tag is error' '
 	git -C work update-index --cacheinfo 160000 "$tag" gar/bage &&
 	git -C work commit -m "bad commit" &&
 	test_when_finished "git -C work reset --hard HEAD^" &&
-	test_must_fail git -C work push --recurse-submodules=on-demand ../pub.git master 2>err &&
+	test_must_fail git -C work push --recurse-submodules=on-demand ../pub.git main 2>err &&
 	test_i18ngrep "is a tag, not a commit" err
 '
 
@@ -322,9 +322,9 @@ test_expect_success 'push fails if recurse submodules option passed as yes' '
 		cd work &&
 		git add gar/bage &&
 		git commit -m "Recurse push fails if recurse submodules option passed as yes for gar/bage" &&
-		test_must_fail git push --recurse-submodules=yes ../pub.git master &&
-		test_must_fail git -c push.recurseSubmodules=yes push ../pub.git master &&
-		git push --recurse-submodules=on-demand ../pub.git master
+		test_must_fail git push --recurse-submodules=yes ../pub.git main &&
+		test_must_fail git -c push.recurseSubmodules=yes push ../pub.git main &&
+		git push --recurse-submodules=on-demand ../pub.git main
 	)
 '
 
@@ -366,7 +366,7 @@ test_expect_success 'push succeeds if submodule has no remote and is on the firs
 		) &&
 		git add b &&
 		git commit -m "added submodule" &&
-		git push --recurse-submodules=check origin master
+		git push --recurse-submodules=check origin main
 	)
 '
 
@@ -375,21 +375,21 @@ test_expect_success 'push unpushed submodules when not needed' '
 		cd work &&
 		(
 			cd gar/bage &&
-			git checkout master &&
+			git checkout main &&
 			>junk5 &&
 			git add junk5 &&
 			git commit -m "Fifth junk" &&
 			git push &&
-			git rev-parse origin/master >../../../expected
+			git rev-parse origin/main >../../../expected
 		) &&
-		git checkout master &&
+		git checkout main &&
 		git add gar/bage &&
 		git commit -m "Fifth commit for gar/bage" &&
-		git push --recurse-submodules=on-demand ../pub.git master
+		git push --recurse-submodules=on-demand ../pub.git main
 	) &&
 	(
 		cd submodule.git &&
-		git rev-parse master >../actual
+		git rev-parse main >../actual
 	) &&
 	test_cmp expected actual
 '
@@ -397,7 +397,7 @@ test_expect_success 'push unpushed submodules when not needed' '
 test_expect_success 'push unpushed submodules when not needed 2' '
 	(
 		cd submodule.git &&
-		git rev-parse master >../expected
+		git rev-parse main >../expected
 	) &&
 	(
 		cd work &&
@@ -410,11 +410,11 @@ test_expect_success 'push unpushed submodules when not needed 2' '
 		>junk2 &&
 		git add junk2 &&
 		git commit -m "Second junk for work" &&
-		git push --recurse-submodules=on-demand ../pub.git master
+		git push --recurse-submodules=on-demand ../pub.git main
 	) &&
 	(
 		cd submodule.git &&
-		git rev-parse master >../actual
+		git rev-parse main >../actual
 	) &&
 	test_cmp expected actual
 '
@@ -424,20 +424,20 @@ test_expect_success 'push unpushed submodules recursively' '
 		cd work &&
 		(
 			cd gar/bage &&
-			git checkout master &&
+			git checkout main &&
 			> junk7 &&
 			git add junk7 &&
 			git commit -m "Seventh junk" &&
-			git rev-parse master >../../../expected
+			git rev-parse main >../../../expected
 		) &&
-		git checkout master &&
+		git checkout main &&
 		git add gar/bage &&
 		git commit -m "Seventh commit for gar/bage" &&
-		git push --recurse-submodules=on-demand ../pub.git master
+		git push --recurse-submodules=on-demand ../pub.git main
 	) &&
 	(
 		cd submodule.git &&
-		git rev-parse master >../actual
+		git rev-parse main >../actual
 	) &&
 	test_cmp expected actual
 '
@@ -447,64 +447,64 @@ test_expect_success 'push unpushable submodule recursively fails' '
 		cd work &&
 		(
 			cd gar/bage &&
-			git rev-parse origin/master >../../../expected &&
-			git checkout master~0 &&
+			git rev-parse origin/main >../../../expected &&
+			git checkout main~0 &&
 			> junk8 &&
 			git add junk8 &&
 			git commit -m "Eighth junk"
 		) &&
 		git add gar/bage &&
 		git commit -m "Eighth commit for gar/bage" &&
-		test_must_fail git push --recurse-submodules=on-demand ../pub.git master
+		test_must_fail git push --recurse-submodules=on-demand ../pub.git main
 	) &&
 	(
 		cd submodule.git &&
-		git rev-parse master >../actual
+		git rev-parse main >../actual
 	) &&
-	test_when_finished git -C work reset --hard master^ &&
+	test_when_finished git -C work reset --hard main^ &&
 	test_cmp expected actual
 '
 
 test_expect_success 'push --dry-run does not recursively update submodules' '
 	(
 		cd work/gar/bage &&
-		git checkout master &&
-		git rev-parse master >../../../expected_submodule &&
+		git checkout main &&
+		git rev-parse main >../../../expected_submodule &&
 		> junk9 &&
 		git add junk9 &&
 		git commit -m "Ninth junk" &&
 
 		# Go up to 'work' directory
 		cd ../.. &&
-		git checkout master &&
-		git rev-parse master >../expected_pub &&
+		git checkout main &&
+		git rev-parse main >../expected_pub &&
 		git add gar/bage &&
 		git commit -m "Ninth commit for gar/bage" &&
-		git push --dry-run --recurse-submodules=on-demand ../pub.git master
+		git push --dry-run --recurse-submodules=on-demand ../pub.git main
 	) &&
-	git -C submodule.git rev-parse master >actual_submodule &&
-	git -C pub.git rev-parse master >actual_pub &&
+	git -C submodule.git rev-parse main >actual_submodule &&
+	git -C pub.git rev-parse main >actual_pub &&
 	test_cmp expected_pub actual_pub &&
 	test_cmp expected_submodule actual_submodule
 '
 
 test_expect_success 'push --dry-run does not recursively update submodules' '
-	git -C work push --dry-run --recurse-submodules=only ../pub.git master &&
+	git -C work push --dry-run --recurse-submodules=only ../pub.git main &&
 
-	git -C submodule.git rev-parse master >actual_submodule &&
-	git -C pub.git rev-parse master >actual_pub &&
+	git -C submodule.git rev-parse main >actual_submodule &&
+	git -C pub.git rev-parse main >actual_pub &&
 	test_cmp expected_pub actual_pub &&
 	test_cmp expected_submodule actual_submodule
 '
 
 test_expect_success 'push only unpushed submodules recursively' '
-	git -C work/gar/bage rev-parse master >expected_submodule &&
-	git -C pub.git rev-parse master >expected_pub &&
+	git -C work/gar/bage rev-parse main >expected_submodule &&
+	git -C pub.git rev-parse main >expected_pub &&
 
-	git -C work push --recurse-submodules=only ../pub.git master &&
+	git -C work push --recurse-submodules=only ../pub.git main &&
 
-	git -C submodule.git rev-parse master >actual_submodule &&
-	git -C pub.git rev-parse master >actual_pub &&
+	git -C submodule.git rev-parse main >actual_submodule &&
+	git -C pub.git rev-parse main >actual_pub &&
 	test_cmp expected_submodule actual_submodule &&
 	test_cmp expected_pub actual_pub
 '
@@ -520,14 +520,14 @@ test_expect_success 'push propagating the remotes name to a submodule' '
 	git -C work commit -m "Tenth junk added to gar/bage" &&
 
 	# Fails when submodule does not have a matching remote
-	test_must_fail git -C work push --recurse-submodules=on-demand pub master &&
+	test_must_fail git -C work push --recurse-submodules=on-demand pub main &&
 	# Succeeds when submodules has matching remote and refspec
-	git -C work push --recurse-submodules=on-demand origin master &&
+	git -C work push --recurse-submodules=on-demand origin main &&
 
-	git -C submodule.git rev-parse master >actual_submodule &&
-	git -C pub.git rev-parse master >actual_pub &&
-	git -C work/gar/bage rev-parse master >expected_submodule &&
-	git -C work rev-parse master >expected_pub &&
+	git -C submodule.git rev-parse main >actual_submodule &&
+	git -C pub.git rev-parse main >actual_pub &&
+	git -C work/gar/bage rev-parse main >expected_submodule &&
+	git -C work rev-parse main >expected_pub &&
 	test_cmp expected_submodule actual_submodule &&
 	test_cmp expected_pub actual_pub
 '
@@ -551,7 +551,7 @@ test_expect_success 'push propagating refspec to a submodule' '
 	test_must_fail git -C work push --recurse-submodules=on-demand origin \
 		HEAD:refs/heads/branch2 &&
 
-	git -C work/gar/bage branch branch2 master &&
+	git -C work/gar/bage branch branch2 main &&
 	git -C work push --recurse-submodules=on-demand origin branch2 &&
 
 	git -C submodule.git rev-parse branch2 >actual_submodule &&
diff --git a/t/t5533-push-cas.sh b/t/t5533-push-cas.sh
index a7f0f098dd..cba26a872d 100755
--- a/t/t5533-push-cas.sh
+++ b/t/t5533-push-cas.sh
@@ -2,7 +2,7 @@
 
 test_description='compare & swap push force/delete safety'
 
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -32,22 +32,22 @@ setup_src_dup_dst () {
 	(
 		cd dup &&
 		git fetch &&
-		git merge origin/master &&
-		git switch -c branch master~2 &&
+		git merge origin/main &&
+		git switch -c branch main~2 &&
 		test_commit D &&
 		test_commit E &&
 		git push origin --all
 	) &&
 	(
 		cd src &&
-		git switch master &&
+		git switch main &&
 		git fetch --all &&
 		git branch branch --track origin/branch &&
-		git rebase origin/master
+		git rebase origin/main
 	) &&
 	(
 		cd dup &&
-		git switch master &&
+		git switch main &&
 		test_commit F &&
 		test_commit G &&
 		git switch branch &&
@@ -68,11 +68,11 @@ test_expect_success 'push to update (protected)' '
 	(
 		cd dst &&
 		test_commit D &&
-		test_must_fail git push --force-with-lease=master:master origin master 2>err &&
+		test_must_fail git push --force-with-lease=main:main origin main 2>err &&
 		grep "stale info" err
 	) &&
-	git ls-remote . refs/heads/master >expect &&
-	git ls-remote src refs/heads/master >actual &&
+	git ls-remote . refs/heads/main >expect &&
+	git ls-remote src refs/heads/main >actual &&
 	test_cmp expect actual
 '
 
@@ -81,11 +81,11 @@ test_expect_success 'push to update (protected, forced)' '
 	(
 		cd dst &&
 		test_commit D &&
-		git push --force --force-with-lease=master:master origin master 2>err &&
+		git push --force --force-with-lease=main:main origin main 2>err &&
 		grep "forced update" err
 	) &&
-	git ls-remote dst refs/heads/master >expect &&
-	git ls-remote src refs/heads/master >actual &&
+	git ls-remote dst refs/heads/main >expect &&
+	git ls-remote src refs/heads/main >actual &&
 	test_cmp expect actual
 '
 
@@ -93,20 +93,20 @@ test_expect_success 'push to update (protected, tracking)' '
 	setup_srcdst_basic &&
 	(
 		cd src &&
-		git checkout master &&
+		git checkout main &&
 		test_commit D &&
 		git checkout HEAD^0
 	) &&
-	git ls-remote src refs/heads/master >expect &&
+	git ls-remote src refs/heads/main >expect &&
 	(
 		cd dst &&
 		test_commit E &&
-		git ls-remote . refs/remotes/origin/master >expect &&
-		test_must_fail git push --force-with-lease=master origin master &&
-		git ls-remote . refs/remotes/origin/master >actual &&
+		git ls-remote . refs/remotes/origin/main >expect &&
+		test_must_fail git push --force-with-lease=main origin main &&
+		git ls-remote . refs/remotes/origin/main >actual &&
 		test_cmp expect actual
 	) &&
-	git ls-remote src refs/heads/master >actual &&
+	git ls-remote src refs/heads/main >actual &&
 	test_cmp expect actual
 '
 
@@ -114,18 +114,18 @@ test_expect_success 'push to update (protected, tracking, forced)' '
 	setup_srcdst_basic &&
 	(
 		cd src &&
-		git checkout master &&
+		git checkout main &&
 		test_commit D &&
 		git checkout HEAD^0
 	) &&
 	(
 		cd dst &&
 		test_commit E &&
-		git ls-remote . refs/remotes/origin/master >expect &&
-		git push --force --force-with-lease=master origin master
+		git ls-remote . refs/remotes/origin/main >expect &&
+		git push --force --force-with-lease=main origin main
 	) &&
-	git ls-remote dst refs/heads/master >expect &&
-	git ls-remote src refs/heads/master >actual &&
+	git ls-remote dst refs/heads/main >expect &&
+	git ls-remote src refs/heads/main >actual &&
 	test_cmp expect actual
 '
 
@@ -134,10 +134,10 @@ test_expect_success 'push to update (allowed)' '
 	(
 		cd dst &&
 		test_commit D &&
-		git push --force-with-lease=master:master^ origin master
+		git push --force-with-lease=main:main^ origin main
 	) &&
-	git ls-remote dst refs/heads/master >expect &&
-	git ls-remote src refs/heads/master >actual &&
+	git ls-remote dst refs/heads/main >expect &&
+	git ls-remote src refs/heads/main >actual &&
 	test_cmp expect actual
 '
 
@@ -146,11 +146,11 @@ test_expect_success 'push to update (allowed, tracking)' '
 	(
 		cd dst &&
 		test_commit D &&
-		git push --force-with-lease=master origin master 2>err &&
+		git push --force-with-lease=main origin main 2>err &&
 		! grep "forced update" err
 	) &&
-	git ls-remote dst refs/heads/master >expect &&
-	git ls-remote src refs/heads/master >actual &&
+	git ls-remote dst refs/heads/main >expect &&
+	git ls-remote src refs/heads/main >actual &&
 	test_cmp expect actual
 '
 
@@ -160,22 +160,22 @@ test_expect_success 'push to update (allowed even though no-ff)' '
 		cd dst &&
 		git reset --hard HEAD^ &&
 		test_commit D &&
-		git push --force-with-lease=master origin master 2>err &&
+		git push --force-with-lease=main origin main 2>err &&
 		grep "forced update" err
 	) &&
-	git ls-remote dst refs/heads/master >expect &&
-	git ls-remote src refs/heads/master >actual &&
+	git ls-remote dst refs/heads/main >expect &&
+	git ls-remote src refs/heads/main >actual &&
 	test_cmp expect actual
 '
 
 test_expect_success 'push to delete (protected)' '
 	setup_srcdst_basic &&
-	git ls-remote src refs/heads/master >expect &&
+	git ls-remote src refs/heads/main >expect &&
 	(
 		cd dst &&
-		test_must_fail git push --force-with-lease=master:master^ origin :master
+		test_must_fail git push --force-with-lease=main:main^ origin :main
 	) &&
-	git ls-remote src refs/heads/master >actual &&
+	git ls-remote src refs/heads/main >actual &&
 	test_cmp expect actual
 '
 
@@ -183,9 +183,9 @@ test_expect_success 'push to delete (protected, forced)' '
 	setup_srcdst_basic &&
 	(
 		cd dst &&
-		git push --force --force-with-lease=master:master^ origin :master
+		git push --force --force-with-lease=main:main^ origin :main
 	) &&
-	git ls-remote src refs/heads/master >actual &&
+	git ls-remote src refs/heads/main >actual &&
 	test_must_be_empty actual
 '
 
@@ -193,10 +193,10 @@ test_expect_success 'push to delete (allowed)' '
 	setup_srcdst_basic &&
 	(
 		cd dst &&
-		git push --force-with-lease=master origin :master 2>err &&
+		git push --force-with-lease=main origin :main 2>err &&
 		grep deleted err
 	) &&
-	git ls-remote src refs/heads/master >actual &&
+	git ls-remote src refs/heads/main >actual &&
 	test_must_be_empty actual
 '
 
@@ -204,12 +204,12 @@ test_expect_success 'cover everything with default force-with-lease (protected)'
 	setup_srcdst_basic &&
 	(
 		cd src &&
-		git branch naster master^
+		git branch nain main^
 	) &&
 	git ls-remote src refs/heads/\* >expect &&
 	(
 		cd dst &&
-		test_must_fail git push --force-with-lease origin master master:naster
+		test_must_fail git push --force-with-lease origin main main:nain
 	) &&
 	git ls-remote src refs/heads/\* >actual &&
 	test_cmp expect actual
@@ -219,16 +219,16 @@ test_expect_success 'cover everything with default force-with-lease (allowed)' '
 	setup_srcdst_basic &&
 	(
 		cd src &&
-		git branch naster master^
+		git branch nain main^
 	) &&
 	(
 		cd dst &&
 		git fetch &&
-		git push --force-with-lease origin master master:naster
+		git push --force-with-lease origin main main:nain
 	) &&
-	git ls-remote dst refs/heads/master |
-	sed -e "s/master/naster/" >expect &&
-	git ls-remote src refs/heads/naster >actual &&
+	git ls-remote dst refs/heads/main |
+	sed -e "s/main/nain/" >expect &&
+	git ls-remote src refs/heads/nain >actual &&
 	test_cmp expect actual
 '
 
@@ -236,7 +236,7 @@ test_expect_success 'new branch covered by force-with-lease' '
 	setup_srcdst_basic &&
 	(
 		cd dst &&
-		git branch branch master &&
+		git branch branch main &&
 		git push --force-with-lease=branch origin branch
 	) &&
 	git ls-remote dst refs/heads/branch >expect &&
@@ -248,7 +248,7 @@ test_expect_success 'new branch covered by force-with-lease (explicit)' '
 	setup_srcdst_basic &&
 	(
 		cd dst &&
-		git branch branch master &&
+		git branch branch main &&
 		git push --force-with-lease=branch: origin branch
 	) &&
 	git ls-remote dst refs/heads/branch >expect &&
@@ -260,12 +260,12 @@ test_expect_success 'new branch already exists' '
 	setup_srcdst_basic &&
 	(
 		cd src &&
-		git checkout -b branch master &&
+		git checkout -b branch main &&
 		test_commit F
 	) &&
 	(
 		cd dst &&
-		git branch branch master &&
+		git branch branch main &&
 		test_must_fail git push --force-with-lease=branch: origin branch
 	)
 '
@@ -280,7 +280,7 @@ test_expect_success 'background updates of REMOTE can be mitigated with a non-up
 		cd dst &&
 		test_commit G &&
 		git remote add origin-push ../src.bare &&
-		git push origin-push master:master
+		git push origin-push main:main
 	) &&
 	git clone --no-local src.bare dst2 &&
 	test_when_finished "rm -rf dst2" &&
@@ -302,58 +302,58 @@ test_expect_success 'background updates of REMOTE can be mitigated with a non-up
 test_expect_success 'background updates to remote can be mitigated with "--force-if-includes"' '
 	setup_src_dup_dst &&
 	test_when_finished "rm -fr dst src dup" &&
-	git ls-remote dst refs/heads/master >expect.master &&
+	git ls-remote dst refs/heads/main >expect.main &&
 	git ls-remote dst refs/heads/branch >expect.branch &&
 	(
 		cd src &&
 		git switch branch &&
 		test_commit I &&
-		git switch master &&
+		git switch main &&
 		test_commit J &&
 		git fetch --all &&
 		test_must_fail git push --force-with-lease --force-if-includes --all
 	) &&
-	git ls-remote dst refs/heads/master >actual.master &&
+	git ls-remote dst refs/heads/main >actual.main &&
 	git ls-remote dst refs/heads/branch >actual.branch &&
-	test_cmp expect.master actual.master &&
+	test_cmp expect.main actual.main &&
 	test_cmp expect.branch actual.branch
 '
 
 test_expect_success 'background updates to remote can be mitigated with "push.useForceIfIncludes"' '
 	setup_src_dup_dst &&
 	test_when_finished "rm -fr dst src dup" &&
-	git ls-remote dst refs/heads/master >expect.master &&
+	git ls-remote dst refs/heads/main >expect.main &&
 	(
 		cd src &&
 		git switch branch &&
 		test_commit I &&
-		git switch master &&
+		git switch main &&
 		test_commit J &&
 		git fetch --all &&
 		git config --local push.useForceIfIncludes true &&
-		test_must_fail git push --force-with-lease=master origin master
+		test_must_fail git push --force-with-lease=main origin main
 	) &&
-	git ls-remote dst refs/heads/master >actual.master &&
-	test_cmp expect.master actual.master
+	git ls-remote dst refs/heads/main >actual.main &&
+	test_cmp expect.main actual.main
 '
 
 test_expect_success '"--force-if-includes" should be disabled for --force-with-lease="<refname>:<expect>"' '
 	setup_src_dup_dst &&
 	test_when_finished "rm -fr dst src dup" &&
-	git ls-remote dst refs/heads/master >expect.master &&
+	git ls-remote dst refs/heads/main >expect.main &&
 	(
 		cd src &&
 		git switch branch &&
 		test_commit I &&
-		git switch master &&
+		git switch main &&
 		test_commit J &&
-		remote_head="$(git rev-parse refs/remotes/origin/master)" &&
+		remote_head="$(git rev-parse refs/remotes/origin/main)" &&
 		git fetch --all &&
-		test_must_fail git push --force-if-includes --force-with-lease="master:$remote_head" 2>err &&
+		test_must_fail git push --force-if-includes --force-with-lease="main:$remote_head" 2>err &&
 		grep "stale info" err
 	) &&
-	git ls-remote dst refs/heads/master >actual.master &&
-	test_cmp expect.master actual.master
+	git ls-remote dst refs/heads/main >actual.main &&
+	test_cmp expect.main actual.main
 '
 
 test_expect_success '"--force-if-includes" should allow forced update after a rebase ("pull --rebase")' '
@@ -363,10 +363,10 @@ test_expect_success '"--force-if-includes" should allow forced update after a re
 		cd src &&
 		git switch branch &&
 		test_commit I &&
-		git switch master &&
+		git switch main &&
 		test_commit J &&
-		git pull --rebase origin master &&
-		git push --force-if-includes --force-with-lease="master"
+		git pull --rebase origin main &&
+		git push --force-if-includes --force-with-lease="main"
 	)
 '
 
@@ -377,11 +377,11 @@ test_expect_success '"--force-if-includes" should allow forced update after a re
 		cd src &&
 		git switch branch &&
 		test_commit I &&
-		git switch master &&
+		git switch main &&
 		test_commit J &&
-		git pull --rebase origin master &&
+		git pull --rebase origin main &&
 		git rebase --onto HEAD~4 HEAD~1 &&
-		git push --force-if-includes --force-with-lease="master"
+		git push --force-if-includes --force-with-lease="main"
 	)
 '
 
diff --git a/t/t5534-push-signed.sh b/t/t5534-push-signed.sh
index 6ab458684d..bba768f5de 100755
--- a/t/t5534-push-signed.sh
+++ b/t/t5534-push-signed.sh
@@ -2,7 +2,7 @@
 
 test_description='signed push'
 
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -12,11 +12,11 @@ prepare_dst () {
 	rm -fr dst &&
 	test_create_repo dst &&
 
-	git push dst master:noop master:ff master:noff
+	git push dst main:noop main:ff main:noff
 }
 
 test_expect_success setup '
-	# master, ff and noff branches pointing at the same commit
+	# main, ff and noff branches pointing at the same commit
 	test_tick &&
 	git commit --allow-empty -m initial &&
 
diff --git a/t/t5537-fetch-shallow.sh b/t/t5537-fetch-shallow.sh
index 6de384a5ea..11d5ea54a9 100755
--- a/t/t5537-fetch-shallow.sh
+++ b/t/t5537-fetch-shallow.sh
@@ -2,7 +2,7 @@
 
 test_description='fetch/clone from a shallow clone'
 
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -52,7 +52,7 @@ test_expect_success 'fetch from shallow clone' '
 	cd shallow2 &&
 	git fetch &&
 	git fsck &&
-	git log --format=%s origin/master >actual &&
+	git log --format=%s origin/main >actual &&
 	test_write_lines 5 4 3 >expect &&
 	test_cmp expect actual
 	)
@@ -67,7 +67,7 @@ test_expect_success 'fetch --depth from shallow clone' '
 	cd shallow2 &&
 	git fetch --depth=2 &&
 	git fsck &&
-	git log --format=%s origin/master >actual &&
+	git log --format=%s origin/main >actual &&
 	test_write_lines 6 5 >expect &&
 	test_cmp expect actual
 	)
@@ -78,7 +78,7 @@ test_expect_success 'fetch --unshallow from shallow clone' '
 	cd shallow2 &&
 	git fetch --unshallow &&
 	git fsck &&
-	git log --format=%s origin/master >actual &&
+	git log --format=%s origin/main >actual &&
 	test_write_lines 6 5 4 3 >expect &&
 	test_cmp expect actual
 	)
@@ -92,7 +92,7 @@ test_expect_success 'fetch --unshallow from a full clone' '
 	test_write_lines 4 3 >expect &&
 	test_cmp expect actual &&
 	git -c fetch.writeCommitGraph fetch --unshallow &&
-	git log origin/master --format=%s >actual &&
+	git log origin/main --format=%s >actual &&
 	test_write_lines 4 3 2 1 >expect &&
 	test_cmp expect actual
 	)
@@ -107,9 +107,9 @@ test_expect_success 'fetch something upstream has but hidden by clients shallow
 	git commit -m add-1-back &&
 	(
 	cd shallow2 &&
-	git fetch ../.git +refs/heads/master:refs/remotes/top/master &&
+	git fetch ../.git +refs/heads/main:refs/remotes/top/main &&
 	git fsck &&
-	git log --format=%s top/master >actual &&
+	git log --format=%s top/main >actual &&
 	test_write_lines add-1-back 4 3 >expect &&
 	test_cmp expect actual
 	) &&
@@ -138,7 +138,7 @@ test_expect_success 'fetch that requires changes in .git/shallow is filtered' '
 test_expect_success 'fetch --update-shallow' '
 	(
 	cd shallow &&
-	git checkout master &&
+	git checkout main &&
 	commit 7 &&
 	git tag -m foo heavy-tag HEAD^ &&
 	git tag light-tag HEAD^:tracked
@@ -149,13 +149,13 @@ test_expect_success 'fetch --update-shallow' '
 	git fsck &&
 	git for-each-ref --sort=refname --format="%(refname)" >actual.refs &&
 	cat <<-\EOF >expect.refs &&
-	refs/remotes/shallow/master
+	refs/remotes/shallow/main
 	refs/remotes/shallow/no-shallow
 	refs/tags/heavy-tag
 	refs/tags/light-tag
 	EOF
 	test_cmp expect.refs actual.refs &&
-	git log --format=%s shallow/master >actual &&
+	git log --format=%s shallow/main >actual &&
 	test_write_lines 7 6 5 4 3 >expect &&
 	test_cmp expect actual
 	)
@@ -164,7 +164,7 @@ test_expect_success 'fetch --update-shallow' '
 test_expect_success 'fetch --update-shallow (with fetch.writeCommitGraph)' '
 	(
 	cd shallow &&
-	git checkout master &&
+	git checkout main &&
 	commit 8 &&
 	git tag -m foo heavy-tag-for-graph HEAD^ &&
 	git tag light-tag-for-graph HEAD^:tracked
@@ -176,7 +176,7 @@ test_expect_success 'fetch --update-shallow (with fetch.writeCommitGraph)' '
 	git fsck &&
 	git for-each-ref --sort=refname --format="%(refname)" >actual.refs &&
 	cat <<-EOF >expect.refs &&
-	refs/remotes/shallow/master
+	refs/remotes/shallow/main
 	refs/remotes/shallow/no-shallow
 	refs/tags/heavy-tag
 	refs/tags/heavy-tag-for-graph
@@ -184,7 +184,7 @@ test_expect_success 'fetch --update-shallow (with fetch.writeCommitGraph)' '
 	refs/tags/light-tag-for-graph
 	EOF
 	test_cmp expect.refs actual.refs &&
-	git log --format=%s shallow/master >actual &&
+	git log --format=%s shallow/main >actual &&
 	test_write_lines 8 7 6 5 4 3 >expect &&
 	test_cmp expect actual
 	)
@@ -209,7 +209,7 @@ test_expect_success '.git/shallow is edited by repack' '
 	test_commit -C shallow-server E &&
 	test_commit -C shallow-server D &&
 	d="$(git -C shallow-server rev-parse --verify D^0)" &&
-	git -C shallow-server checkout master &&
+	git -C shallow-server checkout main &&
 
 	git clone --depth=1 --no-tags --no-single-branch \
 		"file://$PWD/shallow-server" shallow-client &&
@@ -247,7 +247,7 @@ test_expect_success 'shallow fetches check connectivity before writing shallow f
 	git -C "$REPO" config protocol.version 2 &&
 	git -C client config protocol.version 2 &&
 
-	git -C client fetch --depth=2 "$HTTPD_URL/one_time_perl/repo" master:a_branch &&
+	git -C client fetch --depth=2 "$HTTPD_URL/one_time_perl/repo" main:a_branch &&
 
 	# Craft a situation in which the server sends back an unshallow request
 	# with an empty packfile. This is done by refetching with a shorter
@@ -259,7 +259,7 @@ test_expect_success 'shallow fetches check connectivity before writing shallow f
 	       >"$HTTPD_ROOT_PATH/one-time-perl" &&
 	test_must_fail env GIT_TEST_SIDEBAND_ALL=0 git -C client \
 		fetch --depth=1 "$HTTPD_URL/one_time_perl/repo" \
-		master:a_branch &&
+		main:a_branch &&
 
 	# Ensure that the one-time-perl script was used.
 	! test -e "$HTTPD_ROOT_PATH/one-time-perl" &&
diff --git a/t/t5538-push-shallow.sh b/t/t5538-push-shallow.sh
index 1253429d5d..e91fcc173e 100755
--- a/t/t5538-push-shallow.sh
+++ b/t/t5538-push-shallow.sh
@@ -2,7 +2,7 @@
 
 test_description='push from/to a shallow clone'
 
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -47,9 +47,9 @@ test_expect_success 'push from shallow clone' '
 	(
 	cd shallow &&
 	commit 5 &&
-	git push ../.git +master:refs/remotes/shallow/master
+	git push ../.git +main:refs/remotes/shallow/main
 	) &&
-	git log --format=%s shallow/master >actual &&
+	git log --format=%s shallow/main >actual &&
 	git fsck &&
 	cat <<EOF >expect &&
 5
@@ -64,10 +64,10 @@ EOF
 test_expect_success 'push from shallow clone, with grafted roots' '
 	(
 	cd shallow2 &&
-	test_must_fail git push ../.git +master:refs/remotes/shallow2/master 2>err &&
-	grep "shallow2/master.*shallow update not allowed" err
+	test_must_fail git push ../.git +main:refs/remotes/shallow2/main 2>err &&
+	grep "shallow2/main.*shallow update not allowed" err
 	) &&
-	test_must_fail git rev-parse shallow2/master &&
+	test_must_fail git rev-parse shallow2/main &&
 	git fsck
 '
 
@@ -75,9 +75,9 @@ test_expect_success 'add new shallow root with receive.updateshallow on' '
 	test_config receive.shallowupdate true &&
 	(
 	cd shallow2 &&
-	git push ../.git +master:refs/remotes/shallow2/master
+	git push ../.git +main:refs/remotes/shallow2/main
 	) &&
-	git log --format=%s shallow2/master >actual &&
+	git log --format=%s shallow2/main >actual &&
 	git fsck &&
 	cat <<EOF >expect &&
 c
@@ -90,12 +90,12 @@ test_expect_success 'push from shallow to shallow' '
 	(
 	cd shallow &&
 	git --git-dir=../shallow2/.git config receive.shallowupdate true &&
-	git push ../shallow2/.git +master:refs/remotes/shallow/master &&
+	git push ../shallow2/.git +main:refs/remotes/shallow/main &&
 	git --git-dir=../shallow2/.git config receive.shallowupdate false
 	) &&
 	(
 	cd shallow2 &&
-	git log --format=%s shallow/master >actual &&
+	git log --format=%s shallow/main >actual &&
 	git fsck &&
 	cat <<EOF >expect &&
 5
@@ -109,10 +109,10 @@ EOF
 test_expect_success 'push from full to shallow' '
 	! git --git-dir=shallow2/.git cat-file blob $(echo 1|git hash-object --stdin) &&
 	commit 1 &&
-	git push shallow2/.git +master:refs/remotes/top/master &&
+	git push shallow2/.git +main:refs/remotes/top/main &&
 	(
 	cd shallow2 &&
-	git log --format=%s top/master >actual &&
+	git log --format=%s top/main >actual &&
 	git fsck &&
 	cat <<EOF >expect &&
 1
diff --git a/t/t5539-fetch-http-shallow.sh b/t/t5539-fetch-http-shallow.sh
index 1da2a7533e..3ea75d34ca 100755
--- a/t/t5539-fetch-http-shallow.sh
+++ b/t/t5539-fetch-http-shallow.sh
@@ -2,7 +2,7 @@
 
 test_description='fetch/clone from a shallow clone over http'
 
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -35,7 +35,7 @@ test_expect_success 'clone http repository' '
 	(
 	cd clone &&
 	git fsck &&
-	git log --format=%s origin/master >actual &&
+	git log --format=%s origin/main >actual &&
 	cat <<EOF >expect &&
 7
 6
@@ -63,9 +63,9 @@ test_expect_success 'no shallow lines after receiving ACK ready' '
 				refs/heads/unrelated$i:refs/heads/unrelated$i ||
 			exit 1
 		done &&
-		git checkout master &&
+		git checkout main &&
 		test_commit new &&
-		git push  "$HTTPD_DOCUMENT_ROOT_PATH/repo.git" master
+		git push  "$HTTPD_DOCUMENT_ROOT_PATH/repo.git" main
 	) &&
 	(
 		cd clone &&
@@ -98,7 +98,7 @@ test_expect_success 'clone shallow since ...' '
 
 test_expect_success 'fetch shallow since ...' '
 	git -C shallow11 fetch --shallow-since "200000000 +0700" origin &&
-	git -C shallow11 log --pretty=tformat:%s origin/master >actual &&
+	git -C shallow11 log --pretty=tformat:%s origin/main >actual &&
 	cat >expected <<-\EOF &&
 	three
 	two
@@ -123,7 +123,7 @@ test_expect_success 'shallow clone exclude tag two' '
 
 test_expect_success 'fetch exclude tag one' '
 	git -C shallow12 fetch --shallow-exclude one origin &&
-	git -C shallow12 log --pretty=tformat:%s origin/master >actual &&
+	git -C shallow12 log --pretty=tformat:%s origin/main >actual &&
 	test_write_lines three two >expected &&
 	test_cmp expected actual
 '
@@ -139,12 +139,12 @@ test_expect_success 'fetching deepen' '
 	git clone --depth 1 $HTTPD_URL/smart/shallow-deepen.git deepen &&
 	mv "$HTTPD_DOCUMENT_ROOT_PATH/shallow-deepen.git" .git &&
 	test_commit four &&
-	git -C deepen log --pretty=tformat:%s master >actual &&
+	git -C deepen log --pretty=tformat:%s main >actual &&
 	echo three >expected &&
 	test_cmp expected actual &&
 	mv .git "$HTTPD_DOCUMENT_ROOT_PATH/shallow-deepen.git" &&
 	git -C deepen fetch --deepen=1 &&
-	git -C deepen log --pretty=tformat:%s origin/master >actual &&
+	git -C deepen log --pretty=tformat:%s origin/main >actual &&
 	cat >expected <<-\EOF &&
 	four
 	three
-- 
gitgitgadget


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH v3 16/28] t55[4-9]*: adjust the references to the default branch name "main"
  2020-11-18 23:44   ` [PATCH v3 00/28] tests: use main as default branch name Johannes Schindelin via GitGitGadget
                       ` (14 preceding siblings ...)
  2020-11-18 23:44     ` [PATCH v3 15/28] t55[23]*: " Johannes Schindelin via GitGitGadget
@ 2020-11-18 23:44     ` Johannes Schindelin via GitGitGadget
  2020-11-18 23:44     ` [PATCH v3 17/28] t5[6-9]*: " Johannes Schindelin via GitGitGadget
                       ` (12 subsequent siblings)
  28 siblings, 0 replies; 163+ messages in thread
From: Johannes Schindelin via GitGitGadget @ 2020-11-18 23:44 UTC (permalink / raw)
  To: git
  Cc: Felipe Contreras, Ævar Arnfjörð Bjarmason,
	Johannes Schindelin, Jeff King, Jonathan Nieder,
	Johannes Schindelin, Johannes Schindelin

From: Johannes Schindelin <johannes.schindelin@gmx.de>

This trick was performed via

	$ (cd t &&
	   sed -i -e 's/master/main/g' -e 's/MASTER/MAIN/g' \
		-e 's/Master/Main/g' -e 's/retsam/niam/g' \
		-- t55[4-9]*.sh t556x*)

This allows us to define `GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main`
for those tests.

Note that t5541 uses the reversed `master` name: `retsam`. We replace it
by the equivalent for `main`: `niam`.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
---
 t/t5540-http-push-webdav.sh          | 10 ++--
 t/t5541-http-push-smart.sh           | 42 +++++++-------
 t/t5542-push-http-shallow.sh         | 10 ++--
 t/t5543-atomic-push.sh               | 82 +++++++++++++--------------
 t/t5545-push-options.sh              | 64 ++++++++++-----------
 t/t5548-push-porcelain.sh            | 64 ++++++++++-----------
 t/t5550-http-fetch-dumb.sh           | 22 ++++----
 t/t5551-http-fetch-smart.sh          | 22 ++++----
 t/t5552-skipping-fetch-negotiator.sh |  2 +-
 t/t5553-set-upstream.sh              | 84 ++++++++++++++--------------
 t/t5560-http-backend-noserver.sh     |  2 +-
 t/t5561-http-backend.sh              |  6 +-
 t/t556x_common                       |  8 +--
 t/t5570-git-daemon.sh                | 18 +++---
 t/t5571-pre-push-hook.sh             |  6 +-
 t/t5572-pull-submodule.sh            |  4 +-
 t/t5580-unc-paths.sh                 |  4 +-
 t/t5581-http-curl-verbose.sh         |  4 +-
 t/t5582-fetch-negative-refspec.sh    | 24 ++++----
 19 files changed, 239 insertions(+), 239 deletions(-)

diff --git a/t/t5540-http-push-webdav.sh b/t/t5540-http-push-webdav.sh
index 751116e123..8b68bb38a4 100755
--- a/t/t5540-http-push-webdav.sh
+++ b/t/t5540-http-push-webdav.sh
@@ -7,7 +7,7 @@ test_description='test WebDAV http-push
 
 This test runs various sanity checks on http-push.'
 
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -74,7 +74,7 @@ test_expect_success 'push already up-to-date' '
 test_expect_success 'push to remote repository with unpacked refs' '
 	(cd "$HTTPD_DOCUMENT_ROOT_PATH"/test_repo.git &&
 	 rm packed-refs &&
-	 git update-ref refs/heads/master $ORIG_HEAD &&
+	 git update-ref refs/heads/main $ORIG_HEAD &&
 	 git --bare update-server-info) &&
 	git push &&
 	(cd "$HTTPD_DOCUMENT_ROOT_PATH"/test_repo.git &&
@@ -94,7 +94,7 @@ test_expect_success 'http-push fetches unpacked objects' '
 	 git remote rm origin &&
 	 git reflog expire --expire=0 --all &&
 	 git prune &&
-	 git push -f -v $HTTPD_URL/dumb/test_repo_unpacked.git master)
+	 git push -f -v $HTTPD_URL/dumb/test_repo_unpacked.git main)
 '
 
 test_expect_success 'http-push fetches packed objects' '
@@ -114,7 +114,7 @@ test_expect_success 'http-push fetches packed objects' '
 	 git remote remove origin &&
 	 git reflog expire --expire=0 --all &&
 	 git prune &&
-	 git push -f -v $HTTPD_URL/dumb/test_repo_packed.git master)
+	 git push -f -v $HTTPD_URL/dumb/test_repo_packed.git main)
 '
 
 test_expect_success 'create and delete remote branch' '
@@ -166,7 +166,7 @@ test_expect_success 'PUT and MOVE sends object to URLs with SHA-1 hash suffix' '
 '
 
 test_http_push_nonff "$HTTPD_DOCUMENT_ROOT_PATH"/test_repo.git \
-	"$ROOT_PATH"/test_repo_clone master
+	"$ROOT_PATH"/test_repo_clone main
 
 test_expect_success 'push to password-protected repository (user in URL)' '
 	test_commit pw-user &&
diff --git a/t/t5541-http-push-smart.sh b/t/t5541-http-push-smart.sh
index 2836b87239..bc5ccf233f 100755
--- a/t/t5541-http-push-smart.sh
+++ b/t/t5541-http-push-smart.sh
@@ -4,7 +4,7 @@
 #
 
 test_description='test smart pushing over http via http-backend'
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -145,23 +145,23 @@ test_expect_success 'used receive-pack service' '
 '
 
 test_http_push_nonff "$HTTPD_DOCUMENT_ROOT_PATH"/test_repo.git \
-	"$ROOT_PATH"/test_repo_clone master 		success
+	"$ROOT_PATH"/test_repo_clone main 		success
 
 test_expect_success 'push fails for non-fast-forward refs unmatched by remote helper' '
 	# create a dissimilarly-named remote ref so that git is unable to match the
 	# two refs (viz. local, remote) unless an explicit refspec is provided.
-	git push origin master:retsam &&
+	git push origin main:niam &&
 
 	echo "change changed" > path2 &&
 	git commit -a -m path2 --amend &&
 
-	# push master too; this ensures there is at least one '"'push'"' command to
+	# push main too; this ensures there is at least one '"'push'"' command to
 	# the remote helper and triggers interaction with the helper.
-	test_must_fail git push -v origin +master master:retsam >output 2>&1'
+	test_must_fail git push -v origin +main main:niam >output 2>&1'
 
 test_expect_success 'push fails for non-fast-forward refs unmatched by remote helper: remote output' '
-	grep "^ + [a-f0-9]*\.\.\.[a-f0-9]* *master -> master (forced update)$" output &&
-	grep "^ ! \[rejected\] *master -> retsam (non-fast-forward)$" output
+	grep "^ + [a-f0-9]*\.\.\.[a-f0-9]* *main -> main (forced update)$" output &&
+	grep "^ ! \[rejected\] *main -> niam (non-fast-forward)$" output
 '
 
 test_expect_success 'push fails for non-fast-forward refs unmatched by remote helper: our output' '
@@ -170,7 +170,7 @@ test_expect_success 'push fails for non-fast-forward refs unmatched by remote he
 '
 
 test_expect_success 'push (chunked)' '
-	git checkout master &&
+	git checkout main &&
 	test_commit commit path3 &&
 	HEAD=$(git rev-parse --verify HEAD) &&
 	test_config http.postbuffer 4 &&
@@ -180,9 +180,9 @@ test_expect_success 'push (chunked)' '
 	 test $HEAD = $(git rev-parse --verify HEAD))
 '
 
-## References of remote: atomic1(1)            master(2) collateral(2) other(2)
-## References of local :            atomic2(2) master(1) collateral(3) other(2) collateral1(3) atomic(1)
-## Atomic push         :                       master(1) collateral(3)                         atomic(1)
+## References of remote: atomic1(1)            main(2) collateral(2) other(2)
+## References of local :            atomic2(2) main(1) collateral(3) other(2) collateral1(3) atomic(1)
+## Atomic push         :                       main(1) collateral(3)                         atomic(1)
 test_expect_success 'push --atomic also prevents branch creation, reports collateral' '
 	# Setup upstream repo - empty for now
 	d=$HTTPD_DOCUMENT_ROOT_PATH/atomic-branches.git &&
@@ -195,15 +195,15 @@ test_expect_success 'push --atomic also prevents branch creation, reports collat
 	test_commit atomic2 &&
 	git branch collateral &&
 	git branch other &&
-	git push "$up" atomic1 master collateral other &&
+	git push "$up" atomic1 main collateral other &&
 	git tag -d atomic1 &&
 
 	# collateral is a valid push, but should be failed by atomic push
 	git checkout collateral &&
 	test_commit collateral1 &&
 
-	# Make master incompatible with upstream to provoke atomic
-	git checkout master &&
+	# Make main incompatible with upstream to provoke atomic
+	git checkout main &&
 	git reset --hard HEAD^ &&
 
 	# Add a new branch which should be failed by atomic push. This is a
@@ -211,7 +211,7 @@ test_expect_success 'push --atomic also prevents branch creation, reports collat
 	git branch atomic &&
 
 	# --atomic should cause entire push to be rejected
-	test_must_fail git push --atomic "$up" master atomic collateral 2>output &&
+	test_must_fail git push --atomic "$up" main atomic collateral 2>output &&
 
 	# the new branch should not have been created upstream
 	test_must_fail git -C "$d" show-ref --verify refs/heads/atomic &&
@@ -219,15 +219,15 @@ test_expect_success 'push --atomic also prevents branch creation, reports collat
 	# upstream should still reflect atomic2, the last thing we pushed
 	# successfully
 	git rev-parse atomic2 >expected &&
-	# on master...
-	git -C "$d" rev-parse refs/heads/master >actual &&
+	# on main...
+	git -C "$d" rev-parse refs/heads/main >actual &&
 	test_cmp expected actual &&
 	# ...and collateral.
 	git -C "$d" rev-parse refs/heads/collateral >actual &&
 	test_cmp expected actual &&
 
 	# the failed refs should be indicated to the user
-	grep "^ ! .*rejected.* master -> master" output &&
+	grep "^ ! .*rejected.* main -> main" output &&
 
 	# the collateral failure refs should be indicated to the user
 	grep "^ ! .*rejected.* atomic -> atomic .*atomic push failed" output &&
@@ -475,9 +475,9 @@ test_expect_success 'clone/fetch scrubs password from reflogs' '
 	test_commit prepare-for-force-fetch &&
 	git switch -c away &&
 	git fetch "$HTTPD_URL_USER_PASS/smart/test_repo.git" \
-		+master:master &&
+		+main:main &&
 	# should have been scrubbed down to vanilla URL
-	git log -g master >reflog &&
+	git log -g main >reflog &&
 	grep "$HTTPD_URL" reflog &&
 	! grep "$HTTPD_URL_USER_PASS" reflog
 '
@@ -501,7 +501,7 @@ test_expect_success 'colorize errors/hints' '
 	cd "$ROOT_PATH"/test_repo_clone &&
 	test_must_fail git -c color.transport=always -c color.advice=always \
 		-c color.push=always \
-		push origin origin/master^:master 2>act &&
+		push origin origin/main^:main 2>act &&
 	test_decode_color <act >decoded &&
 	test_i18ngrep "<RED>.*rejected.*<RESET>" decoded &&
 	test_i18ngrep "<RED>error: failed to push some refs" decoded &&
diff --git a/t/t5542-push-http-shallow.sh b/t/t5542-push-http-shallow.sh
index 0feec9c449..c2cc83182f 100755
--- a/t/t5542-push-http-shallow.sh
+++ b/t/t5542-push-http-shallow.sh
@@ -2,7 +2,7 @@
 
 test_description='push from/to a shallow clone over http'
 
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -54,12 +54,12 @@ test_expect_success 'push to shallow repo via http' '
 	(
 	cd full &&
 	commit 9 &&
-	git push $HTTPD_URL/smart/repo.git +master:refs/remotes/top/master
+	git push $HTTPD_URL/smart/repo.git +main:refs/remotes/top/main
 	) &&
 	(
 	cd "$HTTPD_DOCUMENT_ROOT_PATH/repo.git" &&
 	git fsck &&
-	git log --format=%s top/master >actual &&
+	git log --format=%s top/main >actual &&
 	cat <<EOF >expect &&
 9
 4
@@ -77,11 +77,11 @@ test_expect_success 'push from shallow repo via http' '
 	git config http.receivepack true
 	) &&
 	commit 10 &&
-	git push $HTTPD_URL/smart/repo.git +master:refs/remotes/top/master &&
+	git push $HTTPD_URL/smart/repo.git +main:refs/remotes/top/main &&
 	(
 	cd "$HTTPD_DOCUMENT_ROOT_PATH/repo.git" &&
 	git fsck &&
-	git log --format=%s top/master >actual &&
+	git log --format=%s top/main >actual &&
 	cat <<EOF >expect &&
 10
 4
diff --git a/t/t5543-atomic-push.sh b/t/t5543-atomic-push.sh
index 16a8fc7535..bfee461861 100755
--- a/t/t5543-atomic-push.sh
+++ b/t/t5543-atomic-push.sh
@@ -2,7 +2,7 @@
 
 test_description='pushing to a repository using the atomic push option'
 
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -43,9 +43,9 @@ test_expect_success 'atomic push works for a single branch' '
 		test_commit one &&
 		git push --mirror up &&
 		test_commit two &&
-		git push --atomic up master
+		git push --atomic up main
 	) &&
-	test_refs master master
+	test_refs main main
 '
 
 test_expect_success 'atomic push works for two branches' '
@@ -58,9 +58,9 @@ test_expect_success 'atomic push works for two branches' '
 		test_commit two &&
 		git checkout second &&
 		test_commit three &&
-		git push --atomic up master second
+		git push --atomic up main second
 	) &&
-	test_refs master master &&
+	test_refs main main &&
 	test_refs second second
 '
 
@@ -73,7 +73,7 @@ test_expect_success 'atomic push works in combination with --mirror' '
 		test_commit two &&
 		git push --atomic --mirror up
 	) &&
-	test_refs master master &&
+	test_refs main main &&
 	test_refs second second
 '
 
@@ -82,7 +82,7 @@ test_expect_success 'atomic push works in combination with --force' '
 	(
 		cd workbench &&
 		test_commit one &&
-		git branch second master &&
+		git branch second main &&
 		test_commit two_a &&
 		git checkout second &&
 		test_commit two_b &&
@@ -90,36 +90,36 @@ test_expect_success 'atomic push works in combination with --force' '
 		test_commit four &&
 		git push --mirror up &&
 		# The actual test is below
-		git checkout master &&
+		git checkout main &&
 		test_commit three_a &&
 		git checkout second &&
 		git reset --hard HEAD^ &&
-		git push --force --atomic up master second
+		git push --force --atomic up main second
 	) &&
-	test_refs master master &&
+	test_refs main main &&
 	test_refs second second
 '
 
-# set up two branches where master can be pushed but second can not
+# set up two branches where main can be pushed but second can not
 # (non-fast-forward). Since second can not be pushed the whole operation
-# will fail and leave master untouched.
+# will fail and leave main untouched.
 test_expect_success 'atomic push fails if one branch fails' '
 	mk_repo_pair &&
 	(
 		cd workbench &&
 		test_commit one &&
-		git checkout -b second master &&
+		git checkout -b second main &&
 		test_commit two &&
 		test_commit three &&
 		test_commit four &&
 		git push --mirror up &&
 		git reset --hard HEAD~2 &&
 		test_commit five &&
-		git checkout master &&
+		git checkout main &&
 		test_commit six &&
 		test_must_fail git push --atomic --all up
 	) &&
-	test_refs master HEAD@{7} &&
+	test_refs main HEAD@{7} &&
 	test_refs second HEAD@{4}
 '
 
@@ -129,7 +129,7 @@ test_expect_success 'atomic push fails if one tag fails remotely' '
 	(
 		cd workbench &&
 		test_commit one &&
-		git checkout -b second master &&
+		git checkout -b second main &&
 		test_commit two &&
 		git push --mirror up
 	) &&
@@ -142,14 +142,14 @@ test_expect_success 'atomic push fails if one tag fails remotely' '
 	# see if we can now push both branches.
 	(
 		cd workbench &&
-		git checkout master &&
+		git checkout main &&
 		test_commit three &&
 		git checkout second &&
 		test_commit four &&
 		git tag test_tag &&
-		test_must_fail git push --tags --atomic up master second
+		test_must_fail git push --tags --atomic up main second
 	) &&
-	test_refs master HEAD@{3} &&
+	test_refs main HEAD@{3} &&
 	test_refs second HEAD@{1}
 '
 
@@ -158,7 +158,7 @@ test_expect_success 'atomic push obeys update hook preventing a branch to be pus
 	(
 		cd workbench &&
 		test_commit one &&
-		git checkout -b second master &&
+		git checkout -b second main &&
 		test_commit two &&
 		git push --mirror up
 	) &&
@@ -168,19 +168,19 @@ test_expect_success 'atomic push obeys update hook preventing a branch to be pus
 		HOOK="$HOOKDIR/update" &&
 		mkdir -p "$HOOKDIR" &&
 		write_script "$HOOK" <<-\EOF
-			# only allow update to master from now on
-			test "$1" = "refs/heads/master"
+			# only allow update to main from now on
+			test "$1" = "refs/heads/main"
 		EOF
 	) &&
 	(
 		cd workbench &&
-		git checkout master &&
+		git checkout main &&
 		test_commit three &&
 		git checkout second &&
 		test_commit four &&
-		test_must_fail git push --atomic up master second
+		test_must_fail git push --atomic up main second
 	) &&
-	test_refs master HEAD@{3} &&
+	test_refs main HEAD@{3} &&
 	test_refs second HEAD@{1}
 '
 
@@ -195,21 +195,21 @@ test_expect_success 'atomic push is not advertised if configured' '
 		test_commit one &&
 		git push --mirror up &&
 		test_commit two &&
-		test_must_fail git push --atomic up master
+		test_must_fail git push --atomic up main
 	) &&
-	test_refs master HEAD@{1}
+	test_refs main HEAD@{1}
 '
 
-# References in upstream : master(1) one(1) foo(1)
-# References in workbench: master(2)        foo(1) two(2) bar(2)
-# Atomic push            : master(2)               two(2) bar(2)
+# References in upstream : main(1) one(1) foo(1)
+# References in workbench: main(2)        foo(1) two(2) bar(2)
+# Atomic push            : main(2)               two(2) bar(2)
 test_expect_success 'atomic push reports (reject by update hook)' '
 	mk_repo_pair &&
 	(
 		cd workbench &&
 		test_commit one &&
 		git branch foo &&
-		git push up master one foo &&
+		git push up main one foo &&
 		git tag -d one
 	) &&
 	(
@@ -231,19 +231,19 @@ test_expect_success 'atomic push reports (reject by update hook)' '
 		git branch bar
 	) &&
 	test_must_fail git -C workbench \
-		push --atomic up master two bar >out 2>&1 &&
+		push --atomic up main two bar >out 2>&1 &&
 	fmt_status_report <out >actual &&
 	cat >expect <<-EOF &&
 	To ../upstream
-	 ! [remote rejected] master -> master (atomic push failure)
+	 ! [remote rejected] main -> main (atomic push failure)
 	 ! [remote rejected] two -> two (atomic push failure)
 	 ! [remote rejected] bar -> bar (hook declined)
 	EOF
 	test_cmp expect actual
 '
 
-# References in upstream : master(1) one(1) foo(1)
-# References in workbench: master(2)        foo(1) two(2) bar(2)
+# References in upstream : main(1) one(1) foo(1)
+# References in workbench: main(2)        foo(1) two(2) bar(2)
 test_expect_success 'atomic push reports (mirror, but reject by update hook)' '
 	(
 		cd workbench &&
@@ -255,7 +255,7 @@ test_expect_success 'atomic push reports (mirror, but reject by update hook)' '
 	fmt_status_report <out >actual &&
 	cat >expect <<-EOF &&
 	To ../upstream
-	 ! [remote rejected] master -> master (atomic push failure)
+	 ! [remote rejected] main -> main (atomic push failure)
 	 ! [remote rejected] one (atomic push failure)
 	 ! [remote rejected] bar -> bar (hook declined)
 	 ! [remote rejected] two -> two (atomic push failure)
@@ -263,21 +263,21 @@ test_expect_success 'atomic push reports (mirror, but reject by update hook)' '
 	test_cmp expect actual
 '
 
-# References in upstream : master(2) one(1) foo(1)
-# References in workbench: master(1)        foo(1) two(2) bar(2)
+# References in upstream : main(2) one(1) foo(1)
+# References in workbench: main(1)        foo(1) two(2) bar(2)
 test_expect_success 'atomic push reports (reject by non-ff)' '
 	rm upstream/.git/hooks/update &&
 	(
 		cd workbench &&
-		git push up master &&
+		git push up main &&
 		git reset --hard HEAD^
 	) &&
 	test_must_fail git -C workbench \
-		push --atomic up master foo bar >out 2>&1 &&
+		push --atomic up main foo bar >out 2>&1 &&
 	fmt_status_report <out >actual &&
 	cat >expect <<-EOF &&
 	To ../upstream
-	 ! [rejected] master -> master (non-fast-forward)
+	 ! [rejected] main -> main (non-fast-forward)
 	 ! [rejected] bar -> bar (atomic push failed)
 	EOF
 	test_cmp expect actual
diff --git a/t/t5545-push-options.sh b/t/t5545-push-options.sh
index 202d75aebe..58c7add7ee 100755
--- a/t/t5545-push-options.sh
+++ b/t/t5545-push-options.sh
@@ -2,7 +2,7 @@
 
 test_description='pushing to a repository using push options'
 
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -66,9 +66,9 @@ test_expect_success 'one push option works for a single branch' '
 		test_commit one &&
 		git push --mirror up &&
 		test_commit two &&
-		git push --push-option=asdf up master
+		git push --push-option=asdf up main
 	) &&
-	test_refs master master &&
+	test_refs main main &&
 	echo "asdf" >expect &&
 	test_cmp expect upstream/.git/hooks/pre-receive.push_options &&
 	test_cmp expect upstream/.git/hooks/post-receive.push_options
@@ -82,9 +82,9 @@ test_expect_success 'push option denied by remote' '
 		test_commit one &&
 		git push --mirror up &&
 		test_commit two &&
-		test_must_fail git push --push-option=asdf up master
+		test_must_fail git push --push-option=asdf up main
 	) &&
-	test_refs master HEAD@{1}
+	test_refs main HEAD@{1}
 '
 
 test_expect_success 'two push options work' '
@@ -95,9 +95,9 @@ test_expect_success 'two push options work' '
 		test_commit one &&
 		git push --mirror up &&
 		test_commit two &&
-		git push --push-option=asdf --push-option="more structured text" up master
+		git push --push-option=asdf --push-option="more structured text" up main
 	) &&
-	test_refs master master &&
+	test_refs main main &&
 	printf "asdf\nmore structured text\n" >expect &&
 	test_cmp expect upstream/.git/hooks/pre-receive.push_options &&
 	test_cmp expect upstream/.git/hooks/post-receive.push_options
@@ -126,14 +126,14 @@ test_expect_success 'push options and submodules' '
 
 	git -C parent push \
 		--push-option=asdf --push-option="more structured text" \
-		--recurse-submodules=on-demand up master &&
+		--recurse-submodules=on-demand up main &&
 
-	git -C upstream rev-parse --verify master >expect &&
-	git -C parent/workbench rev-parse --verify master >actual &&
+	git -C upstream rev-parse --verify main >expect &&
+	git -C parent/workbench rev-parse --verify main >actual &&
 	test_cmp expect actual &&
 
-	git -C parent_upstream rev-parse --verify master >expect &&
-	git -C parent rev-parse --verify master >actual &&
+	git -C parent_upstream rev-parse --verify main >expect &&
+	git -C parent rev-parse --verify main >actual &&
 	test_cmp expect actual &&
 
 	printf "asdf\nmore structured text\n" >expect &&
@@ -151,9 +151,9 @@ test_expect_success 'default push option' '
 		test_commit one &&
 		git push --mirror up &&
 		test_commit two &&
-		git -c push.pushOption=default push up master
+		git -c push.pushOption=default push up main
 	) &&
-	test_refs master master &&
+	test_refs main main &&
 	echo "default" >expect &&
 	test_cmp expect upstream/.git/hooks/pre-receive.push_options &&
 	test_cmp expect upstream/.git/hooks/post-receive.push_options
@@ -167,9 +167,9 @@ test_expect_success 'two default push options' '
 		test_commit one &&
 		git push --mirror up &&
 		test_commit two &&
-		git -c push.pushOption=default1 -c push.pushOption=default2 push up master
+		git -c push.pushOption=default1 -c push.pushOption=default2 push up main
 	) &&
-	test_refs master master &&
+	test_refs main main &&
 	printf "default1\ndefault2\n" >expect &&
 	test_cmp expect upstream/.git/hooks/pre-receive.push_options &&
 	test_cmp expect upstream/.git/hooks/post-receive.push_options
@@ -183,9 +183,9 @@ test_expect_success 'push option from command line overrides from-config push op
 		test_commit one &&
 		git push --mirror up &&
 		test_commit two &&
-		git -c push.pushOption=default push --push-option=manual up master
+		git -c push.pushOption=default push --push-option=manual up main
 	) &&
-	test_refs master master &&
+	test_refs main main &&
 	echo "manual" >expect &&
 	test_cmp expect upstream/.git/hooks/pre-receive.push_options &&
 	test_cmp expect upstream/.git/hooks/post-receive.push_options
@@ -199,9 +199,9 @@ test_expect_success 'empty value of push.pushOption in config clears the list' '
 		test_commit one &&
 		git push --mirror up &&
 		test_commit two &&
-		git -c push.pushOption=default1 -c push.pushOption= -c push.pushOption=default2 push up master
+		git -c push.pushOption=default1 -c push.pushOption= -c push.pushOption=default2 push up main
 	) &&
-	test_refs master master &&
+	test_refs main main &&
 	echo "default2" >expect &&
 	test_cmp expect upstream/.git/hooks/pre-receive.push_options &&
 	test_cmp expect upstream/.git/hooks/post-receive.push_options
@@ -215,16 +215,16 @@ test_expect_success 'invalid push option in config' '
 		test_commit one &&
 		git push --mirror up &&
 		test_commit two &&
-		test_must_fail git -c push.pushOption push up master
+		test_must_fail git -c push.pushOption push up main
 	) &&
-	test_refs master HEAD@{1}
+	test_refs main HEAD@{1}
 '
 
 test_expect_success 'push options keep quoted characters intact (direct)' '
 	mk_repo_pair &&
 	git -C upstream config receive.advertisePushOptions true &&
 	test_commit -C workbench one &&
-	git -C workbench push --push-option="\"embedded quotes\"" up master &&
+	git -C workbench push --push-option="\"embedded quotes\"" up main &&
 	echo "\"embedded quotes\"" >expect &&
 	test_cmp expect upstream/.git/hooks/pre-receive.push_options
 '
@@ -247,28 +247,28 @@ mk_http_pair () {
 test_expect_success 'push option denied properly by http server' '
 	mk_http_pair false &&
 	test_commit -C test_http_clone one &&
-	test_must_fail git -C test_http_clone push --push-option=asdf origin master 2>actual &&
+	test_must_fail git -C test_http_clone push --push-option=asdf origin main 2>actual &&
 	test_i18ngrep "the receiving end does not support push options" actual &&
-	git -C test_http_clone push origin master
+	git -C test_http_clone push origin main
 '
 
 test_expect_success 'push options work properly across http' '
 	mk_http_pair true &&
 
 	test_commit -C test_http_clone one &&
-	git -C test_http_clone push origin master &&
-	git -C "$HTTPD_DOCUMENT_ROOT_PATH"/upstream.git rev-parse --verify master >expect &&
-	git -C test_http_clone rev-parse --verify master >actual &&
+	git -C test_http_clone push origin main &&
+	git -C "$HTTPD_DOCUMENT_ROOT_PATH"/upstream.git rev-parse --verify main >expect &&
+	git -C test_http_clone rev-parse --verify main >actual &&
 	test_cmp expect actual &&
 
 	test_commit -C test_http_clone two &&
-	git -C test_http_clone push --push-option=asdf --push-option="more structured text" origin master &&
+	git -C test_http_clone push --push-option=asdf --push-option="more structured text" origin main &&
 	printf "asdf\nmore structured text\n" >expect &&
 	test_cmp expect "$HTTPD_DOCUMENT_ROOT_PATH"/upstream.git/hooks/pre-receive.push_options &&
 	test_cmp expect "$HTTPD_DOCUMENT_ROOT_PATH"/upstream.git/hooks/post-receive.push_options &&
 
-	git -C "$HTTPD_DOCUMENT_ROOT_PATH"/upstream.git rev-parse --verify master >expect &&
-	git -C test_http_clone rev-parse --verify master >actual &&
+	git -C "$HTTPD_DOCUMENT_ROOT_PATH"/upstream.git rev-parse --verify main >expect &&
+	git -C test_http_clone rev-parse --verify main >actual &&
 	test_cmp expect actual
 '
 
@@ -276,7 +276,7 @@ test_expect_success 'push options keep quoted characters intact (http)' '
 	mk_http_pair true &&
 
 	test_commit -C test_http_clone one &&
-	git -C test_http_clone push --push-option="\"embedded quotes\"" origin master &&
+	git -C test_http_clone push --push-option="\"embedded quotes\"" origin main &&
 	echo "\"embedded quotes\"" >expect &&
 	test_cmp expect "$HTTPD_DOCUMENT_ROOT_PATH"/upstream.git/hooks/pre-receive.push_options
 '
diff --git a/t/t5548-push-porcelain.sh b/t/t5548-push-porcelain.sh
index 1b19b3ef55..5a761f3642 100755
--- a/t/t5548-push-porcelain.sh
+++ b/t/t5548-push-porcelain.sh
@@ -36,7 +36,7 @@ create_commits_in () {
 		shift ||
 		return 1
 	done &&
-	git -C "$repo" update-ref refs/heads/master $oid
+	git -C "$repo" update-ref refs/heads/main $oid
 }
 
 # Format the output of git-push, git-show-ref and other commands to make a
@@ -57,8 +57,8 @@ make_user_friendly_and_stable_output () {
 }
 
 setup_upstream_and_workbench () {
-	# Upstream  after setup : master(B)  foo(A)  bar(A)  baz(A)
-	# Workbench after setup : master(A)
+	# Upstream  after setup : main(B)  foo(A)  bar(A)  baz(A)
+	# Workbench after setup : main(A)
 	test_expect_success "setup upstream repository and workbench" '
 		rm -rf upstream.git workbench &&
 		git init --bare upstream.git &&
@@ -70,9 +70,9 @@ setup_upstream_and_workbench () {
 			# this fixed-width oid will be replaced with "<OID>".
 			git config core.abbrev 7 &&
 			git remote add origin ../upstream.git &&
-			git update-ref refs/heads/master $A &&
+			git update-ref refs/heads/main $A &&
 			git push origin \
-				$B:refs/heads/master \
+				$B:refs/heads/main \
 				$A:refs/heads/foo \
 				$A:refs/heads/bar \
 				$A:refs/heads/baz
@@ -94,17 +94,17 @@ run_git_push_porcelain_output_test() {
 		;;
 	esac
 
-	# Refs of upstream : master(B)  foo(A)  bar(A)  baz(A)
-	# Refs of workbench: master(A)                  baz(A)  next(A)
-	# git-push         : master(A)  NULL    (B)     baz(A)  next(A)
+	# Refs of upstream : main(B)  foo(A)  bar(A)  baz(A)
+	# Refs of workbench: main(A)                  baz(A)  next(A)
+	# git-push         : main(A)  NULL    (B)     baz(A)  next(A)
 	test_expect_success "porcelain output of successful git-push ($PROTOCOL)" '
 		(
 			cd workbench &&
-			git update-ref refs/heads/master $A &&
+			git update-ref refs/heads/main $A &&
 			git update-ref refs/heads/baz $A &&
 			git update-ref refs/heads/next $A &&
 			git push --porcelain --force origin \
-				master \
+				main \
 				:refs/heads/foo \
 				$B:bar \
 				baz \
@@ -116,7 +116,7 @@ run_git_push_porcelain_output_test() {
 		=    refs/heads/baz:refs/heads/baz    [up to date]
 		     <COMMIT-B>:refs/heads/bar    <OID-A>..<OID-B>
 		-    :refs/heads/foo    [deleted]
-		+    refs/heads/master:refs/heads/master    <OID-B>...<OID-A> (forced update)
+		+    refs/heads/main:refs/heads/main    <OID-B>...<OID-A> (forced update)
 		*    refs/heads/next:refs/heads/next    [new branch]
 		Done
 		EOF
@@ -127,22 +127,22 @@ run_git_push_porcelain_output_test() {
 		cat >expect <<-EOF &&
 		<COMMIT-B> refs/heads/bar
 		<COMMIT-A> refs/heads/baz
-		<COMMIT-A> refs/heads/master
+		<COMMIT-A> refs/heads/main
 		<COMMIT-A> refs/heads/next
 		EOF
 		test_cmp expect actual
 	'
 
-	# Refs of upstream : master(A)  bar(B)  baz(A)  next(A)
-	# Refs of workbench: master(B)  bar(A)  baz(A)  next(A)
-	# git-push         : master(B)  bar(A)  NULL    next(A)
+	# Refs of upstream : main(A)  bar(B)  baz(A)  next(A)
+	# Refs of workbench: main(B)  bar(A)  baz(A)  next(A)
+	# git-push         : main(B)  bar(A)  NULL    next(A)
 	test_expect_success "atomic push failed ($PROTOCOL)" '
 		(
 			cd workbench &&
-			git update-ref refs/heads/master $B &&
+			git update-ref refs/heads/main $B &&
 			git update-ref refs/heads/bar $A &&
 			test_must_fail git push --atomic --porcelain origin \
-				master \
+				main \
 				bar \
 				:baz \
 				next
@@ -153,7 +153,7 @@ run_git_push_porcelain_output_test() {
 		=    refs/heads/next:refs/heads/next    [up to date]
 		!    refs/heads/bar:refs/heads/bar    [rejected] (non-fast-forward)
 		!    (delete):refs/heads/baz    [rejected] (atomic push failed)
-		!    refs/heads/master:refs/heads/master    [rejected] (atomic push failed)
+		!    refs/heads/main:refs/heads/main    [rejected] (atomic push failed)
 		Done
 		EOF
 		test_cmp expect actual &&
@@ -163,7 +163,7 @@ run_git_push_porcelain_output_test() {
 		cat >expect <<-EOF &&
 		<COMMIT-B> refs/heads/bar
 		<COMMIT-A> refs/heads/baz
-		<COMMIT-A> refs/heads/master
+		<COMMIT-A> refs/heads/main
 		<COMMIT-A> refs/heads/next
 		EOF
 		test_cmp expect actual
@@ -174,16 +174,16 @@ run_git_push_porcelain_output_test() {
 		EOF
 	'
 
-	# Refs of upstream : master(A)  bar(B)  baz(A)  next(A)
-	# Refs of workbench: master(B)  bar(A)  baz(A)  next(A)
-	# git-push         : master(B)  bar(A)  NULL    next(A)
+	# Refs of upstream : main(A)  bar(B)  baz(A)  next(A)
+	# Refs of workbench: main(B)  bar(A)  baz(A)  next(A)
+	# git-push         : main(B)  bar(A)  NULL    next(A)
 	test_expect_success "pre-receive hook declined ($PROTOCOL)" '
 		(
 			cd workbench &&
-			git update-ref refs/heads/master $B &&
+			git update-ref refs/heads/main $B &&
 			git update-ref refs/heads/bar $A &&
 			test_must_fail git push --porcelain --force origin \
-				master \
+				main \
 				bar \
 				:baz \
 				next
@@ -194,7 +194,7 @@ run_git_push_porcelain_output_test() {
 		=    refs/heads/next:refs/heads/next    [up to date]
 		!    refs/heads/bar:refs/heads/bar    [remote rejected] (pre-receive hook declined)
 		!    :refs/heads/baz    [remote rejected] (pre-receive hook declined)
-		!    refs/heads/master:refs/heads/master    [remote rejected] (pre-receive hook declined)
+		!    refs/heads/main:refs/heads/main    [remote rejected] (pre-receive hook declined)
 		Done
 		EOF
 		test_cmp expect actual &&
@@ -204,7 +204,7 @@ run_git_push_porcelain_output_test() {
 		cat >expect <<-EOF &&
 		<COMMIT-B> refs/heads/bar
 		<COMMIT-A> refs/heads/baz
-		<COMMIT-A> refs/heads/master
+		<COMMIT-A> refs/heads/main
 		<COMMIT-A> refs/heads/next
 		EOF
 		test_cmp expect actual
@@ -214,14 +214,14 @@ run_git_push_porcelain_output_test() {
 		rm "$upstream/hooks/pre-receive"
 	'
 
-	# Refs of upstream : master(A)  bar(B)  baz(A)  next(A)
-	# Refs of workbench: master(B)  bar(A)  baz(A)  next(A)
-	# git-push         : master(B)  bar(A)  NULL    next(A)
+	# Refs of upstream : main(A)  bar(B)  baz(A)  next(A)
+	# Refs of workbench: main(B)  bar(A)  baz(A)  next(A)
+	# git-push         : main(B)  bar(A)  NULL    next(A)
 	test_expect_success "non-fastforward push ($PROTOCOL)" '
 		(
 			cd workbench &&
 			test_must_fail git push --porcelain origin \
-				master \
+				main \
 				bar \
 				:baz \
 				next
@@ -231,7 +231,7 @@ run_git_push_porcelain_output_test() {
 		To <URL/of/upstream.git>
 		=    refs/heads/next:refs/heads/next    [up to date]
 		-    :refs/heads/baz    [deleted]
-		     refs/heads/master:refs/heads/master    <OID-A>..<OID-B>
+		     refs/heads/main:refs/heads/main    <OID-A>..<OID-B>
 		!    refs/heads/bar:refs/heads/bar    [rejected] (non-fast-forward)
 		Done
 		EOF
@@ -241,7 +241,7 @@ run_git_push_porcelain_output_test() {
 		make_user_friendly_and_stable_output <out >actual &&
 		cat >expect <<-EOF &&
 		<COMMIT-B> refs/heads/bar
-		<COMMIT-B> refs/heads/master
+		<COMMIT-B> refs/heads/main
 		<COMMIT-A> refs/heads/next
 		EOF
 		test_cmp expect actual
diff --git a/t/t5550-http-fetch-dumb.sh b/t/t5550-http-fetch-dumb.sh
index 9ec91792c3..2ecb06bb63 100755
--- a/t/t5550-http-fetch-dumb.sh
+++ b/t/t5550-http-fetch-dumb.sh
@@ -1,7 +1,7 @@
 #!/bin/sh
 
 test_description='test dumb fetching over http via static file'
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -29,7 +29,7 @@ test_expect_success 'create http-accessible bare repository with loose objects'
 	 hooks/post-update
 	) &&
 	git remote add public "$HTTPD_DOCUMENT_ROOT_PATH/repo.git" &&
-	git push public master:master
+	git push public main:main
 '
 
 test_expect_success 'clone http repository' '
@@ -40,8 +40,8 @@ test_expect_success 'clone http repository' '
 
 test_expect_success 'list refs from outside any repository' '
 	cat >expect <<-EOF &&
-	$(git rev-parse master)	HEAD
-	$(git rev-parse master)	refs/heads/master
+	$(git rev-parse main)	HEAD
+	$(git rev-parse main)	refs/heads/main
 	EOF
 	nongit git ls-remote "$HTTPD_URL/dumb/repo.git" >actual &&
 	test_cmp expect actual
@@ -184,8 +184,8 @@ test_expect_success 'fetch changes via manual http-fetch' '
 
 	HEAD=$(git rev-parse --verify HEAD) &&
 	(cd clone2 &&
-	 git http-fetch -a -w heads/master-new $HEAD $(git config remote.origin.url) &&
-	 git checkout master-new &&
+	 git http-fetch -a -w heads/main-new $HEAD $(git config remote.origin.url) &&
+	 git checkout main-new &&
 	 test $HEAD = $(git rev-parse --verify HEAD)) &&
 	test_cmp file clone2/file
 '
@@ -195,19 +195,19 @@ test_expect_success 'manual http-fetch without -a works just as well' '
 
 	HEAD=$(git rev-parse --verify HEAD) &&
 	(cd clone3 &&
-	 git http-fetch -w heads/master-new $HEAD $(git config remote.origin.url) &&
-	 git checkout master-new &&
+	 git http-fetch -w heads/main-new $HEAD $(git config remote.origin.url) &&
+	 git checkout main-new &&
 	 test $HEAD = $(git rev-parse --verify HEAD)) &&
 	test_cmp file clone3/file
 '
 
 test_expect_success 'http remote detects correct HEAD' '
-	git push public master:other &&
+	git push public main:other &&
 	(cd clone &&
 	 git remote set-head origin -d &&
 	 git remote set-head origin -a &&
 	 git symbolic-ref refs/remotes/origin/HEAD > output &&
-	 echo refs/remotes/origin/master > expect &&
+	 echo refs/remotes/origin/main > expect &&
 	 test_cmp expect output
 	)
 '
@@ -419,7 +419,7 @@ test_expect_success 'set up evil alternates scheme' '
 	evil=$HTTPD_DOCUMENT_ROOT_PATH/evil.git &&
 	git init --bare "$evil" &&
 	# do this by hand to avoid object existence check
-	printf "%s\\t%s\\n" $sha1 refs/heads/master >"$evil/info/refs"
+	printf "%s\\t%s\\n" $sha1 refs/heads/main >"$evil/info/refs"
 '
 
 # Here we'll just redirect via HTTP. In a real-world attack these would be on
diff --git a/t/t5551-http-fetch-smart.sh b/t/t5551-http-fetch-smart.sh
index 310b89dbab..984dba22af 100755
--- a/t/t5551-http-fetch-smart.sh
+++ b/t/t5551-http-fetch-smart.sh
@@ -1,7 +1,7 @@
 #!/bin/sh
 
 test_description='test smart fetching over http via http-backend'
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -21,7 +21,7 @@ test_expect_success 'create http-accessible bare repository' '
 	 git --bare init
 	) &&
 	git remote add public "$HTTPD_DOCUMENT_ROOT_PATH/repo.git" &&
-	git push public master:master
+	git push public main:main
 '
 
 setup_askpass_helper
@@ -241,9 +241,9 @@ test_expect_success 'invalid Content-Type rejected' '
 
 test_expect_success 'create namespaced refs' '
 	test_commit namespaced &&
-	git push public HEAD:refs/namespaces/ns/refs/heads/master &&
+	git push public HEAD:refs/namespaces/ns/refs/heads/main &&
 	git --git-dir="$HTTPD_DOCUMENT_ROOT_PATH/repo.git" \
-		symbolic-ref refs/namespaces/ns/HEAD refs/namespaces/ns/refs/heads/master
+		symbolic-ref refs/namespaces/ns/HEAD refs/namespaces/ns/refs/heads/main
 '
 
 test_expect_success 'smart clone respects namespace' '
@@ -274,7 +274,7 @@ test_expect_success 'cookies stored in http.cookiefile when http.savecookies set
 	EOF
 	git config http.cookiefile cookies.txt &&
 	git config http.savecookies true &&
-	git ls-remote $HTTPD_URL/smart_cookies/repo.git master &&
+	git ls-remote $HTTPD_URL/smart_cookies/repo.git main &&
 
 	# NEEDSWORK: If the overspecification of the expected result is reduced, we
 	# might be able to run this test in all protocol versions.
@@ -347,12 +347,12 @@ test_expect_success 'large fetch-pack requests can be sent using chunked encodin
 test_expect_success 'test allowreachablesha1inwant' '
 	test_when_finished "rm -rf test_reachable.git" &&
 	server="$HTTPD_DOCUMENT_ROOT_PATH/repo.git" &&
-	master_sha=$(git -C "$server" rev-parse refs/heads/master) &&
+	main_sha=$(git -C "$server" rev-parse refs/heads/main) &&
 	git -C "$server" config uploadpack.allowreachablesha1inwant 1 &&
 
 	git init --bare test_reachable.git &&
 	git -C test_reachable.git remote add origin "$HTTPD_URL/smart/repo.git" &&
-	git -C test_reachable.git fetch origin "$master_sha"
+	git -C test_reachable.git fetch origin "$main_sha"
 '
 
 test_expect_success 'test allowreachablesha1inwant with unreachable' '
@@ -366,7 +366,7 @@ test_expect_success 'test allowreachablesha1inwant with unreachable' '
 	git push public :refs/heads/doomed &&
 
 	server="$HTTPD_DOCUMENT_ROOT_PATH/repo.git" &&
-	master_sha=$(git -C "$server" rev-parse refs/heads/master) &&
+	main_sha=$(git -C "$server" rev-parse refs/heads/main) &&
 	git -C "$server" config uploadpack.allowreachablesha1inwant 1 &&
 
 	git init --bare test_reachable.git &&
@@ -388,7 +388,7 @@ test_expect_success 'test allowanysha1inwant with unreachable' '
 	git push public :refs/heads/doomed &&
 
 	server="$HTTPD_DOCUMENT_ROOT_PATH/repo.git" &&
-	master_sha=$(git -C "$server" rev-parse refs/heads/master) &&
+	main_sha=$(git -C "$server" rev-parse refs/heads/main) &&
 	git -C "$server" config uploadpack.allowreachablesha1inwant 1 &&
 
 	git init --bare test_reachable.git &&
@@ -447,8 +447,8 @@ test_expect_success 'using fetch command in remote-curl updates refs' '
 	test_commit -C "$SERVER" bar &&
 	git -C client -c protocol.version=0 fetch &&
 
-	git -C "$SERVER" rev-parse master >expect &&
-	git -C client rev-parse origin/master >actual &&
+	git -C "$SERVER" rev-parse main >expect &&
+	git -C client rev-parse origin/main >actual &&
 	test_cmp expect actual
 '
 
diff --git a/t/t5552-skipping-fetch-negotiator.sh b/t/t5552-skipping-fetch-negotiator.sh
index 156c704040..7b9fb4ff02 100755
--- a/t/t5552-skipping-fetch-negotiator.sh
+++ b/t/t5552-skipping-fetch-negotiator.sh
@@ -100,7 +100,7 @@ test_expect_success 'use ref advertisement to filter out commits' '
 	git -C server checkout --orphan anotherbranch &&
 	test_commit -C server to_fetch &&
 
-	# The server advertising "c3" (as "refs/heads/master") means that we do
+	# The server advertising "c3" (as "refs/heads/main") means that we do
 	# not need to send any ancestors of "c3", but we still need to send "c3"
 	# itself.
 	test_config -C client fetch.negotiationalgorithm skipping &&
diff --git a/t/t5553-set-upstream.sh b/t/t5553-set-upstream.sh
index e78a21881f..b1d614ce18 100755
--- a/t/t5553-set-upstream.sh
+++ b/t/t5553-set-upstream.sh
@@ -1,7 +1,7 @@
 #!/bin/sh
 
 test_description='"git fetch/pull --set-upstream" basic tests.'
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -35,9 +35,9 @@ test_expect_success 'setup bare parent fetch' '
 	git remote add upstream parent
 '
 
-test_expect_success 'setup commit on master and other fetch' '
+test_expect_success 'setup commit on main and other fetch' '
 	test_commit one &&
-	git push upstream master &&
+	git push upstream main &&
 	git checkout -b other &&
 	test_commit two &&
 	git push upstream other
@@ -46,38 +46,38 @@ test_expect_success 'setup commit on master and other fetch' '
 # tests for fetch --set-upstream
 
 test_expect_success 'fetch --set-upstream does not set upstream w/o branch' '
-	clear_config master other &&
-	git checkout master &&
+	clear_config main other &&
+	git checkout main &&
 	git fetch --set-upstream upstream &&
-	check_config_missing master &&
+	check_config_missing main &&
 	check_config_missing other
 '
 
-test_expect_success 'fetch --set-upstream upstream master sets branch master but not other' '
-	clear_config master other &&
-	git fetch --set-upstream upstream master &&
-	check_config master upstream refs/heads/master &&
+test_expect_success 'fetch --set-upstream upstream main sets branch main but not other' '
+	clear_config main other &&
+	git fetch --set-upstream upstream main &&
+	check_config main upstream refs/heads/main &&
 	check_config_missing other
 '
 
 test_expect_success 'fetch --set-upstream upstream other sets branch other' '
-	clear_config master other &&
+	clear_config main other &&
 	git fetch --set-upstream upstream other &&
-	check_config master upstream refs/heads/other &&
+	check_config main upstream refs/heads/other &&
 	check_config_missing other
 '
 
-test_expect_success 'fetch --set-upstream master:other does not set the branch other2' '
+test_expect_success 'fetch --set-upstream main:other does not set the branch other2' '
 	clear_config other2 &&
-	git fetch --set-upstream upstream master:other2 &&
+	git fetch --set-upstream upstream main:other2 &&
 	check_config_missing other2
 '
 
 test_expect_success 'fetch --set-upstream http://nosuchdomain.example.com fails with invalid url' '
-	# master explicitly not cleared, we check that it is not touched from previous value
+	# main explicitly not cleared, we check that it is not touched from previous value
 	clear_config other other2 &&
 	test_must_fail git fetch --set-upstream http://nosuchdomain.example.com &&
-	check_config master upstream refs/heads/other &&
+	check_config main upstream refs/heads/other &&
 	check_config_missing other &&
 	check_config_missing other2
 '
@@ -86,7 +86,7 @@ test_expect_success 'fetch --set-upstream with valid URL sets upstream to URL' '
 	clear_config other other2 &&
 	url="file://$PWD" &&
 	git fetch --set-upstream "$url" &&
-	check_config master "$url" HEAD &&
+	check_config main "$url" HEAD &&
 	check_config_missing other &&
 	check_config_missing other2
 '
@@ -99,30 +99,30 @@ test_expect_success 'setup bare parent pull' '
 	git remote add upstream parent
 '
 
-test_expect_success 'setup commit on master and other pull' '
+test_expect_success 'setup commit on main and other pull' '
 	test_commit three &&
-	git push --tags upstream master &&
+	git push --tags upstream main &&
 	test_commit four &&
 	git push upstream other
 '
 
-test_expect_success 'pull --set-upstream upstream master sets branch master but not other' '
-	clear_config master other &&
-	git pull --set-upstream upstream master &&
-	check_config master upstream refs/heads/master &&
+test_expect_success 'pull --set-upstream upstream main sets branch main but not other' '
+	clear_config main other &&
+	git pull --set-upstream upstream main &&
+	check_config main upstream refs/heads/main &&
 	check_config_missing other
 '
 
-test_expect_success 'pull --set-upstream master:other2 does not set the branch other2' '
+test_expect_success 'pull --set-upstream main:other2 does not set the branch other2' '
 	clear_config other2 &&
-	git pull --set-upstream upstream master:other2 &&
+	git pull --set-upstream upstream main:other2 &&
 	check_config_missing other2
 '
 
-test_expect_success 'pull --set-upstream upstream other sets branch master' '
-	clear_config master other &&
+test_expect_success 'pull --set-upstream upstream other sets branch main' '
+	clear_config main other &&
 	git pull --set-upstream upstream other &&
-	check_config master upstream refs/heads/other &&
+	check_config main upstream refs/heads/other &&
 	check_config_missing other
 '
 
@@ -133,47 +133,47 @@ test_expect_success 'pull --set-upstream upstream tag does not set the tag' '
 '
 
 test_expect_success 'pull --set-upstream http://nosuchdomain.example.com fails with invalid url' '
-	# master explicitly not cleared, we check that it is not touched from previous value
+	# main explicitly not cleared, we check that it is not touched from previous value
 	clear_config other other2 three &&
 	test_must_fail git pull --set-upstream http://nosuchdomain.example.com &&
-	check_config master upstream refs/heads/other &&
+	check_config main upstream refs/heads/other &&
 	check_config_missing other &&
 	check_config_missing other2 &&
 	check_config_missing three
 '
 
 test_expect_success 'pull --set-upstream upstream HEAD sets branch HEAD' '
-	clear_config master other &&
+	clear_config main other &&
 	git pull --set-upstream upstream HEAD &&
-	check_config master upstream HEAD &&
+	check_config main upstream HEAD &&
 	git checkout other &&
 	git pull --set-upstream upstream HEAD &&
 	check_config other upstream HEAD
 '
 
 test_expect_success 'pull --set-upstream upstream with more than one branch does nothing' '
-	clear_config master three &&
-	git pull --set-upstream upstream master three &&
-	check_config_missing master &&
+	clear_config main three &&
+	git pull --set-upstream upstream main three &&
+	check_config_missing main &&
 	check_config_missing three
 '
 
 test_expect_success 'pull --set-upstream with valid URL sets upstream to URL' '
-	clear_config master other other2 &&
-	git checkout master &&
+	clear_config main other other2 &&
+	git checkout main &&
 	url="file://$PWD" &&
 	git pull --set-upstream "$url" &&
-	check_config master "$url" HEAD &&
+	check_config main "$url" HEAD &&
 	check_config_missing other &&
 	check_config_missing other2
 '
 
 test_expect_success 'pull --set-upstream with valid URL and branch sets branch' '
-	clear_config master other other2 &&
-	git checkout master &&
+	clear_config main other other2 &&
+	git checkout main &&
 	url="file://$PWD" &&
-	git pull --set-upstream "$url" master &&
-	check_config master "$url" refs/heads/master &&
+	git pull --set-upstream "$url" main &&
+	check_config main "$url" refs/heads/main &&
 	check_config_missing other &&
 	check_config_missing other2
 '
diff --git a/t/t5560-http-backend-noserver.sh b/t/t5560-http-backend-noserver.sh
index 5561b7d012..d30cf4f5b8 100755
--- a/t/t5560-http-backend-noserver.sh
+++ b/t/t5560-http-backend-noserver.sh
@@ -1,7 +1,7 @@
 #!/bin/sh
 
 test_description='test git-http-backend-noserver'
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
diff --git a/t/t5561-http-backend.sh b/t/t5561-http-backend.sh
index cba2dffdb0..9c57d84315 100755
--- a/t/t5561-http-backend.sh
+++ b/t/t5561-http-backend.sh
@@ -1,7 +1,7 @@
 #!/bin/sh
 
 test_description='test git-http-backend'
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -42,9 +42,9 @@ POST() {
 
 grep '^[^#]' >exp <<EOF
 
-###  refs/heads/master
+###  refs/heads/main
 ###
-GET  /smart/repo.git/refs/heads/master HTTP/1.1 404 -
+GET  /smart/repo.git/refs/heads/main HTTP/1.1 404 -
 
 ###  getanyfile default
 ###
diff --git a/t/t556x_common b/t/t556x_common
index 359fcfe32b..670fb89477 100755
--- a/t/t556x_common
+++ b/t/t556x_common
@@ -22,7 +22,7 @@ test_expect_success 'setup repository' '
 	 : >objects/info/http-alternates
 	) &&
 	git remote add public "$HTTPD_DOCUMENT_ROOT_PATH/repo.git" &&
-	git push public master:master &&
+	git push public main:main &&
 
 	(cd "$HTTPD_DOCUMENT_ROOT_PATH/repo.git" &&
 	 git repack -a -d
@@ -31,7 +31,7 @@ test_expect_success 'setup repository' '
 	echo other >file &&
 	git add file &&
 	git commit -m two &&
-	git push public master:master &&
+	git push public main:main &&
 
 	LOOSE_URL=$(find_file objects/??) &&
 	PACK_URL=$(find_file objects/pack/*.pack) &&
@@ -51,8 +51,8 @@ get_static_files() {
 
 SMART=smart
 GIT_HTTP_EXPORT_ALL=1 && export GIT_HTTP_EXPORT_ALL
-test_expect_success 'direct refs/heads/master not found' '
-	GET refs/heads/master "404 Not Found"
+test_expect_success 'direct refs/heads/main not found' '
+	GET refs/heads/main "404 Not Found"
 '
 test_expect_success 'static file is ok' '
 	get_static_files "200 OK"
diff --git a/t/t5570-git-daemon.sh b/t/t5570-git-daemon.sh
index 2e99a331c5..3332a0c595 100755
--- a/t/t5570-git-daemon.sh
+++ b/t/t5570-git-daemon.sh
@@ -1,7 +1,7 @@
 #!/bin/sh
 
 test_description='test fetching over git protocol'
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -29,7 +29,7 @@ test_expect_success 'create git-accessible bare repository' '
 	 : >git-daemon-export-ok
 	) &&
 	git remote add public "$GIT_DAEMON_DOCUMENT_ROOT_PATH/repo.git" &&
-	git push public master:master
+	git push public main:main
 '
 
 test_expect_success 'clone git repository' '
@@ -58,12 +58,12 @@ test_expect_success 'no-op fetch without "-v" is quiet' '
 '
 
 test_expect_success 'remote detects correct HEAD' '
-	git push public master:other &&
+	git push public main:other &&
 	(cd clone &&
 	 git remote set-head -d origin &&
 	 git remote set-head -a origin &&
 	 git symbolic-ref refs/remotes/origin/HEAD > output &&
-	 echo refs/remotes/origin/master > expect &&
+	 echo refs/remotes/origin/main > expect &&
 	 test_cmp expect output
 	)
 '
@@ -151,7 +151,7 @@ test_remote_error()
 
 msg="access denied or repository not exported"
 test_expect_success 'clone non-existent' "test_remote_error    '$msg' clone nowhere.git"
-test_expect_success 'push disabled'      "test_remote_error    '$msg' push  repo.git master"
+test_expect_success 'push disabled'      "test_remote_error    '$msg' push  repo.git main"
 test_expect_success 'read access denied' "test_remote_error -x '$msg' fetch repo.git"
 test_expect_success 'not exported'       "test_remote_error -n '$msg' fetch repo.git"
 
@@ -159,7 +159,7 @@ stop_git_daemon
 start_git_daemon --informative-errors
 
 test_expect_success 'clone non-existent' "test_remote_error    'no such repository'      clone nowhere.git"
-test_expect_success 'push disabled'      "test_remote_error    'service not enabled'     push  repo.git master"
+test_expect_success 'push disabled'      "test_remote_error    'service not enabled'     push  repo.git main"
 test_expect_success 'read access denied' "test_remote_error -x 'no such repository'      fetch repo.git"
 test_expect_success 'not exported'       "test_remote_error -n 'repository not exported' fetch repo.git"
 
@@ -195,10 +195,10 @@ test_expect_success FAKENC 'hostname interpolation works after LF-stripping' '
 	fake_nc "$GIT_DAEMON_HOST_PORT" <input >output &&
 	depacketize <output >output.raw &&
 
-	# just pick out the value of master, which avoids any protocol
+	# just pick out the value of main, which avoids any protocol
 	# particulars
-	perl -lne "print \$1 if m{^(\\S+) refs/heads/master}" <output.raw >actual &&
-	git -C "$repo" rev-parse master >expect &&
+	perl -lne "print \$1 if m{^(\\S+) refs/heads/main}" <output.raw >actual &&
+	git -C "$repo" rev-parse main >expect &&
 	test_cmp expect actual
 '
 
diff --git a/t/t5571-pre-push-hook.sh b/t/t5571-pre-push-hook.sh
index 971ed3da4b..ad8d5804f7 100755
--- a/t/t5571-pre-push-hook.sh
+++ b/t/t5571-pre-push-hook.sh
@@ -1,7 +1,7 @@
 #!/bin/sh
 
 test_description='check pre-push hooks'
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -51,11 +51,11 @@ EOF
 cat >expected <<EOF
 parent1
 repo1
-refs/heads/master $COMMIT2 refs/heads/foreign $COMMIT1
+refs/heads/main $COMMIT2 refs/heads/foreign $COMMIT1
 EOF
 
 test_expect_success 'push with hook' '
-	git push parent1 master:foreign &&
+	git push parent1 main:foreign &&
 	diff expected actual
 '
 
diff --git a/t/t5572-pull-submodule.sh b/t/t5572-pull-submodule.sh
index 1d75e3b12b..d6a75964d8 100755
--- a/t/t5572-pull-submodule.sh
+++ b/t/t5572-pull-submodule.sh
@@ -148,8 +148,8 @@ test_expect_success 'branch has no merge base with remote-tracking counterpart'
 
 	git clone parent child &&
 
-	# Reset master so that it has no merge base with
-	# refs/remotes/origin/master.
+	# Reset main so that it has no merge base with
+	# refs/remotes/origin/main.
 	OTHER=$(git -C child commit-tree -m bar \
 		$(git -C child rev-parse HEAD^{tree})) &&
 	git -C child reset --hard "$OTHER" &&
diff --git a/t/t5580-unc-paths.sh b/t/t5580-unc-paths.sh
index da4c94cce1..cd803ae8bf 100755
--- a/t/t5580-unc-paths.sh
+++ b/t/t5580-unc-paths.sh
@@ -1,7 +1,7 @@
 #!/bin/sh
 
 test_description='various Windows-only path tests'
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -56,7 +56,7 @@ test_expect_success fetch '
 	git init to-fetch &&
 	(
 		cd to-fetch &&
-		git fetch "$UNCPATH" master
+		git fetch "$UNCPATH" main
 	)
 '
 
diff --git a/t/t5581-http-curl-verbose.sh b/t/t5581-http-curl-verbose.sh
index 907bb062d6..cded79c16b 100755
--- a/t/t5581-http-curl-verbose.sh
+++ b/t/t5581-http-curl-verbose.sh
@@ -1,7 +1,7 @@
 #!/bin/sh
 
 test_description='test GIT_CURL_VERBOSE'
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -16,7 +16,7 @@ test_expect_success 'setup repository' '
 	git add file &&
 	git commit -m one &&
 	git remote add public "$HTTPD_DOCUMENT_ROOT_PATH/repo.git" &&
-	git push public master:master
+	git push public main:main
 '
 
 test_expect_success 'failure in git-upload-pack is shown' '
diff --git a/t/t5582-fetch-negative-refspec.sh b/t/t5582-fetch-negative-refspec.sh
index 608e9aa189..6af143c140 100755
--- a/t/t5582-fetch-negative-refspec.sh
+++ b/t/t5582-fetch-negative-refspec.sh
@@ -5,7 +5,7 @@ test_description='"git fetch" with negative refspecs.
 
 '
 
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -25,12 +25,12 @@ test_expect_success "clone and setup child repos" '
 		git switch -c alternate &&
 		echo >file updated again by one &&
 		git commit -a -m "updated by one again" &&
-		git switch master
+		git switch main
 	) &&
 	git clone . two &&
 	(
 		cd two &&
-		git config branch.master.remote one &&
+		git config branch.main.remote one &&
 		git config remote.one.url ../one/.git/ &&
 		git config remote.one.fetch +refs/heads/*:refs/remotes/one/* &&
 		git config --add remote.one.fetch ^refs/heads/alternate
@@ -46,9 +46,9 @@ test_expect_success "fetch one" '
 		test_must_fail git rev-parse --verify refs/remotes/one/alternate &&
 		git fetch one &&
 		test_must_fail git rev-parse --verify refs/remotes/one/alternate &&
-		git rev-parse --verify refs/remotes/one/master &&
-		mine=$(git rev-parse refs/remotes/one/master) &&
-		his=$(cd ../one && git rev-parse refs/heads/master) &&
+		git rev-parse --verify refs/remotes/one/main &&
+		mine=$(git rev-parse refs/remotes/one/main) &&
+		his=$(cd ../one && git rev-parse refs/heads/main) &&
 		test "z$mine" = "z$his"
 	)
 '
@@ -60,7 +60,7 @@ test_expect_success "fetch with negative refspec on commandline" '
 		cd three &&
 		alternate_in_one=$(cd ../one && git rev-parse refs/heads/alternate) &&
 		echo $alternate_in_one >expect &&
-		git fetch ../one/.git refs/heads/*:refs/remotes/one/* ^refs/heads/master &&
+		git fetch ../one/.git refs/heads/*:refs/remotes/one/* ^refs/heads/main &&
 		cut -f -1 .git/FETCH_HEAD >actual &&
 		test_cmp expect actual
 	)
@@ -71,8 +71,8 @@ test_expect_success "fetch with negative sha1 refspec fails" '
 	git commit -a -m "updated by origin yet again" &&
 	(
 		cd three &&
-		master_in_one=$(cd ../one && git rev-parse refs/heads/master) &&
-		test_must_fail git fetch ../one/.git refs/heads/*:refs/remotes/one/* ^$master_in_one
+		main_in_one=$(cd ../one && git rev-parse refs/heads/main) &&
+		test_must_fail git fetch ../one/.git refs/heads/*:refs/remotes/one/* ^$main_in_one
 	)
 '
 
@@ -95,10 +95,10 @@ test_expect_success "fetch with negative pattern refspec does not expand prefix"
 	(
 		cd three &&
 		alternate_in_one=$(cd ../one && git rev-parse refs/heads/alternate) &&
-		master_in_one=$(cd ../one && git rev-parse refs/heads/master) &&
+		main_in_one=$(cd ../one && git rev-parse refs/heads/main) &&
 		echo $alternate_in_one >expect &&
-		echo $master_in_one >>expect &&
-		git fetch ../one/.git refs/heads/*:refs/remotes/one/* ^master &&
+		echo $main_in_one >>expect &&
+		git fetch ../one/.git refs/heads/*:refs/remotes/one/* ^main &&
 		cut -f -1 .git/FETCH_HEAD >actual &&
 		test_cmp expect actual
 	)
-- 
gitgitgadget


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH v3 17/28] t5[6-9]*: adjust the references to the default branch name "main"
  2020-11-18 23:44   ` [PATCH v3 00/28] tests: use main as default branch name Johannes Schindelin via GitGitGadget
                       ` (15 preceding siblings ...)
  2020-11-18 23:44     ` [PATCH v3 16/28] t55[4-9]*: " Johannes Schindelin via GitGitGadget
@ 2020-11-18 23:44     ` Johannes Schindelin via GitGitGadget
  2020-11-18 23:44     ` [PATCH v3 18/28] t6[0-3]*: " Johannes Schindelin via GitGitGadget
                       ` (11 subsequent siblings)
  28 siblings, 0 replies; 163+ messages in thread
From: Johannes Schindelin via GitGitGadget @ 2020-11-18 23:44 UTC (permalink / raw)
  To: git
  Cc: Felipe Contreras, Ævar Arnfjörð Bjarmason,
	Johannes Schindelin, Jeff King, Jonathan Nieder,
	Johannes Schindelin, Johannes Schindelin

From: Johannes Schindelin <johannes.schindelin@gmx.de>

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>
---
 t/t5601-clone.sh                    |  6 +--
 t/t5604-clone-reference.sh          | 14 +++----
 t/t5605-clone-local.sh              | 12 +++---
 t/t5606-clone-options.sh            | 10 ++---
 t/t5607-clone-bundle.sh             | 16 ++++----
 t/t5608-clone-2gb.sh                |  2 +-
 t/t5609-clone-branch.sh             |  8 ++--
 t/t5610-clone-detached.sh           |  6 +--
 t/t5611-clone-config.sh             | 18 ++++-----
 t/t5612-clone-refspec.sh            | 44 ++++++++++-----------
 t/t5614-clone-submodules-shallow.sh |  2 +-
 t/t5616-partial-clone.sh            | 52 ++++++++++++-------------
 t/t5617-clone-submodules-remote.sh  |  8 ++--
 t/t5700-protocol-v1.sh              | 18 ++++-----
 t/t5701-git-serve.sh                | 18 ++++-----
 t/t5702-protocol-v2.sh              | 52 ++++++++++++-------------
 t/t5703-upload-pack-ref-in-want.sh  | 60 ++++++++++++++---------------
 t/t5801-remote-helpers.sh           | 26 ++++++-------
 18 files changed, 186 insertions(+), 186 deletions(-)

diff --git a/t/t5601-clone.sh b/t/t5601-clone.sh
index e01c5fe02d..664c913866 100755
--- a/t/t5601-clone.sh
+++ b/t/t5601-clone.sh
@@ -2,7 +2,7 @@
 
 test_description=clone
 
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -220,7 +220,7 @@ test_expect_success 'clone respects global branch.autosetuprebase' '
 		rm -fr dst &&
 		git clone src dst &&
 		cd dst &&
-		actual="z$(git config branch.master.rebase)" &&
+		actual="z$(git config branch.main.rebase)" &&
 		test ztrue = $actual
 	)
 '
@@ -594,7 +594,7 @@ test_expect_success 'clone from a repository with two identical branches' '
 
 	(
 		cd src &&
-		git checkout -b another master
+		git checkout -b another main
 	) &&
 	git clone src target-11 &&
 	test "z$( cd target-11 && git symbolic-ref HEAD )" = zrefs/heads/another
diff --git a/t/t5604-clone-reference.sh b/t/t5604-clone-reference.sh
index 20fbb1e9a3..5d682706ae 100755
--- a/t/t5604-clone-reference.sh
+++ b/t/t5604-clone-reference.sh
@@ -4,7 +4,7 @@
 #
 
 test_description='test clone --reference'
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -52,7 +52,7 @@ test_expect_success 'existence of info/alternates' '
 '
 
 test_expect_success 'pulling from reference' '
-	git -C C pull ../B master
+	git -C C pull ../B main
 '
 
 test_expect_success 'that reference gets used' '
@@ -73,7 +73,7 @@ test_expect_success 'existence of info/alternates' '
 '
 
 test_expect_success 'pulling from reference' '
-	git -C D pull ../B master
+	git -C D pull ../B main
 '
 
 test_expect_success 'that reference gets used' '
@@ -139,11 +139,11 @@ test_expect_success 'prepare branched repository' '
 	git clone A J &&
 	(
 		cd J &&
-		git checkout -b other master^ &&
+		git checkout -b other main^ &&
 		echo other >otherfile &&
 		git add otherfile &&
 		git commit -m other &&
-		git checkout master
+		git checkout main
 	)
 '
 
@@ -155,9 +155,9 @@ test_expect_success 'fetch with incomplete alternates' '
 		git remote add J "file://$base_dir/J" &&
 		GIT_TRACE_PACKET=$U.K git fetch J
 	) &&
-	master_object=$(cd A && git for-each-ref --format="%(objectname)" refs/heads/master) &&
+	main_object=$(cd A && git for-each-ref --format="%(objectname)" refs/heads/main) &&
 	test -s "$U.K" &&
-	! grep " want $master_object" "$U.K" &&
+	! grep " want $main_object" "$U.K" &&
 	tag_object=$(cd A && git for-each-ref --format="%(objectname)" refs/tags/HEAD) &&
 	! grep " want $tag_object" "$U.K"
 '
diff --git a/t/t5605-clone-local.sh b/t/t5605-clone-local.sh
index 94028044b0..7d63365f93 100755
--- a/t/t5605-clone-local.sh
+++ b/t/t5605-clone-local.sh
@@ -1,7 +1,7 @@
 #!/bin/sh
 
 test_description='test local clone'
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -18,7 +18,7 @@ test_expect_success 'preparing origin repository' '
 	test "$(cd a.git && git config --bool core.bare)" = true &&
 	test "$(cd x && git config --bool core.bare)" = true &&
 	git bundle create b1.bundle --all &&
-	git bundle create b2.bundle master &&
+	git bundle create b2.bundle main &&
 	mkdir dir &&
 	cp b1.bundle dir/b3 &&
 	cp b1.bundle b4
@@ -87,7 +87,7 @@ test_expect_success 'bundle clone with nonexistent HEAD' '
 	git clone b2.bundle b2 &&
 	(cd b2 &&
 	git fetch &&
-	test_must_fail git rev-parse --verify refs/heads/master)
+	test_must_fail git rev-parse --verify refs/heads/main)
 '
 
 test_expect_success 'clone empty repository' '
@@ -101,9 +101,9 @@ test_expect_success 'clone empty repository' '
 	 echo "content" >> foo &&
 	 git add foo &&
 	 git commit -m "Initial commit" &&
-	 git push origin master &&
-	 expected=$(git rev-parse master) &&
-	 actual=$(git --git-dir=../empty/.git rev-parse master) &&
+	 git push origin main &&
+	 expected=$(git rev-parse main) &&
+	 actual=$(git --git-dir=../empty/.git rev-parse main) &&
 	 test $actual = $expected)
 '
 
diff --git a/t/t5606-clone-options.sh b/t/t5606-clone-options.sh
index 3893a49e6d..5d6e63a841 100755
--- a/t/t5606-clone-options.sh
+++ b/t/t5606-clone-options.sh
@@ -1,7 +1,7 @@
 #!/bin/sh
 
 test_description='basic clone options'
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -18,7 +18,7 @@ test_expect_success 'setup' '
 test_expect_success 'clone -o' '
 
 	git clone -o foo parent clone-o &&
-	git -C clone-o rev-parse --verify refs/remotes/foo/master
+	git -C clone-o rev-parse --verify refs/remotes/foo/main
 
 '
 
@@ -48,7 +48,7 @@ test_expect_success 'disallows --bare with --separate-git-dir' '
 test_expect_success 'uses "origin" for default remote name' '
 
 	git clone parent clone-default-origin &&
-	git -C clone-default-origin rev-parse --verify refs/remotes/origin/master
+	git -C clone-default-origin rev-parse --verify refs/remotes/origin/main
 
 '
 
@@ -77,14 +77,14 @@ test_expect_success 'prefers config "clone.defaultRemoteName" over default' '
 
 	test_config_global clone.defaultRemoteName from_config &&
 	git clone parent clone-config-origin &&
-	git -C clone-config-origin rev-parse --verify refs/remotes/from_config/master
+	git -C clone-config-origin rev-parse --verify refs/remotes/from_config/main
 
 '
 
 test_expect_success 'prefers --origin over -c config' '
 
 	git clone -c clone.defaultRemoteName=inline --origin from_option parent clone-o-and-inline-config &&
-	git -C clone-o-and-inline-config rev-parse --verify refs/remotes/from_option/master
+	git -C clone-o-and-inline-config rev-parse --verify refs/remotes/from_option/main
 
 '
 
diff --git a/t/t5607-clone-bundle.sh b/t/t5607-clone-bundle.sh
index 6e2e4adbb4..5b39f4a288 100755
--- a/t/t5607-clone-bundle.sh
+++ b/t/t5607-clone-bundle.sh
@@ -1,7 +1,7 @@
 #!/bin/sh
 
 test_description='some bundle related tests'
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -22,7 +22,7 @@ test_expect_success 'setup' '
 '
 
 test_expect_success '"verify" needs a worktree' '
-	git bundle create tip.bundle -1 master &&
+	git bundle create tip.bundle -1 main &&
 	nongit test_must_fail git bundle verify ../tip.bundle 2>err &&
 	test_i18ngrep "need a repository" err
 '
@@ -42,15 +42,15 @@ test_expect_success 'die if bundle file cannot be created' '
 '
 
 test_expect_failure 'bundle --stdin' '
-	echo master | git bundle create stdin-bundle.bdl --stdin &&
+	echo main | git bundle create stdin-bundle.bdl --stdin &&
 	git ls-remote stdin-bundle.bdl >output &&
-	grep master output
+	grep main output
 '
 
 test_expect_failure 'bundle --stdin <rev-list options>' '
-	echo master | git bundle create hybrid-bundle.bdl --stdin tag &&
+	echo main | git bundle create hybrid-bundle.bdl --stdin tag &&
 	git ls-remote hybrid-bundle.bdl >output &&
-	grep master output
+	grep main output
 '
 
 test_expect_success 'empty bundle file is rejected' '
@@ -86,14 +86,14 @@ test_expect_success 'prerequisites with an empty commit message' '
 
 test_expect_success 'failed bundle creation does not leave cruft' '
 	# This fails because the bundle would be empty.
-	test_must_fail git bundle create fail.bundle master..master &&
+	test_must_fail git bundle create fail.bundle main..main &&
 	test_path_is_missing fail.bundle.lock
 '
 
 test_expect_success 'fetch SHA-1 from bundle' '
 	test_create_repo foo &&
 	test_commit -C foo x &&
-	git -C foo bundle create tip.bundle -1 master &&
+	git -C foo bundle create tip.bundle -1 main &&
 	git -C foo rev-parse HEAD >hash &&
 
 	# Exercise to ensure that fetching a SHA-1 from a bundle works with no
diff --git a/t/t5608-clone-2gb.sh b/t/t5608-clone-2gb.sh
index 4c476d2fa1..87a8cd9f98 100755
--- a/t/t5608-clone-2gb.sh
+++ b/t/t5608-clone-2gb.sh
@@ -26,7 +26,7 @@ test_expect_success 'setup' '
 		i=$(($i+1)) ||
 		echo $? > exit-status
 	 done &&
-	 echo "commit refs/heads/master" &&
+	 echo "commit refs/heads/main" &&
 	 echo "author A U Thor <author@email.com> 123456789 +0000" &&
 	 echo "committer C O Mitter <committer@email.com> 123456789 +0000" &&
 	 echo "data 5" &&
diff --git a/t/t5609-clone-branch.sh b/t/t5609-clone-branch.sh
index e4d5124f89..f86a674a03 100755
--- a/t/t5609-clone-branch.sh
+++ b/t/t5609-clone-branch.sh
@@ -1,7 +1,7 @@
 #!/bin/sh
 
 test_description='clone --branch option'
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -23,7 +23,7 @@ test_expect_success 'setup' '
 	 echo one >file && git add file && git commit -m one &&
 	 git checkout -b two &&
 	 echo two >file && git add file && git commit -m two &&
-	 git checkout master) &&
+	 git checkout main) &&
 	mkdir empty &&
 	(cd empty && git init)
 '
@@ -31,7 +31,7 @@ test_expect_success 'setup' '
 test_expect_success 'vanilla clone chooses HEAD' '
 	git clone parent clone &&
 	(cd clone &&
-	 check_HEAD master &&
+	 check_HEAD main &&
 	 check_file one
 	)
 '
@@ -56,7 +56,7 @@ test_expect_success 'clone -b sets up tracking' '
 
 test_expect_success 'clone -b does not munge remotes/origin/HEAD' '
 	(cd clone-two &&
-	 echo refs/remotes/origin/master >expect &&
+	 echo refs/remotes/origin/main >expect &&
 	 git symbolic-ref refs/remotes/origin/HEAD >actual &&
 	 test_cmp expect actual
 	)
diff --git a/t/t5610-clone-detached.sh b/t/t5610-clone-detached.sh
index ba63ba8f42..a7ec21eda5 100755
--- a/t/t5610-clone-detached.sh
+++ b/t/t5610-clone-detached.sh
@@ -1,7 +1,7 @@
 #!/bin/sh
 
 test_description='test cloning a repository with detached HEAD'
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -23,7 +23,7 @@ test_expect_success 'setup' '
 '
 
 test_expect_success 'clone repo (detached HEAD points to branch)' '
-	git checkout master^0 &&
+	git checkout main^0 &&
 	git clone "file://$PWD" detached-branch
 '
 test_expect_success 'cloned HEAD matches' '
@@ -62,7 +62,7 @@ test_expect_success 'cloned HEAD is detached' '
 '
 
 test_expect_success 'clone repo (orphan detached HEAD)' '
-	git checkout master^0 &&
+	git checkout main^0 &&
 	echo four >file &&
 	git commit -a -m four &&
 	git clone "file://$PWD" detached-orphan
diff --git a/t/t5611-clone-config.sh b/t/t5611-clone-config.sh
index be4ae10c82..9f555b87ec 100755
--- a/t/t5611-clone-config.sh
+++ b/t/t5611-clone-config.sh
@@ -1,7 +1,7 @@
 #!/bin/sh
 
 test_description='tests for git clone -c key=value'
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -50,16 +50,16 @@ test_expect_success 'clone -c config is available during clone' '
 
 test_expect_success 'clone -c remote.origin.fetch=<refspec> works' '
 	rm -rf child &&
-	git update-ref refs/grab/it refs/heads/master &&
-	git update-ref refs/leave/out refs/heads/master &&
+	git update-ref refs/grab/it refs/heads/main &&
+	git update-ref refs/leave/out refs/heads/main &&
 	git clone -c "remote.origin.fetch=+refs/grab/*:refs/grab/*" . child &&
 	git -C child for-each-ref --format="%(refname)" >actual &&
 
 	cat >expect <<-\EOF &&
 	refs/grab/it
-	refs/heads/master
+	refs/heads/main
 	refs/remotes/origin/HEAD
-	refs/remotes/origin/master
+	refs/remotes/origin/main
 	EOF
 	test_cmp expect actual
 '
@@ -71,9 +71,9 @@ test_expect_success 'git -c remote.origin.fetch=<refspec> clone works' '
 
 	cat >expect <<-\EOF &&
 	refs/grab/it
-	refs/heads/master
+	refs/heads/main
 	refs/remotes/origin/HEAD
-	refs/remotes/origin/master
+	refs/remotes/origin/main
 	EOF
 	test_cmp expect actual
 '
@@ -88,9 +88,9 @@ test_expect_success 'clone -c remote.<remote>.fetch=<refspec> --origin=<name>' '
 
 	cat >expect <<-\EOF &&
 	refs/grab/it
-	refs/heads/master
+	refs/heads/main
 	refs/remotes/upstream/HEAD
-	refs/remotes/upstream/master
+	refs/remotes/upstream/main
 	EOF
 	test_cmp expect actual
 '
diff --git a/t/t5612-clone-refspec.sh b/t/t5612-clone-refspec.sh
index 9e37f7fef7..6a6af7449c 100755
--- a/t/t5612-clone-refspec.sh
+++ b/t/t5612-clone-refspec.sh
@@ -1,13 +1,13 @@
 #!/bin/sh
 
 test_description='test refspec written by clone-command'
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
 
 test_expect_success 'setup' '
-	# Make two branches, "master" and "side"
+	# Make two branches, "main" and "side"
 	echo one >file &&
 	git add file &&
 	git commit -m one &&
@@ -19,7 +19,7 @@ test_expect_success 'setup' '
 	git checkout -b side &&
 	echo four >file &&
 	git commit -a -m four &&
-	git checkout master &&
+	git checkout main &&
 	git tag five &&
 
 	# default clone
@@ -28,18 +28,18 @@ test_expect_success 'setup' '
 	# default clone --no-tags
 	git clone --no-tags . dir_all_no_tags &&
 
-	# default --single that follows HEAD=master
-	git clone --single-branch . dir_master &&
+	# default --single that follows HEAD=main
+	git clone --single-branch . dir_main &&
 
-	# default --single that follows HEAD=master with no tags
-	git clone --single-branch --no-tags . dir_master_no_tags &&
+	# default --single that follows HEAD=main with no tags
+	git clone --single-branch --no-tags . dir_main_no_tags &&
 
 	# default --single that follows HEAD=side
 	git checkout side &&
 	git clone --single-branch . dir_side &&
 
 	# explicit --single that follows side
-	git checkout master &&
+	git checkout main &&
 	git clone --single-branch --branch side . dir_side2 &&
 
 	# default --single with --mirror
@@ -58,11 +58,11 @@ test_expect_success 'setup' '
 	# explicit --single with tag and --no-tags
 	git clone --single-branch --no-tags --branch two . dir_tag_no_tags &&
 
-	# advance both "master" and "side" branches
+	# advance both "main" and "side" branches
 	git checkout side &&
 	echo five >file &&
 	git commit -a -m five &&
-	git checkout master &&
+	git checkout main &&
 	echo six >file &&
 	git commit -a -m six &&
 
@@ -78,7 +78,7 @@ test_expect_success 'by default all branches will be kept updated' '
 		sed -e "/HEAD$/d" \
 		    -e "s|/remotes/origin/|/heads/|" refs >../actual
 	) &&
-	# follow both master and side
+	# follow both main and side
 	git for-each-ref refs/heads >expect &&
 	test_cmp expect actual
 '
@@ -103,20 +103,20 @@ test_expect_success 'clone with --no-tags' '
 	test_must_be_empty actual
 '
 
-test_expect_success '--single-branch while HEAD pointing at master' '
+test_expect_success '--single-branch while HEAD pointing at main' '
 	(
-		cd dir_master &&
+		cd dir_main &&
 		git fetch --force &&
 		git for-each-ref refs/remotes/origin >refs &&
 		sed -e "/HEAD$/d" \
 		    -e "s|/remotes/origin/|/heads/|" refs >../actual
 	) &&
-	# only follow master
-	git for-each-ref refs/heads/master >expect &&
+	# only follow main
+	git for-each-ref refs/heads/main >expect &&
 	# get & check latest tags
 	test_cmp expect actual &&
 	(
-		cd dir_master &&
+		cd dir_main &&
 		git fetch --tags --force &&
 		git for-each-ref refs/tags >../actual
 	) &&
@@ -125,20 +125,20 @@ test_expect_success '--single-branch while HEAD pointing at master' '
 	test_line_count = 2 actual
 '
 
-test_expect_success '--single-branch while HEAD pointing at master and --no-tags' '
+test_expect_success '--single-branch while HEAD pointing at main and --no-tags' '
 	(
-		cd dir_master_no_tags &&
+		cd dir_main_no_tags &&
 		git fetch &&
 		git for-each-ref refs/remotes/origin >refs &&
 		sed -e "/HEAD$/d" \
 		    -e "s|/remotes/origin/|/heads/|" refs >../actual
 	) &&
-	# only follow master
-	git for-each-ref refs/heads/master >expect &&
+	# only follow main
+	git for-each-ref refs/heads/main >expect &&
 	test_cmp expect actual &&
 	# get tags (noop)
 	(
-		cd dir_master_no_tags &&
+		cd dir_main_no_tags &&
 		git fetch &&
 		git for-each-ref refs/tags >../actual
 	) &&
@@ -146,7 +146,7 @@ test_expect_success '--single-branch while HEAD pointing at master and --no-tags
 	test_line_count = 0 actual &&
 	# get tags with --tags overrides tagOpt
 	(
-		cd dir_master_no_tags &&
+		cd dir_main_no_tags &&
 		git fetch --tags &&
 		git for-each-ref refs/tags >../actual
 	) &&
diff --git a/t/t5614-clone-submodules-shallow.sh b/t/t5614-clone-submodules-shallow.sh
index e4e6ea4d52..5504b519c7 100755
--- a/t/t5614-clone-submodules-shallow.sh
+++ b/t/t5614-clone-submodules-shallow.sh
@@ -7,7 +7,7 @@ test_description='Test shallow cloning of repos with submodules'
 pwd=$(pwd)
 
 test_expect_success 'setup' '
-	git checkout -b master &&
+	git checkout -b main &&
 	test_commit commit1 &&
 	test_commit commit2 &&
 	mkdir sub &&
diff --git a/t/t5616-partial-clone.sh b/t/t5616-partial-clone.sh
index b2c3ed4088..8e726f1515 100755
--- a/t/t5616-partial-clone.sh
+++ b/t/t5616-partial-clone.sh
@@ -2,7 +2,7 @@
 
 test_description='git partial clone'
 
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -54,14 +54,14 @@ test_expect_success 'verify that .promisor file contains refs fetched' '
 	test_line_count = 1 promisorlist &&
 	git -C srv.bare rev-parse --verify HEAD >headhash &&
 	grep "$(cat headhash) HEAD" $(cat promisorlist) &&
-	grep "$(cat headhash) refs/heads/master" $(cat promisorlist)
+	grep "$(cat headhash) refs/heads/main" $(cat promisorlist)
 '
 
-# checkout master to force dynamic object fetch of blobs at HEAD.
+# checkout main to force dynamic object fetch of blobs at HEAD.
 test_expect_success 'verify checkout with dynamic object fetch' '
 	git -C pc1 rev-list --quiet --objects --missing=print HEAD >observed &&
 	test_line_count = 4 observed &&
-	git -C pc1 checkout master &&
+	git -C pc1 checkout main &&
 	git -C pc1 rev-list --quiet --objects --missing=print HEAD >observed &&
 	test_line_count = 0 observed
 '
@@ -76,8 +76,8 @@ test_expect_success 'push new commits to server' '
 		git -C src add file.1.txt
 		git -C src commit -m "mod $x"
 	done &&
-	git -C src blame master -- file.1.txt >expect.blame &&
-	git -C src push -u srv master
+	git -C src blame main -- file.1.txt >expect.blame &&
+	git -C src push -u srv main
 '
 
 # (partial) fetch in the partial clone repo from the promisor remote.
@@ -86,26 +86,26 @@ test_expect_success 'push new commits to server' '
 test_expect_success 'partial fetch inherits filter settings' '
 	git -C pc1 fetch origin &&
 	git -C pc1 rev-list --quiet --objects --missing=print \
-		master..origin/master >observed &&
+		main..origin/main >observed &&
 	test_line_count = 5 observed
 '
 
 # force dynamic object fetch using diff.
-# we should only get 1 new blob (for the file in origin/master).
+# we should only get 1 new blob (for the file in origin/main).
 test_expect_success 'verify diff causes dynamic object fetch' '
-	git -C pc1 diff master..origin/master -- file.1.txt &&
+	git -C pc1 diff main..origin/main -- file.1.txt &&
 	git -C pc1 rev-list --quiet --objects --missing=print \
-		 master..origin/master >observed &&
+		 main..origin/main >observed &&
 	test_line_count = 4 observed
 '
 
 # force full dynamic object fetch of the file's history using blame.
 # we should get the intermediate blobs for the file.
 test_expect_success 'verify blame causes dynamic object fetch' '
-	git -C pc1 blame origin/master -- file.1.txt >observed.blame &&
+	git -C pc1 blame origin/main -- file.1.txt >observed.blame &&
 	test_cmp expect.blame observed.blame &&
 	git -C pc1 rev-list --quiet --objects --missing=print \
-		master..origin/master >observed &&
+		main..origin/main >observed &&
 	test_line_count = 0 observed
 '
 
@@ -118,7 +118,7 @@ test_expect_success 'push new commits to server for file.2.txt' '
 		git -C src add file.2.txt
 		git -C src commit -m "mod $x"
 	done &&
-	git -C src push -u srv master
+	git -C src push -u srv main
 '
 
 # 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' '
 test_expect_success 'override inherited filter-spec using --no-filter' '
 	git -C pc1 fetch --no-filter origin &&
 	git -C pc1 rev-list --quiet --objects --missing=print \
-		master..origin/master >observed &&
+		main..origin/main >observed &&
 	test_line_count = 0 observed
 '
 
@@ -139,7 +139,7 @@ test_expect_success 'push new commits to server for file.3.txt' '
 		git -C src add file.3.txt
 		git -C src commit -m "mod $x"
 	done &&
-	git -C src push -u srv master
+	git -C src push -u srv main
 '
 
 # 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' '
 	git -C pc1 fetch --filter=blob:none origin &&
 
 	git -C pc1 rev-list --quiet --objects --missing=print \
-		 master..origin/master >revs &&
+		 main..origin/main >revs &&
 	awk -f print_1.awk revs |
 	sed "s/?//" |
 	sort >observed.oids &&
@@ -158,7 +158,7 @@ test_expect_success 'manual prefetch of missing objects' '
 	git -C pc1 fetch-pack --stdin "file://$(pwd)/srv.bare" <observed.oids &&
 
 	git -C pc1 rev-list --quiet --objects --missing=print \
-		master..origin/master >revs &&
+		main..origin/main >revs &&
 	awk -f print_1.awk revs |
 	sed "s/?//" |
 	sort >observed.oids &&
@@ -199,7 +199,7 @@ test_expect_success 'use fsck before and after manually fetching a missing subtr
 	echo "in dir" >src/dir/file.txt &&
 	git -C src add dir/file.txt &&
 	git -C src commit -m "file in dir" &&
-	git -C src push -u srv master &&
+	git -C src push -u srv main &&
 	SUBTREE=$(git -C src rev-parse HEAD:dir) &&
 
 	rm -rf dst &&
@@ -207,7 +207,7 @@ test_expect_success 'use fsck before and after manually fetching a missing subtr
 	git -C dst fsck &&
 
 	# Make sure we only have commits, and all trees and blobs are missing.
-	git -C dst rev-list --missing=allow-any --objects master \
+	git -C dst rev-list --missing=allow-any --objects main \
 		>fetched_objects &&
 	awk -f print_1.awk fetched_objects |
 	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
 	git -C dst fsck &&
 
 	# Auto-fetch all remaining trees and blobs with --missing=error
-	git -C dst rev-list --missing=error --objects master >fetched_objects &&
+	git -C dst rev-list --missing=error --objects main >fetched_objects &&
 	test_line_count = 70 fetched_objects &&
 
 	awk -f print_1.awk fetched_objects |
@@ -334,7 +334,7 @@ test_expect_success 'setup src repo for sparse filter' '
 test_expect_success 'partial clone with sparse filter succeeds' '
 	rm -rf dst.git &&
 	git clone --no-local --bare \
-		  --filter=sparse:oid=master:only-one \
+		  --filter=sparse:oid=main:only-one \
 		  sparse-src dst.git &&
 	(
 		cd dst.git &&
@@ -347,11 +347,11 @@ test_expect_success 'partial clone with sparse filter succeeds' '
 test_expect_success 'partial clone with unresolvable sparse filter fails cleanly' '
 	rm -rf dst.git &&
 	test_must_fail git clone --no-local --bare \
-				 --filter=sparse:oid=master:no-such-name \
+				 --filter=sparse:oid=main:no-such-name \
 				 sparse-src dst.git 2>err &&
-	test_i18ngrep "unable to access sparse blob in .master:no-such-name" err &&
+	test_i18ngrep "unable to access sparse blob in .main:no-such-name" err &&
 	test_must_fail git clone --no-local --bare \
-				 --filter=sparse:oid=master \
+				 --filter=sparse:oid=main \
 				 sparse-src dst.git 2>err &&
 	test_i18ngrep "unable to parse sparse filter data in" err
 '
@@ -406,7 +406,7 @@ test_expect_success 'fetch lazy-fetches only to resolve deltas' '
 	# promisor remote other than for the big tree (because it needs to
 	# resolve the delta).
 	GIT_TRACE_PACKET="$(pwd)/trace" git -C client \
-		fetch "file://$(pwd)/server" master &&
+		fetch "file://$(pwd)/server" main &&
 
 	# Verify the assumption that the client needed to fetch the delta base
 	# to resolve the delta.
@@ -425,7 +425,7 @@ test_expect_success 'fetch lazy-fetches only to resolve deltas, protocol v2' '
 	# promisor remote other than for the big blob (because it needs to
 	# resolve the delta).
 	GIT_TRACE_PACKET="$(pwd)/trace" git -C client \
-		fetch "file://$(pwd)/server" master &&
+		fetch "file://$(pwd)/server" main &&
 
 	# Verify that protocol version 2 was used.
 	grep "fetch< version 2" trace &&
diff --git a/t/t5617-clone-submodules-remote.sh b/t/t5617-clone-submodules-remote.sh
index cba468fc53..e2dbb4eaba 100755
--- a/t/t5617-clone-submodules-remote.sh
+++ b/t/t5617-clone-submodules-remote.sh
@@ -2,7 +2,7 @@
 
 test_description='Test cloning repos with submodules using remote-tracking branches'
 
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -10,7 +10,7 @@ export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 pwd=$(pwd)
 
 test_expect_success 'setup' '
-	git checkout -b master &&
+	git checkout -b main &&
 	test_commit commit1 &&
 	mkdir sub &&
 	(
@@ -42,7 +42,7 @@ test_expect_success 'clone with --remote-submodules' '
 	git clone --recurse-submodules --remote-submodules "file://$pwd/." super_clone &&
 	(
 		cd super_clone/sub &&
-		git diff --exit-code remotes/origin/master
+		git diff --exit-code remotes/origin/main
 	)
 '
 
@@ -60,7 +60,7 @@ test_expect_success 'clone with --single-branch' '
 	git clone --recurse-submodules --single-branch "file://$pwd/." super_clone &&
 	(
 		cd super_clone/sub &&
-		git rev-parse --verify origin/master &&
+		git rev-parse --verify origin/main &&
 		test_must_fail git rev-parse --verify origin/other
 	)
 '
diff --git a/t/t5700-protocol-v1.sh b/t/t5700-protocol-v1.sh
index 7f0056c1ed..468bd3e13e 100755
--- a/t/t5700-protocol-v1.sh
+++ b/t/t5700-protocol-v1.sh
@@ -8,7 +8,7 @@ TEST_NO_CREATE_REPO=1
 GIT_TEST_PROTOCOL_VERSION=0
 export GIT_TEST_PROTOCOL_VERSION
 
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -44,7 +44,7 @@ test_expect_success 'fetch with git:// using protocol v1' '
 	GIT_TRACE_PACKET=1 git -C daemon_child -c protocol.version=1 \
 		fetch 2>log &&
 
-	git -C daemon_child log -1 --format=%s origin/master >actual &&
+	git -C daemon_child log -1 --format=%s origin/main >actual &&
 	git -C "$daemon_parent" log -1 --format=%s >expect &&
 	test_cmp expect actual &&
 
@@ -72,7 +72,7 @@ test_expect_success 'push with git:// using protocol v1' '
 	test_commit -C daemon_child three &&
 
 	# Push to another branch, as the target repository has the
-	# master branch checked out and we cannot push into it.
+	# main branch checked out and we cannot push into it.
 	GIT_TRACE_PACKET=1 git -C daemon_child -c protocol.version=1 \
 		push origin HEAD:client_branch 2>log &&
 
@@ -113,7 +113,7 @@ test_expect_success 'fetch with file:// using protocol v1' '
 	GIT_TRACE_PACKET=1 git -C file_child -c protocol.version=1 \
 		fetch 2>log &&
 
-	git -C file_child log -1 --format=%s origin/master >actual &&
+	git -C file_child log -1 --format=%s origin/main >actual &&
 	git -C file_parent log -1 --format=%s >expect &&
 	test_cmp expect actual &&
 
@@ -137,7 +137,7 @@ test_expect_success 'push with file:// using protocol v1' '
 	test_commit -C file_child three &&
 
 	# Push to another branch, as the target repository has the
-	# master branch checked out and we cannot push into it.
+	# main branch checked out and we cannot push into it.
 	GIT_TRACE_PACKET=1 git -C file_child -c protocol.version=1 \
 		push origin HEAD:client_branch 2>log &&
 
@@ -191,7 +191,7 @@ test_expect_success 'fetch with ssh:// using protocol v1' '
 		fetch 2>log &&
 	expect_ssh git-upload-pack &&
 
-	git -C ssh_child log -1 --format=%s origin/master >actual &&
+	git -C ssh_child log -1 --format=%s origin/main >actual &&
 	git -C ssh_parent log -1 --format=%s >expect &&
 	test_cmp expect actual &&
 
@@ -216,7 +216,7 @@ test_expect_success 'push with ssh:// using protocol v1' '
 	test_commit -C ssh_child three &&
 
 	# Push to another branch, as the target repository has the
-	# master branch checked out and we cannot push into it.
+	# main branch checked out and we cannot push into it.
 	GIT_TRACE_PACKET=1 git -C ssh_child -c protocol.version=1 \
 		push origin HEAD:client_branch 2>log &&
 	expect_ssh git-receive-pack &&
@@ -260,7 +260,7 @@ test_expect_success 'fetch with http:// using protocol v1' '
 	GIT_TRACE_PACKET=1 git -C http_child -c protocol.version=1 \
 		fetch 2>log &&
 
-	git -C http_child log -1 --format=%s origin/master >actual &&
+	git -C http_child log -1 --format=%s origin/main >actual &&
 	git -C "$HTTPD_DOCUMENT_ROOT_PATH/http_parent" log -1 --format=%s >expect &&
 	test_cmp expect actual &&
 
@@ -284,7 +284,7 @@ test_expect_success 'push with http:// using protocol v1' '
 	test_commit -C http_child three &&
 
 	# Push to another branch, as the target repository has the
-	# master branch checked out and we cannot push into it.
+	# main branch checked out and we cannot push into it.
 	GIT_TRACE_PACKET=1 git -C http_child -c protocol.version=1 \
 		push origin HEAD:client_branch && #2>log &&
 
diff --git a/t/t5701-git-serve.sh b/t/t5701-git-serve.sh
index 66c47e61d8..d9143b4bd2 100755
--- a/t/t5701-git-serve.sh
+++ b/t/t5701-git-serve.sh
@@ -2,7 +2,7 @@
 
 test_description='test protocol v2 server commands'
 
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -86,9 +86,9 @@ test_expect_success 'wrong object-format' '
 #
 test_expect_success 'setup some refs and tags' '
 	test_commit one &&
-	git branch dev master &&
+	git branch dev main &&
 	test_commit two &&
-	git symbolic-ref refs/heads/release refs/heads/master &&
+	git symbolic-ref refs/heads/release refs/heads/main &&
 	git tag -a -m "annotated tag" annotated-tag
 '
 
@@ -102,7 +102,7 @@ test_expect_success 'basics of ls-refs' '
 	cat >expect <<-EOF &&
 	$(git rev-parse HEAD) HEAD
 	$(git rev-parse refs/heads/dev) refs/heads/dev
-	$(git rev-parse refs/heads/master) refs/heads/master
+	$(git rev-parse refs/heads/main) refs/heads/main
 	$(git rev-parse refs/heads/release) refs/heads/release
 	$(git rev-parse refs/tags/annotated-tag) refs/tags/annotated-tag
 	$(git rev-parse refs/tags/one) refs/tags/one
@@ -120,13 +120,13 @@ test_expect_success 'basic ref-prefixes' '
 	command=ls-refs
 	object-format=$(test_oid algo)
 	0001
-	ref-prefix refs/heads/master
+	ref-prefix refs/heads/main
 	ref-prefix refs/tags/one
 	0000
 	EOF
 
 	cat >expect <<-EOF &&
-	$(git rev-parse refs/heads/master) refs/heads/master
+	$(git rev-parse refs/heads/main) refs/heads/main
 	$(git rev-parse refs/tags/one) refs/tags/one
 	0000
 	EOF
@@ -147,7 +147,7 @@ test_expect_success 'refs/heads prefix' '
 
 	cat >expect <<-EOF &&
 	$(git rev-parse refs/heads/dev) refs/heads/dev
-	$(git rev-parse refs/heads/master) refs/heads/master
+	$(git rev-parse refs/heads/main) refs/heads/main
 	$(git rev-parse refs/heads/release) refs/heads/release
 	0000
 	EOF
@@ -191,8 +191,8 @@ test_expect_success 'symrefs parameter' '
 
 	cat >expect <<-EOF &&
 	$(git rev-parse refs/heads/dev) refs/heads/dev
-	$(git rev-parse refs/heads/master) refs/heads/master
-	$(git rev-parse refs/heads/release) refs/heads/release symref-target:refs/heads/master
+	$(git rev-parse refs/heads/main) refs/heads/main
+	$(git rev-parse refs/heads/release) refs/heads/release symref-target:refs/heads/main
 	0000
 	EOF
 
diff --git a/t/t5702-protocol-v2.sh b/t/t5702-protocol-v2.sh
index f1f77fe089..3d994e0b1b 100755
--- a/t/t5702-protocol-v2.sh
+++ b/t/t5702-protocol-v2.sh
@@ -4,7 +4,7 @@ test_description='test git wire-protocol version 2'
 
 TEST_NO_CREATE_REPO=1
 
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -39,10 +39,10 @@ test_expect_success 'ref advertisement is filtered with ls-remote using protocol
 	test_when_finished "rm -f log" &&
 
 	GIT_TRACE_PACKET="$(pwd)/log" git -c protocol.version=2 \
-		ls-remote "$GIT_DAEMON_URL/parent" master >actual &&
+		ls-remote "$GIT_DAEMON_URL/parent" main >actual &&
 
 	cat >expect <<-EOF &&
-	$(git -C "$daemon_parent" rev-parse refs/heads/master)$(printf "\t")refs/heads/master
+	$(git -C "$daemon_parent" rev-parse refs/heads/main)$(printf "\t")refs/heads/main
 	EOF
 
 	test_cmp expect actual
@@ -72,7 +72,7 @@ test_expect_success 'fetch with git:// using protocol v2' '
 	GIT_TRACE_PACKET="$(pwd)/log" git -C daemon_child -c protocol.version=2 \
 		fetch &&
 
-	git -C daemon_child log -1 --format=%s origin/master >actual &&
+	git -C daemon_child log -1 --format=%s origin/main >actual &&
 	git -C "$daemon_parent" log -1 --format=%s >expect &&
 	test_cmp expect actual &&
 
@@ -121,7 +121,7 @@ test_expect_success 'push with git:// and a config of v2 does not request v2' '
 	test_commit -C daemon_child three &&
 
 	# Push to another branch, as the target repository has the
-	# master branch checked out and we cannot push into it.
+	# main branch checked out and we cannot push into it.
 	GIT_TRACE_PACKET="$(pwd)/log" git -C daemon_child -c protocol.version=2 \
 		push origin HEAD:client_branch &&
 
@@ -161,10 +161,10 @@ test_expect_success 'ref advertisement is filtered with ls-remote using protocol
 	test_when_finished "rm -f log" &&
 
 	GIT_TRACE_PACKET="$(pwd)/log" git -c protocol.version=2 \
-		ls-remote "file://$(pwd)/file_parent" master >actual &&
+		ls-remote "file://$(pwd)/file_parent" main >actual &&
 
 	cat >expect <<-EOF &&
-	$(git -C file_parent rev-parse refs/heads/master)$(printf "\t")refs/heads/master
+	$(git -C file_parent rev-parse refs/heads/main)$(printf "\t")refs/heads/main
 	EOF
 
 	test_cmp expect actual
@@ -174,10 +174,10 @@ test_expect_success 'server-options are sent when using ls-remote' '
 	test_when_finished "rm -f log" &&
 
 	GIT_TRACE_PACKET="$(pwd)/log" git -c protocol.version=2 \
-		ls-remote -o hello -o world "file://$(pwd)/file_parent" master >actual &&
+		ls-remote -o hello -o world "file://$(pwd)/file_parent" main >actual &&
 
 	cat >expect <<-EOF &&
-	$(git -C file_parent rev-parse refs/heads/master)$(printf "\t")refs/heads/master
+	$(git -C file_parent rev-parse refs/heads/main)$(printf "\t")refs/heads/main
 	EOF
 
 	test_cmp expect actual &&
@@ -187,7 +187,7 @@ test_expect_success 'server-options are sent when using ls-remote' '
 
 test_expect_success 'warn if using server-option with ls-remote with legacy protocol' '
 	test_must_fail env GIT_TEST_PROTOCOL_VERSION=0 git -c protocol.version=0 \
-		ls-remote -o hello -o world "file://$(pwd)/file_parent" master 2>err &&
+		ls-remote -o hello -o world "file://$(pwd)/file_parent" main 2>err &&
 
 	test_i18ngrep "see protocol.version in" err &&
 	test_i18ngrep "server options require protocol version 2 or later" err
@@ -220,7 +220,7 @@ test_expect_success 'fetch with file:// using protocol v2' '
 	GIT_TRACE_PACKET="$(pwd)/log" git -C file_child -c protocol.version=2 \
 		fetch origin &&
 
-	git -C file_child log -1 --format=%s origin/master >actual &&
+	git -C file_child log -1 --format=%s origin/main >actual &&
 	git -C file_parent log -1 --format=%s >expect &&
 	test_cmp expect actual &&
 
@@ -235,13 +235,13 @@ test_expect_success 'ref advertisement is filtered during fetch using protocol v
 	git -C file_parent branch unwanted-branch three &&
 
 	GIT_TRACE_PACKET="$(pwd)/log" git -C file_child -c protocol.version=2 \
-		fetch origin master &&
+		fetch origin main &&
 
-	git -C file_child log -1 --format=%s origin/master >actual &&
+	git -C file_child log -1 --format=%s origin/main >actual &&
 	git -C file_parent log -1 --format=%s >expect &&
 	test_cmp expect actual &&
 
-	grep "refs/heads/master" log &&
+	grep "refs/heads/main" log &&
 	! grep "refs/heads/unwanted-branch" log
 '
 
@@ -251,9 +251,9 @@ test_expect_success 'server-options are sent when fetching' '
 	test_commit -C file_parent four &&
 
 	GIT_TRACE_PACKET="$(pwd)/log" git -C file_child -c protocol.version=2 \
-		fetch -o hello -o world origin master &&
+		fetch -o hello -o world origin main &&
 
-	git -C file_child log -1 --format=%s origin/master >actual &&
+	git -C file_child log -1 --format=%s origin/main >actual &&
 	git -C file_parent log -1 --format=%s >expect &&
 	test_cmp expect actual &&
 
@@ -267,7 +267,7 @@ test_expect_success 'warn if using server-option with fetch with legacy protocol
 	git init temp_child &&
 
 	test_must_fail env GIT_TEST_PROTOCOL_VERSION=0 git -C temp_child -c protocol.version=0 \
-		fetch -o hello -o world "file://$(pwd)/file_parent" master 2>err &&
+		fetch -o hello -o world "file://$(pwd)/file_parent" main 2>err &&
 
 	test_i18ngrep "see protocol.version in" err &&
 	test_i18ngrep "server options require protocol version 2 or later" err
@@ -328,7 +328,7 @@ test_expect_success 'partial clone' '
 	grep "version 2" trace &&
 
 	# Ensure that the old version of the file is missing
-	git -C client rev-list --quiet --objects --missing=print master \
+	git -C client rev-list --quiet --objects --missing=print main \
 		>observed.oids &&
 	grep "$(git -C server rev-parse message1:a.txt)" observed.oids &&
 
@@ -353,7 +353,7 @@ test_expect_success 'partial fetch' '
 	SERVER="file://$(pwd)/server" &&
 
 	GIT_TRACE_PACKET="$(pwd)/trace" git -C client -c protocol.version=2 \
-		fetch --filter=blob:none "$SERVER" master:refs/heads/other &&
+		fetch --filter=blob:none "$SERVER" main:refs/heads/other &&
 	grep "version 2" trace &&
 
 	# 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
 	command=fetch
 	object-format=$(test_oid algo)
 	0001
-	want $(git -C server rev-parse master)
+	want $(git -C server rev-parse main)
 	filter blob:none
 	0000
 	EOF
@@ -542,7 +542,7 @@ test_expect_success 'deepen-relative' '
 	test_commit -C server four &&
 
 	# Sanity check that only "three" is downloaded
-	git -C client log --pretty=tformat:%s master >actual &&
+	git -C client log --pretty=tformat:%s main >actual &&
 	echo three >expected &&
 	test_cmp expected actual &&
 
@@ -551,7 +551,7 @@ test_expect_success 'deepen-relative' '
 	# Ensure that protocol v2 is used
 	grep "fetch< version 2" trace &&
 
-	git -C client log --pretty=tformat:%s origin/master >actual &&
+	git -C client log --pretty=tformat:%s origin/main >actual &&
 	cat >expected <<-\EOF &&
 	four
 	three
@@ -673,7 +673,7 @@ test_expect_success 'fetch with http:// using protocol v2' '
 	GIT_TRACE_PACKET="$(pwd)/log" git -C http_child -c protocol.version=2 \
 		fetch &&
 
-	git -C http_child log -1 --format=%s origin/master >actual &&
+	git -C http_child log -1 --format=%s origin/main >actual &&
 	git -C "$HTTPD_DOCUMENT_ROOT_PATH/http_parent" log -1 --format=%s >expect &&
 	test_cmp expect actual &&
 
@@ -701,11 +701,11 @@ test_expect_success 'fetch from namespaced repo respects namespaces' '
 	test_commit -C "$HTTPD_DOCUMENT_ROOT_PATH/nsrepo" one &&
 	test_commit -C "$HTTPD_DOCUMENT_ROOT_PATH/nsrepo" two &&
 	git -C "$HTTPD_DOCUMENT_ROOT_PATH/nsrepo" \
-		update-ref refs/namespaces/ns/refs/heads/master one &&
+		update-ref refs/namespaces/ns/refs/heads/main one &&
 
 	GIT_TRACE_PACKET="$(pwd)/log" git -C http_child -c protocol.version=2 \
 		fetch "$HTTPD_URL/smart_namespace/nsrepo" \
-		refs/heads/master:refs/heads/theirs &&
+		refs/heads/main:refs/heads/theirs &&
 
 	# Server responded using protocol v2
 	grep "fetch< version 2" log &&
@@ -736,7 +736,7 @@ test_expect_success 'push with http:// and a config of v2 does not request v2' '
 	test_commit -C http_child three &&
 
 	# Push to another branch, as the target repository has the
-	# master branch checked out and we cannot push into it.
+	# main branch checked out and we cannot push into it.
 	GIT_TRACE_PACKET="$(pwd)/log" git -C http_child -c protocol.version=2 \
 		push origin HEAD:client_branch &&
 
diff --git a/t/t5703-upload-pack-ref-in-want.sh b/t/t5703-upload-pack-ref-in-want.sh
index c3a52d478f..0f3e0bf15c 100755
--- a/t/t5703-upload-pack-ref-in-want.sh
+++ b/t/t5703-upload-pack-ref-in-want.sh
@@ -2,7 +2,7 @@
 
 test_description='upload-pack ref-in-want'
 
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -41,7 +41,7 @@ write_command () {
 
 # c(o/foo) d(o/bar)
 #        \ /
-#         b   e(baz)  f(master)
+#         b   e(baz)  f(main)
 #          \__  |  __/
 #             \ | /
 #               a
@@ -54,7 +54,7 @@ test_expect_success 'setup repository' '
 	test_commit d &&
 	git checkout -b baz a &&
 	test_commit e &&
-	git checkout master &&
+	git checkout main &&
 	test_commit f
 '
 
@@ -91,7 +91,7 @@ test_expect_success 'invalid want-ref line' '
 test_expect_success 'basic want-ref' '
 	oid=$(git rev-parse f) &&
 	cat >expected_refs <<-EOF &&
-	$oid refs/heads/master
+	$oid refs/heads/main
 	EOF
 	git rev-parse f >expected_commits &&
 
@@ -100,7 +100,7 @@ test_expect_success 'basic want-ref' '
 	$(write_command fetch)
 	0001
 	no-progress
-	want-ref refs/heads/master
+	want-ref refs/heads/main
 	have $oid
 	done
 	0000
@@ -138,7 +138,7 @@ test_expect_success 'multiple want-ref lines' '
 test_expect_success 'mix want and want-ref' '
 	oid=$(git rev-parse f) &&
 	cat >expected_refs <<-EOF &&
-	$oid refs/heads/master
+	$oid refs/heads/main
 	EOF
 	git rev-parse e f >expected_commits &&
 
@@ -146,7 +146,7 @@ test_expect_success 'mix want and want-ref' '
 	$(write_command fetch)
 	0001
 	no-progress
-	want-ref refs/heads/master
+	want-ref refs/heads/main
 	want $(git rev-parse e)
 	have $(git rev-parse a)
 	done
@@ -185,7 +185,7 @@ LOCAL_PRISTINE="$(pwd)/local_pristine"
 # $REPO
 # c(o/foo) d(o/bar)
 #        \ /
-#         b   e(baz)  f(master)
+#         b   e(baz)  f(main)
 #          \__  |  __/
 #             \ | /
 #               a
@@ -196,7 +196,7 @@ LOCAL_PRISTINE="$(pwd)/local_pristine"
 #		.
 #		.
 #		|
-#		a(master)
+#		a(main)
 test_expect_success 'setup repos for fetching with ref-in-want tests' '
 	(
 		git init "$REPO" &&
@@ -212,7 +212,7 @@ test_expect_success 'setup repos for fetching with ref-in-want tests' '
 		test_commit_bulk --id=s 33 &&
 
 		# Add novel commits to upstream
-		git checkout master &&
+		git checkout main &&
 		cd "$REPO" &&
 		git checkout -b o/foo &&
 		test_commit b &&
@@ -221,7 +221,7 @@ test_expect_success 'setup repos for fetching with ref-in-want tests' '
 		test_commit d &&
 		git checkout -b baz a &&
 		test_commit e &&
-		git checkout master &&
+		git checkout main &&
 		test_commit f
 	) &&
 	git -C "$REPO" config uploadpack.allowRefInWant true &&
@@ -248,12 +248,12 @@ test_expect_success 'fetching multiple refs' '
 
 	rm -rf local &&
 	cp -r "$LOCAL_PRISTINE" local &&
-	GIT_TRACE_PACKET="$(pwd)/log" git -C local fetch origin master baz &&
+	GIT_TRACE_PACKET="$(pwd)/log" git -C local fetch origin main baz &&
 
-	git -C "$REPO" rev-parse "master" "baz" >expected &&
-	git -C local rev-parse refs/remotes/origin/master refs/remotes/origin/baz >actual &&
+	git -C "$REPO" rev-parse "main" "baz" >expected &&
+	git -C local rev-parse refs/remotes/origin/main refs/remotes/origin/baz >actual &&
 	test_cmp expected actual &&
-	grep "want-ref refs/heads/master" log &&
+	grep "want-ref refs/heads/main" log &&
 	grep "want-ref refs/heads/baz" log
 '
 
@@ -264,13 +264,13 @@ test_expect_success 'fetching ref and exact OID' '
 	cp -r "$LOCAL_PRISTINE" local &&
 	oid=$(git -C "$REPO" rev-parse b) &&
 	GIT_TRACE_PACKET="$(pwd)/log" git -C local fetch origin \
-		master "$oid":refs/heads/actual &&
+		main "$oid":refs/heads/actual &&
 
-	git -C "$REPO" rev-parse "master" "b" >expected &&
-	git -C local rev-parse refs/remotes/origin/master refs/heads/actual >actual &&
+	git -C "$REPO" rev-parse "main" "b" >expected &&
+	git -C local rev-parse refs/remotes/origin/main refs/heads/actual >actual &&
 	test_cmp expected actual &&
 	grep "want $oid" log &&
-	grep "want-ref refs/heads/master" log
+	grep "want-ref refs/heads/main" log
 '
 
 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' '
 		test_commit_bulk --id=s 33 &&
 
 		# Add novel commits to upstream
-		git checkout master &&
+		git checkout main &&
 		cd "$REPO" &&
 		test_commit m2 &&
 		test_commit m3 &&
@@ -345,7 +345,7 @@ test_expect_success 'server is initially ahead - no ref in want' '
 	git -C "$REPO" config uploadpack.allowRefInWant false &&
 	rm -rf local &&
 	cp -r "$LOCAL_PRISTINE" local &&
-	inconsistency master $(test_oid numeric) &&
+	inconsistency main $(test_oid numeric) &&
 	test_must_fail git -C local fetch 2>err &&
 	test_i18ngrep "fatal: remote error: upload-pack: not our ref" err
 '
@@ -354,11 +354,11 @@ test_expect_success 'server is initially ahead - ref in want' '
 	git -C "$REPO" config uploadpack.allowRefInWant true &&
 	rm -rf local &&
 	cp -r "$LOCAL_PRISTINE" local &&
-	inconsistency master $(test_oid numeric) &&
+	inconsistency main $(test_oid numeric) &&
 	git -C local fetch &&
 
-	git -C "$REPO" rev-parse --verify master >expected &&
-	git -C local rev-parse --verify refs/remotes/origin/master >actual &&
+	git -C "$REPO" rev-parse --verify main >expected &&
+	git -C local rev-parse --verify refs/remotes/origin/main >actual &&
 	test_cmp expected actual
 '
 
@@ -366,11 +366,11 @@ test_expect_success 'server is initially behind - no ref in want' '
 	git -C "$REPO" config uploadpack.allowRefInWant false &&
 	rm -rf local &&
 	cp -r "$LOCAL_PRISTINE" local &&
-	inconsistency master "master^" &&
+	inconsistency main "main^" &&
 	git -C local fetch &&
 
-	git -C "$REPO" rev-parse --verify "master^" >expected &&
-	git -C local rev-parse --verify refs/remotes/origin/master >actual &&
+	git -C "$REPO" rev-parse --verify "main^" >expected &&
+	git -C local rev-parse --verify refs/remotes/origin/main >actual &&
 	test_cmp expected actual
 '
 
@@ -378,11 +378,11 @@ test_expect_success 'server is initially behind - ref in want' '
 	git -C "$REPO" config uploadpack.allowRefInWant true &&
 	rm -rf local &&
 	cp -r "$LOCAL_PRISTINE" local &&
-	inconsistency master "master^" &&
+	inconsistency main "main^" &&
 	git -C local fetch &&
 
-	git -C "$REPO" rev-parse --verify "master" >expected &&
-	git -C local rev-parse --verify refs/remotes/origin/master >actual &&
+	git -C "$REPO" rev-parse --verify "main" >expected &&
+	git -C local rev-parse --verify refs/remotes/origin/main >actual &&
 	test_cmp expected actual
 '
 
diff --git a/t/t5801-remote-helpers.sh b/t/t5801-remote-helpers.sh
index 1ecefb57fe..d386076dbd 100755
--- a/t/t5801-remote-helpers.sh
+++ b/t/t5801-remote-helpers.sh
@@ -5,7 +5,7 @@
 
 test_description='Test remote-helper import and export commands'
 
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -74,18 +74,18 @@ test_expect_success 'fetch multiple branches' '
 	(cd local &&
 	 git fetch
 	) &&
-	compare_refs server master local refs/remotes/origin/master &&
+	compare_refs server main local refs/remotes/origin/main &&
 	compare_refs server new local refs/remotes/origin/new
 '
 
 test_expect_success 'push when remote has extra refs' '
 	(cd local &&
-	 git reset --hard origin/master &&
+	 git reset --hard origin/main &&
 	 echo content >>file &&
 	 git commit -a -m six &&
 	 git push
 	) &&
-	compare_refs local master server master
+	compare_refs local main server main
 '
 
 test_expect_success 'push new branch by name' '
@@ -177,7 +177,7 @@ test_expect_failure 'pushing without marks' '
 
 test_expect_success 'push all with existing object' '
 	(cd local &&
-	git branch dup2 master &&
+	git branch dup2 main &&
 	git push origin --all
 	) &&
 	compare_refs local dup2 server dup2
@@ -185,7 +185,7 @@ test_expect_success 'push all with existing object' '
 
 test_expect_success 'push ref with existing object' '
 	(cd local &&
-	git branch dup master &&
+	git branch dup main &&
 	git push origin dup
 	) &&
 	compare_refs local dup server dup
@@ -193,7 +193,7 @@ test_expect_success 'push ref with existing object' '
 
 test_expect_success GPG 'push signed tag' '
 	(cd local &&
-	git checkout master &&
+	git checkout main &&
 	git tag -s -m signed-tag signed-tag &&
 	git push origin signed-tag
 	) &&
@@ -203,7 +203,7 @@ test_expect_success GPG 'push signed tag' '
 
 test_expect_success GPG 'push signed tag with signed-tags capability' '
 	(cd local &&
-	git checkout master &&
+	git checkout main &&
 	git tag -s -m signed-tag signed-tag-2 &&
 	GIT_REMOTE_TESTGIT_SIGNED_TAGS=1 git push origin signed-tag-2
 	) &&
@@ -212,7 +212,7 @@ test_expect_success GPG 'push signed tag with signed-tags capability' '
 
 test_expect_success 'push update refs' '
 	(cd local &&
-	git checkout -b update master &&
+	git checkout -b update main &&
 	echo update >>file &&
 	git commit -a -m update &&
 	git push origin update &&
@@ -263,7 +263,7 @@ test_expect_success 'proper failure checks for fetching' '
 test_expect_success 'proper failure checks for pushing' '
 	test_when_finished "rm -rf local/git.marks local/testgit.marks" &&
 	(cd local &&
-	git checkout -b crash master &&
+	git checkout -b crash main &&
 	echo crash >>file &&
 	git commit -a -m crash &&
 	test_must_fail env GIT_REMOTE_TESTGIT_FAILURE=1 git push --all &&
@@ -275,7 +275,7 @@ test_expect_success 'proper failure checks for pushing' '
 
 test_expect_success 'push messages' '
 	(cd local &&
-	git checkout -b new_branch master &&
+	git checkout -b new_branch main &&
 	echo new >>file &&
 	git commit -a -m new &&
 	git push origin new_branch &&
@@ -289,7 +289,7 @@ test_expect_success 'push messages' '
 
 test_expect_success 'fetch HEAD' '
 	(cd server &&
-	git checkout master &&
+	git checkout main &&
 	echo more >>file &&
 	git commit -a -m more
 	) &&
@@ -301,7 +301,7 @@ test_expect_success 'fetch HEAD' '
 
 test_expect_success 'fetch url' '
 	(cd server &&
-	git checkout master &&
+	git checkout main &&
 	echo more >>file &&
 	git commit -a -m more
 	) &&
-- 
gitgitgadget


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH v3 18/28] t6[0-3]*: adjust the references to the default branch name "main"
  2020-11-18 23:44   ` [PATCH v3 00/28] tests: use main as default branch name Johannes Schindelin via GitGitGadget
                       ` (16 preceding siblings ...)
  2020-11-18 23:44     ` [PATCH v3 17/28] t5[6-9]*: " Johannes Schindelin via GitGitGadget
@ 2020-11-18 23:44     ` Johannes Schindelin via GitGitGadget
  2020-11-18 23:44     ` [PATCH v3 19/28] t64*: preemptively adjust alignment to prepare for `master` -> `main` Johannes Schindelin via GitGitGadget
                       ` (10 subsequent siblings)
  28 siblings, 0 replies; 163+ messages in thread
From: Johannes Schindelin via GitGitGadget @ 2020-11-18 23:44 UTC (permalink / raw)
  To: git
  Cc: Felipe Contreras, Ævar Arnfjörð Bjarmason,
	Johannes Schindelin, Jeff King, Jonathan Nieder,
	Johannes Schindelin, Johannes Schindelin

From: Johannes Schindelin <johannes.schindelin@gmx.de>

Carefully excluding t6300, which sees independent development elsewhere
at the time of writing, we use `main` as the default branch name in
t6[0-3]*. This trick was performed via

	$ (cd t &&
	   sed -i -e 's/master/main/g' -e 's/MASTER/MAIN/g' \
		-e 's/Master/Main/g' -- t6[0-3]*.sh &&
	   git checkout HEAD -- t6300\*)

This allows us to define `GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main`
for those tests.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
---
 t/t6000-rev-list-misc.sh                   |  4 +-
 t/t6001-rev-list-graft.sh                  |  4 +-
 t/t6004-rev-list-path-optim.sh             | 16 +++----
 t/t6006-rev-list-format.sh                 | 16 +++----
 t/t6007-rev-list-cherry-pick-file.sh       |  6 +--
 t/t6008-rev-list-submodule.sh              |  4 +-
 t/t6009-rev-list-parent.sh                 |  8 ++--
 t/t6012-rev-list-simplify.sh               | 10 ++--
 t/t6013-rev-list-reverse-parents.sh        | 12 ++---
 t/t6016-rev-list-graph-simplify-history.sh |  4 +-
 t/t6017-rev-list-stdin.sh                  | 10 ++--
 t/t6018-rev-list-glob.sh                   | 52 ++++++++++----------
 t/t6019-rev-list-ancestry-path.sh          |  8 ++--
 t/t6030-bisect-porcelain.sh                | 12 ++---
 t/t6040-tracking-info.sh                   | 56 +++++++++++-----------
 t/t6050-replace.sh                         | 12 ++---
 t/t6101-rev-parse-parents.sh               |  4 +-
 t/t6110-rev-list-sparse.sh                 |  4 +-
 t/t6111-rev-list-treesame.sh               |  8 ++--
 t/t6112-rev-list-filters-objects.sh        | 16 +++----
 t/t6120-describe.sh                        | 22 ++++-----
 t/t6200-fmt-merge-msg.sh                   | 52 ++++++++++----------
 t/t6302-for-each-ref-filter.sh             | 48 +++++++++----------
 23 files changed, 194 insertions(+), 194 deletions(-)

diff --git a/t/t6000-rev-list-misc.sh b/t/t6000-rev-list-misc.sh
index 664000adf0..12def7bcbf 100755
--- a/t/t6000-rev-list-misc.sh
+++ b/t/t6000-rev-list-misc.sh
@@ -2,7 +2,7 @@
 
 test_description='miscellaneous rev-list tests'
 
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -88,7 +88,7 @@ test_expect_success 'propagate uninteresting flag down correctly' '
 '
 
 test_expect_success 'symleft flag bit is propagated down from tag' '
-	git log --format="%m %s" --left-right v1.0...master >actual &&
+	git log --format="%m %s" --left-right v1.0...main >actual &&
 	cat >expect <<-\EOF &&
 	< another
 	< that
diff --git a/t/t6001-rev-list-graft.sh b/t/t6001-rev-list-graft.sh
index 67c384f1e8..90d93f77fa 100755
--- a/t/t6001-rev-list-graft.sh
+++ b/t/t6001-rev-list-graft.sh
@@ -2,7 +2,7 @@
 
 test_description='Revision traversal vs grafts and path limiter'
 
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -23,7 +23,7 @@ test_expect_success setup '
 	git commit -a -m "Third in one history." &&
 	A2=$(git rev-parse --verify HEAD) &&
 
-	rm -f .git/refs/heads/master .git/index &&
+	rm -f .git/refs/heads/main .git/index &&
 
 	echo >fileA fileA again &&
 	echo >subdir/fileB fileB again &&
diff --git a/t/t6004-rev-list-path-optim.sh b/t/t6004-rev-list-path-optim.sh
index ff788199e3..cd4f420e2a 100755
--- a/t/t6004-rev-list-path-optim.sh
+++ b/t/t6004-rev-list-path-optim.sh
@@ -4,7 +4,7 @@ test_description='git rev-list trivial path optimization test
 
    d/z1
    b0                             b1
-   o------------------------*----o master
+   o------------------------*----o main
   /                        /
  o---------o----o----o----o side
  a0        c0   c1   a1   c2
@@ -13,7 +13,7 @@ test_description='git rev-list trivial path optimization test
 
 '
 
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -58,18 +58,18 @@ test_expect_success 'further setup' '
 	git add c &&
 	test_tick &&
 	git commit -m "Side makes yet another irrelevant commit" &&
-	git checkout master &&
+	git checkout main &&
 	echo Another >b &&
 	echo Munged >d/z &&
 	git add b d/z &&
 	test_tick &&
-	git commit -m "Master touches b" &&
-	git tag master_b0 &&
+	git commit -m "Main touches b" &&
+	git tag main_b0 &&
 	git merge side &&
 	echo Touched >b &&
 	git add b &&
 	test_tick &&
-	git commit -m "Master touches b again"
+	git commit -m "Main touches b again"
 '
 
 test_expect_success 'path optimization 2' '
@@ -79,13 +79,13 @@ test_expect_success 'path optimization 2' '
 '
 
 test_expect_success 'pathspec with leading path' '
-	git rev-parse master^ master_b0 side_c0 initial >expected &&
+	git rev-parse main^ main_b0 side_c0 initial >expected &&
 	git rev-list HEAD -- d >actual &&
 	test_cmp expected actual
 '
 
 test_expect_success 'pathspec with glob (1)' '
-	git rev-parse master^ master_b0 side_c0 initial >expected &&
+	git rev-parse main^ main_b0 side_c0 initial >expected &&
 	git rev-list HEAD -- "d/*" >actual &&
 	test_cmp expected actual
 '
diff --git a/t/t6006-rev-list-format.sh b/t/t6006-rev-list-format.sh
index bbbd577f10..35a2f62392 100755
--- a/t/t6006-rev-list-format.sh
+++ b/t/t6006-rev-list-format.sh
@@ -5,7 +5,7 @@
 
 test_description='git rev-list --pretty=format test'
 
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -56,7 +56,7 @@ test_expect_success 'setup' '
 test_format () {
 	cat >expect.$1
 	test_expect_${3:-success} "format $1" "
-		git rev-list --pretty=format:'$2' master >output.$1 &&
+		git rev-list --pretty=format:'$2' main >output.$1 &&
 		test_cmp expect.$1 output.$1
 	"
 }
@@ -187,13 +187,13 @@ test_expect_success 'basic colors' '
 	<RED>foo<GREEN>bar<BLUE>baz<RESET>xyzzy
 	EOF
 	format="%Credfoo%Cgreenbar%Cbluebaz%Cresetxyzzy" &&
-	git rev-list --color --format="$format" -1 master >actual.raw &&
+	git rev-list --color --format="$format" -1 main >actual.raw &&
 	test_decode_color <actual.raw >actual &&
 	test_cmp expect actual
 '
 
 test_expect_success '%S is not a placeholder for rev-list yet' '
-	git rev-list --format="%S" -1 master | grep "%S"
+	git rev-list --format="%S" -1 main | grep "%S"
 '
 
 test_expect_success 'advanced colors' '
@@ -202,7 +202,7 @@ test_expect_success 'advanced colors' '
 	<BOLD;RED;BYELLOW>foo<RESET>
 	EOF
 	format="%C(red yellow bold)foo%C(reset)" &&
-	git rev-list --color --format="$format" -1 master >actual.raw &&
+	git rev-list --color --format="$format" -1 main >actual.raw &&
 	test_decode_color <actual.raw >actual &&
 	test_cmp expect actual
 '
@@ -409,7 +409,7 @@ test_expect_success '%x00 shows NUL' '
 
 test_expect_success '%ad respects --date=' '
 	echo 2005-04-07 >expect.ad-short &&
-	git log -1 --date=short --pretty=tformat:%ad >output.ad-short master &&
+	git log -1 --date=short --pretty=tformat:%ad >output.ad-short main &&
 	test_cmp expect.ad-short output.ad-short
 '
 
@@ -497,8 +497,8 @@ test_expect_success '"%h %gD: %gs" is same as git-reflog (with --abbrev)' '
 '
 
 test_expect_success '%gd shortens ref name' '
-	echo "master@{0}" >expect.gd-short &&
-	git log -g -1 --format=%gd refs/heads/master >actual.gd-short &&
+	echo "main@{0}" >expect.gd-short &&
+	git log -g -1 --format=%gd refs/heads/main >actual.gd-short &&
 	test_cmp expect.gd-short actual.gd-short
 '
 
diff --git a/t/t6007-rev-list-cherry-pick-file.sh b/t/t6007-rev-list-cherry-pick-file.sh
index 51547ac3a5..b22bf00598 100755
--- a/t/t6007-rev-list-cherry-pick-file.sh
+++ b/t/t6007-rev-list-cherry-pick-file.sh
@@ -2,7 +2,7 @@
 
 test_description='test git rev-list --cherry-pick -- file'
 
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -34,7 +34,7 @@ test_expect_success setup '
 	test_tick &&
 	git commit -m "E" &&
 	git tag E &&
-	git checkout master &&
+	git checkout main &&
 	git checkout branch foo &&
 	test_tick &&
 	git commit -m "B" &&
@@ -236,7 +236,7 @@ test_expect_success '--cherry-pick with independent, but identical branches' '
 	test_tick &&
 	git commit -m "independent, too" foo &&
 	test -z "$(git rev-list --left-right --cherry-pick \
-		HEAD...master -- foo)"
+		HEAD...main -- foo)"
 '
 
 cat >expect <<EOF
diff --git a/t/t6008-rev-list-submodule.sh b/t/t6008-rev-list-submodule.sh
index 871ace31e2..3153a0d891 100755
--- a/t/t6008-rev-list-submodule.sh
+++ b/t/t6008-rev-list-submodule.sh
@@ -5,7 +5,7 @@
 
 test_description='git rev-list involving submodules that this repo has'
 
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -39,7 +39,7 @@ test_expect_success 'setup' '
 '
 
 test_expect_success "Ilari's test" '
-	git rev-list --objects super master ^super^
+	git rev-list --objects super main ^super^
 '
 
 test_done
diff --git a/t/t6009-rev-list-parent.sh b/t/t6009-rev-list-parent.sh
index 114f755d52..63fa7c8313 100755
--- a/t/t6009-rev-list-parent.sh
+++ b/t/t6009-rev-list-parent.sh
@@ -2,7 +2,7 @@
 
 test_description='ancestor culling and limiting by parent number'
 
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -48,7 +48,7 @@ test_expect_success 'setup roots, merges and octopuses' '
 	test_commit seven &&
 	git checkout -b yetanotherbranch four &&
 	test_commit eight &&
-	git checkout master &&
+	git checkout main &&
 	test_tick &&
 	git merge --allow-unrelated-histories -m normalmerge newroot &&
 	git tag normalmerge &&
@@ -59,7 +59,7 @@ test_expect_success 'setup roots, merges and octopuses' '
 	test_tick &&
 	git merge -m tetrapus sidebranch anotherbranch yetanotherbranch &&
 	git tag tetrapus &&
-	git checkout master
+	git checkout main
 '
 
 test_expect_success 'rev-list roots' '
@@ -126,7 +126,7 @@ test_expect_success 'dodecapus' '
 		roots="$roots root$i" ||
 		return
 	done &&
-	git checkout master &&
+	git checkout main &&
 	test_tick &&
 	git merge -m dodecapus $roots &&
 	git tag dodecapus &&
diff --git a/t/t6012-rev-list-simplify.sh b/t/t6012-rev-list-simplify.sh
index d163c24859..4f7fa8b6c0 100755
--- a/t/t6012-rev-list-simplify.sh
+++ b/t/t6012-rev-list-simplify.sh
@@ -2,7 +2,7 @@
 
 test_description='merge simplification'
 
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -46,7 +46,7 @@ test_expect_success setup '
 	git add side &&
 	test_tick && git commit -m "Side root" &&
 	note J &&
-	git checkout master &&
+	git checkout main &&
 
 	echo "Hello" >file &&
 	echo "second" >lost &&
@@ -68,7 +68,7 @@ test_expect_success setup '
 	note D &&
 
 	test_tick &&
-	test_must_fail git merge -m "merge" master &&
+	test_must_fail git merge -m "merge" main &&
 	>lost && git commit -a -m "merge" &&
 	note E &&
 
@@ -77,7 +77,7 @@ test_expect_success setup '
 	test_tick && git commit -m "Irrelevant change" &&
 	note F &&
 
-	git checkout master &&
+	git checkout main &&
 	echo "Yet another" >elif &&
 	git add elif &&
 	test_tick && git commit -m "Another irrelevant change" &&
@@ -90,7 +90,7 @@ test_expect_success setup '
 	test_tick && git commit -a -m "Final change" &&
 	note I &&
 
-	git checkout master &&
+	git checkout main &&
 	test_tick && git merge --allow-unrelated-histories -m "Coolest" unrelated &&
 	note K &&
 
diff --git a/t/t6013-rev-list-reverse-parents.sh b/t/t6013-rev-list-reverse-parents.sh
index 0298174956..39793cbbd6 100755
--- a/t/t6013-rev-list-reverse-parents.sh
+++ b/t/t6013-rev-list-reverse-parents.sh
@@ -2,7 +2,7 @@
 
 test_description='--reverse combines with --parents'
 
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -21,24 +21,24 @@ test_expect_success 'set up --reverse example' '
 	commit two &&
 	git checkout -b side HEAD^ &&
 	commit three &&
-	git checkout master &&
+	git checkout main &&
 	git merge -s ours side &&
 	commit five
 	'
 
 test_expect_success '--reverse --parents --full-history combines correctly' '
-	git rev-list --parents --full-history master -- foo |
+	git rev-list --parents --full-history main -- foo |
 		perl -e "print reverse <>" > expected &&
-	git rev-list --reverse --parents --full-history master -- foo \
+	git rev-list --reverse --parents --full-history main -- foo \
 		> actual &&
 	test_cmp expected actual
 	'
 
 test_expect_success '--boundary does too' '
-	git rev-list --boundary --parents --full-history master ^root -- foo |
+	git rev-list --boundary --parents --full-history main ^root -- foo |
 		perl -e "print reverse <>" > expected &&
 	git rev-list --boundary --reverse --parents --full-history \
-		master ^root -- foo > actual &&
+		main ^root -- foo > actual &&
 	test_cmp expected actual
 	'
 
diff --git a/t/t6016-rev-list-graph-simplify-history.sh b/t/t6016-rev-list-graph-simplify-history.sh
index 3fb7ee0be4..6eddbbcc9f 100755
--- a/t/t6016-rev-list-graph-simplify-history.sh
+++ b/t/t6016-rev-list-graph-simplify-history.sh
@@ -7,7 +7,7 @@
 
 test_description='--graph and simplified history'
 
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -17,7 +17,7 @@ test_expect_success 'set up rev-list --graph test' '
 	test_commit A1 foo.txt &&
 	test_commit A2 bar.txt &&
 	test_commit A3 bar.txt &&
-	git branch -m master A &&
+	git branch -m main A &&
 
 	# 2 commits on branch B, started from A1
 	git checkout -b B A1 &&
diff --git a/t/t6017-rev-list-stdin.sh b/t/t6017-rev-list-stdin.sh
index e51fe7b9bc..05162512a0 100755
--- a/t/t6017-rev-list-stdin.sh
+++ b/t/t6017-rev-list-stdin.sh
@@ -5,7 +5,7 @@
 
 test_description='log family learns --stdin'
 
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -43,7 +43,7 @@ test_expect_success setup '
 		done &&
 		for i in $them
 		do
-			git checkout -b side-$i master~$i &&
+			git checkout -b side-$i main~$i &&
 			echo updated $i >file-$i &&
 			git add file-$i &&
 			test_tick &&
@@ -52,7 +52,7 @@ test_expect_success setup '
 	)
 '
 
-check master
+check main
 check side-1 ^side-4
 check side-1 ^side-7 --
 check side-1 ^side-7 -- file-1
@@ -69,11 +69,11 @@ test_expect_success 'not only --stdin' '
 	file-2
 	EOF
 	cat >input <<-EOF &&
-	^master^
+	^main^
 	--
 	file-2
 	EOF
-	git log --pretty=tformat:%s --name-only --stdin master -- file-1 \
+	git log --pretty=tformat:%s --name-only --stdin main -- file-1 \
 		<input >actual &&
 	test_cmp expect actual
 '
diff --git a/t/t6018-rev-list-glob.sh b/t/t6018-rev-list-glob.sh
index 60a351c26a..24b34add83 100755
--- a/t/t6018-rev-list-glob.sh
+++ b/t/t6018-rev-list-glob.sh
@@ -2,7 +2,7 @@
 
 test_description='rev-list/rev-parse --glob'
 
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -23,22 +23,22 @@ compare () {
 
 test_expect_success 'setup' '
 
-	commit master &&
-	git checkout -b subspace/one master &&
+	commit main &&
+	git checkout -b subspace/one main &&
 	commit one &&
-	git checkout -b subspace/two master &&
+	git checkout -b subspace/two main &&
 	commit two &&
-	git checkout -b subspace-x master &&
+	git checkout -b subspace-x main &&
 	commit subspace-x &&
-	git checkout -b other/three master &&
+	git checkout -b other/three main &&
 	commit three &&
-	git checkout -b someref master &&
+	git checkout -b someref main &&
 	commit some &&
-	git checkout master &&
+	git checkout main &&
 	commit topic_2 &&
-	git tag foo/bar master &&
+	git tag foo/bar main &&
 	commit topic_3 &&
-	git update-ref refs/remotes/foo/baz master &&
+	git update-ref refs/remotes/foo/baz main &&
 	commit topic_4 &&
 	git update-ref refs/remotes/upstream/one subspace/one &&
 	git update-ref refs/remotes/upstream/two subspace/two &&
@@ -86,7 +86,7 @@ test_expect_failure 'rev-parse accepts --glob as detached option' '
 
 test_expect_failure 'rev-parse is not confused by option-like glob' '
 
-	compare rev-parse "master" "--glob --symbolic master"
+	compare rev-parse "main" "--glob --symbolic main"
 
 '
 
@@ -114,15 +114,15 @@ test_expect_success 'rev-parse --glob=heads/subspace/* --glob=heads/other/*' '
 
 '
 
-test_expect_success 'rev-parse --glob=heads/someref/* master' '
+test_expect_success 'rev-parse --glob=heads/someref/* main' '
 
-	compare rev-parse "master" "--glob=heads/someref/* master"
+	compare rev-parse "main" "--glob=heads/someref/* main"
 
 '
 
 test_expect_success 'rev-parse --glob=heads/*' '
 
-	compare rev-parse "master other/three someref subspace-x subspace/one subspace/two" "--glob=heads/*"
+	compare rev-parse "main other/three someref subspace-x subspace/one subspace/two" "--glob=heads/*"
 
 '
 
@@ -139,7 +139,7 @@ test_expect_success 'rev-parse --remotes=foo' '
 '
 
 test_expect_success 'rev-parse --exclude with --branches' '
-	compare rev-parse "--exclude=*/* --branches" "master someref subspace-x"
+	compare rev-parse "--exclude=*/* --branches" "main someref subspace-x"
 '
 
 test_expect_success 'rev-parse --exclude with --all' '
@@ -224,7 +224,7 @@ test_expect_success 'rev-list --glob refs/heads/subspace/*' '
 
 test_expect_success 'rev-list not confused by option-like --glob arg' '
 
-	compare rev-list "master" "--glob -0 master"
+	compare rev-list "main" "--glob -0 main"
 
 '
 
@@ -272,13 +272,13 @@ test_expect_success 'rev-list --branches=subspace' '
 
 test_expect_success 'rev-list --branches' '
 
-	compare rev-list "master subspace-x someref other/three subspace/one subspace/two" "--branches"
+	compare rev-list "main subspace-x someref other/three subspace/one subspace/two" "--branches"
 
 '
 
-test_expect_success 'rev-list --glob=heads/someref/* master' '
+test_expect_success 'rev-list --glob=heads/someref/* main' '
 
-	compare rev-list "master" "--glob=heads/someref/* master"
+	compare rev-list "main" "--glob=heads/someref/* main"
 
 '
 
@@ -290,7 +290,7 @@ test_expect_success 'rev-list --glob=heads/subspace/* --glob=heads/other/*' '
 
 test_expect_success 'rev-list --glob=heads/*' '
 
-	compare rev-list "master other/three someref subspace-x subspace/one subspace/two" "--glob=heads/*"
+	compare rev-list "main other/three someref subspace-x subspace/one subspace/two" "--glob=heads/*"
 
 '
 
@@ -313,7 +313,7 @@ test_expect_success 'rev-list --remotes=foo' '
 '
 
 test_expect_success 'rev-list --exclude with --branches' '
-	compare rev-list "--exclude=*/* --branches" "master someref subspace-x"
+	compare rev-list "--exclude=*/* --branches" "main someref subspace-x"
 '
 
 test_expect_success 'rev-list --exclude with --all' '
@@ -357,13 +357,13 @@ test_expect_success 'shortlog accepts --glob/--tags/--remotes' '
 
 	compare shortlog "subspace/one subspace/two" --branches=subspace &&
 	compare shortlog \
-	  "master subspace-x someref other/three subspace/one subspace/two" \
+	  "main subspace-x someref other/three subspace/one subspace/two" \
 	  --branches &&
-	compare shortlog master "--glob=heads/someref/* master" &&
+	compare shortlog main "--glob=heads/someref/* main" &&
 	compare shortlog "subspace/one subspace/two other/three" \
 	  "--glob=heads/subspace/* --glob=heads/other/*" &&
 	compare shortlog \
-	  "master other/three someref subspace-x subspace/one subspace/two" \
+	  "main other/three someref subspace-x subspace/one subspace/two" \
 	  "--glob=heads/*" &&
 	compare shortlog foo/bar --tags=foo &&
 	compare shortlog "foo/bar qux/one qux/two qux/x" --tags &&
@@ -374,14 +374,14 @@ test_expect_success 'shortlog accepts --glob/--tags/--remotes' '
 test_expect_failure 'shortlog accepts --glob as detached option' '
 
 	compare shortlog \
-	  "master other/three someref subspace-x subspace/one subspace/two" \
+	  "main other/three someref subspace-x subspace/one subspace/two" \
 	  "--glob heads/*"
 
 '
 
 test_expect_failure 'shortlog --glob is not confused by option-like argument' '
 
-	compare shortlog master "--glob -e master"
+	compare shortlog main "--glob -e main"
 
 '
 
diff --git a/t/t6019-rev-list-ancestry-path.sh b/t/t6019-rev-list-ancestry-path.sh
index aeb7defaa3..20adbece65 100755
--- a/t/t6019-rev-list-ancestry-path.sh
+++ b/t/t6019-rev-list-ancestry-path.sh
@@ -21,7 +21,7 @@ test_description='--ancestry-path'
 #  --ancestry-path G..M -- G.t == L
 #  --ancestry-path --simplify-merges G^..M -- G.t == G L
 
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -131,15 +131,15 @@ test_expect_success 'setup criss-cross' '
 	(cd criss-cross &&
 	 git init &&
 	 test_commit A &&
-	 git checkout -b xb master &&
+	 git checkout -b xb main &&
 	 test_commit B &&
-	 git checkout -b xc master &&
+	 git checkout -b xc main &&
 	 test_commit C &&
 	 git checkout -b xbc xb -- &&
 	 git merge xc &&
 	 git checkout -b xcb xc -- &&
 	 git merge xb &&
-	 git checkout master)
+	 git checkout main)
 '
 
 # no commits in bc descend from cb
diff --git a/t/t6030-bisect-porcelain.sh b/t/t6030-bisect-porcelain.sh
index 7dc65c73cd..f954f0e669 100755
--- a/t/t6030-bisect-porcelain.sh
+++ b/t/t6030-bisect-porcelain.sh
@@ -6,7 +6,7 @@ test_description='Tests git bisect functionality'
 
 exec </dev/null
 
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -92,9 +92,9 @@ test_expect_success 'bisect start without -- takes unknown arg as pathspec' '
 	grep bar ".git/BISECT_NAMES"
 '
 
-test_expect_success 'bisect reset: back in the master branch' '
+test_expect_success 'bisect reset: back in the main branch' '
 	git bisect reset &&
-	echo "* master" > branch.expect &&
+	echo "* main" > branch.expect &&
 	git branch > branch.output &&
 	cmp branch.expect branch.output
 '
@@ -105,7 +105,7 @@ test_expect_success 'bisect reset: back in another branch' '
 	git bisect good $HASH1 &&
 	git bisect bad $HASH3 &&
 	git bisect reset &&
-	echo "  master" > branch.expect &&
+	echo "  main" > branch.expect &&
 	echo "* other" >> branch.expect &&
 	git branch > branch.output &&
 	cmp branch.expect branch.output
@@ -351,7 +351,7 @@ test_expect_success 'bisect skip many ranges' '
 
 test_expect_success 'bisect starting with a detached HEAD' '
 	git bisect reset &&
-	git checkout master^ &&
+	git checkout main^ &&
 	HEAD=$(git rev-parse --verify HEAD) &&
 	git bisect start &&
 	test $HEAD = $(cat .git/BISECT_START) &&
@@ -719,7 +719,7 @@ test_expect_success 'bisect: --no-checkout - target after breakage' '
 test_expect_success 'bisect: demonstrate identification of damage boundary' "
 	git bisect reset &&
 	git checkout broken &&
-	git bisect start broken master --no-checkout &&
+	git bisect start broken main --no-checkout &&
 	test_must_fail git bisect run \"\$SHELL_PATH\" -c '
 		GOOD=\$(git for-each-ref \"--format=%(objectname)\" refs/bisect/good-*) &&
 		git rev-list --objects BISECT_HEAD --not \$GOOD >tmp.\$\$ &&
diff --git a/t/t6040-tracking-info.sh b/t/t6040-tracking-info.sh
index bc95ff6f54..a160b2bf99 100755
--- a/t/t6040-tracking-info.sh
+++ b/t/t6040-tracking-info.sh
@@ -2,7 +2,7 @@
 
 test_description='remote tracking stats'
 
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -37,7 +37,7 @@ test_expect_success setup '
 		git branch -d brokenbase &&
 		git checkout -b b6 origin
 	) &&
-	git checkout -b follower --track master &&
+	git checkout -b follower --track main &&
 	advance h
 '
 
@@ -61,12 +61,12 @@ test_expect_success 'branch -v' '
 '
 
 cat >expect <<\EOF
-b1 [origin/master: ahead 1, behind 1] d
-b2 [origin/master: ahead 1, behind 1] d
-b3 [origin/master: behind 1] b
-b4 [origin/master: ahead 2] f
+b1 [origin/main: ahead 1, behind 1] d
+b2 [origin/main: ahead 1, behind 1] d
+b3 [origin/main: behind 1] b
+b4 [origin/main: ahead 2] f
 b5 [brokenbase: gone] g
-b6 [origin/master] c
+b6 [origin/main] c
 EOF
 
 test_expect_success 'branch -vv' '
@@ -86,7 +86,7 @@ test_expect_success 'checkout (diverged from upstream)' '
 '
 
 test_expect_success 'checkout with local tracked branch' '
-	git checkout master &&
+	git checkout main &&
 	git checkout follower >actual &&
 	test_i18ngrep "is ahead of" actual
 '
@@ -103,7 +103,7 @@ test_expect_success 'checkout (up-to-date with upstream)' '
 	(
 		cd test && git checkout b6
 	) >actual &&
-	test_i18ngrep "Your branch is up to date with .origin/master" actual
+	test_i18ngrep "Your branch is up to date with .origin/main" actual
 '
 
 test_expect_success 'status (diverged from upstream)' '
@@ -133,11 +133,11 @@ test_expect_success 'status (up-to-date with upstream)' '
 		# reports nothing to commit
 		test_must_fail git commit --dry-run
 	) >actual &&
-	test_i18ngrep "Your branch is up to date with .origin/master" actual
+	test_i18ngrep "Your branch is up to date with .origin/main" actual
 '
 
 cat >expect <<\EOF
-## b1...origin/master [ahead 1, behind 1]
+## b1...origin/main [ahead 1, behind 1]
 EOF
 
 test_expect_success 'status -s -b (diverged from upstream)' '
@@ -150,7 +150,7 @@ test_expect_success 'status -s -b (diverged from upstream)' '
 '
 
 cat >expect <<\EOF
-## b1...origin/master [different]
+## b1...origin/main [different]
 EOF
 
 test_expect_success 'status -s -b --no-ahead-behind (diverged from upstream)' '
@@ -163,7 +163,7 @@ test_expect_success 'status -s -b --no-ahead-behind (diverged from upstream)' '
 '
 
 cat >expect <<\EOF
-## b1...origin/master [different]
+## b1...origin/main [different]
 EOF
 
 test_expect_success 'status.aheadbehind=false status -s -b (diverged from upstream)' '
@@ -177,7 +177,7 @@ test_expect_success 'status.aheadbehind=false status -s -b (diverged from upstre
 
 cat >expect <<\EOF
 On branch b1
-Your branch and 'origin/master' have diverged,
+Your branch and 'origin/main' have diverged,
 and have 1 and 1 different commits each, respectively.
 EOF
 
@@ -201,7 +201,7 @@ test_expect_success 'status --long --branch' '
 
 cat >expect <<\EOF
 On branch b1
-Your branch and 'origin/master' refer to different commits.
+Your branch and 'origin/main' refer to different commits.
 EOF
 
 test_expect_success 'status --long --branch --no-ahead-behind' '
@@ -236,7 +236,7 @@ test_expect_success 'status -s -b (upstream is gone)' '
 '
 
 cat >expect <<\EOF
-## b6...origin/master
+## b6...origin/main
 EOF
 
 test_expect_success 'status -s -b (up-to-date with upstream)' '
@@ -249,7 +249,7 @@ test_expect_success 'status -s -b (up-to-date with upstream)' '
 '
 
 test_expect_success 'fail to track lightweight tags' '
-	git checkout master &&
+	git checkout main &&
 	git tag light &&
 	test_must_fail git branch --track lighttrack light >actual &&
 	test_i18ngrep ! "set up to track" actual &&
@@ -257,7 +257,7 @@ test_expect_success 'fail to track lightweight tags' '
 '
 
 test_expect_success 'fail to track annotated tags' '
-	git checkout master &&
+	git checkout main &&
 	git tag -m heavy heavy &&
 	test_must_fail git branch --track heavytrack heavy >actual &&
 	test_i18ngrep ! "set up to track" actual &&
@@ -265,17 +265,17 @@ test_expect_success 'fail to track annotated tags' '
 '
 
 test_expect_success '--set-upstream-to does not change branch' '
-	git branch from-master master &&
-	git branch --set-upstream-to master from-master &&
-	git branch from-topic_2 master &&
+	git branch from-main main &&
+	git branch --set-upstream-to main from-main &&
+	git branch from-topic_2 main &&
 	test_must_fail git config branch.from-topic_2.merge > actual &&
 	git rev-list from-topic_2 &&
 	git update-ref refs/heads/from-topic_2 from-topic_2^ &&
 	git rev-parse from-topic_2 >expect2 &&
-	git branch --set-upstream-to master from-topic_2 &&
-	git config branch.from-master.merge > actual &&
+	git branch --set-upstream-to main from-topic_2 &&
+	git config branch.from-main.merge > actual &&
 	git rev-parse from-topic_2 >actual2 &&
-	grep -q "^refs/heads/master$" actual &&
+	grep -q "^refs/heads/main$" actual &&
 	cmp expect2 actual2
 '
 
@@ -283,11 +283,11 @@ test_expect_success '--set-upstream-to @{-1}' '
 	git checkout follower &&
 	git checkout from-topic_2 &&
 	git config branch.from-topic_2.merge > expect2 &&
-	git branch --set-upstream-to @{-1} from-master &&
-	git config branch.from-master.merge > actual &&
+	git branch --set-upstream-to @{-1} from-main &&
+	git config branch.from-main.merge > actual &&
 	git config branch.from-topic_2.merge > actual2 &&
-	git branch --set-upstream-to follower from-master &&
-	git config branch.from-master.merge > expect &&
+	git branch --set-upstream-to follower from-main &&
+	git config branch.from-main.merge > expect &&
 	test_cmp expect2 actual2 &&
 	test_cmp expect actual
 '
diff --git a/t/t6050-replace.sh b/t/t6050-replace.sh
index 0a53462a61..93c08b1999 100755
--- a/t/t6050-replace.sh
+++ b/t/t6050-replace.sh
@@ -4,7 +4,7 @@
 #
 test_description='Tests replace refs functionality'
 
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -136,9 +136,9 @@ test_expect_success 'tag replaced commit' '
 '
 
 test_expect_success '"git fsck" works' '
-     git fsck master >fsck_master.out &&
-     test_i18ngrep "dangling commit $R" fsck_master.out &&
-     test_i18ngrep "dangling tag $(git show-ref -s refs/tags/mytag)" fsck_master.out &&
+     git fsck main >fsck_main.out &&
+     test_i18ngrep "dangling commit $R" fsck_main.out &&
+     test_i18ngrep "dangling tag $(git show-ref -s refs/tags/mytag)" fsck_main.out &&
      test -z "$(git fsck)"
 '
 
@@ -221,7 +221,7 @@ test_expect_success 'create parallel branch without the bug' '
      git cherry-pick $HASH6 &&
      PARA6=$(git rev-parse --verify HEAD) &&
      git replace $HASH6 $PARA6 &&
-     git checkout master &&
+     git checkout main &&
      cur=$(git rev-parse --verify HEAD) &&
      test "$cur" = "$HASH7" &&
      git log --pretty=oneline | grep $PARA2 &&
@@ -464,7 +464,7 @@ test_expect_success GPG 'set up a merge commit with a mergetag' '
 	git commit -m "hello: 2 more lines from a test branch" &&
 	HASH9=$(git rev-parse --verify HEAD) &&
 	git tag -s -m "tag for testing with a mergetag" test_tag HEAD &&
-	git checkout master &&
+	git checkout main &&
 	git merge -s ours test_tag &&
 	HASH10=$(git rev-parse --verify HEAD) &&
 	git cat-file commit $HASH10 | grep "^mergetag object"
diff --git a/t/t6101-rev-parse-parents.sh b/t/t6101-rev-parse-parents.sh
index 19a56f4a4d..78b5851780 100755
--- a/t/t6101-rev-parse-parents.sh
+++ b/t/t6101-rev-parse-parents.sh
@@ -5,7 +5,7 @@
 
 test_description='Test git rev-parse with different parent options'
 
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -21,7 +21,7 @@ test_expect_success 'setup' '
 	test_commit second &&
 	git checkout --orphan tmp &&
 	test_commit start2 &&
-	git checkout master &&
+	git checkout main &&
 	git merge -m next --allow-unrelated-histories start2 &&
 	test_commit final &&
 
diff --git a/t/t6110-rev-list-sparse.sh b/t/t6110-rev-list-sparse.sh
index 69411862d6..13c1da5352 100755
--- a/t/t6110-rev-list-sparse.sh
+++ b/t/t6110-rev-list-sparse.sh
@@ -1,7 +1,7 @@
 #!/bin/sh
 
 test_description='operations that cull histories in unusual ways'
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -13,7 +13,7 @@ test_expect_success setup '
 	git checkout -b side HEAD^ &&
 	test_commit D &&
 	test_commit E &&
-	git merge master
+	git merge main
 '
 
 test_expect_success 'rev-list --first-parent --boundary' '
diff --git a/t/t6111-rev-list-treesame.sh b/t/t6111-rev-list-treesame.sh
index 58b8d42bf3..e07b6070e0 100755
--- a/t/t6111-rev-list-treesame.sh
+++ b/t/t6111-rev-list-treesame.sh
@@ -13,7 +13,7 @@
 
 test_description='TREESAME and limiting'
 
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -36,13 +36,13 @@ test_expect_success setup '
 	git checkout other-branch &&
 	test_commit "Added other" other "Hello" C &&
 
-	git checkout master &&
+	git checkout main &&
 	test_merge D other-branch &&
 
 	git checkout third-branch &&
 	test_commit "Third file" third "Nothing" E &&
 
-	git checkout master &&
+	git checkout main &&
 	test_commit "file=Blah" file "Blah" F &&
 
 	test_tick && git merge --no-commit third-branch &&
@@ -59,7 +59,7 @@ test_expect_success setup '
 
 	test_tick && git revert I && note J &&
 
-	git checkout master &&
+	git checkout main &&
 	test_tick && git merge --no-ff fiddler-branch &&
 	note K &&
 
diff --git a/t/t6112-rev-list-filters-objects.sh b/t/t6112-rev-list-filters-objects.sh
index 5f39c3adb3..31457d13b9 100755
--- a/t/t6112-rev-list-filters-objects.sh
+++ b/t/t6112-rev-list-filters-objects.sh
@@ -2,7 +2,7 @@
 
 test_description='git rev-list using object filtering'
 
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -226,7 +226,7 @@ test_expect_success 'verify sparse:oid=oid-ish omits top-level files' '
 	sort >expected &&
 
 	git -C r3 rev-list --quiet --objects --filter-print-omitted \
-		--filter=sparse:oid=master:pattern HEAD >revs &&
+		--filter=sparse:oid=main:pattern HEAD >revs &&
 	awk -f print_1.awk revs |
 	sed "s/~//" |
 	sort >observed &&
@@ -439,7 +439,7 @@ test_expect_success 'add sparse pattern blobs whose paths have reserved chars' '
 
 test_expect_success 'combine:... with more than two sub-filters' '
 	git -C r3 rev-list --objects \
-		--filter=combine:tree:3+blob:limit=40+sparse:oid=master:pattern \
+		--filter=combine:tree:3+blob:limit=40+sparse:oid=main:pattern \
 		HEAD >actual &&
 
 	expect_has HEAD "" &&
@@ -457,7 +457,7 @@ test_expect_success 'combine:... with more than two sub-filters' '
 	cp actual expect &&
 
 	git -C r3 rev-list --objects \
-		--filter=combine:tree:3+blob:limit=40+sparse:oid=master:pattern1%2brenamed%25 \
+		--filter=combine:tree:3+blob:limit=40+sparse:oid=main:pattern1%2brenamed%25 \
 		HEAD >actual &&
 	test_cmp expect actual &&
 
@@ -467,23 +467,23 @@ test_expect_success 'combine:... with more than two sub-filters' '
 	test_when_finished "rm -f trace1" &&
 	GIT_TRACE=$(pwd)/trace1 git -C r3 rev-list --objects \
 		--filter=tree:3 --filter=blob:limit=40 \
-		--filter=sparse:oid="master:p;at%ter+n" \
+		--filter=sparse:oid="main:p;at%ter+n" \
 		HEAD >actual &&
 
 	test_cmp expect actual &&
-	grep "Add to combine filter-spec: sparse:oid=master:p%3bat%25ter%2bn" \
+	grep "Add to combine filter-spec: sparse:oid=main:p%3bat%25ter%2bn" \
 		trace1 &&
 
 	# Repeat the above test, but this time, the characters to encode are in
 	# the LHS of the combined filter.
 	test_when_finished "rm -f trace2" &&
 	GIT_TRACE=$(pwd)/trace2 git -C r3 rev-list --objects \
-		--filter=sparse:oid=master:^~pattern \
+		--filter=sparse:oid=main:^~pattern \
 		--filter=tree:3 --filter=blob:limit=40 \
 		HEAD >actual &&
 
 	test_cmp expect actual &&
-	grep "Add to combine filter-spec: sparse:oid=master:%5e%7epattern" \
+	grep "Add to combine filter-spec: sparse:oid=main:%5e%7epattern" \
 		trace2
 '
 
diff --git a/t/t6120-describe.sh b/t/t6120-describe.sh
index 360e65d3b9..546796f847 100755
--- a/t/t6120-describe.sh
+++ b/t/t6120-describe.sh
@@ -11,7 +11,7 @@ test_description='test describe'
 #
 # First parent of a merge commit is on the same line, second parent below.
 
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -105,7 +105,7 @@ check_describe c-* --tags HEAD^^2
 check_describe B --tags HEAD^^2^
 check_describe e --tags HEAD^^^
 
-check_describe heads/master --all HEAD
+check_describe heads/main --all HEAD
 check_describe tags/c-* --all HEAD^
 check_describe tags/e --all HEAD^^^
 
@@ -406,15 +406,15 @@ test_expect_success ULIMIT_STACK_SIZE 'name-rev works in a deep repo' '
 	i=1 &&
 	while test $i -lt 8000
 	do
-		echo "commit refs/heads/master
+		echo "commit refs/heads/main
 committer A U Thor <author@example.com> $((1000000000 + $i * 100)) +0200
 data <<EOF
 commit #$i
 EOF"
-		test $i = 1 && echo "from refs/heads/master^0"
+		test $i = 1 && echo "from refs/heads/main^0"
 		i=$(($i + 1))
 	done | git fast-import &&
-	git checkout master &&
+	git checkout main &&
 	git tag far-far-away HEAD^ &&
 	echo "HEAD~4000 tags/far-far-away~3999" >expect &&
 	git name-rev HEAD~4000 >actual &&
@@ -445,7 +445,7 @@ test_expect_success 'describe complains about missing object' '
 '
 
 test_expect_success 'name-rev a rev shortly after epoch' '
-	test_when_finished "git checkout master" &&
+	test_when_finished "git checkout main" &&
 
 	git checkout --orphan no-timestamp-underflow &&
 	# Any date closer to epoch than the CUTOFF_DATE_SLOP constant
@@ -459,7 +459,7 @@ test_expect_success 'name-rev a rev shortly after epoch' '
 	test_cmp expect actual
 '
 
-# A--------------master
+# A--------------main
 #  \            /
 #   \----------M2
 #    \        /
@@ -490,10 +490,10 @@ test_expect_success 'name-rev covers all conditions while looking at parents' '
 		git checkout $A &&
 		git merge --no-ff HEAD@{1} && # M2
 
-		git checkout master &&
+		git checkout main &&
 		git merge --no-ff HEAD@{1} &&
 
-		echo "$B master^2^2~1^2" >expect &&
+		echo "$B main^2^2~1^2" >expect &&
 		git name-rev $B >actual &&
 
 		test_cmp expect actual
@@ -519,7 +519,7 @@ test_expect_success 'describe commits with disjoint bases' '
 		git checkout --orphan branch && rm file &&
 		echo B > file2 && git add file2 && git commit -m B &&
 		git tag B -a -m B &&
-		git merge --no-ff --allow-unrelated-histories master -m x &&
+		git merge --no-ff --allow-unrelated-histories main -m x &&
 
 		check_describe "A-3-*" HEAD
 	)
@@ -545,7 +545,7 @@ test_expect_success 'describe commits with disjoint bases 2' '
 		echo o >> file2 && git add file2 && GIT_COMMITTER_DATE="2020-01-01 15:01" git commit -m o &&
 		echo B >> file2 && git add file2 && GIT_COMMITTER_DATE="2020-01-01 15:02" git commit -m B &&
 		git tag B -a -m B &&
-		git merge --no-ff --allow-unrelated-histories master -m x &&
+		git merge --no-ff --allow-unrelated-histories main -m x &&
 
 		check_describe "B-3-*" HEAD
 	)
diff --git a/t/t6200-fmt-merge-msg.sh b/t/t6200-fmt-merge-msg.sh
index 725b356d1e..44f55d93fe 100755
--- a/t/t6200-fmt-merge-msg.sh
+++ b/t/t6200-fmt-merge-msg.sh
@@ -5,7 +5,7 @@
 
 test_description='fmt-merge-msg test'
 
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -84,7 +84,7 @@ test_expect_success GPG 'set up a signed tag' '
 test_expect_success 'message for merging local branch' '
 	echo "Merge branch ${apos}left${apos}" >expected &&
 
-	git checkout master &&
+	git checkout main &&
 	git fetch . left &&
 
 	git fmt-merge-msg <.git/FETCH_HEAD >actual &&
@@ -92,7 +92,7 @@ test_expect_success 'message for merging local branch' '
 '
 
 test_expect_success GPG 'message for merging local tag signed by good key' '
-	git checkout master &&
+	git checkout main &&
 	git fetch . signed-good-tag &&
 	git fmt-merge-msg <.git/FETCH_HEAD >actual 2>&1 &&
 	grep "^Merge tag ${apos}signed-good-tag${apos}" actual &&
@@ -101,7 +101,7 @@ test_expect_success GPG 'message for merging local tag signed by good key' '
 '
 
 test_expect_success GPG 'message for merging local tag signed by unknown key' '
-	git checkout master &&
+	git checkout main &&
 	git fetch . signed-good-tag &&
 	GNUPGHOME=. git fmt-merge-msg <.git/FETCH_HEAD >actual 2>&1 &&
 	grep "^Merge tag ${apos}signed-good-tag${apos}" actual &&
@@ -112,7 +112,7 @@ test_expect_success GPG 'message for merging local tag signed by unknown key' '
 test_expect_success 'message for merging external branch' '
 	echo "Merge branch ${apos}left${apos} of $(pwd)" >expected &&
 
-	git checkout master &&
+	git checkout main &&
 	git fetch "$(pwd)" left &&
 
 	git fmt-merge-msg <.git/FETCH_HEAD >actual &&
@@ -136,7 +136,7 @@ test_expect_success '[merge] summary/log configuration' '
 	test_config merge.log true &&
 	test_unconfig merge.summary &&
 
-	git checkout master &&
+	git checkout main &&
 	test_tick &&
 	git fetch . left &&
 
@@ -145,7 +145,7 @@ test_expect_success '[merge] summary/log configuration' '
 	test_unconfig merge.log &&
 	test_config merge.summary true &&
 
-	git checkout master &&
+	git checkout main &&
 	test_tick &&
 	git fetch . left &&
 
@@ -156,7 +156,7 @@ test_expect_success '[merge] summary/log configuration' '
 '
 
 test_expect_success 'setup FETCH_HEAD' '
-	git checkout master &&
+	git checkout main &&
 	test_tick &&
 	git fetch . left
 '
@@ -284,7 +284,7 @@ test_expect_success 'fmt-merge-msg -m' '
 
 	test_unconfig merge.log &&
 	test_unconfig merge.summary &&
-	git checkout master &&
+	git checkout main &&
 	git fetch "$(pwd)" left &&
 	git fmt-merge-msg -m "Sync with left" <.git/FETCH_HEAD >actual &&
 	git fmt-merge-msg --log -m "Sync with left" \
@@ -326,28 +326,28 @@ test_expect_success 'setup: expected shortlog for two branches' '
 test_expect_success 'shortlog for two branches' '
 	test_config merge.log true &&
 	test_unconfig merge.summary &&
-	git checkout master &&
+	git checkout main &&
 	test_tick &&
 	git fetch . left right &&
 	git fmt-merge-msg <.git/FETCH_HEAD >actual1 &&
 
 	test_unconfig merge.log &&
 	test_config merge.summary true &&
-	git checkout master &&
+	git checkout main &&
 	test_tick &&
 	git fetch . left right &&
 	git fmt-merge-msg <.git/FETCH_HEAD >actual2 &&
 
 	test_config merge.log yes &&
 	test_unconfig merge.summary &&
-	git checkout master &&
+	git checkout main &&
 	test_tick &&
 	git fetch . left right &&
 	git fmt-merge-msg <.git/FETCH_HEAD >actual3 &&
 
 	test_unconfig merge.log &&
 	test_config merge.summary yes &&
-	git checkout master &&
+	git checkout main &&
 	test_tick &&
 	git fetch . left right &&
 	git fmt-merge-msg <.git/FETCH_HEAD >actual4 &&
@@ -361,7 +361,7 @@ test_expect_success 'shortlog for two branches' '
 test_expect_success 'merge-msg -F' '
 	test_unconfig merge.log &&
 	test_config merge.summary yes &&
-	git checkout master &&
+	git checkout main &&
 	test_tick &&
 	git fetch . left right &&
 	git fmt-merge-msg -F .git/FETCH_HEAD >actual &&
@@ -371,7 +371,7 @@ test_expect_success 'merge-msg -F' '
 test_expect_success 'merge-msg -F in subdirectory' '
 	test_unconfig merge.log &&
 	test_config merge.summary yes &&
-	git checkout master &&
+	git checkout main &&
 	test_tick &&
 	git fetch . left right &&
 	mkdir sub &&
@@ -411,7 +411,7 @@ test_expect_success 'merge-msg tag' '
 	test_unconfig merge.log &&
 	test_config merge.summary yes &&
 
-	git checkout master &&
+	git checkout main &&
 	test_tick &&
 	git fetch . tag tag-r3 &&
 
@@ -441,7 +441,7 @@ test_expect_success 'merge-msg two tags' '
 	test_unconfig merge.log &&
 	test_config merge.summary yes &&
 
-	git checkout master &&
+	git checkout main &&
 	test_tick &&
 	git fetch . tag tag-r3 tag tag-l5 &&
 
@@ -471,7 +471,7 @@ test_expect_success 'merge-msg tag and branch' '
 	test_unconfig merge.log &&
 	test_config merge.summary yes &&
 
-	git checkout master &&
+	git checkout main &&
 	test_tick &&
 	git fetch . tag tag-r3 left &&
 
@@ -498,7 +498,7 @@ test_expect_success 'merge-msg lots of commits' '
 
 	test_config merge.summary yes &&
 
-	git checkout master &&
+	git checkout main &&
 	test_tick &&
 	git fetch . long &&
 
@@ -509,11 +509,11 @@ test_expect_success 'merge-msg lots of commits' '
 test_expect_success 'merge-msg with "merging" an annotated tag' '
 	test_config merge.log true &&
 
-	git checkout master^0 &&
+	git checkout main^0 &&
 	git commit --allow-empty -m "One step ahead" &&
 	git tag -a -m "An annotated one" annote HEAD &&
 
-	git checkout master &&
+	git checkout main &&
 	git fetch . annote &&
 
 	git fmt-merge-msg <.git/FETCH_HEAD >actual &&
@@ -546,23 +546,23 @@ test_expect_success 'merge-msg with "merging" an annotated tag' '
 '
 
 test_expect_success 'merge.suppressDest configuration' '
-	git checkout -B side master &&
+	git checkout -B side main &&
 	git commit --allow-empty -m "One step ahead" &&
-	git checkout master &&
+	git checkout main &&
 	git fetch . side &&
 
 	git -c merge.suppressDest="" fmt-merge-msg <.git/FETCH_HEAD >full.1 &&
 	head -n1 full.1 >actual &&
-	grep -e "Merge branch .side. into master" actual &&
+	grep -e "Merge branch .side. into main" actual &&
 
 	git -c merge.suppressDest="mast" fmt-merge-msg <.git/FETCH_HEAD >full.2 &&
 	head -n1 full.2 >actual &&
-	grep -e "Merge branch .side. into master$" actual &&
+	grep -e "Merge branch .side. into main$" actual &&
 
 	git -c merge.suppressDest="ma?*[rn]" fmt-merge-msg <.git/FETCH_HEAD >full.3 &&
 	head -n1 full.3 >actual &&
 	grep -e "Merge branch .side." actual &&
-	! grep -e " into master$" actual
+	! grep -e " into main$" actual
 '
 
 test_done
diff --git a/t/t6302-for-each-ref-filter.sh b/t/t6302-for-each-ref-filter.sh
index 0f3e6aa011..e5833af528 100755
--- a/t/t6302-for-each-ref-filter.sh
+++ b/t/t6302-for-each-ref-filter.sh
@@ -2,7 +2,7 @@
 
 test_description='test for-each-refs usage of ref-filter APIs'
 
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -29,17 +29,17 @@ test_expect_success 'setup some history and refs' '
 	git tag $sign -m "A signed tag" signed-tag &&
 	git tag $sign -m "Signed doubly" doubly-signed-tag signed-tag &&
 
-	git checkout master &&
-	git update-ref refs/odd/spot master
+	git checkout main &&
+	git update-ref refs/odd/spot main
 '
 
 test_expect_success 'filtering with --points-at' '
 	cat >expect <<-\EOF &&
-	refs/heads/master
+	refs/heads/main
 	refs/odd/spot
 	refs/tags/three
 	EOF
-	git for-each-ref --format="%(refname)" --points-at=master >actual &&
+	git for-each-ref --format="%(refname)" --points-at=main >actual &&
 	test_cmp expect actual
 '
 
@@ -56,13 +56,13 @@ test_expect_success 'check signed tags with --points-at' '
 
 test_expect_success 'filtering with --merged' '
 	cat >expect <<-\EOF &&
-	refs/heads/master
+	refs/heads/main
 	refs/odd/spot
 	refs/tags/one
 	refs/tags/three
 	refs/tags/two
 	EOF
-	git for-each-ref --format="%(refname)" --merged=master >actual &&
+	git for-each-ref --format="%(refname)" --merged=main >actual &&
 	test_cmp expect actual
 '
 
@@ -75,13 +75,13 @@ test_expect_success 'filtering with --no-merged' '
 	refs/tags/four
 	refs/tags/signed-tag
 	EOF
-	git for-each-ref --format="%(refname)" --no-merged=master >actual &&
+	git for-each-ref --format="%(refname)" --no-merged=main >actual &&
 	test_cmp expect actual
 '
 
 test_expect_success 'filtering with --contains' '
 	cat >expect <<-\EOF &&
-	refs/heads/master
+	refs/heads/main
 	refs/heads/side
 	refs/odd/spot
 	refs/tags/annotated-tag
@@ -254,7 +254,7 @@ test_expect_success PREPARE_FOR_MAIN_BRANCH 'nested alignment with quote formatt
 
 test_expect_success 'check `%(contents:lines=1)`' '
 	cat >expect <<-\EOF &&
-	master |three
+	main |three
 	side |four
 	odd/spot |three
 	annotated-tag |An annotated tag
@@ -272,7 +272,7 @@ test_expect_success 'check `%(contents:lines=1)`' '
 
 test_expect_success 'check `%(contents:lines=0)`' '
 	cat >expect <<-\EOF &&
-	master |
+	main |
 	side |
 	odd/spot |
 	annotated-tag |
@@ -290,7 +290,7 @@ test_expect_success 'check `%(contents:lines=0)`' '
 
 test_expect_success 'check `%(contents:lines=99999)`' '
 	cat >expect <<-\EOF &&
-	master |three
+	main |three
 	side |four
 	odd/spot |three
 	annotated-tag |An annotated tag
@@ -363,7 +363,7 @@ test_expect_success 'improper usage of %(if), %(then), %(else) and %(end) atoms'
 test_expect_success 'check %(if)...%(then)...%(end) atoms' '
 	git for-each-ref --format="%(refname)%(if)%(authorname)%(then) Author: %(authorname)%(end)" >actual &&
 	cat >expect <<-\EOF &&
-	refs/heads/master Author: A U Thor
+	refs/heads/main Author: A U Thor
 	refs/heads/side Author: A U Thor
 	refs/odd/spot Author: A U Thor
 	refs/tags/annotated-tag
@@ -384,7 +384,7 @@ test_expect_success 'check %(if)...%(then)...%(end) atoms' '
 test_expect_success 'check %(if)...%(then)...%(else)...%(end) atoms' '
 	git for-each-ref --format="%(if)%(authorname)%(then)%(authorname)%(else)No author%(end): %(refname)" >actual &&
 	cat >expect <<-\EOF &&
-	A U Thor: refs/heads/master
+	A U Thor: refs/heads/main
 	A U Thor: refs/heads/side
 	A U Thor: refs/odd/spot
 	No author: refs/tags/annotated-tag
@@ -404,7 +404,7 @@ test_expect_success 'check %(if)...%(then)...%(else)...%(end) atoms' '
 test_expect_success 'ignore spaces in %(if) atom usage' '
 	git for-each-ref --format="%(refname:short): %(if)%(HEAD)%(then)Head ref%(else)Not Head ref%(end)" >actual &&
 	cat >expect <<-\EOF &&
-	master: Head ref
+	main: Head ref
 	side: Not Head ref
 	odd/spot: Not Head ref
 	annotated-tag: Not Head ref
@@ -423,19 +423,19 @@ test_expect_success 'ignore spaces in %(if) atom usage' '
 '
 
 test_expect_success 'check %(if:equals=<string>)' '
-	git for-each-ref --format="%(if:equals=master)%(refname:short)%(then)Found master%(else)Not master%(end)" refs/heads/ >actual &&
+	git for-each-ref --format="%(if:equals=main)%(refname:short)%(then)Found main%(else)Not main%(end)" refs/heads/ >actual &&
 	cat >expect <<-\EOF &&
-	Found master
-	Not master
+	Found main
+	Not main
 	EOF
 	test_cmp expect actual
 '
 
 test_expect_success 'check %(if:notequals=<string>)' '
-	git for-each-ref --format="%(if:notequals=master)%(refname:short)%(then)Not master%(else)Found master%(end)" refs/heads/ >actual &&
+	git for-each-ref --format="%(if:notequals=main)%(refname:short)%(then)Not main%(else)Found main%(end)" refs/heads/ >actual &&
 	cat >expect <<-\EOF &&
-	Found master
-	Not master
+	Found main
+	Not main
 	EOF
 	test_cmp expect actual
 '
@@ -446,11 +446,11 @@ test_expect_success '--merged is compatible with --no-merged' '
 
 test_expect_success 'validate worktree atom' '
 	cat >expect <<-EOF &&
-	master: $(pwd)
-	master_worktree: $(pwd)/worktree_dir
+	main: $(pwd)
+	main_worktree: $(pwd)/worktree_dir
 	side: not checked out
 	EOF
-	git worktree add -b master_worktree worktree_dir master &&
+	git worktree add -b main_worktree worktree_dir main &&
 	git for-each-ref --format="%(refname:short): %(if)%(worktreepath)%(then)%(worktreepath)%(else)not checked out%(end)" refs/heads/ >actual &&
 	rm -r worktree_dir &&
 	git worktree prune &&
-- 
gitgitgadget


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH v3 19/28] t64*: preemptively adjust alignment to prepare for `master` -> `main`
  2020-11-18 23:44   ` [PATCH v3 00/28] tests: use main as default branch name Johannes Schindelin via GitGitGadget
                       ` (17 preceding siblings ...)
  2020-11-18 23:44     ` [PATCH v3 18/28] t6[0-3]*: " Johannes Schindelin via GitGitGadget
@ 2020-11-18 23:44     ` Johannes Schindelin via GitGitGadget
  2020-11-18 23:44     ` [PATCH v3 20/28] t6[4-9]*: adjust the references to the default branch name "main" Johannes Schindelin via GitGitGadget
                       ` (9 subsequent siblings)
  28 siblings, 0 replies; 163+ messages in thread
From: Johannes Schindelin via GitGitGadget @ 2020-11-18 23:44 UTC (permalink / raw)
  To: git
  Cc: Felipe Contreras, Ævar Arnfjörð Bjarmason,
	Johannes Schindelin, Jeff King, Jonathan Nieder,
	Johannes Schindelin, Johannes Schindelin

From: Johannes Schindelin <johannes.schindelin@gmx.de>

We are in the process of renaming the default branch name to `main`,
which is two characters shorter than `master`. Therefore, some lines
need to be adjusted in t6416, t6422 and t6427 that want to align text
involving the default branch name.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
---
 t/t6416-recursive-corner-cases.sh    | 8 ++++----
 t/t6422-merge-rename-corner-cases.sh | 4 ++--
 t/t6427-diff3-conflict-markers.sh    | 4 ++--
 3 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/t/t6416-recursive-corner-cases.sh b/t/t6416-recursive-corner-cases.sh
index 6a740771ed..3d515a8e31 100755
--- a/t/t6416-recursive-corner-cases.sh
+++ b/t/t6416-recursive-corner-cases.sh
@@ -388,7 +388,7 @@ test_expect_success 'git detects conflict merging criss-cross+modify/delete' '
 		test_line_count = 2 out &&
 
 		git rev-parse >expect       \
-			master:file  B:file &&
+			master:file    B:file &&
 		git rev-parse   >actual      \
 			:1:file      :2:file &&
 		test_cmp expect actual
@@ -410,7 +410,7 @@ test_expect_success 'git detects conflict merging criss-cross+modify/delete, rev
 		test_line_count = 2 out &&
 
 		git rev-parse >expect       \
-			master:file  B:file &&
+			master:file    B:file &&
 		git rev-parse   >actual      \
 			:1:file      :3:file &&
 		test_cmp expect actual
@@ -1556,7 +1556,7 @@ test_expect_failure 'check conflicting modes for regular file' '
 # Setup:
 #          L1---L2
 #         /  \ /  \
-#   master    X    ?
+#     master    X    ?
 #         \  / \  /
 #          R1---R2
 #
@@ -1751,7 +1751,7 @@ test_expect_success 'check nested conflicts' '
 # Setup:
 #          L1---L2---L3
 #         /  \ /  \ /  \
-#   master    X1   X2   ?
+#     master    X1   X2   ?
 #         \  / \  / \  /
 #          R1---R2---R3
 #
diff --git a/t/t6422-merge-rename-corner-cases.sh b/t/t6422-merge-rename-corner-cases.sh
index 70c8af7f51..9fb4e72ca3 100755
--- a/t/t6422-merge-rename-corner-cases.sh
+++ b/t/t6422-merge-rename-corner-cases.sh
@@ -1133,7 +1133,7 @@ test_conflicts_with_adds_and_renames() {
 	# Setup:
 	#          L
 	#         / \
-	#   master   ?
+	#     master   ?
 	#         \ /
 	#          R
 	#
@@ -1293,7 +1293,7 @@ test_conflicts_with_adds_and_renames add    add
 # Setup:
 #          L
 #         / \
-#   master   ?
+#     master   ?
 #         \ /
 #          R
 #
diff --git a/t/t6427-diff3-conflict-markers.sh b/t/t6427-diff3-conflict-markers.sh
index c192ee4e42..3ae2d07ae1 100755
--- a/t/t6427-diff3-conflict-markers.sh
+++ b/t/t6427-diff3-conflict-markers.sh
@@ -46,7 +46,7 @@ test_expect_success 'check no merge base' '
 # Setup:
 #          L1
 #         /  \
-#   master    ?
+#     master    ?
 #         \  /
 #          R1
 #
@@ -104,7 +104,7 @@ test_expect_success 'check unique merge base' '
 # Setup:
 #          L1---L2--L3
 #         /  \ /      \
-#   master    X1       ?
+#     master    X1       ?
 #         \  / \      /
 #          R1---R2--R3
 #
-- 
gitgitgadget


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH v3 20/28] t6[4-9]*: adjust the references to the default branch name "main"
  2020-11-18 23:44   ` [PATCH v3 00/28] tests: use main as default branch name Johannes Schindelin via GitGitGadget
                       ` (18 preceding siblings ...)
  2020-11-18 23:44     ` [PATCH v3 19/28] t64*: preemptively adjust alignment to prepare for `master` -> `main` Johannes Schindelin via GitGitGadget
@ 2020-11-18 23:44     ` Johannes Schindelin via GitGitGadget
  2020-11-18 23:44     ` [PATCH v3 21/28] t7[0-4]*: " Johannes Schindelin via GitGitGadget
                       ` (8 subsequent siblings)
  28 siblings, 0 replies; 163+ messages in thread
From: Johannes Schindelin via GitGitGadget @ 2020-11-18 23:44 UTC (permalink / raw)
  To: git
  Cc: Felipe Contreras, Ævar Arnfjörð Bjarmason,
	Johannes Schindelin, Jeff King, Jonathan Nieder,
	Johannes Schindelin, Johannes Schindelin

From: Johannes Schindelin <johannes.schindelin@gmx.de>

This trick was performed via

	$ (cd t &&
	   sed -i -e 's/master/main/g' -e 's/MASTER/MAIN/g' \
		-e 's/Master/Main/g' -- t6[4-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>
---
 t/t6400-merge-df.sh                       |  8 ++--
 t/t6402-merge-rename.sh                   | 48 +++++++++++------------
 t/t6404-recursive-merge.sh                |  6 +--
 t/t6405-merge-symlinks.sh                 | 16 ++++----
 t/t6406-merge-attr.sh                     | 26 ++++++------
 t/t6407-merge-binary.sh                   |  8 ++--
 t/t6409-merge-subtree.sh                  | 18 ++++-----
 t/t6411-merge-filemode.sh                 | 12 +++---
 t/t6412-merge-large-rename.sh             |  8 ++--
 t/t6413-merge-crlf.sh                     |  4 +-
 t/t6414-merge-rename-nocruft.sh           |  4 +-
 t/t6415-merge-dir-to-symlink.sh           | 24 ++++++------
 t/t6416-recursive-corner-cases.sh         | 30 +++++++-------
 t/t6417-merge-ours-theirs.sh              | 30 +++++++-------
 t/t6418-merge-text-auto.sh                | 14 +++----
 t/t6419-merge-ignorecase.sh               | 12 +++---
 t/t6422-merge-rename-corner-cases.sh      | 14 +++----
 t/t6425-merge-rename-delete.sh            |  4 +-
 t/t6427-diff3-conflict-markers.sh         | 16 ++++----
 t/t6430-merge-recursive.sh                | 20 +++++-----
 t/t6432-merge-recursive-space-options.sh  |  8 ++--
 t/t6433-merge-toplevel.sh                 | 10 ++---
 t/t6434-merge-recursive-rename-options.sh |  8 ++--
 t/t6436-merge-overwrite.sh                |  4 +-
 t/t6437-submodule-merge.sh                | 16 ++++----
 t/t6439-merge-co-error-msgs.sh            |  8 ++--
 t/t6501-freshen-objects.sh                |  4 +-
 27 files changed, 190 insertions(+), 190 deletions(-)

diff --git a/t/t6400-merge-df.sh b/t/t6400-merge-df.sh
index 5fab2d2dd7..38700d29b5 100755
--- a/t/t6400-merge-df.sh
+++ b/t/t6400-merge-df.sh
@@ -4,7 +4,7 @@
 #
 
 test_description='Test merge with directory/file conflicts'
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -27,12 +27,12 @@ test_expect_success 'prepare repository' '
 '
 
 test_expect_success 'Merge with d/f conflicts' '
-	test_expect_code 1 git merge -m "merge msg" master
+	test_expect_code 1 git merge -m "merge msg" main
 '
 
 test_expect_success 'F/D conflict' '
 	git reset --hard &&
-	git checkout master &&
+	git checkout main &&
 	rm .git/index &&
 
 	mkdir before &&
@@ -50,7 +50,7 @@ test_expect_success 'F/D conflict' '
 	git add . &&
 	git commit -m para &&
 
-	git merge master
+	git merge main
 '
 
 test_expect_success 'setup modify/delete + directory/file conflict' '
diff --git a/t/t6402-merge-rename.sh b/t/t6402-merge-rename.sh
index 227c2feb08..425dad97d5 100755
--- a/t/t6402-merge-rename.sh
+++ b/t/t6402-merge-rename.sh
@@ -1,7 +1,7 @@
 #!/bin/sh
 
 test_description='Merge-recursive merging renames'
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -57,9 +57,9 @@ test_expect_success 'setup' '
 	git branch change &&
 	git branch change+rename &&
 
-	sed -e "/^g /s/.*/g : master changes a line/" <A >A+ &&
+	sed -e "/^g /s/.*/g : main changes a line/" <A >A+ &&
 	mv A+ A &&
-	git commit -a -m "master updates A" &&
+	git commit -a -m "main updates A" &&
 
 	git checkout yellow &&
 	rm -f M &&
@@ -97,7 +97,7 @@ test_expect_success 'setup' '
 	git update-index --add B &&
 	git commit -q -a -m "changed and renamed" &&
 
-	git checkout master
+	git checkout main
 '
 
 test_expect_success 'pull renaming branch into unrenaming one' \
@@ -112,7 +112,7 @@ test_expect_success 'pull renaming branch into unrenaming one' \
 	sed -ne "/^g/{
 	p
 	q
-	}" B | grep master &&
+	}" B | grep main &&
 	git diff --exit-code white N
 '
 
@@ -137,7 +137,7 @@ test_expect_success 'pull unrenaming branch into renaming one' \
 '
 	git reset --hard &&
 	git show-branch &&
-	test_expect_code 1 git pull . master &&
+	test_expect_code 1 git pull . main &&
 	git ls-files -u B >b.stages &&
 	test_line_count = 3 b.stages &&
 	git ls-files -s N >n.stages &&
@@ -190,7 +190,7 @@ test_expect_success 'interference with untracked working tree file' '
 test_expect_success 'interference with untracked working tree file' '
 	git reset --hard &&
 	rm -f A M &&
-	git checkout -f master &&
+	git checkout -f main &&
 	git tag -f anchor &&
 	git show-branch &&
 	git pull . yellow &&
@@ -201,7 +201,7 @@ test_expect_success 'interference with untracked working tree file' '
 test_expect_success 'updated working tree file should prevent the merge' '
 	git reset --hard &&
 	rm -f A M &&
-	git checkout -f master &&
+	git checkout -f main &&
 	git tag -f anchor &&
 	git show-branch &&
 	echo >>M one line addition &&
@@ -214,7 +214,7 @@ test_expect_success 'updated working tree file should prevent the merge' '
 test_expect_success 'updated working tree file should prevent the merge' '
 	git reset --hard &&
 	rm -f A M &&
-	git checkout -f master &&
+	git checkout -f main &&
 	git tag -f anchor &&
 	git show-branch &&
 	echo >>M one line addition &&
@@ -232,7 +232,7 @@ test_expect_success 'interference with untracked working tree file' '
 	git tag -f anchor &&
 	git show-branch &&
 	echo >M this file should not matter &&
-	git pull . master &&
+	git pull . main &&
 	test_path_is_file M &&
 	! {
 		git ls-files -s |
@@ -767,7 +767,7 @@ test_expect_success 'setup avoid unnecessary update, dir->(file,nothing)' '
 	git rm -rf df &&
 	git commit -mB &&
 
-	git checkout master &&
+	git checkout main &&
 	git rm -rf df &&
 	echo bla >df &&
 	git add -A &&
@@ -775,7 +775,7 @@ test_expect_success 'setup avoid unnecessary update, dir->(file,nothing)' '
 '
 
 test_expect_success 'avoid unnecessary update, dir->(file,nothing)' '
-	git checkout -q master^0 &&
+	git checkout -q main^0 &&
 	test-tool chmtime --get -3600 df >expect &&
 	git merge side &&
 	test-tool chmtime --get df >actual &&
@@ -797,14 +797,14 @@ test_expect_success 'setup avoid unnecessary update, modify/delete' '
 	git rm -f file &&
 	git commit -m "Delete file" &&
 
-	git checkout master &&
+	git checkout main &&
 	echo bla >file &&
 	git add -A &&
 	git commit -m "Modify file"
 '
 
 test_expect_success 'avoid unnecessary update, modify/delete' '
-	git checkout -q master^0 &&
+	git checkout -q main^0 &&
 	test-tool chmtime --get -3600 file >expect &&
 	test_must_fail git merge side &&
 	test-tool chmtime --get file >actual &&
@@ -826,13 +826,13 @@ test_expect_success 'setup avoid unnecessary update, rename/add-dest' '
 	git add -A &&
 	git commit -m "Add file copy" &&
 
-	git checkout master &&
+	git checkout main &&
 	git mv file newfile &&
 	git commit -m "Rename file"
 '
 
 test_expect_success 'avoid unnecessary update, rename/add-dest' '
-	git checkout -q master^0 &&
+	git checkout -q main^0 &&
 	test-tool chmtime --get -3600 newfile >expect &&
 	git merge side &&
 	test-tool chmtime --get newfile >actual &&
@@ -882,15 +882,15 @@ test_expect_success 'setup for use of extended merge markers' '
 	git mv original_file renamed_file &&
 	git commit -mB &&
 
-	git checkout master &&
+	git checkout main &&
 	echo 8.5 >>original_file &&
 	git add original_file &&
 	git commit -mC
 '
 
-test_expect_success 'merge master into rename has correct extended markers' '
+test_expect_success 'merge main into rename has correct extended markers' '
 	git checkout rename^0 &&
-	test_must_fail git merge -s recursive master^0 &&
+	test_must_fail git merge -s recursive main^0 &&
 
 	cat >expected <<-\EOF &&
 	1
@@ -905,14 +905,14 @@ test_expect_success 'merge master into rename has correct extended markers' '
 	9
 	=======
 	8.5
-	>>>>>>> master^0:original_file
+	>>>>>>> main^0:original_file
 	EOF
 	test_cmp expected renamed_file
 '
 
-test_expect_success 'merge rename into master has correct extended markers' '
+test_expect_success 'merge rename into main has correct extended markers' '
 	git reset --hard &&
-	git checkout master^0 &&
+	git checkout main^0 &&
 	test_must_fail git merge -s recursive rename^0 &&
 
 	cat >expected <<-\EOF &&
@@ -948,13 +948,13 @@ test_expect_success 'setup spurious "refusing to lose untracked" message' '
 	git mv original_file renamed_file &&
 	git commit -mB &&
 
-	git checkout master &&
+	git checkout main &&
 	git rm original_file &&
 	git commit -mC
 '
 
 test_expect_success 'no spurious "refusing to lose untracked" message' '
-	git checkout master^0 &&
+	git checkout main^0 &&
 	test_must_fail git merge rename^0 2>errors.txt &&
 	! grep "refusing to lose untracked file" errors.txt
 '
diff --git a/t/t6404-recursive-merge.sh b/t/t6404-recursive-merge.sh
index bdf8169456..c7ab7048f5 100755
--- a/t/t6404-recursive-merge.sh
+++ b/t/t6404-recursive-merge.sh
@@ -1,7 +1,7 @@
 #!/bin/sh
 
 test_description='Test merge without common ancestors'
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -22,11 +22,11 @@ test_expect_success 'setup tests' '
 	git add a1 &&
 	GIT_AUTHOR_DATE="2006-12-12 23:00:00" git commit -m 1 a1 &&
 
-	git checkout -b A master &&
+	git checkout -b A main &&
 	echo A >a1 &&
 	GIT_AUTHOR_DATE="2006-12-12 23:00:01" git commit -m A a1 &&
 
-	git checkout -b B master &&
+	git checkout -b B main &&
 	echo B >a1 &&
 	GIT_AUTHOR_DATE="2006-12-12 23:00:02" git commit -m B a1 &&
 
diff --git a/t/t6405-merge-symlinks.sh b/t/t6405-merge-symlinks.sh
index 140e9e6ce6..7435fce71e 100755
--- a/t/t6405-merge-symlinks.sh
+++ b/t/t6405-merge-symlinks.sh
@@ -8,7 +8,7 @@ test_description='merging symlinks on filesystem w/o symlink support.
 This tests that git merge-recursive writes merge results as plain files
 if core.symlinks is false.'
 
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -22,7 +22,7 @@ test_expect_success 'setup' '
 	git branch b-file &&
 	l=$(printf file | git hash-object -t blob -w --stdin) &&
 	echo "120000 $l	symlink" | git update-index --index-info &&
-	git commit -m master &&
+	git commit -m main &&
 	git checkout b-symlink &&
 	l=$(printf file-different | git hash-object -t blob -w --stdin) &&
 	echo "120000 $l	symlink" | git update-index --index-info &&
@@ -33,28 +33,28 @@ test_expect_success 'setup' '
 	git commit -m b-file
 '
 
-test_expect_success 'merge master into b-symlink, which has a different symbolic link' '
+test_expect_success 'merge main into b-symlink, which has a different symbolic link' '
 	git checkout b-symlink &&
-	test_must_fail git merge master
+	test_must_fail git merge main
 '
 
 test_expect_success 'the merge result must be a file' '
 	test_path_is_file symlink
 '
 
-test_expect_success 'merge master into b-file, which has a file instead of a symbolic link' '
+test_expect_success 'merge main into b-file, which has a file instead of a symbolic link' '
 	git reset --hard &&
 	git checkout b-file &&
-	test_must_fail git merge master
+	test_must_fail git merge main
 '
 
 test_expect_success 'the merge result must be a file' '
 	test_path_is_file symlink
 '
 
-test_expect_success 'merge b-file, which has a file instead of a symbolic link, into master' '
+test_expect_success 'merge b-file, which has a file instead of a symbolic link, into main' '
 	git reset --hard &&
-	git checkout master &&
+	git checkout main &&
 	test_must_fail git merge b-file
 '
 
diff --git a/t/t6406-merge-attr.sh b/t/t6406-merge-attr.sh
index 7fe4034d58..d5a4ac2d81 100755
--- a/t/t6406-merge-attr.sh
+++ b/t/t6406-merge-attr.sh
@@ -5,7 +5,7 @@
 
 test_description='per path merge controlled by merge attribute'
 
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -22,10 +22,10 @@ test_expect_success setup '
 	git branch side &&
 	for f in text binary union
 	do
-		echo Master >>$f && git add $f || return 1
+		echo Main >>$f && git add $f || return 1
 	done &&
 	test_tick &&
-	git commit -m Master &&
+	git commit -m Main &&
 
 	git checkout side &&
 	for f in text binary union
@@ -67,7 +67,7 @@ test_expect_success merge '
 		echo "union merge=union"
 	} >.gitattributes &&
 
-	if git merge master
+	if git merge main
 	then
 		echo Gaah, should have conflicted
 		false
@@ -90,7 +90,7 @@ test_expect_success 'check merge result in working tree' '
 	grep "<<<<<<<" text &&
 	cmp binary-orig binary &&
 	! grep "<<<<<<<" union &&
-	grep Master union &&
+	grep Main union &&
 	grep Side union
 
 '
@@ -118,13 +118,13 @@ test_expect_success 'custom merge backend' '
 	git config --replace-all \
 	merge.custom.name "custom merge driver for testing" &&
 
-	git merge master &&
+	git merge main &&
 
 	cmp binary union &&
 	sed -e 1,3d text >check-1 &&
-	o=$(git unpack-file master^:text) &&
+	o=$(git unpack-file main^:text) &&
 	a=$(git unpack-file side^:text) &&
-	b=$(git unpack-file master:text) &&
+	b=$(git unpack-file main:text) &&
 	sh -c "./custom-merge $o $a $b 0 text" &&
 	sed -e 1,3d $a >check-2 &&
 	cmp check-1 check-2 &&
@@ -139,7 +139,7 @@ test_expect_success 'custom merge backend' '
 	git config --replace-all \
 	merge.custom.name "custom merge driver for testing" &&
 
-	if git merge master
+	if git merge main
 	then
 		echo "Eh? should have conflicted"
 		false
@@ -149,9 +149,9 @@ test_expect_success 'custom merge backend' '
 
 	cmp binary union &&
 	sed -e 1,3d text >check-1 &&
-	o=$(git unpack-file master^:text) &&
+	o=$(git unpack-file main^:text) &&
 	a=$(git unpack-file anchor:text) &&
-	b=$(git unpack-file master:text) &&
+	b=$(git unpack-file main:text) &&
 	sh -c "./custom-merge $o $a $b 0 text" &&
 	sed -e 1,3d $a >check-2 &&
 	cmp check-1 check-2 &&
@@ -179,7 +179,7 @@ test_expect_success 'up-to-date merge without common ancestor' '
 	test_tick &&
 	(
 		cd repo1 &&
-		git fetch ../repo2 master &&
+		git fetch ../repo2 main &&
 		git merge --allow-unrelated-histories FETCH_HEAD
 	)
 '
@@ -204,7 +204,7 @@ test_expect_success 'custom merge does not lock index' '
 	# By packaging the command in test_when_finished, we get both
 	# the correctness check and the clean-up.
 	test_when_finished "kill \$(cat sleep.pid)" &&
-	git merge master
+	git merge main
 '
 
 test_done
diff --git a/t/t6407-merge-binary.sh b/t/t6407-merge-binary.sh
index 826deacfd7..d4273f2575 100755
--- a/t/t6407-merge-binary.sh
+++ b/t/t6407-merge-binary.sh
@@ -2,7 +2,7 @@
 
 test_description='ask merge-recursive to merge binary files'
 
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -23,7 +23,7 @@ test_expect_success setup '
 	git ls-files -s a >E0 &&
 	git ls-files -s m | sed -e "s/ 0	/ 3	/" >E3 &&
 	test_tick &&
-	git commit -m "master adds some" &&
+	git commit -m "main adds some" &&
 
 	git checkout side &&
 	echo rezrov >>m &&
@@ -42,7 +42,7 @@ test_expect_success resolve '
 	rm -f a* m* &&
 	git reset --hard anchor &&
 
-	if git merge -s resolve master
+	if git merge -s resolve main
 	then
 		echo Oops, should not have succeeded
 		false
@@ -57,7 +57,7 @@ test_expect_success recursive '
 	rm -f a* m* &&
 	git reset --hard anchor &&
 
-	if git merge -s recursive master
+	if git merge -s recursive main
 	then
 		echo Oops, should not have succeeded
 		false
diff --git a/t/t6409-merge-subtree.sh b/t/t6409-merge-subtree.sh
index e2c1cfc9fe..d406b2343c 100755
--- a/t/t6409-merge-subtree.sh
+++ b/t/t6409-merge-subtree.sh
@@ -2,7 +2,7 @@
 
 test_description='subtree merge strategy'
 
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -17,10 +17,10 @@ test_expect_success setup '
 	echo >>hello world &&
 	git add hello &&
 	git commit -m second &&
-	git checkout master &&
+	git checkout main &&
 	for i in mundo $s; do echo $i; done >hello &&
 	git add hello &&
-	git commit -m master
+	git commit -m main
 
 '
 
@@ -39,7 +39,7 @@ test_expect_success 'setup branch sub' '
 '
 
 test_expect_success 'setup topic branch' '
-	git checkout -b topic master &&
+	git checkout -b topic main &&
 	git merge -s ours --no-commit --allow-unrelated-histories sub &&
 	git read-tree --prefix=dir/ -u sub &&
 	git commit -m "initial merge of sub into topic" &&
@@ -80,8 +80,8 @@ test_expect_success 'setup' '
 
 test_expect_success 'initial merge' '
 	git remote add -f gui ../git-gui &&
-	git merge -s ours --no-commit --allow-unrelated-histories gui/master &&
-	git read-tree --prefix=git-gui/ -u gui/master &&
+	git merge -s ours --no-commit --allow-unrelated-histories gui/main &&
+	git read-tree --prefix=git-gui/ -u gui/main &&
 	git commit -m "Merge git-gui as our subdirectory" &&
 	git checkout -b work &&
 	git ls-files -s >actual &&
@@ -111,10 +111,10 @@ test_expect_success 'merge update' '
 
 test_expect_success 'initial ambiguous subtree' '
 	cd ../git &&
-	git reset --hard master &&
+	git reset --hard main &&
 	git checkout -b topic_2 &&
-	git merge -s ours --no-commit gui/master &&
-	git read-tree --prefix=git-gui2/ -u gui/master &&
+	git merge -s ours --no-commit gui/main &&
+	git read-tree --prefix=git-gui2/ -u gui/main &&
 	git commit -m "Merge git-gui2 as our subdirectory" &&
 	git checkout -b work2 &&
 	git ls-files -s >actual &&
diff --git a/t/t6411-merge-filemode.sh b/t/t6411-merge-filemode.sh
index 7b66abfdbb..f54c915d6a 100755
--- a/t/t6411-merge-filemode.sh
+++ b/t/t6411-merge-filemode.sh
@@ -1,7 +1,7 @@
 #!/bin/sh
 
 test_description='merge: handle file mode'
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -10,11 +10,11 @@ test_expect_success 'set up mode change in one branch' '
 	: >file1 &&
 	git add file1 &&
 	git commit -m initial &&
-	git checkout -b a1 master &&
+	git checkout -b a1 main &&
 	: >dummy &&
 	git add dummy &&
 	git commit -m a &&
-	git checkout -b b1 master &&
+	git checkout -b b1 main &&
 	test_chmod +x file1 &&
 	git add file1 &&
 	git commit -m b1
@@ -42,12 +42,12 @@ do_one_mode resolve b1 a1
 
 test_expect_success 'set up mode change in both branches' '
 	git reset --hard HEAD &&
-	git checkout -b a2 master &&
+	git checkout -b a2 main &&
 	: >file2 &&
 	H=$(git hash-object file2) &&
 	test_chmod +x file2 &&
 	git commit -m a2 &&
-	git checkout -b b2 master &&
+	git checkout -b b2 main &&
 	: >file2 &&
 	git add file2 &&
 	git commit -m b2 &&
@@ -79,7 +79,7 @@ do_both_modes resolve
 
 test_expect_success 'set up delete/modechange scenario' '
 	git reset --hard &&
-	git checkout -b deletion master &&
+	git checkout -b deletion main &&
 	git rm file1 &&
 	git commit -m deletion
 '
diff --git a/t/t6412-merge-large-rename.sh b/t/t6412-merge-large-rename.sh
index d6840078c4..c50d315722 100755
--- a/t/t6412-merge-large-rename.sh
+++ b/t/t6412-merge-large-rename.sh
@@ -1,7 +1,7 @@
 #!/bin/sh
 
 test_description='merging with large rename matrix'
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -33,7 +33,7 @@ test_rename() {
 	test_expect_success "rename ($1, $2)" '
 	n='$1' &&
 	expect='$2' &&
-	git checkout -f master &&
+	git checkout -f main &&
 	test_might_fail git branch -D test$n &&
 	git reset --hard initial &&
 	for i in $(count $n); do
@@ -53,8 +53,8 @@ test_rename() {
 	git add . &&
 	git commit -m change+rename=$n &&
 	case "$expect" in
-		ok) git merge master ;;
-		 *) test_must_fail git merge master ;;
+		ok) git merge main ;;
+		 *) test_must_fail git merge main ;;
 	esac
 	'
 }
diff --git a/t/t6413-merge-crlf.sh b/t/t6413-merge-crlf.sh
index 3bd8e3e899..affea255fe 100755
--- a/t/t6413-merge-crlf.sh
+++ b/t/t6413-merge-crlf.sh
@@ -8,7 +8,7 @@ test_description='merge conflict in crlf repo
 
 '
 
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -27,7 +27,7 @@ test_expect_success setup '
 	echo line from b | append_cr >file &&
 	git commit -m "add line from b" file &&
 	git tag b &&
-	git checkout master
+	git checkout main
 '
 
 test_expect_success 'Check "ours" is CRLF' '
diff --git a/t/t6414-merge-rename-nocruft.sh b/t/t6414-merge-rename-nocruft.sh
index 42824dcf49..d7e3c1fa6e 100755
--- a/t/t6414-merge-rename-nocruft.sh
+++ b/t/t6414-merge-rename-nocruft.sh
@@ -1,7 +1,7 @@
 #!/bin/sh
 
 test_description='Merge-recursive merging renames'
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -68,7 +68,7 @@ test_expect_success 'setup' '
 	git update-index A &&
 	git commit -m "blue modify A" &&
 
-	git checkout master
+	git checkout main
 '
 
 # This test broke in 65ac6e9c3f47807cb603af07a6a9e1a43bc119ae
diff --git a/t/t6415-merge-dir-to-symlink.sh b/t/t6415-merge-dir-to-symlink.sh
index 32c0b62496..2ce104aca7 100755
--- a/t/t6415-merge-dir-to-symlink.sh
+++ b/t/t6415-merge-dir-to-symlink.sh
@@ -1,7 +1,7 @@
 #!/bin/sh
 
 test_description='merging when a directory was replaced with a symlink'
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -22,7 +22,7 @@ test_expect_success 'create a commit where dir a/b changed to symlink' '
 
 test_expect_success 'checkout does not clobber untracked symlink' '
 	git checkout HEAD^0 &&
-	git reset --hard master &&
+	git reset --hard main &&
 	git rm --cached a/b &&
 	git commit -m "untracked symlink remains" &&
 	test_must_fail git checkout start^0
@@ -30,7 +30,7 @@ test_expect_success 'checkout does not clobber untracked symlink' '
 
 test_expect_success 'a/b-2/c/d is kept when clobbering symlink b' '
 	git checkout HEAD^0 &&
-	git reset --hard master &&
+	git reset --hard main &&
 	git rm --cached a/b &&
 	git commit -m "untracked symlink remains" &&
 	git checkout -f start^0 &&
@@ -39,7 +39,7 @@ test_expect_success 'a/b-2/c/d is kept when clobbering symlink b' '
 
 test_expect_success 'checkout should not have deleted a/b-2/c/d' '
 	git checkout HEAD^0 &&
-	git reset --hard master &&
+	git reset --hard main &&
 	 git checkout start^0 &&
 	 test_path_is_file a/b-2/c/d
 '
@@ -56,7 +56,7 @@ test_expect_success 'setup for merge test' '
 test_expect_success 'Handle D/F conflict, do not lose a/b-2/c/d in merge (resolve)' '
 	git reset --hard &&
 	git checkout baseline^0 &&
-	git merge -s resolve master &&
+	git merge -s resolve main &&
 	test_path_is_file a/b-2/c/d
 '
 
@@ -67,7 +67,7 @@ test_expect_success SYMLINKS 'a/b was resolved as symlink' '
 test_expect_success 'Handle D/F conflict, do not lose a/b-2/c/d in merge (recursive)' '
 	git reset --hard &&
 	git checkout baseline^0 &&
-	git merge -s recursive master &&
+	git merge -s recursive main &&
 	test_path_is_file a/b-2/c/d
 '
 
@@ -77,7 +77,7 @@ test_expect_success SYMLINKS 'a/b was resolved as symlink' '
 
 test_expect_success 'Handle F/D conflict, do not lose a/b-2/c/d in merge (resolve)' '
 	git reset --hard &&
-	git checkout master^0 &&
+	git checkout main^0 &&
 	git merge -s resolve baseline^0 &&
 	test_path_is_file a/b-2/c/d
 '
@@ -88,7 +88,7 @@ test_expect_success SYMLINKS 'a/b was resolved as symlink' '
 
 test_expect_success 'Handle F/D conflict, do not lose a/b-2/c/d in merge (recursive)' '
 	git reset --hard &&
-	git checkout master^0 &&
+	git checkout main^0 &&
 	git merge -s recursive baseline^0 &&
 	test_path_is_file a/b-2/c/d
 '
@@ -101,7 +101,7 @@ test_expect_failure 'do not lose untracked in merge (resolve)' '
 	git reset --hard &&
 	git checkout baseline^0 &&
 	>a/b/c/e &&
-	test_must_fail git merge -s resolve master &&
+	test_must_fail git merge -s resolve main &&
 	test_path_is_file a/b/c/e &&
 	test_path_is_file a/b-2/c/d
 '
@@ -110,7 +110,7 @@ test_expect_success 'do not lose untracked in merge (recursive)' '
 	git reset --hard &&
 	git checkout baseline^0 &&
 	>a/b/c/e &&
-	test_must_fail git merge -s recursive master &&
+	test_must_fail git merge -s recursive main &&
 	test_path_is_file a/b/c/e &&
 	test_path_is_file a/b-2/c/d
 '
@@ -119,14 +119,14 @@ test_expect_success 'do not lose modifications in merge (resolve)' '
 	git reset --hard &&
 	git checkout baseline^0 &&
 	echo more content >>a/b/c/d &&
-	test_must_fail git merge -s resolve master
+	test_must_fail git merge -s resolve main
 '
 
 test_expect_success 'do not lose modifications in merge (recursive)' '
 	git reset --hard &&
 	git checkout baseline^0 &&
 	echo more content >>a/b/c/d &&
-	test_must_fail git merge -s recursive master
+	test_must_fail git merge -s recursive main
 '
 
 test_expect_success 'setup a merge where dir a/b-2 changed to symlink' '
diff --git a/t/t6416-recursive-corner-cases.sh b/t/t6416-recursive-corner-cases.sh
index 3d515a8e31..84f5082366 100755
--- a/t/t6416-recursive-corner-cases.sh
+++ b/t/t6416-recursive-corner-cases.sh
@@ -2,7 +2,7 @@
 
 test_description='recursive merge corner cases involving criss-cross merges'
 
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -388,7 +388,7 @@ test_expect_success 'git detects conflict merging criss-cross+modify/delete' '
 		test_line_count = 2 out &&
 
 		git rev-parse >expect       \
-			master:file    B:file &&
+			main:file    B:file &&
 		git rev-parse   >actual      \
 			:1:file      :2:file &&
 		test_cmp expect actual
@@ -410,7 +410,7 @@ test_expect_success 'git detects conflict merging criss-cross+modify/delete, rev
 		test_line_count = 2 out &&
 
 		git rev-parse >expect       \
-			master:file    B:file &&
+			main:file    B:file &&
 		git rev-parse   >actual      \
 			:1:file      :3:file &&
 		test_cmp expect actual
@@ -1556,12 +1556,12 @@ test_expect_failure 'check conflicting modes for regular file' '
 # Setup:
 #          L1---L2
 #         /  \ /  \
-#     master    X    ?
+#     main    X    ?
 #         \  / \  /
 #          R1---R2
 #
 # Where:
-#   master has two files, named 'b' and 'a'
+#   main has two files, named 'b' and 'a'
 #   branches L1 and R1 both modify each of the two files in conflicting ways
 #
 #   L2 is a merge of R1 into L1; more on it later.
@@ -1666,7 +1666,7 @@ test_expect_success 'check nested conflicts' '
 		cd nested_conflicts &&
 
 		git clean -f &&
-		MASTER=$(git rev-parse --short master) &&
+		MAIN=$(git rev-parse --short main) &&
 		git checkout L2^0 &&
 
 		# Merge must fail; there is a conflict
@@ -1682,24 +1682,24 @@ test_expect_success 'check nested conflicts' '
 		test_line_count = 1 out &&
 
 		# Create a and b from virtual merge base X
-		git cat-file -p master:a >base &&
+		git cat-file -p main:a >base &&
 		git cat-file -p L1:a >ours &&
 		git cat-file -p R1:a >theirs &&
 		test_must_fail git merge-file --diff3 \
 			-L "Temporary merge branch 1" \
-			-L "$MASTER"  \
+			-L "$MAIN"  \
 			-L "Temporary merge branch 2" \
 			ours  \
 			base  \
 			theirs &&
 		sed -e "s/^\([<|=>]\)/\1\1/" ours >vmb_a &&
 
-		git cat-file -p master:b >base &&
+		git cat-file -p main:b >base &&
 		git cat-file -p L1:b >ours &&
 		git cat-file -p R1:b >theirs &&
 		test_must_fail git merge-file --diff3 \
 			-L "Temporary merge branch 1" \
-			-L "$MASTER"  \
+			-L "$MAIN"  \
 			-L "Temporary merge branch 2" \
 			ours  \
 			base  \
@@ -1751,12 +1751,12 @@ test_expect_success 'check nested conflicts' '
 # Setup:
 #          L1---L2---L3
 #         /  \ /  \ /  \
-#     master    X1   X2   ?
+#     main    X1   X2   ?
 #         \  / \  / \  /
 #          R1---R2---R3
 #
 # Where:
-#   master has one file named 'content'
+#   main has one file named 'content'
 #   branches L1 and R1 both modify each of the two files in conflicting ways
 #
 #   L<n> (n>1) is a merge of R<n-1> into L<n-1>
@@ -1837,7 +1837,7 @@ test_expect_success 'check virtual merge base with nested conflicts' '
 	(
 		cd virtual_merge_base_has_nested_conflicts &&
 
-		MASTER=$(git rev-parse --short master) &&
+		MAIN=$(git rev-parse --short main) &&
 		git checkout L3^0 &&
 
 		# Merge must fail; there is a conflict
@@ -1860,13 +1860,13 @@ test_expect_success 'check virtual merge base with nested conflicts' '
 		# Imitate X1 merge base, except without long enough conflict
 		# markers because a subsequent sed will modify them.  Put
 		# result into vmb.
-		git cat-file -p master:content >base &&
+		git cat-file -p main:content >base &&
 		git cat-file -p L:content >left &&
 		git cat-file -p R:content >right &&
 		cp left merged-once &&
 		test_must_fail git merge-file --diff3 \
 			-L "Temporary merge branch 1" \
-			-L "$MASTER"  \
+			-L "$MAIN"  \
 			-L "Temporary merge branch 2" \
 			merged-once \
 			base        \
diff --git a/t/t6417-merge-ours-theirs.sh b/t/t6417-merge-ours-theirs.sh
index e7883f890a..ac9aee9a66 100755
--- a/t/t6417-merge-ours-theirs.sh
+++ b/t/t6417-merge-ours-theirs.sh
@@ -1,7 +1,7 @@
 #!/bin/sh
 
 test_description='Merge-recursive ours and theirs variants'
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -23,11 +23,11 @@ test_expect_success setup '
 	sed -e "s/9/nueve/" >file <elif &&
 	git commit -a -m theirs &&
 
-	git checkout master^0
+	git checkout main^0
 '
 
 test_expect_success 'plain recursive - should conflict' '
-	git reset --hard master &&
+	git reset --hard main &&
 	test_must_fail git merge -s recursive side &&
 	grep nine file &&
 	grep nueve file &&
@@ -37,7 +37,7 @@ test_expect_success 'plain recursive - should conflict' '
 '
 
 test_expect_success 'recursive favouring theirs' '
-	git reset --hard master &&
+	git reset --hard main &&
 	git merge -s recursive -Xtheirs side &&
 	! grep nine file &&
 	grep nueve file &&
@@ -47,7 +47,7 @@ test_expect_success 'recursive favouring theirs' '
 '
 
 test_expect_success 'recursive favouring ours' '
-	git reset --hard master &&
+	git reset --hard main &&
 	git merge -s recursive -X ours side &&
 	grep nine file &&
 	! grep nueve file &&
@@ -59,26 +59,26 @@ test_expect_success 'recursive favouring ours' '
 test_expect_success 'binary file with -Xours/-Xtheirs' '
 	echo file binary >.gitattributes &&
 
-	git reset --hard master &&
+	git reset --hard main &&
 	git merge -s recursive -X theirs side &&
 	git diff --exit-code side HEAD -- file &&
 
-	git reset --hard master &&
+	git reset --hard main &&
 	git merge -s recursive -X ours side &&
-	git diff --exit-code master HEAD -- file
+	git diff --exit-code main HEAD -- file
 '
 
 test_expect_success 'pull passes -X to underlying merge' '
-	git reset --hard master && git pull -s recursive -Xours . side &&
-	git reset --hard master && git pull -s recursive -X ours . side &&
-	git reset --hard master && git pull -s recursive -Xtheirs . side &&
-	git reset --hard master && git pull -s recursive -X theirs . side &&
-	git reset --hard master && test_must_fail git pull -s recursive -X bork . side
+	git reset --hard main && git pull -s recursive -Xours . side &&
+	git reset --hard main && git pull -s recursive -X ours . side &&
+	git reset --hard main && git pull -s recursive -Xtheirs . side &&
+	git reset --hard main && git pull -s recursive -X theirs . side &&
+	git reset --hard main && test_must_fail git pull -s recursive -X bork . side
 '
 
 test_expect_success SYMLINKS 'symlink with -Xours/-Xtheirs' '
-	git reset --hard master &&
-	git checkout -b two master &&
+	git reset --hard main &&
+	git checkout -b two main &&
 	ln -s target-zero link &&
 	git add link &&
 	git commit -m "add link pointing to zero" &&
diff --git a/t/t6418-merge-text-auto.sh b/t/t6418-merge-text-auto.sh
index 91b43de00d..1e0296dd17 100755
--- a/t/t6418-merge-text-auto.sh
+++ b/t/t6418-merge-text-auto.sh
@@ -2,17 +2,17 @@
 
 test_description='CRLF merge conflict across text=auto change
 
-* [master] remove .gitattributes
+* [main] remove .gitattributes
  ! [side] add line from b
 --
  + [side] add line from b
-*  [master] remove .gitattributes
-*  [master^] add line from a
-*  [master~2] normalize file
+*  [main] remove .gitattributes
+*  [main^] add line from a
+*  [main~2] normalize file
 *+ [side^] Initial
 '
 
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -67,7 +67,7 @@ test_expect_success setup '
 	git commit -m "add line from b" &&
 	git tag b &&
 
-	git checkout master
+	git checkout main
 '
 
 test_expect_success 'set up fuzz_conflict() helper' '
@@ -198,7 +198,7 @@ test_expect_success 'Test delete/normalize conflict' '
 	git reset --hard initial &&
 	git rm file &&
 	git commit -m "remove file" &&
-	git checkout master &&
+	git checkout main &&
 	git reset --hard a^ &&
 	git merge side &&
 	test_path_is_missing file
diff --git a/t/t6419-merge-ignorecase.sh b/t/t6419-merge-ignorecase.sh
index 9996a94431..b64b75acf5 100755
--- a/t/t6419-merge-ignorecase.sh
+++ b/t/t6419-merge-ignorecase.sh
@@ -2,7 +2,7 @@
 
 test_description='git-merge with case-changing rename on case-insensitive file system'
 
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -23,18 +23,18 @@ test_expect_success 'merge with case-changing rename' '
 	>foo &&
 	git add foo &&
 	git commit -m "intervening commit" &&
-	git checkout master &&
+	git checkout main &&
 	git rm TestCase &&
 	>testcase &&
 	git add testcase &&
 	git commit -m "rename to testcase" &&
 	git checkout with-camel &&
-	git merge master -m "merge" &&
+	git merge main -m "merge" &&
 	test_path_is_file testcase
 '
 
 test_expect_success 'merge with case-changing rename on both sides' '
-	git checkout master &&
+	git checkout main &&
 	git reset --hard baseline &&
 	git branch -D with-camel &&
 	git checkout -b with-camel &&
@@ -43,13 +43,13 @@ test_expect_success 'merge with case-changing rename on both sides' '
 	>foo &&
 	git add foo &&
 	git commit -m "intervening commit" &&
-	git checkout master &&
+	git checkout main &&
 	git rm TestCase &&
 	>testcase &&
 	git add testcase &&
 	git commit -m "rename to testcase" &&
 	git checkout with-camel &&
-	git merge master -m "merge" &&
+	git merge main -m "merge" &&
 	test_path_is_file testcase
 '
 
diff --git a/t/t6422-merge-rename-corner-cases.sh b/t/t6422-merge-rename-corner-cases.sh
index 9fb4e72ca3..bf4ce3c63d 100755
--- a/t/t6422-merge-rename-corner-cases.sh
+++ b/t/t6422-merge-rename-corner-cases.sh
@@ -3,7 +3,7 @@
 test_description="recursive merge corner cases w/ renames but not criss-crosses"
 # t6036 has corner cases that involve both criss-cross merges and renames
 
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -1133,7 +1133,7 @@ test_conflicts_with_adds_and_renames() {
 	# Setup:
 	#          L
 	#         / \
-	#     master   ?
+	#     main   ?
 	#         \ /
 	#          R
 	#
@@ -1263,7 +1263,7 @@ test_conflicts_with_adds_and_renames() {
 				:2:three           \
 				:3:three           &&
 			git rev-parse >expected        \
-				master:irrelevant_file \
+				main:irrelevant_file \
 				file_v2                \
 				file_v4                &&
 			test_cmp expected actual &&
@@ -1293,12 +1293,12 @@ test_conflicts_with_adds_and_renames add    add
 # Setup:
 #          L
 #         / \
-#     master   ?
+#     main   ?
 #         \ /
 #          R
 #
 # Where:
-#   master has two files, named 'one' and 'two'.
+#   main has two files, named 'one' and 'two'.
 #   branches L and R both modify 'one', in conflicting ways.
 #   branches L and R both modify 'two', in conflicting ways.
 #   branch L also renames 'one' to 'three'.
@@ -1379,7 +1379,7 @@ test_expect_success 'check nested conflicts from rename/rename(2to1)' '
 		test_line_count = 1 out &&
 
 		# Compare :2:three to expected values
-		git cat-file -p master:one >base &&
+		git cat-file -p main:one >base &&
 		git cat-file -p L:three >ours &&
 		git cat-file -p R:one >theirs &&
 		test_must_fail git merge-file    \
@@ -1390,7 +1390,7 @@ test_expect_success 'check nested conflicts from rename/rename(2to1)' '
 		test_cmp expect L-three &&
 
 		# Compare :2:three to expected values
-		git cat-file -p master:two >base &&
+		git cat-file -p main:two >base &&
 		git cat-file -p L:two >ours &&
 		git cat-file -p R:three >theirs &&
 		test_must_fail git merge-file    \
diff --git a/t/t6425-merge-rename-delete.sh b/t/t6425-merge-rename-delete.sh
index e58e3dfba1..459b431a60 100755
--- a/t/t6425-merge-rename-delete.sh
+++ b/t/t6425-merge-rename-delete.sh
@@ -1,7 +1,7 @@
 #!/bin/sh
 
 test_description='Merge-recursive rename/delete conflict message'
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -15,7 +15,7 @@ test_expect_success 'rename/delete' '
 	git mv A B &&
 	git commit -m "rename" &&
 
-	git checkout master &&
+	git checkout main &&
 	git rm A &&
 	git commit -m "delete" &&
 
diff --git a/t/t6427-diff3-conflict-markers.sh b/t/t6427-diff3-conflict-markers.sh
index 3ae2d07ae1..25c4b720e7 100755
--- a/t/t6427-diff3-conflict-markers.sh
+++ b/t/t6427-diff3-conflict-markers.sh
@@ -2,7 +2,7 @@
 
 test_description='recursive merge diff3 style conflict markers'
 
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -46,7 +46,7 @@ test_expect_success 'check no merge base' '
 # Setup:
 #          L1
 #         /  \
-#     master    ?
+#     main    ?
 #         \  /
 #          R1
 #
@@ -93,18 +93,18 @@ test_expect_success 'check unique merge base' '
 		cd unique_merge_base &&
 
 		git checkout L^0 &&
-		MASTER=$(git rev-parse --short master) &&
+		MAIN=$(git rev-parse --short main) &&
 
 		test_must_fail git -c merge.conflictstyle=diff3 merge -s recursive R^0 &&
 
-		grep "|||||| $MASTER:content" renamed
+		grep "|||||| $MAIN:content" renamed
 	)
 '
 
 # Setup:
 #          L1---L2--L3
 #         /  \ /      \
-#     master    X1       ?
+#     main    X1       ?
 #         \  / \      /
 #          R1---R2--R3
 #
@@ -194,10 +194,10 @@ test_expect_success 'rebase --merge describes parent of commit being picked' '
 	(
 		cd rebase &&
 		test_commit base file &&
-		test_commit master file &&
+		test_commit main file &&
 		git checkout -b side HEAD^ &&
 		test_commit side file &&
-		test_must_fail git -c merge.conflictstyle=diff3 rebase --merge master &&
+		test_must_fail git -c merge.conflictstyle=diff3 rebase --merge main &&
 		grep "||||||| parent of" file
 	)
 '
@@ -206,7 +206,7 @@ test_expect_success 'rebase --apply describes fake ancestor base' '
 	(
 		cd rebase &&
 		git rebase --abort &&
-		test_must_fail git -c merge.conflictstyle=diff3 rebase --apply master &&
+		test_must_fail git -c merge.conflictstyle=diff3 rebase --apply main &&
 		grep "||||||| constructed merge base" file
 	)
 '
diff --git a/t/t6430-merge-recursive.sh b/t/t6430-merge-recursive.sh
index acb2868260..ffcc01fe65 100755
--- a/t/t6430-merge-recursive.sh
+++ b/t/t6430-merge-recursive.sh
@@ -2,7 +2,7 @@
 
 test_description='merge-recursive backend test'
 
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -38,7 +38,7 @@ test_expect_success 'setup 1' '
 	git add a d/e &&
 
 	test_tick &&
-	git commit -m "master modifies a and d/e" &&
+	git commit -m "main modifies a and d/e" &&
 	c1=$(git rev-parse --verify HEAD) &&
 	( git ls-tree -r HEAD && git ls-files -s ) >actual &&
 	(
@@ -469,7 +469,7 @@ test_expect_success SYMLINKS 'dir in working tree with symlink ancestor does not
 		git checkout -b branch1 &&
 		git commit --allow-empty -m "empty commit" &&
 
-		git checkout master &&
+		git checkout main &&
 		git rm foo &&
 		mkdir foo &&
 		>foo/bar &&
@@ -478,7 +478,7 @@ test_expect_success SYMLINKS 'dir in working tree with symlink ancestor does not
 
 		git checkout branch1 &&
 
-		git cherry-pick master &&
+		git cherry-pick main &&
 		test_path_is_dir foo &&
 		test_path_is_file foo/bar
 	)
@@ -493,8 +493,8 @@ test_expect_success 'reset and 3-way merge' '
 
 test_expect_success 'reset and bind merge' '
 
-	git reset --hard master &&
-	git read-tree --prefix=M/ master &&
+	git reset --hard main &&
+	git read-tree --prefix=M/ main &&
 	git ls-files -s >actual &&
 	(
 		echo "100644 $o1 0	M/a" &&
@@ -508,7 +508,7 @@ test_expect_success 'reset and bind merge' '
 	) >expected &&
 	test_cmp expected actual &&
 
-	git read-tree --prefix=a1/ master &&
+	git read-tree --prefix=a1/ main &&
 	git ls-files -s >actual &&
 	(
 		echo "100644 $o1 0	M/a" &&
@@ -526,7 +526,7 @@ test_expect_success 'reset and bind merge' '
 	) >expected &&
 	test_cmp expected actual &&
 
-	git read-tree --prefix=z/ master &&
+	git read-tree --prefix=z/ main &&
 	git ls-files -s >actual &&
 	(
 		echo "100644 $o1 0	M/a" &&
@@ -602,11 +602,11 @@ test_expect_success 'merge-recursive w/ empty work tree - theirs has rename' '
 
 test_expect_success 'merge removes empty directories' '
 
-	git reset --hard master &&
+	git reset --hard main &&
 	git checkout -b rm &&
 	git rm d/e &&
 	git commit -mremoved-d/e &&
-	git checkout master &&
+	git checkout main &&
 	git merge -s recursive rm &&
 	test_path_is_missing d
 '
diff --git a/t/t6432-merge-recursive-space-options.sh b/t/t6432-merge-recursive-space-options.sh
index 1333cbb148..db4b77e63d 100755
--- a/t/t6432-merge-recursive-space-options.sh
+++ b/t/t6432-merge-recursive-space-options.sh
@@ -2,16 +2,16 @@
 
 test_description='merge-recursive space options
 
-* [master] Clarify
+* [main] Clarify
  ! [remote] Remove cruft
 --
  + [remote] Remove cruft
-*  [master] Clarify
+*  [main] Clarify
 *+ [remote^] Initial revision
 *   ok 1: setup
 '
 
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -90,7 +90,7 @@ test_expect_success 'setup' '
 	mv text.txt+ text.txt &&
 	git commit -a -m "Remove cruft" &&
 
-	git checkout master &&
+	git checkout main &&
 	sed -e "
 			s/\(not in his right mind\),\(.*\)/\1;\2Q/
 			s/Quite correct\(.*\)/It is too correct\1Q/
diff --git a/t/t6433-merge-toplevel.sh b/t/t6433-merge-toplevel.sh
index 2d51b2d08c..b16031465f 100755
--- a/t/t6433-merge-toplevel.sh
+++ b/t/t6433-merge-toplevel.sh
@@ -2,13 +2,13 @@
 
 test_description='"git merge" top-level frontend'
 
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
 
 t3033_reset () {
-	git checkout -B master two &&
+	git checkout -B main two &&
 	git branch -f left three &&
 	git branch -f right four
 }
@@ -24,7 +24,7 @@ test_expect_success setup '
 	test_commit four &&
 	git checkout --orphan newroot &&
 	test_commit five &&
-	git checkout master
+	git checkout main
 '
 
 # Local branches
@@ -64,7 +64,7 @@ test_expect_success 'merge octopus, non-fast-forward (ff)' '
 test_expect_success 'merge octopus, fast-forward (does not ff)' '
 	t3033_reset &&
 	git merge left right &&
-	# two (master) is not an ancestor of three (left) and four (right)
+	# two (main) is not an ancestor of three (left) and four (right)
 	test_must_fail git rev-parse --verify HEAD^4 &&
 	git rev-parse HEAD^1 HEAD^2 HEAD^3 | sort >actual &&
 	git rev-parse two three four | sort >expect &&
@@ -121,7 +121,7 @@ test_expect_success 'merge FETCH_HEAD octopus fast-forward (does not ff)' '
 	t3033_reset &&
 	git fetch . left right &&
 	git merge FETCH_HEAD &&
-	# two (master) is not an ancestor of three (left) and four (right)
+	# two (main) is not an ancestor of three (left) and four (right)
 	test_must_fail git rev-parse --verify HEAD^4 &&
 	git rev-parse HEAD^1 HEAD^2 HEAD^3 | sort >actual &&
 	git rev-parse two three four | sort >expect &&
diff --git a/t/t6434-merge-recursive-rename-options.sh b/t/t6434-merge-recursive-rename-options.sh
index 7e877e96e2..a11707835b 100755
--- a/t/t6434-merge-recursive-rename-options.sh
+++ b/t/t6434-merge-recursive-rename-options.sh
@@ -5,11 +5,11 @@ test_description='merge-recursive rename options
 Test rename detection by examining rename/delete conflicts.
 
 * (HEAD -> rename) rename
-| * (master) delete
+| * (main) delete
 |/
 * base
 
-git diff --name-status base master
+git diff --name-status base main
 D	0-old
 D	1-old
 D	2-old
@@ -26,7 +26,7 @@ they are rounded down (see, e.g., Documentation/diff-generate-patch.txt, which
 mentions this in a different context).
 '
 
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -121,7 +121,7 @@ test_expect_success 'setup repo' '
 	get_expected_stages 2 &&
 	get_expected_stages 3 &&
 	check_50="false" &&
-	tail="HEAD^ -- HEAD master"
+	tail="HEAD^ -- HEAD main"
 '
 
 test_expect_success 'setup thresholds' '
diff --git a/t/t6436-merge-overwrite.sh b/t/t6436-merge-overwrite.sh
index 7d5691c1b4..362ae37a12 100755
--- a/t/t6436-merge-overwrite.sh
+++ b/t/t6436-merge-overwrite.sh
@@ -4,7 +4,7 @@ test_description='git-merge
 
 Do not overwrite changes.'
 
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -196,7 +196,7 @@ test_expect_success 'set up unborn branch and content' '
 '
 
 test_expect_success 'will not clobber WT/index when merging into unborn' '
-	git merge master &&
+	git merge main &&
 	grep foo tracked-file &&
 	git show :tracked-file >expect &&
 	grep foo expect &&
diff --git a/t/t6437-submodule-merge.sh b/t/t6437-submodule-merge.sh
index 14fa46edf3..0f92bcf326 100755
--- a/t/t6437-submodule-merge.sh
+++ b/t/t6437-submodule-merge.sh
@@ -2,7 +2,7 @@
 
 test_description='merging with submodules'
 
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -30,7 +30,7 @@ test_expect_success setup '
 	test_tick &&
 	git commit -m root &&
 
-	git checkout -b a master &&
+	git checkout -b a main &&
 	(cd sub &&
 	 echo A > file &&
 	 git add file &&
@@ -40,7 +40,7 @@ test_expect_success setup '
 	test_tick &&
 	git commit -m a &&
 
-	git checkout -b b master &&
+	git checkout -b b main &&
 	(cd sub &&
 	 echo B > file &&
 	 git add file &&
@@ -257,22 +257,22 @@ test_expect_success 'setup for recursive merge with submodule' '
 	 (cd sub &&
 	  git init &&
 	  test_commit a &&
-	  git checkout -b sub-b master &&
+	  git checkout -b sub-b main &&
 	  test_commit b &&
-	  git checkout -b sub-c master &&
+	  git checkout -b sub-c main &&
 	  test_commit c &&
 	  git checkout -b sub-bc sub-b &&
 	  git merge sub-c &&
 	  git checkout -b sub-cb sub-c &&
 	  git merge sub-b &&
-	  git checkout master) &&
+	  git checkout main) &&
 	 git add sub &&
 	 git commit -m a &&
-	 git checkout -b top-b master &&
+	 git checkout -b top-b main &&
 	 (cd sub && git checkout sub-b) &&
 	 git add sub &&
 	 git commit -m b &&
-	 git checkout -b top-c master &&
+	 git checkout -b top-c main &&
 	 (cd sub && git checkout sub-c) &&
 	 git add sub &&
 	 git commit -m c &&
diff --git a/t/t6439-merge-co-error-msgs.sh b/t/t6439-merge-co-error-msgs.sh
index e5542ceb24..e176475ed5 100755
--- a/t/t6439-merge-co-error-msgs.sh
+++ b/t/t6439-merge-co-error-msgs.sh
@@ -2,7 +2,7 @@
 
 test_description='unpack-trees error messages'
 
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -21,7 +21,7 @@ test_expect_success 'setup' '
 	git add two three four five &&
 	git commit -m Second &&
 
-	git checkout master &&
+	git checkout main &&
 	echo other >two &&
 	echo other >three &&
 	echo other >four &&
@@ -86,7 +86,7 @@ test_expect_success 'cannot switch branches because of local changes' '
 	echo two >rep/two &&
 	git add rep/one rep/two &&
 	git commit -m Fourth &&
-	git checkout master &&
+	git checkout main &&
 	echo uno >rep/one &&
 	echo dos >rep/two &&
 	test_must_fail git checkout branch 2>out &&
@@ -131,7 +131,7 @@ test_expect_success 'not_uptodate_dir porcelain checkout error' '
 	>rep2 &&
 	git add rep rep2 &&
 	git commit -m "added test as a file" &&
-	git checkout master &&
+	git checkout main &&
 	>rep/untracked-file &&
 	>rep2/untracked-file &&
 	test_must_fail git checkout branch 2>out &&
diff --git a/t/t6501-freshen-objects.sh b/t/t6501-freshen-objects.sh
index bda5069044..75210f012b 100755
--- a/t/t6501-freshen-objects.sh
+++ b/t/t6501-freshen-objects.sh
@@ -25,7 +25,7 @@
 #      to refer to an existing tree).
 
 test_description='check pruning of dependent objects'
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -70,7 +70,7 @@ for repack in '' true; do
 		git checkout -b experiment &&
 		commit abandon &&
 		maybe_repack &&
-		git checkout master &&
+		git checkout main &&
 		git branch -D experiment
 	'
 
-- 
gitgitgadget


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH v3 21/28] t7[0-4]*: adjust the references to the default branch name "main"
  2020-11-18 23:44   ` [PATCH v3 00/28] tests: use main as default branch name Johannes Schindelin via GitGitGadget
                       ` (19 preceding siblings ...)
  2020-11-18 23:44     ` [PATCH v3 20/28] t6[4-9]*: adjust the references to the default branch name "main" Johannes Schindelin via GitGitGadget
@ 2020-11-18 23:44     ` Johannes Schindelin via GitGitGadget
  2020-11-18 23:44     ` [PATCH v3 22/28] t7[5-9]*: " Johannes Schindelin via GitGitGadget
                       ` (7 subsequent siblings)
  28 siblings, 0 replies; 163+ messages in thread
From: Johannes Schindelin via GitGitGadget @ 2020-11-18 23:44 UTC (permalink / raw)
  To: git
  Cc: Felipe Contreras, Ævar Arnfjörð Bjarmason,
	Johannes Schindelin, Jeff King, Jonathan Nieder,
	Johannes Schindelin, Johannes Schindelin

From: Johannes Schindelin <johannes.schindelin@gmx.de>

Carefully excluding t7064, which sees independent development elsewhere
at the time of writing, we use `main` as the default branch name in
t7[0-4]*. This trick was performed via

	$ (cd t &&
	   sed -i -e 's/master/main/g' -e 's/MASTER/MAIN/g' \
		-e 's/Master/Main/g' -- t7[0-4]*.sh &&
	   git checkout HEAD -- t7064\*)

This allows us to define `GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main`
for those tests.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
---
 t/t7003-filter-branch.sh                |  42 ++++-----
 t/t7004-tag.sh                          |  10 +--
 t/t7030-verify-tag.sh                   |   4 +-
 t/t7060-wtstatus.sh                     |  28 +++---
 t/t7063-status-untracked-cache.sh       |  16 ++--
 t/t7102-reset.sh                        |   8 +-
 t/t7113-post-index-change-hook.sh       |   4 +-
 t/t7201-co.sh                           | 112 ++++++++++++------------
 t/t7400-submodule-basic.sh              |  22 ++---
 t/t7403-submodule-sync.sh               |  12 +--
 t/t7406-submodule-update.sh             |  40 ++++-----
 t/t7407-submodule-foreach.sh            |  26 +++---
 t/t7409-submodule-detached-work-tree.sh |  10 +--
 t/t7417-submodule-path-url.sh           |   4 +-
 14 files changed, 169 insertions(+), 169 deletions(-)

diff --git a/t/t7003-filter-branch.sh b/t/t7003-filter-branch.sh
index db496fa039..1c55695034 100755
--- a/t/t7003-filter-branch.sh
+++ b/t/t7003-filter-branch.sh
@@ -1,7 +1,7 @@
 #!/bin/sh
 
 test_description='git filter-branch'
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -16,7 +16,7 @@ test_expect_success 'setup' '
 	mkdir dir &&
 	test_commit dir/D &&
 	test_commit E &&
-	git checkout master &&
+	git checkout main &&
 	test_commit C &&
 	git checkout branch &&
 	git merge C &&
@@ -28,7 +28,7 @@ test_expect_success 'setup' '
 # * G
 # *   Merge commit 'C' into branch
 # |\
-# | * (master) C
+# | * (main) C
 # * | E
 # * | dir/D
 # * | D
@@ -165,15 +165,15 @@ test_expect_success 'subdirectory filter result looks okay' '
 '
 
 test_expect_success 'more setup' '
-	git checkout master &&
+	git checkout main &&
 	mkdir subdir &&
 	echo A > subdir/new &&
 	git add subdir/new &&
 	test_tick &&
-	git commit -m "subdir on master" subdir/new &&
+	git commit -m "subdir on main" subdir/new &&
 	git rm A.t &&
 	test_tick &&
-	git commit -m "again subdir on master" &&
+	git commit -m "again subdir on main" &&
 	git merge branch
 '
 
@@ -202,7 +202,7 @@ test_expect_success 'author information is preserved' '
 	git branch preserved-author &&
 	(sane_unset GIT_AUTHOR_NAME &&
 	 git filter-branch -f --msg-filter "cat; \
-			test \$GIT_COMMIT != $(git rev-parse master) || \
+			test \$GIT_COMMIT != $(git rev-parse main) || \
 			echo Hallo" \
 		preserved-author) &&
 	git rev-list --author="B V Uips" preserved-author >actual &&
@@ -221,7 +221,7 @@ test_expect_success "remove a certain author's commits" '
 		else\
 			git commit-tree \"\$@\";\
 		fi" removed-author &&
-	cnt1=$(git rev-list master | wc -l) &&
+	cnt1=$(git rev-list main | wc -l) &&
 	cnt2=$(git rev-list removed-author | wc -l) &&
 	test $cnt1 -eq $(($cnt2 + 1)) &&
 	git rev-list --author="B V Uips" removed-author >actual &&
@@ -229,7 +229,7 @@ test_expect_success "remove a certain author's commits" '
 '
 
 test_expect_success 'barf on invalid name' '
-	test_must_fail git filter-branch -f master xy-problem &&
+	test_must_fail git filter-branch -f main xy-problem &&
 	test_must_fail git filter-branch -f HEAD^
 '
 
@@ -239,8 +239,8 @@ test_expect_success '"map" works in commit filter' '
 		mapped=\$(map \$parent) &&
 		actual=\$(echo \"\$@\" | sed \"s/^.*-p //\") &&
 		test \$mapped = \$actual &&
-		git commit-tree \"\$@\";" master~2..master &&
-	git rev-parse --verify master
+		git commit-tree \"\$@\";" main~2..main &&
+	git rev-parse --verify main
 '
 
 test_expect_success 'Name needing quotes' '
@@ -259,7 +259,7 @@ test_expect_success 'Name needing quotes' '
 
 test_expect_success 'Subdirectory filter with disappearing trees' '
 	git reset --hard &&
-	git checkout master &&
+	git checkout main &&
 
 	mkdir foo &&
 	touch foo/bar &&
@@ -278,7 +278,7 @@ test_expect_success 'Subdirectory filter with disappearing trees' '
 	git commit -m "Re-adding foo" &&
 
 	git filter-branch -f --subdirectory-filter foo &&
-	git rev-list master >actual &&
+	git rev-list main >actual &&
 	test_line_count = 3 actual
 '
 
@@ -335,7 +335,7 @@ test_expect_success 'Tag name filtering allows slashes in tag names' '
 	test_cmp expect actual
 '
 test_expect_success 'setup --prune-empty comparisons' '
-	git checkout --orphan master-no-a &&
+	git checkout --orphan main-no-a &&
 	git rm -rf . &&
 	unset test_tick &&
 	test_tick &&
@@ -346,7 +346,7 @@ test_expect_success 'setup --prune-empty comparisons' '
 	mkdir dir &&
 	test_commit dir/D dir/D.t dir/D dir/Dx &&
 	test_commit E E.t E Ex &&
-	git checkout master-no-a &&
+	git checkout main-no-a &&
 	test_commit C C.t C Cx &&
 	git checkout branch-no-a &&
 	git merge Cx -m "Merge tag '\''C'\'' into branch" &&
@@ -400,7 +400,7 @@ test_expect_success '--prune-empty is able to prune entire branch' '
 '
 
 test_expect_success '--remap-to-ancestor with filename filters' '
-	git checkout master &&
+	git checkout main &&
 	git reset --hard A &&
 	test_commit add-foo foo 1 &&
 	git branch moved-foo &&
@@ -410,15 +410,15 @@ test_expect_success '--remap-to-ancestor with filename filters' '
 	git branch moved-bar &&
 	test_commit change-foo foo 2 &&
 	git filter-branch -f --remap-to-ancestor \
-		moved-foo moved-bar A..master \
+		moved-foo moved-bar A..main \
 		-- -- foo &&
 	test $(git rev-parse moved-foo) = $(git rev-parse moved-bar) &&
-	test $(git rev-parse moved-foo) = $(git rev-parse master^) &&
+	test $(git rev-parse moved-foo) = $(git rev-parse main^) &&
 	test $orig_invariant = $(git rev-parse invariant)
 '
 
 test_expect_success 'automatic remapping to ancestor with filename filters' '
-	git checkout master &&
+	git checkout main &&
 	git reset --hard A &&
 	test_commit add-foo2 foo 1 &&
 	git branch moved-foo2 &&
@@ -428,10 +428,10 @@ test_expect_success 'automatic remapping to ancestor with filename filters' '
 	git branch moved-bar2 &&
 	test_commit change-foo2 foo 2 &&
 	git filter-branch -f \
-		moved-foo2 moved-bar2 A..master \
+		moved-foo2 moved-bar2 A..main \
 		-- -- foo &&
 	test $(git rev-parse moved-foo2) = $(git rev-parse moved-bar2) &&
-	test $(git rev-parse moved-foo2) = $(git rev-parse master^) &&
+	test $(git rev-parse moved-foo2) = $(git rev-parse main^) &&
 	test $orig_invariant = $(git rev-parse invariant2)
 '
 
diff --git a/t/t7004-tag.sh b/t/t7004-tag.sh
index 0e3086c4a6..943a7d5c1d 100755
--- a/t/t7004-tag.sh
+++ b/t/t7004-tag.sh
@@ -7,7 +7,7 @@ test_description='git tag
 
 Tests for operations with tags.'
 
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -1586,7 +1586,7 @@ test_expect_success 'checking that branch head with --no-contains lists all but
 "
 
 test_expect_success 'merging original branch into this branch' '
-	git merge --strategy=ours master &&
+	git merge --strategy=ours main &&
         git tag v4.0
 '
 
@@ -1947,15 +1947,15 @@ test_expect_success ULIMIT_STACK_SIZE '--contains and --no-contains work in a de
 	i=1 &&
 	while test $i -lt 8000
 	do
-		echo "commit refs/heads/master
+		echo "commit refs/heads/main
 committer A U Thor <author@example.com> $((1000000000 + $i * 100)) +0200
 data <<EOF
 commit #$i
 EOF"
-		test $i = 1 && echo "from refs/heads/master^0"
+		test $i = 1 && echo "from refs/heads/main^0"
 		i=$(($i + 1))
 	done | git fast-import &&
-	git checkout master &&
+	git checkout main &&
 	git tag far-far-away HEAD^ &&
 	run_with_limited_stack git tag --contains HEAD >actual &&
 	test_must_be_empty actual &&
diff --git a/t/t7030-verify-tag.sh b/t/t7030-verify-tag.sh
index bcb3c4f035..3cefde9602 100755
--- a/t/t7030-verify-tag.sh
+++ b/t/t7030-verify-tag.sh
@@ -1,7 +1,7 @@
 #!/bin/sh
 
 test_description='signed tag tests'
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -20,7 +20,7 @@ test_expect_success GPG 'create signed tags' '
 	echo 3 >elif && git add elif &&
 	test_tick && git commit -m "third on side" &&
 
-	git checkout master &&
+	git checkout main &&
 	test_tick && git merge -S side &&
 	git tag -s -m merge merge &&
 
diff --git a/t/t7060-wtstatus.sh b/t/t7060-wtstatus.sh
index e65ca019eb..72fb418b89 100755
--- a/t/t7060-wtstatus.sh
+++ b/t/t7060-wtstatus.sh
@@ -2,7 +2,7 @@
 
 test_description='basic work tree status reporting'
 
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -54,7 +54,7 @@ EOF
 		git checkout -b side HEAD^ &&
 		git rm foo &&
 		git commit -m delete &&
-		test_must_fail git merge master &&
+		test_must_fail git merge main &&
 		test_must_fail git commit --dry-run >../actual &&
 		test_i18ncmp ../expect ../actual &&
 		git status >../actual &&
@@ -127,18 +127,18 @@ test_expect_success 'git diff-index --cached -C shows 2 copies + 1 unmerged' '
 
 test_expect_success 'status when conflicts with add and rm advice (deleted by them)' '
 	git reset --hard &&
-	git checkout master &&
+	git checkout main &&
 	test_commit init main.txt init &&
 	git checkout -b second_branch &&
 	git rm main.txt &&
 	git commit -m "main.txt deleted on second_branch" &&
 	test_commit second conflict.txt second &&
-	git checkout master &&
+	git checkout main &&
 	test_commit on_second main.txt on_second &&
-	test_commit master conflict.txt master &&
+	test_commit main conflict.txt main &&
 	test_must_fail git merge second_branch &&
 	cat >expected <<\EOF &&
-On branch master
+On branch main
 You have unmerged paths.
   (fix conflicts and run "git commit")
   (use "git merge --abort" to abort the merge)
@@ -160,8 +160,8 @@ test_expect_success 'prepare for conflicts' '
 	git checkout -b conflict &&
 	test_commit one main.txt one &&
 	git branch conflict_second &&
-	git mv main.txt sub_master.txt &&
-	git commit -m "main.txt renamed in sub_master.txt" &&
+	git mv main.txt sub_main.txt &&
+	git commit -m "main.txt renamed in sub_main.txt" &&
 	git checkout conflict_second &&
 	git mv main.txt sub_second.txt &&
 	git commit -m "main.txt renamed in sub_second.txt"
@@ -179,7 +179,7 @@ You have unmerged paths.
 Unmerged paths:
   (use "git add/rm <file>..." as appropriate to mark resolution)
 	both deleted:    main.txt
-	added by them:   sub_master.txt
+	added by them:   sub_main.txt
 	added by us:     sub_second.txt
 
 no changes added to commit (use "git add" and/or "git commit -a")
@@ -192,7 +192,7 @@ EOF
 test_expect_success 'status when conflicts with only rm advice (both deleted)' '
 	git reset --hard conflict_second &&
 	test_must_fail git merge conflict &&
-	git add sub_master.txt &&
+	git add sub_main.txt &&
 	git add sub_second.txt &&
 	cat >expected <<\EOF &&
 On branch conflict_second
@@ -201,7 +201,7 @@ You have unmerged paths.
   (use "git merge --abort" to abort the merge)
 
 Changes to be committed:
-	new file:   sub_master.txt
+	new file:   sub_main.txt
 
 Unmerged paths:
   (use "git rm <file>..." to mark resolution)
@@ -212,12 +212,12 @@ EOF
 	git status --untracked-files=no >actual &&
 	test_i18ncmp expected actual &&
 	git reset --hard &&
-	git checkout master
+	git checkout main
 '
 
 test_expect_success 'status --branch with detached HEAD' '
 	git reset --hard &&
-	git checkout master^0 &&
+	git checkout main^0 &&
 	git status --branch --porcelain >actual &&
 	cat >expected <<-EOF &&
 	## HEAD (no branch)
@@ -233,7 +233,7 @@ test_expect_success 'status --branch with detached HEAD' '
 ## Duplicate the above test and verify --porcelain=v1 arg parsing.
 test_expect_success 'status --porcelain=v1 --branch with detached HEAD' '
 	git reset --hard &&
-	git checkout master^0 &&
+	git checkout main^0 &&
 	git status --branch --porcelain=v1 >actual &&
 	cat >expected <<-EOF &&
 	## HEAD (no branch)
diff --git a/t/t7063-status-untracked-cache.sh b/t/t7063-status-untracked-cache.sh
index ae60942347..f01bf27727 100755
--- a/t/t7063-status-untracked-cache.sh
+++ b/t/t7063-status-untracked-cache.sh
@@ -2,7 +2,7 @@
 
 test_description='test untracked cache'
 
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -478,7 +478,7 @@ EOF
 test_expect_success 'set up sparse checkout' '
 	echo "done/[a-z]*" >.git/info/sparse-checkout &&
 	test_config core.sparsecheckout true &&
-	git checkout master &&
+	git checkout main &&
 	git update-index --force-untracked-cache &&
 	git status --porcelain >/dev/null && # prime the cache
 	test_path_is_missing done/.gitignore &&
@@ -737,13 +737,13 @@ test_expect_success 'test ident field is working' '
 test_expect_success 'untracked cache survives a checkout' '
 	git commit --allow-empty -m empty &&
 	test-tool dump-untracked-cache >../before &&
-	test_when_finished  "git checkout master" &&
+	test_when_finished  "git checkout main" &&
 	git checkout -b other_branch &&
 	test-tool dump-untracked-cache >../after &&
 	test_cmp ../before ../after &&
 	test_commit test &&
 	test-tool dump-untracked-cache >../before &&
-	git checkout master &&
+	git checkout main &&
 	test-tool dump-untracked-cache >../after &&
 	test_cmp ../before ../after
 '
@@ -778,7 +778,7 @@ test_expect_success SYMLINKS '"status" after symlink replacement should be clean
 	git checkout HEAD~ &&
 	status_is_clean &&
 	status_is_clean &&
-	git checkout master &&
+	git checkout main &&
 	avoid_racy &&
 	status_is_clean &&
 	status_is_clean
@@ -789,7 +789,7 @@ test_expect_success SYMLINKS '"status" after symlink replacement should be clean
 	git checkout HEAD~ &&
 	status_is_clean &&
 	status_is_clean &&
-	git checkout master &&
+	git checkout main &&
 	avoid_racy &&
 	status_is_clean &&
 	status_is_clean
@@ -813,7 +813,7 @@ test_expect_success '"status" after file replacement should be clean with UC=tru
 	git checkout HEAD~ &&
 	status_is_clean &&
 	status_is_clean &&
-	git checkout master &&
+	git checkout main &&
 	avoid_racy &&
 	status_is_clean &&
 	test-tool dump-untracked-cache >../actual &&
@@ -831,7 +831,7 @@ test_expect_success '"status" after file replacement should be clean with UC=fal
 	git checkout HEAD~ &&
 	status_is_clean &&
 	status_is_clean &&
-	git checkout master &&
+	git checkout main &&
 	avoid_racy &&
 	status_is_clean &&
 	status_is_clean
diff --git a/t/t7102-reset.sh b/t/t7102-reset.sh
index 4af43d26f1..7d8fb188ee 100755
--- a/t/t7102-reset.sh
+++ b/t/t7102-reset.sh
@@ -7,7 +7,7 @@ test_description='git reset
 
 Documented tests for git reset'
 
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -148,7 +148,7 @@ test_expect_success 'trying to do reset --soft with pending merge should fail' '
 	printf "1st line 2nd file\n2nd line 2nd file\n3rd line" >secondfile &&
 	git commit -a -m "the change in branch2" &&
 
-	git checkout master &&
+	git checkout main &&
 	git branch -D branch1 branch2 &&
 	check_changes $head5
 '
@@ -170,7 +170,7 @@ test_expect_success 'trying to do reset --soft with pending checkout merge shoul
 	printf "1st line 2nd file\n2nd line 2nd file\n3rd line" >secondfile &&
 	git commit -a -m "the line in branch3" &&
 
-	git checkout master &&
+	git checkout main &&
 	git branch -D branch3 branch4 &&
 	check_changes $head5
 '
@@ -383,7 +383,7 @@ test_expect_success '--hard reset to ORIG_HEAD should clear a fast-forward merge
 	git reset --hard ORIG_HEAD &&
 	check_changes $head5 &&
 
-	git checkout master &&
+	git checkout main &&
 	git branch -D branch1 branch2 &&
 	check_changes $head5
 '
diff --git a/t/t7113-post-index-change-hook.sh b/t/t7113-post-index-change-hook.sh
index 8872c32f94..688fa995c9 100755
--- a/t/t7113-post-index-change-hook.sh
+++ b/t/t7113-post-index-change-hook.sh
@@ -2,7 +2,7 @@
 
 test_description='post index change hook'
 
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -88,7 +88,7 @@ test_expect_success 'test checkout and reset trigger the hook' '
 	EOF
 	: force index to be dirty &&
 	test-tool chmtime +60 dir1/file1.txt &&
-	git checkout master &&
+	git checkout main &&
 	test_path_is_file testsuccess && rm -f testsuccess &&
 	test_path_is_missing testfailure &&
 	test-tool chmtime +60 dir1/file1.txt &&
diff --git a/t/t7201-co.sh b/t/t7201-co.sh
index 12567543c4..daf8678b8a 100755
--- a/t/t7201-co.sh
+++ b/t/t7201-co.sh
@@ -5,10 +5,10 @@
 
 test_description='git checkout tests.
 
-Creates master, forks renamer and side branches from it.
+Creates main, forks renamer and side branches from it.
 Test switching across them.
 
-  ! [master] Initial A one, A two
+  ! [main] Initial A one, A two
    * [renamer] Renamer R one->uno, M two
     ! [side] Side M one, D two, A three
      ! [simple] Simple D one, M two
@@ -16,11 +16,11 @@ Test switching across them.
      + [simple] Simple D one, M two
     +  [side] Side M one, D two, A three
    *   [renamer] Renamer R one->uno, M two
-  +*++ [master] Initial A one, A two
+  +*++ [main] Initial A one, A two
 
 '
 
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -49,27 +49,27 @@ test_expect_success setup '
 	fill a b c d e f >two &&
 	git commit -a -m "Renamer R one->uno, M two" &&
 
-	git checkout -b side master &&
+	git checkout -b side main &&
 	fill 1 2 3 4 5 6 7 >one &&
 	fill A B C D E >three &&
 	rm -f two &&
 	git update-index --add --remove one two three &&
 	git commit -m "Side M one, D two, A three" &&
 
-	git checkout -b simple master &&
+	git checkout -b simple main &&
 	rm -f one &&
 	fill a c e >two &&
 	git commit -a -m "Simple D one, M two" &&
 
-	git checkout master
+	git checkout main
 '
 
 test_expect_success 'checkout from non-existing branch' '
-	git checkout -b delete-me master &&
+	git checkout -b delete-me main &&
 	git update-ref -d --no-deref refs/heads/delete-me &&
 	test refs/heads/delete-me = "$(git symbolic-ref HEAD)" &&
-	git checkout master &&
-	test refs/heads/master = "$(git symbolic-ref HEAD)"
+	git checkout main &&
+	test refs/heads/main = "$(git symbolic-ref HEAD)"
 '
 
 test_expect_success 'checkout with dirty tree without -m' '
@@ -84,7 +84,7 @@ test_expect_success 'checkout with dirty tree without -m' '
 '
 
 test_expect_success 'checkout with unrelated dirty tree without -m' '
-	git checkout -f master &&
+	git checkout -f main &&
 	fill 0 1 2 3 4 5 6 7 8 >same &&
 	cp same kept &&
 	git checkout side >messages &&
@@ -94,7 +94,7 @@ test_expect_success 'checkout with unrelated dirty tree without -m' '
 '
 
 test_expect_success 'checkout -m with dirty tree' '
-	git checkout -f master &&
+	git checkout -f main &&
 	git clean -f &&
 
 	fill 0 1 2 3 4 5 6 7 8 >one &&
@@ -105,9 +105,9 @@ test_expect_success 'checkout -m with dirty tree' '
 	printf "M\t%s\n" one >expect.messages &&
 	test_cmp expect.messages messages &&
 
-	fill "M	one" "A	three" "D	two" >expect.master &&
-	git diff --name-status master >current.master &&
-	test_cmp expect.master current.master &&
+	fill "M	one" "A	three" "D	two" >expect.main &&
+	git diff --name-status main >current.main &&
+	test_cmp expect.main current.main &&
 
 	fill "M	one" >expect.side &&
 	git diff --name-status side >current.side &&
@@ -118,7 +118,7 @@ test_expect_success 'checkout -m with dirty tree' '
 '
 
 test_expect_success 'checkout -m with dirty tree, renamed' '
-	git checkout -f master && git clean -f &&
+	git checkout -f main && git clean -f &&
 
 	fill 1 2 3 4 5 7 8 >one &&
 	if git checkout renamer
@@ -138,7 +138,7 @@ test_expect_success 'checkout -m with dirty tree, renamed' '
 '
 
 test_expect_success 'checkout -m with merge conflict' '
-	git checkout -f master && git clean -f &&
+	git checkout -f main && git clean -f &&
 
 	fill 1 T 3 4 5 6 S 8 >one &&
 	if git checkout renamer
@@ -151,7 +151,7 @@ test_expect_success 'checkout -m with merge conflict' '
 
 	git checkout -m renamer &&
 
-	git diff master:one :3:uno |
+	git diff main:one :3:uno |
 	sed -e "1,/^@@/d" -e "/^ /d" -e "s/^-/d/" -e "s/^+/a/" >current &&
 	fill d2 aT d7 aS >expect &&
 	test_cmp expect current &&
@@ -160,7 +160,7 @@ test_expect_success 'checkout -m with merge conflict' '
 '
 
 test_expect_success 'format of merge conflict from checkout -m' '
-	git checkout -f master &&
+	git checkout -f main &&
 	git clean -f &&
 
 	fill b d >two &&
@@ -184,7 +184,7 @@ test_expect_success 'format of merge conflict from checkout -m' '
 '
 
 test_expect_success 'checkout --merge --conflict=diff3 <branch>' '
-	git checkout -f master &&
+	git checkout -f main &&
 	git reset --hard &&
 	git clean -f &&
 
@@ -196,7 +196,7 @@ test_expect_success 'checkout --merge --conflict=diff3 <branch>' '
 	a
 	c
 	e
-	||||||| master
+	||||||| main
 	a
 	b
 	c
@@ -211,7 +211,7 @@ test_expect_success 'checkout --merge --conflict=diff3 <branch>' '
 '
 
 test_expect_success 'switch to another branch while carrying a deletion' '
-	git checkout -f master &&
+	git checkout -f main &&
 	git reset --hard &&
 	git clean -f &&
 	git rm two &&
@@ -232,7 +232,7 @@ test_expect_success 'checkout to detach HEAD (with advice declined)' '
 	test_i18ngrep "HEAD is now at $rev" messages &&
 	test_line_count = 1 messages &&
 	H=$(git rev-parse --verify HEAD) &&
-	M=$(git show-ref -s --verify refs/heads/master) &&
+	M=$(git show-ref -s --verify refs/heads/main) &&
 	test "z$H" = "z$M" &&
 	if git symbolic-ref HEAD >/dev/null 2>&1
 	then
@@ -252,7 +252,7 @@ test_expect_success 'checkout to detach HEAD' '
 	grep "HEAD is now at $rev" messages &&
 	test_line_count -gt 1 messages &&
 	H=$(git rev-parse --verify HEAD) &&
-	M=$(git show-ref -s --verify refs/heads/master) &&
+	M=$(git show-ref -s --verify refs/heads/main) &&
 	test "z$H" = "z$M" &&
 	if git symbolic-ref HEAD >/dev/null 2>&1
 	then
@@ -264,11 +264,11 @@ test_expect_success 'checkout to detach HEAD' '
 '
 
 test_expect_success 'checkout to detach HEAD with branchname^' '
-	git checkout -f master &&
+	git checkout -f main &&
 	git clean -f &&
 	git checkout renamer^ &&
 	H=$(git rev-parse --verify HEAD) &&
-	M=$(git show-ref -s --verify refs/heads/master) &&
+	M=$(git show-ref -s --verify refs/heads/main) &&
 	test "z$H" = "z$M" &&
 	if git symbolic-ref HEAD >/dev/null 2>&1
 	then
@@ -280,11 +280,11 @@ test_expect_success 'checkout to detach HEAD with branchname^' '
 '
 
 test_expect_success 'checkout to detach HEAD with :/message' '
-	git checkout -f master &&
+	git checkout -f main &&
 	git clean -f &&
 	git checkout ":/Initial" &&
 	H=$(git rev-parse --verify HEAD) &&
-	M=$(git show-ref -s --verify refs/heads/master) &&
+	M=$(git show-ref -s --verify refs/heads/main) &&
 	test "z$H" = "z$M" &&
 	if git symbolic-ref HEAD >/dev/null 2>&1
 	then
@@ -296,11 +296,11 @@ test_expect_success 'checkout to detach HEAD with :/message' '
 '
 
 test_expect_success 'checkout to detach HEAD with HEAD^0' '
-	git checkout -f master &&
+	git checkout -f main &&
 	git clean -f &&
 	git checkout HEAD^0 &&
 	H=$(git rev-parse --verify HEAD) &&
-	M=$(git show-ref -s --verify refs/heads/master) &&
+	M=$(git show-ref -s --verify refs/heads/main) &&
 	test "z$H" = "z$M" &&
 	if git symbolic-ref HEAD >/dev/null 2>&1
 	then
@@ -313,13 +313,13 @@ test_expect_success 'checkout to detach HEAD with HEAD^0' '
 
 test_expect_success 'checkout with ambiguous tag/branch names' '
 	git tag both side &&
-	git branch both master &&
+	git branch both main &&
 	git reset --hard &&
-	git checkout master &&
+	git checkout main &&
 
 	git checkout both &&
 	H=$(git rev-parse --verify HEAD) &&
-	M=$(git show-ref -s --verify refs/heads/master) &&
+	M=$(git show-ref -s --verify refs/heads/main) &&
 	test "z$H" = "z$M" &&
 	name=$(git symbolic-ref HEAD 2>/dev/null) &&
 	test "z$name" = zrefs/heads/both
@@ -327,12 +327,12 @@ test_expect_success 'checkout with ambiguous tag/branch names' '
 
 test_expect_success 'checkout with ambiguous tag/branch names' '
 	git reset --hard &&
-	git checkout master &&
+	git checkout main &&
 
 	git tag frotz side &&
-	git branch frotz master &&
+	git branch frotz main &&
 	git reset --hard &&
-	git checkout master &&
+	git checkout main &&
 
 	git checkout tags/frotz &&
 	H=$(git rev-parse --verify HEAD) &&
@@ -349,7 +349,7 @@ test_expect_success 'checkout with ambiguous tag/branch names' '
 
 test_expect_success 'switch branches while in subdirectory' '
 	git reset --hard &&
-	git checkout master &&
+	git checkout main &&
 
 	mkdir subs &&
 	git -C subs checkout side &&
@@ -365,7 +365,7 @@ test_expect_success 'checkout specific path while in subdirectory' '
 	git add subs/bero &&
 	git commit -m "add subs/bero" &&
 
-	git checkout master &&
+	git checkout main &&
 	mkdir -p subs &&
 	git -C subs checkout side -- bero &&
 	test -f subs/bero
@@ -373,7 +373,7 @@ test_expect_success 'checkout specific path while in subdirectory' '
 
 test_expect_success 'checkout w/--track sets up tracking' '
     git config branch.autosetupmerge false &&
-    git checkout master &&
+    git checkout main &&
     git checkout --track -b track1 &&
     test "$(git config branch.track1.remote)" &&
     test "$(git config branch.track1.merge)"
@@ -382,40 +382,40 @@ test_expect_success 'checkout w/--track sets up tracking' '
 test_expect_success 'checkout w/autosetupmerge=always sets up tracking' '
     test_when_finished git config branch.autosetupmerge false &&
     git config branch.autosetupmerge always &&
-    git checkout master &&
+    git checkout main &&
     git checkout -b track2 &&
     test "$(git config branch.track2.remote)" &&
     test "$(git config branch.track2.merge)"
 '
 
 test_expect_success 'checkout w/--track from non-branch HEAD fails' '
-    git checkout master^0 &&
+    git checkout main^0 &&
     test_must_fail git symbolic-ref HEAD &&
     test_must_fail git checkout --track -b track &&
     test_must_fail git rev-parse --verify track &&
     test_must_fail git symbolic-ref HEAD &&
-    test "z$(git rev-parse master^0)" = "z$(git rev-parse HEAD)"
+    test "z$(git rev-parse main^0)" = "z$(git rev-parse HEAD)"
 '
 
 test_expect_success 'checkout w/--track from tag fails' '
-    git checkout master^0 &&
+    git checkout main^0 &&
     test_must_fail git symbolic-ref HEAD &&
     test_must_fail git checkout --track -b track frotz &&
     test_must_fail git rev-parse --verify track &&
     test_must_fail git symbolic-ref HEAD &&
-    test "z$(git rev-parse master^0)" = "z$(git rev-parse HEAD)"
+    test "z$(git rev-parse main^0)" = "z$(git rev-parse HEAD)"
 '
 
 test_expect_success 'detach a symbolic link HEAD' '
-    git checkout master &&
+    git checkout main &&
     git config --bool core.prefersymlinkrefs yes &&
     git checkout side &&
-    git checkout master &&
+    git checkout main &&
     it=$(git symbolic-ref HEAD) &&
-    test "z$it" = zrefs/heads/master &&
-    here=$(git rev-parse --verify refs/heads/master) &&
+    test "z$it" = zrefs/heads/main &&
+    here=$(git rev-parse --verify refs/heads/main) &&
     git checkout side^ &&
-    test "z$(git rev-parse --verify refs/heads/master)" = "z$here"
+    test "z$(git rev-parse --verify refs/heads/main)" = "z$here"
 '
 
 test_expect_success 'checkout with --track fakes a sensible -b <name>' '
@@ -426,13 +426,13 @@ test_expect_success 'checkout with --track fakes a sensible -b <name>' '
     test "refs/heads/koala/bear" = "$(git symbolic-ref HEAD)" &&
     test "$(git rev-parse HEAD)" = "$(git rev-parse renamer)" &&
 
-    git checkout master && git branch -D koala/bear &&
+    git checkout main && git branch -D koala/bear &&
 
     git checkout --track refs/remotes/origin/koala/bear &&
     test "refs/heads/koala/bear" = "$(git symbolic-ref HEAD)" &&
     test "$(git rev-parse HEAD)" = "$(git rev-parse renamer)" &&
 
-    git checkout master && git branch -D koala/bear &&
+    git checkout main && git branch -D koala/bear &&
 
     git checkout --track remotes/origin/koala/bear &&
     test "refs/heads/koala/bear" = "$(git symbolic-ref HEAD)" &&
@@ -585,17 +585,17 @@ test_expect_success 'checkout --conflict=diff3' '
 '
 
 test_expect_success 'failing checkout -b should not break working tree' '
-	git reset --hard master &&
-	git symbolic-ref HEAD refs/heads/master &&
+	git reset --hard main &&
+	git symbolic-ref HEAD refs/heads/main &&
 	test_must_fail git checkout -b renamer side^ &&
-	test $(git symbolic-ref HEAD) = refs/heads/master &&
+	test $(git symbolic-ref HEAD) = refs/heads/main &&
 	git diff --exit-code &&
 	git diff --cached --exit-code
 '
 
 test_expect_success 'switch out of non-branch' '
-	git reset --hard master &&
-	git checkout master^0 &&
+	git reset --hard main &&
+	git checkout main^0 &&
 	echo modified >one &&
 	test_must_fail git checkout renamer 2>error.log &&
 	! grep "^Previous HEAD" error.log
diff --git a/t/t7400-submodule-basic.sh b/t/t7400-submodule-basic.sh
index 8addc0c8c9..d44f696293 100755
--- a/t/t7400-submodule-basic.sh
+++ b/t/t7400-submodule-basic.sh
@@ -9,7 +9,7 @@ This test tries to verify basic sanity of the init, update and status
 subcommands of git submodule.
 '
 
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -127,7 +127,7 @@ inspect() {
 }
 
 test_expect_success 'submodule add' '
-	echo "refs/heads/master" >expect &&
+	echo "refs/heads/main" >expect &&
 
 	(
 		cd addtest &&
@@ -226,7 +226,7 @@ test_expect_success 'submodule add --branch' '
 	echo "refs/heads/initial" >expect-head &&
 	cat <<-\EOF >expect-heads &&
 	refs/heads/initial
-	refs/heads/master
+	refs/heads/main
 	EOF
 
 	(
@@ -244,7 +244,7 @@ test_expect_success 'submodule add --branch' '
 '
 
 test_expect_success 'submodule add with ./ in path' '
-	echo "refs/heads/master" >expect &&
+	echo "refs/heads/main" >expect &&
 
 	(
 		cd addtest &&
@@ -260,7 +260,7 @@ test_expect_success 'submodule add with ./ in path' '
 '
 
 test_expect_success 'submodule add with /././ in path' '
-	echo "refs/heads/master" >expect &&
+	echo "refs/heads/main" >expect &&
 
 	(
 		cd addtest &&
@@ -276,7 +276,7 @@ test_expect_success 'submodule add with /././ in path' '
 '
 
 test_expect_success 'submodule add with // in path' '
-	echo "refs/heads/master" >expect &&
+	echo "refs/heads/main" >expect &&
 
 	(
 		cd addtest &&
@@ -292,7 +292,7 @@ test_expect_success 'submodule add with // in path' '
 '
 
 test_expect_success 'submodule add with /.. in path' '
-	echo "refs/heads/master" >expect &&
+	echo "refs/heads/main" >expect &&
 
 	(
 		cd addtest &&
@@ -308,7 +308,7 @@ test_expect_success 'submodule add with /.. in path' '
 '
 
 test_expect_success 'submodule add with ./, /.. and // in path' '
-	echo "refs/heads/master" >expect &&
+	echo "refs/heads/main" >expect &&
 
 	(
 		cd addtest &&
@@ -338,7 +338,7 @@ test_expect_success !CYGWIN 'submodule add with \\ in path' '
 '
 
 test_expect_success 'submodule add in subdirectory' '
-	echo "refs/heads/master" >expect &&
+	echo "refs/heads/main" >expect &&
 
 	mkdir addtest/sub &&
 	(
@@ -560,7 +560,7 @@ test_expect_success 'status should be "up-to-date" after update' '
 
 test_expect_success 'checkout superproject with subproject already present' '
 	git checkout initial &&
-	git checkout master
+	git checkout main
 '
 
 test_expect_success 'apply submodule diff' '
@@ -577,7 +577,7 @@ test_expect_success 'apply submodule diff' '
 	git checkout second &&
 	git apply --index P.diff &&
 
-	git diff --cached master >staged &&
+	git diff --cached main >staged &&
 	test_must_be_empty staged
 '
 
diff --git a/t/t7403-submodule-sync.sh b/t/t7403-submodule-sync.sh
index c95559bed5..7d2ac3322b 100755
--- a/t/t7403-submodule-sync.sh
+++ b/t/t7403-submodule-sync.sh
@@ -8,7 +8,7 @@ test_description='git submodule sync
 These tests exercise the "git submodule sync" subcommand.
 '
 
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -81,7 +81,7 @@ test_expect_success 'change submodule url' '
 	(
 		cd super &&
 		cd submodule &&
-		git checkout master &&
+		git checkout main &&
 		git pull
 	) &&
 	mv submodule moved-submodule &&
@@ -115,7 +115,7 @@ test_expect_success '"git submodule sync" should update submodule URLs' '
 	)" &&
 	(
 		cd super-clone/submodule &&
-		git checkout master &&
+		git checkout main &&
 		git pull
 	) &&
 	(
@@ -143,7 +143,7 @@ test_expect_success '"git submodule sync --recursive" should update all submodul
 	)" &&
 	(
 		cd super-clone/submodule/sub-submodule &&
-		git checkout master &&
+		git checkout main &&
 		git pull
 	)
 '
@@ -171,7 +171,7 @@ test_expect_success '"git submodule sync" should update submodule URLs - subdire
 	)" &&
 	(
 		cd super-clone/submodule &&
-		git checkout master &&
+		git checkout main &&
 		git pull
 	) &&
 	(
@@ -202,7 +202,7 @@ test_expect_success '"git submodule sync --recursive" should update all submodul
 	)" &&
 	(
 		cd super-clone/submodule/sub-submodule &&
-		git checkout master &&
+		git checkout main &&
 		git pull
 	)
 '
diff --git a/t/t7406-submodule-update.sh b/t/t7406-submodule-update.sh
index 825b1a7e0c..b9c1624fba 100755
--- a/t/t7406-submodule-update.sh
+++ b/t/t7406-submodule-update.sh
@@ -9,7 +9,7 @@ This test verifies that "git submodule update" detaches the HEAD of the
 submodule and "git submodule update --rebase/--merge" does not detach the HEAD.
 '
 
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -17,10 +17,10 @@ export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 compare_head()
 {
-    sha_master=$(git rev-list --max-count=1 master)
+    sha_main=$(git rev-list --max-count=1 main)
     sha_head=$(git rev-list --max-count=1 HEAD)
 
-    test "$sha_master" = "$sha_head"
+    test "$sha_main" = "$sha_head"
 }
 
 
@@ -265,14 +265,14 @@ test_expect_success 'submodule update --remote should fetch upstream changes wit
 		cd super &&
 		git submodule update --remote --force submodule &&
 		git -C submodule log -1 --oneline >actual &&
-		git -C ../submodule log -1 --oneline master >expect &&
+		git -C ../submodule log -1 --oneline main >expect &&
 		test_cmp expect actual &&
 		git checkout -b test-branch &&
 		git submodule update --remote --force submodule &&
 		git -C submodule log -1 --oneline >actual &&
 		git -C ../submodule log -1 --oneline test-branch >expect &&
 		test_cmp expect actual &&
-		git checkout master &&
+		git checkout main &&
 		git branch -d test-branch &&
 		git reset --hard HEAD^
 	)
@@ -285,7 +285,7 @@ test_expect_success 'local config should override .gitmodules branch' '
 	 git add file &&
 	 test_tick &&
 	 git commit -m "upstream line5" &&
-	 git checkout master
+	 git checkout main
 	) &&
 	(cd super &&
 	 git config submodule.submodule.branch test-branch &&
@@ -295,9 +295,9 @@ test_expect_success 'local config should override .gitmodules branch' '
 	)
 '
 
-test_expect_success 'submodule update --rebase staying on master' '
+test_expect_success 'submodule update --rebase staying on main' '
 	(cd super/submodule &&
-	  git checkout master
+	  git checkout main
 	) &&
 	(cd super &&
 	 (cd submodule &&
@@ -309,7 +309,7 @@ test_expect_success 'submodule update --rebase staying on master' '
 	)
 '
 
-test_expect_success 'submodule update --merge staying on master' '
+test_expect_success 'submodule update --merge staying on main' '
 	(cd super/submodule &&
 	  git reset --hard HEAD~1
 	) &&
@@ -612,7 +612,7 @@ test_expect_success 'submodule update - update=none in .git/config' '
 	(cd super &&
 	 git config submodule.submodule.update none &&
 	 (cd submodule &&
-	  git checkout master &&
+	  git checkout main &&
 	  compare_head
 	 ) &&
 	 git diff --name-only >out &&
@@ -632,7 +632,7 @@ test_expect_success 'submodule update - update=none in .git/config but --checkou
 	(cd super &&
 	 git config submodule.submodule.update none &&
 	 (cd submodule &&
-	  git checkout master &&
+	  git checkout main &&
 	  compare_head
 	 ) &&
 	 git diff --name-only >out &&
@@ -692,7 +692,7 @@ test_expect_success 'submodule update continues after checkout error' '
 test_expect_success 'submodule update continues after recursive checkout error' '
 	(cd super &&
 	 git reset --hard HEAD &&
-	 git checkout master &&
+	 git checkout main &&
 	 git submodule update &&
 	 (cd submodule &&
 	  git submodule add ../submodule subsubmodule &&
@@ -736,7 +736,7 @@ test_expect_success 'submodule update continues after recursive checkout error'
 
 test_expect_success 'submodule update exit immediately in case of merge conflict' '
 	(cd super &&
-	 git checkout master &&
+	 git checkout main &&
 	 git reset --hard HEAD &&
 	 (cd submodule &&
 	  (cd subsubmodule &&
@@ -754,7 +754,7 @@ test_expect_success 'submodule update exit immediately in case of merge conflict
 	 git add submodule2 &&
 	 git commit -m "two_new_submodule_commits" &&
 	 (cd submodule &&
-	  git checkout master &&
+	  git checkout main &&
 	  test_commit "conflict" file &&
 	  echo "conflict" > file
 	 ) &&
@@ -773,7 +773,7 @@ test_expect_success 'submodule update exit immediately in case of merge conflict
 
 test_expect_success 'submodule update exit immediately after recursive rebase error' '
 	(cd super &&
-	 git checkout master &&
+	 git checkout main &&
 	 git reset --hard HEAD &&
 	 (cd submodule &&
 	  git reset --hard HEAD &&
@@ -789,7 +789,7 @@ test_expect_success 'submodule update exit immediately after recursive rebase er
 	 git add submodule2 &&
 	 git commit -m "two_new_submodule_commits" &&
 	 (cd submodule &&
-	  git checkout master &&
+	  git checkout main &&
 	  test_commit "conflict2" file &&
 	  echo "conflict" > file
 	 ) &&
@@ -881,21 +881,21 @@ test_expect_success 'submodule update places git-dir in superprojects git-dir re
 	git clone subsubsuper_update_r subsubsuper_update_r2 &&
 	(cd subsubsuper_update_r2 &&
 	 test_commit "update_subsubsuper" file &&
-	 git push origin master
+	 git push origin main
 	) &&
 	git clone subsuper_update_r subsuper_update_r2 &&
 	(cd subsuper_update_r2 &&
 	 test_commit "update_subsuper" file &&
 	 git submodule add ../subsubsuper_update_r subsubmodule &&
 	 git commit -am "subsubmodule" &&
-	 git push origin master
+	 git push origin main
 	) &&
 	git clone super_update_r super_update_r2 &&
 	(cd super_update_r2 &&
 	 test_commit "update_super" file &&
 	 git submodule add ../subsuper_update_r submodule &&
 	 git commit -am "submodule" &&
-	 git push origin master
+	 git push origin main
 	) &&
 	rm -rf super_update_r2 &&
 	git clone super_update_r super_update_r2 &&
@@ -914,7 +914,7 @@ test_expect_success 'submodule update places git-dir in superprojects git-dir re
 
 test_expect_success 'submodule add properly re-creates deeper level submodules' '
 	(cd super &&
-	 git reset --hard master &&
+	 git reset --hard main &&
 	 rm -rf deeper/ &&
 	 git submodule add --force ../submodule deeper/submodule
 	)
diff --git a/t/t7407-submodule-foreach.sh b/t/t7407-submodule-foreach.sh
index 632defc53b..79981b51eb 100755
--- a/t/t7407-submodule-foreach.sh
+++ b/t/t7407-submodule-foreach.sh
@@ -9,7 +9,7 @@ This test verifies that "git submodule foreach" correctly visits all submodules
 that are currently checked out.
 '
 
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -280,13 +280,13 @@ sub1sha1_short=$(cd clone3/sub1 && git rev-parse --short HEAD)
 sub2sha1_short=$(cd clone3/sub2 && git rev-parse --short HEAD)
 
 cat > expect <<EOF
- $nested1sha1 nested1 (heads/master)
- $nested2sha1 nested1/nested2 (heads/master)
- $nested3sha1 nested1/nested2/nested3 (heads/master)
- $submodulesha1 nested1/nested2/nested3/submodule (heads/master)
+ $nested1sha1 nested1 (heads/main)
+ $nested2sha1 nested1/nested2 (heads/main)
+ $nested3sha1 nested1/nested2/nested3 (heads/main)
+ $submodulesha1 nested1/nested2/nested3/submodule (heads/main)
  $sub1sha1 sub1 ($sub1sha1_short)
  $sub2sha1 sub2 ($sub2sha1_short)
- $sub3sha1 sub3 (heads/master)
+ $sub3sha1 sub3 (heads/main)
 EOF
 
 test_expect_success 'test "status --recursive"' '
@@ -298,10 +298,10 @@ test_expect_success 'test "status --recursive"' '
 '
 
 cat > expect <<EOF
- $nested1sha1 nested1 (heads/master)
+ $nested1sha1 nested1 (heads/main)
 +$nested2sha1 nested1/nested2 (file2~1)
- $nested3sha1 nested1/nested2/nested3 (heads/master)
- $submodulesha1 nested1/nested2/nested3/submodule (heads/master)
+ $nested3sha1 nested1/nested2/nested3 (heads/main)
+ $submodulesha1 nested1/nested2/nested3/submodule (heads/main)
 EOF
 
 test_expect_success 'ensure "status --cached --recursive" preserves the --cached flag' '
@@ -319,13 +319,13 @@ test_expect_success 'ensure "status --cached --recursive" preserves the --cached
 nested2sha1=$(git -C clone3/nested1/nested2 rev-parse HEAD)
 
 cat > expect <<EOF
- $nested1sha1 ../nested1 (heads/master)
+ $nested1sha1 ../nested1 (heads/main)
 +$nested2sha1 ../nested1/nested2 (file2)
- $nested3sha1 ../nested1/nested2/nested3 (heads/master)
- $submodulesha1 ../nested1/nested2/nested3/submodule (heads/master)
+ $nested3sha1 ../nested1/nested2/nested3 (heads/main)
+ $submodulesha1 ../nested1/nested2/nested3/submodule (heads/main)
  $sub1sha1 ../sub1 ($sub1sha1_short)
  $sub2sha1 ../sub2 ($sub2sha1_short)
- $sub3sha1 ../sub3 (heads/master)
+ $sub3sha1 ../sub3 (heads/main)
 EOF
 
 test_expect_success 'test "status --recursive" from sub directory' '
diff --git a/t/t7409-submodule-detached-work-tree.sh b/t/t7409-submodule-detached-work-tree.sh
index e9428e2b59..e17ac81a89 100755
--- a/t/t7409-submodule-detached-work-tree.sh
+++ b/t/t7409-submodule-detached-work-tree.sh
@@ -10,7 +10,7 @@ on detached working trees
 '
 
 TEST_NO_CREATE_REPO=1
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -38,7 +38,7 @@ test_expect_success 'submodule on detached working tree' '
 			git rev-parse --verify HEAD >actual &&
 			test_cmp ../../../../expect actual
 		) &&
-		git push origin master
+		git push origin main
 	) &&
 	mkdir home2 &&
 	(
@@ -47,7 +47,7 @@ test_expect_success 'submodule on detached working tree' '
 		GIT_WORK_TREE="$(pwd)" &&
 		GIT_DIR="$(pwd)/.dotfiles" &&
 		export GIT_WORK_TREE GIT_DIR &&
-		git checkout master &&
+		git checkout main &&
 		git submodule update --init &&
 		(
 			unset GIT_WORK_TREE GIT_DIR &&
@@ -67,10 +67,10 @@ test_expect_success 'submodule on detached working pointed by core.worktree' '
 		git clone --bare ../remote "$GIT_DIR" &&
 		git config core.bare false &&
 		git config core.worktree .. &&
-		git checkout master &&
+		git checkout main &&
 		git submodule add ../bundle1 .vim/bundle/dupe &&
 		test_commit "dupe" &&
-		git push origin master
+		git push origin main
 	) &&
 	(
 		cd home &&
diff --git a/t/t7417-submodule-path-url.sh b/t/t7417-submodule-path-url.sh
index 0a514e951c..f0f6b9fa9e 100755
--- a/t/t7417-submodule-path-url.sh
+++ b/t/t7417-submodule-path-url.sh
@@ -1,7 +1,7 @@
 #!/bin/sh
 
 test_description='check handling of .gitmodule path with dash'
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -39,7 +39,7 @@ test_expect_success MINGW 'submodule paths disallows trailing spaces' '
 	sed "s/sub/sub /" <tree >tree.new &&
 	tree=$(git -C super mktree <tree.new) &&
 	commit=$(echo with space | git -C super commit-tree $tree) &&
-	git -C super update-ref refs/heads/master $commit &&
+	git -C super update-ref refs/heads/main $commit &&
 
 	test_must_fail git clone --recurse-submodules super dst 2>err &&
 	test_i18ngrep "sub " err
-- 
gitgitgadget


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH v3 22/28] t7[5-9]*: adjust the references to the default branch name "main"
  2020-11-18 23:44   ` [PATCH v3 00/28] tests: use main as default branch name Johannes Schindelin via GitGitGadget
                       ` (20 preceding siblings ...)
  2020-11-18 23:44     ` [PATCH v3 21/28] t7[0-4]*: " Johannes Schindelin via GitGitGadget
@ 2020-11-18 23:44     ` Johannes Schindelin via GitGitGadget
  2020-11-18 23:44     ` [PATCH v3 23/28] t8*: " Johannes Schindelin via GitGitGadget
                       ` (6 subsequent siblings)
  28 siblings, 0 replies; 163+ messages in thread
From: Johannes Schindelin via GitGitGadget @ 2020-11-18 23:44 UTC (permalink / raw)
  To: git
  Cc: Felipe Contreras, Ævar Arnfjörð Bjarmason,
	Johannes Schindelin, Jeff King, Jonathan Nieder,
	Johannes Schindelin, Johannes Schindelin

From: Johannes Schindelin <johannes.schindelin@gmx.de>

Excluding t7817, which is added in an unrelated patch series at the time
of writing, this adjusts t7[5-9]*. This trick was performed via

	$ (cd t &&
	   sed -i -e 's/master/main/g' -e 's/MASTER/MAIN/g' \
		-e 's/Master/Main/g' -- t7[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>
---
 t/t7501-commit-basic-functionality.sh         |   4 +-
 t/t7502-commit-porcelain.sh                   |  14 +-
 ...3-pre-commit-and-pre-merge-commit-hooks.sh |  44 ++---
 t/t7504-commit-msg-hook.sh                    |  26 +--
 t/t7505-prepare-commit-msg-hook.sh            |  22 +--
 t/t7508-status.sh                             |  58 +++---
 t/t7510-signed-commit.sh                      |   4 +-
 t/t7512-status-help.sh                        |  42 ++---
 t/t7517-per-repo-email.sh                     |  14 +-
 t/t7600-merge.sh                              |  46 ++---
 t/t7606-merge-custom.sh                       |   2 +-
 t/t7608-merge-messages.sh                     |  38 ++--
 t/t7610-mergetool.sh                          | 176 +++++++++---------
 t/t7611-merge-abort.sh                        |   6 +-
 t/t7612-merge-verify-signatures.sh            |   4 +-
 t/t7614-merge-signoff.sh                      |  26 +--
 t/t7701-repack-unpack-unreachable.sh          |   4 +-
 t/t7800-difftool.sh                           |  40 ++--
 t/t7810-grep.sh                               |  30 +--
 19 files changed, 300 insertions(+), 300 deletions(-)

diff --git a/t/t7501-commit-basic-functionality.sh b/t/t7501-commit-basic-functionality.sh
index 9a1414f31d..0f936182e4 100755
--- a/t/t7501-commit-basic-functionality.sh
+++ b/t/t7501-commit-basic-functionality.sh
@@ -7,7 +7,7 @@
 # signoff
 
 test_description='git commit'
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -606,7 +606,7 @@ test_expect_success 'same tree (merge and amend merge)' '
 	echo zero >zero &&
 	git add zero &&
 	git commit -m "add zero" &&
-	git checkout master &&
+	git checkout main &&
 
 	git merge -s ours side -m "empty ok" &&
 	git diff HEAD^ HEAD >actual &&
diff --git a/t/t7502-commit-porcelain.sh b/t/t7502-commit-porcelain.sh
index c8c16bf1c9..e5332adc9a 100755
--- a/t/t7502-commit-porcelain.sh
+++ b/t/t7502-commit-porcelain.sh
@@ -2,7 +2,7 @@
 
 test_description='git commit porcelain-ish'
 
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -79,7 +79,7 @@ test_expect_success 'output summary format for merges' '
 
 output_tests_cleanup() {
 	# this is needed for "do not fire editor in the presence of conflicts"
-	git checkout master &&
+	git checkout main &&
 
 	# this is needed for the "partial removal" test to pass
 	git rm file1 &&
@@ -443,7 +443,7 @@ test_expect_success 'do not fire editor in the presence of conflicts' '
 	git add g &&
 	git commit -m "add g" &&
 	git branch second &&
-	echo master >g &&
+	echo main >g &&
 	echo g >h &&
 	git add g h &&
 	git commit -m "modify g and add h" &&
@@ -452,7 +452,7 @@ test_expect_success 'do not fire editor in the presence of conflicts' '
 	git add g &&
 	git commit -m second &&
 	# Must fail due to conflict
-	test_must_fail git cherry-pick -n master &&
+	test_must_fail git cherry-pick -n main &&
 	echo "editor not started" >.git/result &&
 	(
 		GIT_EDITOR="\"$(pwd)/.git/FAKE_EDITOR\"" &&
@@ -481,9 +481,9 @@ git reset -q --hard
 
 test_expect_success 'Hand committing of a redundant merge removes dups' '
 
-	git rev-parse second master >expect &&
-	test_must_fail git merge second master &&
-	git checkout master g &&
+	git rev-parse second main >expect &&
+	test_must_fail git merge second main &&
+	git checkout main g &&
 	EDITOR=: git commit -a &&
 	git cat-file commit HEAD >raw &&
 	sed -n -e "s/^parent //p" -e "/^$/q" raw >actual &&
diff --git a/t/t7503-pre-commit-and-pre-merge-commit-hooks.sh b/t/t7503-pre-commit-and-pre-merge-commit-hooks.sh
index 8d3f4ab0d7..606d8d0f08 100755
--- a/t/t7503-pre-commit-and-pre-merge-commit-hooks.sh
+++ b/t/t7503-pre-commit-and-pre-merge-commit-hooks.sh
@@ -2,7 +2,7 @@
 
 test_description='pre-commit and pre-merge-commit hooks'
 
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -47,16 +47,16 @@ test_expect_success 'root commit' '
 	git add foo &&
 	git commit -m "make it non-ff" &&
 	git branch side-orig side &&
-	git checkout master
+	git checkout main
 '
 
 test_expect_success 'setup conflicting branches' '
-	test_when_finished "git checkout master" &&
-	git checkout -b conflicting-a master &&
+	test_when_finished "git checkout main" &&
+	git checkout -b conflicting-a main &&
 	echo a >conflicting &&
 	git add conflicting &&
 	git commit -m conflicting-a &&
-	git checkout -b conflicting-b master &&
+	git checkout -b conflicting-b main &&
 	echo b >conflicting &&
 	git add conflicting &&
 	git commit -m conflicting-b
@@ -74,8 +74,8 @@ test_expect_success 'with no hook (merge)' '
 	test_when_finished "rm -f actual_hooks" &&
 	git branch -f side side-orig &&
 	git checkout side &&
-	git merge -m "merge master" master &&
-	git checkout master &&
+	git merge -m "merge main" main &&
+	git checkout main &&
 	test_path_is_missing actual_hooks
 '
 
@@ -91,8 +91,8 @@ test_expect_success '--no-verify with no hook (merge)' '
 	test_when_finished "rm -f actual_hooks" &&
 	git branch -f side side-orig &&
 	git checkout side &&
-	git merge --no-verify -m "merge master" master &&
-	git checkout master &&
+	git merge --no-verify -m "merge main" main &&
+	git checkout main &&
 	test_path_is_missing actual_hooks
 '
 
@@ -111,15 +111,15 @@ test_expect_success 'with succeeding hook (merge)' '
 	cp "$HOOKDIR/success.sample" "$PREMERGE" &&
 	echo "$PREMERGE" >expected_hooks &&
 	git checkout side &&
-	git merge -m "merge master" master &&
-	git checkout master &&
+	git merge -m "merge main" main &&
+	git checkout main &&
 	test_cmp expected_hooks actual_hooks
 '
 
 test_expect_success 'automatic merge fails; both hooks are available' '
 	test_when_finished "rm -f \"$PREMERGE\" \"$PRECOMMIT\"" &&
 	test_when_finished "rm -f expected_hooks actual_hooks" &&
-	test_when_finished "git checkout master" &&
+	test_when_finished "git checkout main" &&
 	cp "$HOOKDIR/success.sample" "$PREMERGE" &&
 	cp "$HOOKDIR/success.sample" "$PRECOMMIT" &&
 
@@ -148,8 +148,8 @@ test_expect_success '--no-verify with succeeding hook (merge)' '
 	cp "$HOOKDIR/success.sample" "$PREMERGE" &&
 	git branch -f side side-orig &&
 	git checkout side &&
-	git merge --no-verify -m "merge master" master &&
-	git checkout master &&
+	git merge --no-verify -m "merge main" main &&
+	git checkout main &&
 	test_path_is_missing actual_hooks
 '
 
@@ -177,8 +177,8 @@ test_expect_success 'with failing hook (merge)' '
 	cp "$HOOKDIR/fail.sample" "$PREMERGE" &&
 	echo "$PREMERGE" >expected_hooks &&
 	git checkout side &&
-	test_must_fail git merge -m "merge master" master &&
-	git checkout master &&
+	test_must_fail git merge -m "merge main" main &&
+	git checkout main &&
 	test_cmp expected_hooks actual_hooks
 '
 
@@ -187,8 +187,8 @@ test_expect_success '--no-verify with failing hook (merge)' '
 	cp "$HOOKDIR/fail.sample" "$PREMERGE" &&
 	git branch -f side side-orig &&
 	git checkout side &&
-	git merge --no-verify -m "merge master" master &&
-	git checkout master &&
+	git merge --no-verify -m "merge main" main &&
+	git checkout main &&
 	test_path_is_missing actual_hooks
 '
 
@@ -215,8 +215,8 @@ test_expect_success POSIXPERM 'with non-executable hook (merge)' '
 	cp "$HOOKDIR/non-exec.sample" "$PREMERGE" &&
 	git branch -f side side-orig &&
 	git checkout side &&
-	git merge -m "merge master" master &&
-	git checkout master &&
+	git merge -m "merge main" main &&
+	git checkout main &&
 	test_path_is_missing actual_hooks
 '
 
@@ -225,8 +225,8 @@ test_expect_success POSIXPERM '--no-verify with non-executable hook (merge)' '
 	cp "$HOOKDIR/non-exec.sample" "$PREMERGE" &&
 	git branch -f side side-orig &&
 	git checkout side &&
-	git merge --no-verify -m "merge master" master &&
-	git checkout master &&
+	git merge --no-verify -m "merge main" main &&
+	git checkout main &&
 	test_path_is_missing actual_hooks
 '
 
diff --git a/t/t7504-commit-msg-hook.sh b/t/t7504-commit-msg-hook.sh
index 17fb1d8499..4e7592522a 100755
--- a/t/t7504-commit-msg-hook.sh
+++ b/t/t7504-commit-msg-hook.sh
@@ -2,7 +2,7 @@
 
 test_description='commit-msg hook'
 
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -145,12 +145,12 @@ test_expect_success '--no-verify with failing hook (editor)' '
 test_expect_success 'merge fails with failing hook' '
 
 	test_when_finished "git branch -D newbranch" &&
-	test_when_finished "git checkout -f master" &&
+	test_when_finished "git checkout -f main" &&
 	git checkout --orphan newbranch &&
 	: >file2 &&
 	git add file2 &&
 	git commit --no-verify file2 -m in-side-branch &&
-	test_must_fail git merge --allow-unrelated-histories master &&
+	test_must_fail git merge --allow-unrelated-histories main &&
 	commit_msg_is "in-side-branch" # HEAD before merge
 
 '
@@ -158,14 +158,14 @@ test_expect_success 'merge fails with failing hook' '
 test_expect_success 'merge bypasses failing hook with --no-verify' '
 
 	test_when_finished "git branch -D newbranch" &&
-	test_when_finished "git checkout -f master" &&
+	test_when_finished "git checkout -f main" &&
 	git checkout --orphan newbranch &&
 	git rm -f file &&
 	: >file2 &&
 	git add file2 &&
 	git commit --no-verify file2 -m in-side-branch &&
-	git merge --no-verify --allow-unrelated-histories master &&
-	commit_msg_is "Merge branch '\''master'\'' into newbranch"
+	git merge --no-verify --allow-unrelated-histories main &&
+	commit_msg_is "Merge branch '\''main'\'' into newbranch"
 '
 
 
@@ -251,28 +251,28 @@ test_expect_success "hook doesn't edit commit message (editor)" '
 
 test_expect_success 'hook called in git-merge picks up commit message' '
 	test_when_finished "git branch -D newbranch" &&
-	test_when_finished "git checkout -f master" &&
+	test_when_finished "git checkout -f main" &&
 	git checkout --orphan newbranch &&
 	git rm -f file &&
 	: >file2 &&
 	git add file2 &&
 	git commit --no-verify file2 -m in-side-branch &&
-	git merge --allow-unrelated-histories master &&
+	git merge --allow-unrelated-histories main &&
 	commit_msg_is "new message"
 '
 
 test_expect_failure 'merge --continue remembers --no-verify' '
 	test_when_finished "git branch -D newbranch" &&
-	test_when_finished "git checkout -f master" &&
-	git checkout master &&
+	test_when_finished "git checkout -f main" &&
+	git checkout main &&
 	echo a >file2 &&
 	git add file2 &&
-	git commit --no-verify -m "add file2 to master" &&
-	git checkout -b newbranch master^ &&
+	git commit --no-verify -m "add file2 to main" &&
+	git checkout -b newbranch main^ &&
 	echo b >file2 &&
 	git add file2 &&
 	git commit --no-verify file2 -m in-side-branch &&
-	git merge --no-verify -m not-rewritten-by-hook master &&
+	git merge --no-verify -m not-rewritten-by-hook main &&
 	# resolve conflict:
 	echo c >file2 &&
 	git add file2 &&
diff --git a/t/t7505-prepare-commit-msg-hook.sh b/t/t7505-prepare-commit-msg-hook.sh
index 978c90abbb..321b4bc0fc 100755
--- a/t/t7505-prepare-commit-msg-hook.sh
+++ b/t/t7505-prepare-commit-msg-hook.sh
@@ -2,7 +2,7 @@
 
 test_description='prepare-commit-msg hook'
 
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -18,7 +18,7 @@ test_expect_success 'set up commits for rebasing' '
 	do
 		test_commit rebase-$i c $i
 	done &&
-	git checkout master &&
+	git checkout main &&
 
 	cat >rebase-todo <<-EOF
 	pick $(git rev-parse rebase-a)
@@ -193,7 +193,7 @@ test_expect_success 'with hook (-c)' '
 
 test_expect_success 'with hook (merge)' '
 
-	test_when_finished "git checkout -f master" &&
+	test_when_finished "git checkout -f main" &&
 	git checkout -B other HEAD@{1} &&
 	echo "more" >>file &&
 	git add file &&
@@ -205,7 +205,7 @@ test_expect_success 'with hook (merge)' '
 
 test_expect_success 'with hook and editor (merge)' '
 
-	test_when_finished "git checkout -f master" &&
+	test_when_finished "git checkout -f main" &&
 	git checkout -B other HEAD@{1} &&
 	echo "more" >>file &&
 	git add file &&
@@ -221,7 +221,7 @@ test_rebase () {
 	test_expect_$expect C_LOCALE_OUTPUT "with hook (rebase ${mode:--i})" '
 		test_when_finished "\
 			git rebase --abort
-			git checkout -f master
+			git checkout -f main
 			git branch -D tmp" &&
 		git checkout -b tmp rebase-me &&
 		GIT_SEQUENCE_EDITOR="cp rebase-todo" &&
@@ -253,14 +253,14 @@ test_rebase success
 test_have_prereq !REBASE_P || test_rebase success -p
 
 test_expect_success 'with hook (cherry-pick)' '
-	test_when_finished "git checkout -f master" &&
+	test_when_finished "git checkout -f main" &&
 	git checkout -B other b &&
 	git cherry-pick rebase-1 &&
 	test "$(git log -1 --pretty=format:%s)" = "message (no editor)"
 '
 
 test_expect_success 'with hook and editor (cherry-pick)' '
-	test_when_finished "git checkout -f master" &&
+	test_when_finished "git checkout -f main" &&
 	git checkout -B other b &&
 	git cherry-pick -e rebase-1 &&
 	test "$(git log -1 --pretty=format:%s)" = merge
@@ -273,7 +273,7 @@ EOF
 
 test_expect_success 'with failing hook' '
 
-	test_when_finished "git checkout -f master" &&
+	test_when_finished "git checkout -f main" &&
 	head=$(git rev-parse HEAD) &&
 	echo "more" >> file &&
 	git add file &&
@@ -283,7 +283,7 @@ test_expect_success 'with failing hook' '
 
 test_expect_success 'with failing hook (--no-verify)' '
 
-	test_when_finished "git checkout -f master" &&
+	test_when_finished "git checkout -f main" &&
 	head=$(git rev-parse HEAD) &&
 	echo "more" >> file &&
 	git add file &&
@@ -293,7 +293,7 @@ test_expect_success 'with failing hook (--no-verify)' '
 
 test_expect_success 'with failing hook (merge)' '
 
-	test_when_finished "git checkout -f master" &&
+	test_when_finished "git checkout -f main" &&
 	git checkout -B other HEAD@{1} &&
 	echo "more" >> file &&
 	git add file &&
@@ -308,7 +308,7 @@ test_expect_success 'with failing hook (merge)' '
 '
 
 test_expect_success C_LOCALE_OUTPUT 'with failing hook (cherry-pick)' '
-	test_when_finished "git checkout -f master" &&
+	test_when_finished "git checkout -f main" &&
 	git checkout -B other b &&
 	test_must_fail git cherry-pick rebase-1 2>actual &&
 	test $(grep -c prepare-commit-msg actual) = 1
diff --git a/t/t7508-status.sh b/t/t7508-status.sh
index 963fed6821..d01aacb66b 100755
--- a/t/t7508-status.sh
+++ b/t/t7508-status.sh
@@ -37,11 +37,11 @@ test_expect_success 'create upstream branch' '
 	git checkout -b upstream &&
 	test_commit upstream1 &&
 	test_commit upstream2 &&
-	# leave the first commit on master as root because several
+	# leave the first commit on main as root because several
 	# tests depend on this case; for our upstream we only
 	# care about commit counts anyway, so a totally divergent
 	# history is OK
-	git checkout --orphan master
+	git checkout --orphan main
 '
 
 test_expect_success 'setup' '
@@ -88,7 +88,7 @@ EOF
 
 test_expect_success 'status --column' '
 	cat >expect <<\EOF &&
-# On branch master
+# On branch main
 # Your branch and '\''upstream'\'' have diverged,
 # and have 1 and 2 different commits each, respectively.
 #   (use "git pull" to merge the remote branch into yours)
@@ -119,7 +119,7 @@ test_expect_success 'status --column status.displayCommentPrefix=false' '
 '
 
 cat >expect <<\EOF
-# On branch master
+# On branch main
 # Your branch and 'upstream' have diverged,
 # and have 1 and 2 different commits each, respectively.
 #   (use "git pull" to merge the remote branch into yours)
@@ -193,7 +193,7 @@ test_expect_success 'commit ignores status.displayCommentPrefix=false in COMMIT_
 '
 
 cat >expect <<\EOF
-On branch master
+On branch main
 Your branch and 'upstream' have diverged,
 and have 1 and 2 different commits each, respectively.
 
@@ -266,7 +266,7 @@ test_expect_success 'status with gitignore' '
 	test_cmp expect output &&
 
 	cat >expect <<\EOF &&
-On branch master
+On branch main
 Your branch and '\''upstream'\'' have diverged,
 and have 1 and 2 different commits each, respectively.
   (use "git pull" to merge the remote branch into yours)
@@ -331,7 +331,7 @@ test_expect_success 'status with gitignore (nothing untracked)' '
 	test_cmp expect output &&
 
 	cat >expect <<\EOF &&
-On branch master
+On branch main
 Your branch and '\''upstream'\'' have diverged,
 and have 1 and 2 different commits each, respectively.
   (use "git pull" to merge the remote branch into yours)
@@ -368,7 +368,7 @@ output*
 EOF
 
 cat >expect <<\EOF
-## master...upstream [ahead 1, behind 2]
+## main...upstream [ahead 1, behind 2]
  M dir1/modified
 A  dir2/added
 ?? dir1/untracked
@@ -401,7 +401,7 @@ test_expect_success 'setup dir3' '
 
 test_expect_success 'status -uno' '
 	cat >expect <<EOF &&
-On branch master
+On branch main
 Your branch and '\''upstream'\'' have diverged,
 and have 1 and 2 different commits each, respectively.
   (use "git pull" to merge the remote branch into yours)
@@ -429,7 +429,7 @@ test_expect_success 'status (status.showUntrackedFiles no)' '
 
 test_expect_success 'status -uno (advice.statusHints false)' '
 	cat >expect <<EOF &&
-On branch master
+On branch main
 Your branch and '\''upstream'\'' have diverged,
 and have 1 and 2 different commits each, respectively.
 
@@ -463,7 +463,7 @@ test_expect_success 'status -s (status.showUntrackedFiles no)' '
 
 test_expect_success 'status -unormal' '
 	cat >expect <<EOF &&
-On branch master
+On branch main
 Your branch and '\''upstream'\'' have diverged,
 and have 1 and 2 different commits each, respectively.
   (use "git pull" to merge the remote branch into yours)
@@ -518,7 +518,7 @@ test_expect_success 'status -s (status.showUntrackedFiles normal)' '
 
 test_expect_success 'status -uall' '
 	cat >expect <<EOF &&
-On branch master
+On branch main
 Your branch and '\''upstream'\'' have diverged,
 and have 1 and 2 different commits each, respectively.
   (use "git pull" to merge the remote branch into yours)
@@ -578,7 +578,7 @@ test_expect_success 'status -s (status.showUntrackedFiles all)' '
 
 test_expect_success 'status with relative paths' '
 	cat >expect <<\EOF &&
-On branch master
+On branch main
 Your branch and '\''upstream'\'' have diverged,
 and have 1 and 2 different commits each, respectively.
   (use "git pull" to merge the remote branch into yours)
@@ -646,7 +646,7 @@ test_expect_success 'setup unique colors' '
 
 test_expect_success TTY 'status with color.ui' '
 	cat >expect <<\EOF &&
-On branch <GREEN>master<RESET>
+On branch <GREEN>main<RESET>
 Your branch and '\''upstream'\'' have diverged,
 and have 1 and 2 different commits each, respectively.
   (use "git pull" to merge the remote branch into yours)
@@ -706,7 +706,7 @@ test_expect_success TTY 'status -s with color.status' '
 '
 
 cat >expect <<\EOF
-## <YELLOW>master<RESET>...<CYAN>upstream<RESET> [ahead <YELLOW>1<RESET>, behind <CYAN>2<RESET>]
+## <YELLOW>main<RESET>...<CYAN>upstream<RESET> [ahead <YELLOW>1<RESET>, behind <CYAN>2<RESET>]
  <RED>M<RESET> dir1/modified
 <GREEN>A<RESET>  dir2/added
 <BLUE>??<RESET> dir1/untracked
@@ -757,7 +757,7 @@ test_expect_success 'status --porcelain respects -b' '
 
 	git status --porcelain -b >output &&
 	{
-		echo "## master...upstream [ahead 1, behind 2]" &&
+		echo "## main...upstream [ahead 1, behind 2]" &&
 		cat expect
 	} >tmp &&
 	mv tmp expect &&
@@ -769,7 +769,7 @@ test_expect_success 'status --porcelain respects -b' '
 
 test_expect_success 'status without relative paths' '
 	cat >expect <<\EOF &&
-On branch master
+On branch main
 Your branch and '\''upstream'\'' have diverged,
 and have 1 and 2 different commits each, respectively.
   (use "git pull" to merge the remote branch into yours)
@@ -843,7 +843,7 @@ test_expect_success 'status -s without relative paths' '
 
 test_expect_success 'dry-run of partial commit excluding new file in index' '
 	cat >expect <<EOF &&
-On branch master
+On branch main
 Your branch and '\''upstream'\'' have diverged,
 and have 1 and 2 different commits each, respectively.
   (use "git pull" to merge the remote branch into yours)
@@ -897,7 +897,7 @@ test_expect_success 'setup status submodule summary' '
 
 test_expect_success 'status submodule summary is disabled by default' '
 	cat >expect <<EOF &&
-On branch master
+On branch main
 Your branch and '\''upstream'\'' have diverged,
 and have 1 and 2 different commits each, respectively.
   (use "git pull" to merge the remote branch into yours)
@@ -954,7 +954,7 @@ head=$(cd sm && git rev-parse --short=7 --verify HEAD)
 
 test_expect_success 'status submodule summary' '
 	cat >expect <<EOF &&
-On branch master
+On branch main
 Your branch and '\''upstream'\'' have diverged,
 and have 1 and 2 different commits each, respectively.
   (use "git pull" to merge the remote branch into yours)
@@ -1013,7 +1013,7 @@ test_expect_success 'status -s submodule summary' '
 
 test_expect_success 'status submodule summary (clean submodule): commit' '
 	cat >expect <<EOF &&
-On branch master
+On branch main
 Your branch and '\''upstream'\'' have diverged,
 and have 2 and 2 different commits each, respectively.
   (use "git pull" to merge the remote branch into yours)
@@ -1061,7 +1061,7 @@ test_expect_success 'status -z implies porcelain' '
 
 test_expect_success 'commit --dry-run submodule summary (--amend)' '
 	cat >expect <<EOF &&
-On branch master
+On branch main
 Your branch and '\''upstream'\'' have diverged,
 and have 2 and 2 different commits each, respectively.
   (use "git pull" to merge the remote branch into yours)
@@ -1113,7 +1113,7 @@ touch .gitmodules
 
 test_expect_success '--ignore-submodules=untracked suppresses submodules with untracked content' '
 	cat > expect << EOF &&
-On branch master
+On branch main
 Your branch and '\''upstream'\'' have diverged,
 and have 2 and 2 different commits each, respectively.
   (use "git pull" to merge the remote branch into yours)
@@ -1222,7 +1222,7 @@ test_expect_success '.git/config ignore=dirty suppresses submodules with modifie
 
 test_expect_success "--ignore-submodules=untracked doesn't suppress submodules with modified content" '
 	cat > expect << EOF &&
-On branch master
+On branch main
 Your branch and '\''upstream'\'' have diverged,
 and have 2 and 2 different commits each, respectively.
   (use "git pull" to merge the remote branch into yours)
@@ -1279,7 +1279,7 @@ head2=$(cd sm && git commit -q -m "2nd commit" foo && git rev-parse --short=7 --
 
 test_expect_success "--ignore-submodules=untracked doesn't suppress submodule summary" '
 	cat > expect << EOF &&
-On branch master
+On branch main
 Your branch and '\''upstream'\'' have diverged,
 and have 2 and 2 different commits each, respectively.
   (use "git pull" to merge the remote branch into yours)
@@ -1360,7 +1360,7 @@ test_expect_success ".git/config ignore=dirty doesn't suppress submodule summary
 '
 
 cat > expect << EOF
-; On branch master
+; On branch main
 ; Your branch and 'upstream' have diverged,
 ; and have 2 and 2 different commits each, respectively.
 ;   (use "git pull" to merge the remote branch into yours)
@@ -1408,7 +1408,7 @@ test_expect_success "status (core.commentchar with two chars with submodule summ
 
 test_expect_success "--ignore-submodules=all suppresses submodule summary" '
 	cat > expect << EOF &&
-On branch master
+On branch main
 Your branch and '\''upstream'\'' have diverged,
 and have 2 and 2 different commits each, respectively.
   (use "git pull" to merge the remote branch into yours)
@@ -1434,7 +1434,7 @@ EOF
 
 test_expect_success '.gitmodules ignore=all suppresses unstaged submodule summary' '
 	cat > expect << EOF &&
-On branch master
+On branch main
 Your branch and '\''upstream'\'' have diverged,
 and have 2 and 2 different commits each, respectively.
   (use "git pull" to merge the remote branch into yours)
@@ -1554,7 +1554,7 @@ test_expect_success 'git commit --dry-run will show a staged but ignored submodu
 	git reset HEAD^ &&
 	git add sm &&
 	cat >expect << EOF &&
-On branch master
+On branch main
 Your branch and '\''upstream'\'' have diverged,
 and have 2 and 2 different commits each, respectively.
   (use "git pull" to merge the remote branch into yours)
diff --git a/t/t7510-signed-commit.sh b/t/t7510-signed-commit.sh
index a5a36cab85..f4bf925bdd 100755
--- a/t/t7510-signed-commit.sh
+++ b/t/t7510-signed-commit.sh
@@ -1,7 +1,7 @@
 #!/bin/sh
 
 test_description='signed commit tests'
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -28,7 +28,7 @@ test_expect_success GPG 'create signed commits' '
 	echo 3 >elif && git add elif &&
 	test_tick && git commit -m "third on side" &&
 
-	git checkout master &&
+	git checkout main &&
 	test_tick && git merge -S side &&
 	git tag merge &&
 
diff --git a/t/t7512-status-help.sh b/t/t7512-status-help.sh
index fbd760f7e6..9f5e3ce793 100755
--- a/t/t7512-status-help.sh
+++ b/t/t7512-status-help.sh
@@ -7,7 +7,7 @@
 
 test_description='git status advice'
 
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -20,14 +20,14 @@ test_expect_success 'prepare for conflicts' '
 	git config --global advice.statusuoption false &&
 	test_commit init main.txt init &&
 	git branch conflicts &&
-	test_commit on_master main.txt on_master &&
+	test_commit on_main main.txt on_main &&
 	git checkout conflicts &&
 	test_commit on_conflicts main.txt on_conflicts
 '
 
 
 test_expect_success 'status when conflicts unresolved' '
-	test_must_fail git merge master &&
+	test_must_fail git merge main &&
 	cat >expected <<\EOF &&
 On branch conflicts
 You have unmerged paths.
@@ -47,7 +47,7 @@ EOF
 
 test_expect_success 'status when conflicts resolved before commit' '
 	git reset --hard conflicts &&
-	test_must_fail git merge master &&
+	test_must_fail git merge main &&
 	echo one >main.txt &&
 	git add main.txt &&
 	cat >expected <<\EOF &&
@@ -66,7 +66,7 @@ EOF
 
 
 test_expect_success 'prepare for rebase conflicts' '
-	git reset --hard master &&
+	git reset --hard main &&
 	git checkout -b rebase_conflicts &&
 	test_commit one_rebase main.txt one &&
 	test_commit two_rebase main.txt two &&
@@ -121,11 +121,11 @@ EOF
 
 
 test_expect_success 'prepare for rebase_i_conflicts' '
-	git reset --hard master &&
+	git reset --hard main &&
 	git checkout -b rebase_i_conflicts &&
 	test_commit one_unmerge main.txt one_unmerge &&
 	git branch rebase_i_conflicts_second &&
-	test_commit one_master main.txt one_master &&
+	test_commit one_main main.txt one_main &&
 	git checkout rebase_i_conflicts_second &&
 	test_commit one_second main.txt one_second
 '
@@ -185,7 +185,7 @@ EOF
 
 
 test_expect_success 'status when rebasing -i in edit mode' '
-	git reset --hard master &&
+	git reset --hard main &&
 	git checkout -b rebase_i_edit &&
 	test_commit one_rebase_i main.txt one &&
 	test_commit two_rebase_i main.txt two &&
@@ -215,7 +215,7 @@ EOF
 
 
 test_expect_success 'status when splitting a commit' '
-	git reset --hard master &&
+	git reset --hard main &&
 	git checkout -b split_commit &&
 	test_commit one_split main.txt one &&
 	test_commit two_split main.txt two &&
@@ -254,7 +254,7 @@ EOF
 
 
 test_expect_success 'status after editing the last commit with --amend during a rebase -i' '
-	git reset --hard master &&
+	git reset --hard main &&
 	git checkout -b amend_last &&
 	test_commit one_amend main.txt one &&
 	test_commit two_amend main.txt two &&
@@ -287,7 +287,7 @@ EOF
 
 
 test_expect_success 'prepare for several edits' '
-	git reset --hard master &&
+	git reset --hard main &&
 	git checkout -b several_edits &&
 	test_commit one_edits main.txt one &&
 	test_commit two_edits main.txt two &&
@@ -596,7 +596,7 @@ EOF
 
 
 test_expect_success 'prepare am_session' '
-	git reset --hard master &&
+	git reset --hard main &&
 	git checkout -b am_session &&
 	test_commit one_am one.txt "one" &&
 	test_commit two_am two.txt "two" &&
@@ -669,7 +669,7 @@ EOF
 
 
 test_expect_success 'status when bisecting' '
-	git reset --hard master &&
+	git reset --hard main &&
 	git checkout -b bisect &&
 	test_commit one_bisect main.txt one &&
 	test_commit two_bisect main.txt two &&
@@ -692,7 +692,7 @@ EOF
 
 
 test_expect_success 'status when rebase --apply conflicts with statushints disabled' '
-	git reset --hard master &&
+	git reset --hard main &&
 	git checkout -b statushints_disabled &&
 	test_when_finished "git config --local advice.statushints true" &&
 	git config --local advice.statushints false &&
@@ -717,7 +717,7 @@ EOF
 
 
 test_expect_success 'prepare for cherry-pick conflicts' '
-	git reset --hard master &&
+	git reset --hard main &&
 	git checkout -b cherry_branch &&
 	test_commit one_cherry main.txt one &&
 	test_commit two_cherries main.txt two &&
@@ -828,7 +828,7 @@ EOF
 '
 
 test_expect_success 'status while reverting commit (conflicts)' '
-	git checkout master &&
+	git checkout main &&
 	echo before >to-revert.txt &&
 	test_commit before to-revert.txt &&
 	echo old >to-revert.txt &&
@@ -838,7 +838,7 @@ test_expect_success 'status while reverting commit (conflicts)' '
 	TO_REVERT=$(git rev-parse --short HEAD^) &&
 	test_must_fail git revert $TO_REVERT &&
 	cat >expected <<EOF &&
-On branch master
+On branch main
 You are currently reverting commit $TO_REVERT.
   (fix conflicts and run "git revert --continue")
   (use "git revert --skip" to skip this patch)
@@ -859,7 +859,7 @@ test_expect_success 'status while reverting commit (conflicts resolved)' '
 	echo reverted >to-revert.txt &&
 	git add to-revert.txt &&
 	cat >expected <<EOF &&
-On branch master
+On branch main
 You are currently reverting commit $TO_REVERT.
   (all conflicts fixed: run "git revert --continue")
   (use "git revert --skip" to skip this patch)
@@ -878,7 +878,7 @@ EOF
 test_expect_success 'status after reverting commit' '
 	git revert --continue &&
 	cat >expected <<\EOF &&
-On branch master
+On branch main
 nothing to commit (use -u to show untracked files)
 EOF
 	git status --untracked-files=no >actual &&
@@ -892,7 +892,7 @@ test_expect_success 'status while reverting after committing conflict resolution
 	echo reverted >to-revert.txt &&
 	git commit -a &&
 	cat >expected <<EOF &&
-On branch master
+On branch main
 Revert currently in progress.
   (run "git revert --continue" to continue)
   (use "git revert --skip" to skip this patch)
@@ -905,7 +905,7 @@ EOF
 '
 
 test_expect_success 'prepare for different number of commits rebased' '
-	git reset --hard master &&
+	git reset --hard main &&
 	git checkout -b several_commits &&
 	test_commit one_commit main.txt one &&
 	test_commit two_commit main.txt two &&
diff --git a/t/t7517-per-repo-email.sh b/t/t7517-per-repo-email.sh
index 344d72a5c0..405420ae4d 100755
--- a/t/t7517-per-repo-email.sh
+++ b/t/t7517-per-repo-email.sh
@@ -6,7 +6,7 @@
 
 test_description='per-repo forced setting of email address'
 
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -50,24 +50,24 @@ test_expect_success 'set up rebase scenarios' '
 
 test_expect_success 'fast-forward rebase does not care about ident' '
 	git checkout -B tmp side-without-commit &&
-	git rebase master
+	git rebase main
 '
 
 test_expect_success 'non-fast-forward rebase refuses to write commits' '
 	test_when_finished "git rebase --abort || true" &&
 	git checkout -B tmp side-with-commit &&
-	test_must_fail git rebase master
+	test_must_fail git rebase main
 '
 
 test_expect_success 'fast-forward rebase does not care about ident (interactive)' '
 	git checkout -B tmp side-without-commit &&
-	git rebase -i master
+	git rebase -i main
 '
 
 test_expect_success 'non-fast-forward rebase refuses to write commits (interactive)' '
 	test_when_finished "git rebase --abort || true" &&
 	git checkout -B tmp side-with-commit &&
-	test_must_fail git rebase -i master
+	test_must_fail git rebase -i main
 '
 
 test_expect_success 'noop interactive rebase does not care about ident' '
@@ -78,14 +78,14 @@ test_expect_success 'noop interactive rebase does not care about ident' '
 test_expect_success REBASE_P \
 	'fast-forward rebase does not care about ident (preserve)' '
 	git checkout -B tmp side-without-commit &&
-	git rebase -p master
+	git rebase -p main
 '
 
 test_expect_success REBASE_P \
 	'non-fast-forward rebase refuses to write commits (preserve)' '
 	test_when_finished "git rebase --abort || true" &&
 	git checkout -B tmp side-with-commit &&
-	test_must_fail git rebase -p master
+	test_must_fail git rebase -p main
 '
 
 test_expect_success 'author.name overrides user.name' '
diff --git a/t/t7600-merge.sh b/t/t7600-merge.sh
index 0ad866c08c..b2c1d861dc 100755
--- a/t/t7600-merge.sh
+++ b/t/t7600-merge.sh
@@ -14,9 +14,9 @@ Testing basic merge operations/option parsing.
     ! [c4] c4
      ! [c5] c5
       ! [c6] c6
-       * [master] Merge commit 'c1'
+       * [main] Merge commit 'c1'
 --------
-       - [master] Merge commit 'c1'
+       - [main] Merge commit 'c1'
  +     * [c1] commit 1
       +  [c6] c6
      +   [c5] c5
@@ -26,7 +26,7 @@ Testing basic merge operations/option parsing.
 +++++++* [c0] commit 0
 '
 
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -206,13 +206,13 @@ test_expect_success 'merge c0 with c1 with --ff-only' '
 test_debug 'git log --graph --decorate --oneline --all'
 
 test_expect_success 'merge from unborn branch' '
-	git checkout -f master &&
+	git checkout -f main &&
 	test_might_fail git branch -D kid &&
 
 	echo "OBJID HEAD@{0}: initial pull" >reflog.expected &&
 
 	git checkout --orphan kid &&
-	test_when_finished "git checkout -f master" &&
+	test_when_finished "git checkout -f main" &&
 	git rm -fr . &&
 	test_tick &&
 	git merge --ff-only c1 &&
@@ -416,7 +416,7 @@ test_debug 'git log --graph --decorate --oneline --all'
 
 test_expect_success 'merge c1 with c2 (no-commit in config)' '
 	git reset --hard c1 &&
-	test_config branch.master.mergeoptions "--no-commit" &&
+	test_config branch.main.mergeoptions "--no-commit" &&
 	git merge c2 &&
 	verify_merge file result.1-5 &&
 	verify_head $c1 &&
@@ -430,7 +430,7 @@ test_expect_success 'merge c1 with c2 (log in config)' '
 	git merge --log c2 &&
 	git show -s --pretty=tformat:%s%n%b >expect &&
 
-	test_config branch.master.mergeoptions "--log" &&
+	test_config branch.main.mergeoptions "--log" &&
 	git reset --hard c1 &&
 	git merge c2 &&
 	git show -s --pretty=tformat:%s%n%b >actual &&
@@ -443,7 +443,7 @@ test_expect_success 'merge c1 with c2 (log in config gets overridden)' '
 	git merge c2 &&
 	git show -s --pretty=tformat:%s%n%b >expect &&
 
-	test_config branch.master.mergeoptions "--no-log" &&
+	test_config branch.main.mergeoptions "--no-log" &&
 	test_config merge.log "true" &&
 	git reset --hard c1 &&
 	git merge c2 &&
@@ -454,7 +454,7 @@ test_expect_success 'merge c1 with c2 (log in config gets overridden)' '
 
 test_expect_success 'merge c1 with c2 (squash in config)' '
 	git reset --hard c1 &&
-	test_config branch.master.mergeoptions "--squash" &&
+	test_config branch.main.mergeoptions "--squash" &&
 	git merge c2 &&
 	verify_merge file result.1-5 &&
 	verify_head $c1 &&
@@ -466,7 +466,7 @@ test_debug 'git log --graph --decorate --oneline --all'
 
 test_expect_success 'override config option -n with --summary' '
 	git reset --hard c1 &&
-	test_config branch.master.mergeoptions "-n" &&
+	test_config branch.main.mergeoptions "-n" &&
 	test_tick &&
 	git merge --summary c2 >diffstat.txt &&
 	verify_merge file result.1-5 msg.1-5 &&
@@ -480,7 +480,7 @@ test_expect_success 'override config option -n with --summary' '
 
 test_expect_success 'override config option -n with --stat' '
 	git reset --hard c1 &&
-	test_config branch.master.mergeoptions "-n" &&
+	test_config branch.main.mergeoptions "-n" &&
 	test_tick &&
 	git merge --stat c2 >diffstat.txt &&
 	verify_merge file result.1-5 msg.1-5 &&
@@ -496,7 +496,7 @@ test_debug 'git log --graph --decorate --oneline --all'
 
 test_expect_success 'override config option --stat' '
 	git reset --hard c1 &&
-	test_config branch.master.mergeoptions "--stat" &&
+	test_config branch.main.mergeoptions "--stat" &&
 	test_tick &&
 	git merge -n c2 >diffstat.txt &&
 	verify_merge file result.1-5 msg.1-5 &&
@@ -512,7 +512,7 @@ test_debug 'git log --graph --decorate --oneline --all'
 
 test_expect_success 'merge c1 with c2 (override --no-commit)' '
 	git reset --hard c1 &&
-	test_config branch.master.mergeoptions "--no-commit" &&
+	test_config branch.main.mergeoptions "--no-commit" &&
 	test_tick &&
 	git merge --commit c2 &&
 	verify_merge file result.1-5 msg.1-5 &&
@@ -523,7 +523,7 @@ test_debug 'git log --graph --decorate --oneline --all'
 
 test_expect_success 'merge c1 with c2 (override --squash)' '
 	git reset --hard c1 &&
-	test_config branch.master.mergeoptions "--squash" &&
+	test_config branch.main.mergeoptions "--squash" &&
 	test_tick &&
 	git merge --no-squash c2 &&
 	verify_merge file result.1-5 msg.1-5 &&
@@ -552,9 +552,9 @@ test_expect_success 'merge c0 with c1 (merge.ff=false)' '
 '
 test_debug 'git log --graph --decorate --oneline --all'
 
-test_expect_success 'combine branch.master.mergeoptions with merge.ff' '
+test_expect_success 'combine branch.main.mergeoptions with merge.ff' '
 	git reset --hard c0 &&
-	test_config branch.master.mergeoptions "--ff" &&
+	test_config branch.main.mergeoptions "--ff" &&
 	test_config merge.ff "false" &&
 	test_tick &&
 	git merge c1 &&
@@ -596,7 +596,7 @@ test_expect_success 'option --no-ff overrides merge.ff=only config' '
 
 test_expect_success 'merge c0 with c1 (ff overrides no-ff)' '
 	git reset --hard c0 &&
-	test_config branch.master.mergeoptions "--no-ff" &&
+	test_config branch.main.mergeoptions "--no-ff" &&
 	git merge --ff c1 &&
 	verify_merge file result.1 &&
 	verify_head $c1
@@ -609,7 +609,7 @@ test_expect_success 'merge log message' '
 	test_must_be_empty msg.act &&
 
 	git reset --hard c0 &&
-	test_config branch.master.mergeoptions "--no-ff" &&
+	test_config branch.main.mergeoptions "--no-ff" &&
 	git merge --no-log c2 &&
 	git show -s --pretty=format:%b HEAD >msg.act &&
 	test_must_be_empty msg.act &&
@@ -953,10 +953,10 @@ test_expect_success 'set up mod-256 conflict scenario' '
 	git add file &&
 	git commit -m base &&
 
-	# one side changes the first line of each to "master"
-	sed s/-1/-master/ file >tmp &&
+	# one side changes the first line of each to "main"
+	sed s/-1/-main/ file >tmp &&
 	mv tmp file &&
-	git commit -am master &&
+	git commit -am main &&
 
 	# and the other to "side"; merging the two will
 	# yield 256 separate conflicts
@@ -968,12 +968,12 @@ test_expect_success 'set up mod-256 conflict scenario' '
 
 test_expect_success 'merge detects mod-256 conflicts (recursive)' '
 	git reset --hard &&
-	test_must_fail git merge -s recursive master
+	test_must_fail git merge -s recursive main
 '
 
 test_expect_success 'merge detects mod-256 conflicts (resolve)' '
 	git reset --hard &&
-	test_must_fail git merge -s resolve master
+	test_must_fail git merge -s resolve main
 '
 
 test_expect_success 'merge nothing into void' '
diff --git a/t/t7606-merge-custom.sh b/t/t7606-merge-custom.sh
index 8e8c4d7246..81fb7c474c 100755
--- a/t/t7606-merge-custom.sh
+++ b/t/t7606-merge-custom.sh
@@ -4,7 +4,7 @@ test_description="git merge
 
 Testing a custom strategy.
 
-*   (HEAD, master) Merge commit 'c3'
+*   (HEAD, main) Merge commit 'c3'
 |\
 | * (tag: c3) c3
 * | (tag: c1) c1
diff --git a/t/t7608-merge-messages.sh b/t/t7608-merge-messages.sh
index 7059c2a54b..0b908ab2e7 100755
--- a/t/t7608-merge-messages.sh
+++ b/t/t7608-merge-messages.sh
@@ -1,7 +1,7 @@
 #!/bin/sh
 
 test_description='test auto-generated merge messages'
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -13,51 +13,51 @@ check_oneline() {
 }
 
 test_expect_success 'merge local branch' '
-	test_commit master-1 &&
+	test_commit main-1 &&
 	git checkout -b local-branch &&
 	test_commit branch-1 &&
-	git checkout master &&
-	test_commit master-2 &&
+	git checkout main &&
+	test_commit main-2 &&
 	git merge local-branch &&
 	check_oneline "Merge branch Qlocal-branchQ"
 '
 
 test_expect_success 'merge octopus branches' '
-	git checkout -b octopus-a master &&
+	git checkout -b octopus-a main &&
 	test_commit octopus-1 &&
-	git checkout -b octopus-b master &&
+	git checkout -b octopus-b main &&
 	test_commit octopus-2 &&
-	git checkout master &&
+	git checkout main &&
 	git merge octopus-a octopus-b &&
 	check_oneline "Merge branches Qoctopus-aQ and Qoctopus-bQ"
 '
 
 test_expect_success 'merge tag' '
-	git checkout -b tag-branch master &&
+	git checkout -b tag-branch main &&
 	test_commit tag-1 &&
-	git checkout master &&
-	test_commit master-3 &&
+	git checkout main &&
+	test_commit main-3 &&
 	git merge tag-1 &&
 	check_oneline "Merge tag Qtag-1Q"
 '
 
 test_expect_success 'ambiguous tag' '
-	git checkout -b ambiguous master &&
+	git checkout -b ambiguous main &&
 	test_commit ambiguous &&
-	git checkout master &&
-	test_commit master-4 &&
+	git checkout main &&
+	test_commit main-4 &&
 	git merge ambiguous &&
 	check_oneline "Merge tag QambiguousQ"
 '
 
 test_expect_success 'remote-tracking branch' '
-	git checkout -b remote master &&
+	git checkout -b remote main &&
 	test_commit remote-1 &&
-	git update-ref refs/remotes/origin/master remote &&
-	git checkout master &&
-	test_commit master-5 &&
-	git merge origin/master &&
-	check_oneline "Merge remote-tracking branch Qorigin/masterQ"
+	git update-ref refs/remotes/origin/main remote &&
+	git checkout main &&
+	test_commit main-5 &&
+	git merge origin/main &&
+	check_oneline "Merge remote-tracking branch Qorigin/mainQ"
 '
 
 test_done
diff --git a/t/t7610-mergetool.sh b/t/t7610-mergetool.sh
index e65645d5e9..a1c9552f17 100755
--- a/t/t7610-mergetool.sh
+++ b/t/t7610-mergetool.sh
@@ -7,25 +7,25 @@ test_description='git mergetool
 
 Testing basic merge tool invocation'
 
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
 
 # All the mergetool test work by checking out a temporary branch based
-# off 'branch1' and then merging in master and checking the results of
+# off 'branch1' and then merging in main and checking the results of
 # running mergetool
 
 test_expect_success 'setup' '
 	test_config rerere.enabled true &&
-	echo master >file1 &&
-	echo master spaced >"spaced name" &&
-	echo master file11 >file11 &&
-	echo master file12 >file12 &&
-	echo master file13 >file13 &&
-	echo master file14 >file14 &&
+	echo main >file1 &&
+	echo main spaced >"spaced name" &&
+	echo main file11 >file11 &&
+	echo main file12 >file12 &&
+	echo main file13 >file13 &&
+	echo main file14 >file14 &&
 	mkdir subdir &&
-	echo master sub >subdir/file3 &&
+	echo main sub >subdir/file3 &&
 	test_create_repo submod &&
 	(
 		cd submod &&
@@ -37,7 +37,7 @@ test_expect_success 'setup' '
 	git add file1 "spaced name" file1[1-4] subdir/file3 .gitmodules submod &&
 	git commit -m "add initial versions" &&
 
-	git checkout -b branch1 master &&
+	git checkout -b branch1 main &&
 	git submodule update -N &&
 	echo branch1 change >file1 &&
 	echo branch1 newfile >file2 &&
@@ -74,39 +74,39 @@ test_expect_success 'setup' '
 	test_write_lines one two 3 >c/c/file.txt &&
 	git commit -a -m"move to c" &&
 
-	git checkout -b stash1 master &&
+	git checkout -b stash1 main &&
 	echo stash1 change file11 >file11 &&
 	git add file11 &&
 	git commit -m "stash1 changes" &&
 
-	git checkout -b stash2 master &&
+	git checkout -b stash2 main &&
 	echo stash2 change file11 >file11 &&
 	git add file11 &&
 	git commit -m "stash2 changes" &&
 
-	git checkout master &&
+	git checkout main &&
 	git submodule update -N &&
-	echo master updated >file1 &&
-	echo master new >file2 &&
-	echo master updated spaced >"spaced name" &&
-	echo master both added >both &&
-	echo master updated file12 >file12 &&
-	echo master updated file14 >file14 &&
-	echo master new sub >subdir/file3 &&
+	echo main updated >file1 &&
+	echo main new >file2 &&
+	echo main updated spaced >"spaced name" &&
+	echo main both added >both &&
+	echo main updated file12 >file12 &&
+	echo main updated file14 >file14 &&
+	echo main new sub >subdir/file3 &&
 	(
 		cd submod &&
-		echo master submodule >bar &&
+		echo main submodule >bar &&
 		git add bar &&
-		git commit -m "Add bar on master" &&
-		git checkout -b submod-master
+		git commit -m "Add bar on main" &&
+		git checkout -b submod-main
 	) &&
 	git add file1 "spaced name" file12 file14 file2 subdir/file3 submod &&
 	git add both &&
 	git rm file11 &&
-	git commit -m "master updates" &&
+	git commit -m "main updates" &&
 
 	git clean -fdx &&
-	git checkout -b order-file-start master &&
+	git checkout -b order-file-start main &&
 	echo start >a &&
 	echo start >b &&
 	git add a b &&
@@ -133,7 +133,7 @@ test_expect_success 'custom mergetool' '
 	test_when_finished "git reset --hard" &&
 	git checkout -b test$test_count branch1 &&
 	git submodule update -N &&
-	test_must_fail git merge master &&
+	test_must_fail git merge main &&
 	yes "" | git mergetool both &&
 	yes "" | git mergetool file1 file1 &&
 	yes "" | git mergetool file2 "spaced name" &&
@@ -141,11 +141,11 @@ test_expect_success 'custom mergetool' '
 	yes "d" | git mergetool file11 &&
 	yes "d" | git mergetool file12 &&
 	yes "l" | git mergetool submod &&
-	echo "master updated" >expect &&
+	echo "main updated" >expect &&
 	test_cmp expect file1 &&
-	echo "master new" >expect &&
+	echo "main new" >expect &&
 	test_cmp expect file2 &&
-	echo "master new sub" >expect &&
+	echo "main new sub" >expect &&
 	test_cmp expect subdir/file3 &&
 	echo "branch1 submodule" >expect &&
 	test_cmp expect submod/bar &&
@@ -159,7 +159,7 @@ test_expect_success 'gui mergetool' '
 	test_when_finished "git reset --hard" &&
 	git checkout -b test$test_count branch1 &&
 	git submodule update -N &&
-	test_must_fail git merge master &&
+	test_must_fail git merge main &&
 	yes "" | git mergetool --gui both &&
 	yes "" | git mergetool -g file1 file1 &&
 	yes "" | git mergetool --gui file2 "spaced name" &&
@@ -167,11 +167,11 @@ test_expect_success 'gui mergetool' '
 	yes "d" | git mergetool --gui file11 &&
 	yes "d" | git mergetool --gui file12 &&
 	yes "l" | git mergetool --gui submod &&
-	echo "gui master updated" >expect &&
+	echo "gui main updated" >expect &&
 	test_cmp expect file1 &&
-	echo "gui master new" >expect &&
+	echo "gui main new" >expect &&
 	test_cmp expect file2 &&
-	echo "gui master new sub" >expect &&
+	echo "gui main new sub" >expect &&
 	test_cmp expect subdir/file3 &&
 	echo "branch1 submodule" >expect &&
 	test_cmp expect submod/bar &&
@@ -182,7 +182,7 @@ test_expect_success 'gui mergetool without merge.guitool set falls back to merge
 	test_when_finished "git reset --hard" &&
 	git checkout -b test$test_count branch1 &&
 	git submodule update -N &&
-	test_must_fail git merge master &&
+	test_must_fail git merge main &&
 	yes "" | git mergetool --gui both &&
 	yes "" | git mergetool -g file1 file1 &&
 	yes "" | git mergetool --gui file2 "spaced name" &&
@@ -190,11 +190,11 @@ test_expect_success 'gui mergetool without merge.guitool set falls back to merge
 	yes "d" | git mergetool --gui file11 &&
 	yes "d" | git mergetool --gui file12 &&
 	yes "l" | git mergetool --gui submod &&
-	echo "master updated" >expect &&
+	echo "main updated" >expect &&
 	test_cmp expect file1 &&
-	echo "master new" >expect &&
+	echo "main new" >expect &&
 	test_cmp expect file2 &&
-	echo "master new sub" >expect &&
+	echo "main new sub" >expect &&
 	test_cmp expect subdir/file3 &&
 	echo "branch1 submodule" >expect &&
 	test_cmp expect submod/bar &&
@@ -209,7 +209,7 @@ test_expect_success 'mergetool crlf' '
 	# test_when_finished is LIFO.)
 	test_config core.autocrlf true &&
 	git checkout -b test$test_count branch1 &&
-	test_must_fail git merge master &&
+	test_must_fail git merge main &&
 	yes "" | git mergetool file1 &&
 	yes "" | git mergetool file2 &&
 	yes "" | git mergetool "spaced name" &&
@@ -218,11 +218,11 @@ test_expect_success 'mergetool crlf' '
 	yes "d" | git mergetool file11 &&
 	yes "d" | git mergetool file12 &&
 	yes "r" | git mergetool submod &&
-	test "$(printf x | cat file1 -)" = "$(printf "master updated\r\nx")" &&
-	test "$(printf x | cat file2 -)" = "$(printf "master new\r\nx")" &&
-	test "$(printf x | cat subdir/file3 -)" = "$(printf "master new sub\r\nx")" &&
+	test "$(printf x | cat file1 -)" = "$(printf "main updated\r\nx")" &&
+	test "$(printf x | cat file2 -)" = "$(printf "main new\r\nx")" &&
+	test "$(printf x | cat subdir/file3 -)" = "$(printf "main new sub\r\nx")" &&
 	git submodule update -N &&
-	echo "master submodule" >expect &&
+	echo "main submodule" >expect &&
 	test_cmp expect submod/bar &&
 	git commit -m "branch1 resolved with mergetool - autocrlf"
 '
@@ -233,9 +233,9 @@ test_expect_success 'mergetool in subdir' '
 	git submodule update -N &&
 	(
 		cd subdir &&
-		test_must_fail git merge master &&
+		test_must_fail git merge main &&
 		yes "" | git mergetool file3 &&
-		echo "master new sub" >expect &&
+		echo "main new sub" >expect &&
 		test_cmp expect file3
 	)
 '
@@ -246,7 +246,7 @@ test_expect_success 'mergetool on file in parent dir' '
 	git submodule update -N &&
 	(
 		cd subdir &&
-		test_must_fail git merge master &&
+		test_must_fail git merge main &&
 		yes "" | git mergetool file3 &&
 		yes "" | git mergetool ../file1 &&
 		yes "" | git mergetool ../file2 ../spaced\ name &&
@@ -254,9 +254,9 @@ test_expect_success 'mergetool on file in parent dir' '
 		yes "d" | git mergetool ../file11 &&
 		yes "d" | git mergetool ../file12 &&
 		yes "l" | git mergetool ../submod &&
-		echo "master updated" >expect &&
+		echo "main updated" >expect &&
 		test_cmp expect ../file1 &&
-		echo "master new" >expect &&
+		echo "main new" >expect &&
 		test_cmp expect ../file2 &&
 		echo "branch1 submodule" >expect &&
 		test_cmp expect ../submod/bar &&
@@ -268,7 +268,7 @@ test_expect_success 'mergetool skips autoresolved' '
 	test_when_finished "git reset --hard" &&
 	git checkout -b test$test_count branch1 &&
 	git submodule update -N &&
-	test_must_fail git merge master &&
+	test_must_fail git merge main &&
 	test -n "$(git ls-files -u)" &&
 	yes "d" | git mergetool file11 &&
 	yes "d" | git mergetool file12 &&
@@ -283,17 +283,17 @@ test_expect_success 'mergetool merges all from subdir (rerere disabled)' '
 	test_config rerere.enabled false &&
 	(
 		cd subdir &&
-		test_must_fail git merge master &&
+		test_must_fail git merge main &&
 		yes "r" | git mergetool ../submod &&
 		yes "d" "d" | git mergetool --no-prompt &&
-		echo "master updated" >expect &&
+		echo "main updated" >expect &&
 		test_cmp expect ../file1 &&
-		echo "master new" >expect &&
+		echo "main new" >expect &&
 		test_cmp expect ../file2 &&
-		echo "master new sub" >expect &&
+		echo "main new sub" >expect &&
 		test_cmp expect file3 &&
 		( cd .. && git submodule update -N ) &&
-		echo "master submodule" >expect &&
+		echo "main submodule" >expect &&
 		test_cmp expect ../submod/bar &&
 		git commit -m "branch2 resolved by mergetool from subdir"
 	)
@@ -306,17 +306,17 @@ test_expect_success 'mergetool merges all from subdir (rerere enabled)' '
 	rm -rf .git/rr-cache &&
 	(
 		cd subdir &&
-		test_must_fail git merge master &&
+		test_must_fail git merge main &&
 		yes "r" | git mergetool ../submod &&
 		yes "d" "d" | git mergetool --no-prompt &&
-		echo "master updated" >expect &&
+		echo "main updated" >expect &&
 		test_cmp expect ../file1 &&
-		echo "master new" >expect &&
+		echo "main new" >expect &&
 		test_cmp expect ../file2 &&
-		echo "master new sub" >expect &&
+		echo "main new sub" >expect &&
 		test_cmp expect file3 &&
 		( cd .. && git submodule update -N ) &&
-		echo "master submodule" >expect &&
+		echo "main submodule" >expect &&
 		test_cmp expect ../submod/bar &&
 		git commit -m "branch2 resolved by mergetool from subdir"
 	)
@@ -328,7 +328,7 @@ test_expect_success 'mergetool skips resolved paths when rerere is active' '
 	rm -rf .git/rr-cache &&
 	git checkout -b test$test_count branch1 &&
 	git submodule update -N &&
-	test_must_fail git merge master &&
+	test_must_fail git merge main &&
 	yes "l" | git mergetool --no-prompt submod &&
 	yes "d" "d" | git mergetool --no-prompt &&
 	git submodule update -N &&
@@ -369,11 +369,11 @@ test_expect_success 'mergetool takes partial path' '
 	test_config rerere.enabled false &&
 	git checkout -b test$test_count branch1 &&
 	git submodule update -N &&
-	test_must_fail git merge master &&
+	test_must_fail git merge main &&
 
 	yes "" | git mergetool subdir &&
 
-	echo "master new sub" >expect &&
+	echo "main new sub" >expect &&
 	test_cmp expect subdir/file3
 '
 
@@ -437,7 +437,7 @@ test_expect_success 'deleted vs modified submodule' '
 	git rm --cached submod &&
 	git commit -m "Submodule deleted from branch" &&
 	git checkout -b test$test_count.a test$test_count &&
-	test_must_fail git merge master &&
+	test_must_fail git merge main &&
 	test -n "$(git ls-files -u)" &&
 	yes "" | git mergetool file1 file2 spaced\ name subdir/file3 &&
 	yes "" | git mergetool both &&
@@ -447,7 +447,7 @@ test_expect_success 'deleted vs modified submodule' '
 	echo "branch1 submodule" >expect &&
 	test_cmp expect submod/bar &&
 	git submodule update -N &&
-	echo "master submodule" >expect &&
+	echo "main submodule" >expect &&
 	test_cmp expect submod/bar &&
 	output="$(git mergetool --no-prompt)" &&
 	test "$output" = "No files need merging" &&
@@ -456,7 +456,7 @@ test_expect_success 'deleted vs modified submodule' '
 	mv submod submod-movedaside &&
 	git checkout -b test$test_count.b test$test_count &&
 	git submodule update -N &&
-	test_must_fail git merge master &&
+	test_must_fail git merge main &&
 	test -n "$(git ls-files -u)" &&
 	yes "" | git mergetool file1 file2 spaced\ name subdir/file3 &&
 	yes "" | git mergetool both &&
@@ -468,7 +468,7 @@ test_expect_success 'deleted vs modified submodule' '
 	git commit -m "Merge resolved by deleting module" &&
 
 	mv submod-movedaside submod &&
-	git checkout -b test$test_count.c master &&
+	git checkout -b test$test_count.c main &&
 	git submodule update -N &&
 	test_must_fail git merge test$test_count &&
 	test -n "$(git ls-files -u)" &&
@@ -484,7 +484,7 @@ test_expect_success 'deleted vs modified submodule' '
 	git commit -m "Merge resolved by deleting module" &&
 	mv submod.orig submod &&
 
-	git checkout -b test$test_count.d master &&
+	git checkout -b test$test_count.d main &&
 	git submodule update -N &&
 	test_must_fail git merge test$test_count &&
 	test -n "$(git ls-files -u)" &&
@@ -492,10 +492,10 @@ test_expect_success 'deleted vs modified submodule' '
 	yes "" | git mergetool both &&
 	yes "d" | git mergetool file11 file12 &&
 	yes "l" | git mergetool submod &&
-	echo "master submodule" >expect &&
+	echo "main submodule" >expect &&
 	test_cmp expect submod/bar &&
 	git submodule update -N &&
-	echo "master submodule" >expect &&
+	echo "main submodule" >expect &&
 	test_cmp expect submod/bar &&
 	output="$(git mergetool --no-prompt)" &&
 	test "$output" = "No files need merging" &&
@@ -512,7 +512,7 @@ test_expect_success 'file vs modified submodule' '
 	git add submod &&
 	git commit -m "Submodule path becomes file" &&
 	git checkout -b test$test_count.a branch1 &&
-	test_must_fail git merge master &&
+	test_must_fail git merge main &&
 	test -n "$(git ls-files -u)" &&
 	yes "" | git mergetool file1 file2 spaced\ name subdir/file3 &&
 	yes "" | git mergetool both &&
@@ -522,7 +522,7 @@ test_expect_success 'file vs modified submodule' '
 	echo "branch1 submodule" >expect &&
 	test_cmp expect submod/bar &&
 	git submodule update -N &&
-	echo "master submodule" >expect &&
+	echo "main submodule" >expect &&
 	test_cmp expect submod/bar &&
 	output="$(git mergetool --no-prompt)" &&
 	test "$output" = "No files need merging" &&
@@ -530,7 +530,7 @@ test_expect_success 'file vs modified submodule' '
 
 	mv submod submod-movedaside &&
 	git checkout -b test$test_count.b test$test_count &&
-	test_must_fail git merge master &&
+	test_must_fail git merge main &&
 	test -n "$(git ls-files -u)" &&
 	yes "" | git mergetool file1 file2 spaced\ name subdir/file3 &&
 	yes "" | git mergetool both &&
@@ -550,7 +550,7 @@ test_expect_success 'file vs modified submodule' '
 	test "$output" = "No files need merging" &&
 	git commit -m "Merge resolved by keeping file" &&
 
-	git checkout -b test$test_count.c master &&
+	git checkout -b test$test_count.c main &&
 	rmdir submod && mv submod-movedaside submod &&
 	test ! -e submod.orig &&
 	git submodule update -N &&
@@ -576,7 +576,7 @@ test_expect_success 'file vs modified submodule' '
 	test "$output" = "No files need merging" &&
 	git commit -m "Merge resolved by keeping file" &&
 
-	git checkout -b test$test_count.d master &&
+	git checkout -b test$test_count.d main &&
 	rmdir submod && mv submod.orig submod &&
 	git submodule update -N &&
 	test_must_fail git merge test$test_count &&
@@ -589,10 +589,10 @@ test_expect_success 'file vs modified submodule' '
 	then
 		yes "d" | git mergetool submod~test19
 	fi &&
-	echo "master submodule" >expect &&
+	echo "main submodule" >expect &&
 	test_cmp expect submod/bar &&
 	git submodule update -N &&
-	echo "master submodule" >expect &&
+	echo "main submodule" >expect &&
 	test_cmp expect submod/bar &&
 	output="$(git mergetool --no-prompt)" &&
 	test "$output" = "No files need merging" &&
@@ -675,7 +675,7 @@ test_expect_success 'directory vs modified submodule' '
 	git add submod/file16 &&
 	git commit -m "Submodule path becomes directory" &&
 
-	test_must_fail git merge master &&
+	test_must_fail git merge main &&
 	test -n "$(git ls-files -u)" &&
 	yes "l" | git mergetool submod &&
 	echo "not a submodule" >expect &&
@@ -683,14 +683,14 @@ test_expect_success 'directory vs modified submodule' '
 	rm -rf submod.orig &&
 
 	git reset --hard &&
-	test_must_fail git merge master &&
+	test_must_fail git merge main &&
 	test -n "$(git ls-files -u)" &&
 	test ! -e submod.orig &&
 	if test "$GIT_TEST_MERGE_ALGORITHM" = ort
 	then
-		yes "r" | git mergetool submod~master &&
+		yes "r" | git mergetool submod~main &&
 		git mv submod submod.orig &&
-		git mv submod~master submod
+		git mv submod~main submod
 	else
 		yes "r" | git mergetool submod
 	fi &&
@@ -701,18 +701,18 @@ test_expect_success 'directory vs modified submodule' '
 	mv submod-movedaside/.git submod &&
 	( cd submod && git clean -f && git reset --hard ) &&
 	git submodule update -N &&
-	echo "master submodule" >expect &&
+	echo "main submodule" >expect &&
 	test_cmp expect submod/bar &&
 	git reset --hard &&
 	rm -rf submod-movedaside &&
 
-	git checkout -b test$test_count.c master &&
+	git checkout -b test$test_count.c main &&
 	git submodule update -N &&
 	test_must_fail git merge test$test_count &&
 	test -n "$(git ls-files -u)" &&
 	yes "l" | git mergetool submod &&
 	git submodule update -N &&
-	echo "master submodule" >expect &&
+	echo "main submodule" >expect &&
 	test_cmp expect submod/bar &&
 
 	git reset --hard &&
@@ -724,7 +724,7 @@ test_expect_success 'directory vs modified submodule' '
 	echo "not a submodule" >expect &&
 	test_cmp expect submod/file16 &&
 
-	git reset --hard master &&
+	git reset --hard main &&
 	( cd submod && git clean -f && git reset --hard ) &&
 	git submodule update -N
 '
@@ -732,7 +732,7 @@ test_expect_success 'directory vs modified submodule' '
 test_expect_success 'file with no base' '
 	test_when_finished "git reset --hard" &&
 	git checkout -b test$test_count branch1 &&
-	test_must_fail git merge master &&
+	test_must_fail git merge main &&
 	git mergetool --no-prompt --tool mybase -- both &&
 	test_must_be_empty both
 '
@@ -742,9 +742,9 @@ test_expect_success 'custom commands override built-ins' '
 	git checkout -b test$test_count branch1 &&
 	test_config mergetool.defaults.cmd "cat \"\$REMOTE\" >\"\$MERGED\"" &&
 	test_config mergetool.defaults.trustExitCode true &&
-	test_must_fail git merge master &&
+	test_must_fail git merge main &&
 	git mergetool --no-prompt --tool defaults -- both &&
-	echo master both added >expected &&
+	echo main both added >expected &&
 	test_cmp expected both
 '
 
@@ -754,7 +754,7 @@ test_expect_success 'filenames seen by tools start with ./' '
 	test_config mergetool.writeToTemp false &&
 	test_config mergetool.myecho.cmd "echo \"\$LOCAL\"" &&
 	test_config mergetool.myecho.trustExitCode true &&
-	test_must_fail git merge master &&
+	test_must_fail git merge main &&
 	git mergetool --no-prompt --tool myecho -- both >actual &&
 	grep ^\./both_LOCAL_ actual
 '
@@ -771,7 +771,7 @@ test_expect_success MKTEMP 'temporary filenames are used with mergetool.writeToT
 	test_config mergetool.writeToTemp true &&
 	test_config mergetool.myecho.cmd "echo \"\$LOCAL\"" &&
 	test_config mergetool.myecho.trustExitCode true &&
-	test_must_fail git merge master &&
+	test_must_fail git merge main &&
 	git mergetool --no-prompt --tool myecho -- both >actual &&
 	! grep ^\./both_LOCAL_ actual &&
 	grep /both_LOCAL_ actual
diff --git a/t/t7611-merge-abort.sh b/t/t7611-merge-abort.sh
index ed072bfb19..c0e9425115 100755
--- a/t/t7611-merge-abort.sh
+++ b/t/t7611-merge-abort.sh
@@ -7,7 +7,7 @@ Set up repo with conflicting and non-conflicting branches:
 There are three files foo/bar/baz, and the following graph illustrates the
 content of these files in each commit:
 
-# foo/bar/baz --- foo/bar/bazz     <-- master
+# foo/bar/baz --- foo/bar/bazz     <-- main
 #             \
 #              --- foo/barf/bazf   <-- conflict_branch
 #               \
@@ -22,7 +22,7 @@ Next, test git merge --abort with the following variables:
 - changed/unchanged worktree after merge
 - changed/unchanged index after merge
 '
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -43,7 +43,7 @@ test_expect_success 'setup' '
 	git checkout -b clean_branch HEAD^ &&
 	echo bart > bar &&
 	git commit -a -m "clean" &&
-	git checkout master
+	git checkout main
 '
 
 pre_merge_head="$(git rev-parse HEAD)"
diff --git a/t/t7612-merge-verify-signatures.sh b/t/t7612-merge-verify-signatures.sh
index b4ec88f996..61330f71b1 100755
--- a/t/t7612-merge-verify-signatures.sh
+++ b/t/t7612-merge-verify-signatures.sh
@@ -1,7 +1,7 @@
 #!/bin/sh
 
 test_description='merge signature verification tests'
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -34,7 +34,7 @@ test_expect_success GPG 'create signed commits' '
 	echo 3 >baz && git add baz &&
 	test_tick && git commit -SB7227189 -m "untrusted on side" &&
 
-	git checkout master
+	git checkout main
 '
 
 test_expect_success GPG 'merge unsigned commit with verification' '
diff --git a/t/t7614-merge-signoff.sh b/t/t7614-merge-signoff.sh
index ea4eeee35f..fee258d4f0 100755
--- a/t/t7614-merge-signoff.sh
+++ b/t/t7614-merge-signoff.sh
@@ -5,7 +5,7 @@ test_description='git merge --signoff
 This test runs git merge --signoff and makes sure that it works.
 '
 
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -14,17 +14,17 @@ export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 test_setup() {
 	# Expected commit message after merge --signoff
 	cat >expected-signed <<EOF &&
-Merge branch 'master' into other-branch
+Merge branch 'main' into other-branch
 
 Signed-off-by: $(git var GIT_COMMITTER_IDENT | sed -e "s/>.*/>/")
 EOF
 
 	# Expected commit message after merge without --signoff (or with --no-signoff)
 	cat >expected-unsigned <<EOF &&
-Merge branch 'master' into other-branch
+Merge branch 'main' into other-branch
 EOF
 
-	# Initial commit and feature branch to merge master into it.
+	# Initial commit and feature branch to merge main into it.
 	git commit --allow-empty -m "Initial empty commit" &&
 	git checkout -b other-branch &&
 	test_commit other-branch file1 1
@@ -41,30 +41,30 @@ test_expect_success 'setup' '
 
 # Test with --signoff flag
 test_expect_success 'git merge --signoff adds a sign-off line' '
-	git checkout master &&
-	test_commit master-branch-2 file2 2 &&
+	git checkout main &&
+	test_commit main-branch-2 file2 2 &&
 	git checkout other-branch &&
-	git merge master --signoff --no-edit &&
+	git merge main --signoff --no-edit &&
 	git cat-file commit HEAD | sed -e "1,/^\$/d" >actual &&
 	test_cmp expected-signed actual
 '
 
 # Test without --signoff flag
 test_expect_success 'git merge does not add a sign-off line' '
-	git checkout master &&
-	test_commit master-branch-3 file3 3 &&
+	git checkout main &&
+	test_commit main-branch-3 file3 3 &&
 	git checkout other-branch &&
-	git merge master --no-edit &&
+	git merge main --no-edit &&
 	git cat-file commit HEAD | sed -e "1,/^\$/d" >actual &&
 	test_cmp expected-unsigned actual
 '
 
 # Test for --no-signoff flag
 test_expect_success 'git merge --no-signoff flag cancels --signoff flag' '
-	git checkout master &&
-	test_commit master-branch-4 file4 4 &&
+	git checkout main &&
+	test_commit main-branch-4 file4 4 &&
 	git checkout other-branch &&
-	git merge master --no-edit --signoff --no-signoff &&
+	git merge main --no-edit --signoff --no-signoff &&
 	git cat-file commit HEAD | sed -e "1,/^\$/d" >actual &&
 	test_cmp expected-unsigned actual
 '
diff --git a/t/t7701-repack-unpack-unreachable.sh b/t/t7701-repack-unpack-unreachable.sh
index 375f43a721..937f89ee8c 100755
--- a/t/t7701-repack-unpack-unreachable.sh
+++ b/t/t7701-repack-unpack-unreachable.sh
@@ -2,7 +2,7 @@
 
 test_description='git repack works correctly'
 
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -25,7 +25,7 @@ test_expect_success '-A with -d option leaves unreachable objects unpacked' '
 	git commit -a -m more_content &&
 	csha1=$(git rev-parse HEAD^{commit}) &&
 	tsha1=$(git rev-parse HEAD^{tree}) &&
-	git checkout master &&
+	git checkout main &&
 	echo even more content >> file1 &&
 	test_tick &&
 	git commit -a -m even_more_content &&
diff --git a/t/t7800-difftool.sh b/t/t7800-difftool.sh
index f938efa296..9662abc1e7 100755
--- a/t/t7800-difftool.sh
+++ b/t/t7800-difftool.sh
@@ -8,7 +8,7 @@ test_description='git-difftool
 Testing basic diff tool invocation
 '
 
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -38,23 +38,23 @@ test_expect_success 'basic usage requires no repo' '
 	test_i18ngrep ^usage: output
 '
 
-# Create a file on master and change it on branch
+# Create a file on main and change it on branch
 test_expect_success 'setup' '
-	echo master >file &&
+	echo main >file &&
 	git add file &&
 	git commit -m "added file" &&
 
-	git checkout -b branch master &&
+	git checkout -b branch main &&
 	echo branch >file &&
 	git commit -a -m "branch changed file" &&
-	git checkout master
+	git checkout main
 '
 
 # Configure a custom difftool.<tool>.cmd and use it
 test_expect_success 'custom commands' '
 	difftool_test_setup &&
 	test_config difftool.test-tool.cmd "cat \"\$REMOTE\"" &&
-	echo master >expect &&
+	echo main >expect &&
 	git difftool --no-prompt branch >actual &&
 	test_cmp expect actual &&
 
@@ -66,7 +66,7 @@ test_expect_success 'custom commands' '
 
 test_expect_success 'custom tool commands override built-ins' '
 	test_config difftool.vimdiff.cmd "cat \"\$REMOTE\"" &&
-	echo master >expect &&
+	echo main >expect &&
 	git difftool --tool vimdiff --no-prompt branch >actual &&
 	test_cmp expect actual
 '
@@ -314,21 +314,21 @@ test_expect_success 'difftool.<tool>.path' '
 
 test_expect_success 'difftool --extcmd=cat' '
 	echo branch >expect &&
-	echo master >>expect &&
+	echo main >>expect &&
 	git difftool --no-prompt --extcmd=cat branch >actual &&
 	test_cmp expect actual
 '
 
 test_expect_success 'difftool --extcmd cat' '
 	echo branch >expect &&
-	echo master >>expect &&
+	echo main >>expect &&
 	git difftool --no-prompt --extcmd=cat branch >actual &&
 	test_cmp expect actual
 '
 
 test_expect_success 'difftool -x cat' '
 	echo branch >expect &&
-	echo master >>expect &&
+	echo main >>expect &&
 	git difftool --no-prompt -x cat branch >actual &&
 	test_cmp expect actual
 '
@@ -341,7 +341,7 @@ test_expect_success 'difftool --extcmd echo arg1' '
 '
 
 test_expect_success 'difftool --extcmd cat arg1' '
-	echo master >expect &&
+	echo main >expect &&
 	git difftool --no-prompt \
 		--extcmd sh\ -c\ \"cat\ \$1\" branch >actual &&
 	test_cmp expect actual
@@ -354,7 +354,7 @@ test_expect_success 'difftool --extcmd cat arg2' '
 	test_cmp expect actual
 '
 
-# Create a second file on master and a different version on branch
+# Create a second file on main and a different version on branch
 test_expect_success 'setup with 2 files different' '
 	echo m2 >file2 &&
 	git add file2 &&
@@ -364,7 +364,7 @@ test_expect_success 'setup with 2 files different' '
 	echo br2 >file2 &&
 	git add file2 &&
 	git commit -a -m "branch changed file2" &&
-	git checkout master
+	git checkout main
 '
 
 test_expect_success 'say no to the first file' '
@@ -372,14 +372,14 @@ test_expect_success 'say no to the first file' '
 	git difftool -x cat branch <input >output &&
 	grep m2 output &&
 	grep br2 output &&
-	! grep master output &&
+	! grep main output &&
 	! grep branch output
 '
 
 test_expect_success 'say no to the second file' '
 	(echo && echo n) >input &&
 	git difftool -x cat branch <input >output &&
-	grep master output &&
+	grep main output &&
 	grep branch output &&
 	! grep m2 output &&
 	! grep br2 output
@@ -387,7 +387,7 @@ test_expect_success 'say no to the second file' '
 
 test_expect_success 'ending prompt input with EOF' '
 	git difftool -x cat branch </dev/null >output &&
-	! grep master output &&
+	! grep main output &&
 	! grep branch output &&
 	! grep m2 output &&
 	! grep br2 output
@@ -399,9 +399,9 @@ test_expect_success 'difftool --tool-help' '
 '
 
 test_expect_success 'setup change in subdirectory' '
-	git checkout master &&
+	git checkout main &&
 	mkdir sub &&
-	echo master >sub/sub &&
+	echo main >sub/sub &&
 	git add sub/sub &&
 	git commit -m "added sub/sub" &&
 	git tag v1 &&
@@ -529,7 +529,7 @@ run_dir_diff_test 'difftool --dir-diff from subdirectory with GIT_DIR set' '
 run_dir_diff_test 'difftool --dir-diff when worktree file is missing' '
 	test_when_finished git reset --hard &&
 	rm file2 &&
-	git difftool --dir-diff $symlinks --extcmd ls branch master >output &&
+	git difftool --dir-diff $symlinks --extcmd ls branch main >output &&
 	grep file2 output
 '
 
@@ -546,7 +546,7 @@ run_dir_diff_test 'difftool --dir-diff with unmerged files' '
 	echo b >>file &&
 	git add file &&
 	git commit -m conflict-b &&
-	git checkout master &&
+	git checkout main &&
 	git merge conflict-a &&
 	test_must_fail git merge conflict-b &&
 	cat >expect <<-EOF &&
diff --git a/t/t7810-grep.sh b/t/t7810-grep.sh
index 47ec993962..9f1aa9ef25 100755
--- a/t/t7810-grep.sh
+++ b/t/t7810-grep.sh
@@ -6,7 +6,7 @@
 test_description='git grep various.
 '
 
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -1209,19 +1209,19 @@ test_expect_success 'grep -e -- -- path' '
 '
 
 test_expect_success 'dashdash disambiguates rev as rev' '
-	test_when_finished "rm -f master" &&
-	echo content >master &&
-	echo master:hello.c >expect &&
-	git grep -l o master -- hello.c >actual &&
+	test_when_finished "rm -f main" &&
+	echo content >main &&
+	echo main:hello.c >expect &&
+	git grep -l o main -- hello.c >actual &&
 	test_cmp expect actual
 '
 
 test_expect_success 'dashdash disambiguates pathspec as pathspec' '
-	test_when_finished "git rm -f master" &&
-	echo content >master &&
-	git add master &&
-	echo master:content >expect &&
-	git grep o -- master >actual &&
+	test_when_finished "git rm -f main" &&
+	echo content >main &&
+	git add main &&
+	echo main:content >expect &&
+	git grep o -- main >actual &&
 	test_cmp expect actual
 '
 
@@ -1257,15 +1257,15 @@ test_expect_success 'grep --no-index pattern -- path' '
 '
 
 test_expect_success 'grep --no-index complains of revs' '
-	test_must_fail git grep --no-index o master -- 2>err &&
+	test_must_fail git grep --no-index o main -- 2>err &&
 	test_i18ngrep "cannot be used with revs" err
 '
 
 test_expect_success 'grep --no-index prefers paths to revs' '
-	test_when_finished "rm -f master" &&
-	echo content >master &&
-	echo master:content >expect &&
-	git grep --no-index o master >actual &&
+	test_when_finished "rm -f main" &&
+	echo content >main &&
+	echo main:content >expect &&
+	git grep --no-index o main >actual &&
 	test_cmp expect actual
 '
 
-- 
gitgitgadget


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH v3 23/28] t8*: adjust the references to the default branch name "main"
  2020-11-18 23:44   ` [PATCH v3 00/28] tests: use main as default branch name Johannes Schindelin via GitGitGadget
                       ` (21 preceding siblings ...)
  2020-11-18 23:44     ` [PATCH v3 22/28] t7[5-9]*: " Johannes Schindelin via GitGitGadget
@ 2020-11-18 23:44     ` Johannes Schindelin via GitGitGadget
  2020-11-18 23:44     ` [PATCH v3 24/28] t9[0-4]*: " Johannes Schindelin via GitGitGadget
                       ` (5 subsequent siblings)
  28 siblings, 0 replies; 163+ messages in thread
From: Johannes Schindelin via GitGitGadget @ 2020-11-18 23:44 UTC (permalink / raw)
  To: git
  Cc: Felipe Contreras, Ævar Arnfjörð Bjarmason,
	Johannes Schindelin, Jeff King, Jonathan Nieder,
	Johannes Schindelin, Johannes Schindelin

From: Johannes Schindelin <johannes.schindelin@gmx.de>

This trick was performed via

	$ (cd t &&
	   sed -i -e 's/master/main/g' -e 's/MASTER/MAIN/g' \
		-e 's/Master/Main/g' -- t8*.sh annotate*.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>
---
 t/annotate-tests.sh             |  8 ++++----
 t/t8001-annotate.sh             |  4 ++--
 t/t8002-blame.sh                |  2 +-
 t/t8003-blame-corner-cases.sh   |  6 +++---
 t/t8004-blame-with-conflicts.sh | 16 ++++++++--------
 t/t8012-blame-colors.sh         |  2 +-
 6 files changed, 19 insertions(+), 19 deletions(-)

diff --git a/t/annotate-tests.sh b/t/annotate-tests.sh
index 3aee61d2cc..ee5d2d4cf8 100644
--- a/t/annotate-tests.sh
+++ b/t/annotate-tests.sh
@@ -95,7 +95,7 @@ test_expect_success 'blame 2 authors' '
 '
 
 test_expect_success 'setup B1 lines (branch1)' '
-	git checkout -b branch1 master &&
+	git checkout -b branch1 main &&
 	echo "3A slow green fox jumps into the" >>file &&
 	echo "well." >>file &&
 	GIT_AUTHOR_NAME="B1" GIT_AUTHOR_EMAIL="B1@test.git" \
@@ -107,7 +107,7 @@ test_expect_success 'blame 2 authors + 1 branch1 author' '
 '
 
 test_expect_success 'setup B2 lines (branch2)' '
-	git checkout -b branch2 master &&
+	git checkout -b branch2 main &&
 	sed -e "s/2A quick brown/4A quick brown lazy dog/" <file >file.new &&
 	mv file.new file &&
 	GIT_AUTHOR_NAME="B2" GIT_AUTHOR_EMAIL="B2@test.git" \
@@ -131,11 +131,11 @@ test_expect_success 'blame --first-parent blames merge for branch1' '
 '
 
 test_expect_success 'blame ancestor' '
-	check_count -h master A 2 B 2
+	check_count -h main A 2 B 2
 '
 
 test_expect_success 'blame great-ancestor' '
-	check_count -h master^ A 2
+	check_count -h main^ A 2
 '
 
 test_expect_success 'setup evil merge' '
diff --git a/t/t8001-annotate.sh b/t/t8001-annotate.sh
index f661007c85..a536a621b2 100755
--- a/t/t8001-annotate.sh
+++ b/t/t8001-annotate.sh
@@ -1,7 +1,7 @@
 #!/bin/sh
 
 test_description='git annotate'
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -10,7 +10,7 @@ PROG='git annotate'
 . "$TEST_DIRECTORY"/annotate-tests.sh
 
 test_expect_success 'annotate old revision' '
-	git annotate file master >actual &&
+	git annotate file main >actual &&
 	awk "{ print \$3; }" <actual >authors &&
 	test 2 = $(grep A <authors | wc -l) &&
 	test 2 = $(grep B <authors | wc -l)
diff --git a/t/t8002-blame.sh b/t/t8002-blame.sh
index 89a319d2c7..5bb302b1ba 100755
--- a/t/t8002-blame.sh
+++ b/t/t8002-blame.sh
@@ -1,7 +1,7 @@
 #!/bin/sh
 
 test_description='git blame'
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
diff --git a/t/t8003-blame-corner-cases.sh b/t/t8003-blame-corner-cases.sh
index 0613d889db..da80f815ce 100755
--- a/t/t8003-blame-corner-cases.sh
+++ b/t/t8003-blame-corner-cases.sh
@@ -1,7 +1,7 @@
 #!/bin/sh
 
 test_description='git blame corner cases'
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -164,13 +164,13 @@ test_expect_success 'blame wholesale copy and more in the index' '
 
 test_expect_success 'blame during cherry-pick with file rename conflict' '
 
-	test_when_finished "git reset --hard && git checkout master" &&
+	test_when_finished "git reset --hard && git checkout main" &&
 	git checkout HEAD~3 &&
 	echo MOUSE >> mouse &&
 	git mv mouse rodent &&
 	git add rodent &&
 	GIT_AUTHOR_NAME=Rodent git commit -m "rodent" &&
-	git checkout --detach master &&
+	git checkout --detach main &&
 	(git cherry-pick HEAD@{1} || test $? -eq 1) &&
 	git show HEAD@{1}:rodent > rodent &&
 	git add rodent &&
diff --git a/t/t8004-blame-with-conflicts.sh b/t/t8004-blame-with-conflicts.sh
index ffce1d1195..35414a5336 100755
--- a/t/t8004-blame-with-conflicts.sh
+++ b/t/t8004-blame-with-conflicts.sh
@@ -3,7 +3,7 @@
 # Based on a test case submitted by Björn Steinbrink.
 
 test_description='git blame on conflicted files'
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -24,16 +24,16 @@ test_expect_success 'setup first case' '
 	git add file2 &&
 	git commit --author "U Gly <ug@localhost>" -m ugly &&
 
-	# Back to master and change something
-	git checkout master &&
+	# Back to main and change something
+	git checkout main &&
 	echo "
 
 bla" >> file1 &&
 	git commit --author "Old Line <ol@localhost>" -a -m file1.b &&
 
-	# Back to foo and merge master
+	# Back to foo and merge main
 	git checkout foo &&
-	if git merge master; then
+	if git merge main; then
 		echo needed conflict here
 		exit 1
 	else
@@ -47,8 +47,8 @@ Even more" > file2 &&
 	git rm file1 &&
 	git commit --author "M Result <mr@localhost>" -a -m merged &&
 
-	# Back to master and change file1 again
-	git checkout master &&
+	# Back to main and change file1 again
+	git checkout main &&
 	sed s/bla/foo/ <file1 >X &&
 	rm file1 &&
 	mv X file1 &&
@@ -56,7 +56,7 @@ Even more" > file2 &&
 
 	# Try to merge into foo again
 	git checkout foo &&
-	if git merge master; then
+	if git merge main; then
 		echo needed conflict here
 		exit 1
 	else
diff --git a/t/t8012-blame-colors.sh b/t/t8012-blame-colors.sh
index d55b3e22c9..90c75dbb28 100755
--- a/t/t8012-blame-colors.sh
+++ b/t/t8012-blame-colors.sh
@@ -1,7 +1,7 @@
 #!/bin/sh
 
 test_description='colored git blame'
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
-- 
gitgitgadget


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH v3 24/28] t9[0-4]*: adjust the references to the default branch name "main"
  2020-11-18 23:44   ` [PATCH v3 00/28] tests: use main as default branch name Johannes Schindelin via GitGitGadget
                       ` (22 preceding siblings ...)
  2020-11-18 23:44     ` [PATCH v3 23/28] t8*: " Johannes Schindelin via GitGitGadget
@ 2020-11-18 23:44     ` Johannes Schindelin via GitGitGadget
  2020-11-18 23:44     ` [PATCH v3 25/28] t9[5-7]*: " Johannes Schindelin via GitGitGadget
                       ` (4 subsequent siblings)
  28 siblings, 0 replies; 163+ messages in thread
From: Johannes Schindelin via GitGitGadget @ 2020-11-18 23:44 UTC (permalink / raw)
  To: git
  Cc: Felipe Contreras, Ævar Arnfjörð Bjarmason,
	Johannes Schindelin, Jeff King, Jonathan Nieder,
	Johannes Schindelin, Johannes Schindelin

From: Johannes Schindelin <johannes.schindelin@gmx.de>

This trick was performed via

	$ (cd t &&
	   sed -i -e 's/master/main/g' -e 's/MASTER/MAIN/g' \
		-e 's/Master/Main/g' -- t9[0-4]*.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>
---
 t/t9001-send-email.sh                  | 30 ++++-----
 t/t9100-git-svn-basic.sh               |  4 +-
 t/t9145-git-svn-master-branch.sh       |  8 +--
 t/t9151-svn-mergeinfo.sh               |  4 +-
 t/t9155-git-svn-fetch-deleted-tag.sh   |  4 +-
 t/t9156-git-svn-fetch-deleted-tag-2.sh |  8 +--
 t/t9163-git-svn-reset-clears-caches.sh |  4 +-
 t/t9169-git-svn-dcommit-crlf.sh        |  4 +-
 t/t9300-fast-import.sh                 | 84 ++++++++++++------------
 t/t9301-fast-import-notes.sh           | 16 ++---
 t/t9302-fast-import-unpack-limit.sh    | 16 ++---
 t/t9350-fast-export.sh                 | 88 +++++++++++++-------------
 t/t9351-fast-export-anonymize.sh       |  6 +-
 t/t9400-git-cvsserver-server.sh        | 34 +++++-----
 t/t9401-git-cvsserver-crlf.sh          | 18 +++---
 t/t9402-git-cvsserver-refs.sh          | 10 +--
 16 files changed, 169 insertions(+), 169 deletions(-)

diff --git a/t/t9001-send-email.sh b/t/t9001-send-email.sh
index 3d160d939e..4eee9c3dcb 100755
--- a/t/t9001-send-email.sh
+++ b/t/t9001-send-email.sh
@@ -1,7 +1,7 @@
 #!/bin/sh
 
 test_description='git send-email'
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -1171,10 +1171,10 @@ test_expect_success $PREREQ '--compose-encoding adds correct MIME for subject' '
 '
 
 test_expect_success $PREREQ 'detects ambiguous reference/file conflict' '
-	echo master >master &&
-	git add master &&
-	git commit -m"add master" &&
-	test_must_fail git send-email --dry-run master 2>errors &&
+	echo main >main &&
+	git add main &&
+	git commit -m"add main" &&
+	test_must_fail git send-email --dry-run main 2>errors &&
 	grep disambiguate errors
 '
 
@@ -1188,7 +1188,7 @@ test_expect_success $PREREQ 'feed two files' '
 		outdir/000?-*.patch 2>errors >out &&
 	grep "^Subject: " out >subjects &&
 	test "z$(sed -n -e 1p subjects)" = "zSubject: [PATCH 1/2] Second." &&
-	test "z$(sed -n -e 2p subjects)" = "zSubject: [PATCH 2/2] add master"
+	test "z$(sed -n -e 2p subjects)" = "zSubject: [PATCH 2/2] add main"
 '
 
 test_expect_success $PREREQ 'in-reply-to but no threading' '
@@ -2040,7 +2040,7 @@ test_expect_success $PREREQ 'setup expected-list' '
 	--cc="Cc2 <cc2@example.com>" \
 	--bcc="bcc1@example.com" \
 	--bcc="bcc2@example.com" \
-	0001-add-master.patch | replace_variable_fields \
+	0001-add-main.patch | replace_variable_fields \
 	>expected-list
 '
 
@@ -2052,7 +2052,7 @@ test_expect_success $PREREQ 'use email list in --cc --to and --bcc' '
 	--to="to3@example.com" \
 	--cc="Cc 1 <cc1@example.com>, Cc2 <cc2@example.com>" \
 	--bcc="bcc1@example.com, bcc2@example.com" \
-	0001-add-master.patch | replace_variable_fields \
+	0001-add-main.patch | replace_variable_fields \
 	>actual-list &&
 	test_cmp expected-list actual-list
 '
@@ -2068,7 +2068,7 @@ test_expect_success $PREREQ 'aliases work with email list' '
 	--to="To 1 <to1@example.com>, to2, to3@example.com" \
 	--cc="cc1, Cc2 <cc2@example.com>" \
 	--bcc="bcc1@example.com, bcc2@example.com" \
-	0001-add-master.patch | replace_variable_fields \
+	0001-add-main.patch | replace_variable_fields \
 	>actual-list &&
 	test_cmp expected-list actual-list
 '
@@ -2092,7 +2092,7 @@ test_expect_success $PREREQ 'leading and trailing whitespaces are removed' '
 	--cc="Cc2 <cc2@example.com>" \
 	--bcc="$BCC1" \
 	--bcc="bcc2@example.com" \
-	0001-add-master.patch | replace_variable_fields \
+	0001-add-main.patch | replace_variable_fields \
 	>actual-list &&
 	test_cmp expected-list actual-list
 '
@@ -2111,8 +2111,8 @@ test_expect_success $PREREQ 'invoke hook' '
 		false
 		;;
 	esac &&
-	test -f 0001-add-master.patch &&
-	grep "add master" "$1"
+	test -f 0001-add-main.patch &&
+	grep "add main" "$1"
 	EOF
 
 	mkdir subdir &&
@@ -2124,10 +2124,10 @@ test_expect_success $PREREQ 'invoke hook' '
 			--from="Example <nobody@example.com>" \
 			--to=nobody@example.com \
 			--smtp-server="$(pwd)/../fake.sendmail" \
-			../0001-add-master.patch &&
+			../0001-add-main.patch &&
 
 		# Verify error message when a patch is rejected by the hook
-		sed -e "s/add master/x/" ../0001-add-master.patch >../another.patch &&
+		sed -e "s/add main/x/" ../0001-add-main.patch >../another.patch &&
 		test_must_fail git send-email \
 			--from="Example <nobody@example.com>" \
 			--to=nobody@example.com \
@@ -2142,7 +2142,7 @@ test_expect_success $PREREQ 'test that send-email works outside a repo' '
 		--from="Example <nobody@example.com>" \
 		--to=nobody@example.com \
 		--smtp-server="$(pwd)/fake.sendmail" \
-		"$(pwd)/0001-add-master.patch"
+		"$(pwd)/0001-add-main.patch"
 '
 
 test_expect_success $PREREQ 'test that sendmail config is rejected' '
diff --git a/t/t9100-git-svn-basic.sh b/t/t9100-git-svn-basic.sh
index 9a6f2c38f1..1d3fdcc997 100755
--- a/t/t9100-git-svn-basic.sh
+++ b/t/t9100-git-svn-basic.sh
@@ -6,7 +6,7 @@
 test_description='git svn basic tests'
 GIT_SVN_LC_ALL=${LC_ALL:-$LANG}
 
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./lib-git-svn.sh
@@ -278,7 +278,7 @@ test_expect_success 'dcommit $rev does not clobber current branch' '
 	test refs/heads/my-bar = $(git symbolic-ref HEAD) &&
 	git log refs/remotes/bar | grep "change 1" &&
 	! git log refs/remotes/bar | grep "change 2" &&
-	git checkout master &&
+	git checkout main &&
 	git branch -D my-bar
 	'
 
diff --git a/t/t9145-git-svn-master-branch.sh b/t/t9145-git-svn-master-branch.sh
index 053571ca5c..f863e437f7 100755
--- a/t/t9145-git-svn-master-branch.sh
+++ b/t/t9145-git-svn-master-branch.sh
@@ -2,8 +2,8 @@
 #
 # Copyright (c) 2009 Eric Wong
 #
-test_description='git svn initial master branch is "trunk" if possible'
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+test_description='git svn initial main branch is "trunk" if possible'
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./lib-git-svn.sh
@@ -16,12 +16,12 @@ test_expect_success 'setup test repository' '
 	svn_cmd import -m b/b i "$svnrepo/branches/b"
 '
 
-test_expect_success 'git svn clone --stdlayout sets up trunk as master' '
+test_expect_success 'git svn clone --stdlayout sets up trunk as main' '
 	git svn clone -s "$svnrepo" g &&
 	(
 		cd g &&
 		test x$(git rev-parse --verify refs/remotes/origin/trunk^0) = \
-		     x$(git rev-parse --verify refs/heads/master^0)
+		     x$(git rev-parse --verify refs/heads/main^0)
 	)
 '
 
diff --git a/t/t9151-svn-mergeinfo.sh b/t/t9151-svn-mergeinfo.sh
index 9188c761de..696ace2462 100755
--- a/t/t9151-svn-mergeinfo.sh
+++ b/t/t9151-svn-mergeinfo.sh
@@ -5,7 +5,7 @@
 
 test_description='git-svn svn mergeinfo properties'
 
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./lib-git-svn.sh
@@ -53,7 +53,7 @@ test_expect_success 'merging two branches in one commit is detected correctly' '
 	'
 
 test_expect_failure 'everything got merged in the end' '
-	unmerged=$(git rev-list --all --not master) &&
+	unmerged=$(git rev-list --all --not main) &&
 	[ -z "$unmerged" ]
 	'
 
diff --git a/t/t9155-git-svn-fetch-deleted-tag.sh b/t/t9155-git-svn-fetch-deleted-tag.sh
index 9d6cc40add..3258374c13 100755
--- a/t/t9155-git-svn-fetch-deleted-tag.sh
+++ b/t/t9155-git-svn-fetch-deleted-tag.sh
@@ -2,7 +2,7 @@
 
 test_description='git svn fetch deleted tag'
 
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./lib-git-svn.sh
@@ -39,7 +39,7 @@ test_expect_success 'fetch deleted tags from same revision with checksum error'
 	git svn fetch &&
 
 	git diff --exit-code origin/mybranch:trunk/subdir/file origin/tags/mytag:file &&
-	git diff --exit-code master:subdir/file origin/tags/mytag^:file
+	git diff --exit-code main:subdir/file origin/tags/mytag^:file
 '
 
 test_done
diff --git a/t/t9156-git-svn-fetch-deleted-tag-2.sh b/t/t9156-git-svn-fetch-deleted-tag-2.sh
index ba78bfb676..2b75c403e3 100755
--- a/t/t9156-git-svn-fetch-deleted-tag-2.sh
+++ b/t/t9156-git-svn-fetch-deleted-tag-2.sh
@@ -2,7 +2,7 @@
 
 test_description='git svn fetch deleted tag 2'
 
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./lib-git-svn.sh
@@ -39,9 +39,9 @@ test_expect_success 'fetch deleted tags from same revision with no checksum erro
 	cd git_project &&
 	git svn fetch &&
 
-	git diff --exit-code master:subdir3/file origin/tags/mytag:file &&
-	git diff --exit-code master:subdir2/file origin/tags/mytag^:file &&
-	git diff --exit-code master:subdir1/file origin/tags/mytag^^:file
+	git diff --exit-code main:subdir3/file origin/tags/mytag:file &&
+	git diff --exit-code main:subdir2/file origin/tags/mytag^:file &&
+	git diff --exit-code main:subdir1/file origin/tags/mytag^^:file
 '
 
 test_done
diff --git a/t/t9163-git-svn-reset-clears-caches.sh b/t/t9163-git-svn-reset-clears-caches.sh
index e48faf92af..978eb62ff4 100755
--- a/t/t9163-git-svn-reset-clears-caches.sh
+++ b/t/t9163-git-svn-reset-clears-caches.sh
@@ -4,7 +4,7 @@
 #
 
 test_description='git svn reset clears memoized caches'
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./lib-git-svn.sh
@@ -62,7 +62,7 @@ test_expect_success 'fetch to merge-base (a)' '
 test_expect_success 'rebase looses SVN merge (m)' '
 	git svn rebase &&
 	git svn fetch &&
-	test 1 = $(git cat-file -p master|grep parent|wc -l)
+	test 1 = $(git cat-file -p main|grep parent|wc -l)
 '
 
 # git svn fetch creates correct history with merge commit
diff --git a/t/t9169-git-svn-dcommit-crlf.sh b/t/t9169-git-svn-dcommit-crlf.sh
index 47ae51c54f..7080b5d24f 100755
--- a/t/t9169-git-svn-dcommit-crlf.sh
+++ b/t/t9169-git-svn-dcommit-crlf.sh
@@ -1,7 +1,7 @@
 #!/bin/sh
 
 test_description='git svn dcommit CRLF'
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./lib-git-svn.sh
@@ -17,7 +17,7 @@ test_expect_success 'setup commit repository' '
 		p=$(git rev-parse HEAD) &&
 		t=$(git write-tree) &&
 		cmt=$(git commit-tree -p $p $t <cmt) &&
-		git update-ref refs/heads/master $cmt &&
+		git update-ref refs/heads/main $cmt &&
 		git cat-file commit HEAD | tail -n4 >out &&
 		test_cmp cmt out &&
 		git svn dcommit &&
diff --git a/t/t9300-fast-import.sh b/t/t9300-fast-import.sh
index 404a42999e..3d17e932a0 100755
--- a/t/t9300-fast-import.sh
+++ b/t/t9300-fast-import.sh
@@ -4,7 +4,7 @@
 #
 
 test_description='test git fast-import utility'
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -65,7 +65,7 @@ test_expect_success 'A: create pack from stdin' '
 	mark :4
 	data $file4_len
 	$file4_data
-	commit refs/heads/master
+	commit refs/heads/main
 	mark :5
 	committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
 	data <<COMMIT
@@ -120,7 +120,7 @@ test_expect_success 'A: create pack from stdin' '
 
 	INPUT_END
 	git fast-import --export-marks=marks.out <input &&
-	git whatchanged master
+	git whatchanged main
 '
 
 test_expect_success 'A: verify pack' '
@@ -134,7 +134,7 @@ test_expect_success 'A: verify commit' '
 
 	initial
 	EOF
-	git cat-file commit master | sed 1d >actual &&
+	git cat-file commit main | sed 1d >actual &&
 	test_cmp expect actual
 '
 
@@ -144,31 +144,31 @@ test_expect_success 'A: verify tree' '
 	100644 blob file3
 	100755 blob file4
 	EOF
-	git cat-file -p master^{tree} | sed "s/ [0-9a-f]*	/ /" >actual &&
+	git cat-file -p main^{tree} | sed "s/ [0-9a-f]*	/ /" >actual &&
 	test_cmp expect actual
 '
 
 test_expect_success 'A: verify file2' '
 	echo "$file2_data" >expect &&
-	git cat-file blob master:file2 >actual &&
+	git cat-file blob main:file2 >actual &&
 	test_cmp expect actual
 '
 
 test_expect_success 'A: verify file3' '
 	echo "$file3_data" >expect &&
-	git cat-file blob master:file3 >actual &&
+	git cat-file blob main:file3 >actual &&
 	test_cmp expect actual
 '
 
 test_expect_success 'A: verify file4' '
 	printf "$file4_data" >expect &&
-	git cat-file blob master:file4 >actual &&
+	git cat-file blob main:file4 >actual &&
 	test_cmp expect actual
 '
 
 test_expect_success 'A: verify tag/series-A' '
 	cat >expect <<-EOF &&
-	object $(git rev-parse refs/heads/master)
+	object $(git rev-parse refs/heads/main)
 	type commit
 	tag series-A
 
@@ -180,7 +180,7 @@ test_expect_success 'A: verify tag/series-A' '
 
 test_expect_success 'A: verify tag/series-A-blob' '
 	cat >expect <<-EOF &&
-	object $(git rev-parse refs/heads/master:file3)
+	object $(git rev-parse refs/heads/main:file3)
 	type blob
 	tag series-A-blob
 
@@ -196,13 +196,13 @@ test_expect_success 'A: verify tag deletion is successful' '
 
 test_expect_success 'A: verify marks output' '
 	cat >expect <<-EOF &&
-	:2 $(git rev-parse --verify master:file2)
-	:3 $(git rev-parse --verify master:file3)
-	:4 $(git rev-parse --verify master:file4)
-	:5 $(git rev-parse --verify master^0)
+	:2 $(git rev-parse --verify main:file2)
+	:3 $(git rev-parse --verify main:file3)
+	:4 $(git rev-parse --verify main:file4)
+	:5 $(git rev-parse --verify main^0)
 	:6 $(git cat-file tag nested | grep object | cut -d" " -f 2)
 	:7 $(git rev-parse --verify nested)
-	:8 $(git rev-parse --verify master^0)
+	:8 $(git rev-parse --verify main^0)
 	EOF
 	test_cmp expect marks.out
 '
@@ -220,7 +220,7 @@ test_expect_success 'A: tag blob by sha1' '
 	new_blob=$(echo testing | git hash-object --stdin) &&
 	cat >input <<-INPUT_END &&
 	tag series-A-blob-2
-	from $(git rev-parse refs/heads/master:file3)
+	from $(git rev-parse refs/heads/main:file3)
 	data <<EOF
 	Tag blob by sha1.
 	EOF
@@ -246,7 +246,7 @@ test_expect_success 'A: tag blob by sha1' '
 	INPUT_END
 
 	cat >expect <<-EOF &&
-	object $(git rev-parse refs/heads/master:file3)
+	object $(git rev-parse refs/heads/main:file3)
 	type blob
 	tag series-A-blob-2
 
@@ -287,13 +287,13 @@ test_expect_success 'A: verify pack' '
 '
 
 test_expect_success 'A: verify diff' '
-	copy=$(git rev-parse --verify master:file2) &&
+	copy=$(git rev-parse --verify main:file2) &&
 	cat >expect <<-EOF &&
 	:000000 100755 $ZERO_OID $copy A	copy-of-file2
 	EOF
-	git diff-tree -M -r master verify--import-marks >actual &&
+	git diff-tree -M -r main verify--import-marks >actual &&
 	compare_diff_raw expect actual &&
-	test $(git rev-parse --verify master:file2) \
+	test $(git rev-parse --verify main:file2) \
 	    = $(git rev-parse --verify verify--import-marks:copy-of-file2)
 '
 
@@ -367,7 +367,7 @@ test_expect_success 'B: fail on invalid blob sha1' '
 	corrupt
 	COMMIT
 
-	from refs/heads/master
+	from refs/heads/main
 	M 755 $(echo $ZERO_OID | sed -e "s/0$/1/") zero1
 
 	INPUT_END
@@ -384,7 +384,7 @@ test_expect_success 'B: accept branch name "TEMP_TAG"' '
 	tag base
 	COMMIT
 
-	from refs/heads/master
+	from refs/heads/main
 
 	INPUT_END
 
@@ -393,7 +393,7 @@ test_expect_success 'B: accept branch name "TEMP_TAG"' '
 		git prune" &&
 	git fast-import <input &&
 	test -f .git/TEMP_TAG &&
-	test $(git rev-parse master) = $(git rev-parse TEMP_TAG^)
+	test $(git rev-parse main) = $(git rev-parse TEMP_TAG^)
 '
 
 test_expect_success 'B: accept empty committer' '
@@ -531,8 +531,8 @@ test_expect_success 'B: fail on invalid committer (5)' '
 
 test_expect_success 'C: incremental import create pack from stdin' '
 	newf=$(echo hi newf | git hash-object -w --stdin) &&
-	oldf=$(git rev-parse --verify master:file2) &&
-	thrf=$(git rev-parse --verify master:file3) &&
+	oldf=$(git rev-parse --verify main:file2) &&
+	thrf=$(git rev-parse --verify main:file3) &&
 	test_tick &&
 	cat >input <<-INPUT_END &&
 	commit refs/heads/branch
@@ -541,7 +541,7 @@ test_expect_success 'C: incremental import create pack from stdin' '
 	second
 	COMMIT
 
-	from refs/heads/master
+	from refs/heads/main
 	M 644 $oldf file2/oldf
 	M 755 $newf file2/newf
 	D file3
@@ -563,7 +563,7 @@ test_expect_success 'C: validate reuse existing blob' '
 
 test_expect_success 'C: verify commit' '
 	cat >expect <<-EOF &&
-	parent $(git rev-parse --verify master^0)
+	parent $(git rev-parse --verify main^0)
 	author $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
 	committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
 
@@ -581,7 +581,7 @@ test_expect_success 'C: validate rename result' '
 	:100644 100644 $oldf $oldf R100	file2	file2/oldf
 	:100644 000000 $thrf $zero D	file3
 	EOF
-	git diff-tree -M -r master branch >actual &&
+	git diff-tree -M -r main branch >actual &&
 	compare_diff_raw expect actual
 '
 
@@ -1701,7 +1701,7 @@ test_expect_success 'P: superproject & submodule mix' '
 	committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
 	data 8
 	initial
-	from refs/heads/master
+	from refs/heads/main
 	M 100644 :3 .gitmodules
 	M 160000 :2 sub
 
@@ -1736,8 +1736,8 @@ test_expect_success 'P: superproject & submodule mix' '
 	(
 		cd sub &&
 		git init &&
-		git fetch --update-head-ok .. refs/heads/sub:refs/heads/master &&
-		git checkout master
+		git fetch --update-head-ok .. refs/heads/sub:refs/heads/main &&
+		git checkout main
 	) &&
 	git submodule init &&
 	git submodule update
@@ -1761,7 +1761,7 @@ test_expect_success 'P: verbatim SHA gitlinks' '
 	committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
 	data 8
 	initial
-	from refs/heads/master
+	from refs/heads/main
 	M 100644 :1 .gitmodules
 	M 160000 $SUBPREV sub
 
@@ -3432,8 +3432,8 @@ mark :1
 data 4
 foo
 
-reset refs/heads/master
-commit refs/heads/master
+reset refs/heads/main
+commit refs/heads/main
 mark :2
 author Full Name <user@company.tld> 1000000000 +0100
 committer Full Name <user@company.tld> 1000000000 +0100
@@ -3447,7 +3447,7 @@ data 8
 foo
 bar
 
-commit refs/heads/master
+commit refs/heads/main
 mark :4
 author Full Name <user@company.tld> 1000000001 +0100
 committer Full Name <user@company.tld> 1000000001 +0100
@@ -3464,8 +3464,8 @@ mark :1
 data 4
 foo
 
-reset refs/heads/master
-commit refs/heads/master
+reset refs/heads/main
+commit refs/heads/main
 mark :2
 author Full Name <user@company.tld> 2000000000 +0100
 committer Full Name <user@company.tld> 2000000000 +0100
@@ -3480,7 +3480,7 @@ data 73
 	path = sub1
 	url = https://void.example.com/main.git
 
-commit refs/heads/master
+commit refs/heads/main
 mark :4
 author Full Name <user@company.tld> 2000000001 +0100
 committer Full Name <user@company.tld> 2000000001 +0100
@@ -3496,7 +3496,7 @@ data 8
 foo
 bar
 
-commit refs/heads/master
+commit refs/heads/main
 mark :6
 author Full Name <user@company.tld> 2000000002 +0100
 committer Full Name <user@company.tld> 2000000002 +0100
@@ -3514,8 +3514,8 @@ Y_INPUT_END
 
 test_expect_success 'Y: setup' '
 	test_oid_cache <<-EOF
-	Ymaster sha1:9afed2f9161ddf416c0a1863b8b0725b00070504
-	Ymaster sha256:c0a1010da1df187b2e287654793df01b464bd6f8e3f17fc1481a7dadf84caee3
+	Ymain sha1:9afed2f9161ddf416c0a1863b8b0725b00070504
+	Ymain sha256:c0a1010da1df187b2e287654793df01b464bd6f8e3f17fc1481a7dadf84caee3
 	EOF
 '
 
@@ -3527,7 +3527,7 @@ test_expect_success 'Y: rewrite submodules' '
 		git -C sub2 fast-import --export-marks=../sub2-marks <../Y-sub-input &&
 		git fast-import --rewrite-submodules-from=sub:../Y-marks \
 			--rewrite-submodules-to=sub:sub2-marks <../Y-main-input &&
-		test "$(git rev-parse master)" = "$(test_oid Ymaster)"
+		test "$(git rev-parse main)" = "$(test_oid Ymain)"
 	)
 '
 
diff --git a/t/t9301-fast-import-notes.sh b/t/t9301-fast-import-notes.sh
index 0c5bfbde0e..1ae4d7c0d3 100755
--- a/t/t9301-fast-import-notes.sh
+++ b/t/t9301-fast-import-notes.sh
@@ -4,7 +4,7 @@
 #
 
 test_description='test git fast-import of notes objects'
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -12,7 +12,7 @@ export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 test_tick
 cat >input <<INPUT_END
-commit refs/heads/master
+commit refs/heads/main
 committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
 data <<COMMIT
 first commit
@@ -33,7 +33,7 @@ data <<EOF
 file baz/xyzzy in first commit
 EOF
 
-commit refs/heads/master
+commit refs/heads/main
 committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
 data <<COMMIT
 second commit
@@ -49,7 +49,7 @@ data <<EOF
 file baz/xyzzy in second commit
 EOF
 
-commit refs/heads/master
+commit refs/heads/main
 committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
 data <<COMMIT
 third commit
@@ -60,7 +60,7 @@ data <<EOF
 file foo in third commit
 EOF
 
-commit refs/heads/master
+commit refs/heads/main
 committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
 data <<COMMIT
 fourth commit
@@ -73,13 +73,13 @@ EOF
 
 INPUT_END
 
-test_expect_success 'set up master branch' '
+test_expect_success 'set up main branch' '
 
 	git fast-import <input &&
-	git whatchanged master
+	git whatchanged main
 '
 
-commit4=$(git rev-parse refs/heads/master)
+commit4=$(git rev-parse refs/heads/main)
 commit3=$(git rev-parse "$commit4^")
 commit2=$(git rev-parse "$commit4~2")
 commit1=$(git rev-parse "$commit4~3")
diff --git a/t/t9302-fast-import-unpack-limit.sh b/t/t9302-fast-import-unpack-limit.sh
index bb1c39cfcc..f519e4f1bf 100755
--- a/t/t9302-fast-import-unpack-limit.sh
+++ b/t/t9302-fast-import-unpack-limit.sh
@@ -5,7 +5,7 @@ test_description='test git fast-import unpack limit'
 test_expect_success 'create loose objects on import' '
 	test_tick &&
 	cat >input <<-INPUT_END &&
-	commit refs/heads/master
+	commit refs/heads/main
 	committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
 	data <<COMMIT
 	initial
@@ -23,12 +23,12 @@ test_expect_success 'create loose objects on import' '
 test_expect_success 'bigger packs are preserved' '
 	test_tick &&
 	cat >input <<-INPUT_END &&
-	commit refs/heads/master
+	commit refs/heads/main
 	committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
 	data <<COMMIT
 	incremental should create a pack
 	COMMIT
-	from refs/heads/master^0
+	from refs/heads/main^0
 
 	commit refs/heads/branch
 	committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
@@ -48,7 +48,7 @@ test_expect_success 'bigger packs are preserved' '
 test_expect_success 'lookups after checkpoint works' '
 	hello_id=$(echo hello | git hash-object --stdin -t blob) &&
 	id="$GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE" &&
-	before=$(git rev-parse refs/heads/master^0) &&
+	before=$(git rev-parse refs/heads/main^0) &&
 	(
 		cat <<-INPUT_END &&
 		blob
@@ -56,13 +56,13 @@ test_expect_success 'lookups after checkpoint works' '
 		data 6
 		hello
 
-		commit refs/heads/master
+		commit refs/heads/main
 		mark :2
 		committer $id
 		data <<COMMIT
 		checkpoint after this
 		COMMIT
-		from refs/heads/master^0
+		from refs/heads/main^0
 		M 100644 :1 hello
 
 		# pre-checkpoint
@@ -86,10 +86,10 @@ test_expect_success 'lookups after checkpoint works' '
 				n=$(($n + 1))
 			fi &&
 			sleep 1 &&
-			from=$(git rev-parse refs/heads/master^0)
+			from=$(git rev-parse refs/heads/main^0)
 		done &&
 		cat <<-INPUT_END &&
-		commit refs/heads/master
+		commit refs/heads/main
 		committer $id
 		data <<COMMIT
 		make sure from "unpacked sha1 reference" works, too
diff --git a/t/t9350-fast-export.sh b/t/t9350-fast-export.sh
index 6c8830ece5..409b48e244 100755
--- a/t/t9350-fast-export.sh
+++ b/t/t9350-fast-export.sh
@@ -4,7 +4,7 @@
 #
 
 test_description='git fast-export'
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -34,13 +34,13 @@ test_expect_success 'setup' '
 	git commit -m sitzt file2 &&
 	test_tick &&
 	git tag -a -m valentin muss &&
-	git merge -s ours master
+	git merge -s ours main
 
 '
 
 test_expect_success 'fast-export | fast-import' '
 
-	MASTER=$(git rev-parse --verify master) &&
+	MAIN=$(git rev-parse --verify main) &&
 	REIN=$(git rev-parse --verify rein) &&
 	WER=$(git rev-parse --verify wer) &&
 	MUSS=$(git rev-parse --verify muss) &&
@@ -49,7 +49,7 @@ test_expect_success 'fast-export | fast-import' '
 	git fast-export --all >actual &&
 	(cd new &&
 	 git fast-import &&
-	 test $MASTER = $(git rev-parse --verify refs/heads/master) &&
+	 test $MAIN = $(git rev-parse --verify refs/heads/main) &&
 	 test $REIN = $(git rev-parse --verify refs/tags/rein) &&
 	 test $WER = $(git rev-parse --verify refs/heads/wer) &&
 	 test $MUSS = $(git rev-parse --verify refs/tags/muss)) <actual
@@ -83,35 +83,35 @@ test_expect_success 'fast-export --mark-tags ^muss^{commit} muss' '
 	test_cmp expected actual
 '
 
-test_expect_success 'fast-export master~2..master' '
+test_expect_success 'fast-export main~2..main' '
 
-	git fast-export master~2..master >actual &&
-	sed "s/master/partial/" actual |
+	git fast-export main~2..main >actual &&
+	sed "s/main/partial/" actual |
 		(cd new &&
 		 git fast-import &&
-		 test $MASTER != $(git rev-parse --verify refs/heads/partial) &&
-		 git diff --exit-code master partial &&
-		 git diff --exit-code master^ partial^ &&
+		 test $MAIN != $(git rev-parse --verify refs/heads/partial) &&
+		 git diff --exit-code main partial &&
+		 git diff --exit-code main^ partial^ &&
 		 test_must_fail git rev-parse partial~2)
 
 '
 
-test_expect_success 'fast-export --reference-excluded-parents master~2..master' '
+test_expect_success 'fast-export --reference-excluded-parents main~2..main' '
 
-	git fast-export --reference-excluded-parents master~2..master >actual &&
-	grep commit.refs/heads/master actual >commit-count &&
+	git fast-export --reference-excluded-parents main~2..main >actual &&
+	grep commit.refs/heads/main actual >commit-count &&
 	test_line_count = 2 commit-count &&
-	sed "s/master/rewrite/" actual |
+	sed "s/main/rewrite/" actual |
 		(cd new &&
 		 git fast-import &&
-		 test $MASTER = $(git rev-parse --verify refs/heads/rewrite))
+		 test $MAIN = $(git rev-parse --verify refs/heads/rewrite))
 '
 
 test_expect_success 'fast-export --show-original-ids' '
 
-	git fast-export --show-original-ids master >output &&
+	git fast-export --show-original-ids main >output &&
 	grep ^original-oid output| sed -e s/^original-oid.// | sort >actual &&
-	git rev-list --objects master muss >objects-and-names &&
+	git rev-list --objects main muss >objects-and-names &&
 	awk "{print \$1}" objects-and-names | sort >commits-trees-blobs &&
 	comm -23 actual commits-trees-blobs >unfound &&
 	test_must_be_empty unfound
@@ -119,8 +119,8 @@ test_expect_success 'fast-export --show-original-ids' '
 
 test_expect_success 'fast-export --show-original-ids | git fast-import' '
 
-	git fast-export --show-original-ids master muss | git fast-import --quiet &&
-	test $MASTER = $(git rev-parse --verify refs/heads/master) &&
+	git fast-export --show-original-ids main muss | git fast-import --quiet &&
+	test $MAIN = $(git rev-parse --verify refs/heads/main) &&
 	test $MUSS = $(git rev-parse --verify refs/tags/muss)
 '
 
@@ -203,7 +203,7 @@ test_expect_success 'encoding preserved if reencoding fails' '
 
 test_expect_success 'import/export-marks' '
 
-	git checkout -b marks master &&
+	git checkout -b marks main &&
 	git fast-export --export-marks=tmp-marks HEAD &&
 	test -s tmp-marks &&
 	test_line_count = 3 tmp-marks &&
@@ -268,7 +268,7 @@ test_expect_success 'signed-tags=warn-strip' '
 
 test_expect_success 'setup submodule' '
 
-	git checkout -f master &&
+	git checkout -f main &&
 	mkdir sub &&
 	(
 		cd sub &&
@@ -293,17 +293,17 @@ test_expect_success 'setup submodule' '
 
 test_expect_success 'submodule fast-export | fast-import' '
 
-	SUBENT1=$(git ls-tree master^ sub) &&
-	SUBENT2=$(git ls-tree master sub) &&
+	SUBENT1=$(git ls-tree main^ sub) &&
+	SUBENT2=$(git ls-tree main sub) &&
 	rm -rf new &&
 	mkdir new &&
 	git --git-dir=new/.git init &&
 	git fast-export --signed-tags=strip --all >actual &&
 	(cd new &&
 	 git fast-import &&
-	 test "$SUBENT1" = "$(git ls-tree refs/heads/master^ sub)" &&
-	 test "$SUBENT2" = "$(git ls-tree refs/heads/master sub)" &&
-	 git checkout master &&
+	 test "$SUBENT1" = "$(git ls-tree refs/heads/main^ sub)" &&
+	 test "$SUBENT2" = "$(git ls-tree refs/heads/main sub)" &&
+	 git checkout main &&
 	 git submodule init &&
 	 git submodule update &&
 	 cmp sub/file ../sub/file) <actual
@@ -355,7 +355,7 @@ test_expect_success 'fast-export -C -C | fast-import' '
 
 '
 
-test_expect_success 'fast-export | fast-import when master is tagged' '
+test_expect_success 'fast-export | fast-import when main is tagged' '
 
 	git tag -m msg last &&
 	git fast-export -C -C --signed-tags=strip --all > output &&
@@ -470,8 +470,8 @@ mark :2
 data 3
 hi
 
-reset refs/heads/master
-commit refs/heads/master
+reset refs/heads/main
+commit refs/heads/main
 mark :3
 author A U Thor <author@example.com> 1112912713 -0700
 committer C O Mitter <committer@example.com> 1112912713 -0700
@@ -485,7 +485,7 @@ EOF
 test_expect_failure 'no exact-ref revisions included' '
 	(
 		cd limit-by-paths &&
-		git fast-export master~2..master~1 > output &&
+		git fast-export main~2..main~1 > output &&
 		test_cmp expected output
 	)
 '
@@ -527,7 +527,7 @@ test_expect_success 'full-tree re-shows unmodified files'        '
 '
 
 test_expect_success 'set-up a few more tags for tag export tests' '
-	git checkout -f master &&
+	git checkout -f main &&
 	HEAD_TREE=$(git show -s --pretty=raw HEAD | grep tree | sed "s/tree //") &&
 	git tag    tree_tag        -m "tagging a tree" $HEAD_TREE &&
 	git tag -a tree_tag-obj    -m "tagging a tree" $HEAD_TREE &&
@@ -552,7 +552,7 @@ test_expect_success 'tag-obj_tag'     'git fast-export tag-obj_tag'
 test_expect_success 'tag-obj_tag-obj' 'git fast-export tag-obj_tag-obj'
 
 test_expect_success 'handling tags of blobs' '
-	git tag -a -m "Tag of a blob" blobtag $(git rev-parse master:file) &&
+	git tag -a -m "Tag of a blob" blobtag $(git rev-parse main:file) &&
 	git fast-export blobtag >actual &&
 	cat >expect <<-EOF &&
 	blob
@@ -595,10 +595,10 @@ test_expect_success 'directory becomes symlink'        '
 	) &&
 	(
 		cd dirtosymlink &&
-		git fast-export master -- foo |
+		git fast-export main -- foo |
 		(cd ../result && git fast-import --quiet)
 	) &&
-	(cd result && git show master:foo)
+	(cd result && git show main:foo)
 '
 
 test_expect_success 'fast-export quotes pathnames' '
@@ -646,7 +646,7 @@ mark :13
 data 5
 bump
 
-commit refs/heads/master
+commit refs/heads/main
 mark :14
 author A U Thor <author@example.com> 1112912773 -0700
 committer C O Mitter <committer@example.com> 1112912773 -0700
@@ -660,18 +660,18 @@ EOF
 test_expect_success 'avoid uninteresting refs' '
 	> tmp-marks &&
 	git fast-export --import-marks=tmp-marks \
-		--export-marks=tmp-marks master > /dev/null &&
+		--export-marks=tmp-marks main > /dev/null &&
 	git tag v1.0 &&
 	git branch uninteresting &&
 	echo bump > file &&
 	git commit -a -m bump &&
 	git fast-export --import-marks=tmp-marks \
-		--export-marks=tmp-marks ^uninteresting ^v1.0 master > actual &&
+		--export-marks=tmp-marks ^uninteresting ^v1.0 main > actual &&
 	test_cmp expected actual
 '
 
 cat > expected << EOF
-reset refs/heads/master
+reset refs/heads/main
 from :14
 
 EOF
@@ -679,14 +679,14 @@ EOF
 test_expect_success 'refs are updated even if no commits need to be exported' '
 	> tmp-marks &&
 	git fast-export --import-marks=tmp-marks \
-		--export-marks=tmp-marks master > /dev/null &&
+		--export-marks=tmp-marks main > /dev/null &&
 	git fast-export --import-marks=tmp-marks \
-		--export-marks=tmp-marks master > actual &&
+		--export-marks=tmp-marks main > actual &&
 	test_cmp expected actual
 '
 
 test_expect_success 'use refspec' '
-	git fast-export --refspec refs/heads/master:refs/heads/foobar master >actual2 &&
+	git fast-export --refspec refs/heads/main:refs/heads/foobar main >actual2 &&
 	grep "^commit " actual2 | sort | uniq >actual &&
 	echo "commit refs/heads/foobar" > expected &&
 	test_cmp expected actual
@@ -739,13 +739,13 @@ test_expect_success 'merge commit gets exported with --import-marks' '
 		test_commit initial &&
 		git checkout -b topic &&
 		test_commit on-topic &&
-		git checkout master &&
-		test_commit on-master &&
+		git checkout main &&
+		test_commit on-main &&
 		test_tick &&
 		git merge --no-ff -m Yeah topic &&
 
 		echo ":1 $(git rev-parse HEAD^^)" >marks &&
-		git fast-export --import-marks=marks master >out &&
+		git fast-export --import-marks=marks main >out &&
 		grep Yeah out
 	)
 '
diff --git a/t/t9351-fast-export-anonymize.sh b/t/t9351-fast-export-anonymize.sh
index 4130c8a837..1c6e6fcdaf 100755
--- a/t/t9351-fast-export-anonymize.sh
+++ b/t/t9351-fast-export-anonymize.sh
@@ -1,7 +1,7 @@
 #!/bin/sh
 
 test_description='basic tests for fast-export --anonymize'
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -54,7 +54,7 @@ test_expect_success 'stream retains other as refname' '
 '
 
 test_expect_success 'stream omits other refnames' '
-	! grep master stream &&
+	! grep main stream &&
 	! grep mytag stream
 '
 
@@ -88,7 +88,7 @@ test_expect_success 'repo has original shape and timestamps' '
 	shape () {
 		git log --format="%m %ct" --left-right --boundary "$@"
 	} &&
-	(cd .. && shape master...other) >expect &&
+	(cd .. && shape main...other) >expect &&
 	shape $main_branch...$other_branch >actual &&
 	test_cmp expect actual
 '
diff --git a/t/t9400-git-cvsserver-server.sh b/t/t9400-git-cvsserver-server.sh
index 7d23e6ba94..2d29d486ee 100755
--- a/t/t9400-git-cvsserver-server.sh
+++ b/t/t9400-git-cvsserver-server.sh
@@ -8,7 +8,7 @@ test_description='git-cvsserver access
 tests read access to a git repository with the
 cvs CLI client via git-cvsserver server'
 
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -48,7 +48,7 @@ test_expect_success 'setup' '
   touch secondrootfile &&
   git add secondrootfile &&
   git commit -m "second root") &&
-  git fetch secondroot master &&
+  git fetch secondroot main &&
   git merge --allow-unrelated-histories FETCH_HEAD &&
   git clone -q --bare "$WORKDIR/.git" "$SERVERDIR" >/dev/null 2>&1 &&
   GIT_DIR="$SERVERDIR" git config --bool gitcvs.enabled true &&
@@ -60,7 +60,7 @@ test_expect_success 'setup' '
 # note that cvs doesn't accept absolute pathnames
 # as argument to co -d
 test_expect_success 'basic checkout' \
-  'GIT_CONFIG="$git_config" cvs -Q co -d cvswork master &&
+  'GIT_CONFIG="$git_config" cvs -Q co -d cvswork main &&
    test "$(echo $(grep -v ^D cvswork/CVS/Entries|cut -d/ -f2,3,5 | head -n 1))" = "empty/1.1/" &&
    test "$(echo $(grep -v ^D cvswork/CVS/Entries|cut -d/ -f2,3,5 | sed -ne \$p))" = "secondrootfile/1.1/"'
 
@@ -229,7 +229,7 @@ GIT_DIR="$SERVERDIR" git config --bool gitcvs.enabled true || exit 1
 
 test_expect_success 'gitcvs.enabled = false' \
   'GIT_DIR="$SERVERDIR" git config --bool gitcvs.enabled false &&
-   if GIT_CONFIG="$git_config" cvs -Q co -d cvswork2 master >cvs.log 2>&1
+   if GIT_CONFIG="$git_config" cvs -Q co -d cvswork2 main >cvs.log 2>&1
    then
      echo unexpected cvs success
      false
@@ -243,14 +243,14 @@ rm -fr cvswork2
 test_expect_success 'gitcvs.ext.enabled = true' \
   'GIT_DIR="$SERVERDIR" git config --bool gitcvs.ext.enabled true &&
    GIT_DIR="$SERVERDIR" git config --bool gitcvs.enabled false &&
-   GIT_CONFIG="$git_config" cvs -Q co -d cvswork2 master >cvs.log 2>&1 &&
+   GIT_CONFIG="$git_config" cvs -Q co -d cvswork2 main >cvs.log 2>&1 &&
    test_cmp cvswork cvswork2'
 
 rm -fr cvswork2
 test_expect_success 'gitcvs.ext.enabled = false' \
   'GIT_DIR="$SERVERDIR" git config --bool gitcvs.ext.enabled false &&
    GIT_DIR="$SERVERDIR" git config --bool gitcvs.enabled true &&
-   if GIT_CONFIG="$git_config" cvs -Q co -d cvswork2 master >cvs.log 2>&1
+   if GIT_CONFIG="$git_config" cvs -Q co -d cvswork2 main >cvs.log 2>&1
    then
      echo unexpected cvs success
      false
@@ -264,21 +264,21 @@ rm -fr cvswork2
 test_expect_success 'gitcvs.dbname' \
   'GIT_DIR="$SERVERDIR" git config --bool gitcvs.ext.enabled true &&
    GIT_DIR="$SERVERDIR" git config gitcvs.dbname %Ggitcvs.%a.%m.sqlite &&
-   GIT_CONFIG="$git_config" cvs -Q co -d cvswork2 master >cvs.log 2>&1 &&
+   GIT_CONFIG="$git_config" cvs -Q co -d cvswork2 main >cvs.log 2>&1 &&
    test_cmp cvswork cvswork2 &&
-   test -f "$SERVERDIR/gitcvs.ext.master.sqlite" &&
-   cmp "$SERVERDIR/gitcvs.master.sqlite" "$SERVERDIR/gitcvs.ext.master.sqlite"'
+   test -f "$SERVERDIR/gitcvs.ext.main.sqlite" &&
+   cmp "$SERVERDIR/gitcvs.main.sqlite" "$SERVERDIR/gitcvs.ext.main.sqlite"'
 
 rm -fr cvswork2
 test_expect_success 'gitcvs.ext.dbname' \
   'GIT_DIR="$SERVERDIR" git config --bool gitcvs.ext.enabled true &&
    GIT_DIR="$SERVERDIR" git config gitcvs.ext.dbname %Ggitcvs1.%a.%m.sqlite &&
    GIT_DIR="$SERVERDIR" git config gitcvs.dbname %Ggitcvs2.%a.%m.sqlite &&
-   GIT_CONFIG="$git_config" cvs -Q co -d cvswork2 master >cvs.log 2>&1 &&
+   GIT_CONFIG="$git_config" cvs -Q co -d cvswork2 main >cvs.log 2>&1 &&
    test_cmp cvswork cvswork2 &&
-   test -f "$SERVERDIR/gitcvs1.ext.master.sqlite" &&
-   test ! -f "$SERVERDIR/gitcvs2.ext.master.sqlite" &&
-   cmp "$SERVERDIR/gitcvs.master.sqlite" "$SERVERDIR/gitcvs1.ext.master.sqlite"'
+   test -f "$SERVERDIR/gitcvs1.ext.main.sqlite" &&
+   test ! -f "$SERVERDIR/gitcvs2.ext.main.sqlite" &&
+   cmp "$SERVERDIR/gitcvs.main.sqlite" "$SERVERDIR/gitcvs1.ext.main.sqlite"'
 
 
 #------------
@@ -460,7 +460,7 @@ cd "$WORKDIR"
 test_expect_success 'cvs update (module list supports packed refs)' '
     GIT_DIR="$SERVERDIR" git pack-refs --all &&
     GIT_CONFIG="$git_config" cvs -n up -d 2> out &&
-    grep "cvs update: New directory \`master'\''" < out
+    grep "cvs update: New directory \`main'\''" < out
 '
 
 #------------
@@ -502,8 +502,8 @@ test_expect_success 'cvs status (no subdirs in header)' '
 cd "$WORKDIR"
 test_expect_success 'cvs co -c (shows module database)' '
     GIT_CONFIG="$git_config" cvs co -c > out &&
-    grep "^master[	 ][ 	]*master$" <out &&
-    ! grep -v "^master[	 ][ 	]*master$" <out
+    grep "^main[	 ][ 	]*main$" <out &&
+    ! grep -v "^main[	 ][ 	]*main$" <out
 '
 
 #------------
@@ -529,7 +529,7 @@ test_expect_success 'cvs co -c (shows module database)' '
 
 sed -e 's/^x//' -e 's/SP$/ /' > "$WORKDIR/expect" <<EOF
 x
-xRCS file: $WORKDIR/gitcvs.git/master/merge,v
+xRCS file: $WORKDIR/gitcvs.git/main/merge,v
 xWorking file: merge
 xhead: 1.4
 xbranch:
diff --git a/t/t9401-git-cvsserver-crlf.sh b/t/t9401-git-cvsserver-crlf.sh
index 0062341dbf..a34805acdc 100755
--- a/t/t9401-git-cvsserver-crlf.sh
+++ b/t/t9401-git-cvsserver-crlf.sh
@@ -9,7 +9,7 @@ test_description='git-cvsserver -kb modes
 tests -kb mode for binary files when accessing a git
 repository using cvs CLI client via git-cvsserver server'
 
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -108,14 +108,14 @@ test_expect_success 'setup' '
 '
 
 test_expect_success 'cvs co (default crlf)' '
-    GIT_CONFIG="$git_config" cvs -Q co -d cvswork master >cvs.log 2>&1 &&
+    GIT_CONFIG="$git_config" cvs -Q co -d cvswork main >cvs.log 2>&1 &&
     test x"$(grep '/-k' cvswork/CVS/Entries cvswork/subdir/CVS/Entries)" = x""
 '
 
 rm -rf cvswork
 test_expect_success 'cvs co (allbinary)' '
     GIT_DIR="$SERVERDIR" git config --bool gitcvs.allbinary true &&
-    GIT_CONFIG="$git_config" cvs -Q co -d cvswork master >cvs.log 2>&1 &&
+    GIT_CONFIG="$git_config" cvs -Q co -d cvswork main >cvs.log 2>&1 &&
     marked_as cvswork textfile.c -kb &&
     marked_as cvswork binfile.bin -kb &&
     marked_as cvswork .gitattributes -kb &&
@@ -128,7 +128,7 @@ test_expect_success 'cvs co (allbinary)' '
 rm -rf cvswork cvs.log
 test_expect_success 'cvs co (use attributes/allbinary)' '
     GIT_DIR="$SERVERDIR" git config --bool gitcvs.usecrlfattr true &&
-    GIT_CONFIG="$git_config" cvs -Q co -d cvswork master >cvs.log 2>&1 &&
+    GIT_CONFIG="$git_config" cvs -Q co -d cvswork main >cvs.log 2>&1 &&
     marked_as cvswork textfile.c "" &&
     marked_as cvswork binfile.bin -kb &&
     marked_as cvswork .gitattributes -kb &&
@@ -141,7 +141,7 @@ test_expect_success 'cvs co (use attributes/allbinary)' '
 rm -rf cvswork
 test_expect_success 'cvs co (use attributes)' '
     GIT_DIR="$SERVERDIR" git config --bool gitcvs.allbinary false &&
-    GIT_CONFIG="$git_config" cvs -Q co -d cvswork master >cvs.log 2>&1 &&
+    GIT_CONFIG="$git_config" cvs -Q co -d cvswork main >cvs.log 2>&1 &&
     marked_as cvswork textfile.c "" &&
     marked_as cvswork binfile.bin -kb &&
     marked_as cvswork .gitattributes "" &&
@@ -197,7 +197,7 @@ test_expect_success 'updating' '
 rm -rf cvswork
 test_expect_success 'cvs co (use attributes/guess)' '
     GIT_DIR="$SERVERDIR" git config gitcvs.allbinary guess &&
-    GIT_CONFIG="$git_config" cvs -Q co -d cvswork master >cvs.log 2>&1 &&
+    GIT_CONFIG="$git_config" cvs -Q co -d cvswork main >cvs.log 2>&1 &&
     marked_as cvswork textfile.c "" &&
     marked_as cvswork binfile.bin -kb &&
     marked_as cvswork .gitattributes "" &&
@@ -227,7 +227,7 @@ test_expect_success 'setup multi-line files' '
 rm -rf cvswork
 test_expect_success 'cvs co (guess)' '
     GIT_DIR="$SERVERDIR" git config --bool gitcvs.usecrlfattr false &&
-    GIT_CONFIG="$git_config" cvs -Q co -d cvswork master >cvs.log 2>&1 &&
+    GIT_CONFIG="$git_config" cvs -Q co -d cvswork main >cvs.log 2>&1 &&
     marked_as cvswork textfile.c "" &&
     marked_as cvswork binfile.bin -kb &&
     marked_as cvswork .gitattributes "" &&
@@ -242,7 +242,7 @@ test_expect_success 'cvs co (guess)' '
 '
 
 test_expect_success 'cvs co another copy (guess)' '
-    GIT_CONFIG="$git_config" cvs -Q co -d cvswork2 master >cvs.log 2>&1 &&
+    GIT_CONFIG="$git_config" cvs -Q co -d cvswork2 main >cvs.log 2>&1 &&
     marked_as cvswork2 textfile.c "" &&
     marked_as cvswork2 binfile.bin -kb &&
     marked_as cvswork2 .gitattributes "" &&
@@ -338,7 +338,7 @@ test_expect_success 'update subdir of other copy (guess)' '
 
 echo "starting update/merge" >> "${WORKDIR}/marked.log"
 test_expect_success 'update/merge full other copy (guess)' '
-    git pull gitcvs.git master &&
+    git pull gitcvs.git main &&
     sed "s/3/replaced_3/" < multilineTxt.c > ml.temp &&
     mv ml.temp multilineTxt.c &&
     git add multilineTxt.c &&
diff --git a/t/t9402-git-cvsserver-refs.sh b/t/t9402-git-cvsserver-refs.sh
index 33b6db1648..2ee41f9443 100755
--- a/t/t9402-git-cvsserver-refs.sh
+++ b/t/t9402-git-cvsserver-refs.sh
@@ -5,7 +5,7 @@ test_description='git-cvsserver and git refspecs
 tests ability for git-cvsserver to switch between and compare
 tags, branches and other git refspecs'
 
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
@@ -118,7 +118,7 @@ test_expect_success 'setup v1, b1' '
 
 rm -rf cvswork
 test_expect_success 'cvs co v1' '
-	cvs -f -Q co -r v1 -d cvswork master >cvs.log 2>&1 &&
+	cvs -f -Q co -r v1 -d cvswork main >cvs.log 2>&1 &&
 	check_start_tree cvswork &&
 	check_file cvswork textfile.c v1 &&
 	check_file cvswork t2 v1 &&
@@ -131,7 +131,7 @@ test_expect_success 'cvs co v1' '
 
 rm -rf cvswork
 test_expect_success 'cvs co b1' '
-	cvs -f co -r b1 -d cvswork master >cvs.log 2>&1 &&
+	cvs -f co -r b1 -d cvswork main >cvs.log 2>&1 &&
 	check_start_tree cvswork &&
 	check_file cvswork textfile.c v1 &&
 	check_file cvswork t2 v1 &&
@@ -143,7 +143,7 @@ test_expect_success 'cvs co b1' '
 '
 
 test_expect_success 'cvs co b1 [cvswork3]' '
-	cvs -f co -r b1 -d cvswork3 master >cvs.log 2>&1 &&
+	cvs -f co -r b1 -d cvswork3 main >cvs.log 2>&1 &&
 	check_start_tree cvswork3 &&
 	check_file cvswork3 textfile.c v1 &&
 	check_file cvswork3 t2 v1 &&
@@ -268,7 +268,7 @@ test_expect_success 'setup simple b2' '
 '
 
 test_expect_success 'cvs co b2 [into cvswork2]' '
-	cvs -f co -r b2 -d cvswork2 master >cvs.log 2>&1 &&
+	cvs -f co -r b2 -d cvswork2 main >cvs.log 2>&1 &&
 	check_start_tree cvswork &&
 	check_file cvswork textfile.c v1 &&
 	check_file cvswork t2 v1 &&
-- 
gitgitgadget


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH v3 25/28] t9[5-7]*: adjust the references to the default branch name "main"
  2020-11-18 23:44   ` [PATCH v3 00/28] tests: use main as default branch name Johannes Schindelin via GitGitGadget
                       ` (23 preceding siblings ...)
  2020-11-18 23:44     ` [PATCH v3 24/28] t9[0-4]*: " Johannes Schindelin via GitGitGadget
@ 2020-11-18 23:44     ` Johannes Schindelin via GitGitGadget
  2020-11-18 23:44     ` [PATCH v3 26/28] tests(git-p4): transition to the default branch name `main` Johannes Schindelin via GitGitGadget
                       ` (3 subsequent siblings)
  28 siblings, 0 replies; 163+ messages in thread
From: Johannes Schindelin via GitGitGadget @ 2020-11-18 23:44 UTC (permalink / raw)
  To: git
  Cc: Felipe Contreras, Ævar Arnfjörð Bjarmason,
	Johannes Schindelin, Jeff King, Jonathan Nieder,
	Johannes Schindelin, Johannes Schindelin

From: Johannes Schindelin <johannes.schindelin@gmx.de>

This trick was performed via

	$ (cd t &&
	   sed -i -e 's/master/main/g' -e 's/MASTER/MAIN/g' \
		-e 's/Master/Main/g' -- t9[5-7]*.sh lib-cvs.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>
---
 t/lib-cvs.sh                              |  2 +-
 t/t9500-gitweb-standalone-no-errors.sh    | 22 +++++++++++-----------
 t/t9501-gitweb-standalone-http-status.sh  | 16 ++++++++--------
 t/t9502-gitweb-standalone-parse-output.sh | 18 +++++++++---------
 t/t9600-cvsimport.sh                      |  4 ++--
 t/t9601-cvsimport-vendor-branch.sh        | 18 +++++++++---------
 t/t9602-cvsimport-branches-tags.sh        |  6 +++---
 t/t9603-cvsimport-patchsets.sh            | 10 +++++-----
 8 files changed, 48 insertions(+), 48 deletions(-)

diff --git a/t/lib-cvs.sh b/t/lib-cvs.sh
index 9b2bcfb1b0..32b3473379 100644
--- a/t/lib-cvs.sh
+++ b/t/lib-cvs.sh
@@ -36,7 +36,7 @@ setup_cvs_test_repository () {
 test_cvs_co () {
 	# Usage: test_cvs_co BRANCH_NAME
 	rm -rf module-cvs-"$1"
-	if [ "$1" = "master" ]
+	if [ "$1" = "main" ]
 	then
 		$CVS co -P -d module-cvs-"$1" -A module
 	else
diff --git a/t/t9500-gitweb-standalone-no-errors.sh b/t/t9500-gitweb-standalone-no-errors.sh
index fa36bf5e83..ee8c6e30e6 100755
--- a/t/t9500-gitweb-standalone-no-errors.sh
+++ b/t/t9500-gitweb-standalone-no-errors.sh
@@ -10,7 +10,7 @@ commandline, and checks that it would not write any errors
 or warnings to log.'
 
 
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./gitweb-lib.sh
@@ -330,7 +330,7 @@ test_expect_success \
 	 echo "Branch" >>b &&
 	 git add b &&
 	 git commit -a -m "On branch" &&
-	 git checkout master &&
+	 git checkout main &&
 	 git merge b &&
 	 git tag merge_commit'
 
@@ -367,7 +367,7 @@ test_expect_success \
 	 echo "Changed and have mode changed" >07-change-mode-change &&
 	 test_chmod +x 07-change-mode-change &&
 	 git commit -a -m "Large commit" &&
-	 git checkout master'
+	 git checkout main'
 
 test_expect_success \
 	'commit(1): large commit' \
@@ -405,7 +405,7 @@ test_expect_success 'side-by-side: merge commit' '
 
 test_expect_success \
 	'tags: list of different types of tags' \
-	'git checkout master &&
+	'git checkout main &&
 	 git tag -a -m "Tag commit object" tag-commit HEAD &&
 	 git tag -a -m "" tag-commit-nomessage HEAD &&
 	 git tag -a -m "Tag tag object" tag-tag tag-commit &&
@@ -446,7 +446,7 @@ test_expect_success \
 
 test_expect_success \
 	'logs: history (implicit HEAD, deleted file)' \
-	'git checkout master &&
+	'git checkout main &&
 	 echo "to be deleted" >deleted_file &&
 	 git add deleted_file &&
 	 git commit -m "Add file to be deleted" &&
@@ -466,11 +466,11 @@ test_expect_success \
 
 test_expect_success \
 	'path_info: project/branch:file' \
-	'gitweb_run "" "/.git/master:file"'
+	'gitweb_run "" "/.git/main:file"'
 
 test_expect_success \
 	'path_info: project/branch:dir/' \
-	'gitweb_run "" "/.git/master:foo/"'
+	'gitweb_run "" "/.git/main:foo/"'
 
 test_expect_success \
 	'path_info: project/branch (non-existent)' \
@@ -482,16 +482,16 @@ test_expect_success \
 
 test_expect_success \
 	'path_info: project/branch:file (non-existent)' \
-	'gitweb_run "" "/.git/master:non-existent"'
+	'gitweb_run "" "/.git/main:non-existent"'
 
 test_expect_success \
 	'path_info: project/branch:dir/ (non-existent)' \
-	'gitweb_run "" "/.git/master:non-existent/"'
+	'gitweb_run "" "/.git/main:non-existent/"'
 
 
 test_expect_success \
 	'path_info: project/branch:/file' \
-	'gitweb_run "" "/.git/master:/file"'
+	'gitweb_run "" "/.git/main:/file"'
 
 test_expect_success \
 	'path_info: project/:/file (implicit HEAD)' \
@@ -804,7 +804,7 @@ test_expect_success \
 		git checkout orphan_branch ||
 		git checkout --orphan orphan_branch
 	 } &&
-	 test_when_finished "git checkout master" &&
+	 test_when_finished "git checkout main" &&
 	 gitweb_run "p=.git;a=summary"'
 
 test_done
diff --git a/t/t9501-gitweb-standalone-http-status.sh b/t/t9501-gitweb-standalone-http-status.sh
index 6b0adf28d2..141610de54 100755
--- a/t/t9501-gitweb-standalone-http-status.sh
+++ b/t/t9501-gitweb-standalone-http-status.sh
@@ -10,7 +10,7 @@ commandline, and checks that it returns the expected HTTP status
 code and message.'
 
 
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./gitweb-lib.sh
@@ -88,7 +88,7 @@ test_debug 'cat gitweb.headers'
 # snapshot hash ids
 
 test_expect_success 'snapshots: good tree-ish id' '
-	gitweb_run "p=.git;a=snapshot;h=master;sf=tgz" &&
+	gitweb_run "p=.git;a=snapshot;h=main;sf=tgz" &&
 	grep "Status: 200 OK" gitweb.output
 '
 test_debug 'cat gitweb.headers'
@@ -126,7 +126,7 @@ test_debug 'cat gitweb.output'
 # modification times (Last-Modified and If-Modified-Since)
 
 test_expect_success DATE_PARSER 'modification: feed last-modified' '
-	gitweb_run "p=.git;a=atom;h=master" &&
+	gitweb_run "p=.git;a=atom;h=main" &&
 	grep "Status: 200 OK" gitweb.headers &&
 	grep "Last-modified: Thu, 7 Apr 2005 22:14:13 +0000" gitweb.headers
 '
@@ -136,7 +136,7 @@ test_expect_success DATE_PARSER 'modification: feed if-modified-since (modified)
 	HTTP_IF_MODIFIED_SINCE="Wed, 6 Apr 2005 22:14:13 +0000" &&
 	export HTTP_IF_MODIFIED_SINCE &&
 	test_when_finished "unset HTTP_IF_MODIFIED_SINCE" &&
-	gitweb_run "p=.git;a=atom;h=master" &&
+	gitweb_run "p=.git;a=atom;h=main" &&
 	grep "Status: 200 OK" gitweb.headers
 '
 test_debug 'cat gitweb.headers'
@@ -145,13 +145,13 @@ test_expect_success DATE_PARSER 'modification: feed if-modified-since (unmodifie
 	HTTP_IF_MODIFIED_SINCE="Thu, 7 Apr 2005 22:14:13 +0000" &&
 	export HTTP_IF_MODIFIED_SINCE &&
 	test_when_finished "unset HTTP_IF_MODIFIED_SINCE" &&
-	gitweb_run "p=.git;a=atom;h=master" &&
+	gitweb_run "p=.git;a=atom;h=main" &&
 	grep "Status: 304 Not Modified" gitweb.headers
 '
 test_debug 'cat gitweb.headers'
 
 test_expect_success DATE_PARSER 'modification: snapshot last-modified' '
-	gitweb_run "p=.git;a=snapshot;h=master;sf=tgz" &&
+	gitweb_run "p=.git;a=snapshot;h=main;sf=tgz" &&
 	grep "Status: 200 OK" gitweb.headers &&
 	grep "Last-modified: Thu, 7 Apr 2005 22:14:13 +0000" gitweb.headers
 '
@@ -161,7 +161,7 @@ test_expect_success DATE_PARSER 'modification: snapshot if-modified-since (modif
 	HTTP_IF_MODIFIED_SINCE="Wed, 6 Apr 2005 22:14:13 +0000" &&
 	export HTTP_IF_MODIFIED_SINCE &&
 	test_when_finished "unset HTTP_IF_MODIFIED_SINCE" &&
-	gitweb_run "p=.git;a=snapshot;h=master;sf=tgz" &&
+	gitweb_run "p=.git;a=snapshot;h=main;sf=tgz" &&
 	grep "Status: 200 OK" gitweb.headers
 '
 test_debug 'cat gitweb.headers'
@@ -170,7 +170,7 @@ test_expect_success DATE_PARSER 'modification: snapshot if-modified-since (unmod
 	HTTP_IF_MODIFIED_SINCE="Thu, 7 Apr 2005 22:14:13 +0000" &&
 	export HTTP_IF_MODIFIED_SINCE &&
 	test_when_finished "unset HTTP_IF_MODIFIED_SINCE" &&
-	gitweb_run "p=.git;a=snapshot;h=master;sf=tgz" &&
+	gitweb_run "p=.git;a=snapshot;h=main;sf=tgz" &&
 	grep "Status: 304 Not Modified" gitweb.headers
 '
 test_debug 'cat gitweb.headers'
diff --git a/t/t9502-gitweb-standalone-parse-output.sh b/t/t9502-gitweb-standalone-parse-output.sh
index 76d90eccd8..9cf7ab30a8 100755
--- a/t/t9502-gitweb-standalone-parse-output.sh
+++ b/t/t9502-gitweb-standalone-parse-output.sh
@@ -10,7 +10,7 @@ commandline, and checks that it produces the correct output, either
 in the HTTP header or the actual script output.'
 
 
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./gitweb-lib.sh
@@ -82,10 +82,10 @@ test_expect_success 'snapshot: HEAD' '
 '
 test_debug 'cat gitweb.headers && cat file_list'
 
-test_expect_success 'snapshot: short branch name (master)' '
-	gitweb_run "p=.git;a=snapshot;h=master;sf=tar" &&
-	ID=$(git rev-parse --verify --short=7 master) &&
-	check_snapshot ".git-master-$ID"
+test_expect_success 'snapshot: short branch name (main)' '
+	gitweb_run "p=.git;a=snapshot;h=main;sf=tar" &&
+	ID=$(git rev-parse --verify --short=7 main) &&
+	check_snapshot ".git-main-$ID"
 '
 test_debug 'cat gitweb.headers && cat file_list'
 
@@ -96,10 +96,10 @@ test_expect_success 'snapshot: short tag name (first)' '
 '
 test_debug 'cat gitweb.headers && cat file_list'
 
-test_expect_success 'snapshot: full branch name (refs/heads/master)' '
-	gitweb_run "p=.git;a=snapshot;h=refs/heads/master;sf=tar" &&
-	ID=$(git rev-parse --verify --short=7 master) &&
-	check_snapshot ".git-master-$ID"
+test_expect_success 'snapshot: full branch name (refs/heads/main)' '
+	gitweb_run "p=.git;a=snapshot;h=refs/heads/main;sf=tar" &&
+	ID=$(git rev-parse --verify --short=7 main) &&
+	check_snapshot ".git-main-$ID"
 '
 test_debug 'cat gitweb.headers && cat file_list'
 
diff --git a/t/t9600-cvsimport.sh b/t/t9600-cvsimport.sh
index 9257d664f2..5680849218 100755
--- a/t/t9600-cvsimport.sh
+++ b/t/t9600-cvsimport.sh
@@ -1,7 +1,7 @@
 #!/bin/sh
 
 test_description='git cvsimport basic tests'
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./lib-cvs.sh
@@ -162,6 +162,6 @@ test_expect_success PERL 'no .git/cvs-revisions created by default' '
 
 '
 
-test_expect_success PERL 'test entire HEAD' 'test_cmp_branch_tree master'
+test_expect_success PERL 'test entire HEAD' 'test_cmp_branch_tree main'
 
 test_done
diff --git a/t/t9601-cvsimport-vendor-branch.sh b/t/t9601-cvsimport-vendor-branch.sh
index 700c2688d2..116cddba3a 100755
--- a/t/t9601-cvsimport-vendor-branch.sh
+++ b/t/t9601-cvsimport-vendor-branch.sh
@@ -32,7 +32,7 @@
 #       tag has been removed.
 
 test_description='git cvsimport handling of vendor branches'
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./lib-cvs.sh
@@ -45,43 +45,43 @@ test_expect_success PERL 'import a module with a vendor branch' '
 
 '
 
-test_expect_success PERL 'check HEAD out of cvs repository' 'test_cvs_co master'
+test_expect_success PERL 'check HEAD out of cvs repository' 'test_cvs_co main'
 
-test_expect_success PERL 'check master out of git repository' 'test_git_co master'
+test_expect_success PERL 'check main out of git repository' 'test_git_co main'
 
 test_expect_success PERL 'check a file that was imported once' '
 
-	test_cmp_branch_file master imported-once.txt
+	test_cmp_branch_file main imported-once.txt
 
 '
 
 test_expect_failure PERL 'check a file that was imported twice' '
 
-	test_cmp_branch_file master imported-twice.txt
+	test_cmp_branch_file main imported-twice.txt
 
 '
 
 test_expect_success PERL 'check a file that was imported then modified on HEAD' '
 
-	test_cmp_branch_file master imported-modified.txt
+	test_cmp_branch_file main imported-modified.txt
 
 '
 
 test_expect_success PERL 'check a file that was imported, modified, then imported again' '
 
-	test_cmp_branch_file master imported-modified-imported.txt
+	test_cmp_branch_file main imported-modified-imported.txt
 
 '
 
 test_expect_success PERL 'check a file that was added to HEAD then imported' '
 
-	test_cmp_branch_file master added-imported.txt
+	test_cmp_branch_file main added-imported.txt
 
 '
 
 test_expect_success PERL 'a vendor branch whose tag has been removed' '
 
-	test_cmp_branch_file master imported-anonymously.txt
+	test_cmp_branch_file main imported-anonymously.txt
 
 '
 
diff --git a/t/t9602-cvsimport-branches-tags.sh b/t/t9602-cvsimport-branches-tags.sh
index 7b1fb36e67..e5266c9a87 100755
--- a/t/t9602-cvsimport-branches-tags.sh
+++ b/t/t9602-cvsimport-branches-tags.sh
@@ -4,7 +4,7 @@
 # t9602/README.
 
 test_description='git cvsimport handling of branches and tags'
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./lib-cvs.sh
@@ -17,9 +17,9 @@ test_expect_success PERL 'import module' '
 
 '
 
-test_expect_success PERL 'test branch master' '
+test_expect_success PERL 'test branch main' '
 
-	test_cmp_branch_tree master
+	test_cmp_branch_tree main
 
 '
 
diff --git a/t/t9603-cvsimport-patchsets.sh b/t/t9603-cvsimport-patchsets.sh
index 87cd8c0c6b..0e9daa5768 100755
--- a/t/t9603-cvsimport-patchsets.sh
+++ b/t/t9603-cvsimport-patchsets.sh
@@ -12,7 +12,7 @@
 # bug.
 
 test_description='git cvsimport testing for correct patchset estimation'
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./lib-cvs.sh
@@ -23,16 +23,16 @@ test_expect_failure PERL 'import with criss cross times on revisions' '
 	git cvsimport -p"-x" -C module-git module &&
 	(
 		cd module-git &&
-		git log --pretty=format:%s > ../actual-master &&
+		git log --pretty=format:%s > ../actual-main &&
 		git log A~2..A --pretty="format:%s %ad" -- > ../actual-A &&
-		echo "" >> ../actual-master &&
+		echo "" >> ../actual-main &&
 		echo "" >> ../actual-A
 	) &&
 	echo "Rev 4
 Rev 3
 Rev 2
-Rev 1" > expect-master &&
-	test_cmp expect-master actual-master &&
+Rev 1" > expect-main &&
+	test_cmp expect-main actual-main &&
 
 	echo "Rev 5 Branch A Wed Mar 11 19:09:10 2009 +0000
 Rev 4 Branch A Wed Mar 11 19:03:52 2009 +0000" > expect-A &&
-- 
gitgitgadget


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH v3 26/28] tests(git-p4): transition to the default branch name `main`
  2020-11-18 23:44   ` [PATCH v3 00/28] tests: use main as default branch name Johannes Schindelin via GitGitGadget
                       ` (24 preceding siblings ...)
  2020-11-18 23:44     ` [PATCH v3 25/28] t9[5-7]*: " Johannes Schindelin via GitGitGadget
@ 2020-11-18 23:44     ` Johannes Schindelin via GitGitGadget
  2020-11-18 23:44     ` [PATCH v3 27/28] t99*: adjust the references to the default branch name "main" Johannes Schindelin via GitGitGadget
                       ` (2 subsequent siblings)
  28 siblings, 0 replies; 163+ messages in thread
From: Johannes Schindelin via GitGitGadget @ 2020-11-18 23:44 UTC (permalink / raw)
  To: git
  Cc: Felipe Contreras, Ævar Arnfjörð Bjarmason,
	Johannes Schindelin, Jeff King, Jonathan Nieder,
	Johannes Schindelin, Johannes Schindelin

From: Johannes Schindelin <johannes.schindelin@gmx.de>

In the previous commits, we adjusted the test suite to use the branch
name `main` for initial branches.

The `git p4`-related tests are a bit harder to adjust because `git p4`
uses the ref `refs/heads/p4/master` to track the remote branches, and
for now, we do not want to change that (this might be the subject of a
future patch series). We only need to adjust for the actual initial
branch name to be changed to `main`.

This allows us to define `GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main`
for those tests.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
---
 t/t9800-git-p4-basic.sh        |  4 ++--
 t/t9801-git-p4-branch.sh       | 18 +++++++++---------
 t/t9806-git-p4-options.sh      | 20 ++++++++++----------
 t/t9807-git-p4-submit.sh       |  4 ++--
 t/t9811-git-p4-label-import.sh |  4 ++--
 5 files changed, 25 insertions(+), 25 deletions(-)

diff --git a/t/t9800-git-p4-basic.sh b/t/t9800-git-p4-basic.sh
index c920b84778..81bc8e8da1 100755
--- a/t/t9800-git-p4-basic.sh
+++ b/t/t9800-git-p4-basic.sh
@@ -2,7 +2,7 @@
 
 test_description='git p4 tests'
 
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./lib-git-p4.sh
@@ -229,7 +229,7 @@ test_expect_success 'clone --bare should make a bare repository' '
 		git config --get --bool core.bare true &&
 		git rev-parse --verify refs/remotes/p4/master &&
 		git rev-parse --verify refs/remotes/p4/HEAD &&
-		git rev-parse --verify refs/heads/master &&
+		git rev-parse --verify refs/heads/main &&
 		git rev-parse --verify HEAD
 	)
 '
diff --git a/t/t9801-git-p4-branch.sh b/t/t9801-git-p4-branch.sh
index ebfe9d8195..56e64697a8 100755
--- a/t/t9801-git-p4-branch.sh
+++ b/t/t9801-git-p4-branch.sh
@@ -2,7 +2,7 @@
 
 test_description='git p4 tests for p4 branches'
 
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./lib-git-p4.sh
@@ -70,7 +70,7 @@ test_expect_success 'import main, no branch detection' '
 	(
 		cd "$git" &&
 		git log --oneline --graph --decorate --all &&
-		git rev-list master -- >wc &&
+		git rev-list main -- >wc &&
 		test_line_count = 4 wc
 	)
 '
@@ -81,7 +81,7 @@ test_expect_success 'import branch1, no branch detection' '
 	(
 		cd "$git" &&
 		git log --oneline --graph --decorate --all &&
-		git rev-list master -- >wc &&
+		git rev-list main -- >wc &&
 		test_line_count = 2 wc
 	)
 '
@@ -92,7 +92,7 @@ test_expect_success 'import branch2, no branch detection' '
 	(
 		cd "$git" &&
 		git log --oneline --graph --decorate --all &&
-		git rev-list master -- >wc &&
+		git rev-list main -- >wc &&
 		test_line_count = 2 wc
 	)
 '
@@ -103,7 +103,7 @@ test_expect_success 'import depot, no branch detection' '
 	(
 		cd "$git" &&
 		git log --oneline --graph --decorate --all &&
-		git rev-list master -- >wc &&
+		git rev-list main -- >wc &&
 		test_line_count = 8 wc
 	)
 '
@@ -117,7 +117,7 @@ test_expect_success 'import depot, branch detection' '
 		git log --oneline --graph --decorate --all &&
 
 		# 4 main commits
-		git rev-list master -- >wc &&
+		git rev-list main -- >wc &&
 		test_line_count = 4 wc &&
 
 		# 3 main, 1 integrate, 1 on branch2
@@ -140,7 +140,7 @@ test_expect_success 'import depot, branch detection, branchList branch definitio
 		git log --oneline --graph --decorate --all &&
 
 		# 4 main commits
-		git rev-list master -- >wc &&
+		git rev-list main -- >wc &&
 		test_line_count = 4 wc &&
 
 		# 3 main, 1 integrate, 1 on branch2
@@ -487,7 +487,7 @@ test_expect_success 'use-client-spec detect-branches files in top-level' '
 	(
 		cd "$git" &&
 		git p4 sync --detect-branches --use-client-spec //depot/usecs@all &&
-		git checkout -b master p4/usecs/b1 &&
+		git checkout -b main p4/usecs/b1 &&
 		test_path_is_file b1-file1 &&
 		test_path_is_missing b2-file2 &&
 		test_path_is_missing b1 &&
@@ -540,7 +540,7 @@ test_expect_success 'use-client-spec detect-branches skips files in branches' '
 	(
 		cd "$git" &&
 		git p4 sync --detect-branches --use-client-spec //depot/usecs@all &&
-		git checkout -b master p4/usecs/b3 &&
+		git checkout -b main p4/usecs/b3 &&
 		test_path_is_file b1-file1 &&
 		test_path_is_file b3-file3_2 &&
 		test_path_is_missing b3-file3_1
diff --git a/t/t9806-git-p4-options.sh b/t/t9806-git-p4-options.sh
index c7629b6c7d..c26d297433 100755
--- a/t/t9806-git-p4-options.sh
+++ b/t/t9806-git-p4-options.sh
@@ -2,7 +2,7 @@
 
 test_description='git p4 options'
 
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./lib-git-p4.sh
@@ -30,14 +30,14 @@ test_expect_success 'clone no --git-dir' '
 	test_must_fail git p4 clone --git-dir=xx //depot
 '
 
-test_expect_success 'clone --branch should checkout master' '
+test_expect_success 'clone --branch should checkout main' '
 	git p4 clone --branch=refs/remotes/p4/sb --dest="$git" //depot &&
 	test_when_finished cleanup_git &&
 	(
 		cd "$git" &&
 		git rev-parse refs/remotes/p4/sb >sb &&
-		git rev-parse refs/heads/master >master &&
-		test_cmp sb master &&
+		git rev-parse refs/heads/main >main &&
+		test_cmp sb main &&
 		git rev-parse HEAD >head &&
 		test_cmp sb head
 	)
@@ -150,22 +150,22 @@ test_expect_success 'clone --changesfile, @all' '
 	test_must_fail git p4 clone --changesfile="$TRASH_DIRECTORY/cf" --dest="$git" //depot@all
 '
 
-# imports both master and p4/master in refs/heads
+# imports both main and p4/master in refs/heads
 # requires --import-local on sync to find p4 refs/heads
-# does not update master on sync, just p4/master
+# does not update main on sync, just p4/master
 test_expect_success 'clone/sync --import-local' '
 	git p4 clone --import-local --dest="$git" //depot@1,2 &&
 	test_when_finished cleanup_git &&
 	(
 		cd "$git" &&
-		git log --oneline refs/heads/master >lines &&
+		git log --oneline refs/heads/main >lines &&
 		test_line_count = 2 lines &&
 		git log --oneline refs/heads/p4/master >lines &&
 		test_line_count = 2 lines &&
 		test_must_fail git p4 sync &&
 
 		git p4 sync --import-local &&
-		git log --oneline refs/heads/master >lines &&
+		git log --oneline refs/heads/main >lines &&
 		test_line_count = 2 lines &&
 		git log --oneline refs/heads/p4/master >lines &&
 		test_line_count = 3 lines
@@ -177,7 +177,7 @@ test_expect_success 'clone --max-changes' '
 	test_when_finished cleanup_git &&
 	(
 		cd "$git" &&
-		git log --oneline refs/heads/master >lines &&
+		git log --oneline refs/heads/main >lines &&
 		test_line_count = 2 lines
 	)
 '
@@ -240,7 +240,7 @@ test_expect_success 'clone --use-client-spec' '
 			git init &&
 			git config git-p4.useClientSpec true &&
 			git p4 sync //depot/... &&
-			git checkout -b master p4/master &&
+			git checkout -b main p4/master &&
 			test_path_is_file bus/dir/f4 &&
 			test_path_is_missing file1
 		)
diff --git a/t/t9807-git-p4-submit.sh b/t/t9807-git-p4-submit.sh
index f12e6f7206..7d4109f29d 100755
--- a/t/t9807-git-p4-submit.sh
+++ b/t/t9807-git-p4-submit.sh
@@ -2,7 +2,7 @@
 
 test_description='git p4 submit'
 
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./lib-git-p4.sh
@@ -117,7 +117,7 @@ test_expect_success 'submit with allowSubmit' '
 		git config git-p4.skipSubmitEdit true &&
 		git config git-p4.allowSubmit "nobranch" &&
 		test_must_fail git p4 submit &&
-		git config git-p4.allowSubmit "nobranch,master" &&
+		git config git-p4.allowSubmit "nobranch,main" &&
 		git p4 submit
 	)
 '
diff --git a/t/t9811-git-p4-label-import.sh b/t/t9811-git-p4-label-import.sh
index c53952ac14..5ac5383fb7 100755
--- a/t/t9811-git-p4-label-import.sh
+++ b/t/t9811-git-p4-label-import.sh
@@ -2,7 +2,7 @@
 
 test_description='git p4 label tests'
 
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./lib-git-p4.sh
@@ -188,7 +188,7 @@ test_expect_success 'tag that cannot be exported' '
 		git add main/f12 &&
 		git commit -m "adding f12" &&
 		git tag -m "tag on a_branch" GIT_TAG_ON_A_BRANCH &&
-		git checkout master &&
+		git checkout main &&
 		git p4 submit --export-labels
 	) &&
 	(
-- 
gitgitgadget


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH v3 27/28] t99*: adjust the references to the default branch name "main"
  2020-11-18 23:44   ` [PATCH v3 00/28] tests: use main as default branch name Johannes Schindelin via GitGitGadget
                       ` (25 preceding siblings ...)
  2020-11-18 23:44     ` [PATCH v3 26/28] tests(git-p4): transition to the default branch name `main` Johannes Schindelin via GitGitGadget
@ 2020-11-18 23:44     ` Johannes Schindelin via GitGitGadget
  2020-11-18 23:44     ` [PATCH v3 28/28] tests: drop prereq `PREPARE_FOR_MAIN_BRANCH` where no longer needed Johannes Schindelin via GitGitGadget
  2020-11-19 23:35     ` [PATCH v3 00/28] tests: use main as default branch name Junio C Hamano
  28 siblings, 0 replies; 163+ messages in thread
From: Johannes Schindelin via GitGitGadget @ 2020-11-18 23:44 UTC (permalink / raw)
  To: git
  Cc: Felipe Contreras, Ævar Arnfjörð Bjarmason,
	Johannes Schindelin, Jeff King, Jonathan Nieder,
	Johannes Schindelin, Johannes Schindelin

From: Johannes Schindelin <johannes.schindelin@gmx.de>

Carefully excluding t9902, which sees independent development elsewhere
at the time of writing, we use `main` as the default branch name in
t9903. This trick was performed via

	$ (cd t &&
	   sed -i -e 's/master/main/g' -e 's/MASTER/MAIN/g' \
		-e 's/Master/Main/g' -- t99*.sh lib-cvs.sh &&
	   git checkout HEAD -- t9902\*)

This allows us to define `GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main`
for all tests (except the ones we specifically excluded for now).

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
---
 t/t9903-bash-prompt.sh | 116 ++++++++++++++++++++---------------------
 1 file changed, 58 insertions(+), 58 deletions(-)

diff --git a/t/t9903-bash-prompt.sh b/t/t9903-bash-prompt.sh
index f5b5935c2c..bbd513bab0 100755
--- a/t/t9903-bash-prompt.sh
+++ b/t/t9903-bash-prompt.sh
@@ -5,7 +5,7 @@
 
 test_description='test git-specific bash prompt functions'
 
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./lib-bash.sh
@@ -31,7 +31,7 @@ test_expect_success 'setup for prompt tests' '
 	echo 3 >file &&
 	git commit -m "third b1" file &&
 	git tag -a -m msg2 t2 &&
-	git checkout -b b2 master &&
+	git checkout -b b2 main &&
 	echo 0 >file &&
 	git commit -m "second b2" file &&
 	echo 00 >file &&
@@ -40,20 +40,20 @@ test_expect_success 'setup for prompt tests' '
 	git commit -m "yet another b2" file &&
 	mkdir ignored_dir &&
 	echo "ignored_dir/" >>.gitignore &&
-	git checkout master
+	git checkout main
 '
 
 test_expect_success 'prompt - branch name' '
-	printf " (master)" >expected &&
+	printf " (main)" >expected &&
 	__git_ps1 >"$actual" &&
 	test_cmp expected "$actual"
 '
 
 test_expect_success SYMLINKS 'prompt - branch name - symlink symref' '
-	printf " (master)" >expected &&
-	test_when_finished "git checkout master" &&
+	printf " (main)" >expected &&
+	test_when_finished "git checkout main" &&
 	test_config core.preferSymlinkRefs true &&
-	git checkout master &&
+	git checkout main &&
 	__git_ps1 >"$actual" &&
 	test_cmp expected "$actual"
 '
@@ -61,7 +61,7 @@ test_expect_success SYMLINKS 'prompt - branch name - symlink symref' '
 test_expect_success 'prompt - unborn branch' '
 	printf " (unborn)" >expected &&
 	git checkout --orphan unborn &&
-	test_when_finished "git checkout master" &&
+	test_when_finished "git checkout main" &&
 	__git_ps1 >"$actual" &&
 	test_cmp expected "$actual"
 '
@@ -75,7 +75,7 @@ test_expect_success FUNNYNAMES 'prompt - with newline in path' '
 with
 newline" &&
 	mkdir "$repo_with_newline" &&
-	printf " (master)" >expected &&
+	printf " (main)" >expected &&
 	git init "$repo_with_newline" &&
 	test_when_finished "rm -rf \"$repo_with_newline\"" &&
 	mkdir "$repo_with_newline"/subdir &&
@@ -90,7 +90,7 @@ test_expect_success 'prompt - detached head' '
 	printf " ((%s...))" $(git log -1 --format="%h" --abbrev=13 b1^) >expected &&
 	test_config core.abbrev 13 &&
 	git checkout b1^ &&
-	test_when_finished "git checkout master" &&
+	test_when_finished "git checkout main" &&
 	__git_ps1 >"$actual" &&
 	test_cmp expected "$actual"
 '
@@ -98,7 +98,7 @@ test_expect_success 'prompt - detached head' '
 test_expect_success 'prompt - describe detached head - contains' '
 	printf " ((t2~1))" >expected &&
 	git checkout b1^ &&
-	test_when_finished "git checkout master" &&
+	test_when_finished "git checkout main" &&
 	(
 		GIT_PS1_DESCRIBE_STYLE=contains &&
 		__git_ps1 >"$actual"
@@ -109,7 +109,7 @@ test_expect_success 'prompt - describe detached head - contains' '
 test_expect_success 'prompt - describe detached head - branch' '
 	printf " ((tags/t2~1))" >expected &&
 	git checkout b1^ &&
-	test_when_finished "git checkout master" &&
+	test_when_finished "git checkout main" &&
 	(
 		GIT_PS1_DESCRIBE_STYLE=branch &&
 		__git_ps1 >"$actual"
@@ -120,7 +120,7 @@ test_expect_success 'prompt - describe detached head - branch' '
 test_expect_success 'prompt - describe detached head - describe' '
 	printf " ((t1-1-g%s))" $(git log -1 --format="%h" b1^) >expected &&
 	git checkout b1^ &&
-	test_when_finished "git checkout master" &&
+	test_when_finished "git checkout main" &&
 	(
 		GIT_PS1_DESCRIBE_STYLE=describe &&
 		__git_ps1 >"$actual"
@@ -131,7 +131,7 @@ test_expect_success 'prompt - describe detached head - describe' '
 test_expect_success 'prompt - describe detached head - default' '
 	printf " ((t2))" >expected &&
 	git checkout --detach b1 &&
-	test_when_finished "git checkout master" &&
+	test_when_finished "git checkout main" &&
 	__git_ps1 >"$actual" &&
 	test_cmp expected "$actual"
 '
@@ -155,7 +155,7 @@ test_expect_success 'prompt - deep inside .git directory' '
 '
 
 test_expect_success 'prompt - inside bare repository' '
-	printf " (BARE:master)" >expected &&
+	printf " (BARE:main)" >expected &&
 	git init --bare bare.git &&
 	test_when_finished "rm -rf bare.git" &&
 	(
@@ -175,7 +175,7 @@ test_expect_success 'prompt - interactive rebase' '
 	test_when_finished "rm -f fake_editor.sh" &&
 	test_set_editor "$TRASH_DIRECTORY/fake_editor.sh" &&
 	git checkout b1 &&
-	test_when_finished "git checkout master" &&
+	test_when_finished "git checkout main" &&
 	git rebase -i HEAD^ &&
 	test_when_finished "git rebase --abort" &&
 	__git_ps1 >"$actual" &&
@@ -185,7 +185,7 @@ test_expect_success 'prompt - interactive rebase' '
 test_expect_success 'prompt - rebase merge' '
 	printf " (b2|REBASE 1/3)" >expected &&
 	git checkout b2 &&
-	test_when_finished "git checkout master" &&
+	test_when_finished "git checkout main" &&
 	test_must_fail git rebase --merge b1 b2 &&
 	test_when_finished "git rebase --abort" &&
 	__git_ps1 >"$actual" &&
@@ -195,7 +195,7 @@ test_expect_success 'prompt - rebase merge' '
 test_expect_success 'prompt - rebase am' '
 	printf " (b2|REBASE 1/3)" >expected &&
 	git checkout b2 &&
-	test_when_finished "git checkout master" &&
+	test_when_finished "git checkout main" &&
 	test_must_fail git rebase --apply b1 b2 &&
 	test_when_finished "git rebase --abort" &&
 	__git_ps1 >"$actual" &&
@@ -205,7 +205,7 @@ test_expect_success 'prompt - rebase am' '
 test_expect_success 'prompt - merge' '
 	printf " (b1|MERGING)" >expected &&
 	git checkout b1 &&
-	test_when_finished "git checkout master" &&
+	test_when_finished "git checkout main" &&
 	test_must_fail git merge b2 &&
 	test_when_finished "git reset --hard" &&
 	__git_ps1 >"$actual" &&
@@ -213,7 +213,7 @@ test_expect_success 'prompt - merge' '
 '
 
 test_expect_success 'prompt - cherry-pick' '
-	printf " (master|CHERRY-PICKING)" >expected &&
+	printf " (main|CHERRY-PICKING)" >expected &&
 	test_must_fail git cherry-pick b1 b1^ &&
 	test_when_finished "git cherry-pick --abort" &&
 	__git_ps1 >"$actual" &&
@@ -225,7 +225,7 @@ test_expect_success 'prompt - cherry-pick' '
 '
 
 test_expect_success 'prompt - revert' '
-	printf " (master|REVERTING)" >expected &&
+	printf " (main|REVERTING)" >expected &&
 	test_must_fail git revert b1^ b1 &&
 	test_when_finished "git revert --abort" &&
 	__git_ps1 >"$actual" &&
@@ -237,7 +237,7 @@ test_expect_success 'prompt - revert' '
 '
 
 test_expect_success 'prompt - bisect' '
-	printf " (master|BISECTING)" >expected &&
+	printf " (main|BISECTING)" >expected &&
 	git bisect start &&
 	test_when_finished "git bisect reset" &&
 	__git_ps1 >"$actual" &&
@@ -245,7 +245,7 @@ test_expect_success 'prompt - bisect' '
 '
 
 test_expect_success 'prompt - dirty status indicator - clean' '
-	printf " (master)" >expected &&
+	printf " (main)" >expected &&
 	(
 		GIT_PS1_SHOWDIRTYSTATE=y &&
 		__git_ps1 >"$actual"
@@ -254,7 +254,7 @@ test_expect_success 'prompt - dirty status indicator - clean' '
 '
 
 test_expect_success 'prompt - dirty status indicator - dirty worktree' '
-	printf " (master *)" >expected &&
+	printf " (main *)" >expected &&
 	echo "dirty" >file &&
 	test_when_finished "git reset --hard" &&
 	(
@@ -265,7 +265,7 @@ test_expect_success 'prompt - dirty status indicator - dirty worktree' '
 '
 
 test_expect_success 'prompt - dirty status indicator - dirty index' '
-	printf " (master +)" >expected &&
+	printf " (main +)" >expected &&
 	echo "dirty" >file &&
 	test_when_finished "git reset --hard" &&
 	git add -u &&
@@ -277,7 +277,7 @@ test_expect_success 'prompt - dirty status indicator - dirty index' '
 '
 
 test_expect_success 'prompt - dirty status indicator - dirty index and worktree' '
-	printf " (master *+)" >expected &&
+	printf " (main *+)" >expected &&
 	echo "dirty index" >file &&
 	test_when_finished "git reset --hard" &&
 	git add -u &&
@@ -291,7 +291,7 @@ test_expect_success 'prompt - dirty status indicator - dirty index and worktree'
 
 test_expect_success 'prompt - dirty status indicator - orphan branch - clean' '
 	printf " (orphan #)" >expected &&
-	test_when_finished "git checkout master" &&
+	test_when_finished "git checkout main" &&
 	git checkout --orphan orphan &&
 	git reset --hard &&
 	(
@@ -303,7 +303,7 @@ test_expect_success 'prompt - dirty status indicator - orphan branch - clean' '
 
 test_expect_success 'prompt - dirty status indicator - orphan branch - dirty index' '
 	printf " (orphan +)" >expected &&
-	test_when_finished "git checkout master" &&
+	test_when_finished "git checkout main" &&
 	git checkout --orphan orphan &&
 	(
 		GIT_PS1_SHOWDIRTYSTATE=y &&
@@ -314,7 +314,7 @@ test_expect_success 'prompt - dirty status indicator - orphan branch - dirty ind
 
 test_expect_success 'prompt - dirty status indicator - orphan branch - dirty index and worktree' '
 	printf " (orphan *+)" >expected &&
-	test_when_finished "git checkout master" &&
+	test_when_finished "git checkout main" &&
 	git checkout --orphan orphan &&
 	>file &&
 	(
@@ -325,7 +325,7 @@ test_expect_success 'prompt - dirty status indicator - orphan branch - dirty ind
 '
 
 test_expect_success 'prompt - dirty status indicator - shell variable unset with config disabled' '
-	printf " (master)" >expected &&
+	printf " (main)" >expected &&
 	echo "dirty" >file &&
 	test_when_finished "git reset --hard" &&
 	test_config bash.showDirtyState false &&
@@ -337,7 +337,7 @@ test_expect_success 'prompt - dirty status indicator - shell variable unset with
 '
 
 test_expect_success 'prompt - dirty status indicator - shell variable unset with config enabled' '
-	printf " (master)" >expected &&
+	printf " (main)" >expected &&
 	echo "dirty" >file &&
 	test_when_finished "git reset --hard" &&
 	test_config bash.showDirtyState true &&
@@ -349,7 +349,7 @@ test_expect_success 'prompt - dirty status indicator - shell variable unset with
 '
 
 test_expect_success 'prompt - dirty status indicator - shell variable set with config disabled' '
-	printf " (master)" >expected &&
+	printf " (main)" >expected &&
 	echo "dirty" >file &&
 	test_when_finished "git reset --hard" &&
 	test_config bash.showDirtyState false &&
@@ -361,7 +361,7 @@ test_expect_success 'prompt - dirty status indicator - shell variable set with c
 '
 
 test_expect_success 'prompt - dirty status indicator - shell variable set with config enabled' '
-	printf " (master *)" >expected &&
+	printf " (main *)" >expected &&
 	echo "dirty" >file &&
 	test_when_finished "git reset --hard" &&
 	test_config bash.showDirtyState true &&
@@ -385,7 +385,7 @@ test_expect_success 'prompt - dirty status indicator - not shown inside .git dir
 '
 
 test_expect_success 'prompt - stash status indicator - no stash' '
-	printf " (master)" >expected &&
+	printf " (main)" >expected &&
 	(
 		GIT_PS1_SHOWSTASHSTATE=y &&
 		__git_ps1 >"$actual"
@@ -394,7 +394,7 @@ test_expect_success 'prompt - stash status indicator - no stash' '
 '
 
 test_expect_success 'prompt - stash status indicator - stash' '
-	printf " (master $)" >expected &&
+	printf " (main $)" >expected &&
 	echo 2 >file &&
 	git stash &&
 	test_when_finished "git stash drop" &&
@@ -420,7 +420,7 @@ test_expect_success 'prompt - stash status indicator - not shown inside .git dir
 '
 
 test_expect_success 'prompt - untracked files status indicator - no untracked files' '
-	printf " (master)" >expected &&
+	printf " (main)" >expected &&
 	(
 		GIT_PS1_SHOWUNTRACKEDFILES=y &&
 		cd otherrepo &&
@@ -430,7 +430,7 @@ test_expect_success 'prompt - untracked files status indicator - no untracked fi
 '
 
 test_expect_success 'prompt - untracked files status indicator - untracked files' '
-	printf " (master %%)" >expected &&
+	printf " (main %%)" >expected &&
 	(
 		GIT_PS1_SHOWUNTRACKEDFILES=y &&
 		__git_ps1 >"$actual"
@@ -439,7 +439,7 @@ test_expect_success 'prompt - untracked files status indicator - untracked files
 '
 
 test_expect_success 'prompt - untracked files status indicator - empty untracked dir' '
-	printf " (master)" >expected &&
+	printf " (main)" >expected &&
 	mkdir otherrepo/untracked-dir &&
 	test_when_finished "rm -rf otherrepo/untracked-dir" &&
 	(
@@ -451,7 +451,7 @@ test_expect_success 'prompt - untracked files status indicator - empty untracked
 '
 
 test_expect_success 'prompt - untracked files status indicator - non-empty untracked dir' '
-	printf " (master %%)" >expected &&
+	printf " (main %%)" >expected &&
 	mkdir otherrepo/untracked-dir &&
 	test_when_finished "rm -rf otherrepo/untracked-dir" &&
 	>otherrepo/untracked-dir/untracked-file &&
@@ -464,7 +464,7 @@ test_expect_success 'prompt - untracked files status indicator - non-empty untra
 '
 
 test_expect_success 'prompt - untracked files status indicator - untracked files outside cwd' '
-	printf " (master %%)" >expected &&
+	printf " (main %%)" >expected &&
 	(
 		mkdir -p ignored_dir &&
 		cd ignored_dir &&
@@ -475,7 +475,7 @@ test_expect_success 'prompt - untracked files status indicator - untracked files
 '
 
 test_expect_success 'prompt - untracked files status indicator - shell variable unset with config disabled' '
-	printf " (master)" >expected &&
+	printf " (main)" >expected &&
 	test_config bash.showUntrackedFiles false &&
 	(
 		sane_unset GIT_PS1_SHOWUNTRACKEDFILES &&
@@ -485,7 +485,7 @@ test_expect_success 'prompt - untracked files status indicator - shell variable
 '
 
 test_expect_success 'prompt - untracked files status indicator - shell variable unset with config enabled' '
-	printf " (master)" >expected &&
+	printf " (main)" >expected &&
 	test_config bash.showUntrackedFiles true &&
 	(
 		sane_unset GIT_PS1_SHOWUNTRACKEDFILES &&
@@ -495,7 +495,7 @@ test_expect_success 'prompt - untracked files status indicator - shell variable
 '
 
 test_expect_success 'prompt - untracked files status indicator - shell variable set with config disabled' '
-	printf " (master)" >expected &&
+	printf " (main)" >expected &&
 	test_config bash.showUntrackedFiles false &&
 	(
 		GIT_PS1_SHOWUNTRACKEDFILES=y &&
@@ -505,7 +505,7 @@ test_expect_success 'prompt - untracked files status indicator - shell variable
 '
 
 test_expect_success 'prompt - untracked files status indicator - shell variable set with config enabled' '
-	printf " (master %%)" >expected &&
+	printf " (main %%)" >expected &&
 	test_config bash.showUntrackedFiles true &&
 	(
 		GIT_PS1_SHOWUNTRACKEDFILES=y &&
@@ -525,13 +525,13 @@ test_expect_success 'prompt - untracked files status indicator - not shown insid
 '
 
 test_expect_success 'prompt - format string starting with dash' '
-	printf -- "-master" >expected &&
+	printf -- "-main" >expected &&
 	__git_ps1 "-%s" >"$actual" &&
 	test_cmp expected "$actual"
 '
 
 test_expect_success 'prompt - pc mode' '
-	printf "BEFORE: (\${__git_ps1_branch_name}):AFTER\\nmaster" >expected &&
+	printf "BEFORE: (\${__git_ps1_branch_name}):AFTER\\nmain" >expected &&
 	(
 		__git_ps1 "BEFORE:" ":AFTER" >"$actual" &&
 		test_must_be_empty "$actual" &&
@@ -541,7 +541,7 @@ test_expect_success 'prompt - pc mode' '
 '
 
 test_expect_success 'prompt - bash color pc mode - branch name' '
-	printf "BEFORE: (${c_green}\${__git_ps1_branch_name}${c_clear}):AFTER\\nmaster" >expected &&
+	printf "BEFORE: (${c_green}\${__git_ps1_branch_name}${c_clear}):AFTER\\nmain" >expected &&
 	(
 		GIT_PS1_SHOWCOLORHINTS=y &&
 		__git_ps1 "BEFORE:" ":AFTER" >"$actual" &&
@@ -553,7 +553,7 @@ test_expect_success 'prompt - bash color pc mode - branch name' '
 test_expect_success 'prompt - bash color pc mode - detached head' '
 	printf "BEFORE: (${c_red}\${__git_ps1_branch_name}${c_clear}):AFTER\\n(%s...)" $(git log -1 --format="%h" b1^) >expected &&
 	git checkout b1^ &&
-	test_when_finished "git checkout master" &&
+	test_when_finished "git checkout main" &&
 	(
 		GIT_PS1_SHOWCOLORHINTS=y &&
 		__git_ps1 "BEFORE:" ":AFTER" &&
@@ -563,7 +563,7 @@ test_expect_success 'prompt - bash color pc mode - detached head' '
 '
 
 test_expect_success 'prompt - bash color pc mode - dirty status indicator - dirty worktree' '
-	printf "BEFORE: (${c_green}\${__git_ps1_branch_name}${c_clear} ${c_red}*${c_clear}):AFTER\\nmaster" >expected &&
+	printf "BEFORE: (${c_green}\${__git_ps1_branch_name}${c_clear} ${c_red}*${c_clear}):AFTER\\nmain" >expected &&
 	echo "dirty" >file &&
 	test_when_finished "git reset --hard" &&
 	(
@@ -576,7 +576,7 @@ test_expect_success 'prompt - bash color pc mode - dirty status indicator - dirt
 '
 
 test_expect_success 'prompt - bash color pc mode - dirty status indicator - dirty index' '
-	printf "BEFORE: (${c_green}\${__git_ps1_branch_name}${c_clear} ${c_green}+${c_clear}):AFTER\\nmaster" >expected &&
+	printf "BEFORE: (${c_green}\${__git_ps1_branch_name}${c_clear} ${c_green}+${c_clear}):AFTER\\nmain" >expected &&
 	echo "dirty" >file &&
 	test_when_finished "git reset --hard" &&
 	git add -u &&
@@ -590,7 +590,7 @@ test_expect_success 'prompt - bash color pc mode - dirty status indicator - dirt
 '
 
 test_expect_success 'prompt - bash color pc mode - dirty status indicator - dirty index and worktree' '
-	printf "BEFORE: (${c_green}\${__git_ps1_branch_name}${c_clear} ${c_red}*${c_green}+${c_clear}):AFTER\\nmaster" >expected &&
+	printf "BEFORE: (${c_green}\${__git_ps1_branch_name}${c_clear} ${c_red}*${c_green}+${c_clear}):AFTER\\nmain" >expected &&
 	echo "dirty index" >file &&
 	test_when_finished "git reset --hard" &&
 	git add -u &&
@@ -605,7 +605,7 @@ test_expect_success 'prompt - bash color pc mode - dirty status indicator - dirt
 '
 
 test_expect_success 'prompt - bash color pc mode - dirty status indicator - before root commit' '
-	printf "BEFORE: (${c_green}\${__git_ps1_branch_name}${c_clear} ${c_green}#${c_clear}):AFTER\\nmaster" >expected &&
+	printf "BEFORE: (${c_green}\${__git_ps1_branch_name}${c_clear} ${c_green}#${c_clear}):AFTER\\nmain" >expected &&
 	(
 		GIT_PS1_SHOWDIRTYSTATE=y &&
 		GIT_PS1_SHOWCOLORHINTS=y &&
@@ -631,7 +631,7 @@ test_expect_success 'prompt - bash color pc mode - inside .git directory' '
 '
 
 test_expect_success 'prompt - bash color pc mode - stash status indicator' '
-	printf "BEFORE: (${c_green}\${__git_ps1_branch_name}${c_clear} ${c_lblue}\$${c_clear}):AFTER\\nmaster" >expected &&
+	printf "BEFORE: (${c_green}\${__git_ps1_branch_name}${c_clear} ${c_lblue}\$${c_clear}):AFTER\\nmain" >expected &&
 	echo 2 >file &&
 	git stash &&
 	test_when_finished "git stash drop" &&
@@ -645,7 +645,7 @@ test_expect_success 'prompt - bash color pc mode - stash status indicator' '
 '
 
 test_expect_success 'prompt - bash color pc mode - untracked files status indicator' '
-	printf "BEFORE: (${c_green}\${__git_ps1_branch_name}${c_clear} ${c_red}%%${c_clear}):AFTER\\nmaster" >expected &&
+	printf "BEFORE: (${c_green}\${__git_ps1_branch_name}${c_clear} ${c_red}%%${c_clear}):AFTER\\nmain" >expected &&
 	(
 		GIT_PS1_SHOWUNTRACKEDFILES=y &&
 		GIT_PS1_SHOWCOLORHINTS=y &&
@@ -656,7 +656,7 @@ test_expect_success 'prompt - bash color pc mode - untracked files status indica
 '
 
 test_expect_success 'prompt - zsh color pc mode' '
-	printf "BEFORE: (%%F{green}master%%f):AFTER" >expected &&
+	printf "BEFORE: (%%F{green}main%%f):AFTER" >expected &&
 	(
 		ZSH_VERSION=5.0.0 &&
 		GIT_PS1_SHOWCOLORHINTS=y &&
@@ -667,7 +667,7 @@ test_expect_success 'prompt - zsh color pc mode' '
 '
 
 test_expect_success 'prompt - hide if pwd ignored - env var unset, config disabled' '
-	printf " (master)" >expected &&
+	printf " (main)" >expected &&
 	test_config bash.hideIfPwdIgnored false &&
 	(
 		cd ignored_dir &&
@@ -688,7 +688,7 @@ test_expect_success 'prompt - hide if pwd ignored - env var unset, config disabl
 '
 
 test_expect_success 'prompt - hide if pwd ignored - env var unset, config unset' '
-	printf " (master)" >expected &&
+	printf " (main)" >expected &&
 	(
 		cd ignored_dir &&
 		__git_ps1 >"$actual"
@@ -707,7 +707,7 @@ test_expect_success 'prompt - hide if pwd ignored - env var unset, config unset,
 '
 
 test_expect_success 'prompt - hide if pwd ignored - env var set, config disabled' '
-	printf " (master)" >expected &&
+	printf " (main)" >expected &&
 	test_config bash.hideIfPwdIgnored false &&
 	(
 		cd ignored_dir &&
-- 
gitgitgadget


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH v3 28/28] tests: drop prereq `PREPARE_FOR_MAIN_BRANCH` where no longer needed
  2020-11-18 23:44   ` [PATCH v3 00/28] tests: use main as default branch name Johannes Schindelin via GitGitGadget
                       ` (26 preceding siblings ...)
  2020-11-18 23:44     ` [PATCH v3 27/28] t99*: adjust the references to the default branch name "main" Johannes Schindelin via GitGitGadget
@ 2020-11-18 23:44     ` Johannes Schindelin via GitGitGadget
  2020-11-19 23:35     ` [PATCH v3 00/28] tests: use main as default branch name Junio C Hamano
  28 siblings, 0 replies; 163+ messages in thread
From: Johannes Schindelin via GitGitGadget @ 2020-11-18 23:44 UTC (permalink / raw)
  To: git
  Cc: Felipe Contreras, Ævar Arnfjörð Bjarmason,
	Johannes Schindelin, Jeff King, Jonathan Nieder,
	Johannes Schindelin, Johannes Schindelin

From: Johannes Schindelin <johannes.schindelin@gmx.de>

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>
---
 t/t1400-update-ref.sh              |  4 ++--
 t/t3200-branch.sh                  |  6 +++---
 t/t3201-branch-contains.sh         |  2 +-
 t/t3203-branch-output.sh           |  2 +-
 t/t3205-branch-color.sh            |  2 +-
 t/t5505-remote.sh                  |  8 ++++----
 t/t5510-fetch.sh                   |  4 ++--
 t/t5703-upload-pack-ref-in-want.sh |  2 +-
 t/t6302-for-each-ref-filter.sh     | 12 ++++++------
 9 files changed, 21 insertions(+), 21 deletions(-)

diff --git a/t/t1400-update-ref.sh b/t/t1400-update-ref.sh
index 1ad0bbbc53..e7cd4917d1 100755
--- a/t/t1400-update-ref.sh
+++ b/t/t1400-update-ref.sh
@@ -588,7 +588,7 @@ test_expect_success 'stdin fails on unbalanced quotes' '
 	grep "fatal: badly quoted argument: \\\"main" err
 '
 
-test_expect_success PREPARE_FOR_MAIN_BRANCH 'stdin fails on invalid escape' '
+test_expect_success 'stdin fails on invalid escape' '
 	echo "create $a \"ma\zn\"" >stdin &&
 	test_must_fail git update-ref --stdin <stdin 2>err &&
 	grep "fatal: badly quoted argument: \\\"ma\\\\zn\\\"" err
@@ -707,7 +707,7 @@ test_expect_success 'stdin succeeds with quoted argument' '
 	test_cmp expect actual
 '
 
-test_expect_success PREPARE_FOR_MAIN_BRANCH 'stdin succeeds with escaped character' '
+test_expect_success 'stdin succeeds with escaped character' '
 	git update-ref -d $a &&
 	echo "create $a \"ma\\151n\"" >stdin &&
 	git update-ref --stdin <stdin &&
diff --git a/t/t3200-branch.sh b/t/t3200-branch.sh
index 56517dd9c3..66eed73f83 100755
--- a/t/t3200-branch.sh
+++ b/t/t3200-branch.sh
@@ -324,7 +324,7 @@ test_expect_success 'git branch --list -v with --abbrev' '
 
 '
 
-test_expect_success PREPARE_FOR_MAIN_BRANCH 'git branch --column' '
+test_expect_success 'git branch --column' '
 	COLUMNS=81 git branch --column=column >actual &&
 	cat >expect <<\EOF &&
   a/b/c   bam     foo     l     * main    n       o/p     r
@@ -361,7 +361,7 @@ EOF
 	test_cmp expect actual
 '
 
-test_expect_success PREPARE_FOR_MAIN_BRANCH 'git branch with column.*' '
+test_expect_success 'git branch with column.*' '
 	git config column.ui column &&
 	git config column.branch "dense" &&
 	COLUMNS=80 git branch >actual &&
@@ -378,7 +378,7 @@ test_expect_success 'git branch --column -v should fail' '
 	test_must_fail git branch --column -v
 '
 
-test_expect_success PREPARE_FOR_MAIN_BRANCH 'git branch -v with column.ui ignored' '
+test_expect_success 'git branch -v with column.ui ignored' '
 	git config column.ui column &&
 	COLUMNS=80 git branch -v | cut -c -8 | sed "s/ *$//" >actual &&
 	git config --unset column.ui &&
diff --git a/t/t3201-branch-contains.sh b/t/t3201-branch-contains.sh
index 8e626afbb9..f9f4d20e93 100755
--- a/t/t3201-branch-contains.sh
+++ b/t/t3201-branch-contains.sh
@@ -245,7 +245,7 @@ test_expect_success 'branch --merged combined with --no-merged' '
 # Here "topic" tracks "main" with one extra commit, and "zzz" points to the
 # same tip as main The name "zzz" must come alphabetically after "topic"
 # as we process them in that order.
-test_expect_success PREPARE_FOR_MAIN_BRANCH 'branch --merged with --verbose' '
+test_expect_success 'branch --merged with --verbose' '
 	git branch --track topic main &&
 	git branch zzz topic &&
 	git checkout topic &&
diff --git a/t/t3203-branch-output.sh b/t/t3203-branch-output.sh
index a7d2edd988..eaa37534aa 100755
--- a/t/t3203-branch-output.sh
+++ b/t/t3203-branch-output.sh
@@ -332,7 +332,7 @@ test_expect_success '--color overrides auto-color' '
 	test_cmp expect.color actual
 '
 
-test_expect_success PREPARE_FOR_MAIN_BRANCH 'verbose output lists worktree path' '
+test_expect_success 'verbose output lists worktree path' '
 	one=$(git rev-parse --short HEAD) &&
 	two=$(git rev-parse --short main) &&
 	cat >expect <<-EOF &&
diff --git a/t/t3205-branch-color.sh b/t/t3205-branch-color.sh
index b905dc4867..2a09442c2b 100755
--- a/t/t3205-branch-color.sh
+++ b/t/t3205-branch-color.sh
@@ -31,7 +31,7 @@ test_expect_success 'regular output shows colors' '
 	test_cmp expect actual
 '
 
-test_expect_success PREPARE_FOR_MAIN_BRANCH 'verbose output shows colors' '
+test_expect_success 'verbose output shows colors' '
 	oid=$(git rev-parse --short HEAD) &&
 	cat >expect <<-EOF &&
 	* <CYAN>main               <RESET> $oid foo
diff --git a/t/t5505-remote.sh b/t/t5505-remote.sh
index f7e3c9b1e7..59fbb1fa7f 100755
--- a/t/t5505-remote.sh
+++ b/t/t5505-remote.sh
@@ -237,7 +237,7 @@ cat >test/expect <<EOF
     main  pushes to another (up to date)
 EOF
 
-test_expect_success PREPARE_FOR_MAIN_BRANCH 'show' '
+test_expect_success 'show' '
 	(
 		cd test &&
 		git config --add remote.origin.fetch refs/heads/main:refs/heads/upstream &&
@@ -288,7 +288,7 @@ cat >test/expect <<EOF
     refs/tags/lastbackup forces to refs/tags/lastbackup
 EOF
 
-test_expect_success PREPARE_FOR_MAIN_BRANCH 'show -n' '
+test_expect_success 'show -n' '
 	mv one one.unreachable &&
 	(
 		cd test &&
@@ -331,7 +331,7 @@ test_expect_success 'set-head --auto' '
 	)
 '
 
-test_expect_success PREPARE_FOR_MAIN_BRANCH 'set-head --auto has no problem w/multiple HEADs' '
+test_expect_success 'set-head --auto has no problem w/multiple HEADs' '
 	(
 		cd test &&
 		git fetch two "refs/heads/*:refs/remotes/two/*" &&
@@ -1351,7 +1351,7 @@ test_expect_success 'unqualified <dst> refspec DWIM and advice' '
 	)
 '
 
-test_expect_success PREPARE_FOR_MAIN_BRANCH 'refs/remotes/* <src> refspec and unqualified <dst> DWIM and advice' '
+test_expect_success 'refs/remotes/* <src> refspec and unqualified <dst> DWIM and advice' '
 	(
 		cd two &&
 		git tag -a -m "Some tag" my-tag main &&
diff --git a/t/t5510-fetch.sh b/t/t5510-fetch.sh
index 35d9a8c279..d9ae7c20ce 100755
--- a/t/t5510-fetch.sh
+++ b/t/t5510-fetch.sh
@@ -945,7 +945,7 @@ test_expect_success 'fetching with auto-gc does not lock up' '
 	)
 '
 
-test_expect_success PREPARE_FOR_MAIN_BRANCH,C_LOCALE_OUTPUT 'fetch aligned output' '
+test_expect_success C_LOCALE_OUTPUT 'fetch aligned output' '
 	git clone . full-output &&
 	test_commit looooooooooooong-tag &&
 	(
@@ -960,7 +960,7 @@ test_expect_success PREPARE_FOR_MAIN_BRANCH,C_LOCALE_OUTPUT 'fetch aligned outpu
 	test_cmp expect actual
 '
 
-test_expect_success PREPARE_FOR_MAIN_BRANCH,C_LOCALE_OUTPUT 'fetch compact output' '
+test_expect_success C_LOCALE_OUTPUT 'fetch compact output' '
 	git clone . compact &&
 	test_commit extraaa &&
 	(
diff --git a/t/t5703-upload-pack-ref-in-want.sh b/t/t5703-upload-pack-ref-in-want.sh
index 0f3e0bf15c..2f4ce6b0fa 100755
--- a/t/t5703-upload-pack-ref-in-want.sh
+++ b/t/t5703-upload-pack-ref-in-want.sh
@@ -386,7 +386,7 @@ test_expect_success 'server is initially behind - ref in want' '
 	test_cmp expected actual
 '
 
-test_expect_success PREPARE_FOR_MAIN_BRANCH 'server loses a ref - ref in want' '
+test_expect_success 'server loses a ref - ref in want' '
 	git -C "$REPO" config uploadpack.allowRefInWant true &&
 	rm -rf local &&
 	cp -r "$LOCAL_PRISTINE" local &&
diff --git a/t/t6302-for-each-ref-filter.sh b/t/t6302-for-each-ref-filter.sh
index e5833af528..5d682cb31f 100755
--- a/t/t6302-for-each-ref-filter.sh
+++ b/t/t6302-for-each-ref-filter.sh
@@ -116,7 +116,7 @@ test_expect_success '%(color) must fail' '
 	test_must_fail git for-each-ref --format="%(color)%(refname)"
 '
 
-test_expect_success PREPARE_FOR_MAIN_BRANCH 'left alignment is default' '
+test_expect_success 'left alignment is default' '
 	cat >expect <<-\EOF &&
 	refname is refs/heads/main    |refs/heads/main
 	refname is refs/heads/side    |refs/heads/side
@@ -134,7 +134,7 @@ test_expect_success PREPARE_FOR_MAIN_BRANCH 'left alignment is default' '
 	test_cmp expect actual
 '
 
-test_expect_success PREPARE_FOR_MAIN_BRANCH 'middle alignment' '
+test_expect_success 'middle alignment' '
 	cat >expect <<-\EOF &&
 	|  refname is refs/heads/main  |refs/heads/main
 	|  refname is refs/heads/side  |refs/heads/side
@@ -152,7 +152,7 @@ test_expect_success PREPARE_FOR_MAIN_BRANCH 'middle alignment' '
 	test_cmp expect actual
 '
 
-test_expect_success PREPARE_FOR_MAIN_BRANCH 'right alignment' '
+test_expect_success 'right alignment' '
 	cat >expect <<-\EOF &&
 	|    refname is refs/heads/main|refs/heads/main
 	|    refname is refs/heads/side|refs/heads/side
@@ -187,7 +187,7 @@ EOF
 test_align_permutations() {
 	while read -r option
 	do
-		test_expect_success PREPARE_FOR_MAIN_BRANCH "align:$option" '
+		test_expect_success "align:$option" '
 			git for-each-ref --format="|%(align:$option)refname is %(refname)%(end)|%(refname)" >actual &&
 			test_cmp expect actual
 		'
@@ -216,7 +216,7 @@ EOF
 
 # Individual atoms inside %(align:...) and %(end) must not be quoted.
 
-test_expect_success PREPARE_FOR_MAIN_BRANCH 'alignment with format quote' "
+test_expect_success 'alignment with format quote' "
 	cat >expect <<-\EOF &&
 	|'       '\''main| A U Thor'\''       '|
 	|'       '\''side| A U Thor'\''       '|
@@ -234,7 +234,7 @@ test_expect_success PREPARE_FOR_MAIN_BRANCH 'alignment with format quote' "
 	test_cmp expect actual
 "
 
-test_expect_success PREPARE_FOR_MAIN_BRANCH 'nested alignment with quote formatting' "
+test_expect_success 'nested alignment with quote formatting' "
 	cat >expect <<-\EOF &&
 	|'           main               '|
 	|'           side               '|
-- 
gitgitgadget

^ permalink raw reply related	[flat|nested] 163+ messages in thread

* Re: [PATCH 00/28] Use main as default branch name
  2020-11-17 22:55   ` Junio C Hamano
  2020-11-17 23:16     ` Felipe Contreras
@ 2020-11-18 23:45     ` Philip Oakley
  2020-11-19  0:00       ` Johannes Schindelin
  2020-11-19  1:51       ` Junio C Hamano
  1 sibling, 2 replies; 163+ messages in thread
From: Philip Oakley @ 2020-11-18 23:45 UTC (permalink / raw)
  To: Junio C Hamano, Eric W. Biederman
  Cc: Johannes Schindelin via GitGitGadget, git, Johannes Schindelin

On 17/11/2020 22:55, Junio C Hamano wrote:
>  I personally
> do not like the word 'main' used as such, but the rest of the world
> seems to be moving in that direction,

I feel that 'main' is rather a rather dull and boring sort of word.

In that sense, it could be useful as the fall back for those who haven't
yet got a clear view of what they want to call their first born. So I
sort of support both views.

An alternative in the other direction is to go with the 'not currently
on any branch' (detached at nowhere) but then require users to
deliberately create their first branch with their chosen name. This
moves the 'backward incompatibility' to a different place, which may be
easier to manage.
--
Philip

^ permalink raw reply	[flat|nested] 163+ messages in thread

* Re: [PATCH v2 28/27] tests: run tests omitted by PREPARE_FOR_MAIN_BRANCH
  2020-11-18 11:48   ` [PATCH v2 28/27] tests: run tests omitted by PREPARE_FOR_MAIN_BRANCH Ævar Arnfjörð Bjarmason
@ 2020-11-18 23:56     ` Johannes Schindelin
  2020-11-19 19:30       ` Junio C Hamano
  0 siblings, 1 reply; 163+ messages in thread
From: Johannes Schindelin @ 2020-11-18 23:56 UTC (permalink / raw)
  To: Ævar Arnfjörð Bjarmason
  Cc: git, Junio C Hamano, Jeff King, Felipe Contreras

[-- Attachment #1: Type: text/plain, Size: 7072 bytes --]

Hi Ævar,

On Wed, 18 Nov 2020, Ævar Arnfjörð Bjarmason wrote:

> Reinstate the test coverage lost due to PREPARE_FOR_MAIN_BRANCH. The
> remaining impact of that prerequisite was mainly missing coverage from
> submodule fetches being lost[1], e.g. impacting my in-flight
> ab/retire-parse-remote. Now the prerequisite is effectively a
> noop. This goes on top of [2].
>
> I'm not removing the PREPARE_FOR_MAIN_BRANCH prerequisite to keep this
> change small, instead it's now effectively a noop. It can be removed
> in some later change.
>
> The only remaining occurrences in t5526-fetch-submodules.sh can be
> removed without breakage with:
>
>     perl -pi -e 's/PREPARE_FOR_MAIN_BRANCH //g' t/t5526-fetch-submodules.sh
>
> Which at this point leaves only the now-unused prerequisite
> declaration in test-lib.sh.
>
> The coverage in t9902-completion.sh was restored by partially
> reverting[3]. After that we were left with one test in a mixed
> state. It setup "master" but tested for "mai". Change it back to
> "mas", pending a more complete refactoring of that test.
>
> This change only conflicts between next..seen by clashing with Peter
> Kaestle's in-flights submodule fix[4]. Fixing the resulting logic
> error in t5526-fetch-submodules.sh is trivial, simply:
>
>     - compare_refs_in_dir A origin/master B origin/master
>     + compare_refs_in_dir A origin/main B origin/main
>
> 1. 66713e84e7 ("tests: prepare aligned mentions of the default branch name", 2020-10-23)
> 2. https://public-inbox.org/git/pull.762.v2.git.1605629547.gitgitgadget@gmail.com/
> 3. 8164360fc8 ("t9902: prepare a test for the upcoming default branch name", 2020-10-23)
> 4. https://public-inbox.org/git/1605196853-37359-1-git-send-email-peter.kaestle@nokia.com/
>
> Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
> ---

Hmm. I have the feeling that doing this will just delay everything even
further. I had really hoped that we could get this done without "three
steps forward, one step back" dances.

> On Tue, Nov 17 2020, Johannes Schindelin via GitGitGadget wrote:
> > To avoid even more conflicts with topics that did not even make it to seen
> > yet, this patch series specifically excludes t3404, t4013, t5310, t5526,
> > t6300, t7064, t7817, t9902: in those test scripts, we will still use master
> > for the time being. Once the topics in question have settled, I will send
> > the appropriate follow-up patches to adjust them to use main instead.
>
> This is not a replacement for that subsequent cleanup, but seems like
> a simple enough thing to have now to reinstate the missing test
> coverage.
>
> Perhaps there's some topics not in "seen" that you have in mind as
> conflicting, but as noted above the conflict produced here with
> in-flight in "seen" is trivial.

The conflicts might be trivial, but every conflict makes it harder to
juggle branch thickets like Junio's `seen`. And those things add up.
They're no fun, and they make life hard and tedious.

t5526 conflicts _semantically_ with `pk/subsub-fetch-fix` (which touches
t5526 and adds a new test case referring to `master`).

t9902 conflicts with `fc/bash-completion-post-2.29`, and in contrast to
the t5526 issue (which is trivial, even if it does require manual fixing),
the t9902 is a bit more hairy to reason about.

So yes, I would love to have that test coverage back, but not by making
the transition to `main` even harder by reverting parts of it.

That's why I promised publicly to take care of the loose ends as quickly
as I can, after the conflicting issues graduate to `next` (or when they
become stalled or even dropped from `seen`).

Ciao,
Dscho

>
> Seems worth having that sooner than later if Junio's willing juggle
> that.
>
>  t/t5526-fetch-submodules.sh | 6 +++---
>  t/t9902-completion.sh       | 6 +++---
>  t/test-lib.sh               | 9 +++------
>  3 files changed, 9 insertions(+), 12 deletions(-)
>
> diff --git a/t/t5526-fetch-submodules.sh b/t/t5526-fetch-submodules.sh
> index dd8e423d25..f45ba02b8a 100755
> --- a/t/t5526-fetch-submodules.sh
> +++ b/t/t5526-fetch-submodules.sh
> @@ -481,7 +481,7 @@ test_expect_success PREPARE_FOR_MAIN_BRANCH "don't fetch submodule when newly re
>  	test_i18ncmp expect.err actual.err &&
>  	(
>  		cd submodule &&
> -		git checkout -q master
> +		git checkout -q main
>  	)
>  '
>
> @@ -663,9 +663,9 @@ test_expect_success 'fetch new submodule commits on-demand without .gitmodules e
>  	git config -f .gitmodules --remove-section submodule.sub1 &&
>  	git add .gitmodules &&
>  	git commit -m "delete gitmodules file" &&
> -	git checkout -B master &&
> +	git checkout -B main &&
>  	git -C downstream fetch &&
> -	git -C downstream checkout origin/master &&
> +	git -C downstream checkout origin/main &&
>
>  	C=$(git -C submodule commit-tree -m "yet another change outside refs/heads" HEAD^{tree}) &&
>  	git -C submodule update-ref refs/changes/7 $C &&
> diff --git a/t/t9902-completion.sh b/t/t9902-completion.sh
> index 5c01c75d40..3696b85acb 100755
> --- a/t/t9902-completion.sh
> +++ b/t/t9902-completion.sh
> @@ -1055,13 +1055,13 @@ test_expect_success 'teardown after filtering matching refs' '
>  	git -C otherrepo branch -D matching/branch-in-other
>  '
>
> -test_expect_success PREPARE_FOR_MAIN_BRANCH '__git_refs - for-each-ref format specifiers in prefix' '
> +test_expect_success '__git_refs - for-each-ref format specifiers in prefix' '
>  	cat >expected <<-EOF &&
>  	evil-%%-%42-%(refname)..master
>  	EOF
>  	(
> -		cur="evil-%%-%42-%(refname)..mai" &&
> -		__git_refs "" "" "evil-%%-%42-%(refname).." mai >"$actual"
> +		cur="evil-%%-%42-%(refname)..mas" &&
> +		__git_refs "" "" "evil-%%-%42-%(refname).." mas >"$actual"
>  	) &&
>  	test_cmp expected "$actual"
>  '
> diff --git a/t/test-lib.sh b/t/test-lib.sh
> index d39bdf04ce..ed489b2213 100644
> --- a/t/test-lib.sh
> +++ b/t/test-lib.sh
> @@ -257,7 +257,7 @@ case "$TRASH_DIRECTORY" in
>  esac
>
>  case "$TEST_NUMBER" in
> -3404|4013|5310|5526|6300|7064|7817|9902)
> +3404|4013|5310|6300|7064|7817|9902)
>  	# Avoid conflicts with patch series that are cooking at the same time
>  	# as the patch series changing the default of `init.defaultBranch`.
>  	GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
> @@ -1725,12 +1725,9 @@ test_lazy_prereq REBASE_P '
>  	test -z "$GIT_TEST_SKIP_REBASE_P"
>  '
>
> -# Special-purpose prereq for transitioning to a new default branch name:
> -# Some tests need more than just a mindless (case-preserving) s/master/main/g
> -# replacement. The non-trivial adjustments are guarded behind this
> -# prerequisite, acting kind of as a feature flag
> +# Obsolete, do not use, removed soon!
>  test_lazy_prereq PREPARE_FOR_MAIN_BRANCH '
> -	test "$GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME" = main
> +	test "$TEST_NAME" = "t5526-fetch-submodules"
>  '
>
>  # Ensure that no test accidentally triggers a Git command
> --
> 2.29.2.222.g5d2a92d10f8
>
>
>

^ permalink raw reply	[flat|nested] 163+ messages in thread

* Re: [PATCH 00/28] Use main as default branch name
  2020-11-18 23:45     ` Philip Oakley
@ 2020-11-19  0:00       ` Johannes Schindelin
  2020-11-19  0:30         ` Philip Oakley
  2020-11-19  0:30         ` Peter Hadlaw
  2020-11-19  1:51       ` Junio C Hamano
  1 sibling, 2 replies; 163+ messages in thread
From: Johannes Schindelin @ 2020-11-19  0:00 UTC (permalink / raw)
  To: Philip Oakley
  Cc: Junio C Hamano, Eric W. Biederman,
	Johannes Schindelin via GitGitGadget, git

Hi Philip,

On Wed, 18 Nov 2020, Philip Oakley wrote:

> An alternative in the other direction is to go with the 'not currently
> on any branch' (detached at nowhere) but then require users to
> deliberately create their first branch with their chosen name. This
> moves the 'backward incompatibility' to a different place, which may be
> easier to manage.

It might be easier to manage for _us_, the Git developers. But every user
who initializes a repository and wants to push now needs to take the extra
step to give their unnamed branch ("detached HEAD" is _still_ confusing
new users!!!) a name.

That would be much more disruptive than choosing a "rather dull and
boring" name instead of a rather racially-charged one.

And we promised to try to minimize the disruption to Git users.

Ciao,
Dscho

^ permalink raw reply	[flat|nested] 163+ messages in thread

* Re: [PATCH 00/28] Use main as default branch name
  2020-11-19  0:00       ` Johannes Schindelin
@ 2020-11-19  0:30         ` Philip Oakley
  2020-11-19  0:30         ` Peter Hadlaw
  1 sibling, 0 replies; 163+ messages in thread
From: Philip Oakley @ 2020-11-19  0:30 UTC (permalink / raw)
  To: Johannes Schindelin
  Cc: Junio C Hamano, Eric W. Biederman,
	Johannes Schindelin via GitGitGadget, git

Hi Dscho,

On 19/11/2020 00:00, Johannes Schindelin wrote:
> Hi Philip,
>
> On Wed, 18 Nov 2020, Philip Oakley wrote:
>
>> An alternative in the other direction is to go with the 'not currently
>> on any branch' (detached at nowhere) but then require users to
>> deliberately create their first branch with their chosen name. This
>> moves the 'backward incompatibility' to a different place, which may be
>> easier to manage.
> It might be easier to manage for _us_, the Git developers. But every user
> who initializes a repository and wants to push now

Is this 'emerges fully formed' initialise & push  really that common.

I'd be expecting a few add & commits prior to the push, so plenty of
time for deciding and creating the chosen branch. At least that was the
thought process...

>  needs to take the extra
> step to give their unnamed branch

>  ("detached HEAD" is _still_ confusing
> new users!!!) a name.
I'd only mentioned the detached head to keep the devs happy ;-) I'm
quite happy with a "not on any named branch yet" type message for normal
usage.

>
> That would be much more disruptive than choosing a "rather dull and
> boring" name instead of a rather racially-charged one.
"Main" is fine, but Junio had mention say "Primary" as being more
positive, but that is begging the question for the user. We should let
them chose.

Hence using the not greatly inspiring 'main' as a starter offering would
match that desire that the user should, ideally, make their own choice. 
>
> And we promised to try to minimize the disruption to Git users.
...but we haven't said 'it' is an ignorable issue. There's still a lot
of old documentation and inertia to overcome.
>
> Ciao,
> Dscho
Philip

^ permalink raw reply	[flat|nested] 163+ messages in thread

* Re: [PATCH 00/28] Use main as default branch name
  2020-11-19  0:00       ` Johannes Schindelin
  2020-11-19  0:30         ` Philip Oakley
@ 2020-11-19  0:30         ` Peter Hadlaw
  2020-11-19  0:44           ` Philip Oakley
  1 sibling, 1 reply; 163+ messages in thread
From: Peter Hadlaw @ 2020-11-19  0:30 UTC (permalink / raw)
  To: Johannes Schindelin
  Cc: Philip Oakley, Junio C Hamano, Eric W. Biederman,
	Johannes Schindelin via GitGitGadget, git

Hello,

It's worth noting that the word "slave" comes from the en_slav_ement
of Slavs (the Slavic people of Eastern Europe).

I encourage the whole git team to really think about the changes you are making.

It was just reported to me that a professional friend of mine had
confusion as to why,
after initializing a new repository, they couldn't navigate to the
`master` branch of their repository.

I understand this is back-of-the-napkin type math but stay with me for
one moment.
I also understand GitHub is not all of git users, but I just pulled
the number to help me out here.

If GitHub has 40 million users but let's say half of them aren't
active, so now we are at 20 million.
(Replace this number with how many actual users of git are out there.)

Let's even say half of them are on board and aware of this "harmless"
change to a more "sensitive" doublespeak representation of the
"master" copy/branch of the repo.

That leaves us with 10 million users of git that are either unaware or
are not on board. Let's say it takes 3 minutes for a user to search on
the web why exactly they can't
navigate to their "master" branch. That's 30 million minutes of time
wasted, or about 57 man-YEARs of time wasted.... for what?

When do we put our foot down and say enough is enough, and not
everything is offensive?

Again, please reconsider making this change towards doublespeak and
consider the ramifications of how much actual human life & time will
be wasted.

Kind Regards,
Peter

On Wed, Nov 18, 2020 at 6:01 PM Johannes Schindelin
<Johannes.Schindelin@gmx.de> wrote:
>
> Hi Philip,
>
> On Wed, 18 Nov 2020, Philip Oakley wrote:
>
> > An alternative in the other direction is to go with the 'not currently
> > on any branch' (detached at nowhere) but then require users to
> > deliberately create their first branch with their chosen name. This
> > moves the 'backward incompatibility' to a different place, which may be
> > easier to manage.
>
> It might be easier to manage for _us_, the Git developers. But every user
> who initializes a repository and wants to push now needs to take the extra
> step to give their unnamed branch ("detached HEAD" is _still_ confusing
> new users!!!) a name.
>
> That would be much more disruptive than choosing a "rather dull and
> boring" name instead of a rather racially-charged one.
>
> And we promised to try to minimize the disruption to Git users.
>
> Ciao,
> Dscho



-- 
Peter

^ permalink raw reply	[flat|nested] 163+ messages in thread

* Re: [PATCH 00/28] Use main as default branch name
  2020-11-19  0:30         ` Peter Hadlaw
@ 2020-11-19  0:44           ` Philip Oakley
  2020-11-19  0:55             ` Peter Hadlaw
  0 siblings, 1 reply; 163+ messages in thread
From: Philip Oakley @ 2020-11-19  0:44 UTC (permalink / raw)
  To: Peter Hadlaw, Johannes Schindelin
  Cc: Junio C Hamano, Eric W. Biederman,
	Johannes Schindelin via GitGitGadget, git

On 19/11/2020 00:30, Peter Hadlaw wrote:
> That leaves us with 10 million users of git that are either unaware or
> are not on board. Let's say it takes 3 minutes for a user to search on
> the web why exactly they can't
> navigate to their "master" branch. That's 30 million minutes of time
> wasted, or about 57 man-YEARs of time wasted.... for what?
That's (3 mins) probably about the same amount of time as most users
waste on stack overflow for Git questions, or the old 'RTFM', for their
problems in a typical week anyway.

3 mins out of a 35 hr week, over a 44 week x 25 year life is 1.3 ppm,
unless you work too hard and too long, where it's an even lower ppm.

There are mechanism in this series for setting the default branch name.

--
Philip


^ permalink raw reply	[flat|nested] 163+ messages in thread

* Re: [PATCH 00/28] Use main as default branch name
  2020-11-19  0:44           ` Philip Oakley
@ 2020-11-19  0:55             ` Peter Hadlaw
  0 siblings, 0 replies; 163+ messages in thread
From: Peter Hadlaw @ 2020-11-19  0:55 UTC (permalink / raw)
  To: Philip Oakley
  Cc: Johannes Schindelin, Junio C Hamano, Eric W. Biederman,
	Johannes Schindelin via GitGitGadget, git

There's still a responsibility for ~57 years worth of human life that
doesn't actually need to be put at risk.

Someone forgetting how to rebase a branch in some given way and then
having to search is their own responsibility.
On the other hand, this is a decision made on their behalf, without
their consent, ... on everyone's behalf.

If you're not going to change the default without user input, are you
going to ask the user for a default branch name?
Figure out the math and annoyance on that.

On Wed, Nov 18, 2020 at 6:44 PM Philip Oakley <philipoakley@iee.email> wrote:
>
> On 19/11/2020 00:30, Peter Hadlaw wrote:
> > That leaves us with 10 million users of git that are either unaware or
> > are not on board. Let's say it takes 3 minutes for a user to search on
> > the web why exactly they can't
> > navigate to their "master" branch. That's 30 million minutes of time
> > wasted, or about 57 man-YEARs of time wasted.... for what?
> That's (3 mins) probably about the same amount of time as most users
> waste on stack overflow for Git questions, or the old 'RTFM', for their
> problems in a typical week anyway.
>
> 3 mins out of a 35 hr week, over a 44 week x 25 year life is 1.3 ppm,
> unless you work too hard and too long, where it's an even lower ppm.
>
> There are mechanism in this series for setting the default branch name.
>
> --
> Philip
>


-- 
Peter

^ permalink raw reply	[flat|nested] 163+ messages in thread

* Re: [PATCH 00/28] Use main as default branch name
  2020-11-18 23:45     ` Philip Oakley
  2020-11-19  0:00       ` Johannes Schindelin
@ 2020-11-19  1:51       ` Junio C Hamano
  2020-11-19 10:35         ` Philip Oakley
  1 sibling, 1 reply; 163+ messages in thread
From: Junio C Hamano @ 2020-11-19  1:51 UTC (permalink / raw)
  To: Philip Oakley
  Cc: Eric W. Biederman, Johannes Schindelin via GitGitGadget, git,
	Johannes Schindelin

Philip Oakley <philipoakley@iee.email> writes:

> An alternative in the other direction is to go with the 'not currently
> on any branch' (detached at nowhere) but then require users to
> deliberately create their first branch with their chosen name. This
> moves the 'backward incompatibility' to a different place, which may be
> easier to manage.

As has already been mentioned by Peff, I do not think that is a
workable alternative, especially given that people are generally
afraid of and easily get confused by being on a detached HEAD.

And there is no such thing as unborn detached HEAD.  Existing
versions of Git would not consider a $GIT_DIR that does not have any
HEAD, which means a new repository created by such an "initially
there is no branch" version of Git cannot be accessed by any
existing versions of Git.

It raises the backward incompatibility of such an approach to a
whole new level that is simply unmanageable, I am afraid.

^ permalink raw reply	[flat|nested] 163+ messages in thread

* Re: [PATCH 00/28] Use main as default branch name
  2020-11-18 15:43                 ` Junio C Hamano
@ 2020-11-19  9:22                   ` Johannes Schindelin
  0 siblings, 0 replies; 163+ messages in thread
From: Johannes Schindelin @ 2020-11-19  9:22 UTC (permalink / raw)
  To: Junio C Hamano
  Cc: Jonathan Nieder, Jeff King, Felipe Contreras, Eric W. Biederman,
	Johannes Schindelin via GitGitGadget, Git

Hi Junio,

On Wed, 18 Nov 2020, Junio C Hamano wrote:

> Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
>
> > So yes, I totally agree that triggering an interactive prompt by the empty
> > value is not really a good idea (nor a particularly intuitive behavior).
>
> Puzzled.
>
> Nobody talked about going interactive so far and I didn't suggest
> it---even though I think it is a cute idea to give a "what branch
> name do you want to use?" prompt, I do not think it is practical.

The interactive prompt was what I understood your "a notation that asks
for the basename behaviour" comment. The "ask" was what tripped me up, I
always interpret that as interactive. But now that I re-read it, I
understand that you had not thought that far yet.

> I thought it was obvious, but the key to coming up with a name
> dynamically instead of using a fixed string is to derive from a cue
> the end user gives, not directly use what the end user gives.  I do
> not think anybody in the discussion meant by "the <basename> thing"
> to literally use $(basename $(cwd)) output, but use it to derive a
> token that check-ref-format likes.  As you may have already known
> when you wrote them, "My Documents" or the root directory case are
> red herring---it would be trivial to derive "MyDocuments" or
> "my-documents" for the former, and for the latter, it is totally OK
> for the deriving rule to come up with any of "unnamed", "initial",
> etc.

The more magic you introduce, the less intuitive the whole thing gets, and
the more disruptive the change.

> Most of the thing you said in the message I am responding to did not
> make much sense to me.  Perhaps you can retry after reading the
> message you are responding to again?

Could you be a bit more specific?

Was it the "I already use the empty string to force a fall-back, it cannot
also mean something else" that did not make sense?

Or my comment that special-casing values that start with a colon would
look saner to me?

Or the comment about the basename in a root directory?

Or referencing the SFC statement that we want to minimize disruption?

Or my stated preference to go with `main` in order to fulfill that promise
of minimizing the disruption to users?

Or my current plan to introduce an `advise()` call when running `git init`
that tells users that the fall-back for `init.defaultBranch` will change
soon and that users are encouraged to configure it if they care about
keeping the current fall-back?

Or that all of this needs to be done with care?

The message you refer to might not have been the best example of clear
communication, but it hardly deserved _that_ response.

Ciao,
Dscho

^ permalink raw reply	[flat|nested] 163+ messages in thread

* Re: [RFC/PATCH] tests: support testing with an arbitrary default branch (sort of)
  2020-11-18 15:56                 ` Junio C Hamano
@ 2020-11-19  9:32                   ` Johannes Schindelin
  2020-11-19 19:35                     ` Junio C Hamano
  0 siblings, 1 reply; 163+ messages in thread
From: Johannes Schindelin @ 2020-11-19  9:32 UTC (permalink / raw)
  To: Junio C Hamano
  Cc: Ævar Arnfjörð Bjarmason, Jeff King, git,
	Theodore Ts'o, Don Goodman-Wilson, brian m. carlson,
	Felipe Contreras

[-- Attachment #1: Type: text/plain, Size: 818 bytes --]

Hi Junio & Ævar,

On Wed, 18 Nov 2020, Junio C Hamano wrote:

> Ævar Arnfjörð Bjarmason <avarab@gmail.com> writes:
>
> > P.S.: Shouldn't the pull patch in d18c950a69f be using the advice
> >      facility, not warning()?
>
> I think warning() is the right thing here, as it is self squelching.
> Setting pull.rebase (even to 'false') is sufficient---there is no
> need to set advise.setpullrebase to 'false' on top.

Right. The only reason to use `advise()` would be to allow users to
squelch the warning by setting `advice.*`.

On the other hand, warnings are not colored, but advice messages are.

And now I realize that the same holds for `init.defaultBranch`: it is also
self-squelching. And it also might benefit from the coloring to make it
stand out a bit.

Thoughts?

Ciao,
Dscho

^ permalink raw reply	[flat|nested] 163+ messages in thread

* Re: [PATCH 00/28] Use main as default branch name
  2020-11-19  1:51       ` Junio C Hamano
@ 2020-11-19 10:35         ` Philip Oakley
  2020-11-19 11:10           ` Sergey Organov
  0 siblings, 1 reply; 163+ messages in thread
From: Philip Oakley @ 2020-11-19 10:35 UTC (permalink / raw)
  To: Junio C Hamano
  Cc: Eric W. Biederman, Johannes Schindelin via GitGitGadget, git,
	Johannes Schindelin

On 19/11/2020 01:51, Junio C Hamano wrote:
> Philip Oakley <philipoakley@iee.email> writes:
>
>> An alternative in the other direction is to go with the 'not currently
>> on any branch' (detached at nowhere) but then require users to
>> deliberately create their first branch with their chosen name. This
>> moves the 'backward incompatibility' to a different place, which may be
>> easier to manage.
> As has already been mentioned by Peff, I do not think that is a
> workable alternative, especially given that people are generally
> afraid of and easily get confused by being on a detached HEAD.
Yes, our use of the technical phrase 'detached HEAD' is confusing,
compared with the more pleasant 'not on any branch', or 'not at a branch
tip'. Such is the curse of knowledge.
>
> And there is no such thing as unborn detached HEAD.  Existing
> versions of Git would not consider a $GIT_DIR that does not have any
> HEAD, which means a new repository created by such an "initially
> there is no branch" version of Git cannot be accessed by any
> existing versions of Git.
Isn't this, essentially, because there is no 'empty/null commit' that we
(HEAD) could start at? There have been a few cases where I've been
'annoyed' that we're missing that. (rather than the orphan branch approach)
>
> It raises the backward incompatibility of such an approach to a
> whole new level that is simply unmanageable, I am afraid.
OK, accepted.

Philip


^ permalink raw reply	[flat|nested] 163+ messages in thread

* Re: [RFC/PATCH] tests: support testing with an arbitrary default branch (sort of)
  2020-11-18 13:32               ` Ævar Arnfjörð Bjarmason
  2020-11-18 14:16                 ` Felipe Contreras
  2020-11-18 15:56                 ` Junio C Hamano
@ 2020-11-19 10:46                 ` Johannes Schindelin
  2 siblings, 0 replies; 163+ messages in thread
From: Johannes Schindelin @ 2020-11-19 10:46 UTC (permalink / raw)
  To: Ævar Arnfjörð Bjarmason
  Cc: Jeff King, git, Junio C Hamano, Theodore Ts'o,
	Don Goodman-Wilson, brian m. carlson, Felipe Contreras

[-- Attachment #1: Type: text/plain, Size: 4483 bytes --]

Hi Ævar,

I agree with pretty much all you said, just wanted to comment on a couple
things:

On Wed, 18 Nov 2020, Ævar Arnfjörð Bjarmason wrote:

> In case I didn't make it clear I have no objection entirely replacing
> "master" with "main" in the tests. I just had a practical
> concern/question about coverage while it was landing, and a suggestion
> of whether perhaps there was an easier/faster way to do the "init"
> change first by omitting some of the test churn.
>
> But if you want to do all the legwork that's fine by me :)

I started it, I finish it, I guess. Well, technically Don started it...

> I think some of the people advocating this change can rightly look at
> some of the previous E-Mail traffic and see what are at best rants and
> at worst some political grandstanding that's at best pretty irrelevant
> to any proposed changes in git.git.
>
> But that doesn't mean that there aren't some legitimate concerns.

And that's so sad to read. It is disheartening how eager certain people
were to drown out others' voices, then claiming that they had not heard
any views opposing their own. I mean, yeah, if you want to hear other
opinions, it sure helps to stop talking for a while, and to start
listening.

I consider myself lucky that I _did_ get the chance to listen. Related to
my work in GSoC and Outreachy, and through my day job, wonderful people
approached me with their stories and perspectives. I am really glad that I
had the opportunity to hear those.

As to legitimate concerns: yes, you are right. There are those. If your
documentation says that you should avoid committing directly to the
`master` branch, and then you clone a popular Open Source project and it
does not even _have_ a `master` branch, that might be a bit puzzling.

Note that I used a clone as an example, not `git init`, because it is a
much more common operation. Git is a tool for developers to communicate,
in a way, after all, even if it _can_ be used for working in isolation,
too. Hence clones outnumber inits. And that communication of ideas, of
code, and to combine efforts, to collaborate, that is what Git really
facilitates. That is why I find it so important to be inclusive, to be
inviting underrepresented developers. There is such a lot of untapped
potential there, and even if using a non-offensive default branch name is
but a _teeny_ tiny step to open the door a little, it is at least a step
in the right direction.

Now, since I mentioned `clone`: please note that the default branch name
used in a `clone` is squarely outside the Git project's control. It is
decided by the maintainer(s)/communities of the respective projects. And
that's exactly how it should be.

Therefore, as you said before, it does not really matter all that much
at what date we will change the fall-back for `init.defaultBranch`.

At the same time, I still think that it is valuable to transition the test
suite _now_, to be as independent on a specific default branch name as
possible, if only to ensure that above-mentioned projects can choose
freely what they want their primary branch to be called and Git works just
fine.

> I do 100% agree that the s/master/main/g change of the default should be
> made in one form or another. In my mind that doesn't even require a
> consideration of the political motivations at this point as far as
> git.git is concerned, just:
>
>  1. Major Git hosting providers already made the change
>
>  2. Realistically a lot/majority of git's user base interact with that
>     in a major way.
>
>  3. A discrepancy in any default between /usr/bin/git and those
>     providers is more confusing than not.

Right.

I originally thought that we should switch the default branch name in
v2.30 for that reason, but I now think that adding that advice is probably
a less disruptive, and almost equally supportive solution.

>  4. #3 doesn't mean they say "jump" we say "how high" whatever the
>     change is.
>
>     But in this case the default is an entirely arbitrary default. Not
>     e.g. that they decided to add some ill-thought out header to the
>     object format or whatever.
>
> P.S.: Shouldn't the pull patch in d18c950a69f be using the advice
>      facility, not warning()?

I submitted a patch for that, but unfortunately forgot to Cc: you:
https://lore.kernel.org/git/pull.795.git.1605781349528.gitgitgadget@gmail.com

Ciao,
Dscho

^ permalink raw reply	[flat|nested] 163+ messages in thread

* Re: [PATCH 00/28] Use main as default branch name
  2020-11-19 10:35         ` Philip Oakley
@ 2020-11-19 11:10           ` Sergey Organov
  2020-11-19 11:50             ` Philip Oakley
  2020-11-21 23:01             ` Junio C Hamano
  0 siblings, 2 replies; 163+ messages in thread
From: Sergey Organov @ 2020-11-19 11:10 UTC (permalink / raw)
  To: Philip Oakley
  Cc: Junio C Hamano, Eric W. Biederman,
	Johannes Schindelin via GitGitGadget, git, Johannes Schindelin

Philip Oakley <philipoakley@iee.email> writes:

> On 19/11/2020 01:51, Junio C Hamano wrote:
>> Philip Oakley <philipoakley@iee.email> writes:
>>
>>> An alternative in the other direction is to go with the 'not currently
>>> on any branch' (detached at nowhere) but then require users to
>>> deliberately create their first branch with their chosen name. This
>>> moves the 'backward incompatibility' to a different place, which may be
>>> easier to manage.
>> As has already been mentioned by Peff, I do not think that is a
>> workable alternative, especially given that people are generally
>> afraid of and easily get confused by being on a detached HEAD.
> Yes, our use of the technical phrase 'detached HEAD' is confusing,
> compared with the more pleasant 'not on any branch', or 'not at a branch
> tip'. Such is the curse of knowledge.

To me "not on a branch [tip]" is also confusing, as in fact you are, as
is easily seen after you perform a few commits, and now HEAD points
directly to the tip of the branch (that has no other references).

I wonder why Git didn't rather adopt "unnamed branch" or "nameless
branch" to describe this mode of operation?

-- Sergey

^ permalink raw reply	[flat|nested] 163+ messages in thread

* Re: [PATCH 00/28] Use main as default branch name
  2020-11-19 11:10           ` Sergey Organov
@ 2020-11-19 11:50             ` Philip Oakley
  2020-11-19 12:33               ` Sergey Organov
  2020-11-21 23:01             ` Junio C Hamano
  1 sibling, 1 reply; 163+ messages in thread
From: Philip Oakley @ 2020-11-19 11:50 UTC (permalink / raw)
  To: Sergey Organov
  Cc: Junio C Hamano, Eric W. Biederman,
	Johannes Schindelin via GitGitGadget, git, Johannes Schindelin

On 19/11/2020 11:10, Sergey Organov wrote:
> Philip Oakley <philipoakley@iee.email> writes:
>
>> On 19/11/2020 01:51, Junio C Hamano wrote:
>>> Philip Oakley <philipoakley@iee.email> writes:
>>>
>>>> An alternative in the other direction is to go with the 'not currently
>>>> on any branch' (detached at nowhere) but then require users to
>>>> deliberately create their first branch with their chosen name. This
>>>> moves the 'backward incompatibility' to a different place, which may be
>>>> easier to manage.
>>> As has already been mentioned by Peff, I do not think that is a
>>> workable alternative, especially given that people are generally
>>> afraid of and easily get confused by being on a detached HEAD.
>> Yes, our use of the technical phrase 'detached HEAD' is confusing,
>> compared with the more pleasant 'not on any branch', or 'not at a branch
>> tip'. Such is the curse of knowledge.
> To me "not on a branch [tip]" is also confusing, as in fact you are, as
> is easily seen after you perform a few commits, and now HEAD points
> directly to the tip of the branch (that has no other references).
>
> I wonder why Git didn't rather adopt "unnamed branch" or "nameless
> branch" to describe this mode of operation?
Given the ephemeral nature of branches they sound like good suggestion.

However I suspect "history" to be the "why" of the current 'detached
head' usage.
Maybe it's a side reference to Nearly Headless Nick or other discussions
of the time (aka lost in history)?
--
Philip

^ permalink raw reply	[flat|nested] 163+ messages in thread

* Re: [PATCH 00/28] Use main as default branch name
  2020-11-19 11:50             ` Philip Oakley
@ 2020-11-19 12:33               ` Sergey Organov
  0 siblings, 0 replies; 163+ messages in thread
From: Sergey Organov @ 2020-11-19 12:33 UTC (permalink / raw)
  To: Philip Oakley
  Cc: Junio C Hamano, Eric W. Biederman,
	Johannes Schindelin via GitGitGadget, git, Johannes Schindelin

Philip Oakley <philipoakley@iee.email> writes:

> On 19/11/2020 11:10, Sergey Organov wrote:
>> Philip Oakley <philipoakley@iee.email> writes:
>>
>>> On 19/11/2020 01:51, Junio C Hamano wrote:
>>>> Philip Oakley <philipoakley@iee.email> writes:
>>>>
>>>>> An alternative in the other direction is to go with the 'not currently
>>>>> on any branch' (detached at nowhere) but then require users to
>>>>> deliberately create their first branch with their chosen name. This
>>>>> moves the 'backward incompatibility' to a different place, which may be
>>>>> easier to manage.
>>>> As has already been mentioned by Peff, I do not think that is a
>>>> workable alternative, especially given that people are generally
>>>> afraid of and easily get confused by being on a detached HEAD.
>>> Yes, our use of the technical phrase 'detached HEAD' is confusing,
>>> compared with the more pleasant 'not on any branch', or 'not at a branch
>>> tip'. Such is the curse of knowledge.
>> To me "not on a branch [tip]" is also confusing, as in fact you are, as
>> is easily seen after you perform a few commits, and now HEAD points
>> directly to the tip of the branch (that has no other references).
>>
>> I wonder why Git didn't rather adopt "unnamed branch" or "nameless
>> branch" to describe this mode of operation?
> Given the ephemeral nature of branches they sound like good
> suggestion.

Sure, so to me they sound even more natural in Git context than in any
other VCS I'm aware of.

>
> However I suspect "history" to be the "why" of the current 'detached
> head' usage.
> Maybe it's a side reference to Nearly Headless Nick or other discussions
> of the time (aka lost in history)?

I do have a few commits at which HEAD has been detached, not once at
some. Bloody they are.

-- Sergey

^ permalink raw reply	[flat|nested] 163+ messages in thread

* Re: [PATCH v2 28/27] tests: run tests omitted by PREPARE_FOR_MAIN_BRANCH
  2020-11-18 23:56     ` Johannes Schindelin
@ 2020-11-19 19:30       ` Junio C Hamano
  2020-11-20 13:09         ` Johannes Schindelin
  0 siblings, 1 reply; 163+ messages in thread
From: Junio C Hamano @ 2020-11-19 19:30 UTC (permalink / raw)
  To: Johannes Schindelin
  Cc: Ævar Arnfjörð Bjarmason, git, Jeff King, Felipe Contreras

Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:

> The conflicts might be trivial, but every conflict makes it harder to
> juggle branch thickets like Junio's `seen`. And those things add up.
> They're no fun, and they make life hard and tedious.

The worst part is they can easily be cause of unintended breakage
due to mismerge.

> t5526 conflicts _semantically_ with `pk/subsub-fetch-fix` (which touches
> t5526 and adds a new test case referring to `master`).
>
> t9902 conflicts with `fc/bash-completion-post-2.29`, and in contrast to
> the t5526 issue (which is trivial, even if it does require manual fixing),
> the t9902 is a bit more hairy to reason about.
>
> So yes, I would love to have that test coverage back, but not by making
> the transition to `main` even harder by reverting parts of it.

Hmph, wouldn't the forcing with GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
to 'master' be the right way to keep test coverage?  After all, the
primary goal is to prepare tests so that we won't lose coverage when
the fallback default of init.defaultbranch is switched to 'main',
and it is a secondary goal of much lessor importance to reduce the
number of hits from "git grep master t/".

> That's why I promised publicly to take care of the loose ends as quickly
> as I can, after the conflicting issues graduate to `next` (or when they
> become stalled or even dropped from `seen`).

Perhaps I should start to more aggressively drop topics from `seen`
that are not sufficiently reviewed?  The guiding principle ought to
be "unreviewed patches are not worth applying", but I have a feeling
that we have become more and more lax over time due to shortage of
quality reviews.  I dunno.


^ permalink raw reply	[flat|nested] 163+ messages in thread

* Re: [RFC/PATCH] tests: support testing with an arbitrary default branch (sort of)
  2020-11-19  9:32                   ` Johannes Schindelin
@ 2020-11-19 19:35                     ` Junio C Hamano
  2020-11-22 19:07                       ` Johannes Schindelin
  0 siblings, 1 reply; 163+ messages in thread
From: Junio C Hamano @ 2020-11-19 19:35 UTC (permalink / raw)
  To: Johannes Schindelin
  Cc: Ævar Arnfjörð Bjarmason, Jeff King, git,
	Theodore Ts'o, Don Goodman-Wilson, brian m. carlson,
	Felipe Contreras

Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:

> Hi Junio & Ævar,
>
> On Wed, 18 Nov 2020, Junio C Hamano wrote:
>
>> Ævar Arnfjörð Bjarmason <avarab@gmail.com> writes:
>>
>> > P.S.: Shouldn't the pull patch in d18c950a69f be using the advice
>> >      facility, not warning()?
>>
>> I think warning() is the right thing here, as it is self squelching.
>> Setting pull.rebase (even to 'false') is sufficient---there is no
>> need to set advise.setpullrebase to 'false' on top.
>
> Right. The only reason to use `advise()` would be to allow users to
> squelch the warning by setting `advice.*`.
>
> On the other hand, warnings are not colored, but advice messages are.
>
> And now I realize that the same holds for `init.defaultBranch`: it is also
> self-squelching. And it also might benefit from the coloring to make it
> stand out a bit.
>
> Thoughts?

I do not see colors well.  You'll always get "find some other way to
make it stand out more to those like us---if you canhdo so without
colors, that would be ideal" from me, so please don't ask me to vote
for more colors.



^ permalink raw reply	[flat|nested] 163+ messages in thread

* Re: [PATCH v3 00/28] tests: use main as default branch name
  2020-11-18 23:44   ` [PATCH v3 00/28] tests: use main as default branch name Johannes Schindelin via GitGitGadget
                       ` (27 preceding siblings ...)
  2020-11-18 23:44     ` [PATCH v3 28/28] tests: drop prereq `PREPARE_FOR_MAIN_BRANCH` where no longer needed Johannes Schindelin via GitGitGadget
@ 2020-11-19 23:35     ` Junio C Hamano
  28 siblings, 0 replies; 163+ messages in thread
From: Junio C Hamano @ 2020-11-19 23:35 UTC (permalink / raw)
  To: Johannes Schindelin via GitGitGadget
  Cc: git, Felipe Contreras, Ævar Arnfjörð Bjarmason,
	Johannes Schindelin, Jeff King, Jonathan Nieder

"Johannes Schindelin via GitGitGadget" <gitgitgadget@gmail.com>
writes:

> Note that this branch is based on next, mostly because it would otherwise
> conflict with en/merge-tests, jk/diff-release-filespec-fix and 
> ds/maintenance-part-3.

Note that what is queued in my tree is unlikely to be based on
'next', but instead start by merging jk/diff-release-filespec-fix
and possibly the fix-up for ds/maintenance-part-3 into 'master' and
then applying these patches on top.  

This will be time consuming but cannot be avoided ;-)

I just started building such a topic branch.  It is likely that
the result of today's integration cycle would be pushed out much
later than usual.

Thanks.

^ permalink raw reply	[flat|nested] 163+ messages in thread

* Re: [RFC/PATCH] tests: support testing with an arbitrary default branch (sort of)
  2020-11-18 14:16                 ` Felipe Contreras
@ 2020-11-20 11:36                   ` Ævar Arnfjörð Bjarmason
  2020-11-20 16:00                     ` Felipe Contreras
  0 siblings, 1 reply; 163+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2020-11-20 11:36 UTC (permalink / raw)
  To: Felipe Contreras
  Cc: Johannes Schindelin, Jeff King, Git, Junio C Hamano,
	Theodore Ts'o, Don Goodman-Wilson, brian m. carlson


On Wed, Nov 18 2020, Felipe Contreras wrote:

> On Wed, Nov 18, 2020 at 7:32 AM Ævar Arnfjörð Bjarmason
> <avarab@gmail.com> wrote:
>
>> I do 100% agree that the s/master/main/g change of the default should be
>> made in one form or another. In my mind that doesn't even require a
>> consideration of the political motivations at this point as far as
>> git.git is concerned, just:
>
> Others disagree.

Sure, and I might end up disagreeing with myself once we have the
proposed patches & more people inevitably chime in with some useful data
about the trade-offs, edge cases we haven't considered etc.

> While the political motivation shouldn't be a central concern, I
> suspect the vast majority of users have no idea this change is coming,
> and when they see the warning they will likely complain... Strongly.
> The fact that this change is extremely politically charged will become
> a factor.
>
>>  1. Major Git hosting providers already made the change

[... addressed below ...]

> That's their decision. The Git project shouldn't be held hostage to
> third party decisions.
>
>>  2. Realistically a lot/majority of git's user base interact with that
>>     in a major way.
>>
>>  3. A discrepancy in any default between /usr/bin/git and those
>>     providers is more confusing than not.
>
> That's a problem for GitHub et al. Fortunately they can tell their
> users to set init.defaultbranch to whatever they want.

I think this and what you mention in another thread[1] about GitHub's
instructions for creating a repository takes a narrow view of our
responsibility for creating a sane UI for users.

For example, right after the instructions you note there GitHub's
current instructions are:

    git remote add origin $url
    git branch -M main
    git push -u origin main

Now, put yourself in the shoes of a novice user who's just been
introduced to this "git" thing for a job they started 2 days ago. We
don't take the s/master/main/g change in git.git, GitHub keeps
theirs.

You followed some tutorial or read the manpage to create a local
repository and made a few commits, then to upload it to GitHub or
another provider that uses "main" by default you copy/pasted the above
commands. Now the thing changing from "master" to "main" is one more
thing you're confused by.

That's my motivation for supporting this change. I think most git users
by number are (hopefully) in the future, yes, as you note we'll have
version transitions where that's more confusing than not, but the same
can be said about the dashed command transition.

Whatever mistakes we made in that transition and should learn from a
typical git user in 2020 has never used a dashed builtin, just like a
new user in 2030 probably won't know or have to care about their local
default being different than a $BIG_HOSTING_PROVIDER default.

That *is* our problem, not just a problem for GitHub et al. To claim
otherwise is to just bury our head in the sand.

Are we on balance going to not make the change because e.g. we don't
want various paper books and tutorials to be confusing? Maybe, maybe
not. But just dismissing those concerns by saying e.g. "that's
O'Reilly's problem" would be as nonsensical as us pretending that
perpetuating an (admittedly rather minor) UI difference in perpetuity by
our inaction is purely GitHub's responsibility.

>>  4. #3 doesn't mean they say "jump" we say "how high" whatever the
>>     change is.
>>
>>     But in this case the default is an entirely arbitrary default. Not
>>     e.g. that they decided to add some ill-thought out header to the
>>     object format or whatever.
>
> I don't agree it is arbitrary, otherwise you could set the default to
> "loremipsum". Moreover, even if was arbitrary, it was arbitrary in
> 2005, not 2020 where "master" is already widely used in basically
> *all* the documentation everywhere. Some people have been using this
> name for 15 years, they won't give it up just like that.

Yes, that was badly phrased and I take that back. I meant to say
something closer to "a common convention" or whatever. E.g. if GitHub et
al for whatever reason switched all use of "origin" as the default
remote to "source" I'd think that at some point we'd be improving things
overall if we made that switch as well.

> People will complain, especially if they don't see a good reason for
> the change.


1. https://lore.kernel.org/git/CAMP44s1515GOwTOYv-wz4qMC9Qb6d8cSVSb_CNVwun0+Yj3VxQ@mail.gmail.com/

^ permalink raw reply	[flat|nested] 163+ messages in thread

* Re: [PATCH v2 28/27] tests: run tests omitted by PREPARE_FOR_MAIN_BRANCH
  2020-11-19 19:30       ` Junio C Hamano
@ 2020-11-20 13:09         ` Johannes Schindelin
  2020-11-20 18:08           ` Junio C Hamano
  0 siblings, 1 reply; 163+ messages in thread
From: Johannes Schindelin @ 2020-11-20 13:09 UTC (permalink / raw)
  To: Junio C Hamano
  Cc: Ævar Arnfjörð Bjarmason, git, Jeff King, Felipe Contreras

Hi Junio,

On Thu, 19 Nov 2020, Junio C Hamano wrote:

> Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
>
> > The conflicts might be trivial, but every conflict makes it harder to
> > juggle branch thickets like Junio's `seen`. And those things add up.
> > They're no fun, and they make life hard and tedious.
>
> The worst part is they can easily be cause of unintended breakage
> due to mismerge.
>
> > t5526 conflicts _semantically_ with `pk/subsub-fetch-fix` (which touches
> > t5526 and adds a new test case referring to `master`).
> >
> > t9902 conflicts with `fc/bash-completion-post-2.29`, and in contrast to
> > the t5526 issue (which is trivial, even if it does require manual fixing),
> > the t9902 is a bit more hairy to reason about.
> >
> > So yes, I would love to have that test coverage back, but not by making
> > the transition to `main` even harder by reverting parts of it.
>
> Hmph, wouldn't the forcing with GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
> to 'master' be the right way to keep test coverage?

Well, I was naive enough to think that this whole "let's transition the
test suite to use `main` as default branch name" business would go over
much quicker. With that expectation, I was content to already have
`PREPARE_FOR_MAIN`-marked test cases in t5526 and t9902. They are
currently skipped because that prereq is still waiting for the transition
to complete.

That's what my promise was about: as soon as the competing topics settle,
I want to address those two test scripts in particular, moving them over
to `GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main`.

> After all, the primary goal is to prepare tests so that we won't lose
> coverage when the fallback default of init.defaultbranch is switched to
> 'main', and it is a secondary goal of much lessor importance to reduce
> the number of hits from "git grep master t/".
>
> > That's why I promised publicly to take care of the loose ends as quickly
> > as I can, after the conflicting issues graduate to `next` (or when they
> > become stalled or even dropped from `seen`).
>
> Perhaps I should start to more aggressively drop topics from `seen`
> that are not sufficiently reviewed?  The guiding principle ought to
> be "unreviewed patches are not worth applying", but I have a feeling
> that we have become more and more lax over time due to shortage of
> quality reviews.  I dunno.

FWIW I think you do a wonderful job of keeping the patch series in `seen`.
I wish we could keep the CI build passing a bit more, but I'd rather have
the branches that are in flight in one place, so that it is easy e.g. to
find out whether `git diff next..seen -- t/t9902\*` is empty (to determine
whether working on that script would cause conflicts right now).

Ciao,
Dscho


^ permalink raw reply	[flat|nested] 163+ messages in thread

* Re: [RFC/PATCH] tests: support testing with an arbitrary default branch (sort of)
  2020-11-20 11:36                   ` Ævar Arnfjörð Bjarmason
@ 2020-11-20 16:00                     ` Felipe Contreras
  0 siblings, 0 replies; 163+ messages in thread
From: Felipe Contreras @ 2020-11-20 16:00 UTC (permalink / raw)
  To: Ævar Arnfjörð Bjarmason
  Cc: Johannes Schindelin, Jeff King, Git, Junio C Hamano,
	Theodore Ts'o, Don Goodman-Wilson, brian m. carlson

On Fri, Nov 20, 2020 at 5:36 AM Ævar Arnfjörð Bjarmason
<avarab@gmail.com> wrote:
> On Wed, Nov 18 2020, Felipe Contreras wrote:

> > That's a problem for GitHub et al. Fortunately they can tell their
> > users to set init.defaultbranch to whatever they want.
>
> I think this and what you mention in another thread[1] about GitHub's
> instructions for creating a repository takes a narrow view of our
> responsibility for creating a sane UI for users.
>
> For example, right after the instructions you note there GitHub's
> current instructions are:
>
>     git remote add origin $url
>     git branch -M main
>     git push -u origin main
>
> Now, put yourself in the shoes of a novice user who's just been
> introduced to this "git" thing for a job they started 2 days ago. We
> don't take the s/master/main/g change in git.git, GitHub keeps
> theirs.

I am.

But that doesn't change the instructions. The "git branch -M main"
would still be there (for older versions of Git).

And the "git push -u origin main" would still be there, because you
need to specify the branch you want to push to. Although I would have
used HEAD instead of main, or even better @, which apparently doesn't
work, but should work. If GitHub cares so much about these
instructions, they could have fixed this so "git push -u origin @"
works, why haven't they? Because they don't care as much as they claim
to (see the obvious inconsistency below).

> You followed some tutorial or read the manpage to create a local
> repository and made a few commits, then to upload it to GitHub or
> another provider that uses "main" by default you copy/pasted the above
> commands. Now the thing changing from "master" to "main" is one more
> thing you're confused by.

What if the project uses "trunk"? Or "default"?

If a project uses a non-standard name, it's their responsibility to
teach their users how to interact with that project. If GitHub chose
"main", it's *their* responsibility to tell their users that this is a
discrepancy from most of the online documentation, including online
documentation specific to GitHub.

The best way the Git project can help is by not hard-coding any of
these names, so the documentation doesn't have to use "master", or
"main", but can use @, or @{upstream}.

But right now the documentation *has* to hard-code these names,
because of poor triangular workflow support from Git, something I
tried to fix many years ago with my @{publish} patches.

If we had proper @{upstream} and @{publish} support, and taught users
how to use them well, there would be no need for anyone to do "git
rebase -i master" ("git rebase -i" would do).

> That's my motivation for supporting this change. I think most git users
> by number are (hopefully) in the future, yes, as you note we'll have
> version transitions where that's more confusing than not, but the same
> can be said about the dashed command transition.

The number of Git users in the future directly depends on how we treat
Git users in the present. And the Git users of the present would not
appreciate that 99% of documentation out there uses "master", while
Git does not, especially if in their mind it's due to bad (political)
reasons.

What's wrong with *first* fixing the interface so we don't have to
type "master" so much (e.g. by properly supporting triangular
workflows), and *then* consider changing "master" later, *after* a lot
of online documentation has stopped using the name "master" directly
as well?

> Whatever mistakes we made in that transition and should learn from a
> typical git user in 2020 has never used a dashed builtin, just like a
> new user in 2030 probably won't know or have to care about their local
> default being different than a $BIG_HOSTING_PROVIDER default.

That's *if* the current project survives in its current form. Perhaps
in 2030 there will be a libgit with more than one user interface.
Nobody knows the future.

> That *is* our problem, not just a problem for GitHub et al. To claim
> otherwise is to just bury our head in the sand.

It is our problem to improve the interface so users don't have to type
"master" (or "main), so much.

It is not our problem that GitHub decided to get ahead of itself and
change their instructions without first considering other options,
like improving the interface.

> Are we on balance going to not make the change because e.g. we don't
> want various paper books and tutorials to be confusing? Maybe, maybe
> not. But just dismissing those concerns by saying e.g. "that's
> O'Reilly's problem" would be as nonsensical as us pretending that
> perpetuating an (admittedly rather minor) UI difference in perpetuity by
> our inaction is purely GitHub's responsibility.

GitHub can fix that UI difference *today* by retracting their
instructions and instead come here and discuss with us ways to improve
the interface first.

They chose that action *unilaterally* without discussing it with the
Git project. That's on them.

Yes, GitHub users are our users too, but we have many more users, we
shouldn't hurt them just because GitHub has no patience.

As an example of GitHub's impatience, look at GitHub's Hello World
[1], the text has been updated to "main", but all the images say
"master". It's their *first* guide, and it's already inconsistent.

https://guides.github.com/activities/hello-world/readme-edits.gif

Additionally, GitHub cannot say "implement X or we will hurt our
users". That would be manipulative tactics, and the Git project should
not succumb to those. Regardless of what GitHub does, the Git project
should implement X on its own terms, if and when it has determined
it's in the best interest of its users.

Moreover, you have not explained precisely how the issues will be
solved by changing the default name. All the documentation out there
would be inconsistent with "main". Even GitHub's own documentation is
inconsistent at this precise moment.

Take one of the first results you get when googling "github how to"
[2], it says to "git push -u origin master". By keeping the name
"master" we are helping those users that are not using a github.com
guide, and are using one of the hundreds (or thousands) of guides out
there that assume the name is master. In fact, the *only* thing that
is hurting GitHub users right now is those initial instructions they
chose, which you can ignore, and instead use an external guide.

It is very likely that by doing this change we would actually hurt
more GitHub users than not doing it.

Cheers.

[1] https://guides.github.com/activities/hello-world/
[2] https://opensource.com/article/18/1/step-step-guide-git

-- 
Felipe Contreras

^ permalink raw reply	[flat|nested] 163+ messages in thread

* Re: [PATCH v2 28/27] tests: run tests omitted by PREPARE_FOR_MAIN_BRANCH
  2020-11-20 13:09         ` Johannes Schindelin
@ 2020-11-20 18:08           ` Junio C Hamano
  0 siblings, 0 replies; 163+ messages in thread
From: Junio C Hamano @ 2020-11-20 18:08 UTC (permalink / raw)
  To: Johannes Schindelin
  Cc: Ævar Arnfjörð Bjarmason, git, Jeff King, Felipe Contreras

Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:

>> Perhaps I should start to more aggressively drop topics from `seen`
>> that are not sufficiently reviewed?  The guiding principle ought to
>> be "unreviewed patches are not worth applying", but I have a feeling
>> that we have become more and more lax over time due to shortage of
>> quality reviews.  I dunno.
>
> FWIW I think you do a wonderful job of keeping the patch series in `seen`.
> I wish we could keep the CI build passing a bit more, but I'd rather have
> the branches that are in flight in one place, so that it is easy e.g. to
> find out whether `git diff next..seen -- t/t9902\*` is empty (to determine
> whether working on that script would cause conflicts right now).

I have to disagree.  There are a few topics, perhaps more than a
few, that is age old in Git timescale nobody has bothered to ask the
list why we still have it in 'seen' [*1*].

It may be a good thing to pick up as many potentially interesting
new topics as possible and to merge them to 'seen' while resolving
possible conflicts with other topics in flight.  I am willing to
continue doing so.

But I doubt that a series lingering in 'seen' that has not been
touched for more than say four weeks has much chance of gaining any
new interest to push it forward.  Perhaps we need a policy to
discard a topic whose author timestamp is 8 weeks or older and not
in 'next', without preventing those who care about the topic from
resurrecting it in support, or something along that line.


[Footnote]

*1* The question can be asked in two ways.  "Shouldn't it go 'next'
already?  I've read it over, here is the review and the thread shows
a clear concensus that it is a good idea" is one happy outcome (even
though that would indicate the maintainer doing a poor job).

Alternatively, "Shouldn't it be discarded?  Nobody seemed interested
back then and now we have X instead, so it is not necessary." is
also a possible happy outcome.

^ permalink raw reply	[flat|nested] 163+ messages in thread

* Re: [PATCH 00/28] Use main as default branch name
  2020-11-19 11:10           ` Sergey Organov
  2020-11-19 11:50             ` Philip Oakley
@ 2020-11-21 23:01             ` Junio C Hamano
  2020-11-22 10:21               ` Sergey Organov
  1 sibling, 1 reply; 163+ messages in thread
From: Junio C Hamano @ 2020-11-21 23:01 UTC (permalink / raw)
  To: Sergey Organov
  Cc: Philip Oakley, Eric W. Biederman,
	Johannes Schindelin via GitGitGadget, git, Johannes Schindelin

Sergey Organov <sorganov@gmail.com> writes:

> To me "not on a branch [tip]" is also confusing, as in fact you are, as
> is easily seen after you perform a few commits, and now HEAD points
> directly to the tip of the branch (that has no other references).

Aren't you confused about what "on a branch" means?

After either of these two operations, your HEAD may point at the
same commit, but the former is on a branch (the master branch), and
the latter is not.

    git checkout master
    git checkout master^0

The difference between these two states does *NOT* come from which
commit HEAD points at.

The difference comes from what happens when you make a new commit
starting from that state.  The former (i.e. you are on a branch)
grows the branch.  The latter (i.e. you are not on a branch) does
not grow any branch.

This is an unrelated trivia, but did anybody know that we were
pretty much on the detached HEAD all the time for more than a month
of early life of Git, until cad88fdf (git-init-db: set up the full
default environment, 2005-05-30)?

^ permalink raw reply	[flat|nested] 163+ messages in thread

* Re: [PATCH 00/28] Use main as default branch name
  2020-11-21 23:01             ` Junio C Hamano
@ 2020-11-22 10:21               ` Sergey Organov
  2020-11-22 11:20                 ` Philip Oakley
  2020-11-22 21:56                 ` Felipe Contreras
  0 siblings, 2 replies; 163+ messages in thread
From: Sergey Organov @ 2020-11-22 10:21 UTC (permalink / raw)
  To: Junio C Hamano
  Cc: Philip Oakley, Eric W. Biederman,
	Johannes Schindelin via GitGitGadget, git, Johannes Schindelin

Junio C Hamano <gitster@pobox.com> writes:

> Sergey Organov <sorganov@gmail.com> writes:
>
>> To me "not on a branch [tip]" is also confusing, as in fact you are, as
>> is easily seen after you perform a few commits, and now HEAD points
>> directly to the tip of the branch (that has no other references).
>
> Aren't you confused about what "on a branch" means?

I believe I'm not.

>
> After either of these two operations, your HEAD may point at the
> same commit, but the former is on a branch (the master branch), and
> the latter is not.
>
>     git checkout master
>     git checkout master^0
>
> The difference between these two states does *NOT* come from which
> commit HEAD points at.

Sure.

>
> The difference comes from what happens when you make a new commit
> starting from that state.  The former (i.e. you are on a branch)
> grows the branch.

Sure.

> The latter (i.e. you are not on a branch) does not grow any branch.

That's one way of looking at it, resulting in this "detached HEAD"
thingy that is too technical for the git user proper, I think. Moreover,
it immediately raises the question: if it doesn't grow any branch, /what/
does it grow?

Another way of describing it, that I prefer, is that you /are/ on an
/unnamed/ branch and new commits grow this particular /unnamed/ branch.
No need not only for "detached", but even for "HEAD" to be known to the
user to get the idea, I think.

>
> This is an unrelated trivia, but did anybody know that we were
> pretty much on the detached HEAD all the time for more than a month
> of early life of Git, until cad88fdf (git-init-db: set up the full
> default environment, 2005-05-30)?

I was not aware, and it seems that in my terminology it'd sound: "Git
didn't have named branches until cad88fdf".

-- Sergey

^ permalink raw reply	[flat|nested] 163+ messages in thread

* Re: [PATCH 00/28] Use main as default branch name
  2020-11-22 10:21               ` Sergey Organov
@ 2020-11-22 11:20                 ` Philip Oakley
  2020-11-22 13:23                   ` Sergey Organov
  2020-11-22 21:56                 ` Felipe Contreras
  1 sibling, 1 reply; 163+ messages in thread
From: Philip Oakley @ 2020-11-22 11:20 UTC (permalink / raw)
  To: Sergey Organov, Junio C Hamano
  Cc: Eric W. Biederman, Johannes Schindelin via GitGitGadget, git,
	Johannes Schindelin

On 22/11/2020 10:21, Sergey Organov wrote:
> Junio C Hamano <gitster@pobox.com> writes:
>
>> Sergey Organov <sorganov@gmail.com> writes:
>>
>>> To me "not on a branch [tip]" is also confusing, as in fact you are, as
>>> is easily seen after you perform a few commits, and now HEAD points
>>> directly to the tip of the branch (that has no other references).
>> Aren't you confused about what "on a branch" means?
> I believe I'm not.

Isn't this one of those "implementation detail" viewpoint arguments,
combined with some incompleteness in various places.

From a naive english user perspective , 'on' a branch can also mean
anywhere along a branch and not just at the tip. Being at a commit along
a branch can be tricky to appreciate (that on/at distinction isn't
immediately obvious..)
>
>> After either of these two operations, your HEAD may point at the
>> same commit, but the former is on a branch (the master branch), and
>> the latter is not.
>>
>>     git checkout master
>>     git checkout master^0
>>
>> The difference between these two states does *NOT* come from which
>> commit HEAD points at.
> Sure.
From an implementation perspective one can go two ways, and we tell the
user which way we went, even though, ultimately, we look at the same
commit.

Though, for an unborn branch we don't have a null commit value (c.f.
empty tree) to help in being 'detached at nowhere'.
>
>> The difference comes from what happens when you make a new commit
>> starting from that state.  The former (i.e. you are on a branch)
>> grows the branch.
> Sure.
>
>> The latter (i.e. you are not on a branch) does not grow any branch.
> That's one way of looking at it, resulting in this "detached HEAD"
> thingy that is too technical for the git user proper, I think. Moreover,
> it immediately raises the question: if it doesn't grow any branch, /what/
> does it grow?
>
> Another way of describing it, that I prefer, is that you /are/ on an
> /unnamed/ branch and new commits grow this particular /unnamed/ branch.
> No need not only for "detached", but even for "HEAD" to be known to the
> user to get the idea, I think.
I don't think we can start like this and continue with a commit on top
of the orphaned 'unnamed' branch. (Not tried it though..)
>
>> This is an unrelated trivia, but did anybody know that we were
>> pretty much on the detached HEAD all the time for more than a month
>> of early life of Git, until cad88fdf (git-init-db: set up the full
>> default environment, 2005-05-30)?
> I was not aware, and it seems that in my terminology it'd sound: "Git
> didn't have named branches until cad88fdf".
>
> -- Sergey


^ permalink raw reply	[flat|nested] 163+ messages in thread

* Re: [PATCH 00/28] Use main as default branch name
  2020-11-22 11:20                 ` Philip Oakley
@ 2020-11-22 13:23                   ` Sergey Organov
  2020-11-22 20:18                     ` Philip Oakley
  0 siblings, 1 reply; 163+ messages in thread
From: Sergey Organov @ 2020-11-22 13:23 UTC (permalink / raw)
  To: Philip Oakley
  Cc: Junio C Hamano, Eric W. Biederman,
	Johannes Schindelin via GitGitGadget, git, Johannes Schindelin

Philip Oakley <philipoakley@iee.email> writes:

> On 22/11/2020 10:21, Sergey Organov wrote:
>> Junio C Hamano <gitster@pobox.com> writes:
>>
>>> Sergey Organov <sorganov@gmail.com> writes:
>>>
>>>> To me "not on a branch [tip]" is also confusing, as in fact you are, as
>>>> is easily seen after you perform a few commits, and now HEAD points
>>>> directly to the tip of the branch (that has no other references).
>>> Aren't you confused about what "on a branch" means?
>> I believe I'm not.
>
> Isn't this one of those "implementation detail" viewpoint arguments,
> combined with some incompleteness in various places.
>
> From a naive english user perspective , 'on' a branch can also mean
> anywhere along a branch and not just at the tip. Being at a commit along
> a branch can be tricky to appreciate (that on/at distinction isn't
> immediately obvious..)
>>
>>> After either of these two operations, your HEAD may point at the
>>> same commit, but the former is on a branch (the master branch), and
>>> the latter is not.
>>>
>>>     git checkout master
>>>     git checkout master^0
>>>
>>> The difference between these two states does *NOT* come from which
>>> commit HEAD points at.
>> Sure.
> From an implementation perspective one can go two ways, and we tell the
> user which way we went, even though, ultimately, we look at the same
> commit.

AFAIU, the only difference is that HEAD points to the commit directly in
the case of "detached HEAD", while it points to the commit indirectly
through the branch reference in the usual case.

>
> Though, for an unborn branch we don't have a null commit value (c.f.
> empty tree) to help in being 'detached at nowhere'.

We can pretend we have a null commit for the sake of regularity, even
though Git implementation has none.

Actually, it looks like a few things would be easier if Git got the
"Adam" commit that is the ultimate final parent of everything in the
first place, but it didn't.


>>
>>> The difference comes from what happens when you make a new commit
>>> starting from that state.  The former (i.e. you are on a branch)
>>> grows the branch.
>> Sure.
>>
>>> The latter (i.e. you are not on a branch) does not grow any branch.
>> That's one way of looking at it, resulting in this "detached HEAD"
>> thingy that is too technical for the git user proper, I think. Moreover,
>> it immediately raises the question: if it doesn't grow any branch, /what/
>> does it grow?
>>
>> Another way of describing it, that I prefer, is that you /are/ on an
>> /unnamed/ branch and new commits grow this particular /unnamed/ branch.
>> No need not only for "detached", but even for "HEAD" to be known to the
>> user to get the idea, I think.
> I don't think we can start like this and continue with a commit on top
> of the orphaned 'unnamed' branch. (Not tried it though..)

I rather believe we can, no problems, and that's why "detached HEAD" behaves
exactly as unnamed branch would.

To make it obvious "detached HEAD" is in fact a subset of the usual
case, imagine that "detached HEAD" is rather first implemented by
pointing to a branch reference with a hidden name that in turn points to
the commit, and then this "incognito branch reference" is optimized-out
as being invisible anyway, so HEAD now points to the commit itself.

-- Sergey Organov

^ permalink raw reply	[flat|nested] 163+ messages in thread

* Re: [RFC/PATCH] tests: support testing with an arbitrary default branch (sort of)
  2020-11-19 19:35                     ` Junio C Hamano
@ 2020-11-22 19:07                       ` Johannes Schindelin
  0 siblings, 0 replies; 163+ messages in thread
From: Johannes Schindelin @ 2020-11-22 19:07 UTC (permalink / raw)
  To: Junio C Hamano
  Cc: Ævar Arnfjörð Bjarmason, Jeff King, git,
	Theodore Ts'o, Don Goodman-Wilson, brian m. carlson,
	Felipe Contreras

[-- Attachment #1: Type: text/plain, Size: 1765 bytes --]

Hi Junio,

On Thu, 19 Nov 2020, Junio C Hamano wrote:

> Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
>
> > On Wed, 18 Nov 2020, Junio C Hamano wrote:
> >
> >> Ævar Arnfjörð Bjarmason <avarab@gmail.com> writes:
> >>
> >> > P.S.: Shouldn't the pull patch in d18c950a69f be using the advice
> >> >      facility, not warning()?
> >>
> >> I think warning() is the right thing here, as it is self squelching.
> >> Setting pull.rebase (even to 'false') is sufficient---there is no
> >> need to set advise.setpullrebase to 'false' on top.
> >
> > Right. The only reason to use `advise()` would be to allow users to
> > squelch the warning by setting `advice.*`.
> >
> > On the other hand, warnings are not colored, but advice messages are.
> >
> > And now I realize that the same holds for `init.defaultBranch`: it is also
> > self-squelching. And it also might benefit from the coloring to make it
> > stand out a bit.
> >
> > Thoughts?
>
> I do not see colors well.  You'll always get "find some other way to
> make it stand out more to those like us---if you canhdo so without
> colors, that would be ideal" from me, so please don't ask me to vote
> for more colors.

From a purely selfish point of view: colors _do_ serve me well. And from a
maintainer's point of view: I added my share of coloring based on users'
feedback, so I think that even if it does not benefit everybody equally
well, it is valuable to add coloring where helpful.

As to the aspect "find some other way to make it stand out", I believe
that `advise()` addresses that _also_, by virtue of prefixing the lines
with the uniform `hint:` prefix (which stands out visually, at least to
me, maybe it also does that for you?).

Ciao,
Dscho

^ permalink raw reply	[flat|nested] 163+ messages in thread

* Re: [PATCH 00/28] Use main as default branch name
  2020-11-22 13:23                   ` Sergey Organov
@ 2020-11-22 20:18                     ` Philip Oakley
  0 siblings, 0 replies; 163+ messages in thread
From: Philip Oakley @ 2020-11-22 20:18 UTC (permalink / raw)
  To: Sergey Organov
  Cc: Junio C Hamano, Eric W. Biederman,
	Johannes Schindelin via GitGitGadget, git, Johannes Schindelin

On 22/11/2020 13:23, Sergey Organov wrote:
>>>> The latter (i.e. you are not on a branch) does not grow any branch.
>>> That's one way of looking at it, resulting in this "detached HEAD"
>>> thingy that is too technical for the git user proper, I think. Moreover,
>>> it immediately raises the question: if it doesn't grow any branch, /what/
>>> does it grow?
>>>
>>> Another way of describing it, that I prefer, is that you /are/ on an
>>> /unnamed/ branch and new commits grow this particular /unnamed/ branch.
>>> No need not only for "detached", but even for "HEAD" to be known to the
>>> user to get the idea, I think.
>> I don't think we can start like this and continue with a commit on top
>> of the orphaned 'unnamed' branch. (Not tried it though..)
> I rather believe we can, no problems, and that's why "detached HEAD" behaves
> exactly as unnamed branch would.
>
> To make it obvious "detached HEAD" is in fact a subset of the usual
> case, imagine that "detached HEAD" is rather first implemented by
> pointing to a branch reference with a hidden name that in turn points to
> the commit, and then this "incognito branch reference" is optimized-out
> as being invisible anyway, so HEAD now points to the commit itself.
>
Thinking about some options...

After a `git init`: We can hack HEAD to "ref: refs/heads/" (i.e. a
symref to an unnamed branch) and `git status` will report "No commits yet".
My PS1 will report the current branch as "()" (i.e. an empty name).

However,
`git branch` reports "Failed to resolve HEAD as a valid ref.", and
`git commit` reports "cannot lock ref 'HEAD': there is a non-empty
directory '.git/refs/heads/' blocking reference 'refs/heads/'".

So, there could be the option to detect that unnamed ref state (no
characters after the final "/") without going "Fatal:".

However there is still the potential difficulty that after the first
commit on that unnamed branch we would have the difficult choice of:

- either keeping that unnamed ref/branch symref, and have nowhere to
hold the new commit name (oid), because HEAD is already acting as the
place holder for the symref,
- or we have to lose the place holder symref and place the new commit
oid into HEAD, leaving us back at the regular "detached head", but for
an as yet unnamed orphan branch.
(tested on Windows[1])

For the second case we would still need to ensure that  protections are
in place to avoid loosing those detached commits if the user
switches/checks out to new branch based on some other oid. (for that to
happen then that checkout oid must be somewhere in the unnamed branch,
but the latest tip commits should need checking to prevent unexpected
loss - the current warning may not be enough...)

At the moment there is a lot of 'lock-in' for the status quo, and the
alternative may not be any better, and have some backward compatibility
issues, though those may be overstated, depending on how repos are being
'shared'.

Philip


[1]
phili@Philip-Win10 MINGW64 /c/git-sdk-64/usr/src/unnamed ()
$ git version
git version 2.29.2.windows.2


^ permalink raw reply	[flat|nested] 163+ messages in thread

* Re: [PATCH 00/28] Use main as default branch name
  2020-11-22 10:21               ` Sergey Organov
  2020-11-22 11:20                 ` Philip Oakley
@ 2020-11-22 21:56                 ` Felipe Contreras
  2020-11-22 23:54                   ` Junio C Hamano
  1 sibling, 1 reply; 163+ messages in thread
From: Felipe Contreras @ 2020-11-22 21:56 UTC (permalink / raw)
  To: Sergey Organov
  Cc: Junio C Hamano, Philip Oakley, Eric W. Biederman,
	Johannes Schindelin via GitGitGadget, Git, Johannes Schindelin

On Sun, Nov 22, 2020 at 4:24 AM Sergey Organov <sorganov@gmail.com> wrote:
>
> Junio C Hamano <gitster@pobox.com> writes:

> > The latter (i.e. you are not on a branch) does not grow any branch.
>
> That's one way of looking at it, resulting in this "detached HEAD"
> thingy that is too technical for the git user proper, I think. Moreover,
> it immediately raises the question: if it doesn't grow any branch, /what/
> does it grow?
>
> Another way of describing it, that I prefer, is that you /are/ on an
> /unnamed/ branch and new commits grow this particular /unnamed/ branch.
> No need not only for "detached", but even for "HEAD" to be known to the
> user to get the idea, I think.

This is precisely what it is conceptually.

And there's absolutely no need for the user to know what HEAD is
behind the curtains, especially since they can just use @, and think
of it as "the current branch".

It is clearly a branch, for example you can do "git push origin @:my-fix".

Cheers.

-- 
Felipe Contreras

^ permalink raw reply	[flat|nested] 163+ messages in thread

* Re: [PATCH 00/28] Use main as default branch name
  2020-11-22 21:56                 ` Felipe Contreras
@ 2020-11-22 23:54                   ` Junio C Hamano
  0 siblings, 0 replies; 163+ messages in thread
From: Junio C Hamano @ 2020-11-22 23:54 UTC (permalink / raw)
  To: Felipe Contreras
  Cc: Sergey Organov, Philip Oakley, Eric W. Biederman,
	Johannes Schindelin via GitGitGadget, Git, Johannes Schindelin

Felipe Contreras <felipe.contreras@gmail.com> writes:

> It is clearly a branch, for example you can do "git push origin @:my-fix".

Hmm, you can also do "git push origin c2f3bf071e:maintenance", but
it does not make a bare object name a branch.  

At least I doubt the "clearly" part of your statement.  There might
be a better example to support the above claim, but this one is not.



^ permalink raw reply	[flat|nested] 163+ messages in thread

end of thread, other threads:[~2020-11-23  9:29 UTC | newest]

Thread overview: 163+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-12 22:43 [PATCH 00/28] Use main as default branch name Johannes Schindelin via GitGitGadget
2020-11-12 22:43 ` [PATCH 01/28] t0060: preemptively adjust alignment Johannes Schindelin via GitGitGadget
2020-11-12 22:43 ` [PATCH 02/28] t[01]*: adjust the references to the default branch name "main" Johannes Schindelin via GitGitGadget
2020-11-12 22:43 ` [PATCH 03/28] t2*: " Johannes Schindelin via GitGitGadget
2020-11-12 22:43 ` [PATCH 04/28] t3[0-3]*: " Johannes Schindelin via GitGitGadget
2020-11-12 22:43 ` [PATCH 05/28] t3416: preemptively adjust alignment in a comment Johannes Schindelin via GitGitGadget
2020-11-12 22:43 ` [PATCH 06/28] t34*: adjust the references to the default branch name "main" Johannes Schindelin via GitGitGadget
2020-11-12 22:43 ` [PATCH 07/28] t3[5-9]*: " Johannes Schindelin via GitGitGadget
2020-11-12 22:43 ` [PATCH 08/28] t4*: " Johannes Schindelin via GitGitGadget
2020-11-12 22:43 ` [PATCH 09/28] t5323: prepare centered comment for `master` -> `main` Johannes Schindelin via GitGitGadget
2020-11-12 22:43 ` [PATCH 10/28] t5[0-4]*: adjust the references to the default branch name "main" Johannes Schindelin via GitGitGadget
2020-11-12 22:43 ` [PATCH 11/28] t5503: prepare aligned comment for replacing `master` with `main` Johannes Schindelin via GitGitGadget
2020-11-12 22:43 ` [PATCH 12/28] t550*: adjust the references to the default branch name "main" Johannes Schindelin via GitGitGadget
2020-11-12 22:43 ` [PATCH 13/28] t551*: " Johannes Schindelin via GitGitGadget
2020-11-12 22:43 ` [PATCH 14/28] t55[23]*: " Johannes Schindelin via GitGitGadget
2020-11-13 10:02   ` Ævar Arnfjörð Bjarmason
2020-11-13 14:18     ` Johannes Schindelin
2020-11-16 20:07     ` Junio C Hamano
2020-11-12 22:43 ` [PATCH 15/28] t55[4-9]*: " Johannes Schindelin via GitGitGadget
2020-11-12 22:43 ` [PATCH 16/28] t5[6-9]*: " Johannes Schindelin via GitGitGadget
2020-11-12 22:43 ` [PATCH 17/28] t6[0-3]*: " Johannes Schindelin via GitGitGadget
2020-11-12 22:43 ` [PATCH 18/28] t64*: preemptively adjust alignment to prepare for `master` -> `main` Johannes Schindelin via GitGitGadget
2020-11-12 22:43 ` [PATCH 19/28] t6[4-9]*: adjust the references to the default branch name "main" Johannes Schindelin via GitGitGadget
2020-11-12 22:43 ` [PATCH 20/28] t7[0-4]*: " Johannes Schindelin via GitGitGadget
2020-11-12 22:43 ` [PATCH 21/28] t7[5-9]*: " Johannes Schindelin via GitGitGadget
2020-11-12 22:43 ` [PATCH 22/28] t8*: " Johannes Schindelin via GitGitGadget
2020-11-12 22:43 ` [PATCH 23/28] t9[0-4]*: " Johannes Schindelin via GitGitGadget
2020-11-12 22:43 ` [PATCH 24/28] t9[5-7]*: " Johannes Schindelin via GitGitGadget
2020-11-12 22:43 ` [PATCH 25/28] tests(git-p4): transition to the default branch name `main` Johannes Schindelin via GitGitGadget
2020-11-12 22:43 ` [PATCH 26/28] t99*: adjust the references to the default branch name "main" Johannes Schindelin via GitGitGadget
2020-11-12 22:43 ` [PATCH 27/28] tests: drop prereq `PREPARE_FOR_MAIN_BRANCH` where no longer needed Johannes Schindelin via GitGitGadget
2020-11-12 22:43 ` [PATCH 28/28] Change the default branch name to `main` Don Goodman-Wilson via GitGitGadget
2020-11-13  9:57   ` Ævar Arnfjörð Bjarmason
2020-11-13 14:09     ` Johannes Schindelin
2020-11-16 20:04       ` Junio C Hamano
2020-11-13  0:11 ` [PATCH 00/28] Use main as default branch name Felipe Contreras
2020-11-13 12:55 ` Ævar Arnfjörð Bjarmason
2020-11-13 14:22   ` Johannes Schindelin
2020-11-13 16:13     ` [RFC/PATCH] tests: support testing with an arbitrary default branch (sort of) Ævar Arnfjörð Bjarmason
2020-11-13 19:14       ` Jeff King
2020-11-13 22:00         ` Johannes Schindelin
2020-11-13 22:39           ` Johannes Schindelin
2020-11-13 23:49           ` Ævar Arnfjörð Bjarmason
     [not found]             ` <nycvar.QRO.7.76.6.2011162118060.18437@tvgsbejvaqbjf.bet>
2020-11-18 13:32               ` Ævar Arnfjörð Bjarmason
2020-11-18 14:16                 ` Felipe Contreras
2020-11-20 11:36                   ` Ævar Arnfjörð Bjarmason
2020-11-20 16:00                     ` Felipe Contreras
2020-11-18 15:56                 ` Junio C Hamano
2020-11-19  9:32                   ` Johannes Schindelin
2020-11-19 19:35                     ` Junio C Hamano
2020-11-22 19:07                       ` Johannes Schindelin
2020-11-19 10:46                 ` Johannes Schindelin
2020-11-14  0:25           ` Felipe Contreras
2020-11-13 17:42   ` [PATCH 00/28] Use main as default branch name Felipe Contreras
2020-11-14  6:13 ` Junio C Hamano
2020-11-16 19:52   ` Junio C Hamano
2020-11-17 16:10     ` Johannes Schindelin
2020-11-17 19:09       ` Junio C Hamano
2020-11-18 20:58         ` Johannes Schindelin
2020-11-17 16:12 ` [PATCH v2 00/27] tests: use " Johannes Schindelin via GitGitGadget
2020-11-17 16:12   ` [PATCH v2 01/27] t0060: preemptively adjust alignment Johannes Schindelin via GitGitGadget
2020-11-17 16:12   ` [PATCH v2 02/27] t[01]*: adjust the references to the default branch name "main" Johannes Schindelin via GitGitGadget
2020-11-17 16:12   ` [PATCH v2 03/27] t2*: " Johannes Schindelin via GitGitGadget
2020-11-17 16:12   ` [PATCH v2 04/27] t3[0-3]*: " Johannes Schindelin via GitGitGadget
2020-11-17 16:12   ` [PATCH v2 05/27] t3416: preemptively adjust alignment in a comment Johannes Schindelin via GitGitGadget
2020-11-17 16:12   ` [PATCH v2 06/27] t34*: adjust the references to the default branch name "main" Johannes Schindelin via GitGitGadget
2020-11-17 16:12   ` [PATCH v2 07/27] t3[5-9]*: " Johannes Schindelin via GitGitGadget
2020-11-17 16:12   ` [PATCH v2 08/27] t4*: " Johannes Schindelin via GitGitGadget
2020-11-17 16:12   ` [PATCH v2 09/27] t5323: prepare centered comment for `master` -> `main` Johannes Schindelin via GitGitGadget
2020-11-17 16:12   ` [PATCH v2 10/27] t5[0-4]*: adjust the references to the default branch name "main" Johannes Schindelin via GitGitGadget
2020-11-17 16:12   ` [PATCH v2 11/27] t5503: prepare aligned comment for replacing `master` with `main` Johannes Schindelin via GitGitGadget
2020-11-17 16:12   ` [PATCH v2 12/27] t550*: adjust the references to the default branch name "main" Johannes Schindelin via GitGitGadget
2020-11-17 16:12   ` [PATCH v2 13/27] t551*: " Johannes Schindelin via GitGitGadget
2020-11-17 16:12   ` [PATCH v2 14/27] t55[23]*: " Johannes Schindelin via GitGitGadget
2020-11-17 16:12   ` [PATCH v2 15/27] t55[4-9]*: " Johannes Schindelin via GitGitGadget
2020-11-17 16:12   ` [PATCH v2 16/27] t5[6-9]*: " Johannes Schindelin via GitGitGadget
2020-11-17 16:12   ` [PATCH v2 17/27] t6[0-3]*: " Johannes Schindelin via GitGitGadget
2020-11-17 16:12   ` [PATCH v2 18/27] t64*: preemptively adjust alignment to prepare for `master` -> `main` Johannes Schindelin via GitGitGadget
2020-11-17 16:12   ` [PATCH v2 19/27] t6[4-9]*: adjust the references to the default branch name "main" Johannes Schindelin via GitGitGadget
2020-11-17 16:12   ` [PATCH v2 20/27] t7[0-4]*: " Johannes Schindelin via GitGitGadget
2020-11-17 16:12   ` [PATCH v2 21/27] t7[5-9]*: " Johannes Schindelin via GitGitGadget
2020-11-17 16:12   ` [PATCH v2 22/27] t8*: " Johannes Schindelin via GitGitGadget
2020-11-17 16:12   ` [PATCH v2 23/27] t9[0-4]*: " Johannes Schindelin via GitGitGadget
2020-11-17 16:12   ` [PATCH v2 24/27] t9[5-7]*: " Johannes Schindelin via GitGitGadget
2020-11-17 16:12   ` [PATCH v2 25/27] tests(git-p4): transition to the default branch name `main` Johannes Schindelin via GitGitGadget
2020-11-17 16:12   ` [PATCH v2 26/27] t99*: adjust the references to the default branch name "main" Johannes Schindelin via GitGitGadget
2020-11-17 16:12   ` [PATCH v2 27/27] tests: drop prereq `PREPARE_FOR_MAIN_BRANCH` where no longer needed Johannes Schindelin via GitGitGadget
2020-11-18 11:48   ` [PATCH v2 28/27] tests: run tests omitted by PREPARE_FOR_MAIN_BRANCH Ævar Arnfjörð Bjarmason
2020-11-18 23:56     ` Johannes Schindelin
2020-11-19 19:30       ` Junio C Hamano
2020-11-20 13:09         ` Johannes Schindelin
2020-11-20 18:08           ` Junio C Hamano
2020-11-18 23:44   ` [PATCH v3 00/28] tests: use main as default branch name Johannes Schindelin via GitGitGadget
2020-11-18 23:44     ` [PATCH v3 01/28] tests: mark tests relying on the current default for `init.defaultBranch` Johannes Schindelin via GitGitGadget
2020-11-18 23:44     ` [PATCH v3 02/28] t0060: preemptively adjust alignment Johannes Schindelin via GitGitGadget
2020-11-18 23:44     ` [PATCH v3 03/28] t[01]*: adjust the references to the default branch name "main" Johannes Schindelin via GitGitGadget
2020-11-18 23:44     ` [PATCH v3 04/28] t2*: " Johannes Schindelin via GitGitGadget
2020-11-18 23:44     ` [PATCH v3 05/28] t3[0-3]*: " Johannes Schindelin via GitGitGadget
2020-11-18 23:44     ` [PATCH v3 06/28] t3416: preemptively adjust alignment in a comment Johannes Schindelin via GitGitGadget
2020-11-18 23:44     ` [PATCH v3 07/28] t34*: adjust the references to the default branch name "main" Johannes Schindelin via GitGitGadget
2020-11-18 23:44     ` [PATCH v3 08/28] t3[5-9]*: " Johannes Schindelin via GitGitGadget
2020-11-18 23:44     ` [PATCH v3 09/28] t4*: " Johannes Schindelin via GitGitGadget
2020-11-18 23:44     ` [PATCH v3 10/28] t5323: prepare centered comment for `master` -> `main` Johannes Schindelin via GitGitGadget
2020-11-18 23:44     ` [PATCH v3 11/28] t5[0-4]*: adjust the references to the default branch name "main" Johannes Schindelin via GitGitGadget
2020-11-18 23:44     ` [PATCH v3 12/28] t5503: prepare aligned comment for replacing `master` with `main` Johannes Schindelin via GitGitGadget
2020-11-18 23:44     ` [PATCH v3 13/28] t550*: adjust the references to the default branch name "main" Johannes Schindelin via GitGitGadget
2020-11-18 23:44     ` [PATCH v3 14/28] t551*: " Johannes Schindelin via GitGitGadget
2020-11-18 23:44     ` [PATCH v3 15/28] t55[23]*: " Johannes Schindelin via GitGitGadget
2020-11-18 23:44     ` [PATCH v3 16/28] t55[4-9]*: " Johannes Schindelin via GitGitGadget
2020-11-18 23:44     ` [PATCH v3 17/28] t5[6-9]*: " Johannes Schindelin via GitGitGadget
2020-11-18 23:44     ` [PATCH v3 18/28] t6[0-3]*: " Johannes Schindelin via GitGitGadget
2020-11-18 23:44     ` [PATCH v3 19/28] t64*: preemptively adjust alignment to prepare for `master` -> `main` Johannes Schindelin via GitGitGadget
2020-11-18 23:44     ` [PATCH v3 20/28] t6[4-9]*: adjust the references to the default branch name "main" Johannes Schindelin via GitGitGadget
2020-11-18 23:44     ` [PATCH v3 21/28] t7[0-4]*: " Johannes Schindelin via GitGitGadget
2020-11-18 23:44     ` [PATCH v3 22/28] t7[5-9]*: " Johannes Schindelin via GitGitGadget
2020-11-18 23:44     ` [PATCH v3 23/28] t8*: " Johannes Schindelin via GitGitGadget
2020-11-18 23:44     ` [PATCH v3 24/28] t9[0-4]*: " Johannes Schindelin via GitGitGadget
2020-11-18 23:44     ` [PATCH v3 25/28] t9[5-7]*: " Johannes Schindelin via GitGitGadget
2020-11-18 23:44     ` [PATCH v3 26/28] tests(git-p4): transition to the default branch name `main` Johannes Schindelin via GitGitGadget
2020-11-18 23:44     ` [PATCH v3 27/28] t99*: adjust the references to the default branch name "main" Johannes Schindelin via GitGitGadget
2020-11-18 23:44     ` [PATCH v3 28/28] tests: drop prereq `PREPARE_FOR_MAIN_BRANCH` where no longer needed Johannes Schindelin via GitGitGadget
2020-11-19 23:35     ` [PATCH v3 00/28] tests: use main as default branch name Junio C Hamano
2020-11-17 20:48 ` [PATCH 00/28] Use " Eric W. Biederman
2020-11-17 22:47   ` Felipe Contreras
2020-11-17 23:33     ` Jeff King
2020-11-18  0:07       ` Junio C Hamano
2020-11-18  1:25         ` Jeff King
2020-11-18  2:40           ` Jonathan Nieder
2020-11-18  5:43             ` Junio C Hamano
2020-11-18 11:32               ` Johannes Schindelin
2020-11-18 15:43                 ` Junio C Hamano
2020-11-19  9:22                   ` Johannes Schindelin
2020-11-18  0:18       ` Felipe Contreras
2020-11-18  1:22         ` Jeff King
2020-11-18  1:45           ` Felipe Contreras
2020-11-18  2:06             ` Jeff King
2020-11-18  2:39               ` Jonathan Nieder
2020-11-18 10:12                 ` Felipe Contreras
2020-11-18  9:04               ` Felipe Contreras
2020-11-17 22:55   ` Junio C Hamano
2020-11-17 23:16     ` Felipe Contreras
2020-11-18  0:10       ` Junio C Hamano
2020-11-18  0:51         ` Felipe Contreras
2020-11-18 23:45     ` Philip Oakley
2020-11-19  0:00       ` Johannes Schindelin
2020-11-19  0:30         ` Philip Oakley
2020-11-19  0:30         ` Peter Hadlaw
2020-11-19  0:44           ` Philip Oakley
2020-11-19  0:55             ` Peter Hadlaw
2020-11-19  1:51       ` Junio C Hamano
2020-11-19 10:35         ` Philip Oakley
2020-11-19 11:10           ` Sergey Organov
2020-11-19 11:50             ` Philip Oakley
2020-11-19 12:33               ` Sergey Organov
2020-11-21 23:01             ` Junio C Hamano
2020-11-22 10:21               ` Sergey Organov
2020-11-22 11:20                 ` Philip Oakley
2020-11-22 13:23                   ` Sergey Organov
2020-11-22 20:18                     ` Philip Oakley
2020-11-22 21:56                 ` Felipe Contreras
2020-11-22 23:54                   ` Junio C Hamano
2020-11-18  2:56   ` Jonathan Nieder
2020-11-18  5:57     ` Junio C Hamano

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).