t3701: indent here documents
Indent here documents in line with the current style for tests. While at it, quote the end marker of here-docs that do not use variable interpolation. Signed-off-by: Phillip Wood <phillip.wood@dunelm.org.uk> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Phillip Wood committed
Feb 19, 2018 at 11:29 UTC
e4d671c6a686ba48f9f987fdabad0eeb49759199
1 file changed
+87
-87
t/t3701-add-interactive.sh
+87
-87
@@ -22,14 +22,14 @@ test_expect_success 'status works (initial)' '
22
'
23
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
'
34
35
test_expect_success 'diff works (initial)' '
@@ -59,14 +59,14 @@ test_expect_success 'status works (commit)' '
59
'
60
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
'
71
72
test_expect_success 'diff works (commit)' '
@@ -83,8 +83,8 @@ test_expect_success 'revert works (commit)' '
83
84
85
test_expect_success 'setup expected' '
86
-cat >expected <<EOF
87
-EOF
86
+ cat >expected <<-\EOF
87
+ EOF
88
'
89
90
test_expect_success 'setup fake editor' '
@@ -100,21 +100,21 @@ test_expect_success 'dummy edit works' '
100
'
101
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
'
111
112
test_expect_success 'setup fake editor' '
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
chmod a+x fake_editor.sh &&
119
test_set_editor "$(pwd)/fake_editor.sh"
120
'
@@ -126,10 +126,10 @@ test_expect_success 'bad edit rejected' '
126
'
127
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
'
134
135
test_expect_success 'garbage edit rejected' '
@@ -139,28 +139,28 @@ test_expect_success 'garbage edit rejected' '
139
'
140
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
'
150
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
'
165
166
test_expect_success 'real edit works' '
@@ -222,31 +222,31 @@ test_expect_success 'setup again' '
222
223
# Write the patch file with a new line at the top and bottom
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
'
236
237
# Expected output, similar to the patch but w/ diff at the top
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
'
251
252
# Test splitting the first patch, then adding both
@@ -259,15 +259,15 @@ test_expect_success 'add first line works' '
259
'
260
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
'
272
273
test_expect_success 'deleting a non-empty file' '
@@ -282,11 +282,11 @@ test_expect_success 'deleting a non-empty file' '
282
'
283
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
'
291
292
test_expect_success 'deleting an empty file' '