Skip to content

Commit d622c34

Browse files
derrickstoleegitster
authored andcommitted
t1091: improve here-docs
t1091-sparse-checkout-builtin.sh uses here-docs to populate the expected contents of the sparse-checkout file. These do not use shell interpolation, so use "-\EOF" instead of "-EOF". Also use proper tabbing. Signed-off-by: Derrick Stolee <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 522e641 commit d622c34

File tree

1 file changed

+49
-49
lines changed

1 file changed

+49
-49
lines changed

t/t1091-sparse-checkout-builtin.sh

Lines changed: 49 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,11 @@ test_expect_success 'git sparse-checkout list (empty)' '
4646

4747
test_expect_success 'git sparse-checkout list (populated)' '
4848
test_when_finished rm -f repo/.git/info/sparse-checkout &&
49-
cat >repo/.git/info/sparse-checkout <<-EOF &&
50-
/folder1/*
51-
/deep/
52-
**/a
53-
!*bin*
49+
cat >repo/.git/info/sparse-checkout <<-\EOF &&
50+
/folder1/*
51+
/deep/
52+
**/a
53+
!*bin*
5454
EOF
5555
cp repo/.git/info/sparse-checkout expect &&
5656
git -C repo sparse-checkout list >list &&
@@ -59,9 +59,9 @@ test_expect_success 'git sparse-checkout list (populated)' '
5959

6060
test_expect_success 'git sparse-checkout init' '
6161
git -C repo sparse-checkout init &&
62-
cat >expect <<-EOF &&
63-
/*
64-
!/*/
62+
cat >expect <<-\EOF &&
63+
/*
64+
!/*/
6565
EOF
6666
test_cmp expect repo/.git/info/sparse-checkout &&
6767
test_cmp_config -C repo true core.sparsecheckout &&
@@ -70,20 +70,20 @@ test_expect_success 'git sparse-checkout init' '
7070

7171
test_expect_success 'git sparse-checkout list after init' '
7272
git -C repo sparse-checkout list >actual &&
73-
cat >expect <<-EOF &&
74-
/*
75-
!/*/
73+
cat >expect <<-\EOF &&
74+
/*
75+
!/*/
7676
EOF
7777
test_cmp expect actual
7878
'
7979

8080
test_expect_success 'init with existing sparse-checkout' '
8181
echo "*folder*" >> repo/.git/info/sparse-checkout &&
8282
git -C repo sparse-checkout init &&
83-
cat >expect <<-EOF &&
84-
/*
85-
!/*/
86-
*folder*
83+
cat >expect <<-\EOF &&
84+
/*
85+
!/*/
86+
*folder*
8787
EOF
8888
test_cmp expect repo/.git/info/sparse-checkout &&
8989
check_files repo a folder1 folder2
@@ -92,9 +92,9 @@ test_expect_success 'init with existing sparse-checkout' '
9292
test_expect_success 'clone --sparse' '
9393
git clone --sparse repo clone &&
9494
git -C clone sparse-checkout list >actual &&
95-
cat >expect <<-EOF &&
96-
/*
97-
!/*/
95+
cat >expect <<-\EOF &&
96+
/*
97+
!/*/
9898
EOF
9999
test_cmp expect actual &&
100100
check_files clone a
@@ -116,10 +116,10 @@ test_expect_success 'set enables config' '
116116

117117
test_expect_success 'set sparse-checkout using builtin' '
118118
git -C repo sparse-checkout set "/*" "!/*/" "*folder*" &&
119-
cat >expect <<-EOF &&
120-
/*
121-
!/*/
122-
*folder*
119+
cat >expect <<-\EOF &&
120+
/*
121+
!/*/
122+
*folder*
123123
EOF
124124
git -C repo sparse-checkout list >actual &&
125125
test_cmp expect actual &&
@@ -128,11 +128,11 @@ test_expect_success 'set sparse-checkout using builtin' '
128128
'
129129

130130
test_expect_success 'set sparse-checkout using --stdin' '
131-
cat >expect <<-EOF &&
132-
/*
133-
!/*/
134-
/folder1/
135-
/folder2/
131+
cat >expect <<-\EOF &&
132+
/*
133+
!/*/
134+
/folder1/
135+
/folder2/
136136
EOF
137137
git -C repo sparse-checkout set --stdin <expect &&
138138
git -C repo sparse-checkout list >actual &&
@@ -179,28 +179,28 @@ test_expect_success 'cone mode: init and set' '
179179
check_files repo a deep &&
180180
check_files repo/deep a deeper1 &&
181181
check_files repo/deep/deeper1 a deepest &&
182-
cat >expect <<-EOF &&
183-
/*
184-
!/*/
185-
/deep/
186-
!/deep/*/
187-
/deep/deeper1/
188-
!/deep/deeper1/*/
189-
/deep/deeper1/deepest/
182+
cat >expect <<-\EOF &&
183+
/*
184+
!/*/
185+
/deep/
186+
!/deep/*/
187+
/deep/deeper1/
188+
!/deep/deeper1/*/
189+
/deep/deeper1/deepest/
190190
EOF
191191
test_cmp expect repo/.git/info/sparse-checkout &&
192-
git -C repo sparse-checkout set --stdin 2>err <<-EOF &&
193-
folder1
194-
folder2
192+
git -C repo sparse-checkout set --stdin 2>err <<-\EOF &&
193+
folder1
194+
folder2
195195
EOF
196196
test_must_be_empty err &&
197197
check_files repo a folder1 folder2
198198
'
199199

200200
test_expect_success 'cone mode: list' '
201-
cat >expect <<-EOF &&
202-
folder1
203-
folder2
201+
cat >expect <<-\EOF &&
202+
folder1
203+
folder2
204204
EOF
205205
git -C repo sparse-checkout set --stdin <expect &&
206206
git -C repo sparse-checkout list >actual 2>err &&
@@ -211,10 +211,10 @@ test_expect_success 'cone mode: list' '
211211
test_expect_success 'cone mode: set with nested folders' '
212212
git -C repo sparse-checkout set deep deep/deeper1/deepest 2>err &&
213213
test_line_count = 0 err &&
214-
cat >expect <<-EOF &&
215-
/*
216-
!/*/
217-
/deep/
214+
cat >expect <<-\EOF &&
215+
/*
216+
!/*/
217+
/deep/
218218
EOF
219219
test_cmp repo/.git/info/sparse-checkout expect
220220
'
@@ -271,10 +271,10 @@ test_expect_success 'sparse-checkout (init|set|disable) fails with dirty status'
271271
test_expect_success 'cone mode: set with core.ignoreCase=true' '
272272
git -C repo sparse-checkout init --cone &&
273273
git -C repo -c core.ignoreCase=true sparse-checkout set folder1 &&
274-
cat >expect <<-EOF &&
275-
/*
276-
!/*/
277-
/folder1/
274+
cat >expect <<-\EOF &&
275+
/*
276+
!/*/
277+
/folder1/
278278
EOF
279279
test_cmp expect repo/.git/info/sparse-checkout &&
280280
check_files repo a folder1

0 commit comments

Comments
 (0)