summaryrefslogtreecommitdiff
path: root/t/t5570-git-daemon.sh
diff options
context:
space:
mode:
authorJohannes Schindelin <johannes.schindelin@gmx.de>2020-11-18 23:44:34 (GMT)
committerJunio C Hamano <gitster@pobox.com>2020-11-19 23:44:18 (GMT)
commit028cb644ec6450fa9438ba6b6d100c0f34e029a5 (patch)
tree4e438ef5f6bc52e4c94b94bfefd4d3bf73df51fa /t/t5570-git-daemon.sh
parent3ac8f6301ee9d4bf3f9e58b3ef12ba536005cb9d (diff)
downloadgit-028cb644ec6450fa9438ba6b6d100c0f34e029a5.zip
git-028cb644ec6450fa9438ba6b6d100c0f34e029a5.tar.gz
git-028cb644ec6450fa9438ba6b6d100c0f34e029a5.tar.bz2
t55[4-9]*: adjust the references 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/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> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t5570-git-daemon.sh')
-rwxr-xr-xt/t5570-git-daemon.sh18
1 files changed, 9 insertions, 9 deletions
diff --git a/t/t5570-git-daemon.sh b/t/t5570-git-daemon.sh
index 2e99a33..3332a0c 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
'