Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2021-01-26 01:19:18 +0300
committerJunio C Hamano <gitster@pobox.com>2021-01-26 01:19:18 +0300
commit27d7c8599b159862762e2bd121c22d516fb04e90 (patch)
tree91bed47151791fe2e18e8e9e07a5d58207413bda /t/t5570-git-daemon.sh
parent440acfbe0cec5c2316ef7a706c975143c4902b20 (diff)
parent8b70966aa90b52427e1a09329abde8d845f90398 (diff)
Merge branch 'js/default-branch-name-tests-final-stretch'
Prepare tests not to be affected by the name of the default branch "git init" creates. * js/default-branch-name-tests-final-stretch: (28 commits) tests: drop prereq `PREPARE_FOR_MAIN_BRANCH` where no longer needed t99*: adjust the references to the default branch name "main" tests(git-p4): transition to the default branch name `main` t9[5-7]*: adjust the references to the default branch name "main" t9[0-4]*: adjust the references to the default branch name "main" t8*: adjust the references to the default branch name "main" t7[5-9]*: adjust the references to the default branch name "main" t7[0-4]*: adjust the references to the default branch name "main" t6[4-9]*: adjust the references to the default branch name "main" t64*: preemptively adjust alignment to prepare for `master` -> `main` t6[0-3]*: adjust the references to the default branch name "main" t5[6-9]*: adjust the references to the default branch name "main" t55[4-9]*: adjust the references to the default branch name "main" t55[23]*: adjust the references to the default branch name "main" t551*: adjust the references to the default branch name "main" t550*: adjust the references to the default branch name "main" t5503: prepare aligned comment for replacing `master` with `main` t5[0-4]*: adjust the references to the default branch name "main" t5323: prepare centered comment for `master` -> `main` t4*: adjust the references to the default branch name "main" ...
Diffstat (limited to 't/t5570-git-daemon.sh')
-rwxr-xr-xt/t5570-git-daemon.sh19
1 files changed, 11 insertions, 8 deletions
diff --git a/t/t5570-git-daemon.sh b/t/t5570-git-daemon.sh
index 0fbb194810..82c31ab6cd 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=main
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
. ./test-lib.sh
. "$TEST_DIRECTORY"/lib-git-daemon.sh
@@ -26,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' '
@@ -55,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
)
'
@@ -153,7 +156,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"
@@ -161,7 +164,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"
@@ -197,10 +200,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
'