@@ -22,14 +22,14 @@ test_expect_success 'status works (initial)' '
2222'
2323
2424test_expect_success ' setup expected' '
25- cat >expected <<EOF
26- new file mode 100644
27- index 0000000..d95f3ad
28- --- /dev/null
29- +++ b/file
30- @@ -0,0 +1 @@
31- +content
32- EOF
25+ cat >expected <<-\ EOF
26+ new file mode 100644
27+ index 0000000..d95f3ad
28+ --- /dev/null
29+ +++ b/file
30+ @@ -0,0 +1 @@
31+ +content
32+ EOF
3333'
3434
3535test_expect_success ' diff works (initial)' '
@@ -59,14 +59,14 @@ test_expect_success 'status works (commit)' '
5959'
6060
6161test_expect_success ' setup expected' '
62- cat >expected <<EOF
63- index 180b47c..b6f2c08 100644
64- --- a/file
65- +++ b/file
66- @@ -1 +1,2 @@
67- baseline
68- +content
69- EOF
62+ cat >expected <<-\ EOF
63+ index 180b47c..b6f2c08 100644
64+ --- a/file
65+ +++ b/file
66+ @@ -1 +1,2 @@
67+ baseline
68+ +content
69+ EOF
7070'
7171
7272test_expect_success ' diff works (commit)' '
@@ -83,8 +83,8 @@ test_expect_success 'revert works (commit)' '
8383
8484
8585test_expect_success ' setup expected' '
86- cat >expected <<EOF
87- EOF
86+ cat >expected <<-\ EOF
87+ EOF
8888'
8989
9090test_expect_success ' setup fake editor' '
@@ -100,21 +100,21 @@ test_expect_success 'dummy edit works' '
100100'
101101
102102test_expect_success ' setup patch' '
103- cat >patch <<EOF
104- @@ -1,1 +1,4 @@
105- this
106- +patch
107- -does not
108- apply
109- EOF
103+ cat >patch <<-\ EOF
104+ @@ -1,1 +1,4 @@
105+ this
106+ +patch
107+ -does not
108+ apply
109+ EOF
110110'
111111
112112test_expect_success ' setup fake editor' '
113113 echo "#!$SHELL_PATH" >fake_editor.sh &&
114- cat >>fake_editor.sh <<\EOF &&
115- mv -f "$1" oldpatch &&
116- mv -f patch "$1"
117- EOF
114+ cat >>fake_editor.sh <<- \EOF &&
115+ mv -f "$1" oldpatch &&
116+ mv -f patch "$1"
117+ EOF
118118 chmod a+x fake_editor.sh &&
119119 test_set_editor "$(pwd)/fake_editor.sh"
120120'
@@ -126,10 +126,10 @@ test_expect_success 'bad edit rejected' '
126126'
127127
128128test_expect_success ' setup patch' '
129- cat >patch <<EOF
130- this patch
131- is garbage
132- EOF
129+ cat >patch <<-\ EOF
130+ this patch
131+ is garbage
132+ EOF
133133'
134134
135135test_expect_success ' garbage edit rejected' '
@@ -139,28 +139,28 @@ test_expect_success 'garbage edit rejected' '
139139'
140140
141141test_expect_success ' setup patch' '
142- cat >patch <<EOF
143- @@ -1,0 +1,0 @@
144- baseline
145- +content
146- +newcontent
147- +lines
148- EOF
142+ cat >patch <<-\ EOF
143+ @@ -1,0 +1,0 @@
144+ baseline
145+ +content
146+ +newcontent
147+ +lines
148+ EOF
149149'
150150
151151test_expect_success ' setup expected' '
152- cat >expected <<EOF
153- diff --git a/file b/file
154- index b5dd6c9..f910ae9 100644
155- --- a/file
156- +++ b/file
157- @@ -1,4 +1,4 @@
158- baseline
159- content
160- -newcontent
161- +more
162- lines
163- EOF
152+ cat >expected <<-\ EOF
153+ diff --git a/file b/file
154+ index b5dd6c9..f910ae9 100644
155+ --- a/file
156+ +++ b/file
157+ @@ -1,4 +1,4 @@
158+ baseline
159+ content
160+ -newcontent
161+ +more
162+ lines
163+ EOF
164164'
165165
166166test_expect_success ' real edit works' '
@@ -222,31 +222,31 @@ test_expect_success 'setup again' '
222222
223223# Write the patch file with a new line at the top and bottom
224224test_expect_success ' setup patch' '
225- cat >patch <<EOF
226- index 180b47c..b6f2c08 100644
227- --- a/file
228- +++ b/file
229- @@ -1,2 +1,4 @@
230- +firstline
231- baseline
232- content
233- +lastline
234- EOF
225+ cat >patch <<-\ EOF
226+ index 180b47c..b6f2c08 100644
227+ --- a/file
228+ +++ b/file
229+ @@ -1,2 +1,4 @@
230+ +firstline
231+ baseline
232+ content
233+ +lastline
234+ EOF
235235'
236236
237237# Expected output, similar to the patch but w/ diff at the top
238238test_expect_success ' setup expected' '
239- cat >expected <<EOF
240- diff --git a/file b/file
241- index b6f2c08..61b9053 100755
242- --- a/file
243- +++ b/file
244- @@ -1,2 +1,4 @@
245- +firstline
246- baseline
247- content
248- +lastline
249- EOF
239+ cat >expected <<-\ EOF
240+ diff --git a/file b/file
241+ index b6f2c08..61b9053 100755
242+ --- a/file
243+ +++ b/file
244+ @@ -1,2 +1,4 @@
245+ +firstline
246+ baseline
247+ content
248+ +lastline
249+ EOF
250250'
251251
252252# Test splitting the first patch, then adding both
@@ -259,15 +259,15 @@ test_expect_success 'add first line works' '
259259'
260260
261261test_expect_success ' setup expected' '
262- cat >expected <<EOF
263- diff --git a/non-empty b/non-empty
264- deleted file mode 100644
265- index d95f3ad..0000000
266- --- a/non-empty
267- +++ /dev/null
268- @@ -1 +0,0 @@
269- -content
270- EOF
262+ cat >expected <<-\ EOF
263+ diff --git a/non-empty b/non-empty
264+ deleted file mode 100644
265+ index d95f3ad..0000000
266+ --- a/non-empty
267+ +++ /dev/null
268+ @@ -1 +0,0 @@
269+ -content
270+ EOF
271271'
272272
273273test_expect_success ' deleting a non-empty file' '
@@ -282,11 +282,11 @@ test_expect_success 'deleting a non-empty file' '
282282'
283283
284284test_expect_success ' setup expected' '
285- cat >expected <<EOF
286- diff --git a/empty b/empty
287- deleted file mode 100644
288- index e69de29..0000000
289- EOF
285+ cat >expected <<-\ EOF
286+ diff --git a/empty b/empty
287+ deleted file mode 100644
288+ index e69de29..0000000
289+ EOF
290290'
291291
292292test_expect_success ' deleting an empty file' '
0 commit comments