@@ -75,11 +75,10 @@ test_expect_success 'rebase --keep-empty' '
75
75
test_line_count = 6 actual
76
76
'
77
77
78
- cat > expect << EOF
79
- error: nothing to do
80
- EOF
81
-
82
78
test_expect_success ' rebase -i with empty HEAD' '
79
+ cat >expect <<-\EOF &&
80
+ error: nothing to do
81
+ EOF
83
82
set_fake_editor &&
84
83
test_must_fail env FAKE_LINES="1 exec_true" git rebase -i HEAD^ >actual 2>&1 &&
85
84
test_i18ncmp expect actual
@@ -237,25 +236,23 @@ test_expect_success 'exchange two commits' '
237
236
test G = $(git cat-file commit HEAD | sed -ne \$p)
238
237
'
239
238
240
- cat > expect << EOF
241
- diff --git a/file1 b/file1
242
- index f70f10e..fd79235 100644
243
- --- a/file1
244
- +++ b/file1
245
- @@ -1 +1 @@
246
- -A
247
- +G
248
- EOF
249
-
250
- cat > expect2 << EOF
251
- <<<<<<< HEAD
252
- D
253
- =======
254
- G
255
- >>>>>>> 5d18e54... G
256
- EOF
257
-
258
239
test_expect_success ' stop on conflicting pick' '
240
+ cat >expect <<-\EOF &&
241
+ diff --git a/file1 b/file1
242
+ index f70f10e..fd79235 100644
243
+ --- a/file1
244
+ +++ b/file1
245
+ @@ -1 +1 @@
246
+ -A
247
+ +G
248
+ EOF
249
+ cat >expect2 <<-\EOF &&
250
+ <<<<<<< HEAD
251
+ D
252
+ =======
253
+ G
254
+ >>>>>>> 5d18e54... G
255
+ EOF
259
256
git tag new-branch1 &&
260
257
set_fake_editor &&
261
258
test_must_fail git rebase -i master &&
@@ -495,15 +492,14 @@ test_expect_success 'commit message retained after conflict' '
495
492
git branch -D conflict-squash
496
493
'
497
494
498
- cat > expect-squash-fixup << EOF
499
- B
500
-
501
- D
495
+ test_expect_success C_LOCALE_OUTPUT ' squash and fixup generate correct log messages' '
496
+ cat >expect-squash-fixup <<-\EOF &&
497
+ B
502
498
503
- ONCE
504
- EOF
499
+ D
505
500
506
- test_expect_success C_LOCALE_OUTPUT ' squash and fixup generate correct log messages' '
501
+ ONCE
502
+ EOF
507
503
git checkout -b squash-fixup E &&
508
504
base=$(git rev-parse HEAD~4) &&
509
505
set_fake_editor &&
@@ -799,13 +795,12 @@ test_expect_success 'rebase -i can copy notes' '
799
795
test "a note" = "$(git notes show HEAD)"
800
796
'
801
797
802
- cat > expect << EOF
803
- an earlier note
804
-
805
- a note
806
- EOF
807
-
808
798
test_expect_success ' rebase -i can copy notes over a fixup' '
799
+ cat >expect <<-\EOF &&
800
+ an earlier note
801
+
802
+ a note
803
+ EOF
809
804
git reset --hard n3 &&
810
805
git notes add -m"an earlier note" n2 &&
811
806
set_fake_editor &&
@@ -1304,52 +1299,37 @@ test_expect_success 'rebase -i respects rebase.missingCommitsCheck = ignore' '
1304
1299
actual
1305
1300
'
1306
1301
1307
- cat > expect << EOF
1308
- Warning: some commits may have been dropped accidentally.
1309
- Dropped commits (newer to older):
1310
- - $( git rev-list --pretty=oneline --abbrev-commit -1 master)
1311
- To avoid this message, use "drop" to explicitly remove a commit.
1312
-
1313
- Use 'git config rebase.missingCommitsCheck' to change the level of warnings.
1314
- The possible behaviours are: ignore, warn, error.
1315
-
1316
- Rebasing (1/4)
1317
- Rebasing (2/4)
1318
- Rebasing (3/4)
1319
- Rebasing (4/4)
1320
- Successfully rebased and updated refs/heads/missing-commit.
1321
- EOF
1322
-
1323
- cr_to_nl () {
1324
- tr ' \015' ' \012'
1325
- }
1326
-
1327
1302
test_expect_success ' rebase -i respects rebase.missingCommitsCheck = warn' '
1303
+ cat >expect <<-EOF &&
1304
+ Warning: some commits may have been dropped accidentally.
1305
+ Dropped commits (newer to older):
1306
+ - $(git rev-list --pretty=oneline --abbrev-commit -1 master)
1307
+ To avoid this message, use "drop" to explicitly remove a commit.
1308
+ EOF
1328
1309
test_config rebase.missingCommitsCheck warn &&
1329
1310
rebase_setup_and_clean missing-commit &&
1330
1311
set_fake_editor &&
1331
1312
FAKE_LINES="1 2 3 4" \
1332
1313
git rebase -i --root 2>actual.2 &&
1333
- cr_to_nl < actual.2 >actual &&
1314
+ head -n4 actual.2 >actual &&
1334
1315
test_i18ncmp expect actual &&
1335
1316
test D = $(git cat-file commit HEAD | sed -ne \$p)
1336
1317
'
1337
1318
1338
- cat > expect << EOF
1339
- Warning: some commits may have been dropped accidentally.
1340
- Dropped commits (newer to older):
1341
- - $( git rev-list --pretty=oneline --abbrev-commit -1 master)
1342
- - $( git rev-list --pretty=oneline --abbrev-commit -1 master~2)
1343
- To avoid this message, use "drop" to explicitly remove a commit.
1344
-
1345
- Use 'git config rebase.missingCommitsCheck' to change the level of warnings.
1346
- The possible behaviours are: ignore, warn, error.
1347
-
1348
- You can fix this with 'git rebase --edit-todo' and then run 'git rebase --continue'.
1349
- Or you can abort the rebase with 'git rebase --abort'.
1350
- EOF
1351
-
1352
1319
test_expect_success ' rebase -i respects rebase.missingCommitsCheck = error' '
1320
+ cat >expect <<-EOF &&
1321
+ Warning: some commits may have been dropped accidentally.
1322
+ Dropped commits (newer to older):
1323
+ - $(git rev-list --pretty=oneline --abbrev-commit -1 master)
1324
+ - $(git rev-list --pretty=oneline --abbrev-commit -1 master~2)
1325
+ To avoid this message, use "drop" to explicitly remove a commit.
1326
+
1327
+ Use ' \' ' git config rebase.missingCommitsCheck' \' ' to change the level of warnings.
1328
+ The possible behaviours are: ignore, warn, error.
1329
+
1330
+ You can fix this with ' \' ' git rebase --edit-todo' \' ' and then run ' \' ' git rebase --continue' \' ' .
1331
+ Or you can abort the rebase with ' \' ' git rebase --abort' \' ' .
1332
+ EOF
1353
1333
test_config rebase.missingCommitsCheck error &&
1354
1334
rebase_setup_and_clean missing-commit &&
1355
1335
set_fake_editor &&
0 commit comments