Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohannes Schindelin <johannes.schindelin@gmx.de>2020-11-19 02:44:25 +0300
committerJunio C Hamano <gitster@pobox.com>2020-11-20 02:44:18 +0300
commitd1c02d93b3374e031f87f9032c5dc6ef9bfbe0af (patch)
treeae0f375e60e3660a1e4ce647538e5499e7b14c3b /t/t3412-rebase-root.sh
parentba766eebee07c2c3f9ad2c4dad26e71200f96f93 (diff)
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>
Diffstat (limited to 't/t3412-rebase-root.sh')
-rwxr-xr-xt/t3412-rebase-root.sh30
1 files changed, 15 insertions, 15 deletions
diff --git a/t/t3412-rebase-root.sh b/t/t3412-rebase-root.sh
index 07597643c5..fda62c65bd 100755
--- a/t/t3412-rebase-root.sh
+++ b/t/t3412-rebase-root.sh
@@ -4,7 +4,7 @@ test_description='git rebase --root
Tests if git rebase --root --onto <newparent> can rebase the root commit.
'
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
. ./test-lib.sh
@@ -27,7 +27,7 @@ test_expect_success 'prepare repository' '
test_expect_success 'rebase --root fails with too many args' '
git checkout -B fail other &&
- test_must_fail git rebase --onto master --root fail fail
+ test_must_fail git rebase --onto main --root fail fail
'
test_expect_success 'setup pre-rebase hook' '
@@ -47,7 +47,7 @@ EOF
test_expect_success 'rebase --root --onto <newbase>' '
git checkout -b work other &&
- git rebase --root --onto master &&
+ git rebase --root --onto main &&
git log --pretty=tformat:"%s" > rebased &&
test_cmp expect rebased
'
@@ -58,7 +58,7 @@ test_expect_success 'pre-rebase got correct input (1)' '
test_expect_success 'rebase --root --onto <newbase> <branch>' '
git branch work2 other &&
- git rebase --root --onto master work2 &&
+ git rebase --root --onto main work2 &&
git log --pretty=tformat:"%s" > rebased2 &&
test_cmp expect rebased2
'
@@ -69,7 +69,7 @@ test_expect_success 'pre-rebase got correct input (2)' '
test_expect_success 'rebase -i --root --onto <newbase>' '
git checkout -b work3 other &&
- git rebase -i --root --onto master &&
+ git rebase -i --root --onto main &&
git log --pretty=tformat:"%s" > rebased3 &&
test_cmp expect rebased3
'
@@ -80,7 +80,7 @@ test_expect_success 'pre-rebase got correct input (3)' '
test_expect_success 'rebase -i --root --onto <newbase> <branch>' '
git branch work4 other &&
- git rebase -i --root --onto master work4 &&
+ git rebase -i --root --onto main work4 &&
git log --pretty=tformat:"%s" > rebased4 &&
test_cmp expect rebased4
'
@@ -91,7 +91,7 @@ test_expect_success 'pre-rebase got correct input (4)' '
test_expect_success REBASE_P 'rebase -i -p with linear history' '
git checkout -b work5 other &&
- git rebase -i -p --root --onto master &&
+ git rebase -i -p --root --onto main &&
git log --pretty=tformat:"%s" > rebased5 &&
test_cmp expect rebased5
'
@@ -125,7 +125,7 @@ EOF
test_expect_success REBASE_P 'rebase -i -p with merge' '
git checkout -b work6 other &&
- git rebase -i -p --root --onto master &&
+ git rebase -i -p --root --onto main &&
log_with_names work6 > rebased6 &&
test_cmp expect-side rebased6
'
@@ -160,7 +160,7 @@ EOF
test_expect_success REBASE_P 'rebase -i -p with two roots' '
git checkout -b work7 other &&
- git rebase -i -p --root --onto master &&
+ git rebase -i -p --root --onto main &&
log_with_names work7 > rebased7 &&
test_cmp expect-third rebased7
'
@@ -176,14 +176,14 @@ EOF
test_expect_success 'pre-rebase hook stops rebase' '
git checkout -b stops1 other &&
- test_must_fail git rebase --root --onto master &&
+ test_must_fail git rebase --root --onto main &&
test "z$(git symbolic-ref HEAD)" = zrefs/heads/stops1 &&
test 0 = $(git rev-list other...stops1 | wc -l)
'
test_expect_success 'pre-rebase hook stops rebase -i' '
git checkout -b stops2 other &&
- test_must_fail git rebase --root --onto master &&
+ test_must_fail git rebase --root --onto main &&
test "z$(git symbolic-ref HEAD)" = zrefs/heads/stops2 &&
test 0 = $(git rev-list other...stops2 | wc -l)
'
@@ -193,7 +193,7 @@ test_expect_success 'remove pre-rebase hook' '
'
test_expect_success 'set up a conflict' '
- git checkout master &&
+ git checkout main &&
echo conflict > B &&
git add B &&
git commit -m conflict
@@ -201,7 +201,7 @@ test_expect_success 'set up a conflict' '
test_expect_success 'rebase --root with conflict (first part)' '
git checkout -b conflict1 other &&
- test_must_fail git rebase --root --onto master &&
+ test_must_fail git rebase --root --onto main &&
git ls-files -u | grep "B$"
'
@@ -228,7 +228,7 @@ test_expect_success 'rebase --root with conflict (second part)' '
test_expect_success 'rebase -i --root with conflict (first part)' '
git checkout -b conflict2 other &&
- test_must_fail git rebase -i --root --onto master &&
+ test_must_fail git rebase -i --root --onto main &&
git ls-files -u | grep "B$"
'
@@ -266,7 +266,7 @@ EOF
test_expect_success REBASE_P 'rebase -i -p --root with conflict (first part)' '
git checkout -b conflict3 other &&
- test_must_fail git rebase -i -p --root --onto master &&
+ test_must_fail git rebase -i -p --root --onto main &&
git ls-files -u | grep "B$"
'