@@ -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,27 +1299,26 @@ 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
1302
cr_to_nl () {
1324
1303
tr ' \015' ' \012'
1325
1304
}
1326
1305
1327
1306
test_expect_success ' rebase -i respects rebase.missingCommitsCheck = warn' '
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
1328
1322
test_config rebase.missingCommitsCheck warn &&
1329
1323
rebase_setup_and_clean missing-commit &&
1330
1324
set_fake_editor &&
@@ -1335,21 +1329,20 @@ test_expect_success 'rebase -i respects rebase.missingCommitsCheck = warn' '
1335
1329
test D = $(git cat-file commit HEAD | sed -ne \$p)
1336
1330
'
1337
1331
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
1332
test_expect_success ' rebase -i respects rebase.missingCommitsCheck = error' '
1333
+ cat >expect <<-EOF &&
1334
+ Warning: some commits may have been dropped accidentally.
1335
+ Dropped commits (newer to older):
1336
+ - $(git rev-list --pretty=oneline --abbrev-commit -1 master)
1337
+ - $(git rev-list --pretty=oneline --abbrev-commit -1 master~2)
1338
+ To avoid this message, use "drop" to explicitly remove a commit.
1339
+
1340
+ Use ' \' ' git config rebase.missingCommitsCheck' \' ' to change the level of warnings.
1341
+ The possible behaviours are: ignore, warn, error.
1342
+
1343
+ You can fix this with ' \' ' git rebase --edit-todo' \' ' and then run ' \' ' git rebase --continue' \' ' .
1344
+ Or you can abort the rebase with ' \' ' git rebase --abort' \' ' .
1345
+ EOF
1353
1346
test_config rebase.missingCommitsCheck error &&
1354
1347
rebase_setup_and_clean missing-commit &&
1355
1348
set_fake_editor &&
0 commit comments