From 334afbc76fbd4a8d850946a2b450ba036365b554 Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Wed, 18 Nov 2020 23:44:19 +0000 Subject: 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 Signed-off-by: Junio C Hamano diff --git a/ci/run-build-and-tests.sh b/ci/run-build-and-tests.sh index 6c27b88..50e0b90 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 960ed15..0a396c9 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 b63ba62..0d43189 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 f6deaf4..adf862a 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 bfc4fb9..ccdc91c 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 5b927b7..068b784 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 608673f..368f7d5 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 58c0b7e..c3c2770 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 181956b..57caa3a 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 cf96016..edb8944 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 59b3aa4..b9bab37 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 301e071..9177871 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 f35a73d..d731322 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 84acfc4..25e68ca 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 825d9a1..67e201b 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 2dc853d..c573438 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 4c01e08..4ae6f50 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 5d955c3..aaf32f3 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 74af927..531059b 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 36b7ef5..126518c 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 9a84858..aede1c2 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 1e44a17..fd58388 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 730a43d..aa02ca4 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 985daf1..f6fecff 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 c730600..140914a 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 1181a9f..c463b5f 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 f6e741c..a26a6b7 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 c7878a6..8c43537 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 408b97d..d23da4e 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 492edff..bb2c131 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 2>&1 || [ $? -eq 128 ] diff --git a/t/t5541-http-push-smart.sh b/t/t5541-http-push-smart.sh index 187454f..2836b87 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 ddc1db7..0feec9c 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 620c30d..16a8fc7 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 38e6f73..202d75a 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 483578b..9ec9179 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 e40e9ed..310b89d 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 7622981..e78a218 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 9fafcf1..5561b7d 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 6eb0294..cba2dff 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 8f69a78..2e99a33 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 ac53d63..971ed3d 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 cf768b3..da4c94c 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 927aad0..907bb06 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 8c61e28..608e9aa 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 7df3c53..e01c5fe 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 2f7be23..20fbb1e 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 af23419..9402804 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 7f082fb..3893a49 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 26985f4..6e2e4ad 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 6e7a7be..e4d5124 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 8b0d607..ba63ba8 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 8e0fd39..be4ae10 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 e3b436d..9e37f7f 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 f4d49d8..b2c3ed4 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 1a041df..cba468f 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 022901b..7f0056c 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 a1f5fdc..66c47e6 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 7d5b179..f1f77fe 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 b46940b..c3a52d4 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 0f04b6c..1ecefb5 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 fc4d55d..664000a 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 7504ba4..67c384f 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 3e8c42e..ff78819 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 99a1eaf..bbbd577 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 f026837..51547ac 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 c4af9ca..871ace3 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 916d969..114f755 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 fd202fc..d163c24 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 89458d3..0298174 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 f5e6e92..3fb7ee0 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 667b375..e51fe7b 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 fe2f3ce..60a351c 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 353f843..aeb7def 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 aa22638..7dc65c7 100755 --- a/t/t6030-bisect-porcelain.sh +++ b/t/t6030-bisect-porcelain.sh @@ -6,6 +6,9 @@ test_description='Tests git bisect functionality' exec hello.c <