summaryrefslogtreecommitdiff
path: root/t/t3406-rebase-message.sh
diff options
context:
space:
mode:
Diffstat (limited to 't/t3406-rebase-message.sh')
-rwxr-xr-xt/t3406-rebase-message.sh34
1 files changed, 15 insertions, 19 deletions
diff --git a/t/t3406-rebase-message.sh b/t/t3406-rebase-message.sh
index 4afc528165..77a313f62e 100755
--- a/t/t3406-rebase-message.sh
+++ b/t/t3406-rebase-message.sh
@@ -2,6 +2,9 @@
test_description='messages from rebase operation'
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
. ./test-lib.sh
test_expect_success 'setup' '
@@ -18,27 +21,27 @@ test_expect_success 'setup' '
'
test_expect_success 'rebase -m' '
- git rebase -m master >actual &&
+ git rebase -m main >actual &&
test_must_be_empty actual
'
-test_expect_success 'rebase against master twice' '
- git rebase --apply master >out &&
+test_expect_success 'rebase against main twice' '
+ git rebase --apply main >out &&
test_i18ngrep "Current branch topic is up to date" out
'
-test_expect_success 'rebase against master twice with --force' '
- git rebase --force-rebase --apply master >out &&
+test_expect_success 'rebase against main twice with --force' '
+ git rebase --force-rebase --apply main >out &&
test_i18ngrep "Current branch topic is up to date, rebase forced" out
'
-test_expect_success 'rebase against master twice from another branch' '
+test_expect_success 'rebase against main twice from another branch' '
git checkout topic^ &&
- git rebase --apply master topic >out &&
+ git rebase --apply main topic >out &&
test_i18ngrep "Current branch topic is up to date" out
'
-test_expect_success 'rebase fast-forward to master' '
+test_expect_success 'rebase fast-forward to main' '
git checkout topic^ &&
git rebase --apply topic >out &&
test_i18ngrep "Fast-forwarded HEAD to topic" out
@@ -46,31 +49,24 @@ test_expect_success 'rebase fast-forward to master' '
test_expect_success 'rebase --stat' '
git reset --hard start &&
- git rebase --stat master >diffstat.txt &&
+ git rebase --stat main >diffstat.txt &&
grep "^ fileX | *1 +$" diffstat.txt
'
test_expect_success 'rebase w/config rebase.stat' '
git reset --hard start &&
git config rebase.stat true &&
- git rebase master >diffstat.txt &&
+ git rebase main >diffstat.txt &&
grep "^ fileX | *1 +$" diffstat.txt
'
test_expect_success 'rebase -n overrides config rebase.stat config' '
git reset --hard start &&
git config rebase.stat true &&
- git rebase -n master >diffstat.txt &&
+ git rebase -n main >diffstat.txt &&
! grep "^ fileX | *1 +$" diffstat.txt
'
-# Output to stderr:
-#
-# "Does not point to a valid commit: invalid-ref"
-#
-# NEEDSWORK: This "grep" is fine in real non-C locales, but
-# GIT_TEST_GETTEXT_POISON poisons the refname along with the enclosing
-# error message.
test_expect_success 'rebase --onto outputs the invalid ref' '
test_must_fail git rebase --onto invalid-ref HEAD HEAD 2>err &&
test_i18ngrep "invalid-ref" err
@@ -113,7 +109,7 @@ test_expect_success 'rebase -i onto unrelated history' '
git init unrelated &&
test_commit -C unrelated 1 &&
git -C unrelated remote add -f origin "$PWD" &&
- git -C unrelated branch --set-upstream-to=origin/master &&
+ git -C unrelated branch --set-upstream-to=origin/main &&
git -C unrelated -c core.editor=true rebase -i -v --stat >actual &&
test_i18ngrep "Changes to " actual &&
test_i18ngrep "5 files changed" actual