]> git.ipfire.org Git - thirdparty/git.git/commit - t/t6439-merge-co-error-msgs.sh
tests: mark tests relying on the current default for `init.defaultBranch`
authorJohannes Schindelin <johannes.schindelin@gmx.de>
Wed, 18 Nov 2020 23:44:19 +0000 (23:44 +0000)
committerJunio C Hamano <gitster@pobox.com>
Thu, 19 Nov 2020 23:44:17 +0000 (15:44 -0800)
commit334afbc76fbd4a8d850946a2b450ba036365b554
treeb6a7ffac1950815fc9c50bc040a7e90eca4ece18
parentfced6d171e0e242e330dd71b123de4bcd2616f0b
tests: mark tests relying on the current default for `init.defaultBranch`

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