@@ -9,6 +9,7 @@ This test exercises porcelain V2 output for git status.'
9
9
10
10
11
11
test_expect_success setup '
12
+ git checkout -f --orphan initial-branch &&
12
13
test_tick &&
13
14
git config core.autocrlf false &&
14
15
echo x >file_x &&
@@ -22,7 +23,7 @@ test_expect_success setup '
22
23
test_expect_success ' before initial commit, nothing added, only untracked' '
23
24
cat >expect <<-EOF &&
24
25
# branch.oid (initial)
25
- # branch.head master
26
+ # branch.head initial-branch
26
27
? actual
27
28
? dir1/
28
29
? expect
@@ -45,7 +46,7 @@ test_expect_success 'before initial commit, things added' '
45
46
46
47
cat >expect <<-EOF &&
47
48
# branch.oid (initial)
48
- # branch.head master
49
+ # branch.head initial-branch
49
50
1 A. N... 000000 100644 100644 $ZERO_OID $OID_A dir1/file_a
50
51
1 A. N... 000000 100644 100644 $ZERO_OID $OID_B dir1/file_b
51
52
1 A. N... 000000 100644 100644 $ZERO_OID $OID_X file_x
@@ -62,7 +63,7 @@ test_expect_success 'before initial commit, things added' '
62
63
test_expect_success ' before initial commit, things added (-z)' '
63
64
lf_to_nul >expect <<-EOF &&
64
65
# branch.oid (initial)
65
- # branch.head master
66
+ # branch.head initial-branch
66
67
1 A. N... 000000 100644 100644 $ZERO_OID $OID_A dir1/file_a
67
68
1 A. N... 000000 100644 100644 $ZERO_OID $OID_B dir1/file_b
68
69
1 A. N... 000000 100644 100644 $ZERO_OID $OID_X file_x
@@ -81,7 +82,7 @@ test_expect_success 'make first commit, comfirm HEAD oid and branch' '
81
82
H0=$(git rev-parse HEAD) &&
82
83
cat >expect <<-EOF &&
83
84
# branch.oid $H0
84
- # branch.head master
85
+ # branch.head initial-branch
85
86
? actual
86
87
? expect
87
88
EOF
@@ -98,7 +99,7 @@ test_expect_success 'after first commit, create unstaged changes' '
98
99
99
100
cat >expect <<-EOF &&
100
101
# branch.oid $H0
101
- # branch.head master
102
+ # branch.head initial-branch
102
103
1 .M N... 100644 100644 100644 $OID_X $OID_X file_x
103
104
1 .D N... 100644 100644 000000 $OID_Z $OID_Z file_z
104
105
? actual
@@ -126,7 +127,7 @@ test_expect_success 'after first commit, stage existing changes' '
126
127
127
128
cat >expect <<-EOF &&
128
129
# branch.oid $H0
129
- # branch.head master
130
+ # branch.head initial-branch
130
131
1 M. N... 100644 100644 100644 $OID_X $OID_X1 file_x
131
132
1 D. N... 100644 000000 000000 $OID_Z $ZERO_OID file_z
132
133
? actual
@@ -143,7 +144,7 @@ test_expect_success 'rename causes 2 path lines' '
143
144
144
145
q_to_tab >expect <<-EOF &&
145
146
# branch.oid $H0
146
- # branch.head master
147
+ # branch.head initial-branch
147
148
1 M. N... 100644 100644 100644 $OID_X $OID_X1 file_x
148
149
1 D. N... 100644 000000 000000 $OID_Z $ZERO_OID file_z
149
150
2 R. N... 100644 100644 100644 $OID_Y $OID_Y R100 renamed_yQfile_y
@@ -161,7 +162,7 @@ test_expect_success 'rename causes 2 path lines (-z)' '
161
162
## Lines use NUL path separator and line terminator, so double transform here.
162
163
q_to_nul <<-EOF | lf_to_nul >expect &&
163
164
# branch.oid $H0
164
- # branch.head master
165
+ # branch.head initial-branch
165
166
1 M. N... 100644 100644 100644 $OID_X $OID_X1 file_x
166
167
1 D. N... 100644 000000 000000 $OID_Z $ZERO_OID file_z
167
168
2 R. N... 100644 100644 100644 $OID_Y $OID_Y R100 renamed_yQfile_y
@@ -179,7 +180,7 @@ test_expect_success 'make second commit, confirm clean and new HEAD oid' '
179
180
180
181
cat >expect <<-EOF &&
181
182
# branch.oid $H1
182
- # branch.head master
183
+ # branch.head initial-branch
183
184
? actual
184
185
? expect
185
186
EOF
@@ -231,7 +232,7 @@ test_expect_success 'create and commit permanent ignore file' '
231
232
232
233
cat >expect <<-EOF &&
233
234
# branch.oid $H1
234
- # branch.head master
235
+ # branch.head initial-branch
235
236
EOF
236
237
237
238
git status --porcelain=v2 --branch >actual &&
@@ -257,14 +258,14 @@ test_expect_success 'verify --intent-to-add output' '
257
258
test_expect_success ' verify AA (add-add) conflict' '
258
259
test_when_finished "git reset --hard" &&
259
260
260
- git branch AA_A master &&
261
+ git branch AA_A initial-branch &&
261
262
git checkout AA_A &&
262
263
echo "Branch AA_A" >conflict.txt &&
263
264
OID_AA_A=$(git hash-object -t blob -- conflict.txt) &&
264
265
git add conflict.txt &&
265
266
git commit -m "branch aa_a" &&
266
267
267
- git branch AA_B master &&
268
+ git branch AA_B initial-branch &&
268
269
git checkout AA_B &&
269
270
echo "Branch AA_B" >conflict.txt &&
270
271
OID_AA_B=$(git hash-object -t blob -- conflict.txt) &&
@@ -290,7 +291,7 @@ test_expect_success 'verify AA (add-add) conflict' '
290
291
test_expect_success ' verify UU (edit-edit) conflict' '
291
292
test_when_finished "git reset --hard" &&
292
293
293
- git branch UU_ANC master &&
294
+ git branch UU_ANC initial-branch &&
294
295
git checkout UU_ANC &&
295
296
echo "Ancestor" >conflict.txt &&
296
297
OID_UU_ANC=$(git hash-object -t blob -- conflict.txt) &&
@@ -328,18 +329,18 @@ test_expect_success 'verify UU (edit-edit) conflict' '
328
329
'
329
330
330
331
test_expect_success ' verify upstream fields in branch header' '
331
- git checkout master &&
332
+ git checkout initial-branch &&
332
333
test_when_finished "rm -rf sub_repo" &&
333
334
git clone . sub_repo &&
334
335
(
335
- ## Confirm local master tracks remote master .
336
+ ## Confirm local initial-branch tracks remote initial-branch .
336
337
cd sub_repo &&
337
338
HUF=$(git rev-parse HEAD) &&
338
339
339
340
cat >expect <<-EOF &&
340
341
# branch.oid $HUF
341
- # branch.head master
342
- # branch.upstream origin/master
342
+ # branch.head initial-branch
343
+ # branch.upstream origin/initial-branch
343
344
# branch.ab +0 -0
344
345
EOF
345
346
@@ -355,8 +356,8 @@ test_expect_success 'verify upstream fields in branch header' '
355
356
356
357
cat >expect <<-EOF &&
357
358
# branch.oid $HUF
358
- # branch.head master
359
- # branch.upstream origin/master
359
+ # branch.head initial-branch
360
+ # branch.upstream origin/initial-branch
360
361
# branch.ab +1 -0
361
362
EOF
362
363
@@ -367,9 +368,9 @@ test_expect_success 'verify upstream fields in branch header' '
367
368
git status --porcelain=v2 --untracked-files=all >actual &&
368
369
test_must_be_empty actual &&
369
370
370
- ## Test upstream-gone case. Fake this by pointing origin/master at
371
- ## a non-existing commit.
372
- OLD=$(git rev-parse origin/master ) &&
371
+ ## Test upstream-gone case. Fake this by pointing
372
+ ## origin/initial-branch at a non-existing commit.
373
+ OLD=$(git rev-parse origin/initial-branch ) &&
373
374
NEW=$ZERO_OID &&
374
375
mv .git/packed-refs .git/old-packed-refs &&
375
376
sed "s/$OLD/$NEW/g" <.git/old-packed-refs >.git/packed-refs &&
@@ -378,8 +379,8 @@ test_expect_success 'verify upstream fields in branch header' '
378
379
379
380
cat >expect <<-EOF &&
380
381
# branch.oid $HUF
381
- # branch.head master
382
- # branch.upstream origin/master
382
+ # branch.head initial-branch
383
+ # branch.upstream origin/initial-branch
383
384
EOF
384
385
385
386
git status --porcelain=v2 --branch --untracked-files=all >actual &&
@@ -388,19 +389,19 @@ test_expect_success 'verify upstream fields in branch header' '
388
389
'
389
390
390
391
test_expect_success ' verify --[no-]ahead-behind with V2 format' '
391
- git checkout master &&
392
+ git checkout initial-branch &&
392
393
test_when_finished "rm -rf sub_repo" &&
393
394
git clone . sub_repo &&
394
395
(
395
- ## Confirm local master tracks remote master .
396
+ ## Confirm local initial-branch tracks remote initial-branch .
396
397
cd sub_repo &&
397
398
HUF=$(git rev-parse HEAD) &&
398
399
399
400
# Confirm --no-ahead-behind reports traditional branch.ab with 0/0 for equal branches.
400
401
cat >expect <<-EOF &&
401
402
# branch.oid $HUF
402
- # branch.head master
403
- # branch.upstream origin/master
403
+ # branch.head initial-branch
404
+ # branch.upstream origin/initial-branch
404
405
# branch.ab +0 -0
405
406
EOF
406
407
@@ -410,8 +411,8 @@ test_expect_success 'verify --[no-]ahead-behind with V2 format' '
410
411
# Confirm --ahead-behind reports traditional branch.ab with 0/0.
411
412
cat >expect <<-EOF &&
412
413
# branch.oid $HUF
413
- # branch.head master
414
- # branch.upstream origin/master
414
+ # branch.head initial-branch
415
+ # branch.upstream origin/initial-branch
415
416
# branch.ab +0 -0
416
417
EOF
417
418
@@ -428,8 +429,8 @@ test_expect_success 'verify --[no-]ahead-behind with V2 format' '
428
429
# Confirm --no-ahead-behind reports branch.ab with ?/? for non-equal branches.
429
430
cat >expect <<-EOF &&
430
431
# branch.oid $HUF
431
- # branch.head master
432
- # branch.upstream origin/master
432
+ # branch.head initial-branch
433
+ # branch.upstream origin/initial-branch
433
434
# branch.ab +? -?
434
435
EOF
435
436
@@ -439,8 +440,8 @@ test_expect_success 'verify --[no-]ahead-behind with V2 format' '
439
440
# Confirm --ahead-behind reports traditional branch.ab with 1/0.
440
441
cat >expect <<-EOF &&
441
442
# branch.oid $HUF
442
- # branch.head master
443
- # branch.upstream origin/master
443
+ # branch.head initial-branch
444
+ # branch.upstream origin/initial-branch
444
445
# branch.ab +1 -0
445
446
EOF
446
447
@@ -458,7 +459,7 @@ test_expect_success 'verify --[no-]ahead-behind with V2 format' '
458
459
'
459
460
460
461
test_expect_success ' create and add submodule, submodule appears clean (A. S...)' '
461
- git checkout master &&
462
+ git checkout initial-branch &&
462
463
git clone . sub_repo &&
463
464
git clone . super_repo &&
464
465
( cd super_repo &&
@@ -471,8 +472,8 @@ test_expect_success 'create and add submodule, submodule appears clean (A. S...)
471
472
472
473
cat >expect <<-EOF &&
473
474
# branch.oid $HSUP
474
- # branch.head master
475
- # branch.upstream origin/master
475
+ # branch.head initial-branch
476
+ # branch.upstream origin/initial-branch
476
477
# branch.ab +0 -0
477
478
1 A. N... 000000 100644 100644 $ZERO_OID $HMOD .gitmodules
478
479
1 A. S... 000000 160000 160000 $ZERO_OID $HSUB sub1
@@ -496,8 +497,8 @@ test_expect_success 'untracked changes in added submodule (AM S..U)' '
496
497
497
498
cat >expect <<-EOF &&
498
499
# branch.oid $HSUP
499
- # branch.head master
500
- # branch.upstream origin/master
500
+ # branch.head initial-branch
501
+ # branch.upstream origin/initial-branch
501
502
# branch.ab +0 -0
502
503
1 A. N... 000000 100644 100644 $ZERO_OID $HMOD .gitmodules
503
504
1 AM S..U 000000 160000 160000 $ZERO_OID $HSUB sub1
@@ -521,8 +522,8 @@ test_expect_success 'staged changes in added submodule (AM S.M.)' '
521
522
522
523
cat >expect <<-EOF &&
523
524
# branch.oid $HSUP
524
- # branch.head master
525
- # branch.upstream origin/master
525
+ # branch.head initial-branch
526
+ # branch.upstream origin/initial-branch
526
527
# branch.ab +0 -0
527
528
1 A. N... 000000 100644 100644 $ZERO_OID $HMOD .gitmodules
528
529
1 AM S.M. 000000 160000 160000 $ZERO_OID $HSUB sub1
@@ -548,8 +549,8 @@ test_expect_success 'staged and unstaged changes in added (AM S.M.)' '
548
549
549
550
cat >expect <<-EOF &&
550
551
# branch.oid $HSUP
551
- # branch.head master
552
- # branch.upstream origin/master
552
+ # branch.head initial-branch
553
+ # branch.upstream origin/initial-branch
553
554
# branch.ab +0 -0
554
555
1 A. N... 000000 100644 100644 $ZERO_OID $HMOD .gitmodules
555
556
1 AM S.M. 000000 160000 160000 $ZERO_OID $HSUB sub1
@@ -575,8 +576,8 @@ test_expect_success 'staged and untracked changes in added submodule (AM S.MU)'
575
576
576
577
cat >expect <<-EOF &&
577
578
# branch.oid $HSUP
578
- # branch.head master
579
- # branch.upstream origin/master
579
+ # branch.head initial-branch
580
+ # branch.upstream origin/initial-branch
580
581
# branch.ab +0 -0
581
582
1 A. N... 000000 100644 100644 $ZERO_OID $HMOD .gitmodules
582
583
1 AM S.MU 000000 160000 160000 $ZERO_OID $HSUB sub1
@@ -602,8 +603,8 @@ test_expect_success 'commit within the submodule appears as new commit in super
602
603
603
604
cat >expect <<-EOF &&
604
605
# branch.oid $HSUP
605
- # branch.head master
606
- # branch.upstream origin/master
606
+ # branch.head initial-branch
607
+ # branch.upstream origin/initial-branch
607
608
# branch.ab +0 -0
608
609
1 A. N... 000000 100644 100644 $ZERO_OID $HMOD .gitmodules
609
610
1 AM SC.. 000000 160000 160000 $ZERO_OID $HSUB sub1
@@ -625,8 +626,8 @@ test_expect_success 'stage submodule in super and commit' '
625
626
626
627
cat >expect <<-EOF &&
627
628
# branch.oid $HSUP
628
- # branch.head master
629
- # branch.upstream origin/master
629
+ # branch.head initial-branch
630
+ # branch.upstream origin/initial-branch
630
631
# branch.ab +1 -0
631
632
EOF
632
633
@@ -646,8 +647,8 @@ test_expect_success 'make unstaged changes in existing submodule (.M S.M.)' '
646
647
647
648
cat >expect <<-EOF &&
648
649
# branch.oid $HSUP
649
- # branch.head master
650
- # branch.upstream origin/master
650
+ # branch.head initial-branch
651
+ # branch.upstream origin/initial-branch
651
652
# branch.ab +1 -0
652
653
1 .M S.M. 160000 160000 160000 $HSUB $HSUB sub1
653
654
EOF
0 commit comments