@@ -12,7 +12,7 @@ Initial setup:
12
12
13
13
one - two - three - four (conflict-branch)
14
14
/
15
- A - B - C - D - E (master )
15
+ A - B - C - D - E (primary )
16
16
| \
17
17
| F - G - H (branch1)
18
18
| \
@@ -30,6 +30,7 @@ Initial setup:
30
30
. " $TEST_DIRECTORY " /lib-rebase.sh
31
31
32
32
test_expect_success ' setup' '
33
+ git switch -C primary &&
33
34
test_commit A file1 &&
34
35
test_commit B file1 &&
35
36
test_commit C file2 &&
65
66
export SHELL
66
67
67
68
test_expect_success ' rebase --keep-empty' '
68
- git checkout -b emptybranch master &&
69
+ git checkout -b emptybranch primary &&
69
70
git commit --allow-empty -m "empty" &&
70
71
git rebase --keep-empty -i HEAD~2 &&
71
72
git log --oneline >actual &&
@@ -86,7 +87,7 @@ test_expect_success 'rebase -i with empty todo list' '
86
87
'
87
88
88
89
test_expect_success ' rebase -i with the exec command' '
89
- git checkout master &&
90
+ git checkout primary &&
90
91
(
91
92
set_fake_editor &&
92
93
FAKE_LINES="1 exec_>touch-one
@@ -103,12 +104,12 @@ test_expect_success 'rebase -i with the exec command' '
103
104
test_path_is_file touch-three &&
104
105
test_path_is_file "touch-file name with spaces" &&
105
106
test_path_is_file touch-after-semicolon &&
106
- test_cmp_rev master HEAD &&
107
+ test_cmp_rev primary HEAD &&
107
108
rm -f touch-*
108
109
'
109
110
110
111
test_expect_success ' rebase -i with the exec command runs from tree root' '
111
- git checkout master &&
112
+ git checkout primary &&
112
113
mkdir subdir && (cd subdir &&
113
114
set_fake_editor &&
114
115
FAKE_LINES="1 exec_>touch-subdir" \
@@ -121,7 +122,7 @@ test_expect_success 'rebase -i with the exec command runs from tree root' '
121
122
test_expect_success ' rebase -i with exec allows git commands in subdirs' '
122
123
test_when_finished "rm -rf subdir" &&
123
124
test_when_finished "git rebase --abort ||:" &&
124
- git checkout master &&
125
+ git checkout primary &&
125
126
mkdir subdir && (cd subdir &&
126
127
set_fake_editor &&
127
128
FAKE_LINES="1 x_cd_subdir_&&_git_rev-parse_--is-inside-work-tree" \
@@ -139,13 +140,13 @@ test_expect_success 'rebase -i sets work tree properly' '
139
140
'
140
141
141
142
test_expect_success ' rebase -i with the exec command checks tree cleanness' '
142
- git checkout master &&
143
+ git checkout primary &&
143
144
(
144
145
set_fake_editor &&
145
146
test_must_fail env FAKE_LINES="exec_echo_foo_>file1 1" \
146
147
git rebase -i HEAD^
147
148
) &&
148
- test_cmp_rev master ^ HEAD &&
149
+ test_cmp_rev primary ^ HEAD &&
149
150
git reset --hard &&
150
151
git rebase --continue
151
152
'
@@ -168,7 +169,7 @@ test_expect_success 'rebase -x with newline in command fails' '
168
169
'
169
170
170
171
test_expect_success ' rebase -i with exec of inexistent command' '
171
- git checkout master &&
172
+ git checkout primary &&
172
173
test_when_finished "git rebase --abort" &&
173
174
(
174
175
set_fake_editor &&
@@ -259,8 +260,8 @@ test_expect_success 'stop on conflicting pick' '
259
260
>>>>>>> $commit (G)
260
261
EOF
261
262
git tag new-branch1 &&
262
- test_must_fail git rebase -i master &&
263
- test "$(git rev-parse HEAD~3)" = "$(git rev-parse master )" &&
263
+ test_must_fail git rebase -i primary &&
264
+ test "$(git rev-parse HEAD~3)" = "$(git rev-parse primary )" &&
264
265
test_cmp expect .git/rebase-merge/patch &&
265
266
test_cmp expect2 file1 &&
266
267
test "$(git diff --name-status |
@@ -287,7 +288,7 @@ test_expect_success 'abort' '
287
288
test_expect_success ' abort with error when new base cannot be checked out' '
288
289
git rm --cached file1 &&
289
290
git commit -m "remove file in base" &&
290
- test_must_fail git rebase -i master > output 2>&1 &&
291
+ test_must_fail git rebase -i primary > output 2>&1 &&
291
292
test_i18ngrep "The following untracked working tree files would be overwritten by checkout:" \
292
293
output &&
293
294
test_i18ngrep "file1" output &&
@@ -301,7 +302,7 @@ test_expect_success 'retain authorship' '
301
302
test_tick &&
302
303
GIT_AUTHOR_NAME="Twerp Snog" git commit -m "different author" &&
303
304
git tag twerp &&
304
- git rebase -i --onto master HEAD^ &&
305
+ git rebase -i --onto primary HEAD^ &&
305
306
git show HEAD | grep "^Author: Twerp Snog"
306
307
'
307
308
@@ -336,10 +337,10 @@ test_expect_success 'squash' '
336
337
(
337
338
set_fake_editor &&
338
339
FAKE_LINES="1 squash 2" EXPECT_HEADER_COUNT=2 \
339
- git rebase -i --onto master HEAD~2
340
+ git rebase -i --onto primary HEAD~2
340
341
) &&
341
342
test B = $(cat file7) &&
342
- test_cmp_rev HEAD^ master
343
+ test_cmp_rev HEAD^ primary
343
344
'
344
345
345
346
test_expect_success ' retain authorship when squashing' '
@@ -366,12 +367,12 @@ test_expect_failure REBASE_P 'exchange two commits with -p' '
366
367
'
367
368
368
369
test_expect_success REBASE_P ' preserve merges with -p' '
369
- git checkout -b to-be-preserved master ^ &&
370
+ git checkout -b to-be-preserved primary ^ &&
370
371
: > unrelated-file &&
371
372
git add unrelated-file &&
372
373
test_tick &&
373
374
git commit -m "unrelated" &&
374
- git checkout -b another-branch master &&
375
+ git checkout -b another-branch primary &&
375
376
echo B > file1 &&
376
377
test_tick &&
377
378
git commit -m J file1 &&
@@ -394,7 +395,7 @@ test_expect_success REBASE_P 'preserve merges with -p' '
394
395
git commit -m M file1 &&
395
396
git checkout -b to-be-rebased &&
396
397
test_tick &&
397
- git rebase -i -p --onto branch1 master &&
398
+ git rebase -i -p --onto branch1 primary &&
398
399
git update-index --refresh &&
399
400
git diff-files --quiet &&
400
401
git diff-index --quiet --cached HEAD -- &&
@@ -437,7 +438,7 @@ test_expect_success '--continue tries to commit' '
437
438
'
438
439
439
440
test_expect_success ' verbose flag is heeded, even after --continue' '
440
- git reset --hard master @{1} &&
441
+ git reset --hard primary @{1} &&
441
442
test_tick &&
442
443
test_must_fail git rebase -v -i --onto new-branch1 HEAD^ &&
443
444
echo resolved > file1 &&
@@ -802,7 +803,7 @@ test_expect_success 'rebase -i continue with unstaged submodule' '
802
803
'
803
804
804
805
test_expect_success ' avoid unnecessary reset' '
805
- git checkout master &&
806
+ git checkout primary &&
806
807
git reset --hard &&
807
808
test-tool chmtime =123456789 file3 &&
808
809
git update-index --refresh &&
@@ -814,14 +815,14 @@ test_expect_success 'avoid unnecessary reset' '
814
815
'
815
816
816
817
test_expect_success ' reword' '
817
- git checkout -b reword-branch master &&
818
+ git checkout -b reword-branch primary &&
818
819
(
819
820
set_fake_editor &&
820
821
FAKE_LINES="1 2 3 reword 4" FAKE_COMMIT_MESSAGE="E changed" \
821
822
git rebase -i A &&
822
823
git show HEAD | grep "E changed" &&
823
- test $(git rev-parse master ) != $(git rev-parse HEAD) &&
824
- test_cmp_rev master ^ HEAD^ &&
824
+ test $(git rev-parse primary ) != $(git rev-parse HEAD) &&
825
+ test_cmp_rev primary ^ HEAD^ &&
825
826
FAKE_LINES="1 2 reword 3 4" FAKE_COMMIT_MESSAGE="D changed" \
826
827
git rebase -i A &&
827
828
git show HEAD^ | grep "D changed" &&
@@ -918,7 +919,7 @@ test_expect_success 'rebase-i history with funny messages' '
918
919
'
919
920
920
921
test_expect_success ' prepare for rebase -i --exec' '
921
- git checkout master &&
922
+ git checkout primary &&
922
923
git checkout -b execute &&
923
924
test_commit one_exec main.txt one_exec &&
924
925
test_commit two_exec main.txt two_exec &&
@@ -1027,7 +1028,7 @@ test_expect_success 'rebase -i --exec without <CMD>' '
1027
1028
git reset --hard execute &&
1028
1029
test_must_fail git rebase -i --exec 2>actual &&
1029
1030
test_i18ngrep "requires a value" actual &&
1030
- git checkout master
1031
+ git checkout primary
1031
1032
'
1032
1033
1033
1034
test_expect_success ' rebase -i --root re-order and drop commits' '
@@ -1079,7 +1080,7 @@ test_expect_success 'rebase -i --root fixup root commit' '
1079
1080
1080
1081
test_expect_success ' rebase -i --root reword original root commit' '
1081
1082
test_when_finished "test_might_fail git rebase --abort" &&
1082
- git checkout -b reword-original-root-branch master &&
1083
+ git checkout -b reword-original-root-branch primary &&
1083
1084
(
1084
1085
set_fake_editor &&
1085
1086
FAKE_LINES="reword 1 2" FAKE_COMMIT_MESSAGE="A changed" \
@@ -1091,7 +1092,7 @@ test_expect_success 'rebase -i --root reword original root commit' '
1091
1092
1092
1093
test_expect_success ' rebase -i --root reword new root commit' '
1093
1094
test_when_finished "test_might_fail git rebase --abort" &&
1094
- git checkout -b reword-now-root-branch master &&
1095
+ git checkout -b reword-now-root-branch primary &&
1095
1096
(
1096
1097
set_fake_editor &&
1097
1098
FAKE_LINES="reword 3 1" FAKE_COMMIT_MESSAGE="C changed" \
@@ -1251,7 +1252,7 @@ test_expect_success 'rebase -i error on commits with \ in message' '
1251
1252
'
1252
1253
1253
1254
test_expect_success ' short commit ID setup' '
1254
- test_when_finished "git checkout master " &&
1255
+ test_when_finished "git checkout primary " &&
1255
1256
git checkout --orphan collide &&
1256
1257
git rm -rf . &&
1257
1258
(
@@ -1292,7 +1293,7 @@ test_expect_success 'short commit ID collide' '
1292
1293
t3404_collider sha1:ac4f2ee
1293
1294
t3404_collider sha256:16697
1294
1295
EOF
1295
- test_when_finished "reset_rebase && git checkout master " &&
1296
+ test_when_finished "reset_rebase && git checkout primary " &&
1296
1297
git checkout collide &&
1297
1298
colliding_id=$(test_oid t3404_collision) &&
1298
1299
hexsz=$(test_oid hexsz) &&
@@ -1416,11 +1417,11 @@ test_expect_success 'rebase --continue removes CHERRY_PICK_HEAD' '
1416
1417
1417
1418
rebase_setup_and_clean () {
1418
1419
test_when_finished "
1419
- git checkout master &&
1420
+ git checkout primary &&
1420
1421
test_might_fail git branch -D $1 &&
1421
1422
test_might_fail git rebase --abort
1422
1423
" &&
1423
- git checkout -b $1 ${2:- master }
1424
+ git checkout -b $1 ${2:- primary }
1424
1425
}
1425
1426
1426
1427
test_expect_success ' drop' '
@@ -1451,7 +1452,7 @@ test_expect_success 'rebase -i respects rebase.missingCommitsCheck = warn' '
1451
1452
cat >expect <<-EOF &&
1452
1453
Warning: some commits may have been dropped accidentally.
1453
1454
Dropped commits (newer to older):
1454
- - $(git rev-list --pretty=oneline --abbrev-commit -1 master )
1455
+ - $(git rev-list --pretty=oneline --abbrev-commit -1 primary )
1455
1456
To avoid this message, use "drop" to explicitly remove a commit.
1456
1457
EOF
1457
1458
test_config rebase.missingCommitsCheck warn &&
@@ -1469,8 +1470,8 @@ test_expect_success 'rebase -i respects rebase.missingCommitsCheck = error' '
1469
1470
cat >expect <<-EOF &&
1470
1471
Warning: some commits may have been dropped accidentally.
1471
1472
Dropped commits (newer to older):
1472
- - $(git rev-list --pretty=oneline --abbrev-commit -1 master )
1473
- - $(git rev-list --pretty=oneline --abbrev-commit -1 master ~2)
1473
+ - $(git rev-list --pretty=oneline --abbrev-commit -1 primary )
1474
+ - $(git rev-list --pretty=oneline --abbrev-commit -1 primary ~2)
1474
1475
To avoid this message, use "drop" to explicitly remove a commit.
1475
1476
1476
1477
Use ' \' ' git config rebase.missingCommitsCheck' \' ' to change the level of warnings.
@@ -1512,11 +1513,11 @@ test_expect_success 'rebase --edit-todo respects rebase.missingCommitsCheck = ig
1512
1513
1513
1514
test_expect_success ' rebase --edit-todo respects rebase.missingCommitsCheck = warn' '
1514
1515
cat >expect <<-EOF &&
1515
- error: invalid line 1: badcmd $(git rev-list --pretty=oneline --abbrev-commit -1 master ~4)
1516
+ error: invalid line 1: badcmd $(git rev-list --pretty=oneline --abbrev-commit -1 primary ~4)
1516
1517
Warning: some commits may have been dropped accidentally.
1517
1518
Dropped commits (newer to older):
1518
- - $(git rev-list --pretty=oneline --abbrev-commit -1 master )
1519
- - $(git rev-list --pretty=oneline --abbrev-commit -1 master ~4)
1519
+ - $(git rev-list --pretty=oneline --abbrev-commit -1 primary )
1520
+ - $(git rev-list --pretty=oneline --abbrev-commit -1 primary ~4)
1520
1521
To avoid this message, use "drop" to explicitly remove a commit.
1521
1522
EOF
1522
1523
head -n4 expect >expect.2 &&
@@ -1546,11 +1547,11 @@ test_expect_success 'rebase --edit-todo respects rebase.missingCommitsCheck = wa
1546
1547
1547
1548
test_expect_success ' rebase --edit-todo respects rebase.missingCommitsCheck = error' '
1548
1549
cat >expect <<-EOF &&
1549
- error: invalid line 1: badcmd $(git rev-list --pretty=oneline --abbrev-commit -1 master ~4)
1550
+ error: invalid line 1: badcmd $(git rev-list --pretty=oneline --abbrev-commit -1 primary ~4)
1550
1551
Warning: some commits may have been dropped accidentally.
1551
1552
Dropped commits (newer to older):
1552
- - $(git rev-list --pretty=oneline --abbrev-commit -1 master )
1553
- - $(git rev-list --pretty=oneline --abbrev-commit -1 master ~4)
1553
+ - $(git rev-list --pretty=oneline --abbrev-commit -1 primary )
1554
+ - $(git rev-list --pretty=oneline --abbrev-commit -1 primary ~4)
1554
1555
To avoid this message, use "drop" to explicitly remove a commit.
1555
1556
1556
1557
Use ' \' ' git config rebase.missingCommitsCheck' \' ' to change the level of warnings.
@@ -1635,7 +1636,7 @@ test_expect_success 'respects rebase.abbreviateCommands with fixup, squash and e
1635
1636
(
1636
1637
set_cat_todo_editor &&
1637
1638
test_must_fail git rebase -i --exec "git show HEAD" \
1638
- --autosquash master >actual
1639
+ --autosquash primary >actual
1639
1640
) &&
1640
1641
test_cmp expected actual
1641
1642
'
@@ -1646,7 +1647,7 @@ test_expect_success 'static check of bad command' '
1646
1647
set_fake_editor &&
1647
1648
test_must_fail env FAKE_LINES="1 2 3 bad 4 5" \
1648
1649
git rebase -i --root 2>actual &&
1649
- test_i18ngrep "badcmd $(git rev-list --oneline -1 master ~1)" \
1650
+ test_i18ngrep "badcmd $(git rev-list --oneline -1 primary ~1)" \
1650
1651
actual &&
1651
1652
test_i18ngrep "You can fix this with .git rebase --edit-todo.." \
1652
1653
actual &&
@@ -1798,13 +1799,13 @@ test_expect_success 'todo has correct onto hash' '
1798
1799
'
1799
1800
1800
1801
test_expect_success ' ORIG_HEAD is updated correctly' '
1801
- test_when_finished "git checkout master && git branch -D test-orig-head" &&
1802
+ test_when_finished "git checkout primary && git branch -D test-orig-head" &&
1802
1803
git checkout -b test-orig-head A &&
1803
1804
git commit --allow-empty -m A1 &&
1804
1805
git commit --allow-empty -m A2 &&
1805
1806
git commit --allow-empty -m A3 &&
1806
1807
git commit --allow-empty -m A4 &&
1807
- git rebase master &&
1808
+ git rebase primary &&
1808
1809
test_cmp_rev ORIG_HEAD test-orig-head@{1}
1809
1810
'
1810
1811
0 commit comments