@@ -22,14 +22,14 @@ test_expect_success 'status works (initial)' '
22
22
'
23
23
24
24
test_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
33
33
'
34
34
35
35
test_expect_success ' diff works (initial)' '
@@ -59,14 +59,14 @@ test_expect_success 'status works (commit)' '
59
59
'
60
60
61
61
test_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
70
70
'
71
71
72
72
test_expect_success ' diff works (commit)' '
@@ -83,8 +83,8 @@ test_expect_success 'revert works (commit)' '
83
83
84
84
85
85
test_expect_success ' setup expected' '
86
- cat >expected <<EOF
87
- EOF
86
+ cat >expected <<-\ EOF
87
+ EOF
88
88
'
89
89
90
90
test_expect_success ' setup fake editor' '
@@ -100,21 +100,21 @@ test_expect_success 'dummy edit works' '
100
100
'
101
101
102
102
test_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
110
110
'
111
111
112
112
test_expect_success ' setup fake editor' '
113
113
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
118
118
chmod a+x fake_editor.sh &&
119
119
test_set_editor "$(pwd)/fake_editor.sh"
120
120
'
@@ -126,10 +126,10 @@ test_expect_success 'bad edit rejected' '
126
126
'
127
127
128
128
test_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
133
133
'
134
134
135
135
test_expect_success ' garbage edit rejected' '
@@ -139,28 +139,28 @@ test_expect_success 'garbage edit rejected' '
139
139
'
140
140
141
141
test_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
149
149
'
150
150
151
151
test_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
164
164
'
165
165
166
166
test_expect_success ' real edit works' '
@@ -222,31 +222,31 @@ test_expect_success 'setup again' '
222
222
223
223
# Write the patch file with a new line at the top and bottom
224
224
test_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
235
235
'
236
236
237
237
# Expected output, similar to the patch but w/ diff at the top
238
238
test_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
250
250
'
251
251
252
252
# Test splitting the first patch, then adding both
@@ -259,15 +259,15 @@ test_expect_success 'add first line works' '
259
259
'
260
260
261
261
test_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
271
271
'
272
272
273
273
test_expect_success ' deleting a non-empty file' '
@@ -282,11 +282,11 @@ test_expect_success 'deleting a non-empty file' '
282
282
'
283
283
284
284
test_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
290
290
'
291
291
292
292
test_expect_success ' deleting an empty file' '
0 commit comments