Skip to content

Commit 62e7daa

Browse files
dschogitster
authored andcommitted
t5515: use main as the name of the main branch for testing (part 1)
As part of the effort to change the default branch name to `main`, let's prepare t5515. In addition to adjusting the references to the branch name itself, this also requires two commit hashes to be adjusted (actually four, as there is a SHA-1 _and_ a SHA-256 of both). That trick was performed by running sed -i -e 's/master/main/g' -e 's/Master/Main/g' \ -e 's/6c9dec2b923228c9ff994c6cfe4ae16c12408dc5/ecf3b3627b498bdcb735cc4343bf165f76964e9a/g' \ -e 's/8521c3072461fcfe8f32d67f95cc6e6b832a2db2fa29769ffc788bce85ebcd75/fff666109892bb4b1c80cd1649d2d8762a0663db8b5d46c8be98360b64fbba5f/g' \ -e 's/754b754407bf032e9a2f9d5a9ad05ca79a6b228f/b4ab76b1a01ea602209932134a44f1e6bd610832/g' \ -e 's/6c7abaea8a6d8ef4d89877e68462758dc6774690fbbbb0e6d7dd57415c9abde0/380ebae0113f877ce46fcdf39d5bc33e4dc0928db5c5a4d5fdc78381c4d55ae3/g' \ -- t/t5515-*.sh These commit hashes have been determined manually, of course, by running the test after adjusting only the branch names, and then copying the hashes from the log of the failed run. Note: this patch only touches the t5515 script so far, not the supporting material in t/t5515/. The resulting patch would have weighed over 100kB and therefore the Git mailing list would have dropped it. The files in t/t5515/ will be adjusted in the next two commits. As t5515 would fail without these adjustments, we temporarily skip it via the `PREPARE_FOR_MAIN_BRANCH` prereq. Signed-off-by: Johannes Schindelin <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 3224b0f commit 62e7daa

File tree

1 file changed

+20
-12
lines changed

1 file changed

+20
-12
lines changed

t/t5515-fetch-merge-logic.sh

Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,19 @@ test_description='Merge logic in fetch'
1111
GIT_TEST_PROTOCOL_VERSION=0
1212
export GIT_TEST_PROTOCOL_VERSION
1313

14+
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
15+
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
16+
1417
. ./test-lib.sh
1518

19+
test_have_prereq PREPARE_FOR_MAIN_BRANCH || {
20+
test_skip="In transit for the default branch name 'main'"
21+
test_done
22+
}
23+
1624
build_script () {
1725
script="$1" &&
18-
for i in one three_file master topic_2 one_tree three two two2 three2
26+
for i in one three_file main topic_2 one_tree three two two2 three2
1927
do
2028
echo "s/$(test_oid --hash=sha1 "$i")/$(test_oid "$i")/g" >>"$script"
2129
done
@@ -40,8 +48,8 @@ test_expect_success setup '
4048
three_file sha1:0e3b14047d3ee365f4f2a1b673db059c3972589c
4149
three_file sha256:bc4447d50c07497a8bfe6eef817f2364ecca9d471452e43b52756cc1a908bd32
4250
43-
master sha1:6c9dec2b923228c9ff994c6cfe4ae16c12408dc5
44-
master sha256:8521c3072461fcfe8f32d67f95cc6e6b832a2db2fa29769ffc788bce85ebcd75
51+
main sha1:ecf3b3627b498bdcb735cc4343bf165f76964e9a
52+
main sha256:fff666109892bb4b1c80cd1649d2d8762a0663db8b5d46c8be98360b64fbba5f
4553
4654
one_tree sha1:22feea448b023a2d864ef94b013735af34d238ba
4755
one_tree sha256:6e4743f4ef2356b881dda5e91f5c7cdffe870faf350bf7b312f80a20935f5d83
@@ -52,8 +60,8 @@ test_expect_success setup '
5260
two sha1:525b7fb068d59950d185a8779dc957c77eed73ba
5361
two sha256:3b21de3440cd38c2a9e9b464adb923f7054949ed4c918e1a0ac4c95cd52774db
5462
55-
topic_2 sha1:754b754407bf032e9a2f9d5a9ad05ca79a6b228f
56-
topic_2 sha256:6c7abaea8a6d8ef4d89877e68462758dc6774690fbbbb0e6d7dd57415c9abde0
63+
topic_2 sha1:b4ab76b1a01ea602209932134a44f1e6bd610832
64+
topic_2 sha256:380ebae0113f877ce46fcdf39d5bc33e4dc0928db5c5a4d5fdc78381c4d55ae3
5765
5866
two2 sha1:6134ee8f857693b96ff1cc98d3e2fd62b199e5a8
5967
two2 sha256:87a2d3ee29c83a3dc7afd41c0606b11f67603120b910a7be7840accdc18344d4
@@ -80,9 +88,9 @@ test_expect_success setup '
8088
git tag -a -m "Tag Three file" tag-three-file HEAD^{tree}:file &&
8189
git branch three &&
8290
83-
echo master >> file &&
84-
git commit -a -m Master &&
85-
git tag -a -m "Tag Master" tag-master &&
91+
echo main >> file &&
92+
git commit -a -m Main &&
93+
git tag -a -m "Tag Main" tag-main &&
8694
8795
git checkout three &&
8896
@@ -91,7 +99,7 @@ test_expect_success setup '
9199
git config remote.origin.url ../.git/ &&
92100
93101
git config remote.config-explicit.url ../.git/ &&
94-
git config remote.config-explicit.fetch refs/heads/master:remotes/rem/master &&
102+
git config remote.config-explicit.fetch refs/heads/main:remotes/rem/main &&
95103
git config --add remote.config-explicit.fetch refs/heads/one:remotes/rem/one &&
96104
git config --add remote.config-explicit.fetch two:remotes/rem/two &&
97105
git config --add remote.config-explicit.fetch refs/heads/three:remotes/rem/three &&
@@ -104,7 +112,7 @@ test_expect_success setup '
104112
mkdir -p .git/remotes &&
105113
{
106114
echo "URL: ../.git/"
107-
echo "Pull: refs/heads/master:remotes/rem/master"
115+
echo "Pull: refs/heads/main:remotes/rem/main"
108116
echo "Pull: refs/heads/one:remotes/rem/one"
109117
echo "Pull: two:remotes/rem/two"
110118
echo "Pull: refs/heads/three:remotes/rem/three"
@@ -149,7 +157,7 @@ done > tests
149157
# but does depend on Pull: or fetch lines.
150158
# Use two branches completely unrelated from the arguments,
151159
# the clone default and one without branch properties
152-
for branch in master br-unconfig ; do
160+
for branch in main br-unconfig ; do
153161
echo $branch
154162
for remote in $remotes ; do
155163
echo $branch $remote
@@ -158,7 +166,7 @@ done >> tests
158166

159167
# Merge logic does not depend on branch properties
160168
# neither in the Pull: or .fetch config
161-
for branch in master br-unconfig ; do
169+
for branch in main br-unconfig ; do
162170
cat <<EOF
163171
$branch ../.git
164172
$branch ../.git one

0 commit comments

Comments
 (0)