summaryrefslogtreecommitdiff
path: root/t/t5500-fetch-pack.sh
diff options
context:
space:
mode:
Diffstat (limited to 't/t5500-fetch-pack.sh')
-rwxr-xr-xt/t5500-fetch-pack.sh41
1 files changed, 22 insertions, 19 deletions
diff --git a/t/t5500-fetch-pack.sh b/t/t5500-fetch-pack.sh
index 8c54e34..8a5d349 100755
--- a/t/t5500-fetch-pack.sh
+++ b/t/t5500-fetch-pack.sh
@@ -5,6 +5,9 @@
test_description='Testing multi_ack pack fetching'
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
. ./test-lib.sh
# Test fetch-pack/upload-pack pair.
@@ -407,14 +410,14 @@ test_expect_success 'in_vain resetted upon ACK' '
rm -rf myserver myclient &&
git init myserver &&
- # Linked list of commits on master. The first is common; the rest are
+ # Linked list of commits on main. The first is common; the rest are
# not.
- test_commit -C myserver first_master_commit &&
+ test_commit -C myserver first_main_commit &&
git clone "file://$(pwd)/myserver" myclient &&
test_commit_bulk -C myclient 255 &&
# Another linked list of commits on anotherbranch with no connection to
- # master. The first is common; the rest are not.
+ # main. The first is common; the rest are not.
git -C myserver checkout --orphan anotherbranch &&
test_commit -C myserver first_anotherbranch_commit &&
git -C myclient fetch origin anotherbranch:refs/heads/anotherbranch &&
@@ -422,14 +425,14 @@ test_expect_success 'in_vain resetted upon ACK' '
test_commit_bulk -C myclient 255 &&
# The new commit that the client wants to fetch.
- git -C myserver checkout master &&
+ git -C myserver checkout main &&
test_commit -C myserver to_fetch &&
# The client will send (as "have"s) all 256 commits in anotherbranch
# first. The 256th commit is common between the client and the server,
# and should reset in_vain. This allows negotiation to continue until
# the client reports that first_anotherbranch_commit is common.
- git -C myclient fetch --progress origin master 2>log &&
+ git -C myclient fetch --progress origin main 2>log &&
test_i18ngrep "Total 3 " log
'
@@ -544,7 +547,7 @@ test_expect_success 'test lonely missing ref' '
cd client &&
test_must_fail git fetch-pack --no-progress .. refs/heads/xyzzy 2>../error-m
) &&
- test_i18ncmp expect-error error-m
+ test_cmp expect-error error-m
'
test_expect_success 'test missing ref after existing' '
@@ -552,7 +555,7 @@ test_expect_success 'test missing ref after existing' '
cd client &&
test_must_fail git fetch-pack --no-progress .. refs/heads/A refs/heads/xyzzy 2>../error-em
) &&
- test_i18ncmp expect-error error-em
+ test_cmp expect-error error-em
'
test_expect_success 'test missing ref before existing' '
@@ -560,7 +563,7 @@ test_expect_success 'test missing ref before existing' '
cd client &&
test_must_fail git fetch-pack --no-progress .. refs/heads/xyzzy refs/heads/A 2>../error-me
) &&
- test_i18ncmp expect-error error-me
+ test_cmp expect-error error-me
'
test_expect_success 'test --all, --depth, and explicit head' '
@@ -637,7 +640,7 @@ test_expect_success 'shallow fetch with tags does not break the repository' '
mkdir repo2 &&
cd repo2 &&
git init &&
- git fetch --depth=2 ../.git master:branch &&
+ git fetch --depth=2 ../.git main:branch &&
git fsck
)
'
@@ -662,7 +665,7 @@ test_expect_success 'fetch-pack can fetch a raw sha1 that is advertised as a ref
git init client &&
git -C client fetch-pack ../server \
- $(git -C server rev-parse refs/heads/master)
+ $(git -C server rev-parse refs/heads/main)
'
test_expect_success 'fetch-pack can fetch a raw sha1 overlapping a named ref' '
@@ -688,7 +691,7 @@ test_expect_success 'fetch-pack cannot fetch a raw sha1 that is not advertised a
# Some protocol versions (e.g. 2) support fetching
# unadvertised objects, so restrict this test to v0.
test_must_fail env GIT_TEST_PROTOCOL_VERSION=0 git -C client fetch-pack ../server \
- $(git -C server rev-parse refs/heads/master^) 2>err &&
+ $(git -C server rev-parse refs/heads/main^) 2>err &&
test_i18ngrep "Server does not allow request for unadvertised object" err
'
@@ -822,7 +825,7 @@ test_expect_success 'clone shallow since ...' '
test_expect_success 'fetch shallow since ...' '
git -C shallow11 fetch --shallow-since "200000000 +0700" origin &&
- git -C shallow11 log --pretty=tformat:%s origin/master >actual &&
+ git -C shallow11 log --pretty=tformat:%s origin/main >actual &&
cat >expected <<-\EOF &&
three
two
@@ -863,7 +866,7 @@ test_expect_success 'shallow since with commit graph and already-seen commit' '
(
cd shallow-since-graph &&
test_commit base &&
- test_commit master &&
+ test_commit main &&
git checkout -b other HEAD^ &&
test_commit other &&
git commit-graph write --reachable &&
@@ -871,9 +874,10 @@ test_expect_success 'shallow since with commit graph and already-seen commit' '
GIT_PROTOCOL=version=2 git upload-pack . <<-EOF >/dev/null
0012command=fetch
+ $(echo "object-format=$(test_oid algo)" | packetize)
00010013deepen-since 1
- 0032want $(git rev-parse other)
- 0032have $(git rev-parse master)
+ $(echo "want $(git rev-parse other)" | packetize)
+ $(echo "have $(git rev-parse main)" | packetize)
0000
EOF
)
@@ -895,7 +899,7 @@ test_expect_success 'shallow clone exclude tag two' '
test_expect_success 'fetch exclude tag one' '
git -C shallow12 fetch --shallow-exclude one origin &&
- git -C shallow12 log --pretty=tformat:%s origin/master >actual &&
+ git -C shallow12 log --pretty=tformat:%s origin/main >actual &&
test_write_lines three two >expected &&
test_cmp expected actual
'
@@ -909,11 +913,11 @@ test_expect_success 'fetching deepen' '
test_commit three &&
git clone --depth 1 "file://$(pwd)/." deepen &&
test_commit four &&
- git -C deepen log --pretty=tformat:%s master >actual &&
+ git -C deepen log --pretty=tformat:%s main >actual &&
echo three >expected &&
test_cmp expected actual &&
git -C deepen fetch --deepen=1 &&
- git -C deepen log --pretty=tformat:%s origin/master >actual &&
+ git -C deepen log --pretty=tformat:%s origin/main >actual &&
cat >expected <<-\EOF &&
four
three
@@ -999,7 +1003,6 @@ fetch_filter_blob_limit_zero () {
test_config -C "$SERVER" uploadpack.allowfilter 1 &&
git clone "$URL" client &&
- test_config -C client extensions.partialclone origin &&
test_commit -C "$SERVER" two &&