summaryrefslogtreecommitdiff
path: root/t/t5551-http-fetch-smart.sh
diff options
context:
space:
mode:
Diffstat (limited to 't/t5551-http-fetch-smart.sh')
-rwxr-xr-xt/t5551-http-fetch-smart.sh23
1 files changed, 13 insertions, 10 deletions
diff --git a/t/t5551-http-fetch-smart.sh b/t/t5551-http-fetch-smart.sh
index e40e9ed..984dba2 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=main
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
. ./test-lib.sh
. "$TEST_DIRECTORY"/lib-httpd.sh
start_httpd
@@ -18,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
@@ -238,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' '
@@ -271,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.
@@ -344,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' '
@@ -363,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 &&
@@ -385,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 &&
@@ -444,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
'