Skip to content

Commit a881baa

Browse files
dschogitster
authored andcommitted
t9[0-4]*: 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' -- t9[0-4]*.sh) This allows us to define `GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main` for those tests. Signed-off-by: Johannes Schindelin <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 747f6c6 commit a881baa

16 files changed

+169
-169
lines changed

t/t9001-send-email.sh

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/bin/sh
22

33
test_description='git send-email'
4-
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
4+
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
55
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
66

77
. ./test-lib.sh
@@ -1171,10 +1171,10 @@ test_expect_success $PREREQ '--compose-encoding adds correct MIME for subject' '
11711171
'
11721172

11731173
test_expect_success $PREREQ 'detects ambiguous reference/file conflict' '
1174-
echo master >master &&
1175-
git add master &&
1176-
git commit -m"add master" &&
1177-
test_must_fail git send-email --dry-run master 2>errors &&
1174+
echo main >main &&
1175+
git add main &&
1176+
git commit -m"add main" &&
1177+
test_must_fail git send-email --dry-run main 2>errors &&
11781178
grep disambiguate errors
11791179
'
11801180

@@ -1188,7 +1188,7 @@ test_expect_success $PREREQ 'feed two files' '
11881188
outdir/000?-*.patch 2>errors >out &&
11891189
grep "^Subject: " out >subjects &&
11901190
test "z$(sed -n -e 1p subjects)" = "zSubject: [PATCH 1/2] Second." &&
1191-
test "z$(sed -n -e 2p subjects)" = "zSubject: [PATCH 2/2] add master"
1191+
test "z$(sed -n -e 2p subjects)" = "zSubject: [PATCH 2/2] add main"
11921192
'
11931193

11941194
test_expect_success $PREREQ 'in-reply-to but no threading' '
@@ -2040,7 +2040,7 @@ test_expect_success $PREREQ 'setup expected-list' '
20402040
--cc="Cc2 <[email protected]>" \
20412041
20422042
2043-
0001-add-master.patch | replace_variable_fields \
2043+
0001-add-main.patch | replace_variable_fields \
20442044
>expected-list
20452045
'
20462046

@@ -2052,7 +2052,7 @@ test_expect_success $PREREQ 'use email list in --cc --to and --bcc' '
20522052
20532053
--cc="Cc 1 <[email protected]>, Cc2 <[email protected]>" \
20542054
2055-
0001-add-master.patch | replace_variable_fields \
2055+
0001-add-main.patch | replace_variable_fields \
20562056
>actual-list &&
20572057
test_cmp expected-list actual-list
20582058
'
@@ -2068,7 +2068,7 @@ test_expect_success $PREREQ 'aliases work with email list' '
20682068
--to="To 1 <[email protected]>, to2, [email protected]" \
20692069
--cc="cc1, Cc2 <[email protected]>" \
20702070
2071-
0001-add-master.patch | replace_variable_fields \
2071+
0001-add-main.patch | replace_variable_fields \
20722072
>actual-list &&
20732073
test_cmp expected-list actual-list
20742074
'
@@ -2092,7 +2092,7 @@ test_expect_success $PREREQ 'leading and trailing whitespaces are removed' '
20922092
--cc="Cc2 <[email protected]>" \
20932093
--bcc="$BCC1" \
20942094
2095-
0001-add-master.patch | replace_variable_fields \
2095+
0001-add-main.patch | replace_variable_fields \
20962096
>actual-list &&
20972097
test_cmp expected-list actual-list
20982098
'
@@ -2111,8 +2111,8 @@ test_expect_success $PREREQ 'invoke hook' '
21112111
false
21122112
;;
21132113
esac &&
2114-
test -f 0001-add-master.patch &&
2115-
grep "add master" "$1"
2114+
test -f 0001-add-main.patch &&
2115+
grep "add main" "$1"
21162116
EOF
21172117
21182118
mkdir subdir &&
@@ -2124,10 +2124,10 @@ test_expect_success $PREREQ 'invoke hook' '
21242124
--from="Example <[email protected]>" \
21252125
21262126
--smtp-server="$(pwd)/../fake.sendmail" \
2127-
../0001-add-master.patch &&
2127+
../0001-add-main.patch &&
21282128
21292129
# Verify error message when a patch is rejected by the hook
2130-
sed -e "s/add master/x/" ../0001-add-master.patch >../another.patch &&
2130+
sed -e "s/add main/x/" ../0001-add-main.patch >../another.patch &&
21312131
test_must_fail git send-email \
21322132
--from="Example <[email protected]>" \
21332133
@@ -2142,7 +2142,7 @@ test_expect_success $PREREQ 'test that send-email works outside a repo' '
21422142
--from="Example <[email protected]>" \
21432143
21442144
--smtp-server="$(pwd)/fake.sendmail" \
2145-
"$(pwd)/0001-add-master.patch"
2145+
"$(pwd)/0001-add-main.patch"
21462146
'
21472147

21482148
test_expect_success $PREREQ 'test that sendmail config is rejected' '

t/t9100-git-svn-basic.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
test_description='git svn basic tests'
77
GIT_SVN_LC_ALL=${LC_ALL:-$LANG}
88

9-
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
9+
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
1010
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
1111

1212
. ./lib-git-svn.sh
@@ -278,7 +278,7 @@ test_expect_success 'dcommit $rev does not clobber current branch' '
278278
test refs/heads/my-bar = $(git symbolic-ref HEAD) &&
279279
git log refs/remotes/bar | grep "change 1" &&
280280
! git log refs/remotes/bar | grep "change 2" &&
281-
git checkout master &&
281+
git checkout main &&
282282
git branch -D my-bar
283283
'
284284

t/t9145-git-svn-master-branch.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
#
33
# Copyright (c) 2009 Eric Wong
44
#
5-
test_description='git svn initial master branch is "trunk" if possible'
6-
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
5+
test_description='git svn initial main branch is "trunk" if possible'
6+
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
77
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
88

99
. ./lib-git-svn.sh
@@ -16,12 +16,12 @@ test_expect_success 'setup test repository' '
1616
svn_cmd import -m b/b i "$svnrepo/branches/b"
1717
'
1818

19-
test_expect_success 'git svn clone --stdlayout sets up trunk as master' '
19+
test_expect_success 'git svn clone --stdlayout sets up trunk as main' '
2020
git svn clone -s "$svnrepo" g &&
2121
(
2222
cd g &&
2323
test x$(git rev-parse --verify refs/remotes/origin/trunk^0) = \
24-
x$(git rev-parse --verify refs/heads/master^0)
24+
x$(git rev-parse --verify refs/heads/main^0)
2525
)
2626
'
2727

t/t9151-svn-mergeinfo.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
test_description='git-svn svn mergeinfo properties'
77

8-
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
8+
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
99
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
1010

1111
. ./lib-git-svn.sh
@@ -53,7 +53,7 @@ test_expect_success 'merging two branches in one commit is detected correctly' '
5353
'
5454

5555
test_expect_failure 'everything got merged in the end' '
56-
unmerged=$(git rev-list --all --not master) &&
56+
unmerged=$(git rev-list --all --not main) &&
5757
[ -z "$unmerged" ]
5858
'
5959

t/t9155-git-svn-fetch-deleted-tag.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
test_description='git svn fetch deleted tag'
44

5-
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
5+
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
66
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
77

88
. ./lib-git-svn.sh
@@ -39,7 +39,7 @@ test_expect_success 'fetch deleted tags from same revision with checksum error'
3939
git svn fetch &&
4040
4141
git diff --exit-code origin/mybranch:trunk/subdir/file origin/tags/mytag:file &&
42-
git diff --exit-code master:subdir/file origin/tags/mytag^:file
42+
git diff --exit-code main:subdir/file origin/tags/mytag^:file
4343
'
4444

4545
test_done

t/t9156-git-svn-fetch-deleted-tag-2.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
test_description='git svn fetch deleted tag 2'
44

5-
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
5+
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
66
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
77

88
. ./lib-git-svn.sh
@@ -39,9 +39,9 @@ test_expect_success 'fetch deleted tags from same revision with no checksum erro
3939
cd git_project &&
4040
git svn fetch &&
4141
42-
git diff --exit-code master:subdir3/file origin/tags/mytag:file &&
43-
git diff --exit-code master:subdir2/file origin/tags/mytag^:file &&
44-
git diff --exit-code master:subdir1/file origin/tags/mytag^^:file
42+
git diff --exit-code main:subdir3/file origin/tags/mytag:file &&
43+
git diff --exit-code main:subdir2/file origin/tags/mytag^:file &&
44+
git diff --exit-code main:subdir1/file origin/tags/mytag^^:file
4545
'
4646

4747
test_done

t/t9163-git-svn-reset-clears-caches.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#
55

66
test_description='git svn reset clears memoized caches'
7-
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
7+
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
88
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
99

1010
. ./lib-git-svn.sh
@@ -62,7 +62,7 @@ test_expect_success 'fetch to merge-base (a)' '
6262
test_expect_success 'rebase looses SVN merge (m)' '
6363
git svn rebase &&
6464
git svn fetch &&
65-
test 1 = $(git cat-file -p master|grep parent|wc -l)
65+
test 1 = $(git cat-file -p main|grep parent|wc -l)
6666
'
6767

6868
# git svn fetch creates correct history with merge commit

t/t9169-git-svn-dcommit-crlf.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/bin/sh
22

33
test_description='git svn dcommit CRLF'
4-
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
4+
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
55
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
66

77
. ./lib-git-svn.sh
@@ -17,7 +17,7 @@ test_expect_success 'setup commit repository' '
1717
p=$(git rev-parse HEAD) &&
1818
t=$(git write-tree) &&
1919
cmt=$(git commit-tree -p $p $t <cmt) &&
20-
git update-ref refs/heads/master $cmt &&
20+
git update-ref refs/heads/main $cmt &&
2121
git cat-file commit HEAD | tail -n4 >out &&
2222
test_cmp cmt out &&
2323
git svn dcommit &&

0 commit comments

Comments
 (0)