t[01]*: adjust the references to the default branch name "main"
Carefully excluding t1309, which sees independent development elsewhere at the time of writing, we transition above-mentioned tests to the default branch name `main`. This trick was performed via $ (cd t && sed -i -e 's/master/main/g' -e 's/MASTER/MAIN/g' \ -e 's/Master/Main/g' -e 's/naster/nain/g' -- t[01]*.sh && git checkout HEAD -- t1309\*) Note that t5533 contains a variation of the name `master` (`naster`) that we rename here, too. This allows us to define `GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main` for those tests. Helped-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> 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
06d531486e9078c88c324ad6f87376cfa897f058
44 files changed
+394
-394
t/t0002-gitfile.sh
+4
-4
@@ -4,7 +4,7 @@ test_description='.git file
4
5
Verify that plumbing commands work when .git is a file
6
'
7
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
7
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
8
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
9
10
. ./test-lib.sh
@@ -99,7 +99,7 @@ test_expect_success 'enter_repo non-strict mode' '
99
git ls-remote enter_repo >actual &&
100
cat >expected <<-EOF &&
101
$head HEAD
102
- $head refs/heads/master
102
+ $head refs/heads/main
103
$head refs/tags/foo
104
EOF
105
test_cmp expected actual
@@ -114,7 +114,7 @@ test_expect_success 'enter_repo linked checkout' '
114
git ls-remote foo >actual &&
115
cat >expected <<-EOF &&
116
$head HEAD
117
- $head refs/heads/master
117
+ $head refs/heads/main
118
$head refs/tags/foo
119
EOF
120
test_cmp expected actual
@@ -125,7 +125,7 @@ test_expect_success 'enter_repo strict mode' '
125
git ls-remote --upload-pack="git upload-pack --strict" foo/.git >actual &&
126
cat >expected <<-EOF &&
127
$head HEAD
128
- $head refs/heads/master
128
+ $head refs/heads/main
129
$head refs/tags/foo
130
EOF
131
test_cmp expected actual
t/t0020-crlf.sh
+5
-5
@@ -2,7 +2,7 @@
2
3
test_description='CRLF conversion'
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
@@ -321,8 +321,8 @@ test_expect_success 'checkout with existing .gitattributes' '
321
git add .gitattributes .file &&
322
git commit -m second &&
323
324
- git checkout master~1 &&
325
- git checkout master &&
324
+ git checkout main~1 &&
325
+ git checkout main &&
326
test "$(git diff-files --raw)" = ""
327
328
'
@@ -334,8 +334,8 @@ test_expect_success 'checkout when deleting .gitattributes' '
334
git add .file2 &&
335
git commit -m third &&
336
337
- git checkout master~1 &&
338
- git checkout master &&
337
+ git checkout main~1 &&
338
+ git checkout main &&
339
has_cr .file2
340
341
'
t/t0021-conversion.sh
+21
-21
@@ -2,7 +2,7 @@
2
3
test_description='blob conversion via gitattributes'
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
@@ -381,8 +381,8 @@ test_expect_success PERL 'required process filter should filter data' '
381
test_cmp_count expected.log debug.log &&
382
383
git commit -m "test commit 2" &&
384
- MASTER=$(git rev-parse --verify master) &&
385
- META="ref=refs/heads/master treeish=$MASTER" &&
384
+ MAIN=$(git rev-parse --verify main) &&
385
+ META="ref=refs/heads/main treeish=$MAIN" &&
386
rm -f test2.r "testsubdir/test3 '\''sq'\'',\$x=.r" &&
387
388
filter_git checkout --quiet --no-progress . &&
@@ -407,7 +407,7 @@ test_expect_success PERL 'required process filter should filter data' '
407
EOF
408
test_cmp_exclude_clean expected.log debug.log &&
409
410
- filter_git checkout --quiet --no-progress master &&
410
+ filter_git checkout --quiet --no-progress main &&
411
cat >expected.log <<-EOF &&
412
START
413
init handshake complete
@@ -439,15 +439,15 @@ test_expect_success PERL 'required process filter should filter data for various
439
M3=$(git hash-object "testsubdir/test3 '\''sq'\'',\$x=.r") &&
440
EMPTY=$(git hash-object /dev/null) &&
441
442
- MASTER=$(git rev-parse --verify master) &&
442
+ MAIN=$(git rev-parse --verify main) &&
443
444
cp "$TEST_ROOT/test.o" test5.r &&
445
git add test5.r &&
446
git commit -m "test commit 3" &&
447
git checkout empty-branch &&
448
- filter_git rebase --onto empty-branch master^^ master &&
449
- MASTER2=$(git rev-parse --verify master) &&
450
- META="ref=refs/heads/master treeish=$MASTER2" &&
448
+ filter_git rebase --onto empty-branch main^^ main &&
449
+ MAIN2=$(git rev-parse --verify main) &&
450
+ META="ref=refs/heads/main treeish=$MAIN2" &&
451
cat >expected.log <<-EOF &&
452
START
453
init handshake complete
@@ -461,8 +461,8 @@ test_expect_success PERL 'required process filter should filter data for various
461
test_cmp_exclude_clean expected.log debug.log &&
462
463
git reset --hard empty-branch &&
464
- filter_git reset --hard $MASTER &&
465
- META="treeish=$MASTER" &&
464
+ filter_git reset --hard $MAIN &&
465
+ META="treeish=$MAIN" &&
466
cat >expected.log <<-EOF &&
467
START
468
init handshake complete
@@ -474,10 +474,10 @@ test_expect_success PERL 'required process filter should filter data for various
474
EOF
475
test_cmp_exclude_clean expected.log debug.log &&
476
477
- git branch old-master $MASTER &&
477
+ git branch old-main $MAIN &&
478
git reset --hard empty-branch &&
479
- filter_git reset --hard old-master &&
480
- META="ref=refs/heads/old-master treeish=$MASTER" &&
479
+ filter_git reset --hard old-main &&
480
+ META="ref=refs/heads/old-main treeish=$MAIN" &&
481
cat >expected.log <<-EOF &&
482
START
483
init handshake complete
@@ -490,9 +490,9 @@ test_expect_success PERL 'required process filter should filter data for various
490
test_cmp_exclude_clean expected.log debug.log &&
491
492
git checkout -b merge empty-branch &&
493
- git branch -f master $MASTER2 &&
494
- filter_git merge master &&
495
- META="treeish=$MASTER2" &&
493
+ git branch -f main $MAIN2 &&
494
+ filter_git merge main &&
495
+ META="treeish=$MAIN2" &&
496
cat >expected.log <<-EOF &&
497
START
498
init handshake complete
@@ -505,8 +505,8 @@ test_expect_success PERL 'required process filter should filter data for various
505
EOF
506
test_cmp_exclude_clean expected.log debug.log &&
507
508
- filter_git archive master >/dev/null &&
509
- META="ref=refs/heads/master treeish=$MASTER2" &&
508
+ filter_git archive main >/dev/null &&
509
+ META="ref=refs/heads/main treeish=$MAIN2" &&
510
cat >expected.log <<-EOF &&
511
START
512
init handshake complete
@@ -519,7 +519,7 @@ test_expect_success PERL 'required process filter should filter data for various
519
EOF
520
test_cmp_exclude_clean expected.log debug.log &&
521
522
- TREE="$(git rev-parse $MASTER2^{tree})" &&
522
+ TREE="$(git rev-parse $MAIN2^{tree})" &&
523
filter_git archive $TREE >/dev/null &&
524
META="treeish=$TREE" &&
525
cat >expected.log <<-EOF &&
@@ -859,8 +859,8 @@ test_expect_success PERL 'delayed checkout in process filter' '
859
) &&
860
861
S=$(test_file_size "$TEST_ROOT/test.o") &&
862
- PM="ref=refs/heads/master treeish=$(git -C repo rev-parse --verify master) " &&
863
- M="${PM}blob=$(git -C repo rev-parse --verify master:test.a)" &&
862
+ PM="ref=refs/heads/main treeish=$(git -C repo rev-parse --verify main) " &&
863
+ M="${PM}blob=$(git -C repo rev-parse --verify main:test.a)" &&
864
cat >a.exp <<-EOF &&
865
START
866
init handshake complete
t/t0027-auto-crlf.sh
+2
-2
@@ -368,9 +368,9 @@ test_expect_success 'ls-files --eol -o Text/Binary' '
368
test_cmp expect actual
369
'
370
371
-test_expect_success 'setup master' '
371
+test_expect_success 'setup main' '
372
echo >.gitattributes &&
373
- git checkout -b master &&
373
+ git checkout -b main &&
374
git add .gitattributes &&
375
git commit -m "add .gitattributes" . &&
376
printf "\$Id: 0000000000000000000000000000000000000000 \$\nLINEONE\nLINETWO\nLINETHREE" >LF &&
t/t0028-working-tree-encoding.sh
+3
-3
@@ -2,7 +2,7 @@
2
3
test_description='working-tree-encoding conversion via gitattributes'
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
@@ -218,7 +218,7 @@ test_expect_success 'error if encoding round trip is not the same during refresh
218
TEST_HASH=$(git hash-object --no-filters -w nonsense.utf16le) &&
219
git update-index --add --cacheinfo 100644 $TEST_HASH nonsense.utf16le &&
220
COMMIT=$(git commit-tree -p $(git rev-parse HEAD) -m "plain commit" $(git write-tree)) &&
221
- git update-ref refs/heads/master $COMMIT &&
221
+ git update-ref refs/heads/main $COMMIT &&
222
223
test_must_fail git checkout HEAD^ 2>err.out &&
224
test_i18ngrep "error: .* overwritten by checkout:" err.out
@@ -234,7 +234,7 @@ test_expect_success 'error if encoding garbage is already in Git' '
234
TEST_HASH=$(git hash-object --no-filters -w nonsense.utf16) &&
235
git update-index --add --cacheinfo 100644 $TEST_HASH nonsense.utf16 &&
236
COMMIT=$(git commit-tree -p $(git rev-parse HEAD) -m "plain commit" $(git write-tree)) &&
237
- git update-ref refs/heads/master $COMMIT &&
237
+ git update-ref refs/heads/main $COMMIT &&
238
239
git diff 2>err.out &&
240
test_i18ngrep "error: BOM is required" err.out
t/t0041-usage.sh
+6
-6
@@ -2,7 +2,7 @@
2
3
test_description='Test commands behavior when given invalid argument value'
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
@@ -44,8 +44,8 @@ test_expect_success 'tag usage error' '
44
'
45
46
test_expect_success 'branch --contains <existent_commit>' '
47
- git branch --contains "master" >actual 2>actual.err &&
48
- test_i18ngrep "master" actual &&
47
+ git branch --contains "main" >actual 2>actual.err &&
48
+ test_i18ngrep "main" actual &&
49
test_line_count = 0 actual.err
50
'
51
@@ -57,7 +57,7 @@ test_expect_success 'branch --contains <inexistent_commit>' '
57
'
58
59
test_expect_success 'branch --no-contains <existent_commit>' '
60
- git branch --no-contains "master" >actual 2>actual.err &&
60
+ git branch --no-contains "main" >actual 2>actual.err &&
61
test_line_count = 0 actual &&
62
test_line_count = 0 actual.err
63
'
@@ -76,7 +76,7 @@ test_expect_success 'branch usage error' '
76
'
77
78
test_expect_success 'for-each-ref --contains <existent_object>' '
79
- git for-each-ref --contains "master" >actual 2>actual.err &&
79
+ git for-each-ref --contains "main" >actual 2>actual.err &&
80
test_line_count = 2 actual &&
81
test_line_count = 0 actual.err
82
'
@@ -89,7 +89,7 @@ test_expect_success 'for-each-ref --contains <inexistent_object>' '
89
'
90
91
test_expect_success 'for-each-ref --no-contains <existent_object>' '
92
- git for-each-ref --no-contains "master" >actual 2>actual.err &&
92
+ git for-each-ref --no-contains "main" >actual 2>actual.err &&
93
test_line_count = 0 actual &&
94
test_line_count = 0 actual.err
95
'
t/t0050-filesystem.sh
+4
-4
@@ -2,7 +2,7 @@
2
3
test_description='Various filesystem issues'
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
@@ -68,7 +68,7 @@ test_expect_success "setup case tests" '
68
git mv camelcase tmp &&
69
git mv tmp CamelCase &&
70
git commit -m "rename" &&
71
- git checkout -f master
71
+ git checkout -f main
72
'
73
74
test_expect_success 'rename (case change)' '
@@ -121,7 +121,7 @@ test_expect_success "setup unicode normalization tests" '
121
git mv $aumlcdiar tmp &&
122
git mv tmp "$auml" &&
123
git commit -m rename &&
124
- git checkout -f master
124
+ git checkout -f main
125
'
126
127
$test_unicode 'rename (silent unicode normalization)' '
@@ -150,7 +150,7 @@ test_expect_success CASE_INSENSITIVE_FS 'checkout with no pathspec and a case in
150
git add gitweb &&
151
git commit -m "add gitweb/subdir/file" &&
152
153
- git checkout master
153
+ git checkout main
154
)
155
'
156
t/t0060-path-utils.sh
+2
-2
@@ -312,8 +312,8 @@ test_git_path GIT_COMMON_DIR=bar info/sparse-checkout .git/info/sparse-check
312
test_git_path GIT_COMMON_DIR=bar info//sparse-checkout .git/info//sparse-checkout
313
test_git_path GIT_COMMON_DIR=bar remotes/bar bar/remotes/bar
314
test_git_path GIT_COMMON_DIR=bar branches/bar bar/branches/bar
315
-test_git_path GIT_COMMON_DIR=bar logs/refs/heads/master bar/logs/refs/heads/master
316
-test_git_path GIT_COMMON_DIR=bar refs/heads/master bar/refs/heads/master
315
+test_git_path GIT_COMMON_DIR=bar logs/refs/heads/main bar/logs/refs/heads/main
316
+test_git_path GIT_COMMON_DIR=bar refs/heads/main bar/refs/heads/main
317
test_git_path GIT_COMMON_DIR=bar refs/bisect/foo .git/refs/bisect/foo
318
test_git_path GIT_COMMON_DIR=bar hooks/me bar/hooks/me
319
test_git_path GIT_COMMON_DIR=bar config bar/config
t/t0100-previous.sh
+10
-10
@@ -2,7 +2,7 @@
2
3
test_description='previous branch syntax @{-n}'
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
@@ -11,7 +11,7 @@ test_expect_success 'branch -d @{-1}' '
11
test_commit A &&
12
git checkout -b junk &&
13
git checkout - &&
14
- test "$(git symbolic-ref HEAD)" = refs/heads/master &&
14
+ test "$(git symbolic-ref HEAD)" = refs/heads/main &&
15
git branch -d @{-1} &&
16
test_must_fail git rev-parse --verify refs/heads/junk
17
'
@@ -20,9 +20,9 @@ test_expect_success 'branch -d @{-12} when there is not enough switches yet' '
20
git reflog expire --expire=now &&
21
git checkout -b junk2 &&
22
git checkout - &&
23
- test "$(git symbolic-ref HEAD)" = refs/heads/master &&
23
+ test "$(git symbolic-ref HEAD)" = refs/heads/main &&
24
test_must_fail git branch -d @{-12} &&
25
- git rev-parse --verify refs/heads/master
25
+ git rev-parse --verify refs/heads/main
26
'
27
28
test_expect_success 'merge @{-1}' '
@@ -31,19 +31,19 @@ test_expect_success 'merge @{-1}' '
31
git checkout A &&
32
test_commit C &&
33
test_commit D &&
34
- git branch -f master B &&
34
+ git branch -f main B &&
35
git branch -f other &&
36
git checkout other &&
37
- git checkout master &&
37
+ git checkout main &&
38
git merge @{-1} &&
39
git cat-file commit HEAD | grep "Merge branch '\''other'\''"
40
'
41
42
test_expect_success 'merge @{-1}~1' '
43
- git checkout master &&
43
+ git checkout main &&
44
git reset --hard B &&
45
git checkout other &&
46
- git checkout master &&
46
+ git checkout main &&
47
git merge @{-1}~1 &&
48
git cat-file commit HEAD >actual &&
49
grep "Merge branch '\''other'\''" actual
@@ -51,11 +51,11 @@ test_expect_success 'merge @{-1}~1' '
51
52
test_expect_success 'merge @{-100} before checking out that many branches yet' '
53
git reflog expire --expire=now &&
54
- git checkout -f master &&
54
+ git checkout -f main &&
55
git reset --hard B &&
56
git branch -f other C &&
57
git checkout other &&
58
- git checkout master &&
58
+ git checkout main &&
59
test_must_fail git merge @{-100}
60
'
61
t/t1004-read-tree-m-u-wf.sh
+21
-21
@@ -2,7 +2,7 @@
2
3
test_description='read-tree -m -u checks working tree files'
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
@@ -23,17 +23,17 @@ test_expect_success 'two-way setup' '
23
git branch side &&
24
git tag -f branch-point &&
25
26
- echo file2 is not tracked on the master branch anymore &&
26
+ echo file2 is not tracked on the main branch anymore &&
27
rm -f file2 subdir/file2 &&
28
git update-index --remove file2 subdir/file2 &&
29
- git commit -a -m "master removes file2 and subdir/file2"
29
+ git commit -a -m "main removes file2 and subdir/file2"
30
'
31
32
test_expect_success 'two-way not clobbering' '
33
34
- echo >file2 master creates untracked file2 &&
35
- echo >subdir/file2 master creates untracked subdir/file2 &&
36
- if err=$(read_tree_u_must_succeed -m -u master side 2>&1)
34
+ echo >file2 main creates untracked file2 &&
35
+ echo >subdir/file2 main creates untracked subdir/file2 &&
36
+ if err=$(read_tree_u_must_succeed -m -u main side 2>&1)
37
then
38
echo should have complained
39
false
@@ -46,7 +46,7 @@ echo file2 >.gitignore
46
47
test_expect_success 'two-way with incorrect --exclude-per-directory (1)' '
48
49
- if err=$(read_tree_u_must_succeed -m --exclude-per-directory=.gitignore master side 2>&1)
49
+ if err=$(read_tree_u_must_succeed -m --exclude-per-directory=.gitignore main side 2>&1)
50
then
51
echo should have complained
52
false
@@ -57,7 +57,7 @@ test_expect_success 'two-way with incorrect --exclude-per-directory (1)' '
57
58
test_expect_success 'two-way with incorrect --exclude-per-directory (2)' '
59
60
- if err=$(read_tree_u_must_succeed -m -u --exclude-per-directory=foo --exclude-per-directory=.gitignore master side 2>&1)
60
+ if err=$(read_tree_u_must_succeed -m -u --exclude-per-directory=foo --exclude-per-directory=.gitignore main side 2>&1)
61
then
62
echo should have complained
63
false
@@ -68,7 +68,7 @@ test_expect_success 'two-way with incorrect --exclude-per-directory (2)' '
68
69
test_expect_success 'two-way clobbering a ignored file' '
70
71
- read_tree_u_must_succeed -m -u --exclude-per-directory=.gitignore master side
71
+ read_tree_u_must_succeed -m -u --exclude-per-directory=.gitignore main side
72
'
73
74
rm -f .gitignore
@@ -84,21 +84,21 @@ test_expect_success 'three-way not complaining on an untracked path in both' '
84
git update-index --add file3 subdir/file3 &&
85
git commit -a -m "side adds file3 and removes file2" &&
86
87
- git checkout master &&
88
- echo >file2 file two is untracked on the master side &&
89
- echo >subdir/file2 file two is untracked on the master side &&
87
+ git checkout main &&
88
+ echo >file2 file two is untracked on the main side &&
89
+ echo >subdir/file2 file two is untracked on the main side &&
90
91
- read_tree_u_must_succeed -m -u branch-point master side
91
+ read_tree_u_must_succeed -m -u branch-point main side
92
'
93
94
test_expect_success 'three-way not clobbering a working tree file' '
95
96
git reset --hard &&
97
rm -f file2 subdir/file2 file3 subdir/file3 &&
98
- git checkout master &&
99
- echo >file3 file three created in master, untracked &&
100
- echo >subdir/file3 file three created in master, untracked &&
101
- if err=$(read_tree_u_must_succeed -m -u branch-point master side 2>&1)
98
+ git checkout main &&
99
+ echo >file3 file three created in main, untracked &&
100
+ echo >subdir/file3 file three created in main, untracked &&
101
+ if err=$(read_tree_u_must_succeed -m -u branch-point main side 2>&1)
102
then
103
echo should have complained
104
false
@@ -113,11 +113,11 @@ test_expect_success 'three-way not complaining on an untracked file' '
113
114
git reset --hard &&
115
rm -f file2 subdir/file2 file3 subdir/file3 &&
116
- git checkout master &&
117
- echo >file3 file three created in master, untracked &&
118
- echo >subdir/file3 file three created in master, untracked &&
116
+ git checkout main &&
117
+ echo >file3 file three created in main, untracked &&
118
+ echo >subdir/file3 file three created in main, untracked &&
119
120
- read_tree_u_must_succeed -m -u --exclude-per-directory=.gitignore branch-point master side
120
+ read_tree_u_must_succeed -m -u --exclude-per-directory=.gitignore branch-point main side
121
'
122
123
test_expect_success '3-way not overwriting local changes (setup)' '
t/t1008-read-tree-overlay.sh
+2
-2
@@ -2,7 +2,7 @@
2
3
test_description='test multi-tree read-tree without merging'
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 setup '
25
'
26
27
test_expect_success 'multi-read' '
28
- read_tree_must_succeed initial master side &&
28
+ read_tree_must_succeed initial main side &&
29
test_write_lines a b/c >expect &&
30
git ls-files >actual &&
31
test_cmp expect actual
t/t1009-read-tree-new-index.sh
+3
-3
@@ -2,7 +2,7 @@
2
3
test_description='test read-tree into a fresh index file'
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
@@ -15,13 +15,13 @@ test_expect_success setup '
15
16
test_expect_success 'non-existent index file' '
17
rm -f new-index &&
18
- GIT_INDEX_FILE=new-index git read-tree master
18
+ GIT_INDEX_FILE=new-index git read-tree main
19
'
20
21
test_expect_success 'empty index file' '
22
rm -f new-index &&
23
> new-index &&
24
- GIT_INDEX_FILE=new-index git read-tree master
24
+ GIT_INDEX_FILE=new-index git read-tree main
25
'
26
27
test_done
t/t1011-read-tree-sparse-checkout.sh
+1
-1
@@ -2,7 +2,7 @@
2
3
test_description='sparse checkout tests
4
5
-* (tag: removed, master) removed
5
+* (tag: removed, main) removed
6
| D sub/added
7
* (HEAD, tag: top) modified and added
8
| M init.t
t/t1021-rerere-in-workdir.sh
+2
-2
@@ -1,7 +1,7 @@
1
#!/bin/sh
2
3
test_description='rerere run in a workdir'
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
@@ -22,7 +22,7 @@ test_expect_success SYMLINKS setup '
22
test_tick &&
23
git commit -a -m goodbye &&
24
25
- git checkout master
25
+ git checkout main
26
'
27
28
test_expect_success SYMLINKS 'rerere in workdir' '
t/t1090-sparse-checkout-scope.sh
+6
-6
@@ -2,7 +2,7 @@
2
3
test_description='sparse checkout scope tests'
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
@@ -23,18 +23,18 @@ test_expect_success 'create feature branch' '
23
git commit -m "modification"
24
'
25
26
-test_expect_success 'perform sparse checkout of master' '
26
+test_expect_success 'perform sparse checkout of main' '
27
git config --local --bool core.sparsecheckout true &&
28
echo "!/*" >.git/info/sparse-checkout &&
29
echo "/a" >>.git/info/sparse-checkout &&
30
echo "/c" >>.git/info/sparse-checkout &&
31
- git checkout master &&
31
+ git checkout main &&
32
test_path_is_file a &&
33
test_path_is_missing b &&
34
test_path_is_file c
35
'
36
37
-test_expect_success 'merge feature branch into sparse checkout of master' '
37
+test_expect_success 'merge feature branch into sparse checkout of main' '
38
git merge feature &&
39
test_path_is_file a &&
40
test_path_is_missing b &&
@@ -42,10 +42,10 @@ test_expect_success 'merge feature branch into sparse checkout of master' '
42
test "$(cat c)" = "modified"
43
'
44
45
-test_expect_success 'return to full checkout of master' '
45
+test_expect_success 'return to full checkout of main' '
46
git checkout feature &&
47
echo "/*" >.git/info/sparse-checkout &&
48
- git checkout master &&
48
+ git checkout main &&
49
test_path_is_file a &&
50
test_path_is_file b &&
51
test_path_is_file c &&
t/t1091-sparse-checkout-builtin.sh
+2
-2
@@ -2,7 +2,7 @@
2
3
test_description='sparse checkout builtin tests'
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
@@ -120,7 +120,7 @@ test_expect_success 'interaction with clone --no-checkout (unborn index)' '
120
test_path_is_missing clone_no_checkout/.git/index &&
121
122
# No branch is checked out until we manually switch to one
123
- git -C clone_no_checkout switch master &&
123
+ git -C clone_no_checkout switch main &&
124
test_path_is_file clone_no_checkout/.git/index &&
125
check_files clone_no_checkout a folder1
126
'
t/t1300-config.sh
+5
-5
@@ -5,7 +5,7 @@
5
6
test_description='Test git config in different settings'
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
@@ -1057,8 +1057,8 @@ test_expect_success 'check split_cmdline return' "
1057
echo foo > foo &&
1058
git add foo &&
1059
git commit -m 'initial commit' &&
1060
- git config branch.master.mergeoptions 'echo \"' &&
1061
- test_must_fail git merge master
1060
+ git config branch.main.mergeoptions 'echo \"' &&
1061
+ test_must_fail git merge main
1062
"
1063
1064
test_expect_success 'git -c "key=value" support' '
@@ -1772,11 +1772,11 @@ test_expect_success '--show-origin blob' '
1772
1773
test_expect_success '--show-origin blob ref' '
1774
cat >expect <<-\EOF &&
1775
- blob:master:custom.conf user.custom=true
1775
+ blob:main:custom.conf user.custom=true
1776
EOF
1777
git add "$CUSTOM_CONFIG_FILE" &&
1778
git commit -m "new config file" &&
1779
- git config --blob=master:"$CUSTOM_CONFIG_FILE" --show-origin --list >output &&
1779
+ git config --blob=main:"$CUSTOM_CONFIG_FILE" --show-origin --list >output &&
1780
test_cmp expect output
1781
'
1782
t/t1301-shared-repo.sh
+3
-3
@@ -5,7 +5,7 @@
5
6
test_description='Test shared repository initialization'
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
@@ -118,13 +118,13 @@ test_expect_success POSIXPERM 'git reflog expire honors core.sharedRepository' '
118
umask 077 &&
119
git config core.sharedRepository group &&
120
git reflog expire --all &&
121
- actual="$(ls -l .git/logs/refs/heads/master)" &&
121
+ actual="$(ls -l .git/logs/refs/heads/main)" &&
122
case "$actual" in
123
-rw-rw-*)
124
: happy
125
;;
126
*)
127
- echo Ooops, .git/logs/refs/heads/master is not 0662 [$actual]
127
+ echo Ooops, .git/logs/refs/heads/main is not 0662 [$actual]
128
false
129
;;
130
esac
t/t1305-config-include.sh
+1
-1
@@ -312,7 +312,7 @@ test_expect_success SYMLINKS 'conditional include, gitdir matching symlink, icas
312
test_expect_success 'conditional include, onbranch' '
313
echo "[includeIf \"onbranch:foo-branch\"]path=bar9" >>.git/config &&
314
echo "[test]nine=9" >.git/bar9 &&
315
- git checkout -b master &&
315
+ git checkout -b main &&
316
test_must_fail git config test.nine &&
317
git checkout -b foo-branch &&
318
echo 9 >expect &&
t/t1400-update-ref.sh
+35
-35
@@ -4,14 +4,14 @@
4
#
5
6
test_description='Test git update-ref and basic ref logging'
7
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
7
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
8
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
9
10
. ./test-lib.sh
11
12
Z=$ZERO_OID
13
14
-m=refs/heads/master
14
+m=refs/heads/main
15
n_dir=refs/heads/gu
16
n=$n_dir/fixes
17
outside=refs/foo
@@ -261,7 +261,7 @@ test_expect_success "(not) changed .git/$m" '
261
! test $B = $(git show-ref -s --verify $m)
262
'
263
264
-rm -f .git/logs/refs/heads/master
264
+rm -f .git/logs/refs/heads/main
265
test_expect_success "create $m (logged by touch)" '
266
test_config core.logAllRefUpdates false &&
267
GIT_COMMITTER_DATE="2005-05-26 23:30" \
@@ -297,7 +297,7 @@ test_expect_success 'symref empty directory removal' '
297
git branch e1/e2/r1 HEAD &&
298
git branch e1/r2 HEAD &&
299
git checkout e1/e2/r1 &&
300
- test_when_finished "git checkout master" &&
300
+ test_when_finished "git checkout main" &&
301
test_path_is_file .git/refs/heads/e1/e2/r1 &&
302
test_path_is_file .git/logs/refs/heads/e1/e2/r1 &&
303
git update-ref -d HEAD &&
@@ -361,68 +361,68 @@ test_expect_success 'set up for querying the reflog' '
361
ed="Thu, 26 May 2005 18:32:00 -0500"
362
gd="Thu, 26 May 2005 18:33:00 -0500"
363
ld="Thu, 26 May 2005 18:43:00 -0500"
364
-test_expect_success 'Query "master@{May 25 2005}" (before history)' '
364
+test_expect_success 'Query "main@{May 25 2005}" (before history)' '
365
test_when_finished "rm -f o e" &&
366
- git rev-parse --verify "master@{May 25 2005}" >o 2>e &&
366
+ git rev-parse --verify "main@{May 25 2005}" >o 2>e &&
367
echo "$C" >expect &&
368
test_cmp expect o &&
369
- echo "warning: log for '\''master'\'' only goes back to $ed" >expect &&
369
+ echo "warning: log for '\''main'\'' only goes back to $ed" >expect &&
370
test_i18ncmp expect e
371
'
372
-test_expect_success 'Query master@{2005-05-25} (before history)' '
372
+test_expect_success 'Query main@{2005-05-25} (before history)' '
373
test_when_finished "rm -f o e" &&
374
- git rev-parse --verify master@{2005-05-25} >o 2>e &&
374
+ git rev-parse --verify main@{2005-05-25} >o 2>e &&
375
echo "$C" >expect &&
376
test_cmp expect o &&
377
- echo "warning: log for '\''master'\'' only goes back to $ed" >expect &&
377
+ echo "warning: log for '\''main'\'' only goes back to $ed" >expect &&
378
test_i18ncmp expect e
379
'
380
-test_expect_success 'Query "master@{May 26 2005 23:31:59}" (1 second before history)' '
380
+test_expect_success 'Query "main@{May 26 2005 23:31:59}" (1 second before history)' '
381
test_when_finished "rm -f o e" &&
382
- git rev-parse --verify "master@{May 26 2005 23:31:59}" >o 2>e &&
382
+ git rev-parse --verify "main@{May 26 2005 23:31:59}" >o 2>e &&
383
echo "$C" >expect &&
384
test_cmp expect o &&
385
- echo "warning: log for '\''master'\'' only goes back to $ed" >expect &&
385
+ echo "warning: log for '\''main'\'' only goes back to $ed" >expect &&
386
test_i18ncmp expect e
387
'
388
-test_expect_success 'Query "master@{May 26 2005 23:32:00}" (exactly history start)' '
388
+test_expect_success 'Query "main@{May 26 2005 23:32:00}" (exactly history start)' '
389
test_when_finished "rm -f o e" &&
390
- git rev-parse --verify "master@{May 26 2005 23:32:00}" >o 2>e &&
390
+ git rev-parse --verify "main@{May 26 2005 23:32:00}" >o 2>e &&
391
echo "$C" >expect &&
392
test_cmp expect o &&
393
test_must_be_empty e
394
'
395
-test_expect_success 'Query "master@{May 26 2005 23:32:30}" (first non-creation change)' '
395
+test_expect_success 'Query "main@{May 26 2005 23:32:30}" (first non-creation change)' '
396
test_when_finished "rm -f o e" &&
397
- git rev-parse --verify "master@{May 26 2005 23:32:30}" >o 2>e &&
397
+ git rev-parse --verify "main@{May 26 2005 23:32:30}" >o 2>e &&
398
echo "$A" >expect &&
399
test_cmp expect o &&
400
test_must_be_empty e
401
'
402
-test_expect_success 'Query "master@{2005-05-26 23:33:01}" (middle of history with gap)' '
402
+test_expect_success 'Query "main@{2005-05-26 23:33:01}" (middle of history with gap)' '
403
test_when_finished "rm -f o e" &&
404
- git rev-parse --verify "master@{2005-05-26 23:33:01}" >o 2>e &&
404
+ git rev-parse --verify "main@{2005-05-26 23:33:01}" >o 2>e &&
405
echo "$B" >expect &&
406
test_cmp expect o &&
407
test_i18ngrep -F "warning: log for ref $m has gap after $gd" e
408
'
409
-test_expect_success 'Query "master@{2005-05-26 23:38:00}" (middle of history)' '
409
+test_expect_success 'Query "main@{2005-05-26 23:38:00}" (middle of history)' '
410
test_when_finished "rm -f o e" &&
411
- git rev-parse --verify "master@{2005-05-26 23:38:00}" >o 2>e &&
411
+ git rev-parse --verify "main@{2005-05-26 23:38:00}" >o 2>e &&
412
echo "$Z" >expect &&
413
test_cmp expect o &&
414
test_must_be_empty e
415
'
416
-test_expect_success 'Query "master@{2005-05-26 23:43:00}" (exact end of history)' '
416
+test_expect_success 'Query "main@{2005-05-26 23:43:00}" (exact end of history)' '
417
test_when_finished "rm -f o e" &&
418
- git rev-parse --verify "master@{2005-05-26 23:43:00}" >o 2>e &&
418
+ git rev-parse --verify "main@{2005-05-26 23:43:00}" >o 2>e &&
419
echo "$E" >expect &&
420
test_cmp expect o &&
421
test_must_be_empty e
422
'
423
-test_expect_success 'Query "master@{2005-05-28}" (past end of history)' '
423
+test_expect_success 'Query "main@{2005-05-28}" (past end of history)' '
424
test_when_finished "rm -f o e" &&
425
- git rev-parse --verify "master@{2005-05-28}" >o 2>e &&
425
+ git rev-parse --verify "main@{2005-05-28}" >o 2>e &&
426
echo "$D" >expect &&
427
test_cmp expect o &&
428
test_i18ngrep -F "warning: log for ref $m unexpectedly ended on $ld" e
@@ -464,14 +464,14 @@ test_expect_success 'git commit logged updates' '
464
'
465
unset h_TEST h_OTHER h_FIXED h_MERGED
466
467
-test_expect_success 'git cat-file blob master:F (expect OTHER)' '
468
- test OTHER = $(git cat-file blob master:F)
467
+test_expect_success 'git cat-file blob main:F (expect OTHER)' '
468
+ test OTHER = $(git cat-file blob main:F)
469
'
470
-test_expect_success 'git cat-file blob master@{2005-05-26 23:30}:F (expect TEST)' '
471
- test TEST = $(git cat-file blob "master@{2005-05-26 23:30}:F")
470
+test_expect_success 'git cat-file blob main@{2005-05-26 23:30}:F (expect TEST)' '
471
+ test TEST = $(git cat-file blob "main@{2005-05-26 23:30}:F")
472
'
473
-test_expect_success 'git cat-file blob master@{2005-05-26 23:42}:F (expect OTHER)' '
474
- test OTHER = $(git cat-file blob "master@{2005-05-26 23:42}:F")
473
+test_expect_success 'git cat-file blob main@{2005-05-26 23:42}:F (expect OTHER)' '
474
+ test OTHER = $(git cat-file blob "main@{2005-05-26 23:42}:F")
475
'
476
477
# Test adding and deleting pseudorefs
@@ -583,9 +583,9 @@ test_expect_success 'stdin fails on unknown command' '
583
'
584
585
test_expect_success 'stdin fails on unbalanced quotes' '
586
- echo "create $a \"master" >stdin &&
586
+ echo "create $a \"main" >stdin &&
587
test_must_fail git update-ref --stdin <stdin 2>err &&
588
- grep "fatal: badly quoted argument: \\\"master" err
588
+ grep "fatal: badly quoted argument: \\\"main" err
589
'
590
591
test_expect_success PREPARE_FOR_MAIN_BRANCH 'stdin fails on invalid escape' '
@@ -595,9 +595,9 @@ test_expect_success PREPARE_FOR_MAIN_BRANCH 'stdin fails on invalid escape' '
595
'
596
597
test_expect_success 'stdin fails on junk after quoted argument' '
598
- echo "create \"$a\"master" >stdin &&
598
+ echo "create \"$a\"main" >stdin &&
599
test_must_fail git update-ref --stdin <stdin 2>err &&
600
- grep "fatal: unexpected character after quoted argument: \\\"$a\\\"master" err
600
+ grep "fatal: unexpected character after quoted argument: \\\"$a\\\"main" err
601
'
602
603
test_expect_success 'stdin fails create with no ref' '
t/t1402-check-ref-format.sh
+16
-16
@@ -134,18 +134,18 @@ valid_ref !MINGW "$ref" '--refspec-pattern --allow-onelevel --normalize'
134
test_expect_success "check-ref-format --branch @{-1}" '
135
T=$(git write-tree) &&
136
sha1=$(echo A | git commit-tree $T) &&
137
- git update-ref refs/heads/master $sha1 &&
138
- git update-ref refs/remotes/origin/master $sha1 &&
139
- git checkout master &&
140
- git checkout origin/master &&
141
- git checkout master &&
137
+ git update-ref refs/heads/main $sha1 &&
138
+ git update-ref refs/remotes/origin/main $sha1 &&
139
+ git checkout main &&
140
+ git checkout origin/main &&
141
+ git checkout main &&
142
refname=$(git check-ref-format --branch @{-1}) &&
143
test "$refname" = "$sha1" &&
144
refname2=$(git check-ref-format --branch @{-2}) &&
145
- test "$refname2" = master'
145
+ test "$refname2" = main'
146
147
-test_expect_success 'check-ref-format --branch -naster' '
148
- test_must_fail git check-ref-format --branch -naster >actual &&
147
+test_expect_success 'check-ref-format --branch -nain' '
148
+ test_must_fail git check-ref-format --branch -nain >actual &&
149
test_must_be_empty actual
150
'
151
@@ -154,11 +154,11 @@ test_expect_success 'check-ref-format --branch from subdir' '
154
155
T=$(git write-tree) &&
156
sha1=$(echo A | git commit-tree $T) &&
157
- git update-ref refs/heads/master $sha1 &&
158
- git update-ref refs/remotes/origin/master $sha1 &&
159
- git checkout master &&
160
- git checkout origin/master &&
161
- git checkout master &&
157
+ git update-ref refs/heads/main $sha1 &&
158
+ git update-ref refs/remotes/origin/main $sha1 &&
159
+ git checkout main &&
160
+ git checkout origin/main &&
161
+ git checkout main &&
162
refname=$(
163
cd subdir &&
164
git check-ref-format --branch @{-1}
@@ -171,9 +171,9 @@ test_expect_success 'check-ref-format --branch @{-1} from non-repo' '
171
test_must_be_empty actual
172
'
173
174
-test_expect_success 'check-ref-format --branch master from non-repo' '
175
- echo master >expect &&
176
- nongit git check-ref-format --branch master >actual &&
174
+test_expect_success 'check-ref-format --branch main from non-repo' '
175
+ echo main >expect &&
176
+ nongit git check-ref-format --branch main >actual &&
177
test_cmp expect actual
178
'
179
t/t1403-show-ref.sh
+10
-10
@@ -1,7 +1,7 @@
1
#!/bin/sh
2
3
test_description='show-ref'
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
@@ -12,7 +12,7 @@ test_expect_success setup '
12
git checkout -b side &&
13
test_commit B &&
14
git tag -f -a -m "annotated B" B &&
15
- git checkout master &&
15
+ git checkout main &&
16
test_commit C &&
17
git branch B A^0
18
'
@@ -95,23 +95,23 @@ test_expect_success 'show-ref -d' '
95
git show-ref --verify -d refs/tags/A refs/tags/C >actual &&
96
test_cmp expect actual &&
97
98
- echo $(git rev-parse refs/heads/master) refs/heads/master >expect &&
99
- git show-ref -d master >actual &&
98
+ echo $(git rev-parse refs/heads/main) refs/heads/main >expect &&
99
+ git show-ref -d main >actual &&
100
test_cmp expect actual &&
101
102
- git show-ref -d heads/master >actual &&
102
+ git show-ref -d heads/main >actual &&
103
test_cmp expect actual &&
104
105
- git show-ref -d refs/heads/master >actual &&
105
+ git show-ref -d refs/heads/main >actual &&
106
test_cmp expect actual &&
107
108
- git show-ref -d --verify refs/heads/master >actual &&
108
+ git show-ref -d --verify refs/heads/main >actual &&
109
test_cmp expect actual &&
110
111
- test_must_fail git show-ref -d --verify master >actual &&
111
+ test_must_fail git show-ref -d --verify main >actual &&
112
test_must_be_empty actual &&
113
114
- test_must_fail git show-ref -d --verify heads/master >actual &&
114
+ test_must_fail git show-ref -d --verify heads/main >actual &&
115
test_must_be_empty actual &&
116
117
test_must_fail git show-ref --verify -d A C >actual &&
@@ -123,7 +123,7 @@ test_expect_success 'show-ref -d' '
123
'
124
125
test_expect_success 'show-ref --heads, --tags, --head, pattern' '
126
- for branch in B master side
126
+ for branch in B main side
127
do
128
echo $(git rev-parse refs/heads/$branch) refs/heads/$branch
129
done >expect.heads &&
t/t1405-main-ref-store.sh
+22
-22
@@ -2,7 +2,7 @@
2
3
test_description='test main ref store api'
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
@@ -24,9 +24,9 @@ test_expect_success 'peel_ref(new-tag)' '
24
test_cmp expected actual
25
'
26
27
-test_expect_success 'create_symref(FOO, refs/heads/master)' '
28
- $RUN create-symref FOO refs/heads/master nothing &&
29
- echo refs/heads/master >expected &&
27
+test_expect_success 'create_symref(FOO, refs/heads/main)' '
28
+ $RUN create-symref FOO refs/heads/main nothing &&
29
+ echo refs/heads/main >expected &&
30
git symbolic-ref FOO >actual &&
31
test_cmp expected actual
32
'
@@ -34,7 +34,7 @@ test_expect_success 'create_symref(FOO, refs/heads/master)' '
34
test_expect_success 'delete_refs(FOO, refs/tags/new-tag)' '
35
git rev-parse FOO -- &&
36
git rev-parse refs/tags/new-tag -- &&
37
- m=$(git rev-parse master) &&
37
+ m=$(git rev-parse main) &&
38
REF_NO_DEREF=1 &&
39
$RUN delete-refs $REF_NO_DEREF nothing FOO refs/tags/new-tag &&
40
test_must_fail git rev-parse --symbolic-full-name FOO &&
@@ -42,19 +42,19 @@ test_expect_success 'delete_refs(FOO, refs/tags/new-tag)' '
42
test_must_fail git rev-parse refs/tags/new-tag --
43
'
44
45
-test_expect_success 'rename_refs(master, new-master)' '
46
- git rev-parse master >expected &&
47
- $RUN rename-ref refs/heads/master refs/heads/new-master &&
48
- git rev-parse new-master >actual &&
45
+test_expect_success 'rename_refs(main, new-main)' '
46
+ git rev-parse main >expected &&
47
+ $RUN rename-ref refs/heads/main refs/heads/new-main &&
48
+ git rev-parse new-main >actual &&
49
test_cmp expected actual &&
50
- test_commit recreate-master
50
+ test_commit recreate-main
51
'
52
53
test_expect_success 'for_each_ref(refs/heads/)' '
54
$RUN for-each-ref refs/heads/ | cut -d" " -f 2- >actual &&
55
cat >expected <<-\EOF &&
56
- master 0x0
57
- new-master 0x0
56
+ main 0x0
57
+ new-main 0x0
58
EOF
59
test_cmp expected actual
60
'
@@ -65,23 +65,23 @@ test_expect_success 'for_each_ref() is sorted' '
65
test_cmp expected actual
66
'
67
68
-test_expect_success 'resolve_ref(new-master)' '
69
- SHA1=`git rev-parse new-master` &&
70
- echo "$SHA1 refs/heads/new-master 0x0" >expected &&
71
- $RUN resolve-ref refs/heads/new-master 0 >actual &&
68
+test_expect_success 'resolve_ref(new-main)' '
69
+ SHA1=`git rev-parse new-main` &&
70
+ echo "$SHA1 refs/heads/new-main 0x0" >expected &&
71
+ $RUN resolve-ref refs/heads/new-main 0 >actual &&
72
test_cmp expected actual
73
'
74
75
-test_expect_success 'verify_ref(new-master)' '
76
- $RUN verify-ref refs/heads/new-master
75
+test_expect_success 'verify_ref(new-main)' '
76
+ $RUN verify-ref refs/heads/new-main
77
'
78
79
test_expect_success 'for_each_reflog()' '
80
$RUN for-each-reflog | sort -k2 | cut -d" " -f 2- >actual &&
81
cat >expected <<-\EOF &&
82
HEAD 0x1
83
- refs/heads/master 0x0
84
- refs/heads/new-master 0x0
83
+ refs/heads/main 0x0
84
+ refs/heads/new-main 0x0
85
EOF
86
test_cmp expected actual
87
'
@@ -89,12 +89,12 @@ test_expect_success 'for_each_reflog()' '
89
test_expect_success 'for_each_reflog_ent()' '
90
$RUN for-each-reflog-ent HEAD >actual &&
91
head -n1 actual | grep one &&
92
- tail -n2 actual | head -n1 | grep recreate-master
92
+ tail -n2 actual | head -n1 | grep recreate-main
93
'
94
95
test_expect_success 'for_each_reflog_ent_reverse()' '
96
$RUN for-each-reflog-ent-reverse HEAD >actual &&
97
- head -n1 actual | grep recreate-master &&
97
+ head -n1 actual | grep recreate-main &&
98
tail -n2 actual | head -n1 | grep one
99
'
100
t/t1406-submodule-ref-store.sh
+16
-16
@@ -2,7 +2,7 @@
2
3
test_description='test submodule ref store api'
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
@@ -14,7 +14,7 @@ test_expect_success 'setup' '
14
(
15
cd sub &&
16
test_commit first &&
17
- git checkout -b new-master
17
+ git checkout -b new-main
18
)
19
'
20
@@ -30,7 +30,7 @@ test_expect_success 'peel_ref(new-tag)' '
30
'
31
32
test_expect_success 'create_symref() not allowed' '
33
- test_must_fail $RUN create-symref FOO refs/heads/master nothing
33
+ test_must_fail $RUN create-symref FOO refs/heads/main nothing
34
'
35
36
test_expect_success 'delete_refs() not allowed' '
@@ -38,14 +38,14 @@ test_expect_success 'delete_refs() not allowed' '
38
'
39
40
test_expect_success 'rename_refs() not allowed' '
41
- test_must_fail $RUN rename-ref refs/heads/master refs/heads/new-master
41
+ test_must_fail $RUN rename-ref refs/heads/main refs/heads/new-main
42
'
43
44
test_expect_success 'for_each_ref(refs/heads/)' '
45
$RUN for-each-ref refs/heads/ | cut -d" " -f 2- >actual &&
46
cat >expected <<-\EOF &&
47
- master 0x0
48
- new-master 0x0
47
+ main 0x0
48
+ new-main 0x0
49
EOF
50
test_cmp expected actual
51
'
@@ -56,23 +56,23 @@ test_expect_success 'for_each_ref() is sorted' '
56
test_cmp expected actual
57
'
58
59
-test_expect_success 'resolve_ref(master)' '
60
- SHA1=`git -C sub rev-parse master` &&
61
- echo "$SHA1 refs/heads/master 0x0" >expected &&
62
- $RUN resolve-ref refs/heads/master 0 >actual &&
59
+test_expect_success 'resolve_ref(main)' '
60
+ SHA1=`git -C sub rev-parse main` &&
61
+ echo "$SHA1 refs/heads/main 0x0" >expected &&
62
+ $RUN resolve-ref refs/heads/main 0 >actual &&
63
test_cmp expected actual
64
'
65
66
-test_expect_success 'verify_ref(new-master)' '
67
- $RUN verify-ref refs/heads/new-master
66
+test_expect_success 'verify_ref(new-main)' '
67
+ $RUN verify-ref refs/heads/new-main
68
'
69
70
test_expect_success 'for_each_reflog()' '
71
$RUN for-each-reflog | sort | cut -d" " -f 2- >actual &&
72
cat >expected <<-\EOF &&
73
HEAD 0x1
74
- refs/heads/master 0x0
75
- refs/heads/new-master 0x0
74
+ refs/heads/main 0x0
75
+ refs/heads/new-main 0x0
76
EOF
77
test_cmp expected actual
78
'
@@ -80,12 +80,12 @@ test_expect_success 'for_each_reflog()' '
80
test_expect_success 'for_each_reflog_ent()' '
81
$RUN for-each-reflog-ent HEAD >actual &&
82
head -n1 actual | grep first &&
83
- tail -n2 actual | head -n1 | grep master.to.new
83
+ tail -n2 actual | head -n1 | grep main.to.new
84
'
85
86
test_expect_success 'for_each_reflog_ent_reverse()' '
87
$RUN for-each-reflog-ent-reverse HEAD >actual &&
88
- head -n1 actual | grep master.to.new &&
88
+ head -n1 actual | grep main.to.new &&
89
tail -n2 actual | head -n1 | grep first
90
'
91
t/t1407-worktree-ref-store.sh
+17
-17
@@ -2,7 +2,7 @@
2
3
test_description='test worktree ref store api'
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
@@ -12,7 +12,7 @@ RMAIN="test-tool ref-store worktree:main"
12
13
test_expect_success 'setup' '
14
test_commit first &&
15
- git worktree add -b wt-master wt &&
15
+ git worktree add -b wt-main wt &&
16
(
17
cd wt &&
18
test_commit second
@@ -20,34 +20,34 @@ test_expect_success 'setup' '
20
'
21
22
test_expect_success 'resolve_ref(<shared-ref>)' '
23
- SHA1=`git rev-parse master` &&
24
- echo "$SHA1 refs/heads/master 0x0" >expected &&
25
- $RWT resolve-ref refs/heads/master 0 >actual &&
23
+ SHA1=`git rev-parse main` &&
24
+ echo "$SHA1 refs/heads/main 0x0" >expected &&
25
+ $RWT resolve-ref refs/heads/main 0 >actual &&
26
test_cmp expected actual &&
27
- $RMAIN resolve-ref refs/heads/master 0 >actual &&
27
+ $RMAIN resolve-ref refs/heads/main 0 >actual &&
28
test_cmp expected actual
29
'
30
31
test_expect_success 'resolve_ref(<per-worktree-ref>)' '
32
SHA1=`git -C wt rev-parse HEAD` &&
33
- echo "$SHA1 refs/heads/wt-master 0x1" >expected &&
33
+ echo "$SHA1 refs/heads/wt-main 0x1" >expected &&
34
$RWT resolve-ref HEAD 0 >actual &&
35
test_cmp expected actual &&
36
37
SHA1=`git rev-parse HEAD` &&
38
- echo "$SHA1 refs/heads/master 0x1" >expected &&
38
+ echo "$SHA1 refs/heads/main 0x1" >expected &&
39
$RMAIN resolve-ref HEAD 0 >actual &&
40
test_cmp expected actual
41
'
42
43
-test_expect_success 'create_symref(FOO, refs/heads/master)' '
44
- $RWT create-symref FOO refs/heads/master nothing &&
45
- echo refs/heads/master >expected &&
43
+test_expect_success 'create_symref(FOO, refs/heads/main)' '
44
+ $RWT create-symref FOO refs/heads/main nothing &&
45
+ echo refs/heads/main >expected &&
46
git -C wt symbolic-ref FOO >actual &&
47
test_cmp expected actual &&
48
49
- $RMAIN create-symref FOO refs/heads/wt-master nothing &&
50
- echo refs/heads/wt-master >expected &&
49
+ $RMAIN create-symref FOO refs/heads/wt-main nothing &&
50
+ echo refs/heads/wt-main >expected &&
51
git symbolic-ref FOO >actual &&
52
test_cmp expected actual
53
'
@@ -66,8 +66,8 @@ test_expect_success 'for_each_reflog()' '
66
HEAD 0x1
67
PSEUDO-WT 0x0
68
refs/bisect/wt-random 0x0
69
- refs/heads/master 0x0
70
- refs/heads/wt-master 0x0
69
+ refs/heads/main 0x0
70
+ refs/heads/wt-main 0x0
71
EOF
72
test_cmp expected actual &&
73
@@ -76,8 +76,8 @@ test_expect_success 'for_each_reflog()' '
76
HEAD 0x1
77
PSEUDO-MAIN 0x0
78
refs/bisect/random 0x0
79
- refs/heads/master 0x0
80
- refs/heads/wt-master 0x0
79
+ refs/heads/main 0x0
80
+ refs/heads/wt-main 0x0
81
EOF
82
test_cmp expected actual
83
'
t/t1408-packed-refs.sh
+7
-7
@@ -2,7 +2,7 @@
2
3
test_description='packed-refs entries are covered by loose refs'
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
@@ -12,32 +12,32 @@ test_expect_success setup '
12
git commit --allow-empty -m one &&
13
one=$(git rev-parse HEAD) &&
14
git for-each-ref >actual &&
15
- echo "$one commit refs/heads/master" >expect &&
15
+ echo "$one commit refs/heads/main" >expect &&
16
test_cmp expect actual &&
17
18
git pack-refs --all &&
19
git for-each-ref >actual &&
20
- echo "$one commit refs/heads/master" >expect &&
20
+ echo "$one commit refs/heads/main" >expect &&
21
test_cmp expect actual &&
22
23
git checkout --orphan another &&
24
test_tick &&
25
git commit --allow-empty -m two &&
26
two=$(git rev-parse HEAD) &&
27
- git checkout -B master &&
27
+ git checkout -B main &&
28
git branch -D another &&
29
30
git for-each-ref >actual &&
31
- echo "$two commit refs/heads/master" >expect &&
31
+ echo "$two commit refs/heads/main" >expect &&
32
test_cmp expect actual &&
33
34
git reflog expire --expire=now --all &&
35
git prune &&
36
- git tag -m v1.0 v1.0 master
36
+ git tag -m v1.0 v1.0 main
37
'
38
39
test_expect_success 'no error from stale entry in packed-refs' '
40
- git describe master >actual 2>&1 &&
40
+ git describe main >actual 2>&1 &&
41
echo "v1.0" >expect &&
42
test_cmp expect actual
43
'
t/t1410-reflog.sh
+29
-29
@@ -4,7 +4,7 @@
4
#
5
6
test_description='Test prune and reflog expiration'
7
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
7
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
8
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
9
10
. ./test-lib.sh
@@ -102,7 +102,7 @@ test_expect_success setup '
102
103
check_fsck &&
104
105
- git reflog refs/heads/master >output &&
105
+ git reflog refs/heads/main >output &&
106
test_line_count = 4 output
107
'
108
@@ -119,7 +119,7 @@ test_expect_success rewind '
119
120
check_have A B C D E F G H I J K L &&
121
122
- git reflog refs/heads/master >output &&
122
+ git reflog refs/heads/main >output &&
123
test_line_count = 5 output
124
'
125
@@ -138,7 +138,7 @@ test_expect_success 'reflog expire --dry-run should not touch reflog' '
138
--stale-fix \
139
--all &&
140
141
- git reflog refs/heads/master >output &&
141
+ git reflog refs/heads/main >output &&
142
test_line_count = 5 output &&
143
144
check_fsck "missing blob $F"
@@ -152,7 +152,7 @@ test_expect_success 'reflog expire' '
152
--stale-fix \
153
--all &&
154
155
- git reflog refs/heads/master >output &&
155
+ git reflog refs/heads/main >output &&
156
test_line_count = 2 output &&
157
158
check_fsck "dangling commit $K"
@@ -189,29 +189,29 @@ test_expect_success 'delete' '
189
git commit -m tiger C &&
190
191
HEAD_entry_count=$(git reflog | wc -l) &&
192
- master_entry_count=$(git reflog show master | wc -l) &&
192
+ main_entry_count=$(git reflog show main | wc -l) &&
193
194
test $HEAD_entry_count = 5 &&
195
- test $master_entry_count = 5 &&
195
+ test $main_entry_count = 5 &&
196
197
198
- git reflog delete master@{1} &&
199
- git reflog show master > output &&
200
- test_line_count = $(($master_entry_count - 1)) output &&
198
+ git reflog delete main@{1} &&
199
+ git reflog show main > output &&
200
+ test_line_count = $(($main_entry_count - 1)) output &&
201
test $HEAD_entry_count = $(git reflog | wc -l) &&
202
! grep ox < output &&
203
204
- master_entry_count=$(wc -l < output) &&
204
+ main_entry_count=$(wc -l < output) &&
205
206
git reflog delete HEAD@{1} &&
207
test $(($HEAD_entry_count -1)) = $(git reflog | wc -l) &&
208
- test $master_entry_count = $(git reflog show master | wc -l) &&
208
+ test $main_entry_count = $(git reflog show main | wc -l) &&
209
210
HEAD_entry_count=$(git reflog | wc -l) &&
211
212
- git reflog delete master@{07.04.2005.15:15:00.-0700} &&
213
- git reflog show master > output &&
214
- test_line_count = $(($master_entry_count - 1)) output &&
212
+ git reflog delete main@{07.04.2005.15:15:00.-0700} &&
213
+ git reflog show main > output &&
214
+ test_line_count = $(($main_entry_count - 1)) output &&
215
! grep dragon < output
216
217
'
@@ -219,7 +219,7 @@ test_expect_success 'delete' '
219
test_expect_success 'rewind2' '
220
221
test_tick && git reset --hard HEAD~2 &&
222
- git reflog refs/heads/master >output &&
222
+ git reflog refs/heads/main >output &&
223
test_line_count = 4 output
224
'
225
@@ -229,7 +229,7 @@ test_expect_success '--expire=never' '
229
--expire=never \
230
--expire-unreachable=never \
231
--all &&
232
- git reflog refs/heads/master >output &&
232
+ git reflog refs/heads/main >output &&
233
test_line_count = 4 output
234
'
235
@@ -240,7 +240,7 @@ test_expect_success 'gc.reflogexpire=never' '
240
git reflog expire --verbose --all >output &&
241
test_line_count = 9 output &&
242
243
- git reflog refs/heads/master >output &&
243
+ git reflog refs/heads/main >output &&
244
test_line_count = 4 output
245
'
246
@@ -249,7 +249,7 @@ test_expect_success 'gc.reflogexpire=false' '
249
test_config gc.reflogexpireunreachable false &&
250
251
git reflog expire --verbose --all &&
252
- git reflog refs/heads/master >output &&
252
+ git reflog refs/heads/main >output &&
253
test_line_count = 4 output
254
255
'
@@ -258,33 +258,33 @@ test_expect_success 'git reflog expire unknown reference' '
258
test_config gc.reflogexpire never &&
259
test_config gc.reflogexpireunreachable never &&
260
261
- test_must_fail git reflog expire master@{123} 2>stderr &&
261
+ test_must_fail git reflog expire main@{123} 2>stderr &&
262
test_i18ngrep "points nowhere" stderr &&
263
test_must_fail git reflog expire does-not-exist 2>stderr &&
264
test_i18ngrep "points nowhere" stderr
265
'
266
267
test_expect_success 'checkout should not delete log for packed ref' '
268
- test $(git reflog master | wc -l) = 4 &&
268
+ test $(git reflog main | wc -l) = 4 &&
269
git branch foo &&
270
git pack-refs --all &&
271
git checkout foo &&
272
- test $(git reflog master | wc -l) = 4
272
+ test $(git reflog main | wc -l) = 4
273
'
274
275
test_expect_success 'stale dirs do not cause d/f conflicts (reflogs on)' '
276
test_when_finished "git branch -d one || git branch -d one/two" &&
277
278
- git branch one/two master &&
279
- echo "one/two@{0} branch: Created from master" >expect &&
278
+ git branch one/two main &&
279
+ echo "one/two@{0} branch: Created from main" >expect &&
280
git log -g --format="%gd %gs" one/two >actual &&
281
test_cmp expect actual &&
282
git branch -d one/two &&
283
284
# now logs/refs/heads/one is a stale directory, but
285
# we should move it out of the way to create "one" reflog
286
- git branch one master &&
287
- echo "one@{0} branch: Created from master" >expect &&
286
+ git branch one main &&
287
+ echo "one@{0} branch: Created from main" >expect &&
288
git log -g --format="%gd %gs" one >actual &&
289
test_cmp expect actual
290
'
@@ -292,15 +292,15 @@ test_expect_success 'stale dirs do not cause d/f conflicts (reflogs on)' '
292
test_expect_success 'stale dirs do not cause d/f conflicts (reflogs off)' '
293
test_when_finished "git branch -d one || git branch -d one/two" &&
294
295
- git branch one/two master &&
296
- echo "one/two@{0} branch: Created from master" >expect &&
295
+ git branch one/two main &&
296
+ echo "one/two@{0} branch: Created from main" >expect &&
297
git log -g --format="%gd %gs" one/two >actual &&
298
test_cmp expect actual &&
299
git branch -d one/two &&
300
301
# same as before, but we only create a reflog for "one" if
302
# it already exists, which it does not
303
- git -c core.logallrefupdates=false branch one master &&
303
+ git -c core.logallrefupdates=false branch one main &&
304
git log -g --format="%gd %gs" one >actual &&
305
test_must_be_empty actual
306
'
t/t1411-reflog-show.sh
+2
-2
@@ -1,7 +1,7 @@
1
#!/bin/sh
2
3
test_description='Test reflog display routines'
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
@@ -170,7 +170,7 @@ test_expect_success 'git log -g -p shows diffs vs. parents' '
170
'
171
172
test_expect_success 'reflog exists works' '
173
- git reflog exists refs/heads/master &&
173
+ git reflog exists refs/heads/main &&
174
! git reflog exists refs/heads/nonexistent
175
'
176
t/t1413-reflog-detach.sh
+13
-13
@@ -1,13 +1,13 @@
1
#!/bin/sh
2
3
test_description='Test reflog interaction with detached HEAD'
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
8
9
reset_state () {
10
- git checkout master &&
10
+ git checkout main &&
11
cp saved_reflog .git/logs/HEAD
12
}
13
@@ -22,14 +22,14 @@ test_expect_success setup '
22
23
test_expect_success baseline '
24
reset_state &&
25
- git rev-parse master master^ >expect &&
25
+ git rev-parse main main^ >expect &&
26
git log -g --format=%H >actual &&
27
test_cmp expect actual
28
'
29
30
test_expect_success 'switch to branch' '
31
reset_state &&
32
- git rev-parse side master master^ >expect &&
32
+ git rev-parse side main main^ >expect &&
33
git checkout side &&
34
git log -g --format=%H >actual &&
35
test_cmp expect actual
@@ -37,34 +37,34 @@ test_expect_success 'switch to branch' '
37
38
test_expect_success 'detach to other' '
39
reset_state &&
40
- git rev-parse master side master master^ >expect &&
40
+ git rev-parse main side main main^ >expect &&
41
git checkout side &&
42
- git checkout master^0 &&
42
+ git checkout main^0 &&
43
git log -g --format=%H >actual &&
44
test_cmp expect actual
45
'
46
47
test_expect_success 'detach to self' '
48
reset_state &&
49
- git rev-parse master master master^ >expect &&
50
- git checkout master^0 &&
49
+ git rev-parse main main main^ >expect &&
50
+ git checkout main^0 &&
51
git log -g --format=%H >actual &&
52
test_cmp expect actual
53
'
54
55
test_expect_success 'attach to self' '
56
reset_state &&
57
- git rev-parse master master master master^ >expect &&
58
- git checkout master^0 &&
59
- git checkout master &&
57
+ git rev-parse main main main main^ >expect &&
58
+ git checkout main^0 &&
59
+ git checkout main &&
60
git log -g --format=%H >actual &&
61
test_cmp expect actual
62
'
63
64
test_expect_success 'attach to other' '
65
reset_state &&
66
- git rev-parse side master master master^ >expect &&
67
- git checkout master^0 &&
66
+ git rev-parse side main main main^ >expect &&
67
+ git checkout main^0 &&
68
git checkout side &&
69
git log -g --format=%H >actual &&
70
test_cmp expect actual
t/t1414-reflog-walk.sh
+7
-7
@@ -1,7 +1,7 @@
1
#!/bin/sh
2
3
test_description='various tests of reflog walk (log -g) behavior'
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
@@ -11,7 +11,7 @@ test_expect_success 'set up some reflog entries' '
11
test_commit two &&
12
git checkout -b side HEAD^ &&
13
test_commit three &&
14
- git merge --no-commit master &&
14
+ git merge --no-commit main &&
15
echo evil-merge-content >>one.t &&
16
test_tick &&
17
git commit --no-edit -a
@@ -23,9 +23,9 @@ do_walk () {
23
24
test_expect_success 'set up expected reflog' '
25
cat >expect.all <<-EOF
26
- HEAD@{0} commit (merge): Merge branch ${SQ}master${SQ} into side
26
+ HEAD@{0} commit (merge): Merge branch ${SQ}main${SQ} into side
27
HEAD@{1} commit: three
28
- HEAD@{2} checkout: moving from master to side
28
+ HEAD@{2} checkout: moving from main to side
29
HEAD@{3} commit: two
30
HEAD@{4} commit (initial): one
31
EOF
@@ -76,15 +76,15 @@ test_expect_success 'walking multiple reflogs shows all' '
76
# sort ignores the bits after the timestamp.
77
#
78
# 2. POSIX leaves undefined whether this is a stable sort or not. So
79
- # we use "-k 1" to ensure that we see HEAD before master before
79
+ # we use "-k 1" to ensure that we see HEAD before main before
80
# side when breaking ties.
81
{
82
do_walk --date=unix HEAD &&
83
do_walk --date=unix side &&
84
- do_walk --date=unix master
84
+ do_walk --date=unix main
85
} >expect.raw &&
86
sort -t "{" -k 2nr -k 1 <expect.raw >expect &&
87
- do_walk --date=unix HEAD master side >actual &&
87
+ do_walk --date=unix HEAD main side >actual &&
88
test_cmp expect actual
89
'
90
t/t1416-ref-transaction-hooks.sh
+6
-6
@@ -2,7 +2,7 @@
2
3
test_description='reference transaction 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
@@ -56,11 +56,11 @@ test_expect_success 'hook gets all queued updates in prepared state' '
56
EOF
57
cat >expect <<-EOF &&
58
$ZERO_OID $POST_OID HEAD
59
- $ZERO_OID $POST_OID refs/heads/master
59
+ $ZERO_OID $POST_OID refs/heads/main
60
EOF
61
git update-ref HEAD POST <<-EOF &&
62
update HEAD $ZERO_OID $POST_OID
63
- update refs/heads/master $ZERO_OID $POST_OID
63
+ update refs/heads/main $ZERO_OID $POST_OID
64
EOF
65
test_cmp expect actual
66
'
@@ -79,7 +79,7 @@ test_expect_success 'hook gets all queued updates in committed state' '
79
EOF
80
cat >expect <<-EOF &&
81
$ZERO_OID $POST_OID HEAD
82
- $ZERO_OID $POST_OID refs/heads/master
82
+ $ZERO_OID $POST_OID refs/heads/main
83
EOF
84
git update-ref HEAD POST &&
85
test_cmp expect actual
@@ -99,12 +99,12 @@ test_expect_success 'hook gets all queued updates in aborted state' '
99
EOF
100
cat >expect <<-EOF &&
101
$ZERO_OID $POST_OID HEAD
102
- $ZERO_OID $POST_OID refs/heads/master
102
+ $ZERO_OID $POST_OID refs/heads/main
103
EOF
104
git update-ref --stdin <<-EOF &&
105
start
106
update HEAD POST $ZERO_OID
107
- update refs/heads/master POST $ZERO_OID
107
+ update refs/heads/main POST $ZERO_OID
108
abort
109
EOF
110
test_cmp expect actual
t/t1430-bad-ref-name.sh
+27
-27
@@ -1,7 +1,7 @@
1
#!/bin/sh
2
3
test_description='Test handling of ref names that check-ref-format rejects'
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 'fast-import: fail on invalid branch name ".badbranchname"'
20
corrupt
21
COMMIT
22
23
- from refs/heads/master
23
+ from refs/heads/main
24
25
INPUT_END
26
test_must_fail git fast-import <input
@@ -35,14 +35,14 @@ test_expect_success 'fast-import: fail on invalid branch name "bad[branch]name"'
35
corrupt
36
COMMIT
37
38
- from refs/heads/master
38
+ from refs/heads/main
39
40
INPUT_END
41
test_must_fail git fast-import <input
42
'
43
44
test_expect_success 'git branch shows badly named ref as warning' '
45
- cp .git/refs/heads/master .git/refs/heads/broken...ref &&
45
+ cp .git/refs/heads/main .git/refs/heads/broken...ref &&
46
test_when_finished "rm -f .git/refs/heads/broken...ref" &&
47
git branch >output 2>error &&
48
test_i18ngrep -e "ignoring ref with broken name refs/heads/broken\.\.\.ref" error &&
@@ -50,7 +50,7 @@ test_expect_success 'git branch shows badly named ref as warning' '
50
'
51
52
test_expect_success 'branch -d can delete badly named ref' '
53
- cp .git/refs/heads/master .git/refs/heads/broken...ref &&
53
+ cp .git/refs/heads/main .git/refs/heads/broken...ref &&
54
test_when_finished "rm -f .git/refs/heads/broken...ref" &&
55
git branch -d broken...ref &&
56
git branch >output 2>error &&
@@ -59,7 +59,7 @@ test_expect_success 'branch -d can delete badly named ref' '
59
'
60
61
test_expect_success 'branch -D can delete badly named ref' '
62
- cp .git/refs/heads/master .git/refs/heads/broken...ref &&
62
+ cp .git/refs/heads/main .git/refs/heads/broken...ref &&
63
test_when_finished "rm -f .git/refs/heads/broken...ref" &&
64
git branch -D broken...ref &&
65
git branch >output 2>error &&
@@ -101,17 +101,17 @@ test_expect_success 'branch -m cannot rename to a bad ref name' '
101
test_might_fail git branch -D goodref &&
102
git branch goodref &&
103
test_must_fail git branch -m goodref broken...ref &&
104
- test_cmp_rev master goodref &&
104
+ test_cmp_rev main goodref &&
105
git branch >output 2>error &&
106
! grep -e "broken\.\.\.ref" error &&
107
! grep -e "broken\.\.\.ref" output
108
'
109
110
test_expect_failure 'branch -m can rename from a bad ref name' '
111
- cp .git/refs/heads/master .git/refs/heads/broken...ref &&
111
+ cp .git/refs/heads/main .git/refs/heads/broken...ref &&
112
test_when_finished "rm -f .git/refs/heads/broken...ref" &&
113
git branch -m broken...ref renamed &&
114
- test_cmp_rev master renamed &&
114
+ test_cmp_rev main renamed &&
115
git branch >output 2>error &&
116
! grep -e "broken\.\.\.ref" error &&
117
! grep -e "broken\.\.\.ref" output
@@ -138,7 +138,7 @@ test_expect_failure C_LOCALE_OUTPUT 'push --mirror can delete badly named ref' '
138
cd dest &&
139
test_commit two &&
140
git checkout --detach &&
141
- cp .git/refs/heads/master .git/refs/heads/broken...ref
141
+ cp .git/refs/heads/main .git/refs/heads/broken...ref
142
) &&
143
git -C src push --mirror "file://$top/dest" &&
144
git -C dest branch >output 2>error &&
@@ -149,7 +149,7 @@ test_expect_failure C_LOCALE_OUTPUT 'push --mirror can delete badly named ref' '
149
test_expect_success 'rev-parse skips symref pointing to broken name' '
150
test_when_finished "rm -f .git/refs/heads/broken...ref" &&
151
git branch shadow one &&
152
- cp .git/refs/heads/master .git/refs/heads/broken...ref &&
152
+ cp .git/refs/heads/main .git/refs/heads/broken...ref &&
153
printf "ref: refs/heads/broken...ref\n" >.git/refs/tags/shadow &&
154
test_when_finished "rm -f .git/refs/tags/shadow" &&
155
git rev-parse --verify one >expect &&
@@ -159,11 +159,11 @@ test_expect_success 'rev-parse skips symref pointing to broken name' '
159
'
160
161
test_expect_success 'for-each-ref emits warnings for broken names' '
162
- cp .git/refs/heads/master .git/refs/heads/broken...ref &&
162
+ cp .git/refs/heads/main .git/refs/heads/broken...ref &&
163
test_when_finished "rm -f .git/refs/heads/broken...ref" &&
164
printf "ref: refs/heads/broken...ref\n" >.git/refs/heads/badname &&
165
test_when_finished "rm -f .git/refs/heads/badname" &&
166
- printf "ref: refs/heads/master\n" >.git/refs/heads/broken...symref &&
166
+ printf "ref: refs/heads/main\n" >.git/refs/heads/broken...symref &&
167
test_when_finished "rm -f .git/refs/heads/broken...symref" &&
168
git for-each-ref >output 2>error &&
169
! grep -e "broken\.\.\.ref" output &&
@@ -175,7 +175,7 @@ test_expect_success 'for-each-ref emits warnings for broken names' '
175
'
176
177
test_expect_success 'update-ref -d can delete broken name' '
178
- cp .git/refs/heads/master .git/refs/heads/broken...ref &&
178
+ cp .git/refs/heads/main .git/refs/heads/broken...ref &&
179
test_when_finished "rm -f .git/refs/heads/broken...ref" &&
180
git update-ref -d refs/heads/broken...ref >output 2>error &&
181
test_must_be_empty output &&
@@ -186,7 +186,7 @@ test_expect_success 'update-ref -d can delete broken name' '
186
'
187
188
test_expect_success 'branch -d can delete broken name' '
189
- cp .git/refs/heads/master .git/refs/heads/broken...ref &&
189
+ cp .git/refs/heads/main .git/refs/heads/broken...ref &&
190
test_when_finished "rm -f .git/refs/heads/broken...ref" &&
191
git branch -d broken...ref >output 2>error &&
192
test_i18ngrep "Deleted branch broken...ref (was broken)" output &&
@@ -197,7 +197,7 @@ test_expect_success 'branch -d can delete broken name' '
197
'
198
199
test_expect_success 'update-ref --no-deref -d can delete symref to broken name' '
200
- cp .git/refs/heads/master .git/refs/heads/broken...ref &&
200
+ cp .git/refs/heads/main .git/refs/heads/broken...ref &&
201
test_when_finished "rm -f .git/refs/heads/broken...ref" &&
202
printf "ref: refs/heads/broken...ref\n" >.git/refs/heads/badname &&
203
test_when_finished "rm -f .git/refs/heads/badname" &&
@@ -208,7 +208,7 @@ test_expect_success 'update-ref --no-deref -d can delete symref to broken name'
208
'
209
210
test_expect_success 'branch -d can delete symref to broken name' '
211
- cp .git/refs/heads/master .git/refs/heads/broken...ref &&
211
+ cp .git/refs/heads/main .git/refs/heads/broken...ref &&
212
test_when_finished "rm -f .git/refs/heads/broken...ref" &&
213
printf "ref: refs/heads/broken...ref\n" >.git/refs/heads/badname &&
214
test_when_finished "rm -f .git/refs/heads/badname" &&
@@ -237,7 +237,7 @@ test_expect_success 'branch -d can delete dangling symref to broken name' '
237
'
238
239
test_expect_success 'update-ref -d can delete broken name through symref' '
240
- cp .git/refs/heads/master .git/refs/heads/broken...ref &&
240
+ cp .git/refs/heads/main .git/refs/heads/broken...ref &&
241
test_when_finished "rm -f .git/refs/heads/broken...ref" &&
242
printf "ref: refs/heads/broken...ref\n" >.git/refs/heads/badname &&
243
test_when_finished "rm -f .git/refs/heads/badname" &&
@@ -248,7 +248,7 @@ test_expect_success 'update-ref -d can delete broken name through symref' '
248
'
249
250
test_expect_success 'update-ref --no-deref -d can delete symref with broken name' '
251
- printf "ref: refs/heads/master\n" >.git/refs/heads/broken...symref &&
251
+ printf "ref: refs/heads/main\n" >.git/refs/heads/broken...symref &&
252
test_when_finished "rm -f .git/refs/heads/broken...symref" &&
253
git update-ref --no-deref -d refs/heads/broken...symref >output 2>error &&
254
test_path_is_missing .git/refs/heads/broken...symref &&
@@ -257,11 +257,11 @@ test_expect_success 'update-ref --no-deref -d can delete symref with broken name
257
'
258
259
test_expect_success 'branch -d can delete symref with broken name' '
260
- printf "ref: refs/heads/master\n" >.git/refs/heads/broken...symref &&
260
+ printf "ref: refs/heads/main\n" >.git/refs/heads/broken...symref &&
261
test_when_finished "rm -f .git/refs/heads/broken...symref" &&
262
git branch -d broken...symref >output 2>error &&
263
test_path_is_missing .git/refs/heads/broken...symref &&
264
- test_i18ngrep "Deleted branch broken...symref (was refs/heads/master)" output &&
264
+ test_i18ngrep "Deleted branch broken...symref (was refs/heads/main)" output &&
265
test_must_be_empty error
266
'
267
@@ -299,37 +299,37 @@ test_expect_success 'update-ref -d cannot delete absolute path' '
299
'
300
301
test_expect_success 'update-ref --stdin fails create with bad ref name' '
302
- echo "create ~a refs/heads/master" >stdin &&
302
+ echo "create ~a refs/heads/main" >stdin &&
303
test_must_fail git update-ref --stdin <stdin 2>err &&
304
grep "fatal: invalid ref format: ~a" err
305
'
306
307
test_expect_success 'update-ref --stdin fails update with bad ref name' '
308
- echo "update ~a refs/heads/master" >stdin &&
308
+ echo "update ~a refs/heads/main" >stdin &&
309
test_must_fail git update-ref --stdin <stdin 2>err &&
310
grep "fatal: invalid ref format: ~a" err
311
'
312
313
test_expect_success 'update-ref --stdin fails delete with bad ref name' '
314
- echo "delete ~a refs/heads/master" >stdin &&
314
+ echo "delete ~a refs/heads/main" >stdin &&
315
test_must_fail git update-ref --stdin <stdin 2>err &&
316
grep "fatal: invalid ref format: ~a" err
317
'
318
319
test_expect_success 'update-ref --stdin -z fails create with bad ref name' '
320
- printf "%s\0" "create ~a " refs/heads/master >stdin &&
320
+ printf "%s\0" "create ~a " refs/heads/main >stdin &&
321
test_must_fail git update-ref -z --stdin <stdin 2>err &&
322
grep "fatal: invalid ref format: ~a " err
323
'
324
325
test_expect_success 'update-ref --stdin -z fails update with bad ref name' '
326
- printf "%s\0" "update ~a" refs/heads/master "" >stdin &&
326
+ printf "%s\0" "update ~a" refs/heads/main "" >stdin &&
327
test_must_fail git update-ref -z --stdin <stdin 2>err &&
328
grep "fatal: invalid ref format: ~a" err
329
'
330
331
test_expect_success 'update-ref --stdin -z fails delete with bad ref name' '
332
- printf "%s\0" "delete ~a" refs/heads/master >stdin &&
332
+ printf "%s\0" "delete ~a" refs/heads/main >stdin &&
333
test_must_fail git update-ref -z --stdin <stdin 2>err &&
334
grep "fatal: invalid ref format: ~a" err
335
'
t/t1450-fsck.sh
+1
-1
@@ -3,7 +3,7 @@
3
test_description='git fsck random collection of tests
4
5
* (HEAD) B
6
-* (master) A
6
+* (main) A
7
'
8
9
. ./test-lib.sh
t/t1500-rev-parse.sh
+3
-3
@@ -1,7 +1,7 @@
1
#!/bin/sh
2
3
test_description='test git rev-parse'
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
@@ -177,8 +177,8 @@ test_expect_success 'showing the superproject correctly' '
177
test_commit -C super/dir/sub branch1_commit &&
178
git -C super add dir/sub &&
179
test_commit -C super branch1_commit &&
180
- git -C super checkout -b branch2 master &&
181
- git -C super/dir/sub checkout -b branch2 master &&
180
+ git -C super checkout -b branch2 main &&
181
+ git -C super/dir/sub checkout -b branch2 main &&
182
test_commit -C super/dir/sub branch2_commit &&
183
git -C super add dir/sub &&
184
test_commit -C super branch2_commit &&
t/t1503-rev-parse-verify.sh
+15
-15
@@ -6,7 +6,7 @@ test_description='test git rev-parse --verify'
6
7
exec </dev/null
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
@@ -54,8 +54,8 @@ test_expect_success 'works with one good rev' '
54
test "$rev_hash3" = "$HASH3" &&
55
rev_hash4=$(git rev-parse --verify $HASH4) &&
56
test "$rev_hash4" = "$HASH4" &&
57
- rev_master=$(git rev-parse --verify master) &&
58
- test "$rev_master" = "$HASH4" &&
57
+ rev_main=$(git rev-parse --verify main) &&
58
+ test "$rev_main" = "$HASH4" &&
59
rev_head=$(git rev-parse --verify HEAD) &&
60
test "$rev_head" = "$HASH4"
61
'
@@ -119,27 +119,27 @@ test_expect_success 'no stdout output on error' '
119
'
120
121
test_expect_success 'use --default' '
122
- git rev-parse --verify --default master &&
123
- git rev-parse --verify --default master HEAD &&
124
- git rev-parse --default master --verify &&
125
- git rev-parse --default master --verify HEAD &&
126
- git rev-parse --verify HEAD --default master &&
127
- test_must_fail git rev-parse --verify foo --default master &&
122
+ git rev-parse --verify --default main &&
123
+ git rev-parse --verify --default main HEAD &&
124
+ git rev-parse --default main --verify &&
125
+ git rev-parse --default main --verify HEAD &&
126
+ git rev-parse --verify HEAD --default main &&
127
+ test_must_fail git rev-parse --verify foo --default main &&
128
test_must_fail git rev-parse --default HEAD --verify bar &&
129
test_must_fail git rev-parse --verify --default HEAD baz &&
130
test_must_fail git rev-parse --default foo --verify &&
131
test_must_fail git rev-parse --verify --default bar
132
'
133
134
-test_expect_success 'master@{n} for various n' '
134
+test_expect_success 'main@{n} for various n' '
135
N=$(git reflog | wc -l) &&
136
Nm1=$(($N-1)) &&
137
Np1=$(($N+1)) &&
138
- git rev-parse --verify master@{0} &&
139
- git rev-parse --verify master@{1} &&
140
- git rev-parse --verify master@{$Nm1} &&
141
- test_must_fail git rev-parse --verify master@{$N} &&
142
- test_must_fail git rev-parse --verify master@{$Np1}
138
+ git rev-parse --verify main@{0} &&
139
+ git rev-parse --verify main@{1} &&
140
+ git rev-parse --verify main@{$Nm1} &&
141
+ test_must_fail git rev-parse --verify main@{$N} &&
142
+ test_must_fail git rev-parse --verify main@{$Np1}
143
'
144
145
test_expect_success SYMLINKS 'ref resolution not confused by broken symlinks' '
t/t1505-rev-parse-last.sh
+5
-5
@@ -2,7 +2,7 @@
2
3
test_description='test @{-N} syntax'
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
@@ -23,12 +23,12 @@ test_expect_success 'setup' '
23
make_commit 3 &&
24
git checkout side &&
25
make_commit 4 &&
26
- git merge master &&
27
- git checkout master
26
+ git merge main &&
27
+ git checkout main
28
29
'
30
31
-# 1 -- 2 -- 3 master
31
+# 1 -- 2 -- 3 main
32
# \ \
33
# \ \
34
# --- 4 --- 5 side
@@ -52,7 +52,7 @@ test_expect_success '@{-1}@{1} works' '
52
'
53
54
test_expect_success '@{-2} works' '
55
- test_cmp_rev master @{-2}
55
+ test_cmp_rev main @{-2}
56
'
57
58
test_expect_success '@{-3} fails' '
t/t1506-rev-parse-diagnosis.sh
+3
-3
@@ -4,7 +4,7 @@ test_description='test git rev-parse diagnosis for invalid argument'
4
5
exec </dev/null
6
7
-GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
7
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
8
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
9
10
. ./test-lib.sh
@@ -140,10 +140,10 @@ test_expect_success 'incorrect file in :path and :N:path' '
140
'
141
142
test_expect_success 'invalid @{n} reference' '
143
- test_must_fail git rev-parse master@{99999} >output 2>error &&
143
+ test_must_fail git rev-parse main@{99999} >output 2>error &&
144
test_must_be_empty output &&
145
test_i18ngrep "log for [^ ]* only has [0-9][0-9]* entries" error &&
146
- test_must_fail git rev-parse --verify master@{99999} >output 2>error &&
146
+ test_must_fail git rev-parse --verify main@{99999} >output 2>error &&
147
test_must_be_empty output &&
148
test_i18ngrep "log for [^ ]* only has [0-9][0-9]* entries" error
149
'
t/t1507-rev-parse-upstream.sh
+21
-21
@@ -2,7 +2,7 @@
2
3
test_description='test <branch>@{upstream} syntax'
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
@@ -13,20 +13,20 @@ test_expect_success 'setup' '
13
test_commit 1 &&
14
git checkout -b side &&
15
test_commit 2 &&
16
- git checkout master &&
16
+ git checkout main &&
17
git clone . clone &&
18
test_commit 3 &&
19
(cd clone &&
20
test_commit 4 &&
21
git branch --track my-side origin/side &&
22
- git branch --track local-master master &&
22
+ git branch --track local-main main &&
23
git branch --track fun@ny origin/side &&
24
git branch --track @funny origin/side &&
25
git branch --track funny@ origin/side &&
26
- git remote add -t master master-only .. &&
27
- git fetch master-only &&
26
+ git remote add -t main main-only .. &&
27
+ git fetch main-only &&
28
git branch bad-upstream &&
29
- git config branch.bad-upstream.remote master-only &&
29
+ git config branch.bad-upstream.remote main-only &&
30
git config branch.bad-upstream.merge refs/heads/side
31
)
32
'
@@ -42,7 +42,7 @@ error_message () {
42
}
43
44
test_expect_success '@{upstream} resolves to correct full name' '
45
- echo refs/remotes/origin/master >expect &&
45
+ echo refs/remotes/origin/main >expect &&
46
git -C clone rev-parse --symbolic-full-name @{upstream} >actual &&
47
test_cmp expect actual &&
48
git -C clone rev-parse --symbolic-full-name @{UPSTREAM} >actual &&
@@ -52,7 +52,7 @@ test_expect_success '@{upstream} resolves to correct full name' '
52
'
53
54
test_expect_success '@{u} resolves to correct full name' '
55
- echo refs/remotes/origin/master >expect &&
55
+ echo refs/remotes/origin/main >expect &&
56
git -C clone rev-parse --symbolic-full-name @{u} >actual &&
57
test_cmp expect actual &&
58
git -C clone rev-parse --symbolic-full-name @{U} >actual &&
@@ -135,7 +135,7 @@ test_expect_success 'checkout -b new my-side@{u} forks from the same' '
135
test_expect_success 'merge my-side@{u} records the correct name' '
136
(
137
cd clone &&
138
- git checkout master &&
138
+ git checkout main &&
139
test_might_fail git branch -D new &&
140
git branch -t new my-side@{u} &&
141
git merge -s ours new@{u} &&
@@ -146,24 +146,24 @@ test_expect_success 'merge my-side@{u} records the correct name' '
146
'
147
148
test_expect_success 'branch -d other@{u}' '
149
- git checkout -t -b other master &&
149
+ git checkout -t -b other main &&
150
git branch -d @{u} &&
151
- git for-each-ref refs/heads/master >actual &&
151
+ git for-each-ref refs/heads/main >actual &&
152
test_must_be_empty actual
153
'
154
155
test_expect_success 'checkout other@{u}' '
156
- git branch -f master HEAD &&
157
- git checkout -t -b another master &&
156
+ git branch -f main HEAD &&
157
+ git checkout -t -b another main &&
158
git checkout @{u} &&
159
git symbolic-ref HEAD >actual &&
160
- echo refs/heads/master >expect &&
160
+ echo refs/heads/main >expect &&
161
test_cmp expect actual
162
'
163
164
test_expect_success 'branch@{u} works when tracking a local branch' '
165
- echo refs/heads/master >expect &&
166
- git -C clone rev-parse --symbolic-full-name local-master@{u} >actual &&
165
+ echo refs/heads/main >expect &&
166
+ git -C clone rev-parse --symbolic-full-name local-main@{u} >actual &&
167
test_cmp expect actual
168
'
169
@@ -177,7 +177,7 @@ test_expect_success 'branch@{u} error message when no upstream' '
177
178
test_expect_success '@{u} error message when no upstream' '
179
cat >expect <<-EOF &&
180
- fatal: no upstream configured for branch ${SQ}master${SQ}
180
+ fatal: no upstream configured for branch ${SQ}main${SQ}
181
EOF
182
test_must_fail git rev-parse --verify @{u} 2>actual &&
183
test_i18ncmp expect actual
@@ -211,14 +211,14 @@ test_expect_success 'branch@{u} error message if upstream branch not fetched' '
211
test_expect_success 'pull works when tracking a local branch' '
212
(
213
cd clone &&
214
- git checkout local-master &&
214
+ git checkout local-main &&
215
git pull
216
)
217
'
218
219
# makes sense if the previous one succeeded
220
test_expect_success '@{u} works when tracking a local branch' '
221
- echo refs/heads/master >expect &&
221
+ echo refs/heads/main >expect &&
222
git -C clone rev-parse --symbolic-full-name @{u} >actual &&
223
test_cmp expect actual
224
'
@@ -227,7 +227,7 @@ test_expect_success 'log -g other@{u}' '
227
commit=$(git rev-parse HEAD) &&
228
cat >expect <<-EOF &&
229
commit $commit
230
- Reflog: master@{0} (C O Mitter <committer@example.com>)
230
+ Reflog: main@{0} (C O Mitter <committer@example.com>)
231
Reflog message: branch: Created from HEAD
232
Author: A U Thor <author@example.com>
233
Date: Thu Apr 7 15:15:13 2005 -0700
@@ -242,7 +242,7 @@ test_expect_success 'log -g other@{u}@{now}' '
242
commit=$(git rev-parse HEAD) &&
243
cat >expect <<-EOF &&
244
commit $commit
245
- Reflog: master@{Thu Apr 7 15:17:13 2005 -0700} (C O Mitter <committer@example.com>)
245
+ Reflog: main@{Thu Apr 7 15:17:13 2005 -0700} (C O Mitter <committer@example.com>)
246
Reflog message: branch: Created from HEAD
247
Author: A U Thor <author@example.com>
248
Date: Thu Apr 7 15:15:13 2005 -0700
t/t1508-at-combinations.sh
+6
-6
@@ -1,7 +1,7 @@
1
#!/bin/sh
2
3
test_description='test various @{X} syntax combinations together'
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
@@ -33,8 +33,8 @@ fail() {
33
}
34
35
test_expect_success 'setup' '
36
- test_commit master-one &&
37
- test_commit master-two &&
36
+ test_commit main-one &&
37
+ test_commit main-two &&
38
git checkout -b upstream-branch &&
39
test_commit upstream-one &&
40
test_commit upstream-two &&
@@ -50,7 +50,7 @@ test_expect_success 'setup' '
50
git checkout -b new-branch &&
51
test_commit new-one &&
52
test_commit new-two &&
53
- git branch -u master old-branch &&
53
+ git branch -u main old-branch &&
54
git branch -u upstream-branch new-branch
55
'
56
@@ -65,8 +65,8 @@ check "@{-1}@{1}" commit old-one
65
check "@{u}" ref refs/heads/upstream-branch
66
check "HEAD@{u}" ref refs/heads/upstream-branch
67
check "@{u}@{1}" commit upstream-one
68
-check "@{-1}@{u}" ref refs/heads/master
69
-check "@{-1}@{u}@{1}" commit master-one
68
+check "@{-1}@{u}" ref refs/heads/main
69
+check "@{-1}@{u}@{1}" commit main-one
70
check "@" commit new-two
71
check "@@{u}" ref refs/heads/upstream-branch
72
check "@@/at-test" ref refs/heads/@@/at-test
t/t1511-rev-parse-caret.sh
+14
-14
@@ -2,7 +2,7 @@
2
3
test_description='tests for ref^{stuff}'
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 'setup' '
18
git commit -m Initial &&
19
git tag -a -m commit commit-tag &&
20
git branch ref &&
21
- git checkout master &&
21
+ git checkout main &&
22
echo modified >>a-blob &&
23
git add -u &&
24
git commit -m Modified &&
@@ -76,52 +76,52 @@ test_expect_success 'ref^{tag}' '
76
'
77
78
test_expect_success 'ref^{/.}' '
79
- git rev-parse master >expected &&
80
- git rev-parse master^{/.} >actual &&
79
+ git rev-parse main >expected &&
80
+ git rev-parse main^{/.} >actual &&
81
test_cmp expected actual
82
'
83
84
test_expect_success 'ref^{/non-existent}' '
85
- test_must_fail git rev-parse master^{/non-existent}
85
+ test_must_fail git rev-parse main^{/non-existent}
86
'
87
88
test_expect_success 'ref^{/Initial}' '
89
git rev-parse ref >expected &&
90
- git rev-parse master^{/Initial} >actual &&
90
+ git rev-parse main^{/Initial} >actual &&
91
test_cmp expected actual
92
'
93
94
test_expect_success 'ref^{/!Exp}' '
95
- test_must_fail git rev-parse master^{/!Exp}
95
+ test_must_fail git rev-parse main^{/!Exp}
96
'
97
98
test_expect_success 'ref^{/!}' '
99
- test_must_fail git rev-parse master^{/!}
99
+ test_must_fail git rev-parse main^{/!}
100
'
101
102
test_expect_success 'ref^{/!!Exp}' '
103
git rev-parse expref >expected &&
104
- git rev-parse master^{/!!Exp} >actual &&
104
+ git rev-parse main^{/!!Exp} >actual &&
105
test_cmp expected actual
106
'
107
108
test_expect_success 'ref^{/!-}' '
109
- test_must_fail git rev-parse master^{/!-}
109
+ test_must_fail git rev-parse main^{/!-}
110
'
111
112
test_expect_success 'ref^{/!-.}' '
113
- test_must_fail git rev-parse master^{/!-.}
113
+ test_must_fail git rev-parse main^{/!-.}
114
'
115
116
test_expect_success 'ref^{/!-non-existent}' '
117
- git rev-parse master >expected &&
118
- git rev-parse master^{/!-non-existent} >actual &&
117
+ git rev-parse main >expected &&
118
+ git rev-parse main^{/!-non-existent} >actual &&
119
test_cmp expected actual
120
'
121
122
test_expect_success 'ref^{/!-Changed}' '
123
git rev-parse expref >expected &&
124
- git rev-parse master^{/!-Changed} >actual &&
124
+ git rev-parse main^{/!-Changed} >actual &&
125
test_cmp expected actual
126
'
127
t/t1512-rev-parse-disambiguation.sh
+2
-2
@@ -20,7 +20,7 @@ one tagged as v1.0.0. They all have one regular file each.
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
@@ -215,7 +215,7 @@ test_expect_success 'more history' '
215
side=$(git rev-parse HEAD) &&
216
217
# commit 000000000066
218
- git checkout master &&
218
+ git checkout main &&
219
220
# If you use recursive, merge will fail and you will need to
221
# clean up a0blgqsjc as well. If you use resolve, merge will
t/t1513-rev-parse-prefix.sh
+3
-3
@@ -2,7 +2,7 @@
2
3
test_description='Tests for rev-parse --prefix'
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,9 +79,9 @@ test_expect_success 'disambiguate path with valid prefix' '
79
'
80
81
test_expect_success 'file and refs with prefix' '
82
- git rev-parse --prefix sub1/ master file1 >actual &&
82
+ git rev-parse --prefix sub1/ main file1 >actual &&
83
cat <<-EOF >expected &&
84
- $(git rev-parse master)
84
+ $(git rev-parse main)
85
sub1/file1
86
EOF
87
test_cmp expected actual
t/t1514-rev-parse-push.sh
+9
-9
@@ -1,7 +1,7 @@
1
#!/bin/sh
2
3
test_description='test <branch>@{push} syntax'
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
@@ -19,24 +19,24 @@ test_expect_success 'setup' '
19
git remote add other other.git &&
20
test_commit base &&
21
git push origin HEAD &&
22
- git branch --set-upstream-to=origin/master master &&
23
- git branch --track topic origin/master &&
22
+ git branch --set-upstream-to=origin/main main &&
23
+ git branch --track topic origin/main &&
24
git push origin topic &&
25
git push other topic
26
'
27
28
test_expect_success '@{push} with default=nothing' '
29
test_config push.default nothing &&
30
- test_must_fail git rev-parse master@{push} &&
31
- test_must_fail git rev-parse master@{PUSH} &&
32
- test_must_fail git rev-parse master@{PuSH}
30
+ test_must_fail git rev-parse main@{push} &&
31
+ test_must_fail git rev-parse main@{PUSH} &&
32
+ test_must_fail git rev-parse main@{PuSH}
33
'
34
35
test_expect_success '@{push} with default=simple' '
36
test_config push.default simple &&
37
- resolve master@{push} refs/remotes/origin/master &&
38
- resolve master@{PUSH} refs/remotes/origin/master &&
39
- resolve master@{pUSh} refs/remotes/origin/master
37
+ resolve main@{push} refs/remotes/origin/main &&
38
+ resolve main@{PUSH} refs/remotes/origin/main &&
39
+ resolve main@{pUSh} refs/remotes/origin/main
40
'
41
42
test_expect_success 'triangular @{push} fails with default=simple' '
t/t1700-split-index.sh
+2
-2
@@ -2,7 +2,7 @@
2
3
test_description='split index mode tests'
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
@@ -499,7 +499,7 @@ test_expect_success 'do not refresh null base index' '
499
test_commit initial &&
500
git checkout -b side-branch &&
501
test_commit extra &&
502
- git checkout master &&
502
+ git checkout main &&
503
git update-index --split-index &&
504
test_commit more &&
505
# must not write a new shareindex, or we wont catch the problem