t7[5-9]*: adjust the references to the default branch name "main"

Excluding t7817, which is added in an unrelated patch series at the time of writing, this adjusts t7[5-9]*. This trick was performed via $ (cd t && sed -i -e 's/master/main/g' -e 's/MASTER/MAIN/g' \ -e 's/Master/Main/g' -- t7[5-9]*.sh) 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>

Johannes Schindelin committed Nov 18, 2020 at 23:44 UTC 1e2ae142c06f7648a646278947bbcb61173f37eb
19 files changed +300 -300
t/t7501-commit-basic-functionality.sh
+2 -2
@@ -7,7 +7,7 @@
7 # signoff
8
9 test_description='git commit'
10 -GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
10 +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
11 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
12
13 . ./test-lib.sh
@@ -606,7 +606,7 @@ test_expect_success 'same tree (merge and amend merge)' '
606 echo zero >zero &&
607 git add zero &&
608 git commit -m "add zero" &&
609 - git checkout master &&
609 + git checkout main &&
610
611 git merge -s ours side -m "empty ok" &&
612 git diff HEAD^ HEAD >actual &&
t/t7502-commit-porcelain.sh
+7 -7
@@ -2,7 +2,7 @@
2
3 test_description='git commit porcelain-ish'
4
5 -GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
5 +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
6 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
7
8 . ./test-lib.sh
@@ -79,7 +79,7 @@ test_expect_success 'output summary format for merges' '
79
80 output_tests_cleanup() {
81 # this is needed for "do not fire editor in the presence of conflicts"
82 - git checkout master &&
82 + git checkout main &&
83
84 # this is needed for the "partial removal" test to pass
85 git rm file1 &&
@@ -443,7 +443,7 @@ test_expect_success 'do not fire editor in the presence of conflicts' '
443 git add g &&
444 git commit -m "add g" &&
445 git branch second &&
446 - echo master >g &&
446 + echo main >g &&
447 echo g >h &&
448 git add g h &&
449 git commit -m "modify g and add h" &&
@@ -452,7 +452,7 @@ test_expect_success 'do not fire editor in the presence of conflicts' '
452 git add g &&
453 git commit -m second &&
454 # Must fail due to conflict
455 - test_must_fail git cherry-pick -n master &&
455 + test_must_fail git cherry-pick -n main &&
456 echo "editor not started" >.git/result &&
457 (
458 GIT_EDITOR="\"$(pwd)/.git/FAKE_EDITOR\"" &&
@@ -481,9 +481,9 @@ git reset -q --hard
481
482 test_expect_success 'Hand committing of a redundant merge removes dups' '
483
484 - git rev-parse second master >expect &&
485 - test_must_fail git merge second master &&
486 - git checkout master g &&
484 + git rev-parse second main >expect &&
485 + test_must_fail git merge second main &&
486 + git checkout main g &&
487 EDITOR=: git commit -a &&
488 git cat-file commit HEAD >raw &&
489 sed -n -e "s/^parent //p" -e "/^$/q" raw >actual &&
t/t7503-pre-commit-and-pre-merge-commit-hooks.sh
+22 -22
@@ -2,7 +2,7 @@
2
3 test_description='pre-commit and pre-merge-commit hooks'
4
5 -GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
5 +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
6 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
7
8 . ./test-lib.sh
@@ -47,16 +47,16 @@ test_expect_success 'root commit' '
47 git add foo &&
48 git commit -m "make it non-ff" &&
49 git branch side-orig side &&
50 - git checkout master
50 + git checkout main
51 '
52
53 test_expect_success 'setup conflicting branches' '
54 - test_when_finished "git checkout master" &&
55 - git checkout -b conflicting-a master &&
54 + test_when_finished "git checkout main" &&
55 + git checkout -b conflicting-a main &&
56 echo a >conflicting &&
57 git add conflicting &&
58 git commit -m conflicting-a &&
59 - git checkout -b conflicting-b master &&
59 + git checkout -b conflicting-b main &&
60 echo b >conflicting &&
61 git add conflicting &&
62 git commit -m conflicting-b
@@ -74,8 +74,8 @@ test_expect_success 'with no hook (merge)' '
74 test_when_finished "rm -f actual_hooks" &&
75 git branch -f side side-orig &&
76 git checkout side &&
77 - git merge -m "merge master" master &&
78 - git checkout master &&
77 + git merge -m "merge main" main &&
78 + git checkout main &&
79 test_path_is_missing actual_hooks
80 '
81
@@ -91,8 +91,8 @@ test_expect_success '--no-verify with no hook (merge)' '
91 test_when_finished "rm -f actual_hooks" &&
92 git branch -f side side-orig &&
93 git checkout side &&
94 - git merge --no-verify -m "merge master" master &&
95 - git checkout master &&
94 + git merge --no-verify -m "merge main" main &&
95 + git checkout main &&
96 test_path_is_missing actual_hooks
97 '
98
@@ -111,15 +111,15 @@ test_expect_success 'with succeeding hook (merge)' '
111 cp "$HOOKDIR/success.sample" "$PREMERGE" &&
112 echo "$PREMERGE" >expected_hooks &&
113 git checkout side &&
114 - git merge -m "merge master" master &&
115 - git checkout master &&
114 + git merge -m "merge main" main &&
115 + git checkout main &&
116 test_cmp expected_hooks actual_hooks
117 '
118
119 test_expect_success 'automatic merge fails; both hooks are available' '
120 test_when_finished "rm -f \"$PREMERGE\" \"$PRECOMMIT\"" &&
121 test_when_finished "rm -f expected_hooks actual_hooks" &&
122 - test_when_finished "git checkout master" &&
122 + test_when_finished "git checkout main" &&
123 cp "$HOOKDIR/success.sample" "$PREMERGE" &&
124 cp "$HOOKDIR/success.sample" "$PRECOMMIT" &&
125
@@ -148,8 +148,8 @@ test_expect_success '--no-verify with succeeding hook (merge)' '
148 cp "$HOOKDIR/success.sample" "$PREMERGE" &&
149 git branch -f side side-orig &&
150 git checkout side &&
151 - git merge --no-verify -m "merge master" master &&
152 - git checkout master &&
151 + git merge --no-verify -m "merge main" main &&
152 + git checkout main &&
153 test_path_is_missing actual_hooks
154 '
155
@@ -177,8 +177,8 @@ test_expect_success 'with failing hook (merge)' '
177 cp "$HOOKDIR/fail.sample" "$PREMERGE" &&
178 echo "$PREMERGE" >expected_hooks &&
179 git checkout side &&
180 - test_must_fail git merge -m "merge master" master &&
181 - git checkout master &&
180 + test_must_fail git merge -m "merge main" main &&
181 + git checkout main &&
182 test_cmp expected_hooks actual_hooks
183 '
184
@@ -187,8 +187,8 @@ test_expect_success '--no-verify with failing hook (merge)' '
187 cp "$HOOKDIR/fail.sample" "$PREMERGE" &&
188 git branch -f side side-orig &&
189 git checkout side &&
190 - git merge --no-verify -m "merge master" master &&
191 - git checkout master &&
190 + git merge --no-verify -m "merge main" main &&
191 + git checkout main &&
192 test_path_is_missing actual_hooks
193 '
194
@@ -215,8 +215,8 @@ test_expect_success POSIXPERM 'with non-executable hook (merge)' '
215 cp "$HOOKDIR/non-exec.sample" "$PREMERGE" &&
216 git branch -f side side-orig &&
217 git checkout side &&
218 - git merge -m "merge master" master &&
219 - git checkout master &&
218 + git merge -m "merge main" main &&
219 + git checkout main &&
220 test_path_is_missing actual_hooks
221 '
222
@@ -225,8 +225,8 @@ test_expect_success POSIXPERM '--no-verify with non-executable hook (merge)' '
225 cp "$HOOKDIR/non-exec.sample" "$PREMERGE" &&
226 git branch -f side side-orig &&
227 git checkout side &&
228 - git merge --no-verify -m "merge master" master &&
229 - git checkout master &&
228 + git merge --no-verify -m "merge main" main &&
229 + git checkout main &&
230 test_path_is_missing actual_hooks
231 '
232
t/t7504-commit-msg-hook.sh
+13 -13
@@ -2,7 +2,7 @@
2
3 test_description='commit-msg hook'
4
5 -GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
5 +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
6 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
7
8 . ./test-lib.sh
@@ -145,12 +145,12 @@ test_expect_success '--no-verify with failing hook (editor)' '
145 test_expect_success 'merge fails with failing hook' '
146
147 test_when_finished "git branch -D newbranch" &&
148 - test_when_finished "git checkout -f master" &&
148 + test_when_finished "git checkout -f main" &&
149 git checkout --orphan newbranch &&
150 : >file2 &&
151 git add file2 &&
152 git commit --no-verify file2 -m in-side-branch &&
153 - test_must_fail git merge --allow-unrelated-histories master &&
153 + test_must_fail git merge --allow-unrelated-histories main &&
154 commit_msg_is "in-side-branch" # HEAD before merge
155
156 '
@@ -158,14 +158,14 @@ test_expect_success 'merge fails with failing hook' '
158 test_expect_success 'merge bypasses failing hook with --no-verify' '
159
160 test_when_finished "git branch -D newbranch" &&
161 - test_when_finished "git checkout -f master" &&
161 + test_when_finished "git checkout -f main" &&
162 git checkout --orphan newbranch &&
163 git rm -f file &&
164 : >file2 &&
165 git add file2 &&
166 git commit --no-verify file2 -m in-side-branch &&
167 - git merge --no-verify --allow-unrelated-histories master &&
168 - commit_msg_is "Merge branch '\''master'\'' into newbranch"
167 + git merge --no-verify --allow-unrelated-histories main &&
168 + commit_msg_is "Merge branch '\''main'\'' into newbranch"
169 '
170
171
@@ -251,28 +251,28 @@ test_expect_success "hook doesn't edit commit message (editor)" '
251
252 test_expect_success 'hook called in git-merge picks up commit message' '
253 test_when_finished "git branch -D newbranch" &&
254 - test_when_finished "git checkout -f master" &&
254 + test_when_finished "git checkout -f main" &&
255 git checkout --orphan newbranch &&
256 git rm -f file &&
257 : >file2 &&
258 git add file2 &&
259 git commit --no-verify file2 -m in-side-branch &&
260 - git merge --allow-unrelated-histories master &&
260 + git merge --allow-unrelated-histories main &&
261 commit_msg_is "new message"
262 '
263
264 test_expect_failure 'merge --continue remembers --no-verify' '
265 test_when_finished "git branch -D newbranch" &&
266 - test_when_finished "git checkout -f master" &&
267 - git checkout master &&
266 + test_when_finished "git checkout -f main" &&
267 + git checkout main &&
268 echo a >file2 &&
269 git add file2 &&
270 - git commit --no-verify -m "add file2 to master" &&
271 - git checkout -b newbranch master^ &&
270 + git commit --no-verify -m "add file2 to main" &&
271 + git checkout -b newbranch main^ &&
272 echo b >file2 &&
273 git add file2 &&
274 git commit --no-verify file2 -m in-side-branch &&
275 - git merge --no-verify -m not-rewritten-by-hook master &&
275 + git merge --no-verify -m not-rewritten-by-hook main &&
276 # resolve conflict:
277 echo c >file2 &&
278 git add file2 &&
t/t7505-prepare-commit-msg-hook.sh
+11 -11
@@ -2,7 +2,7 @@
2
3 test_description='prepare-commit-msg hook'
4
5 -GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
5 +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
6 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
7
8 . ./test-lib.sh
@@ -18,7 +18,7 @@ test_expect_success 'set up commits for rebasing' '
18 do
19 test_commit rebase-$i c $i
20 done &&
21 - git checkout master &&
21 + git checkout main &&
22
23 cat >rebase-todo <<-EOF
24 pick $(git rev-parse rebase-a)
@@ -193,7 +193,7 @@ test_expect_success 'with hook (-c)' '
193
194 test_expect_success 'with hook (merge)' '
195
196 - test_when_finished "git checkout -f master" &&
196 + test_when_finished "git checkout -f main" &&
197 git checkout -B other HEAD@{1} &&
198 echo "more" >>file &&
199 git add file &&
@@ -205,7 +205,7 @@ test_expect_success 'with hook (merge)' '
205
206 test_expect_success 'with hook and editor (merge)' '
207
208 - test_when_finished "git checkout -f master" &&
208 + test_when_finished "git checkout -f main" &&
209 git checkout -B other HEAD@{1} &&
210 echo "more" >>file &&
211 git add file &&
@@ -221,7 +221,7 @@ test_rebase () {
221 test_expect_$expect C_LOCALE_OUTPUT "with hook (rebase ${mode:--i})" '
222 test_when_finished "\
223 git rebase --abort
224 - git checkout -f master
224 + git checkout -f main
225 git branch -D tmp" &&
226 git checkout -b tmp rebase-me &&
227 GIT_SEQUENCE_EDITOR="cp rebase-todo" &&
@@ -253,14 +253,14 @@ test_rebase success
253 test_have_prereq !REBASE_P || test_rebase success -p
254
255 test_expect_success 'with hook (cherry-pick)' '
256 - test_when_finished "git checkout -f master" &&
256 + test_when_finished "git checkout -f main" &&
257 git checkout -B other b &&
258 git cherry-pick rebase-1 &&
259 test "$(git log -1 --pretty=format:%s)" = "message (no editor)"
260 '
261
262 test_expect_success 'with hook and editor (cherry-pick)' '
263 - test_when_finished "git checkout -f master" &&
263 + test_when_finished "git checkout -f main" &&
264 git checkout -B other b &&
265 git cherry-pick -e rebase-1 &&
266 test "$(git log -1 --pretty=format:%s)" = merge
@@ -273,7 +273,7 @@ EOF
273
274 test_expect_success 'with failing hook' '
275
276 - test_when_finished "git checkout -f master" &&
276 + test_when_finished "git checkout -f main" &&
277 head=$(git rev-parse HEAD) &&
278 echo "more" >> file &&
279 git add file &&
@@ -283,7 +283,7 @@ test_expect_success 'with failing hook' '
283
284 test_expect_success 'with failing hook (--no-verify)' '
285
286 - test_when_finished "git checkout -f master" &&
286 + test_when_finished "git checkout -f main" &&
287 head=$(git rev-parse HEAD) &&
288 echo "more" >> file &&
289 git add file &&
@@ -293,7 +293,7 @@ test_expect_success 'with failing hook (--no-verify)' '
293
294 test_expect_success 'with failing hook (merge)' '
295
296 - test_when_finished "git checkout -f master" &&
296 + test_when_finished "git checkout -f main" &&
297 git checkout -B other HEAD@{1} &&
298 echo "more" >> file &&
299 git add file &&
@@ -308,7 +308,7 @@ test_expect_success 'with failing hook (merge)' '
308 '
309
310 test_expect_success C_LOCALE_OUTPUT 'with failing hook (cherry-pick)' '
311 - test_when_finished "git checkout -f master" &&
311 + test_when_finished "git checkout -f main" &&
312 git checkout -B other b &&
313 test_must_fail git cherry-pick rebase-1 2>actual &&
314 test $(grep -c prepare-commit-msg actual) = 1
t/t7508-status.sh
+29 -29
@@ -37,11 +37,11 @@ test_expect_success 'create upstream branch' '
37 git checkout -b upstream &&
38 test_commit upstream1 &&
39 test_commit upstream2 &&
40 - # leave the first commit on master as root because several
40 + # leave the first commit on main as root because several
41 # tests depend on this case; for our upstream we only
42 # care about commit counts anyway, so a totally divergent
43 # history is OK
44 - git checkout --orphan master
44 + git checkout --orphan main
45 '
46
47 test_expect_success 'setup' '
@@ -88,7 +88,7 @@ EOF
88
89 test_expect_success 'status --column' '
90 cat >expect <<\EOF &&
91 -# On branch master
91 +# On branch main
92 # Your branch and '\''upstream'\'' have diverged,
93 # and have 1 and 2 different commits each, respectively.
94 # (use "git pull" to merge the remote branch into yours)
@@ -119,7 +119,7 @@ test_expect_success 'status --column status.displayCommentPrefix=false' '
119 '
120
121 cat >expect <<\EOF
122 -# On branch master
122 +# On branch main
123 # Your branch and 'upstream' have diverged,
124 # and have 1 and 2 different commits each, respectively.
125 # (use "git pull" to merge the remote branch into yours)
@@ -193,7 +193,7 @@ test_expect_success 'commit ignores status.displayCommentPrefix=false in COMMIT_
193 '
194
195 cat >expect <<\EOF
196 -On branch master
196 +On branch main
197 Your branch and 'upstream' have diverged,
198 and have 1 and 2 different commits each, respectively.
199
@@ -266,7 +266,7 @@ test_expect_success 'status with gitignore' '
266 test_cmp expect output &&
267
268 cat >expect <<\EOF &&
269 -On branch master
269 +On branch main
270 Your branch and '\''upstream'\'' have diverged,
271 and have 1 and 2 different commits each, respectively.
272 (use "git pull" to merge the remote branch into yours)
@@ -331,7 +331,7 @@ test_expect_success 'status with gitignore (nothing untracked)' '
331 test_cmp expect output &&
332
333 cat >expect <<\EOF &&
334 -On branch master
334 +On branch main
335 Your branch and '\''upstream'\'' have diverged,
336 and have 1 and 2 different commits each, respectively.
337 (use "git pull" to merge the remote branch into yours)
@@ -368,7 +368,7 @@ output*
368 EOF
369
370 cat >expect <<\EOF
371 -## master...upstream [ahead 1, behind 2]
371 +## main...upstream [ahead 1, behind 2]
372 M dir1/modified
373 A dir2/added
374 ?? dir1/untracked
@@ -401,7 +401,7 @@ test_expect_success 'setup dir3' '
401
402 test_expect_success 'status -uno' '
403 cat >expect <<EOF &&
404 -On branch master
404 +On branch main
405 Your branch and '\''upstream'\'' have diverged,
406 and have 1 and 2 different commits each, respectively.
407 (use "git pull" to merge the remote branch into yours)
@@ -429,7 +429,7 @@ test_expect_success 'status (status.showUntrackedFiles no)' '
429
430 test_expect_success 'status -uno (advice.statusHints false)' '
431 cat >expect <<EOF &&
432 -On branch master
432 +On branch main
433 Your branch and '\''upstream'\'' have diverged,
434 and have 1 and 2 different commits each, respectively.
435
@@ -463,7 +463,7 @@ test_expect_success 'status -s (status.showUntrackedFiles no)' '
463
464 test_expect_success 'status -unormal' '
465 cat >expect <<EOF &&
466 -On branch master
466 +On branch main
467 Your branch and '\''upstream'\'' have diverged,
468 and have 1 and 2 different commits each, respectively.
469 (use "git pull" to merge the remote branch into yours)
@@ -518,7 +518,7 @@ test_expect_success 'status -s (status.showUntrackedFiles normal)' '
518
519 test_expect_success 'status -uall' '
520 cat >expect <<EOF &&
521 -On branch master
521 +On branch main
522 Your branch and '\''upstream'\'' have diverged,
523 and have 1 and 2 different commits each, respectively.
524 (use "git pull" to merge the remote branch into yours)
@@ -578,7 +578,7 @@ test_expect_success 'status -s (status.showUntrackedFiles all)' '
578
579 test_expect_success 'status with relative paths' '
580 cat >expect <<\EOF &&
581 -On branch master
581 +On branch main
582 Your branch and '\''upstream'\'' have diverged,
583 and have 1 and 2 different commits each, respectively.
584 (use "git pull" to merge the remote branch into yours)
@@ -646,7 +646,7 @@ test_expect_success 'setup unique colors' '
646
647 test_expect_success TTY 'status with color.ui' '
648 cat >expect <<\EOF &&
649 -On branch <GREEN>master<RESET>
649 +On branch <GREEN>main<RESET>
650 Your branch and '\''upstream'\'' have diverged,
651 and have 1 and 2 different commits each, respectively.
652 (use "git pull" to merge the remote branch into yours)
@@ -706,7 +706,7 @@ test_expect_success TTY 'status -s with color.status' '
706 '
707
708 cat >expect <<\EOF
709 -## <YELLOW>master<RESET>...<CYAN>upstream<RESET> [ahead <YELLOW>1<RESET>, behind <CYAN>2<RESET>]
709 +## <YELLOW>main<RESET>...<CYAN>upstream<RESET> [ahead <YELLOW>1<RESET>, behind <CYAN>2<RESET>]
710 <RED>M<RESET> dir1/modified
711 <GREEN>A<RESET> dir2/added
712 <BLUE>??<RESET> dir1/untracked
@@ -757,7 +757,7 @@ test_expect_success 'status --porcelain respects -b' '
757
758 git status --porcelain -b >output &&
759 {
760 - echo "## master...upstream [ahead 1, behind 2]" &&
760 + echo "## main...upstream [ahead 1, behind 2]" &&
761 cat expect
762 } >tmp &&
763 mv tmp expect &&
@@ -769,7 +769,7 @@ test_expect_success 'status --porcelain respects -b' '
769
770 test_expect_success 'status without relative paths' '
771 cat >expect <<\EOF &&
772 -On branch master
772 +On branch main
773 Your branch and '\''upstream'\'' have diverged,
774 and have 1 and 2 different commits each, respectively.
775 (use "git pull" to merge the remote branch into yours)
@@ -843,7 +843,7 @@ test_expect_success 'status -s without relative paths' '
843
844 test_expect_success 'dry-run of partial commit excluding new file in index' '
845 cat >expect <<EOF &&
846 -On branch master
846 +On branch main
847 Your branch and '\''upstream'\'' have diverged,
848 and have 1 and 2 different commits each, respectively.
849 (use "git pull" to merge the remote branch into yours)
@@ -897,7 +897,7 @@ test_expect_success 'setup status submodule summary' '
897
898 test_expect_success 'status submodule summary is disabled by default' '
899 cat >expect <<EOF &&
900 -On branch master
900 +On branch main
901 Your branch and '\''upstream'\'' have diverged,
902 and have 1 and 2 different commits each, respectively.
903 (use "git pull" to merge the remote branch into yours)
@@ -954,7 +954,7 @@ head=$(cd sm && git rev-parse --short=7 --verify HEAD)
954
955 test_expect_success 'status submodule summary' '
956 cat >expect <<EOF &&
957 -On branch master
957 +On branch main
958 Your branch and '\''upstream'\'' have diverged,
959 and have 1 and 2 different commits each, respectively.
960 (use "git pull" to merge the remote branch into yours)
@@ -1013,7 +1013,7 @@ test_expect_success 'status -s submodule summary' '
1013
1014 test_expect_success 'status submodule summary (clean submodule): commit' '
1015 cat >expect <<EOF &&
1016 -On branch master
1016 +On branch main
1017 Your branch and '\''upstream'\'' have diverged,
1018 and have 2 and 2 different commits each, respectively.
1019 (use "git pull" to merge the remote branch into yours)
@@ -1061,7 +1061,7 @@ test_expect_success 'status -z implies porcelain' '
1061
1062 test_expect_success 'commit --dry-run submodule summary (--amend)' '
1063 cat >expect <<EOF &&
1064 -On branch master
1064 +On branch main
1065 Your branch and '\''upstream'\'' have diverged,
1066 and have 2 and 2 different commits each, respectively.
1067 (use "git pull" to merge the remote branch into yours)
@@ -1113,7 +1113,7 @@ touch .gitmodules
1113
1114 test_expect_success '--ignore-submodules=untracked suppresses submodules with untracked content' '
1115 cat > expect << EOF &&
1116 -On branch master
1116 +On branch main
1117 Your branch and '\''upstream'\'' have diverged,
1118 and have 2 and 2 different commits each, respectively.
1119 (use "git pull" to merge the remote branch into yours)
@@ -1222,7 +1222,7 @@ test_expect_success '.git/config ignore=dirty suppresses submodules with modifie
1222
1223 test_expect_success "--ignore-submodules=untracked doesn't suppress submodules with modified content" '
1224 cat > expect << EOF &&
1225 -On branch master
1225 +On branch main
1226 Your branch and '\''upstream'\'' have diverged,
1227 and have 2 and 2 different commits each, respectively.
1228 (use "git pull" to merge the remote branch into yours)
@@ -1279,7 +1279,7 @@ head2=$(cd sm && git commit -q -m "2nd commit" foo && git rev-parse --short=7 --
1279
1280 test_expect_success "--ignore-submodules=untracked doesn't suppress submodule summary" '
1281 cat > expect << EOF &&
1282 -On branch master
1282 +On branch main
1283 Your branch and '\''upstream'\'' have diverged,
1284 and have 2 and 2 different commits each, respectively.
1285 (use "git pull" to merge the remote branch into yours)
@@ -1360,7 +1360,7 @@ test_expect_success ".git/config ignore=dirty doesn't suppress submodule summary
1360 '
1361
1362 cat > expect << EOF
1363 -; On branch master
1363 +; On branch main
1364 ; Your branch and 'upstream' have diverged,
1365 ; and have 2 and 2 different commits each, respectively.
1366 ; (use "git pull" to merge the remote branch into yours)
@@ -1408,7 +1408,7 @@ test_expect_success "status (core.commentchar with two chars with submodule summ
1408
1409 test_expect_success "--ignore-submodules=all suppresses submodule summary" '
1410 cat > expect << EOF &&
1411 -On branch master
1411 +On branch main
1412 Your branch and '\''upstream'\'' have diverged,
1413 and have 2 and 2 different commits each, respectively.
1414 (use "git pull" to merge the remote branch into yours)
@@ -1434,7 +1434,7 @@ EOF
1434
1435 test_expect_success '.gitmodules ignore=all suppresses unstaged submodule summary' '
1436 cat > expect << EOF &&
1437 -On branch master
1437 +On branch main
1438 Your branch and '\''upstream'\'' have diverged,
1439 and have 2 and 2 different commits each, respectively.
1440 (use "git pull" to merge the remote branch into yours)
@@ -1554,7 +1554,7 @@ test_expect_success 'git commit --dry-run will show a staged but ignored submodu
1554 git reset HEAD^ &&
1555 git add sm &&
1556 cat >expect << EOF &&
1557 -On branch master
1557 +On branch main
1558 Your branch and '\''upstream'\'' have diverged,
1559 and have 2 and 2 different commits each, respectively.
1560 (use "git pull" to merge the remote branch into yours)
t/t7510-signed-commit.sh
+2 -2
@@ -1,7 +1,7 @@
1 #!/bin/sh
2
3 test_description='signed commit tests'
4 -GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
4 +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
5 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
6
7 . ./test-lib.sh
@@ -28,7 +28,7 @@ test_expect_success GPG 'create signed commits' '
28 echo 3 >elif && git add elif &&
29 test_tick && git commit -m "third on side" &&
30
31 - git checkout master &&
31 + git checkout main &&
32 test_tick && git merge -S side &&
33 git tag merge &&
34
t/t7512-status-help.sh
+21 -21
@@ -7,7 +7,7 @@
7
8 test_description='git status advice'
9
10 -GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
10 +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
11 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
12
13 . ./test-lib.sh
@@ -20,14 +20,14 @@ test_expect_success 'prepare for conflicts' '
20 git config --global advice.statusuoption false &&
21 test_commit init main.txt init &&
22 git branch conflicts &&
23 - test_commit on_master main.txt on_master &&
23 + test_commit on_main main.txt on_main &&
24 git checkout conflicts &&
25 test_commit on_conflicts main.txt on_conflicts
26 '
27
28
29 test_expect_success 'status when conflicts unresolved' '
30 - test_must_fail git merge master &&
30 + test_must_fail git merge main &&
31 cat >expected <<\EOF &&
32 On branch conflicts
33 You have unmerged paths.
@@ -47,7 +47,7 @@ EOF
47
48 test_expect_success 'status when conflicts resolved before commit' '
49 git reset --hard conflicts &&
50 - test_must_fail git merge master &&
50 + test_must_fail git merge main &&
51 echo one >main.txt &&
52 git add main.txt &&
53 cat >expected <<\EOF &&
@@ -66,7 +66,7 @@ EOF
66
67
68 test_expect_success 'prepare for rebase conflicts' '
69 - git reset --hard master &&
69 + git reset --hard main &&
70 git checkout -b rebase_conflicts &&
71 test_commit one_rebase main.txt one &&
72 test_commit two_rebase main.txt two &&
@@ -121,11 +121,11 @@ EOF
121
122
123 test_expect_success 'prepare for rebase_i_conflicts' '
124 - git reset --hard master &&
124 + git reset --hard main &&
125 git checkout -b rebase_i_conflicts &&
126 test_commit one_unmerge main.txt one_unmerge &&
127 git branch rebase_i_conflicts_second &&
128 - test_commit one_master main.txt one_master &&
128 + test_commit one_main main.txt one_main &&
129 git checkout rebase_i_conflicts_second &&
130 test_commit one_second main.txt one_second
131 '
@@ -185,7 +185,7 @@ EOF
185
186
187 test_expect_success 'status when rebasing -i in edit mode' '
188 - git reset --hard master &&
188 + git reset --hard main &&
189 git checkout -b rebase_i_edit &&
190 test_commit one_rebase_i main.txt one &&
191 test_commit two_rebase_i main.txt two &&
@@ -215,7 +215,7 @@ EOF
215
216
217 test_expect_success 'status when splitting a commit' '
218 - git reset --hard master &&
218 + git reset --hard main &&
219 git checkout -b split_commit &&
220 test_commit one_split main.txt one &&
221 test_commit two_split main.txt two &&
@@ -254,7 +254,7 @@ EOF
254
255
256 test_expect_success 'status after editing the last commit with --amend during a rebase -i' '
257 - git reset --hard master &&
257 + git reset --hard main &&
258 git checkout -b amend_last &&
259 test_commit one_amend main.txt one &&
260 test_commit two_amend main.txt two &&
@@ -287,7 +287,7 @@ EOF
287
288
289 test_expect_success 'prepare for several edits' '
290 - git reset --hard master &&
290 + git reset --hard main &&
291 git checkout -b several_edits &&
292 test_commit one_edits main.txt one &&
293 test_commit two_edits main.txt two &&
@@ -596,7 +596,7 @@ EOF
596
597
598 test_expect_success 'prepare am_session' '
599 - git reset --hard master &&
599 + git reset --hard main &&
600 git checkout -b am_session &&
601 test_commit one_am one.txt "one" &&
602 test_commit two_am two.txt "two" &&
@@ -669,7 +669,7 @@ EOF
669
670
671 test_expect_success 'status when bisecting' '
672 - git reset --hard master &&
672 + git reset --hard main &&
673 git checkout -b bisect &&
674 test_commit one_bisect main.txt one &&
675 test_commit two_bisect main.txt two &&
@@ -692,7 +692,7 @@ EOF
692
693
694 test_expect_success 'status when rebase --apply conflicts with statushints disabled' '
695 - git reset --hard master &&
695 + git reset --hard main &&
696 git checkout -b statushints_disabled &&
697 test_when_finished "git config --local advice.statushints true" &&
698 git config --local advice.statushints false &&
@@ -717,7 +717,7 @@ EOF
717
718
719 test_expect_success 'prepare for cherry-pick conflicts' '
720 - git reset --hard master &&
720 + git reset --hard main &&
721 git checkout -b cherry_branch &&
722 test_commit one_cherry main.txt one &&
723 test_commit two_cherries main.txt two &&
@@ -828,7 +828,7 @@ EOF
828 '
829
830 test_expect_success 'status while reverting commit (conflicts)' '
831 - git checkout master &&
831 + git checkout main &&
832 echo before >to-revert.txt &&
833 test_commit before to-revert.txt &&
834 echo old >to-revert.txt &&
@@ -838,7 +838,7 @@ test_expect_success 'status while reverting commit (conflicts)' '
838 TO_REVERT=$(git rev-parse --short HEAD^) &&
839 test_must_fail git revert $TO_REVERT &&
840 cat >expected <<EOF &&
841 -On branch master
841 +On branch main
842 You are currently reverting commit $TO_REVERT.
843 (fix conflicts and run "git revert --continue")
844 (use "git revert --skip" to skip this patch)
@@ -859,7 +859,7 @@ test_expect_success 'status while reverting commit (conflicts resolved)' '
859 echo reverted >to-revert.txt &&
860 git add to-revert.txt &&
861 cat >expected <<EOF &&
862 -On branch master
862 +On branch main
863 You are currently reverting commit $TO_REVERT.
864 (all conflicts fixed: run "git revert --continue")
865 (use "git revert --skip" to skip this patch)
@@ -878,7 +878,7 @@ EOF
878 test_expect_success 'status after reverting commit' '
879 git revert --continue &&
880 cat >expected <<\EOF &&
881 -On branch master
881 +On branch main
882 nothing to commit (use -u to show untracked files)
883 EOF
884 git status --untracked-files=no >actual &&
@@ -892,7 +892,7 @@ test_expect_success 'status while reverting after committing conflict resolution
892 echo reverted >to-revert.txt &&
893 git commit -a &&
894 cat >expected <<EOF &&
895 -On branch master
895 +On branch main
896 Revert currently in progress.
897 (run "git revert --continue" to continue)
898 (use "git revert --skip" to skip this patch)
@@ -905,7 +905,7 @@ EOF
905 '
906
907 test_expect_success 'prepare for different number of commits rebased' '
908 - git reset --hard master &&
908 + git reset --hard main &&
909 git checkout -b several_commits &&
910 test_commit one_commit main.txt one &&
911 test_commit two_commit main.txt two &&
t/t7517-per-repo-email.sh
+7 -7
@@ -6,7 +6,7 @@
6
7 test_description='per-repo forced setting of email address'
8
9 -GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
9 +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
10 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
11
12 . ./test-lib.sh
@@ -50,24 +50,24 @@ test_expect_success 'set up rebase scenarios' '
50
51 test_expect_success 'fast-forward rebase does not care about ident' '
52 git checkout -B tmp side-without-commit &&
53 - git rebase master
53 + git rebase main
54 '
55
56 test_expect_success 'non-fast-forward rebase refuses to write commits' '
57 test_when_finished "git rebase --abort || true" &&
58 git checkout -B tmp side-with-commit &&
59 - test_must_fail git rebase master
59 + test_must_fail git rebase main
60 '
61
62 test_expect_success 'fast-forward rebase does not care about ident (interactive)' '
63 git checkout -B tmp side-without-commit &&
64 - git rebase -i master
64 + git rebase -i main
65 '
66
67 test_expect_success 'non-fast-forward rebase refuses to write commits (interactive)' '
68 test_when_finished "git rebase --abort || true" &&
69 git checkout -B tmp side-with-commit &&
70 - test_must_fail git rebase -i master
70 + test_must_fail git rebase -i main
71 '
72
73 test_expect_success 'noop interactive rebase does not care about ident' '
@@ -78,14 +78,14 @@ test_expect_success 'noop interactive rebase does not care about ident' '
78 test_expect_success REBASE_P \
79 'fast-forward rebase does not care about ident (preserve)' '
80 git checkout -B tmp side-without-commit &&
81 - git rebase -p master
81 + git rebase -p main
82 '
83
84 test_expect_success REBASE_P \
85 'non-fast-forward rebase refuses to write commits (preserve)' '
86 test_when_finished "git rebase --abort || true" &&
87 git checkout -B tmp side-with-commit &&
88 - test_must_fail git rebase -p master
88 + test_must_fail git rebase -p main
89 '
90
91 test_expect_success 'author.name overrides user.name' '
t/t7600-merge.sh
+23 -23
@@ -14,9 +14,9 @@ Testing basic merge operations/option parsing.
14 ! [c4] c4
15 ! [c5] c5
16 ! [c6] c6
17 - * [master] Merge commit 'c1'
17 + * [main] Merge commit 'c1'
18 --------
19 - - [master] Merge commit 'c1'
19 + - [main] Merge commit 'c1'
20 + * [c1] commit 1
21 + [c6] c6
22 + [c5] c5
@@ -26,7 +26,7 @@ Testing basic merge operations/option parsing.
26 +++++++* [c0] commit 0
27 '
28
29 -GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
29 +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
30 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
31
32 . ./test-lib.sh
@@ -206,13 +206,13 @@ test_expect_success 'merge c0 with c1 with --ff-only' '
206 test_debug 'git log --graph --decorate --oneline --all'
207
208 test_expect_success 'merge from unborn branch' '
209 - git checkout -f master &&
209 + git checkout -f main &&
210 test_might_fail git branch -D kid &&
211
212 echo "OBJID HEAD@{0}: initial pull" >reflog.expected &&
213
214 git checkout --orphan kid &&
215 - test_when_finished "git checkout -f master" &&
215 + test_when_finished "git checkout -f main" &&
216 git rm -fr . &&
217 test_tick &&
218 git merge --ff-only c1 &&
@@ -416,7 +416,7 @@ test_debug 'git log --graph --decorate --oneline --all'
416
417 test_expect_success 'merge c1 with c2 (no-commit in config)' '
418 git reset --hard c1 &&
419 - test_config branch.master.mergeoptions "--no-commit" &&
419 + test_config branch.main.mergeoptions "--no-commit" &&
420 git merge c2 &&
421 verify_merge file result.1-5 &&
422 verify_head $c1 &&
@@ -430,7 +430,7 @@ test_expect_success 'merge c1 with c2 (log in config)' '
430 git merge --log c2 &&
431 git show -s --pretty=tformat:%s%n%b >expect &&
432
433 - test_config branch.master.mergeoptions "--log" &&
433 + test_config branch.main.mergeoptions "--log" &&
434 git reset --hard c1 &&
435 git merge c2 &&
436 git show -s --pretty=tformat:%s%n%b >actual &&
@@ -443,7 +443,7 @@ test_expect_success 'merge c1 with c2 (log in config gets overridden)' '
443 git merge c2 &&
444 git show -s --pretty=tformat:%s%n%b >expect &&
445
446 - test_config branch.master.mergeoptions "--no-log" &&
446 + test_config branch.main.mergeoptions "--no-log" &&
447 test_config merge.log "true" &&
448 git reset --hard c1 &&
449 git merge c2 &&
@@ -454,7 +454,7 @@ test_expect_success 'merge c1 with c2 (log in config gets overridden)' '
454
455 test_expect_success 'merge c1 with c2 (squash in config)' '
456 git reset --hard c1 &&
457 - test_config branch.master.mergeoptions "--squash" &&
457 + test_config branch.main.mergeoptions "--squash" &&
458 git merge c2 &&
459 verify_merge file result.1-5 &&
460 verify_head $c1 &&
@@ -466,7 +466,7 @@ test_debug 'git log --graph --decorate --oneline --all'
466
467 test_expect_success 'override config option -n with --summary' '
468 git reset --hard c1 &&
469 - test_config branch.master.mergeoptions "-n" &&
469 + test_config branch.main.mergeoptions "-n" &&
470 test_tick &&
471 git merge --summary c2 >diffstat.txt &&
472 verify_merge file result.1-5 msg.1-5 &&
@@ -480,7 +480,7 @@ test_expect_success 'override config option -n with --summary' '
480
481 test_expect_success 'override config option -n with --stat' '
482 git reset --hard c1 &&
483 - test_config branch.master.mergeoptions "-n" &&
483 + test_config branch.main.mergeoptions "-n" &&
484 test_tick &&
485 git merge --stat c2 >diffstat.txt &&
486 verify_merge file result.1-5 msg.1-5 &&
@@ -496,7 +496,7 @@ test_debug 'git log --graph --decorate --oneline --all'
496
497 test_expect_success 'override config option --stat' '
498 git reset --hard c1 &&
499 - test_config branch.master.mergeoptions "--stat" &&
499 + test_config branch.main.mergeoptions "--stat" &&
500 test_tick &&
501 git merge -n c2 >diffstat.txt &&
502 verify_merge file result.1-5 msg.1-5 &&
@@ -512,7 +512,7 @@ test_debug 'git log --graph --decorate --oneline --all'
512
513 test_expect_success 'merge c1 with c2 (override --no-commit)' '
514 git reset --hard c1 &&
515 - test_config branch.master.mergeoptions "--no-commit" &&
515 + test_config branch.main.mergeoptions "--no-commit" &&
516 test_tick &&
517 git merge --commit c2 &&
518 verify_merge file result.1-5 msg.1-5 &&
@@ -523,7 +523,7 @@ test_debug 'git log --graph --decorate --oneline --all'
523
524 test_expect_success 'merge c1 with c2 (override --squash)' '
525 git reset --hard c1 &&
526 - test_config branch.master.mergeoptions "--squash" &&
526 + test_config branch.main.mergeoptions "--squash" &&
527 test_tick &&
528 git merge --no-squash c2 &&
529 verify_merge file result.1-5 msg.1-5 &&
@@ -552,9 +552,9 @@ test_expect_success 'merge c0 with c1 (merge.ff=false)' '
552 '
553 test_debug 'git log --graph --decorate --oneline --all'
554
555 -test_expect_success 'combine branch.master.mergeoptions with merge.ff' '
555 +test_expect_success 'combine branch.main.mergeoptions with merge.ff' '
556 git reset --hard c0 &&
557 - test_config branch.master.mergeoptions "--ff" &&
557 + test_config branch.main.mergeoptions "--ff" &&
558 test_config merge.ff "false" &&
559 test_tick &&
560 git merge c1 &&
@@ -596,7 +596,7 @@ test_expect_success 'option --no-ff overrides merge.ff=only config' '
596
597 test_expect_success 'merge c0 with c1 (ff overrides no-ff)' '
598 git reset --hard c0 &&
599 - test_config branch.master.mergeoptions "--no-ff" &&
599 + test_config branch.main.mergeoptions "--no-ff" &&
600 git merge --ff c1 &&
601 verify_merge file result.1 &&
602 verify_head $c1
@@ -609,7 +609,7 @@ test_expect_success 'merge log message' '
609 test_must_be_empty msg.act &&
610
611 git reset --hard c0 &&
612 - test_config branch.master.mergeoptions "--no-ff" &&
612 + test_config branch.main.mergeoptions "--no-ff" &&
613 git merge --no-log c2 &&
614 git show -s --pretty=format:%b HEAD >msg.act &&
615 test_must_be_empty msg.act &&
@@ -953,10 +953,10 @@ test_expect_success 'set up mod-256 conflict scenario' '
953 git add file &&
954 git commit -m base &&
955
956 - # one side changes the first line of each to "master"
957 - sed s/-1/-master/ file >tmp &&
956 + # one side changes the first line of each to "main"
957 + sed s/-1/-main/ file >tmp &&
958 mv tmp file &&
959 - git commit -am master &&
959 + git commit -am main &&
960
961 # and the other to "side"; merging the two will
962 # yield 256 separate conflicts
@@ -968,12 +968,12 @@ test_expect_success 'set up mod-256 conflict scenario' '
968
969 test_expect_success 'merge detects mod-256 conflicts (recursive)' '
970 git reset --hard &&
971 - test_must_fail git merge -s recursive master
971 + test_must_fail git merge -s recursive main
972 '
973
974 test_expect_success 'merge detects mod-256 conflicts (resolve)' '
975 git reset --hard &&
976 - test_must_fail git merge -s resolve master
976 + test_must_fail git merge -s resolve main
977 '
978
979 test_expect_success 'merge nothing into void' '
t/t7606-merge-custom.sh
+1 -1
@@ -4,7 +4,7 @@ test_description="git merge
4
5 Testing a custom strategy.
6
7 -* (HEAD, master) Merge commit 'c3'
7 +* (HEAD, main) Merge commit 'c3'
8 |\
9 | * (tag: c3) c3
10 * | (tag: c1) c1
t/t7608-merge-messages.sh
+19 -19
@@ -1,7 +1,7 @@
1 #!/bin/sh
2
3 test_description='test auto-generated merge messages'
4 -GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
4 +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
5 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
6
7 . ./test-lib.sh
@@ -13,51 +13,51 @@ check_oneline() {
13 }
14
15 test_expect_success 'merge local branch' '
16 - test_commit master-1 &&
16 + test_commit main-1 &&
17 git checkout -b local-branch &&
18 test_commit branch-1 &&
19 - git checkout master &&
20 - test_commit master-2 &&
19 + git checkout main &&
20 + test_commit main-2 &&
21 git merge local-branch &&
22 check_oneline "Merge branch Qlocal-branchQ"
23 '
24
25 test_expect_success 'merge octopus branches' '
26 - git checkout -b octopus-a master &&
26 + git checkout -b octopus-a main &&
27 test_commit octopus-1 &&
28 - git checkout -b octopus-b master &&
28 + git checkout -b octopus-b main &&
29 test_commit octopus-2 &&
30 - git checkout master &&
30 + git checkout main &&
31 git merge octopus-a octopus-b &&
32 check_oneline "Merge branches Qoctopus-aQ and Qoctopus-bQ"
33 '
34
35 test_expect_success 'merge tag' '
36 - git checkout -b tag-branch master &&
36 + git checkout -b tag-branch main &&
37 test_commit tag-1 &&
38 - git checkout master &&
39 - test_commit master-3 &&
38 + git checkout main &&
39 + test_commit main-3 &&
40 git merge tag-1 &&
41 check_oneline "Merge tag Qtag-1Q"
42 '
43
44 test_expect_success 'ambiguous tag' '
45 - git checkout -b ambiguous master &&
45 + git checkout -b ambiguous main &&
46 test_commit ambiguous &&
47 - git checkout master &&
48 - test_commit master-4 &&
47 + git checkout main &&
48 + test_commit main-4 &&
49 git merge ambiguous &&
50 check_oneline "Merge tag QambiguousQ"
51 '
52
53 test_expect_success 'remote-tracking branch' '
54 - git checkout -b remote master &&
54 + git checkout -b remote main &&
55 test_commit remote-1 &&
56 - git update-ref refs/remotes/origin/master remote &&
57 - git checkout master &&
58 - test_commit master-5 &&
59 - git merge origin/master &&
60 - check_oneline "Merge remote-tracking branch Qorigin/masterQ"
56 + git update-ref refs/remotes/origin/main remote &&
57 + git checkout main &&
58 + test_commit main-5 &&
59 + git merge origin/main &&
60 + check_oneline "Merge remote-tracking branch Qorigin/mainQ"
61 '
62
63 test_done
t/t7610-mergetool.sh
+88 -88
@@ -7,25 +7,25 @@ test_description='git mergetool
7
8 Testing basic merge tool invocation'
9
10 -GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
10 +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
11 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
12
13 . ./test-lib.sh
14
15 # All the mergetool test work by checking out a temporary branch based
16 -# off 'branch1' and then merging in master and checking the results of
16 +# off 'branch1' and then merging in main and checking the results of
17 # running mergetool
18
19 test_expect_success 'setup' '
20 test_config rerere.enabled true &&
21 - echo master >file1 &&
22 - echo master spaced >"spaced name" &&
23 - echo master file11 >file11 &&
24 - echo master file12 >file12 &&
25 - echo master file13 >file13 &&
26 - echo master file14 >file14 &&
21 + echo main >file1 &&
22 + echo main spaced >"spaced name" &&
23 + echo main file11 >file11 &&
24 + echo main file12 >file12 &&
25 + echo main file13 >file13 &&
26 + echo main file14 >file14 &&
27 mkdir subdir &&
28 - echo master sub >subdir/file3 &&
28 + echo main sub >subdir/file3 &&
29 test_create_repo submod &&
30 (
31 cd submod &&
@@ -37,7 +37,7 @@ test_expect_success 'setup' '
37 git add file1 "spaced name" file1[1-4] subdir/file3 .gitmodules submod &&
38 git commit -m "add initial versions" &&
39
40 - git checkout -b branch1 master &&
40 + git checkout -b branch1 main &&
41 git submodule update -N &&
42 echo branch1 change >file1 &&
43 echo branch1 newfile >file2 &&
@@ -74,39 +74,39 @@ test_expect_success 'setup' '
74 test_write_lines one two 3 >c/c/file.txt &&
75 git commit -a -m"move to c" &&
76
77 - git checkout -b stash1 master &&
77 + git checkout -b stash1 main &&
78 echo stash1 change file11 >file11 &&
79 git add file11 &&
80 git commit -m "stash1 changes" &&
81
82 - git checkout -b stash2 master &&
82 + git checkout -b stash2 main &&
83 echo stash2 change file11 >file11 &&
84 git add file11 &&
85 git commit -m "stash2 changes" &&
86
87 - git checkout master &&
87 + git checkout main &&
88 git submodule update -N &&
89 - echo master updated >file1 &&
90 - echo master new >file2 &&
91 - echo master updated spaced >"spaced name" &&
92 - echo master both added >both &&
93 - echo master updated file12 >file12 &&
94 - echo master updated file14 >file14 &&
95 - echo master new sub >subdir/file3 &&
89 + echo main updated >file1 &&
90 + echo main new >file2 &&
91 + echo main updated spaced >"spaced name" &&
92 + echo main both added >both &&
93 + echo main updated file12 >file12 &&
94 + echo main updated file14 >file14 &&
95 + echo main new sub >subdir/file3 &&
96 (
97 cd submod &&
98 - echo master submodule >bar &&
98 + echo main submodule >bar &&
99 git add bar &&
100 - git commit -m "Add bar on master" &&
101 - git checkout -b submod-master
100 + git commit -m "Add bar on main" &&
101 + git checkout -b submod-main
102 ) &&
103 git add file1 "spaced name" file12 file14 file2 subdir/file3 submod &&
104 git add both &&
105 git rm file11 &&
106 - git commit -m "master updates" &&
106 + git commit -m "main updates" &&
107
108 git clean -fdx &&
109 - git checkout -b order-file-start master &&
109 + git checkout -b order-file-start main &&
110 echo start >a &&
111 echo start >b &&
112 git add a b &&
@@ -133,7 +133,7 @@ test_expect_success 'custom mergetool' '
133 test_when_finished "git reset --hard" &&
134 git checkout -b test$test_count branch1 &&
135 git submodule update -N &&
136 - test_must_fail git merge master &&
136 + test_must_fail git merge main &&
137 yes "" | git mergetool both &&
138 yes "" | git mergetool file1 file1 &&
139 yes "" | git mergetool file2 "spaced name" &&
@@ -141,11 +141,11 @@ test_expect_success 'custom mergetool' '
141 yes "d" | git mergetool file11 &&
142 yes "d" | git mergetool file12 &&
143 yes "l" | git mergetool submod &&
144 - echo "master updated" >expect &&
144 + echo "main updated" >expect &&
145 test_cmp expect file1 &&
146 - echo "master new" >expect &&
146 + echo "main new" >expect &&
147 test_cmp expect file2 &&
148 - echo "master new sub" >expect &&
148 + echo "main new sub" >expect &&
149 test_cmp expect subdir/file3 &&
150 echo "branch1 submodule" >expect &&
151 test_cmp expect submod/bar &&
@@ -159,7 +159,7 @@ test_expect_success 'gui mergetool' '
159 test_when_finished "git reset --hard" &&
160 git checkout -b test$test_count branch1 &&
161 git submodule update -N &&
162 - test_must_fail git merge master &&
162 + test_must_fail git merge main &&
163 yes "" | git mergetool --gui both &&
164 yes "" | git mergetool -g file1 file1 &&
165 yes "" | git mergetool --gui file2 "spaced name" &&
@@ -167,11 +167,11 @@ test_expect_success 'gui mergetool' '
167 yes "d" | git mergetool --gui file11 &&
168 yes "d" | git mergetool --gui file12 &&
169 yes "l" | git mergetool --gui submod &&
170 - echo "gui master updated" >expect &&
170 + echo "gui main updated" >expect &&
171 test_cmp expect file1 &&
172 - echo "gui master new" >expect &&
172 + echo "gui main new" >expect &&
173 test_cmp expect file2 &&
174 - echo "gui master new sub" >expect &&
174 + echo "gui main new sub" >expect &&
175 test_cmp expect subdir/file3 &&
176 echo "branch1 submodule" >expect &&
177 test_cmp expect submod/bar &&
@@ -182,7 +182,7 @@ test_expect_success 'gui mergetool without merge.guitool set falls back to merge
182 test_when_finished "git reset --hard" &&
183 git checkout -b test$test_count branch1 &&
184 git submodule update -N &&
185 - test_must_fail git merge master &&
185 + test_must_fail git merge main &&
186 yes "" | git mergetool --gui both &&
187 yes "" | git mergetool -g file1 file1 &&
188 yes "" | git mergetool --gui file2 "spaced name" &&
@@ -190,11 +190,11 @@ test_expect_success 'gui mergetool without merge.guitool set falls back to merge
190 yes "d" | git mergetool --gui file11 &&
191 yes "d" | git mergetool --gui file12 &&
192 yes "l" | git mergetool --gui submod &&
193 - echo "master updated" >expect &&
193 + echo "main updated" >expect &&
194 test_cmp expect file1 &&
195 - echo "master new" >expect &&
195 + echo "main new" >expect &&
196 test_cmp expect file2 &&
197 - echo "master new sub" >expect &&
197 + echo "main new sub" >expect &&
198 test_cmp expect subdir/file3 &&
199 echo "branch1 submodule" >expect &&
200 test_cmp expect submod/bar &&
@@ -209,7 +209,7 @@ test_expect_success 'mergetool crlf' '
209 # test_when_finished is LIFO.)
210 test_config core.autocrlf true &&
211 git checkout -b test$test_count branch1 &&
212 - test_must_fail git merge master &&
212 + test_must_fail git merge main &&
213 yes "" | git mergetool file1 &&
214 yes "" | git mergetool file2 &&
215 yes "" | git mergetool "spaced name" &&
@@ -218,11 +218,11 @@ test_expect_success 'mergetool crlf' '
218 yes "d" | git mergetool file11 &&
219 yes "d" | git mergetool file12 &&
220 yes "r" | git mergetool submod &&
221 - test "$(printf x | cat file1 -)" = "$(printf "master updated\r\nx")" &&
222 - test "$(printf x | cat file2 -)" = "$(printf "master new\r\nx")" &&
223 - test "$(printf x | cat subdir/file3 -)" = "$(printf "master new sub\r\nx")" &&
221 + test "$(printf x | cat file1 -)" = "$(printf "main updated\r\nx")" &&
222 + test "$(printf x | cat file2 -)" = "$(printf "main new\r\nx")" &&
223 + test "$(printf x | cat subdir/file3 -)" = "$(printf "main new sub\r\nx")" &&
224 git submodule update -N &&
225 - echo "master submodule" >expect &&
225 + echo "main submodule" >expect &&
226 test_cmp expect submod/bar &&
227 git commit -m "branch1 resolved with mergetool - autocrlf"
228 '
@@ -233,9 +233,9 @@ test_expect_success 'mergetool in subdir' '
233 git submodule update -N &&
234 (
235 cd subdir &&
236 - test_must_fail git merge master &&
236 + test_must_fail git merge main &&
237 yes "" | git mergetool file3 &&
238 - echo "master new sub" >expect &&
238 + echo "main new sub" >expect &&
239 test_cmp expect file3
240 )
241 '
@@ -246,7 +246,7 @@ test_expect_success 'mergetool on file in parent dir' '
246 git submodule update -N &&
247 (
248 cd subdir &&
249 - test_must_fail git merge master &&
249 + test_must_fail git merge main &&
250 yes "" | git mergetool file3 &&
251 yes "" | git mergetool ../file1 &&
252 yes "" | git mergetool ../file2 ../spaced\ name &&
@@ -254,9 +254,9 @@ test_expect_success 'mergetool on file in parent dir' '
254 yes "d" | git mergetool ../file11 &&
255 yes "d" | git mergetool ../file12 &&
256 yes "l" | git mergetool ../submod &&
257 - echo "master updated" >expect &&
257 + echo "main updated" >expect &&
258 test_cmp expect ../file1 &&
259 - echo "master new" >expect &&
259 + echo "main new" >expect &&
260 test_cmp expect ../file2 &&
261 echo "branch1 submodule" >expect &&
262 test_cmp expect ../submod/bar &&
@@ -268,7 +268,7 @@ test_expect_success 'mergetool skips autoresolved' '
268 test_when_finished "git reset --hard" &&
269 git checkout -b test$test_count branch1 &&
270 git submodule update -N &&
271 - test_must_fail git merge master &&
271 + test_must_fail git merge main &&
272 test -n "$(git ls-files -u)" &&
273 yes "d" | git mergetool file11 &&
274 yes "d" | git mergetool file12 &&
@@ -283,17 +283,17 @@ test_expect_success 'mergetool merges all from subdir (rerere disabled)' '
283 test_config rerere.enabled false &&
284 (
285 cd subdir &&
286 - test_must_fail git merge master &&
286 + test_must_fail git merge main &&
287 yes "r" | git mergetool ../submod &&
288 yes "d" "d" | git mergetool --no-prompt &&
289 - echo "master updated" >expect &&
289 + echo "main updated" >expect &&
290 test_cmp expect ../file1 &&
291 - echo "master new" >expect &&
291 + echo "main new" >expect &&
292 test_cmp expect ../file2 &&
293 - echo "master new sub" >expect &&
293 + echo "main new sub" >expect &&
294 test_cmp expect file3 &&
295 ( cd .. && git submodule update -N ) &&
296 - echo "master submodule" >expect &&
296 + echo "main submodule" >expect &&
297 test_cmp expect ../submod/bar &&
298 git commit -m "branch2 resolved by mergetool from subdir"
299 )
@@ -306,17 +306,17 @@ test_expect_success 'mergetool merges all from subdir (rerere enabled)' '
306 rm -rf .git/rr-cache &&
307 (
308 cd subdir &&
309 - test_must_fail git merge master &&
309 + test_must_fail git merge main &&
310 yes "r" | git mergetool ../submod &&
311 yes "d" "d" | git mergetool --no-prompt &&
312 - echo "master updated" >expect &&
312 + echo "main updated" >expect &&
313 test_cmp expect ../file1 &&
314 - echo "master new" >expect &&
314 + echo "main new" >expect &&
315 test_cmp expect ../file2 &&
316 - echo "master new sub" >expect &&
316 + echo "main new sub" >expect &&
317 test_cmp expect file3 &&
318 ( cd .. && git submodule update -N ) &&
319 - echo "master submodule" >expect &&
319 + echo "main submodule" >expect &&
320 test_cmp expect ../submod/bar &&
321 git commit -m "branch2 resolved by mergetool from subdir"
322 )
@@ -328,7 +328,7 @@ test_expect_success 'mergetool skips resolved paths when rerere is active' '
328 rm -rf .git/rr-cache &&
329 git checkout -b test$test_count branch1 &&
330 git submodule update -N &&
331 - test_must_fail git merge master &&
331 + test_must_fail git merge main &&
332 yes "l" | git mergetool --no-prompt submod &&
333 yes "d" "d" | git mergetool --no-prompt &&
334 git submodule update -N &&
@@ -369,11 +369,11 @@ test_expect_success 'mergetool takes partial path' '
369 test_config rerere.enabled false &&
370 git checkout -b test$test_count branch1 &&
371 git submodule update -N &&
372 - test_must_fail git merge master &&
372 + test_must_fail git merge main &&
373
374 yes "" | git mergetool subdir &&
375
376 - echo "master new sub" >expect &&
376 + echo "main new sub" >expect &&
377 test_cmp expect subdir/file3
378 '
379
@@ -437,7 +437,7 @@ test_expect_success 'deleted vs modified submodule' '
437 git rm --cached submod &&
438 git commit -m "Submodule deleted from branch" &&
439 git checkout -b test$test_count.a test$test_count &&
440 - test_must_fail git merge master &&
440 + test_must_fail git merge main &&
441 test -n "$(git ls-files -u)" &&
442 yes "" | git mergetool file1 file2 spaced\ name subdir/file3 &&
443 yes "" | git mergetool both &&
@@ -447,7 +447,7 @@ test_expect_success 'deleted vs modified submodule' '
447 echo "branch1 submodule" >expect &&
448 test_cmp expect submod/bar &&
449 git submodule update -N &&
450 - echo "master submodule" >expect &&
450 + echo "main submodule" >expect &&
451 test_cmp expect submod/bar &&
452 output="$(git mergetool --no-prompt)" &&
453 test "$output" = "No files need merging" &&
@@ -456,7 +456,7 @@ test_expect_success 'deleted vs modified submodule' '
456 mv submod submod-movedaside &&
457 git checkout -b test$test_count.b test$test_count &&
458 git submodule update -N &&
459 - test_must_fail git merge master &&
459 + test_must_fail git merge main &&
460 test -n "$(git ls-files -u)" &&
461 yes "" | git mergetool file1 file2 spaced\ name subdir/file3 &&
462 yes "" | git mergetool both &&
@@ -468,7 +468,7 @@ test_expect_success 'deleted vs modified submodule' '
468 git commit -m "Merge resolved by deleting module" &&
469
470 mv submod-movedaside submod &&
471 - git checkout -b test$test_count.c master &&
471 + git checkout -b test$test_count.c main &&
472 git submodule update -N &&
473 test_must_fail git merge test$test_count &&
474 test -n "$(git ls-files -u)" &&
@@ -484,7 +484,7 @@ test_expect_success 'deleted vs modified submodule' '
484 git commit -m "Merge resolved by deleting module" &&
485 mv submod.orig submod &&
486
487 - git checkout -b test$test_count.d master &&
487 + git checkout -b test$test_count.d main &&
488 git submodule update -N &&
489 test_must_fail git merge test$test_count &&
490 test -n "$(git ls-files -u)" &&
@@ -492,10 +492,10 @@ test_expect_success 'deleted vs modified submodule' '
492 yes "" | git mergetool both &&
493 yes "d" | git mergetool file11 file12 &&
494 yes "l" | git mergetool submod &&
495 - echo "master submodule" >expect &&
495 + echo "main submodule" >expect &&
496 test_cmp expect submod/bar &&
497 git submodule update -N &&
498 - echo "master submodule" >expect &&
498 + echo "main submodule" >expect &&
499 test_cmp expect submod/bar &&
500 output="$(git mergetool --no-prompt)" &&
501 test "$output" = "No files need merging" &&
@@ -512,7 +512,7 @@ test_expect_success 'file vs modified submodule' '
512 git add submod &&
513 git commit -m "Submodule path becomes file" &&
514 git checkout -b test$test_count.a branch1 &&
515 - test_must_fail git merge master &&
515 + test_must_fail git merge main &&
516 test -n "$(git ls-files -u)" &&
517 yes "" | git mergetool file1 file2 spaced\ name subdir/file3 &&
518 yes "" | git mergetool both &&
@@ -522,7 +522,7 @@ test_expect_success 'file vs modified submodule' '
522 echo "branch1 submodule" >expect &&
523 test_cmp expect submod/bar &&
524 git submodule update -N &&
525 - echo "master submodule" >expect &&
525 + echo "main submodule" >expect &&
526 test_cmp expect submod/bar &&
527 output="$(git mergetool --no-prompt)" &&
528 test "$output" = "No files need merging" &&
@@ -530,7 +530,7 @@ test_expect_success 'file vs modified submodule' '
530
531 mv submod submod-movedaside &&
532 git checkout -b test$test_count.b test$test_count &&
533 - test_must_fail git merge master &&
533 + test_must_fail git merge main &&
534 test -n "$(git ls-files -u)" &&
535 yes "" | git mergetool file1 file2 spaced\ name subdir/file3 &&
536 yes "" | git mergetool both &&
@@ -550,7 +550,7 @@ test_expect_success 'file vs modified submodule' '
550 test "$output" = "No files need merging" &&
551 git commit -m "Merge resolved by keeping file" &&
552
553 - git checkout -b test$test_count.c master &&
553 + git checkout -b test$test_count.c main &&
554 rmdir submod && mv submod-movedaside submod &&
555 test ! -e submod.orig &&
556 git submodule update -N &&
@@ -576,7 +576,7 @@ test_expect_success 'file vs modified submodule' '
576 test "$output" = "No files need merging" &&
577 git commit -m "Merge resolved by keeping file" &&
578
579 - git checkout -b test$test_count.d master &&
579 + git checkout -b test$test_count.d main &&
580 rmdir submod && mv submod.orig submod &&
581 git submodule update -N &&
582 test_must_fail git merge test$test_count &&
@@ -589,10 +589,10 @@ test_expect_success 'file vs modified submodule' '
589 then
590 yes "d" | git mergetool submod~test19
591 fi &&
592 - echo "master submodule" >expect &&
592 + echo "main submodule" >expect &&
593 test_cmp expect submod/bar &&
594 git submodule update -N &&
595 - echo "master submodule" >expect &&
595 + echo "main submodule" >expect &&
596 test_cmp expect submod/bar &&
597 output="$(git mergetool --no-prompt)" &&
598 test "$output" = "No files need merging" &&
@@ -675,7 +675,7 @@ test_expect_success 'directory vs modified submodule' '
675 git add submod/file16 &&
676 git commit -m "Submodule path becomes directory" &&
677
678 - test_must_fail git merge master &&
678 + test_must_fail git merge main &&
679 test -n "$(git ls-files -u)" &&
680 yes "l" | git mergetool submod &&
681 echo "not a submodule" >expect &&
@@ -683,14 +683,14 @@ test_expect_success 'directory vs modified submodule' '
683 rm -rf submod.orig &&
684
685 git reset --hard &&
686 - test_must_fail git merge master &&
686 + test_must_fail git merge main &&
687 test -n "$(git ls-files -u)" &&
688 test ! -e submod.orig &&
689 if test "$GIT_TEST_MERGE_ALGORITHM" = ort
690 then
691 - yes "r" | git mergetool submod~master &&
691 + yes "r" | git mergetool submod~main &&
692 git mv submod submod.orig &&
693 - git mv submod~master submod
693 + git mv submod~main submod
694 else
695 yes "r" | git mergetool submod
696 fi &&
@@ -701,18 +701,18 @@ test_expect_success 'directory vs modified submodule' '
701 mv submod-movedaside/.git submod &&
702 ( cd submod && git clean -f && git reset --hard ) &&
703 git submodule update -N &&
704 - echo "master submodule" >expect &&
704 + echo "main submodule" >expect &&
705 test_cmp expect submod/bar &&
706 git reset --hard &&
707 rm -rf submod-movedaside &&
708
709 - git checkout -b test$test_count.c master &&
709 + git checkout -b test$test_count.c main &&
710 git submodule update -N &&
711 test_must_fail git merge test$test_count &&
712 test -n "$(git ls-files -u)" &&
713 yes "l" | git mergetool submod &&
714 git submodule update -N &&
715 - echo "master submodule" >expect &&
715 + echo "main submodule" >expect &&
716 test_cmp expect submod/bar &&
717
718 git reset --hard &&
@@ -724,7 +724,7 @@ test_expect_success 'directory vs modified submodule' '
724 echo "not a submodule" >expect &&
725 test_cmp expect submod/file16 &&
726
727 - git reset --hard master &&
727 + git reset --hard main &&
728 ( cd submod && git clean -f && git reset --hard ) &&
729 git submodule update -N
730 '
@@ -732,7 +732,7 @@ test_expect_success 'directory vs modified submodule' '
732 test_expect_success 'file with no base' '
733 test_when_finished "git reset --hard" &&
734 git checkout -b test$test_count branch1 &&
735 - test_must_fail git merge master &&
735 + test_must_fail git merge main &&
736 git mergetool --no-prompt --tool mybase -- both &&
737 test_must_be_empty both
738 '
@@ -742,9 +742,9 @@ test_expect_success 'custom commands override built-ins' '
742 git checkout -b test$test_count branch1 &&
743 test_config mergetool.defaults.cmd "cat \"\$REMOTE\" >\"\$MERGED\"" &&
744 test_config mergetool.defaults.trustExitCode true &&
745 - test_must_fail git merge master &&
745 + test_must_fail git merge main &&
746 git mergetool --no-prompt --tool defaults -- both &&
747 - echo master both added >expected &&
747 + echo main both added >expected &&
748 test_cmp expected both
749 '
750
@@ -754,7 +754,7 @@ test_expect_success 'filenames seen by tools start with ./' '
754 test_config mergetool.writeToTemp false &&
755 test_config mergetool.myecho.cmd "echo \"\$LOCAL\"" &&
756 test_config mergetool.myecho.trustExitCode true &&
757 - test_must_fail git merge master &&
757 + test_must_fail git merge main &&
758 git mergetool --no-prompt --tool myecho -- both >actual &&
759 grep ^\./both_LOCAL_ actual
760 '
@@ -771,7 +771,7 @@ test_expect_success MKTEMP 'temporary filenames are used with mergetool.writeToT
771 test_config mergetool.writeToTemp true &&
772 test_config mergetool.myecho.cmd "echo \"\$LOCAL\"" &&
773 test_config mergetool.myecho.trustExitCode true &&
774 - test_must_fail git merge master &&
774 + test_must_fail git merge main &&
775 git mergetool --no-prompt --tool myecho -- both >actual &&
776 ! grep ^\./both_LOCAL_ actual &&
777 grep /both_LOCAL_ actual
t/t7611-merge-abort.sh
+3 -3
@@ -7,7 +7,7 @@ Set up repo with conflicting and non-conflicting branches:
7 There are three files foo/bar/baz, and the following graph illustrates the
8 content of these files in each commit:
9
10 -# foo/bar/baz --- foo/bar/bazz <-- master
10 +# foo/bar/baz --- foo/bar/bazz <-- main
11 # \
12 # --- foo/barf/bazf <-- conflict_branch
13 # \
@@ -22,7 +22,7 @@ Next, test git merge --abort with the following variables:
22 - changed/unchanged worktree after merge
23 - changed/unchanged index after merge
24 '
25 -GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
25 +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
26 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
27
28 . ./test-lib.sh
@@ -43,7 +43,7 @@ test_expect_success 'setup' '
43 git checkout -b clean_branch HEAD^ &&
44 echo bart > bar &&
45 git commit -a -m "clean" &&
46 - git checkout master
46 + git checkout main
47 '
48
49 pre_merge_head="$(git rev-parse HEAD)"
t/t7612-merge-verify-signatures.sh
+2 -2
@@ -1,7 +1,7 @@
1 #!/bin/sh
2
3 test_description='merge signature verification tests'
4 -GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
4 +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
5 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
6
7 . ./test-lib.sh
@@ -34,7 +34,7 @@ test_expect_success GPG 'create signed commits' '
34 echo 3 >baz && git add baz &&
35 test_tick && git commit -SB7227189 -m "untrusted on side" &&
36
37 - git checkout master
37 + git checkout main
38 '
39
40 test_expect_success GPG 'merge unsigned commit with verification' '
t/t7614-merge-signoff.sh
+13 -13
@@ -5,7 +5,7 @@ test_description='git merge --signoff
5 This test runs git merge --signoff and makes sure that it works.
6 '
7
8 -GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
8 +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
9 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
10
11 . ./test-lib.sh
@@ -14,17 +14,17 @@ export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
14 test_setup() {
15 # Expected commit message after merge --signoff
16 cat >expected-signed <<EOF &&
17 -Merge branch 'master' into other-branch
17 +Merge branch 'main' into other-branch
18
19 Signed-off-by: $(git var GIT_COMMITTER_IDENT | sed -e "s/>.*/>/")
20 EOF
21
22 # Expected commit message after merge without --signoff (or with --no-signoff)
23 cat >expected-unsigned <<EOF &&
24 -Merge branch 'master' into other-branch
24 +Merge branch 'main' into other-branch
25 EOF
26
27 - # Initial commit and feature branch to merge master into it.
27 + # Initial commit and feature branch to merge main into it.
28 git commit --allow-empty -m "Initial empty commit" &&
29 git checkout -b other-branch &&
30 test_commit other-branch file1 1
@@ -41,30 +41,30 @@ test_expect_success 'setup' '
41
42 # Test with --signoff flag
43 test_expect_success 'git merge --signoff adds a sign-off line' '
44 - git checkout master &&
45 - test_commit master-branch-2 file2 2 &&
44 + git checkout main &&
45 + test_commit main-branch-2 file2 2 &&
46 git checkout other-branch &&
47 - git merge master --signoff --no-edit &&
47 + git merge main --signoff --no-edit &&
48 git cat-file commit HEAD | sed -e "1,/^\$/d" >actual &&
49 test_cmp expected-signed actual
50 '
51
52 # Test without --signoff flag
53 test_expect_success 'git merge does not add a sign-off line' '
54 - git checkout master &&
55 - test_commit master-branch-3 file3 3 &&
54 + git checkout main &&
55 + test_commit main-branch-3 file3 3 &&
56 git checkout other-branch &&
57 - git merge master --no-edit &&
57 + git merge main --no-edit &&
58 git cat-file commit HEAD | sed -e "1,/^\$/d" >actual &&
59 test_cmp expected-unsigned actual
60 '
61
62 # Test for --no-signoff flag
63 test_expect_success 'git merge --no-signoff flag cancels --signoff flag' '
64 - git checkout master &&
65 - test_commit master-branch-4 file4 4 &&
64 + git checkout main &&
65 + test_commit main-branch-4 file4 4 &&
66 git checkout other-branch &&
67 - git merge master --no-edit --signoff --no-signoff &&
67 + git merge main --no-edit --signoff --no-signoff &&
68 git cat-file commit HEAD | sed -e "1,/^\$/d" >actual &&
69 test_cmp expected-unsigned actual
70 '
t/t7701-repack-unpack-unreachable.sh
+2 -2
@@ -2,7 +2,7 @@
2
3 test_description='git repack works correctly'
4
5 -GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
5 +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
6 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
7
8 . ./test-lib.sh
@@ -25,7 +25,7 @@ test_expect_success '-A with -d option leaves unreachable objects unpacked' '
25 git commit -a -m more_content &&
26 csha1=$(git rev-parse HEAD^{commit}) &&
27 tsha1=$(git rev-parse HEAD^{tree}) &&
28 - git checkout master &&
28 + git checkout main &&
29 echo even more content >> file1 &&
30 test_tick &&
31 git commit -a -m even_more_content &&
t/t7800-difftool.sh
+20 -20
@@ -8,7 +8,7 @@ test_description='git-difftool
8 Testing basic diff tool invocation
9 '
10
11 -GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
11 +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
12 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
13
14 . ./test-lib.sh
@@ -38,23 +38,23 @@ test_expect_success 'basic usage requires no repo' '
38 test_i18ngrep ^usage: output
39 '
40
41 -# Create a file on master and change it on branch
41 +# Create a file on main and change it on branch
42 test_expect_success 'setup' '
43 - echo master >file &&
43 + echo main >file &&
44 git add file &&
45 git commit -m "added file" &&
46
47 - git checkout -b branch master &&
47 + git checkout -b branch main &&
48 echo branch >file &&
49 git commit -a -m "branch changed file" &&
50 - git checkout master
50 + git checkout main
51 '
52
53 # Configure a custom difftool.<tool>.cmd and use it
54 test_expect_success 'custom commands' '
55 difftool_test_setup &&
56 test_config difftool.test-tool.cmd "cat \"\$REMOTE\"" &&
57 - echo master >expect &&
57 + echo main >expect &&
58 git difftool --no-prompt branch >actual &&
59 test_cmp expect actual &&
60
@@ -66,7 +66,7 @@ test_expect_success 'custom commands' '
66
67 test_expect_success 'custom tool commands override built-ins' '
68 test_config difftool.vimdiff.cmd "cat \"\$REMOTE\"" &&
69 - echo master >expect &&
69 + echo main >expect &&
70 git difftool --tool vimdiff --no-prompt branch >actual &&
71 test_cmp expect actual
72 '
@@ -314,21 +314,21 @@ test_expect_success 'difftool.<tool>.path' '
314
315 test_expect_success 'difftool --extcmd=cat' '
316 echo branch >expect &&
317 - echo master >>expect &&
317 + echo main >>expect &&
318 git difftool --no-prompt --extcmd=cat branch >actual &&
319 test_cmp expect actual
320 '
321
322 test_expect_success 'difftool --extcmd cat' '
323 echo branch >expect &&
324 - echo master >>expect &&
324 + echo main >>expect &&
325 git difftool --no-prompt --extcmd=cat branch >actual &&
326 test_cmp expect actual
327 '
328
329 test_expect_success 'difftool -x cat' '
330 echo branch >expect &&
331 - echo master >>expect &&
331 + echo main >>expect &&
332 git difftool --no-prompt -x cat branch >actual &&
333 test_cmp expect actual
334 '
@@ -341,7 +341,7 @@ test_expect_success 'difftool --extcmd echo arg1' '
341 '
342
343 test_expect_success 'difftool --extcmd cat arg1' '
344 - echo master >expect &&
344 + echo main >expect &&
345 git difftool --no-prompt \
346 --extcmd sh\ -c\ \"cat\ \$1\" branch >actual &&
347 test_cmp expect actual
@@ -354,7 +354,7 @@ test_expect_success 'difftool --extcmd cat arg2' '
354 test_cmp expect actual
355 '
356
357 -# Create a second file on master and a different version on branch
357 +# Create a second file on main and a different version on branch
358 test_expect_success 'setup with 2 files different' '
359 echo m2 >file2 &&
360 git add file2 &&
@@ -364,7 +364,7 @@ test_expect_success 'setup with 2 files different' '
364 echo br2 >file2 &&
365 git add file2 &&
366 git commit -a -m "branch changed file2" &&
367 - git checkout master
367 + git checkout main
368 '
369
370 test_expect_success 'say no to the first file' '
@@ -372,14 +372,14 @@ test_expect_success 'say no to the first file' '
372 git difftool -x cat branch <input >output &&
373 grep m2 output &&
374 grep br2 output &&
375 - ! grep master output &&
375 + ! grep main output &&
376 ! grep branch output
377 '
378
379 test_expect_success 'say no to the second file' '
380 (echo && echo n) >input &&
381 git difftool -x cat branch <input >output &&
382 - grep master output &&
382 + grep main output &&
383 grep branch output &&
384 ! grep m2 output &&
385 ! grep br2 output
@@ -387,7 +387,7 @@ test_expect_success 'say no to the second file' '
387
388 test_expect_success 'ending prompt input with EOF' '
389 git difftool -x cat branch </dev/null >output &&
390 - ! grep master output &&
390 + ! grep main output &&
391 ! grep branch output &&
392 ! grep m2 output &&
393 ! grep br2 output
@@ -399,9 +399,9 @@ test_expect_success 'difftool --tool-help' '
399 '
400
401 test_expect_success 'setup change in subdirectory' '
402 - git checkout master &&
402 + git checkout main &&
403 mkdir sub &&
404 - echo master >sub/sub &&
404 + echo main >sub/sub &&
405 git add sub/sub &&
406 git commit -m "added sub/sub" &&
407 git tag v1 &&
@@ -529,7 +529,7 @@ run_dir_diff_test 'difftool --dir-diff from subdirectory with GIT_DIR set' '
529 run_dir_diff_test 'difftool --dir-diff when worktree file is missing' '
530 test_when_finished git reset --hard &&
531 rm file2 &&
532 - git difftool --dir-diff $symlinks --extcmd ls branch master >output &&
532 + git difftool --dir-diff $symlinks --extcmd ls branch main >output &&
533 grep file2 output
534 '
535
@@ -546,7 +546,7 @@ run_dir_diff_test 'difftool --dir-diff with unmerged files' '
546 echo b >>file &&
547 git add file &&
548 git commit -m conflict-b &&
549 - git checkout master &&
549 + git checkout main &&
550 git merge conflict-a &&
551 test_must_fail git merge conflict-b &&
552 cat >expect <<-EOF &&
t/t7810-grep.sh
+15 -15
@@ -6,7 +6,7 @@
6 test_description='git grep various.
7 '
8
9 -GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
9 +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
10 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
11
12 . ./test-lib.sh
@@ -1209,19 +1209,19 @@ test_expect_success 'grep -e -- -- path' '
1209 '
1210
1211 test_expect_success 'dashdash disambiguates rev as rev' '
1212 - test_when_finished "rm -f master" &&
1213 - echo content >master &&
1214 - echo master:hello.c >expect &&
1215 - git grep -l o master -- hello.c >actual &&
1212 + test_when_finished "rm -f main" &&
1213 + echo content >main &&
1214 + echo main:hello.c >expect &&
1215 + git grep -l o main -- hello.c >actual &&
1216 test_cmp expect actual
1217 '
1218
1219 test_expect_success 'dashdash disambiguates pathspec as pathspec' '
1220 - test_when_finished "git rm -f master" &&
1221 - echo content >master &&
1222 - git add master &&
1223 - echo master:content >expect &&
1224 - git grep o -- master >actual &&
1220 + test_when_finished "git rm -f main" &&
1221 + echo content >main &&
1222 + git add main &&
1223 + echo main:content >expect &&
1224 + git grep o -- main >actual &&
1225 test_cmp expect actual
1226 '
1227
@@ -1257,15 +1257,15 @@ test_expect_success 'grep --no-index pattern -- path' '
1257 '
1258
1259 test_expect_success 'grep --no-index complains of revs' '
1260 - test_must_fail git grep --no-index o master -- 2>err &&
1260 + test_must_fail git grep --no-index o main -- 2>err &&
1261 test_i18ngrep "cannot be used with revs" err
1262 '
1263
1264 test_expect_success 'grep --no-index prefers paths to revs' '
1265 - test_when_finished "rm -f master" &&
1266 - echo content >master &&
1267 - echo master:content >expect &&
1268 - git grep --no-index o master >actual &&
1265 + test_when_finished "rm -f main" &&
1266 + echo content >main &&
1267 + echo main:content >expect &&
1268 + git grep --no-index o main >actual &&
1269 test_cmp expect actual
1270 '
1271