t7[0-4]*: adjust the references to the default branch name "main"

Carefully excluding t7064, which sees independent development elsewhere at the time of writing, we use `main` as the default branch name in t7[0-4]*. 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[0-4]*.sh && git checkout HEAD -- t7064\*) 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 01dc81336dc10c8f2350454c755a8a0ab676a9c9
14 files changed +169 -169
t/t7003-filter-branch.sh
+21 -21
@@ -1,7 +1,7 @@
1 #!/bin/sh
2
3 test_description='git filter-branch'
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
@@ -16,7 +16,7 @@ test_expect_success 'setup' '
16 mkdir dir &&
17 test_commit dir/D &&
18 test_commit E &&
19 - git checkout master &&
19 + git checkout main &&
20 test_commit C &&
21 git checkout branch &&
22 git merge C &&
@@ -28,7 +28,7 @@ test_expect_success 'setup' '
28 # * G
29 # * Merge commit 'C' into branch
30 # |\
31 -# | * (master) C
31 +# | * (main) C
32 # * | E
33 # * | dir/D
34 # * | D
@@ -165,15 +165,15 @@ test_expect_success 'subdirectory filter result looks okay' '
165 '
166
167 test_expect_success 'more setup' '
168 - git checkout master &&
168 + git checkout main &&
169 mkdir subdir &&
170 echo A > subdir/new &&
171 git add subdir/new &&
172 test_tick &&
173 - git commit -m "subdir on master" subdir/new &&
173 + git commit -m "subdir on main" subdir/new &&
174 git rm A.t &&
175 test_tick &&
176 - git commit -m "again subdir on master" &&
176 + git commit -m "again subdir on main" &&
177 git merge branch
178 '
179
@@ -202,7 +202,7 @@ test_expect_success 'author information is preserved' '
202 git branch preserved-author &&
203 (sane_unset GIT_AUTHOR_NAME &&
204 git filter-branch -f --msg-filter "cat; \
205 - test \$GIT_COMMIT != $(git rev-parse master) || \
205 + test \$GIT_COMMIT != $(git rev-parse main) || \
206 echo Hallo" \
207 preserved-author) &&
208 git rev-list --author="B V Uips" preserved-author >actual &&
@@ -221,7 +221,7 @@ test_expect_success "remove a certain author's commits" '
221 else\
222 git commit-tree \"\$@\";\
223 fi" removed-author &&
224 - cnt1=$(git rev-list master | wc -l) &&
224 + cnt1=$(git rev-list main | wc -l) &&
225 cnt2=$(git rev-list removed-author | wc -l) &&
226 test $cnt1 -eq $(($cnt2 + 1)) &&
227 git rev-list --author="B V Uips" removed-author >actual &&
@@ -229,7 +229,7 @@ test_expect_success "remove a certain author's commits" '
229 '
230
231 test_expect_success 'barf on invalid name' '
232 - test_must_fail git filter-branch -f master xy-problem &&
232 + test_must_fail git filter-branch -f main xy-problem &&
233 test_must_fail git filter-branch -f HEAD^
234 '
235
@@ -239,8 +239,8 @@ test_expect_success '"map" works in commit filter' '
239 mapped=\$(map \$parent) &&
240 actual=\$(echo \"\$@\" | sed \"s/^.*-p //\") &&
241 test \$mapped = \$actual &&
242 - git commit-tree \"\$@\";" master~2..master &&
243 - git rev-parse --verify master
242 + git commit-tree \"\$@\";" main~2..main &&
243 + git rev-parse --verify main
244 '
245
246 test_expect_success 'Name needing quotes' '
@@ -259,7 +259,7 @@ test_expect_success 'Name needing quotes' '
259
260 test_expect_success 'Subdirectory filter with disappearing trees' '
261 git reset --hard &&
262 - git checkout master &&
262 + git checkout main &&
263
264 mkdir foo &&
265 touch foo/bar &&
@@ -278,7 +278,7 @@ test_expect_success 'Subdirectory filter with disappearing trees' '
278 git commit -m "Re-adding foo" &&
279
280 git filter-branch -f --subdirectory-filter foo &&
281 - git rev-list master >actual &&
281 + git rev-list main >actual &&
282 test_line_count = 3 actual
283 '
284
@@ -335,7 +335,7 @@ test_expect_success 'Tag name filtering allows slashes in tag names' '
335 test_cmp expect actual
336 '
337 test_expect_success 'setup --prune-empty comparisons' '
338 - git checkout --orphan master-no-a &&
338 + git checkout --orphan main-no-a &&
339 git rm -rf . &&
340 unset test_tick &&
341 test_tick &&
@@ -346,7 +346,7 @@ test_expect_success 'setup --prune-empty comparisons' '
346 mkdir dir &&
347 test_commit dir/D dir/D.t dir/D dir/Dx &&
348 test_commit E E.t E Ex &&
349 - git checkout master-no-a &&
349 + git checkout main-no-a &&
350 test_commit C C.t C Cx &&
351 git checkout branch-no-a &&
352 git merge Cx -m "Merge tag '\''C'\'' into branch" &&
@@ -400,7 +400,7 @@ test_expect_success '--prune-empty is able to prune entire branch' '
400 '
401
402 test_expect_success '--remap-to-ancestor with filename filters' '
403 - git checkout master &&
403 + git checkout main &&
404 git reset --hard A &&
405 test_commit add-foo foo 1 &&
406 git branch moved-foo &&
@@ -410,15 +410,15 @@ test_expect_success '--remap-to-ancestor with filename filters' '
410 git branch moved-bar &&
411 test_commit change-foo foo 2 &&
412 git filter-branch -f --remap-to-ancestor \
413 - moved-foo moved-bar A..master \
413 + moved-foo moved-bar A..main \
414 -- -- foo &&
415 test $(git rev-parse moved-foo) = $(git rev-parse moved-bar) &&
416 - test $(git rev-parse moved-foo) = $(git rev-parse master^) &&
416 + test $(git rev-parse moved-foo) = $(git rev-parse main^) &&
417 test $orig_invariant = $(git rev-parse invariant)
418 '
419
420 test_expect_success 'automatic remapping to ancestor with filename filters' '
421 - git checkout master &&
421 + git checkout main &&
422 git reset --hard A &&
423 test_commit add-foo2 foo 1 &&
424 git branch moved-foo2 &&
@@ -428,10 +428,10 @@ test_expect_success 'automatic remapping to ancestor with filename filters' '
428 git branch moved-bar2 &&
429 test_commit change-foo2 foo 2 &&
430 git filter-branch -f \
431 - moved-foo2 moved-bar2 A..master \
431 + moved-foo2 moved-bar2 A..main \
432 -- -- foo &&
433 test $(git rev-parse moved-foo2) = $(git rev-parse moved-bar2) &&
434 - test $(git rev-parse moved-foo2) = $(git rev-parse master^) &&
434 + test $(git rev-parse moved-foo2) = $(git rev-parse main^) &&
435 test $orig_invariant = $(git rev-parse invariant2)
436 '
437
t/t7004-tag.sh
+5 -5
@@ -7,7 +7,7 @@ test_description='git tag
7
8 Tests for operations with tags.'
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
@@ -1586,7 +1586,7 @@ test_expect_success 'checking that branch head with --no-contains lists all but
1586 "
1587
1588 test_expect_success 'merging original branch into this branch' '
1589 - git merge --strategy=ours master &&
1589 + git merge --strategy=ours main &&
1590 git tag v4.0
1591 '
1592
@@ -1947,15 +1947,15 @@ test_expect_success ULIMIT_STACK_SIZE '--contains and --no-contains work in a de
1947 i=1 &&
1948 while test $i -lt 8000
1949 do
1950 - echo "commit refs/heads/master
1950 + echo "commit refs/heads/main
1951 committer A U Thor <author@example.com> $((1000000000 + $i * 100)) +0200
1952 data <<EOF
1953 commit #$i
1954 EOF"
1955 - test $i = 1 && echo "from refs/heads/master^0"
1955 + test $i = 1 && echo "from refs/heads/main^0"
1956 i=$(($i + 1))
1957 done | git fast-import &&
1958 - git checkout master &&
1958 + git checkout main &&
1959 git tag far-far-away HEAD^ &&
1960 run_with_limited_stack git tag --contains HEAD >actual &&
1961 test_must_be_empty actual &&
t/t7030-verify-tag.sh
+2 -2
@@ -1,7 +1,7 @@
1 #!/bin/sh
2
3 test_description='signed tag 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
@@ -20,7 +20,7 @@ test_expect_success GPG 'create signed tags' '
20 echo 3 >elif && git add elif &&
21 test_tick && git commit -m "third on side" &&
22
23 - git checkout master &&
23 + git checkout main &&
24 test_tick && git merge -S side &&
25 git tag -s -m merge merge &&
26
t/t7060-wtstatus.sh
+14 -14
@@ -2,7 +2,7 @@
2
3 test_description='basic work tree status reporting'
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
@@ -54,7 +54,7 @@ EOF
54 git checkout -b side HEAD^ &&
55 git rm foo &&
56 git commit -m delete &&
57 - test_must_fail git merge master &&
57 + test_must_fail git merge main &&
58 test_must_fail git commit --dry-run >../actual &&
59 test_i18ncmp ../expect ../actual &&
60 git status >../actual &&
@@ -127,18 +127,18 @@ test_expect_success 'git diff-index --cached -C shows 2 copies + 1 unmerged' '
127
128 test_expect_success 'status when conflicts with add and rm advice (deleted by them)' '
129 git reset --hard &&
130 - git checkout master &&
130 + git checkout main &&
131 test_commit init main.txt init &&
132 git checkout -b second_branch &&
133 git rm main.txt &&
134 git commit -m "main.txt deleted on second_branch" &&
135 test_commit second conflict.txt second &&
136 - git checkout master &&
136 + git checkout main &&
137 test_commit on_second main.txt on_second &&
138 - test_commit master conflict.txt master &&
138 + test_commit main conflict.txt main &&
139 test_must_fail git merge second_branch &&
140 cat >expected <<\EOF &&
141 -On branch master
141 +On branch main
142 You have unmerged paths.
143 (fix conflicts and run "git commit")
144 (use "git merge --abort" to abort the merge)
@@ -160,8 +160,8 @@ test_expect_success 'prepare for conflicts' '
160 git checkout -b conflict &&
161 test_commit one main.txt one &&
162 git branch conflict_second &&
163 - git mv main.txt sub_master.txt &&
164 - git commit -m "main.txt renamed in sub_master.txt" &&
163 + git mv main.txt sub_main.txt &&
164 + git commit -m "main.txt renamed in sub_main.txt" &&
165 git checkout conflict_second &&
166 git mv main.txt sub_second.txt &&
167 git commit -m "main.txt renamed in sub_second.txt"
@@ -179,7 +179,7 @@ You have unmerged paths.
179 Unmerged paths:
180 (use "git add/rm <file>..." as appropriate to mark resolution)
181 both deleted: main.txt
182 - added by them: sub_master.txt
182 + added by them: sub_main.txt
183 added by us: sub_second.txt
184
185 no changes added to commit (use "git add" and/or "git commit -a")
@@ -192,7 +192,7 @@ EOF
192 test_expect_success 'status when conflicts with only rm advice (both deleted)' '
193 git reset --hard conflict_second &&
194 test_must_fail git merge conflict &&
195 - git add sub_master.txt &&
195 + git add sub_main.txt &&
196 git add sub_second.txt &&
197 cat >expected <<\EOF &&
198 On branch conflict_second
@@ -201,7 +201,7 @@ You have unmerged paths.
201 (use "git merge --abort" to abort the merge)
202
203 Changes to be committed:
204 - new file: sub_master.txt
204 + new file: sub_main.txt
205
206 Unmerged paths:
207 (use "git rm <file>..." to mark resolution)
@@ -212,12 +212,12 @@ EOF
212 git status --untracked-files=no >actual &&
213 test_i18ncmp expected actual &&
214 git reset --hard &&
215 - git checkout master
215 + git checkout main
216 '
217
218 test_expect_success 'status --branch with detached HEAD' '
219 git reset --hard &&
220 - git checkout master^0 &&
220 + git checkout main^0 &&
221 git status --branch --porcelain >actual &&
222 cat >expected <<-EOF &&
223 ## HEAD (no branch)
@@ -233,7 +233,7 @@ test_expect_success 'status --branch with detached HEAD' '
233 ## Duplicate the above test and verify --porcelain=v1 arg parsing.
234 test_expect_success 'status --porcelain=v1 --branch with detached HEAD' '
235 git reset --hard &&
236 - git checkout master^0 &&
236 + git checkout main^0 &&
237 git status --branch --porcelain=v1 >actual &&
238 cat >expected <<-EOF &&
239 ## HEAD (no branch)
t/t7063-status-untracked-cache.sh
+8 -8
@@ -2,7 +2,7 @@
2
3 test_description='test untracked cache'
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
@@ -478,7 +478,7 @@ EOF
478 test_expect_success 'set up sparse checkout' '
479 echo "done/[a-z]*" >.git/info/sparse-checkout &&
480 test_config core.sparsecheckout true &&
481 - git checkout master &&
481 + git checkout main &&
482 git update-index --force-untracked-cache &&
483 git status --porcelain >/dev/null && # prime the cache
484 test_path_is_missing done/.gitignore &&
@@ -737,13 +737,13 @@ test_expect_success 'test ident field is working' '
737 test_expect_success 'untracked cache survives a checkout' '
738 git commit --allow-empty -m empty &&
739 test-tool dump-untracked-cache >../before &&
740 - test_when_finished "git checkout master" &&
740 + test_when_finished "git checkout main" &&
741 git checkout -b other_branch &&
742 test-tool dump-untracked-cache >../after &&
743 test_cmp ../before ../after &&
744 test_commit test &&
745 test-tool dump-untracked-cache >../before &&
746 - git checkout master &&
746 + git checkout main &&
747 test-tool dump-untracked-cache >../after &&
748 test_cmp ../before ../after
749 '
@@ -778,7 +778,7 @@ test_expect_success SYMLINKS '"status" after symlink replacement should be clean
778 git checkout HEAD~ &&
779 status_is_clean &&
780 status_is_clean &&
781 - git checkout master &&
781 + git checkout main &&
782 avoid_racy &&
783 status_is_clean &&
784 status_is_clean
@@ -789,7 +789,7 @@ test_expect_success SYMLINKS '"status" after symlink replacement should be clean
789 git checkout HEAD~ &&
790 status_is_clean &&
791 status_is_clean &&
792 - git checkout master &&
792 + git checkout main &&
793 avoid_racy &&
794 status_is_clean &&
795 status_is_clean
@@ -813,7 +813,7 @@ test_expect_success '"status" after file replacement should be clean with UC=tru
813 git checkout HEAD~ &&
814 status_is_clean &&
815 status_is_clean &&
816 - git checkout master &&
816 + git checkout main &&
817 avoid_racy &&
818 status_is_clean &&
819 test-tool dump-untracked-cache >../actual &&
@@ -831,7 +831,7 @@ test_expect_success '"status" after file replacement should be clean with UC=fal
831 git checkout HEAD~ &&
832 status_is_clean &&
833 status_is_clean &&
834 - git checkout master &&
834 + git checkout main &&
835 avoid_racy &&
836 status_is_clean &&
837 status_is_clean
t/t7102-reset.sh
+4 -4
@@ -7,7 +7,7 @@ test_description='git reset
7
8 Documented tests for git reset'
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
@@ -148,7 +148,7 @@ test_expect_success 'trying to do reset --soft with pending merge should fail' '
148 printf "1st line 2nd file\n2nd line 2nd file\n3rd line" >secondfile &&
149 git commit -a -m "the change in branch2" &&
150
151 - git checkout master &&
151 + git checkout main &&
152 git branch -D branch1 branch2 &&
153 check_changes $head5
154 '
@@ -170,7 +170,7 @@ test_expect_success 'trying to do reset --soft with pending checkout merge shoul
170 printf "1st line 2nd file\n2nd line 2nd file\n3rd line" >secondfile &&
171 git commit -a -m "the line in branch3" &&
172
173 - git checkout master &&
173 + git checkout main &&
174 git branch -D branch3 branch4 &&
175 check_changes $head5
176 '
@@ -383,7 +383,7 @@ test_expect_success '--hard reset to ORIG_HEAD should clear a fast-forward merge
383 git reset --hard ORIG_HEAD &&
384 check_changes $head5 &&
385
386 - git checkout master &&
386 + git checkout main &&
387 git branch -D branch1 branch2 &&
388 check_changes $head5
389 '
t/t7113-post-index-change-hook.sh
+2 -2
@@ -2,7 +2,7 @@
2
3 test_description='post index change 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
@@ -88,7 +88,7 @@ test_expect_success 'test checkout and reset trigger the hook' '
88 EOF
89 : force index to be dirty &&
90 test-tool chmtime +60 dir1/file1.txt &&
91 - git checkout master &&
91 + git checkout main &&
92 test_path_is_file testsuccess && rm -f testsuccess &&
93 test_path_is_missing testfailure &&
94 test-tool chmtime +60 dir1/file1.txt &&
t/t7201-co.sh
+56 -56
@@ -5,10 +5,10 @@
5
6 test_description='git checkout tests.
7
8 -Creates master, forks renamer and side branches from it.
8 +Creates main, forks renamer and side branches from it.
9 Test switching across them.
10
11 - ! [master] Initial A one, A two
11 + ! [main] Initial A one, A two
12 * [renamer] Renamer R one->uno, M two
13 ! [side] Side M one, D two, A three
14 ! [simple] Simple D one, M two
@@ -16,11 +16,11 @@ Test switching across them.
16 + [simple] Simple D one, M two
17 + [side] Side M one, D two, A three
18 * [renamer] Renamer R one->uno, M two
19 - +*++ [master] Initial A one, A two
19 + +*++ [main] Initial A one, A two
20
21 '
22
23 -GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
23 +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
24 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
25
26 . ./test-lib.sh
@@ -49,27 +49,27 @@ test_expect_success setup '
49 fill a b c d e f >two &&
50 git commit -a -m "Renamer R one->uno, M two" &&
51
52 - git checkout -b side master &&
52 + git checkout -b side main &&
53 fill 1 2 3 4 5 6 7 >one &&
54 fill A B C D E >three &&
55 rm -f two &&
56 git update-index --add --remove one two three &&
57 git commit -m "Side M one, D two, A three" &&
58
59 - git checkout -b simple master &&
59 + git checkout -b simple main &&
60 rm -f one &&
61 fill a c e >two &&
62 git commit -a -m "Simple D one, M two" &&
63
64 - git checkout master
64 + git checkout main
65 '
66
67 test_expect_success 'checkout from non-existing branch' '
68 - git checkout -b delete-me master &&
68 + git checkout -b delete-me main &&
69 git update-ref -d --no-deref refs/heads/delete-me &&
70 test refs/heads/delete-me = "$(git symbolic-ref HEAD)" &&
71 - git checkout master &&
72 - test refs/heads/master = "$(git symbolic-ref HEAD)"
71 + git checkout main &&
72 + test refs/heads/main = "$(git symbolic-ref HEAD)"
73 '
74
75 test_expect_success 'checkout with dirty tree without -m' '
@@ -84,7 +84,7 @@ test_expect_success 'checkout with dirty tree without -m' '
84 '
85
86 test_expect_success 'checkout with unrelated dirty tree without -m' '
87 - git checkout -f master &&
87 + git checkout -f main &&
88 fill 0 1 2 3 4 5 6 7 8 >same &&
89 cp same kept &&
90 git checkout side >messages &&
@@ -94,7 +94,7 @@ test_expect_success 'checkout with unrelated dirty tree without -m' '
94 '
95
96 test_expect_success 'checkout -m with dirty tree' '
97 - git checkout -f master &&
97 + git checkout -f main &&
98 git clean -f &&
99
100 fill 0 1 2 3 4 5 6 7 8 >one &&
@@ -105,9 +105,9 @@ test_expect_success 'checkout -m with dirty tree' '
105 printf "M\t%s\n" one >expect.messages &&
106 test_cmp expect.messages messages &&
107
108 - fill "M one" "A three" "D two" >expect.master &&
109 - git diff --name-status master >current.master &&
110 - test_cmp expect.master current.master &&
108 + fill "M one" "A three" "D two" >expect.main &&
109 + git diff --name-status main >current.main &&
110 + test_cmp expect.main current.main &&
111
112 fill "M one" >expect.side &&
113 git diff --name-status side >current.side &&
@@ -118,7 +118,7 @@ test_expect_success 'checkout -m with dirty tree' '
118 '
119
120 test_expect_success 'checkout -m with dirty tree, renamed' '
121 - git checkout -f master && git clean -f &&
121 + git checkout -f main && git clean -f &&
122
123 fill 1 2 3 4 5 7 8 >one &&
124 if git checkout renamer
@@ -138,7 +138,7 @@ test_expect_success 'checkout -m with dirty tree, renamed' '
138 '
139
140 test_expect_success 'checkout -m with merge conflict' '
141 - git checkout -f master && git clean -f &&
141 + git checkout -f main && git clean -f &&
142
143 fill 1 T 3 4 5 6 S 8 >one &&
144 if git checkout renamer
@@ -151,7 +151,7 @@ test_expect_success 'checkout -m with merge conflict' '
151
152 git checkout -m renamer &&
153
154 - git diff master:one :3:uno |
154 + git diff main:one :3:uno |
155 sed -e "1,/^@@/d" -e "/^ /d" -e "s/^-/d/" -e "s/^+/a/" >current &&
156 fill d2 aT d7 aS >expect &&
157 test_cmp expect current &&
@@ -160,7 +160,7 @@ test_expect_success 'checkout -m with merge conflict' '
160 '
161
162 test_expect_success 'format of merge conflict from checkout -m' '
163 - git checkout -f master &&
163 + git checkout -f main &&
164 git clean -f &&
165
166 fill b d >two &&
@@ -184,7 +184,7 @@ test_expect_success 'format of merge conflict from checkout -m' '
184 '
185
186 test_expect_success 'checkout --merge --conflict=diff3 <branch>' '
187 - git checkout -f master &&
187 + git checkout -f main &&
188 git reset --hard &&
189 git clean -f &&
190
@@ -196,7 +196,7 @@ test_expect_success 'checkout --merge --conflict=diff3 <branch>' '
196 a
197 c
198 e
199 - ||||||| master
199 + ||||||| main
200 a
201 b
202 c
@@ -211,7 +211,7 @@ test_expect_success 'checkout --merge --conflict=diff3 <branch>' '
211 '
212
213 test_expect_success 'switch to another branch while carrying a deletion' '
214 - git checkout -f master &&
214 + git checkout -f main &&
215 git reset --hard &&
216 git clean -f &&
217 git rm two &&
@@ -232,7 +232,7 @@ test_expect_success 'checkout to detach HEAD (with advice declined)' '
232 test_i18ngrep "HEAD is now at $rev" messages &&
233 test_line_count = 1 messages &&
234 H=$(git rev-parse --verify HEAD) &&
235 - M=$(git show-ref -s --verify refs/heads/master) &&
235 + M=$(git show-ref -s --verify refs/heads/main) &&
236 test "z$H" = "z$M" &&
237 if git symbolic-ref HEAD >/dev/null 2>&1
238 then
@@ -252,7 +252,7 @@ test_expect_success 'checkout to detach HEAD' '
252 grep "HEAD is now at $rev" messages &&
253 test_line_count -gt 1 messages &&
254 H=$(git rev-parse --verify HEAD) &&
255 - M=$(git show-ref -s --verify refs/heads/master) &&
255 + M=$(git show-ref -s --verify refs/heads/main) &&
256 test "z$H" = "z$M" &&
257 if git symbolic-ref HEAD >/dev/null 2>&1
258 then
@@ -264,11 +264,11 @@ test_expect_success 'checkout to detach HEAD' '
264 '
265
266 test_expect_success 'checkout to detach HEAD with branchname^' '
267 - git checkout -f master &&
267 + git checkout -f main &&
268 git clean -f &&
269 git checkout renamer^ &&
270 H=$(git rev-parse --verify HEAD) &&
271 - M=$(git show-ref -s --verify refs/heads/master) &&
271 + M=$(git show-ref -s --verify refs/heads/main) &&
272 test "z$H" = "z$M" &&
273 if git symbolic-ref HEAD >/dev/null 2>&1
274 then
@@ -280,11 +280,11 @@ test_expect_success 'checkout to detach HEAD with branchname^' '
280 '
281
282 test_expect_success 'checkout to detach HEAD with :/message' '
283 - git checkout -f master &&
283 + git checkout -f main &&
284 git clean -f &&
285 git checkout ":/Initial" &&
286 H=$(git rev-parse --verify HEAD) &&
287 - M=$(git show-ref -s --verify refs/heads/master) &&
287 + M=$(git show-ref -s --verify refs/heads/main) &&
288 test "z$H" = "z$M" &&
289 if git symbolic-ref HEAD >/dev/null 2>&1
290 then
@@ -296,11 +296,11 @@ test_expect_success 'checkout to detach HEAD with :/message' '
296 '
297
298 test_expect_success 'checkout to detach HEAD with HEAD^0' '
299 - git checkout -f master &&
299 + git checkout -f main &&
300 git clean -f &&
301 git checkout HEAD^0 &&
302 H=$(git rev-parse --verify HEAD) &&
303 - M=$(git show-ref -s --verify refs/heads/master) &&
303 + M=$(git show-ref -s --verify refs/heads/main) &&
304 test "z$H" = "z$M" &&
305 if git symbolic-ref HEAD >/dev/null 2>&1
306 then
@@ -313,13 +313,13 @@ test_expect_success 'checkout to detach HEAD with HEAD^0' '
313
314 test_expect_success 'checkout with ambiguous tag/branch names' '
315 git tag both side &&
316 - git branch both master &&
316 + git branch both main &&
317 git reset --hard &&
318 - git checkout master &&
318 + git checkout main &&
319
320 git checkout both &&
321 H=$(git rev-parse --verify HEAD) &&
322 - M=$(git show-ref -s --verify refs/heads/master) &&
322 + M=$(git show-ref -s --verify refs/heads/main) &&
323 test "z$H" = "z$M" &&
324 name=$(git symbolic-ref HEAD 2>/dev/null) &&
325 test "z$name" = zrefs/heads/both
@@ -327,12 +327,12 @@ test_expect_success 'checkout with ambiguous tag/branch names' '
327
328 test_expect_success 'checkout with ambiguous tag/branch names' '
329 git reset --hard &&
330 - git checkout master &&
330 + git checkout main &&
331
332 git tag frotz side &&
333 - git branch frotz master &&
333 + git branch frotz main &&
334 git reset --hard &&
335 - git checkout master &&
335 + git checkout main &&
336
337 git checkout tags/frotz &&
338 H=$(git rev-parse --verify HEAD) &&
@@ -349,7 +349,7 @@ test_expect_success 'checkout with ambiguous tag/branch names' '
349
350 test_expect_success 'switch branches while in subdirectory' '
351 git reset --hard &&
352 - git checkout master &&
352 + git checkout main &&
353
354 mkdir subs &&
355 git -C subs checkout side &&
@@ -365,7 +365,7 @@ test_expect_success 'checkout specific path while in subdirectory' '
365 git add subs/bero &&
366 git commit -m "add subs/bero" &&
367
368 - git checkout master &&
368 + git checkout main &&
369 mkdir -p subs &&
370 git -C subs checkout side -- bero &&
371 test -f subs/bero
@@ -373,7 +373,7 @@ test_expect_success 'checkout specific path while in subdirectory' '
373
374 test_expect_success 'checkout w/--track sets up tracking' '
375 git config branch.autosetupmerge false &&
376 - git checkout master &&
376 + git checkout main &&
377 git checkout --track -b track1 &&
378 test "$(git config branch.track1.remote)" &&
379 test "$(git config branch.track1.merge)"
@@ -382,40 +382,40 @@ test_expect_success 'checkout w/--track sets up tracking' '
382 test_expect_success 'checkout w/autosetupmerge=always sets up tracking' '
383 test_when_finished git config branch.autosetupmerge false &&
384 git config branch.autosetupmerge always &&
385 - git checkout master &&
385 + git checkout main &&
386 git checkout -b track2 &&
387 test "$(git config branch.track2.remote)" &&
388 test "$(git config branch.track2.merge)"
389 '
390
391 test_expect_success 'checkout w/--track from non-branch HEAD fails' '
392 - git checkout master^0 &&
392 + git checkout main^0 &&
393 test_must_fail git symbolic-ref HEAD &&
394 test_must_fail git checkout --track -b track &&
395 test_must_fail git rev-parse --verify track &&
396 test_must_fail git symbolic-ref HEAD &&
397 - test "z$(git rev-parse master^0)" = "z$(git rev-parse HEAD)"
397 + test "z$(git rev-parse main^0)" = "z$(git rev-parse HEAD)"
398 '
399
400 test_expect_success 'checkout w/--track from tag fails' '
401 - git checkout master^0 &&
401 + git checkout main^0 &&
402 test_must_fail git symbolic-ref HEAD &&
403 test_must_fail git checkout --track -b track frotz &&
404 test_must_fail git rev-parse --verify track &&
405 test_must_fail git symbolic-ref HEAD &&
406 - test "z$(git rev-parse master^0)" = "z$(git rev-parse HEAD)"
406 + test "z$(git rev-parse main^0)" = "z$(git rev-parse HEAD)"
407 '
408
409 test_expect_success 'detach a symbolic link HEAD' '
410 - git checkout master &&
410 + git checkout main &&
411 git config --bool core.prefersymlinkrefs yes &&
412 git checkout side &&
413 - git checkout master &&
413 + git checkout main &&
414 it=$(git symbolic-ref HEAD) &&
415 - test "z$it" = zrefs/heads/master &&
416 - here=$(git rev-parse --verify refs/heads/master) &&
415 + test "z$it" = zrefs/heads/main &&
416 + here=$(git rev-parse --verify refs/heads/main) &&
417 git checkout side^ &&
418 - test "z$(git rev-parse --verify refs/heads/master)" = "z$here"
418 + test "z$(git rev-parse --verify refs/heads/main)" = "z$here"
419 '
420
421 test_expect_success 'checkout with --track fakes a sensible -b <name>' '
@@ -426,13 +426,13 @@ test_expect_success 'checkout with --track fakes a sensible -b <name>' '
426 test "refs/heads/koala/bear" = "$(git symbolic-ref HEAD)" &&
427 test "$(git rev-parse HEAD)" = "$(git rev-parse renamer)" &&
428
429 - git checkout master && git branch -D koala/bear &&
429 + git checkout main && git branch -D koala/bear &&
430
431 git checkout --track refs/remotes/origin/koala/bear &&
432 test "refs/heads/koala/bear" = "$(git symbolic-ref HEAD)" &&
433 test "$(git rev-parse HEAD)" = "$(git rev-parse renamer)" &&
434
435 - git checkout master && git branch -D koala/bear &&
435 + git checkout main && git branch -D koala/bear &&
436
437 git checkout --track remotes/origin/koala/bear &&
438 test "refs/heads/koala/bear" = "$(git symbolic-ref HEAD)" &&
@@ -585,17 +585,17 @@ test_expect_success 'checkout --conflict=diff3' '
585 '
586
587 test_expect_success 'failing checkout -b should not break working tree' '
588 - git reset --hard master &&
589 - git symbolic-ref HEAD refs/heads/master &&
588 + git reset --hard main &&
589 + git symbolic-ref HEAD refs/heads/main &&
590 test_must_fail git checkout -b renamer side^ &&
591 - test $(git symbolic-ref HEAD) = refs/heads/master &&
591 + test $(git symbolic-ref HEAD) = refs/heads/main &&
592 git diff --exit-code &&
593 git diff --cached --exit-code
594 '
595
596 test_expect_success 'switch out of non-branch' '
597 - git reset --hard master &&
598 - git checkout master^0 &&
597 + git reset --hard main &&
598 + git checkout main^0 &&
599 echo modified >one &&
600 test_must_fail git checkout renamer 2>error.log &&
601 ! grep "^Previous HEAD" error.log
t/t7400-submodule-basic.sh
+11 -11
@@ -9,7 +9,7 @@ This test tries to verify basic sanity of the init, update and status
9 subcommands of git submodule.
10 '
11
12 -GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
12 +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
13 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
14
15 . ./test-lib.sh
@@ -127,7 +127,7 @@ inspect() {
127 }
128
129 test_expect_success 'submodule add' '
130 - echo "refs/heads/master" >expect &&
130 + echo "refs/heads/main" >expect &&
131
132 (
133 cd addtest &&
@@ -226,7 +226,7 @@ test_expect_success 'submodule add --branch' '
226 echo "refs/heads/initial" >expect-head &&
227 cat <<-\EOF >expect-heads &&
228 refs/heads/initial
229 - refs/heads/master
229 + refs/heads/main
230 EOF
231
232 (
@@ -244,7 +244,7 @@ test_expect_success 'submodule add --branch' '
244 '
245
246 test_expect_success 'submodule add with ./ in path' '
247 - echo "refs/heads/master" >expect &&
247 + echo "refs/heads/main" >expect &&
248
249 (
250 cd addtest &&
@@ -260,7 +260,7 @@ test_expect_success 'submodule add with ./ in path' '
260 '
261
262 test_expect_success 'submodule add with /././ in path' '
263 - echo "refs/heads/master" >expect &&
263 + echo "refs/heads/main" >expect &&
264
265 (
266 cd addtest &&
@@ -276,7 +276,7 @@ test_expect_success 'submodule add with /././ in path' '
276 '
277
278 test_expect_success 'submodule add with // in path' '
279 - echo "refs/heads/master" >expect &&
279 + echo "refs/heads/main" >expect &&
280
281 (
282 cd addtest &&
@@ -292,7 +292,7 @@ test_expect_success 'submodule add with // in path' '
292 '
293
294 test_expect_success 'submodule add with /.. in path' '
295 - echo "refs/heads/master" >expect &&
295 + echo "refs/heads/main" >expect &&
296
297 (
298 cd addtest &&
@@ -308,7 +308,7 @@ test_expect_success 'submodule add with /.. in path' '
308 '
309
310 test_expect_success 'submodule add with ./, /.. and // in path' '
311 - echo "refs/heads/master" >expect &&
311 + echo "refs/heads/main" >expect &&
312
313 (
314 cd addtest &&
@@ -338,7 +338,7 @@ test_expect_success !CYGWIN 'submodule add with \\ in path' '
338 '
339
340 test_expect_success 'submodule add in subdirectory' '
341 - echo "refs/heads/master" >expect &&
341 + echo "refs/heads/main" >expect &&
342
343 mkdir addtest/sub &&
344 (
@@ -560,7 +560,7 @@ test_expect_success 'status should be "up-to-date" after update' '
560
561 test_expect_success 'checkout superproject with subproject already present' '
562 git checkout initial &&
563 - git checkout master
563 + git checkout main
564 '
565
566 test_expect_success 'apply submodule diff' '
@@ -577,7 +577,7 @@ test_expect_success 'apply submodule diff' '
577 git checkout second &&
578 git apply --index P.diff &&
579
580 - git diff --cached master >staged &&
580 + git diff --cached main >staged &&
581 test_must_be_empty staged
582 '
583
t/t7403-submodule-sync.sh
+6 -6
@@ -8,7 +8,7 @@ test_description='git submodule sync
8 These tests exercise the "git submodule sync" subcommand.
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
@@ -81,7 +81,7 @@ test_expect_success 'change submodule url' '
81 (
82 cd super &&
83 cd submodule &&
84 - git checkout master &&
84 + git checkout main &&
85 git pull
86 ) &&
87 mv submodule moved-submodule &&
@@ -115,7 +115,7 @@ test_expect_success '"git submodule sync" should update submodule URLs' '
115 )" &&
116 (
117 cd super-clone/submodule &&
118 - git checkout master &&
118 + git checkout main &&
119 git pull
120 ) &&
121 (
@@ -143,7 +143,7 @@ test_expect_success '"git submodule sync --recursive" should update all submodul
143 )" &&
144 (
145 cd super-clone/submodule/sub-submodule &&
146 - git checkout master &&
146 + git checkout main &&
147 git pull
148 )
149 '
@@ -171,7 +171,7 @@ test_expect_success '"git submodule sync" should update submodule URLs - subdire
171 )" &&
172 (
173 cd super-clone/submodule &&
174 - git checkout master &&
174 + git checkout main &&
175 git pull
176 ) &&
177 (
@@ -202,7 +202,7 @@ test_expect_success '"git submodule sync --recursive" should update all submodul
202 )" &&
203 (
204 cd super-clone/submodule/sub-submodule &&
205 - git checkout master &&
205 + git checkout main &&
206 git pull
207 )
208 '
t/t7406-submodule-update.sh
+20 -20
@@ -9,7 +9,7 @@ This test verifies that "git submodule update" detaches the HEAD of the
9 submodule and "git submodule update --rebase/--merge" does not detach the HEAD.
10 '
11
12 -GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
12 +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
13 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
14
15 . ./test-lib.sh
@@ -17,10 +17,10 @@ export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
17
18 compare_head()
19 {
20 - sha_master=$(git rev-list --max-count=1 master)
20 + sha_main=$(git rev-list --max-count=1 main)
21 sha_head=$(git rev-list --max-count=1 HEAD)
22
23 - test "$sha_master" = "$sha_head"
23 + test "$sha_main" = "$sha_head"
24 }
25
26
@@ -265,14 +265,14 @@ test_expect_success 'submodule update --remote should fetch upstream changes wit
265 cd super &&
266 git submodule update --remote --force submodule &&
267 git -C submodule log -1 --oneline >actual &&
268 - git -C ../submodule log -1 --oneline master >expect &&
268 + git -C ../submodule log -1 --oneline main >expect &&
269 test_cmp expect actual &&
270 git checkout -b test-branch &&
271 git submodule update --remote --force submodule &&
272 git -C submodule log -1 --oneline >actual &&
273 git -C ../submodule log -1 --oneline test-branch >expect &&
274 test_cmp expect actual &&
275 - git checkout master &&
275 + git checkout main &&
276 git branch -d test-branch &&
277 git reset --hard HEAD^
278 )
@@ -285,7 +285,7 @@ test_expect_success 'local config should override .gitmodules branch' '
285 git add file &&
286 test_tick &&
287 git commit -m "upstream line5" &&
288 - git checkout master
288 + git checkout main
289 ) &&
290 (cd super &&
291 git config submodule.submodule.branch test-branch &&
@@ -295,9 +295,9 @@ test_expect_success 'local config should override .gitmodules branch' '
295 )
296 '
297
298 -test_expect_success 'submodule update --rebase staying on master' '
298 +test_expect_success 'submodule update --rebase staying on main' '
299 (cd super/submodule &&
300 - git checkout master
300 + git checkout main
301 ) &&
302 (cd super &&
303 (cd submodule &&
@@ -309,7 +309,7 @@ test_expect_success 'submodule update --rebase staying on master' '
309 )
310 '
311
312 -test_expect_success 'submodule update --merge staying on master' '
312 +test_expect_success 'submodule update --merge staying on main' '
313 (cd super/submodule &&
314 git reset --hard HEAD~1
315 ) &&
@@ -612,7 +612,7 @@ test_expect_success 'submodule update - update=none in .git/config' '
612 (cd super &&
613 git config submodule.submodule.update none &&
614 (cd submodule &&
615 - git checkout master &&
615 + git checkout main &&
616 compare_head
617 ) &&
618 git diff --name-only >out &&
@@ -632,7 +632,7 @@ test_expect_success 'submodule update - update=none in .git/config but --checkou
632 (cd super &&
633 git config submodule.submodule.update none &&
634 (cd submodule &&
635 - git checkout master &&
635 + git checkout main &&
636 compare_head
637 ) &&
638 git diff --name-only >out &&
@@ -692,7 +692,7 @@ test_expect_success 'submodule update continues after checkout error' '
692 test_expect_success 'submodule update continues after recursive checkout error' '
693 (cd super &&
694 git reset --hard HEAD &&
695 - git checkout master &&
695 + git checkout main &&
696 git submodule update &&
697 (cd submodule &&
698 git submodule add ../submodule subsubmodule &&
@@ -736,7 +736,7 @@ test_expect_success 'submodule update continues after recursive checkout error'
736
737 test_expect_success 'submodule update exit immediately in case of merge conflict' '
738 (cd super &&
739 - git checkout master &&
739 + git checkout main &&
740 git reset --hard HEAD &&
741 (cd submodule &&
742 (cd subsubmodule &&
@@ -754,7 +754,7 @@ test_expect_success 'submodule update exit immediately in case of merge conflict
754 git add submodule2 &&
755 git commit -m "two_new_submodule_commits" &&
756 (cd submodule &&
757 - git checkout master &&
757 + git checkout main &&
758 test_commit "conflict" file &&
759 echo "conflict" > file
760 ) &&
@@ -773,7 +773,7 @@ test_expect_success 'submodule update exit immediately in case of merge conflict
773
774 test_expect_success 'submodule update exit immediately after recursive rebase error' '
775 (cd super &&
776 - git checkout master &&
776 + git checkout main &&
777 git reset --hard HEAD &&
778 (cd submodule &&
779 git reset --hard HEAD &&
@@ -789,7 +789,7 @@ test_expect_success 'submodule update exit immediately after recursive rebase er
789 git add submodule2 &&
790 git commit -m "two_new_submodule_commits" &&
791 (cd submodule &&
792 - git checkout master &&
792 + git checkout main &&
793 test_commit "conflict2" file &&
794 echo "conflict" > file
795 ) &&
@@ -881,21 +881,21 @@ test_expect_success 'submodule update places git-dir in superprojects git-dir re
881 git clone subsubsuper_update_r subsubsuper_update_r2 &&
882 (cd subsubsuper_update_r2 &&
883 test_commit "update_subsubsuper" file &&
884 - git push origin master
884 + git push origin main
885 ) &&
886 git clone subsuper_update_r subsuper_update_r2 &&
887 (cd subsuper_update_r2 &&
888 test_commit "update_subsuper" file &&
889 git submodule add ../subsubsuper_update_r subsubmodule &&
890 git commit -am "subsubmodule" &&
891 - git push origin master
891 + git push origin main
892 ) &&
893 git clone super_update_r super_update_r2 &&
894 (cd super_update_r2 &&
895 test_commit "update_super" file &&
896 git submodule add ../subsuper_update_r submodule &&
897 git commit -am "submodule" &&
898 - git push origin master
898 + git push origin main
899 ) &&
900 rm -rf super_update_r2 &&
901 git clone super_update_r super_update_r2 &&
@@ -914,7 +914,7 @@ test_expect_success 'submodule update places git-dir in superprojects git-dir re
914
915 test_expect_success 'submodule add properly re-creates deeper level submodules' '
916 (cd super &&
917 - git reset --hard master &&
917 + git reset --hard main &&
918 rm -rf deeper/ &&
919 git submodule add --force ../submodule deeper/submodule
920 )
t/t7407-submodule-foreach.sh
+13 -13
@@ -9,7 +9,7 @@ This test verifies that "git submodule foreach" correctly visits all submodules
9 that are currently checked out.
10 '
11
12 -GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
12 +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
13 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
14
15 . ./test-lib.sh
@@ -280,13 +280,13 @@ sub1sha1_short=$(cd clone3/sub1 && git rev-parse --short HEAD)
280 sub2sha1_short=$(cd clone3/sub2 && git rev-parse --short HEAD)
281
282 cat > expect <<EOF
283 - $nested1sha1 nested1 (heads/master)
284 - $nested2sha1 nested1/nested2 (heads/master)
285 - $nested3sha1 nested1/nested2/nested3 (heads/master)
286 - $submodulesha1 nested1/nested2/nested3/submodule (heads/master)
283 + $nested1sha1 nested1 (heads/main)
284 + $nested2sha1 nested1/nested2 (heads/main)
285 + $nested3sha1 nested1/nested2/nested3 (heads/main)
286 + $submodulesha1 nested1/nested2/nested3/submodule (heads/main)
287 $sub1sha1 sub1 ($sub1sha1_short)
288 $sub2sha1 sub2 ($sub2sha1_short)
289 - $sub3sha1 sub3 (heads/master)
289 + $sub3sha1 sub3 (heads/main)
290 EOF
291
292 test_expect_success 'test "status --recursive"' '
@@ -298,10 +298,10 @@ test_expect_success 'test "status --recursive"' '
298 '
299
300 cat > expect <<EOF
301 - $nested1sha1 nested1 (heads/master)
301 + $nested1sha1 nested1 (heads/main)
302 +$nested2sha1 nested1/nested2 (file2~1)
303 - $nested3sha1 nested1/nested2/nested3 (heads/master)
304 - $submodulesha1 nested1/nested2/nested3/submodule (heads/master)
303 + $nested3sha1 nested1/nested2/nested3 (heads/main)
304 + $submodulesha1 nested1/nested2/nested3/submodule (heads/main)
305 EOF
306
307 test_expect_success 'ensure "status --cached --recursive" preserves the --cached flag' '
@@ -319,13 +319,13 @@ test_expect_success 'ensure "status --cached --recursive" preserves the --cached
319 nested2sha1=$(git -C clone3/nested1/nested2 rev-parse HEAD)
320
321 cat > expect <<EOF
322 - $nested1sha1 ../nested1 (heads/master)
322 + $nested1sha1 ../nested1 (heads/main)
323 +$nested2sha1 ../nested1/nested2 (file2)
324 - $nested3sha1 ../nested1/nested2/nested3 (heads/master)
325 - $submodulesha1 ../nested1/nested2/nested3/submodule (heads/master)
324 + $nested3sha1 ../nested1/nested2/nested3 (heads/main)
325 + $submodulesha1 ../nested1/nested2/nested3/submodule (heads/main)
326 $sub1sha1 ../sub1 ($sub1sha1_short)
327 $sub2sha1 ../sub2 ($sub2sha1_short)
328 - $sub3sha1 ../sub3 (heads/master)
328 + $sub3sha1 ../sub3 (heads/main)
329 EOF
330
331 test_expect_success 'test "status --recursive" from sub directory' '
t/t7409-submodule-detached-work-tree.sh
+5 -5
@@ -10,7 +10,7 @@ on detached working trees
10 '
11
12 TEST_NO_CREATE_REPO=1
13 -GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
13 +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
14 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
15
16 . ./test-lib.sh
@@ -38,7 +38,7 @@ test_expect_success 'submodule on detached working tree' '
38 git rev-parse --verify HEAD >actual &&
39 test_cmp ../../../../expect actual
40 ) &&
41 - git push origin master
41 + git push origin main
42 ) &&
43 mkdir home2 &&
44 (
@@ -47,7 +47,7 @@ test_expect_success 'submodule on detached working tree' '
47 GIT_WORK_TREE="$(pwd)" &&
48 GIT_DIR="$(pwd)/.dotfiles" &&
49 export GIT_WORK_TREE GIT_DIR &&
50 - git checkout master &&
50 + git checkout main &&
51 git submodule update --init &&
52 (
53 unset GIT_WORK_TREE GIT_DIR &&
@@ -67,10 +67,10 @@ test_expect_success 'submodule on detached working pointed by core.worktree' '
67 git clone --bare ../remote "$GIT_DIR" &&
68 git config core.bare false &&
69 git config core.worktree .. &&
70 - git checkout master &&
70 + git checkout main &&
71 git submodule add ../bundle1 .vim/bundle/dupe &&
72 test_commit "dupe" &&
73 - git push origin master
73 + git push origin main
74 ) &&
75 (
76 cd home &&
t/t7417-submodule-path-url.sh
+2 -2
@@ -1,7 +1,7 @@
1 #!/bin/sh
2
3 test_description='check handling of .gitmodule path with dash'
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
@@ -39,7 +39,7 @@ test_expect_success MINGW 'submodule paths disallows trailing spaces' '
39 sed "s/sub/sub /" <tree >tree.new &&
40 tree=$(git -C super mktree <tree.new) &&
41 commit=$(echo with space | git -C super commit-tree $tree) &&
42 - git -C super update-ref refs/heads/master $commit &&
42 + git -C super update-ref refs/heads/main $commit &&
43
44 test_must_fail git clone --recurse-submodules super dst 2>err &&
45 test_i18ngrep "sub " err