t34*: adjust the references to the default branch name "main"
Carefully excluding t3404, which sees independent development elsewhere
at the time of writing, we use `main` as the default branch name in
t34*. This trick was performed via
$ (cd t &&
sed -i -e 's/master/main/g' -e 's/MASTER/MAIN/g' \
-e 's/Master/Main/g' -- t34*.sh &&
git checkout HEAD -- t34\*)
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
test_expect_success 'rebase sets ORIG_HEAD to pre-rebase state' '
git checkout -b orig-head topic &&
pre="$(git rev-parse --verify HEAD)" &&
git rebase master &&
git rebase main &&
test_cmp_rev "$pre" ORIG_HEAD &&
test_cmp_rev ! "$pre" HEAD
'
@ -96,19 +96,19 @@ test_expect_success 'HEAD was detached during rebase' '
@@ -96,19 +96,19 @@ test_expect_success 'HEAD was detached during rebase' '
test_expect_success 'rebase from ambiguous branch name' '
git checkout -b topic side &&
git rebase master
git rebase main
'
test_expect_success 'rebase off of the previous branch using "-"' '
git checkout master &&
git checkout main &&
git checkout HEAD^ &&
git rebase @{-1} >expect.messages &&
git merge-base master HEAD >expect.forkpoint &&
git merge-base main HEAD >expect.forkpoint &&
git checkout master &&
git checkout main &&
git checkout HEAD^ &&
git rebase - >actual.messages &&
git merge-base master HEAD >actual.forkpoint &&
git merge-base main HEAD >actual.forkpoint &&
test_cmp expect.forkpoint actual.forkpoint &&
# the next one is dubious---we may want to say "-",
@ -117,7 +117,7 @@ test_expect_success 'rebase off of the previous branch using "-"' '
@@ -117,7 +117,7 @@ test_expect_success 'rebase off of the previous branch using "-"' '
'
test_expect_success 'rebase a single mode change' '
git checkout master &&
git checkout main &&
git branch -D topic &&
echo 1 >X &&
git add X &&
@ -129,7 +129,7 @@ test_expect_success 'rebase a single mode change' '
@@ -129,7 +129,7 @@ test_expect_success 'rebase a single mode change' '
test_chmod +x A &&
test_tick &&
git commit -m modechange &&
GIT_TRACE=1 git rebase master
GIT_TRACE=1 git rebase main
'
test_expect_success 'rebase is not broken by diff.renames' '
@ -165,11 +165,11 @@ test_expect_success 'fail when upstream arg is missing and not configured' '
@@ -165,11 +165,11 @@ test_expect_success 'fail when upstream arg is missing and not configured' '
test_expect_success 'rebase works with format.useAutoBase' '
test_config format.useAutoBase true &&
git checkout topic &&
git rebase master
git rebase main
'
test_expect_success 'default to common base in @{upstream}s reflog if no upstream arg (--merge)' '
@ -187,7 +187,7 @@ test_expect_success 'default to common base in @{upstream}s reflog if no upstrea
@@ -187,7 +187,7 @@ test_expect_success 'default to common base in @{upstream}s reflog if no upstrea
'
test_expect_success 'default to common base in @{upstream}s reflog if no upstream arg (--apply)' '
@ -229,13 +229,13 @@ test_expect_success 'cherry-picked commits and fork-point work together' '
@@ -229,13 +229,13 @@ test_expect_success 'cherry-picked commits and fork-point work together' '
test_expect_success 'rebase --apply -q is quiet' '
git checkout -b quiet topic &&
git rebase --apply -q master >output.out 2>&1 &&
git rebase --apply -q main >output.out 2>&1 &&
test_must_be_empty output.out
'
test_expect_success 'rebase --merge -q is quiet' '
git checkout -B quiet topic &&
git rebase --merge -q master >output.out 2>&1 &&
git rebase --merge -q main >output.out 2>&1 &&
test_must_be_empty output.out
'
@ -297,7 +297,7 @@ test_expect_success 'rebase commit with an ancient timestamp' '
@@ -297,7 +297,7 @@ test_expect_success 'rebase commit with an ancient timestamp' '
'
test_expect_success 'rebase with "From " line in commit message' '
git checkout -b preserve-from master~1 &&
git checkout -b preserve-from main~1 &&
cat >From_.msg <<EOF &&
Somebody embedded an mbox in a commit message
@ -313,7 +313,7 @@ EOF
@@ -313,7 +313,7 @@ EOF
>From_ &&
git add From_ &&
git commit -F From_.msg &&
git rebase master &&
git rebase main &&
git log -1 --pretty=format:%B >out &&
test_cmp From_.msg out
'
@ -360,12 +360,12 @@ test_expect_success 'rebase --apply and .gitattributes' '
@@ -360,12 +360,12 @@ test_expect_success 'rebase --apply and .gitattributes' '
@ -168,7 +168,7 @@ test_expect_success 'rebase --skip works with two conflicts in a row' '
@@ -168,7 +168,7 @@ test_expect_success 'rebase --skip works with two conflicts in a row' '
test_expect_success 'interactive rebase --continue works with touched file' '
rm -fr .git/rebase-* &&
git reset --hard &&
git checkout master &&
git checkout main &&
FAKE_LINES="edit 1" git rebase -i HEAD^ &&
test-tool chmtime =-60 F1 &&
@ -34,9 +34,9 @@ test_expect_success 'interactive rebase --continue works with touched file' '
@@ -34,9 +34,9 @@ test_expect_success 'interactive rebase --continue works with touched file' '
test_expect_success 'non-interactive rebase --continue works with touched file' '
rm -fr .git/rebase-* &&
git reset --hard &&
git checkout master &&
git checkout main &&
test_must_fail git rebase --onto master master topic &&
test_must_fail git rebase --onto main main topic &&
@ -308,7 +308,7 @@ test_expect_success 'autostash is saved on editor failure with conflict' '
@@ -308,7 +308,7 @@ test_expect_success 'autostash is saved on editor failure with conflict' '
'
test_expect_success 'autostash with dirty submodules' '
@ -327,7 +327,7 @@ test_expect_success 'branch is left alone when possible' '
@@ -327,7 +327,7 @@ test_expect_success 'branch is left alone when possible' '
test_expect_success 'never change active branch' '
test_expect_success 'with a branch tip that was cherry-picked already' '
git checkout -b already-upstream master &&
git checkout -b already-upstream main &&
base="$(git rev-parse --verify HEAD)" &&
test_commit A1 &&
@ -214,7 +214,7 @@ test_expect_success 'with a branch tip that was cherry-picked already' '
@@ -214,7 +214,7 @@ test_expect_success 'with a branch tip that was cherry-picked already' '
'
test_expect_success 'do not rebase cousins unless asked for' '
git checkout -b cousins master &&
git checkout -b cousins main &&
before="$(git rev-parse --verify HEAD)" &&
test_tick &&
git rebase -r HEAD^ &&
@ -343,7 +343,7 @@ test_expect_success 'a "merge" into a root commit is a fast-forward' '
@@ -343,7 +343,7 @@ test_expect_success 'a "merge" into a root commit is a fast-forward' '
test_expect_success 'A root commit can be a cousin, treat it that way' '
git checkout --orphan khnum &&
test_commit yama &&
git checkout -b asherah master &&
git checkout -b asherah main &&
test_commit shamkat &&
git merge --allow-unrelated-histories khnum &&
test_tick &&
@ -370,7 +370,7 @@ test_expect_success 'labels that are object IDs are rewritten' '
@@ -370,7 +370,7 @@ test_expect_success 'labels that are object IDs are rewritten' '
git checkout -b third B &&
test_commit I &&
third=$(git rev-parse HEAD) &&
git checkout -b labels master &&
git checkout -b labels main &&
git merge --no-commit third &&
test_tick &&
git commit -m "Merge commit '\''$third'\'' into labels" &&