t3[5-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' -- t3[5-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>
maint
Johannes Schindelin4 years agocommitted byJunio C Hamano
@ -10,7 +10,7 @@ test_description='test cherry-pick and revert with renames
@@ -10,7 +10,7 @@ test_description='test cherry-pick and revert with renames
'
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
. ./test-lib.sh
@ -115,7 +115,7 @@ test_expect_success 'cherry-pick on unborn branch' '
@@ -115,7 +115,7 @@ test_expect_success 'cherry-pick on unborn branch' '
test_expect_success 'cherry-pick "-" to pick from previous branch' '
git checkout unborn &&
test_commit to-pick actual content &&
git checkout master &&
git checkout main &&
git cherry-pick - &&
echo content >expect &&
test_cmp expect actual
@ -135,7 +135,7 @@ test_expect_success 'cherry-pick "-" is meaningless without checkout' '
@@ -135,7 +135,7 @@ test_expect_success 'cherry-pick "-" is meaningless without checkout' '
test_expect_success 'cherry-pick "-" works with arguments' '
git checkout -b side-branch &&
test_commit change actual change &&
git checkout master &&
git checkout main &&
git cherry-pick -s - &&
echo "Signed-off-by: C O Mitter <committer@example.com>" >expect &&
git cat-file commit HEAD | grep ^Signed-off-by: >signoff &&
@ -41,14 +41,14 @@ test_expect_success 'cherry-pick a root commit' '
@@ -41,14 +41,14 @@ test_expect_success 'cherry-pick a root commit' '
test_expect_success 'revert a root commit' '
git revert master &&
git revert main &&
test_path_is_missing file1
'
test_expect_success 'cherry-pick a root commit with an external strategy' '
git cherry-pick --strategy=resolve master &&
git cherry-pick --strategy=resolve main &&
echo first >expect &&
test_cmp expect file1
@ -56,7 +56,7 @@ test_expect_success 'cherry-pick a root commit with an external strategy' '
@@ -56,7 +56,7 @@ test_expect_success 'cherry-pick a root commit with an external strategy' '
test_expect_success 'revert a root commit with an external strategy' '
git revert --strategy=resolve master &&
git revert --strategy=resolve main &&
test_path_is_missing file1
'
@ -68,7 +68,7 @@ test_expect_success 'cherry-pick two root commits' '
@@ -68,7 +68,7 @@ test_expect_success 'cherry-pick two root commits' '
test_expect_success 'cherry-pick using --ff fast forwards' '
git checkout master &&
git checkout main &&
git reset --hard first &&
test_tick &&
git cherry-pick --ff second &&
@ -35,7 +35,7 @@ test_expect_success 'cherry-pick using --ff fast forwards' '
@@ -35,7 +35,7 @@ test_expect_success 'cherry-pick using --ff fast forwards' '
'
test_expect_success 'cherry-pick not using --ff does not fast forwards' '
git checkout master &&
git checkout main &&
git reset --hard first &&
test_tick &&
git cherry-pick second &&
@ -52,7 +52,7 @@ test_expect_success 'cherry-pick not using --ff does not fast forwards' '
@@ -52,7 +52,7 @@ test_expect_success 'cherry-pick not using --ff does not fast forwards' '
# (This has been taken from t3502-cherry-pick-merge.sh)
@ -9,7 +9,7 @@ test_description='test cherry-pick and revert with conflicts
@@ -9,7 +9,7 @@ test_description='test cherry-pick and revert with conflicts
@ -48,7 +48,7 @@ test_expect_success 'cherry-pick three one two works' '
@@ -48,7 +48,7 @@ test_expect_success 'cherry-pick three one two works' '
test_commit one &&
test_commit two &&
test_commit three &&
git checkout -f master &&
git checkout -f main &&
git reset --hard first &&
git cherry-pick three one two &&
git diff --quiet three &&
@ -59,28 +59,28 @@ two"
@@ -59,28 +59,28 @@ two"
'
test_expect_success 'cherry-pick three one two: fails' '
git checkout -f master &&
git checkout -f main &&
git reset --hard first &&
test_must_fail git cherry-pick three one two:
'
test_expect_success 'output to keep user entertained during multi-pick' '
cat <<-\EOF >expected &&
[master OBJID] second
[main OBJID] second
Author: A U Thor <author@example.com>
Date: Thu Apr 7 15:14:13 2005 -0700
1 file changed, 1 insertion(+)
[master OBJID] third
[main OBJID] third
Author: A U Thor <author@example.com>
Date: Thu Apr 7 15:15:13 2005 -0700
1 file changed, 1 insertion(+)
[master OBJID] fourth
[main OBJID] fourth
Author: A U Thor <author@example.com>
Date: Thu Apr 7 15:16:13 2005 -0700
1 file changed, 1 insertion(+)
EOF
git checkout -f master &&
git checkout -f main &&
git reset --hard first &&
test_tick &&
git cherry-pick first..fourth >actual &&
@ -90,7 +90,7 @@ test_expect_success 'output to keep user entertained during multi-pick' '
@@ -90,7 +90,7 @@ test_expect_success 'output to keep user entertained during multi-pick' '
@ -607,7 +607,7 @@ test_expect_success 'rm of a conflicted unpopulated submodule succeeds' '
@@ -607,7 +607,7 @@ test_expect_success 'rm of a conflicted unpopulated submodule succeeds' '
'
test_expect_success 'rm of a populated submodule with a .git directory migrates git dir' '
git checkout -f master &&
git checkout -f main &&
git reset --hard &&
git submodule update &&
(
@ -720,7 +720,7 @@ test_expect_success 'checking out a commit after submodule removal needs manual
@@ -720,7 +720,7 @@ test_expect_success 'checking out a commit after submodule removal needs manual
git checkout HEAD^ &&
git submodule update &&
git checkout -q HEAD^ &&
git checkout -q master 2>actual &&
git checkout -q main 2>actual &&
test_i18ngrep "^warning: unable to rmdir '\''submod'\'':" actual &&
test_when_finished "git reset --hard HEAD && git checkout master &&
test_when_finished "git reset --hard HEAD && git checkout main &&
git branch -D stash-branch" &&
test $(git ls-files --modified | wc -l) -eq 1
'
@ -741,7 +741,7 @@ test_expect_success 'valid ref of the form "n", n < N' '
@@ -741,7 +741,7 @@ test_expect_success 'valid ref of the form "n", n < N' '
git stash &&
git stash show 0 &&
git stash branch tmp 0 &&
git checkout master &&
git checkout main &&
git stash &&
git stash apply 0 &&
git reset --hard &&
@ -758,7 +758,7 @@ test_expect_success 'branch: do not drop the stash if the branch exists' '
@@ -758,7 +758,7 @@ test_expect_success 'branch: do not drop the stash if the branch exists' '
@ -771,7 +771,7 @@ test_expect_success 'branch: should not drop the stash if the apply fails' '
@@ -771,7 +771,7 @@ test_expect_success 'branch: should not drop the stash if the apply fails' '
echo "stash@{0}: On master: test message" >expect &&
echo "stash@{0}: On main: test message" >expect &&
git stash list -1 >actual &&
test_cmp expect actual
'
@ -914,7 +914,7 @@ test_expect_success 'push -m also works without space' '
@@ -914,7 +914,7 @@ test_expect_success 'push -m also works without space' '
>foo &&
git add foo &&
git stash push -m"unspaced test message" &&
echo "stash@{0}: On master: unspaced test message" >expect &&
echo "stash@{0}: On main: unspaced test message" >expect &&
STASH_ID=$(git stash create "create test message") &&
echo "On master: create test message" >expect &&
echo "On main: create test message" >expect &&
git show --pretty=%s -s ${STASH_ID} >actual &&
test_cmp expect actual
'
@ -1016,13 +1016,13 @@ test_expect_success 'create with multiple arguments for the message' '
@@ -1016,13 +1016,13 @@ test_expect_success 'create with multiple arguments for the message' '
>foo &&
git add foo &&
STASH_ID=$(git stash create test untracked) &&
echo "On master: test untracked" >expect &&
echo "On main: test untracked" >expect &&
git show --pretty=%s -s ${STASH_ID} >actual &&
test_cmp expect actual
'
test_expect_success 'create in a detached state' '