diff options
author | Junio C Hamano <gitster@pobox.com> | 2021-01-25 14:19:18 -0800 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2021-01-25 14:19:18 -0800 |
commit | 27d7c8599b159862762e2bd121c22d516fb04e90 (patch) | |
tree | 91bed47151791fe2e18e8e9e07a5d58207413bda /t/t7512-status-help.sh | |
parent | Merge branch 'dl/reflog-with-single-entry' (diff) | |
parent | tests: drop prereq `PREPARE_FOR_MAIN_BRANCH` where no longer needed (diff) | |
download | tgif-27d7c8599b159862762e2bd121c22d516fb04e90.tar.xz |
Merge branch 'js/default-branch-name-tests-final-stretch'
Prepare tests not to be affected by the name of the default branch
"git init" creates.
* js/default-branch-name-tests-final-stretch: (28 commits)
tests: drop prereq `PREPARE_FOR_MAIN_BRANCH` where no longer needed
t99*: adjust the references to the default branch name "main"
tests(git-p4): transition to the default branch name `main`
t9[5-7]*: adjust the references to the default branch name "main"
t9[0-4]*: adjust the references to the default branch name "main"
t8*: adjust the references to the default branch name "main"
t7[5-9]*: adjust the references to the default branch name "main"
t7[0-4]*: adjust the references to the default branch name "main"
t6[4-9]*: adjust the references to the default branch name "main"
t64*: preemptively adjust alignment to prepare for `master` -> `main`
t6[0-3]*: adjust the references to the default branch name "main"
t5[6-9]*: adjust the references to the default branch name "main"
t55[4-9]*: adjust the references to the default branch name "main"
t55[23]*: adjust the references to the default branch name "main"
t551*: adjust the references to the default branch name "main"
t550*: adjust the references to the default branch name "main"
t5503: prepare aligned comment for replacing `master` with `main`
t5[0-4]*: adjust the references to the default branch name "main"
t5323: prepare centered comment for `master` -> `main`
t4*: adjust the references to the default branch name "main"
...
Diffstat (limited to 't/t7512-status-help.sh')
-rwxr-xr-x | t/t7512-status-help.sh | 43 |
1 files changed, 23 insertions, 20 deletions
diff --git a/t/t7512-status-help.sh b/t/t7512-status-help.sh index 29518e0949..9f5e3ce793 100755 --- a/t/t7512-status-help.sh +++ b/t/t7512-status-help.sh @@ -7,6 +7,9 @@ test_description='git status advice' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh . "$TEST_DIRECTORY"/lib-rebase.sh @@ -17,14 +20,14 @@ test_expect_success 'prepare for conflicts' ' git config --global advice.statusuoption false && test_commit init main.txt init && git branch conflicts && - test_commit on_master main.txt on_master && + test_commit on_main main.txt on_main && git checkout conflicts && test_commit on_conflicts main.txt on_conflicts ' test_expect_success 'status when conflicts unresolved' ' - test_must_fail git merge master && + test_must_fail git merge main && cat >expected <<\EOF && On branch conflicts You have unmerged paths. @@ -44,7 +47,7 @@ EOF test_expect_success 'status when conflicts resolved before commit' ' git reset --hard conflicts && - test_must_fail git merge master && + test_must_fail git merge main && echo one >main.txt && git add main.txt && cat >expected <<\EOF && @@ -63,7 +66,7 @@ EOF test_expect_success 'prepare for rebase conflicts' ' - git reset --hard master && + git reset --hard main && git checkout -b rebase_conflicts && test_commit one_rebase main.txt one && test_commit two_rebase main.txt two && @@ -118,11 +121,11 @@ EOF test_expect_success 'prepare for rebase_i_conflicts' ' - git reset --hard master && + git reset --hard main && git checkout -b rebase_i_conflicts && test_commit one_unmerge main.txt one_unmerge && git branch rebase_i_conflicts_second && - test_commit one_master main.txt one_master && + test_commit one_main main.txt one_main && git checkout rebase_i_conflicts_second && test_commit one_second main.txt one_second ' @@ -182,7 +185,7 @@ EOF test_expect_success 'status when rebasing -i in edit mode' ' - git reset --hard master && + git reset --hard main && git checkout -b rebase_i_edit && test_commit one_rebase_i main.txt one && test_commit two_rebase_i main.txt two && @@ -212,7 +215,7 @@ EOF test_expect_success 'status when splitting a commit' ' - git reset --hard master && + git reset --hard main && git checkout -b split_commit && test_commit one_split main.txt one && test_commit two_split main.txt two && @@ -251,7 +254,7 @@ EOF test_expect_success 'status after editing the last commit with --amend during a rebase -i' ' - git reset --hard master && + git reset --hard main && git checkout -b amend_last && test_commit one_amend main.txt one && test_commit two_amend main.txt two && @@ -284,7 +287,7 @@ EOF test_expect_success 'prepare for several edits' ' - git reset --hard master && + git reset --hard main && git checkout -b several_edits && test_commit one_edits main.txt one && test_commit two_edits main.txt two && @@ -593,7 +596,7 @@ EOF test_expect_success 'prepare am_session' ' - git reset --hard master && + git reset --hard main && git checkout -b am_session && test_commit one_am one.txt "one" && test_commit two_am two.txt "two" && @@ -666,7 +669,7 @@ EOF test_expect_success 'status when bisecting' ' - git reset --hard master && + git reset --hard main && git checkout -b bisect && test_commit one_bisect main.txt one && test_commit two_bisect main.txt two && @@ -689,7 +692,7 @@ EOF test_expect_success 'status when rebase --apply conflicts with statushints disabled' ' - git reset --hard master && + git reset --hard main && git checkout -b statushints_disabled && test_when_finished "git config --local advice.statushints true" && git config --local advice.statushints false && @@ -714,7 +717,7 @@ EOF test_expect_success 'prepare for cherry-pick conflicts' ' - git reset --hard master && + git reset --hard main && git checkout -b cherry_branch && test_commit one_cherry main.txt one && test_commit two_cherries main.txt two && @@ -825,7 +828,7 @@ EOF ' test_expect_success 'status while reverting commit (conflicts)' ' - git checkout master && + git checkout main && echo before >to-revert.txt && test_commit before to-revert.txt && echo old >to-revert.txt && @@ -835,7 +838,7 @@ test_expect_success 'status while reverting commit (conflicts)' ' TO_REVERT=$(git rev-parse --short HEAD^) && test_must_fail git revert $TO_REVERT && cat >expected <<EOF && -On branch master +On branch main You are currently reverting commit $TO_REVERT. (fix conflicts and run "git revert --continue") (use "git revert --skip" to skip this patch) @@ -856,7 +859,7 @@ test_expect_success 'status while reverting commit (conflicts resolved)' ' echo reverted >to-revert.txt && git add to-revert.txt && cat >expected <<EOF && -On branch master +On branch main You are currently reverting commit $TO_REVERT. (all conflicts fixed: run "git revert --continue") (use "git revert --skip" to skip this patch) @@ -875,7 +878,7 @@ EOF test_expect_success 'status after reverting commit' ' git revert --continue && cat >expected <<\EOF && -On branch master +On branch main nothing to commit (use -u to show untracked files) EOF git status --untracked-files=no >actual && @@ -889,7 +892,7 @@ test_expect_success 'status while reverting after committing conflict resolution echo reverted >to-revert.txt && git commit -a && cat >expected <<EOF && -On branch master +On branch main Revert currently in progress. (run "git revert --continue" to continue) (use "git revert --skip" to skip this patch) @@ -902,7 +905,7 @@ EOF ' test_expect_success 'prepare for different number of commits rebased' ' - git reset --hard master && + git reset --hard main && git checkout -b several_commits && test_commit one_commit main.txt one && test_commit two_commit main.txt two && |