summaryrefslogtreecommitdiff
path: root/t/t5703-upload-pack-ref-in-want.sh
diff options
context:
space:
mode:
authorJohannes Schindelin <johannes.schindelin@gmx.de>2020-11-18 23:44:35 (GMT)
committerJunio C Hamano <gitster@pobox.com>2020-11-19 23:44:18 (GMT)
commit95cf2c01875fd66421d3551e9e86db435523575d (patch)
tree93b27344f9fac7d11a5bd27b849a13cde5b246d9 /t/t5703-upload-pack-ref-in-want.sh
parent028cb644ec6450fa9438ba6b6d100c0f34e029a5 (diff)
downloadgit-95cf2c01875fd66421d3551e9e86db435523575d.zip
git-95cf2c01875fd66421d3551e9e86db435523575d.tar.gz
git-95cf2c01875fd66421d3551e9e86db435523575d.tar.bz2
t5[6-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' -- t5[6-9]*.sh) This allows us to define `GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main` for those tests. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t5703-upload-pack-ref-in-want.sh')
-rwxr-xr-xt/t5703-upload-pack-ref-in-want.sh60
1 files changed, 30 insertions, 30 deletions
diff --git a/t/t5703-upload-pack-ref-in-want.sh b/t/t5703-upload-pack-ref-in-want.sh
index c3a52d4..0f3e0bf 100755
--- a/t/t5703-upload-pack-ref-in-want.sh
+++ b/t/t5703-upload-pack-ref-in-want.sh
@@ -2,7 +2,7 @@
test_description='upload-pack ref-in-want'
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
. ./test-lib.sh
@@ -41,7 +41,7 @@ write_command () {
# c(o/foo) d(o/bar)
# \ /
-# b e(baz) f(master)
+# b e(baz) f(main)
# \__ | __/
# \ | /
# a
@@ -54,7 +54,7 @@ test_expect_success 'setup repository' '
test_commit d &&
git checkout -b baz a &&
test_commit e &&
- git checkout master &&
+ git checkout main &&
test_commit f
'
@@ -91,7 +91,7 @@ test_expect_success 'invalid want-ref line' '
test_expect_success 'basic want-ref' '
oid=$(git rev-parse f) &&
cat >expected_refs <<-EOF &&
- $oid refs/heads/master
+ $oid refs/heads/main
EOF
git rev-parse f >expected_commits &&
@@ -100,7 +100,7 @@ test_expect_success 'basic want-ref' '
$(write_command fetch)
0001
no-progress
- want-ref refs/heads/master
+ want-ref refs/heads/main
have $oid
done
0000
@@ -138,7 +138,7 @@ test_expect_success 'multiple want-ref lines' '
test_expect_success 'mix want and want-ref' '
oid=$(git rev-parse f) &&
cat >expected_refs <<-EOF &&
- $oid refs/heads/master
+ $oid refs/heads/main
EOF
git rev-parse e f >expected_commits &&
@@ -146,7 +146,7 @@ test_expect_success 'mix want and want-ref' '
$(write_command fetch)
0001
no-progress
- want-ref refs/heads/master
+ want-ref refs/heads/main
want $(git rev-parse e)
have $(git rev-parse a)
done
@@ -185,7 +185,7 @@ LOCAL_PRISTINE="$(pwd)/local_pristine"
# $REPO
# c(o/foo) d(o/bar)
# \ /
-# b e(baz) f(master)
+# b e(baz) f(main)
# \__ | __/
# \ | /
# a
@@ -196,7 +196,7 @@ LOCAL_PRISTINE="$(pwd)/local_pristine"
# .
# .
# |
-# a(master)
+# a(main)
test_expect_success 'setup repos for fetching with ref-in-want tests' '
(
git init "$REPO" &&
@@ -212,7 +212,7 @@ test_expect_success 'setup repos for fetching with ref-in-want tests' '
test_commit_bulk --id=s 33 &&
# Add novel commits to upstream
- git checkout master &&
+ git checkout main &&
cd "$REPO" &&
git checkout -b o/foo &&
test_commit b &&
@@ -221,7 +221,7 @@ test_expect_success 'setup repos for fetching with ref-in-want tests' '
test_commit d &&
git checkout -b baz a &&
test_commit e &&
- git checkout master &&
+ git checkout main &&
test_commit f
) &&
git -C "$REPO" config uploadpack.allowRefInWant true &&
@@ -248,12 +248,12 @@ test_expect_success 'fetching multiple refs' '
rm -rf local &&
cp -r "$LOCAL_PRISTINE" local &&
- GIT_TRACE_PACKET="$(pwd)/log" git -C local fetch origin master baz &&
+ GIT_TRACE_PACKET="$(pwd)/log" git -C local fetch origin main baz &&
- git -C "$REPO" rev-parse "master" "baz" >expected &&
- git -C local rev-parse refs/remotes/origin/master refs/remotes/origin/baz >actual &&
+ git -C "$REPO" rev-parse "main" "baz" >expected &&
+ git -C local rev-parse refs/remotes/origin/main refs/remotes/origin/baz >actual &&
test_cmp expected actual &&
- grep "want-ref refs/heads/master" log &&
+ grep "want-ref refs/heads/main" log &&
grep "want-ref refs/heads/baz" log
'
@@ -264,13 +264,13 @@ test_expect_success 'fetching ref and exact OID' '
cp -r "$LOCAL_PRISTINE" local &&
oid=$(git -C "$REPO" rev-parse b) &&
GIT_TRACE_PACKET="$(pwd)/log" git -C local fetch origin \
- master "$oid":refs/heads/actual &&
+ main "$oid":refs/heads/actual &&
- git -C "$REPO" rev-parse "master" "b" >expected &&
- git -C local rev-parse refs/remotes/origin/master refs/heads/actual >actual &&
+ git -C "$REPO" rev-parse "main" "b" >expected &&
+ git -C local rev-parse refs/remotes/origin/main refs/heads/actual >actual &&
test_cmp expected actual &&
grep "want $oid" log &&
- grep "want-ref refs/heads/master" log
+ grep "want-ref refs/heads/main" log
'
test_expect_success 'fetching with wildcard that does not match any refs' '
@@ -319,7 +319,7 @@ test_expect_success 'setup repos for change-while-negotiating test' '
test_commit_bulk --id=s 33 &&
# Add novel commits to upstream
- git checkout master &&
+ git checkout main &&
cd "$REPO" &&
test_commit m2 &&
test_commit m3 &&
@@ -345,7 +345,7 @@ test_expect_success 'server is initially ahead - no ref in want' '
git -C "$REPO" config uploadpack.allowRefInWant false &&
rm -rf local &&
cp -r "$LOCAL_PRISTINE" local &&
- inconsistency master $(test_oid numeric) &&
+ inconsistency main $(test_oid numeric) &&
test_must_fail git -C local fetch 2>err &&
test_i18ngrep "fatal: remote error: upload-pack: not our ref" err
'
@@ -354,11 +354,11 @@ test_expect_success 'server is initially ahead - ref in want' '
git -C "$REPO" config uploadpack.allowRefInWant true &&
rm -rf local &&
cp -r "$LOCAL_PRISTINE" local &&
- inconsistency master $(test_oid numeric) &&
+ inconsistency main $(test_oid numeric) &&
git -C local fetch &&
- git -C "$REPO" rev-parse --verify master >expected &&
- git -C local rev-parse --verify refs/remotes/origin/master >actual &&
+ git -C "$REPO" rev-parse --verify main >expected &&
+ git -C local rev-parse --verify refs/remotes/origin/main >actual &&
test_cmp expected actual
'
@@ -366,11 +366,11 @@ test_expect_success 'server is initially behind - no ref in want' '
git -C "$REPO" config uploadpack.allowRefInWant false &&
rm -rf local &&
cp -r "$LOCAL_PRISTINE" local &&
- inconsistency master "master^" &&
+ inconsistency main "main^" &&
git -C local fetch &&
- git -C "$REPO" rev-parse --verify "master^" >expected &&
- git -C local rev-parse --verify refs/remotes/origin/master >actual &&
+ git -C "$REPO" rev-parse --verify "main^" >expected &&
+ git -C local rev-parse --verify refs/remotes/origin/main >actual &&
test_cmp expected actual
'
@@ -378,11 +378,11 @@ test_expect_success 'server is initially behind - ref in want' '
git -C "$REPO" config uploadpack.allowRefInWant true &&
rm -rf local &&
cp -r "$LOCAL_PRISTINE" local &&
- inconsistency master "master^" &&
+ inconsistency main "main^" &&
git -C local fetch &&
- git -C "$REPO" rev-parse --verify "master" >expected &&
- git -C local rev-parse --verify refs/remotes/origin/master >actual &&
+ git -C "$REPO" rev-parse --verify "main" >expected &&
+ git -C local rev-parse --verify refs/remotes/origin/main >actual &&
test_cmp expected actual
'