diff options
Diffstat (limited to 't/t6200-fmt-merge-msg.sh')
-rwxr-xr-x | t/t6200-fmt-merge-msg.sh | 53 |
1 files changed, 28 insertions, 25 deletions
diff --git a/t/t6200-fmt-merge-msg.sh b/t/t6200-fmt-merge-msg.sh index f3e66eaf9b..44f55d93fe 100755 --- a/t/t6200-fmt-merge-msg.sh +++ b/t/t6200-fmt-merge-msg.sh @@ -5,6 +5,9 @@ test_description='fmt-merge-msg test' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh . "$TEST_DIRECTORY/lib-gpg.sh" @@ -81,7 +84,7 @@ test_expect_success GPG 'set up a signed tag' ' test_expect_success 'message for merging local branch' ' echo "Merge branch ${apos}left${apos}" >expected && - git checkout master && + git checkout main && git fetch . left && git fmt-merge-msg <.git/FETCH_HEAD >actual && @@ -89,7 +92,7 @@ test_expect_success 'message for merging local branch' ' ' test_expect_success GPG 'message for merging local tag signed by good key' ' - git checkout master && + git checkout main && git fetch . signed-good-tag && git fmt-merge-msg <.git/FETCH_HEAD >actual 2>&1 && grep "^Merge tag ${apos}signed-good-tag${apos}" actual && @@ -98,7 +101,7 @@ test_expect_success GPG 'message for merging local tag signed by good key' ' ' test_expect_success GPG 'message for merging local tag signed by unknown key' ' - git checkout master && + git checkout main && git fetch . signed-good-tag && GNUPGHOME=. git fmt-merge-msg <.git/FETCH_HEAD >actual 2>&1 && grep "^Merge tag ${apos}signed-good-tag${apos}" actual && @@ -109,7 +112,7 @@ test_expect_success GPG 'message for merging local tag signed by unknown key' ' test_expect_success 'message for merging external branch' ' echo "Merge branch ${apos}left${apos} of $(pwd)" >expected && - git checkout master && + git checkout main && git fetch "$(pwd)" left && git fmt-merge-msg <.git/FETCH_HEAD >actual && @@ -133,7 +136,7 @@ test_expect_success '[merge] summary/log configuration' ' test_config merge.log true && test_unconfig merge.summary && - git checkout master && + git checkout main && test_tick && git fetch . left && @@ -142,7 +145,7 @@ test_expect_success '[merge] summary/log configuration' ' test_unconfig merge.log && test_config merge.summary true && - git checkout master && + git checkout main && test_tick && git fetch . left && @@ -153,7 +156,7 @@ test_expect_success '[merge] summary/log configuration' ' ' test_expect_success 'setup FETCH_HEAD' ' - git checkout master && + git checkout main && test_tick && git fetch . left ' @@ -281,7 +284,7 @@ test_expect_success 'fmt-merge-msg -m' ' test_unconfig merge.log && test_unconfig merge.summary && - git checkout master && + git checkout main && git fetch "$(pwd)" left && git fmt-merge-msg -m "Sync with left" <.git/FETCH_HEAD >actual && git fmt-merge-msg --log -m "Sync with left" \ @@ -323,28 +326,28 @@ test_expect_success 'setup: expected shortlog for two branches' ' test_expect_success 'shortlog for two branches' ' test_config merge.log true && test_unconfig merge.summary && - git checkout master && + git checkout main && test_tick && git fetch . left right && git fmt-merge-msg <.git/FETCH_HEAD >actual1 && test_unconfig merge.log && test_config merge.summary true && - git checkout master && + git checkout main && test_tick && git fetch . left right && git fmt-merge-msg <.git/FETCH_HEAD >actual2 && test_config merge.log yes && test_unconfig merge.summary && - git checkout master && + git checkout main && test_tick && git fetch . left right && git fmt-merge-msg <.git/FETCH_HEAD >actual3 && test_unconfig merge.log && test_config merge.summary yes && - git checkout master && + git checkout main && test_tick && git fetch . left right && git fmt-merge-msg <.git/FETCH_HEAD >actual4 && @@ -358,7 +361,7 @@ test_expect_success 'shortlog for two branches' ' test_expect_success 'merge-msg -F' ' test_unconfig merge.log && test_config merge.summary yes && - git checkout master && + git checkout main && test_tick && git fetch . left right && git fmt-merge-msg -F .git/FETCH_HEAD >actual && @@ -368,7 +371,7 @@ test_expect_success 'merge-msg -F' ' test_expect_success 'merge-msg -F in subdirectory' ' test_unconfig merge.log && test_config merge.summary yes && - git checkout master && + git checkout main && test_tick && git fetch . left right && mkdir sub && @@ -408,7 +411,7 @@ test_expect_success 'merge-msg tag' ' test_unconfig merge.log && test_config merge.summary yes && - git checkout master && + git checkout main && test_tick && git fetch . tag tag-r3 && @@ -438,7 +441,7 @@ test_expect_success 'merge-msg two tags' ' test_unconfig merge.log && test_config merge.summary yes && - git checkout master && + git checkout main && test_tick && git fetch . tag tag-r3 tag tag-l5 && @@ -468,7 +471,7 @@ test_expect_success 'merge-msg tag and branch' ' test_unconfig merge.log && test_config merge.summary yes && - git checkout master && + git checkout main && test_tick && git fetch . tag tag-r3 left && @@ -495,7 +498,7 @@ test_expect_success 'merge-msg lots of commits' ' test_config merge.summary yes && - git checkout master && + git checkout main && test_tick && git fetch . long && @@ -506,11 +509,11 @@ test_expect_success 'merge-msg lots of commits' ' test_expect_success 'merge-msg with "merging" an annotated tag' ' test_config merge.log true && - git checkout master^0 && + git checkout main^0 && git commit --allow-empty -m "One step ahead" && git tag -a -m "An annotated one" annote HEAD && - git checkout master && + git checkout main && git fetch . annote && git fmt-merge-msg <.git/FETCH_HEAD >actual && @@ -543,23 +546,23 @@ test_expect_success 'merge-msg with "merging" an annotated tag' ' ' test_expect_success 'merge.suppressDest configuration' ' - git checkout -B side master && + git checkout -B side main && git commit --allow-empty -m "One step ahead" && - git checkout master && + git checkout main && git fetch . side && git -c merge.suppressDest="" fmt-merge-msg <.git/FETCH_HEAD >full.1 && head -n1 full.1 >actual && - grep -e "Merge branch .side. into master" actual && + grep -e "Merge branch .side. into main" actual && git -c merge.suppressDest="mast" fmt-merge-msg <.git/FETCH_HEAD >full.2 && head -n1 full.2 >actual && - grep -e "Merge branch .side. into master$" actual && + grep -e "Merge branch .side. into main$" actual && git -c merge.suppressDest="ma?*[rn]" fmt-merge-msg <.git/FETCH_HEAD >full.3 && head -n1 full.3 >actual && grep -e "Merge branch .side." actual && - ! grep -e " into master$" actual + ! grep -e " into main$" actual ' test_done |