@matheusbsbs / matheus-bagliano / commits / 3a4fdeee89
Fork 0

t7401: change indentation for enhanced readability

Change the indentation of expected outputs for enhanced readability of the tests. Also modify the heredoc string limiter in a test which lacks it to support the indentation change. Mentored-by: Christian Couder <chriscool@tuxfamily.org> Mentored-by: Kaartic Sivaraam <kaartic.sivaraam@gmail.com> Helped-by: Junio C Hamano <gitster@pobox.com> Helped-by: Taylor Blau <me@taylorr.com> Signed-off-by: Shourya Shukla <shouryashukla.oo@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Shourya Shukla committed Aug 21, 2020 at 22:29 UTC 3a4fdeee895606b258e2bf53d7ed0878936f6214
1 file changed +65 -65
t/t7401-submodule-summary.sh
+65 -65
@@ -38,10 +38,10 @@ test_expect_success 'added submodule' "
38 git add sm1 &&
39 git submodule summary >actual &&
40 cat >expected <<-EOF &&
41 -* sm1 0000000...$head1 (2):
42 - > Add foo2
41 + * sm1 0000000...$head1 (2):
42 + > Add foo2
43
44 -EOF
44 + EOF
45 test_cmp expected actual
46 "
47
@@ -52,10 +52,10 @@ test_expect_success 'added submodule (subdirectory)' "
52 git submodule summary >../actual
53 ) &&
54 cat >expected <<-EOF &&
55 -* ../sm1 0000000...$head1 (2):
56 - > Add foo2
55 + * ../sm1 0000000...$head1 (2):
56 + > Add foo2
57
58 -EOF
58 + EOF
59 test_cmp expected actual
60 "
61
@@ -73,10 +73,10 @@ test_expect_success 'added submodule (subdirectory with explicit path)' "
73 git submodule summary ../sm1 >../actual
74 ) &&
75 cat >expected <<-EOF &&
76 -* ../sm1 0000000...$head1 (2):
77 - > Add foo2
76 + * ../sm1 0000000...$head1 (2):
77 + > Add foo2
78
79 -EOF
79 + EOF
80 test_cmp expected actual
81 "
82
@@ -86,20 +86,20 @@ head2=$(add_file sm1 foo3)
86 test_expect_success 'modified submodule(forward)' "
87 git submodule summary >actual &&
88 cat >expected <<-EOF &&
89 -* sm1 $head1...$head2 (1):
90 - > Add foo3
89 + * sm1 $head1...$head2 (1):
90 + > Add foo3
91
92 -EOF
92 + EOF
93 test_cmp expected actual
94 "
95
96 test_expect_success 'modified submodule(forward), --files' "
97 git submodule summary --files >actual &&
98 cat >expected <<-EOF &&
99 -* sm1 $head1...$head2 (1):
100 - > Add foo3
99 + * sm1 $head1...$head2 (1):
100 + > Add foo3
101
102 -EOF
102 + EOF
103 test_cmp expected actual
104 "
105
@@ -110,10 +110,10 @@ test_expect_success 'no ignore=all setting has any effect' "
110 git config diff.ignoreSubmodules all &&
111 git submodule summary >actual &&
112 cat >expected <<-EOF &&
113 -* sm1 $head1...$head2 (1):
114 - > Add foo3
113 + * sm1 $head1...$head2 (1):
114 + > Add foo3
115
116 -EOF
116 + EOF
117 test_cmp expected actual &&
118 git config --unset diff.ignoreSubmodules &&
119 git config --remove-section submodule.sm1 &&
@@ -131,11 +131,11 @@ head3=$(
131 test_expect_success 'modified submodule(backward)' "
132 git submodule summary >actual &&
133 cat >expected <<-EOF &&
134 -* sm1 $head2...$head3 (2):
135 - < Add foo3
136 - < Add foo2
134 + * sm1 $head2...$head3 (2):
135 + < Add foo3
136 + < Add foo2
137
138 -EOF
138 + EOF
139 test_cmp expected actual
140 "
141
@@ -144,25 +144,25 @@ head4_full=$(GIT_DIR=sm1/.git git rev-parse --verify HEAD)
144 test_expect_success 'modified submodule(backward and forward)' "
145 git submodule summary >actual &&
146 cat >expected <<-EOF &&
147 -* sm1 $head2...$head4 (4):
148 - > Add foo5
149 - > Add foo4
150 - < Add foo3
151 - < Add foo2
147 + * sm1 $head2...$head4 (4):
148 + > Add foo5
149 + > Add foo4
150 + < Add foo3
151 + < Add foo2
152
153 -EOF
153 + EOF
154 test_cmp expected actual
155 "
156
157 test_expect_success '--summary-limit' "
158 git submodule summary -n 3 >actual &&
159 cat >expected <<-EOF &&
160 -* sm1 $head2...$head4 (4):
161 - > Add foo5
162 - > Add foo4
163 - < Add foo3
160 + * sm1 $head2...$head4 (4):
161 + > Add foo5
162 + > Add foo4
163 + < Add foo3
164
165 -EOF
165 + EOF
166 test_cmp expected actual
167 "
168
@@ -177,20 +177,20 @@ mv sm1-bak sm1
177 test_expect_success 'typechanged submodule(submodule->blob), --cached' "
178 git submodule summary --cached >actual &&
179 cat >expected <<-EOF &&
180 -* sm1 $head4(submodule)->$head5(blob) (3):
181 - < Add foo5
180 + * sm1 $head4(submodule)->$head5(blob) (3):
181 + < Add foo5
182
183 -EOF
183 + EOF
184 test_i18ncmp expected actual
185 "
186
187 test_expect_success 'typechanged submodule(submodule->blob), --files' "
188 git submodule summary --files >actual &&
189 cat >expected <<-EOF &&
190 -* sm1 $head5(blob)->$head4(submodule) (3):
191 - > Add foo5
190 + * sm1 $head5(blob)->$head4(submodule) (3):
191 + > Add foo5
192
193 -EOF
193 + EOF
194 test_i18ncmp expected actual
195 "
196
@@ -199,9 +199,9 @@ git checkout-index sm1
199 test_expect_success 'typechanged submodule(submodule->blob)' "
200 git submodule summary >actual &&
201 cat >expected <<-EOF &&
202 -* sm1 $head4(submodule)->$head5(blob):
202 + * sm1 $head4(submodule)->$head5(blob):
203
204 -EOF
204 + EOF
205 test_i18ncmp expected actual
206 "
207
@@ -211,10 +211,10 @@ head6=$(add_file sm1 foo6 foo7)
211 test_expect_success 'nonexistent commit' "
212 git submodule summary >actual &&
213 cat >expected <<-EOF &&
214 -* sm1 $head4...$head6:
215 - Warn: sm1 doesn't contain commit $head4_full
214 + * sm1 $head4...$head6:
215 + Warn: sm1 doesn't contain commit $head4_full
216
217 -EOF
217 + EOF
218 test_i18ncmp expected actual
219 "
220
@@ -222,10 +222,10 @@ commit_file
222 test_expect_success 'typechanged submodule(blob->submodule)' "
223 git submodule summary >actual &&
224 cat >expected <<-EOF &&
225 -* sm1 $head5(blob)->$head6(submodule) (2):
226 - > Add foo7
225 + * sm1 $head5(blob)->$head6(submodule) (2):
226 + > Add foo7
227
228 -EOF
228 + EOF
229 test_i18ncmp expected actual
230 "
231
@@ -234,9 +234,9 @@ rm -rf sm1
234 test_expect_success 'deleted submodule' "
235 git submodule summary >actual &&
236 cat >expected <<-EOF &&
237 -* sm1 $head6...0000000:
237 + * sm1 $head6...0000000:
238
239 -EOF
239 + EOF
240 test_cmp expected actual
241 "
242
@@ -249,22 +249,22 @@ test_expect_success 'create second submodule' '
249 test_expect_success 'multiple submodules' "
250 git submodule summary >actual &&
251 cat >expected <<-EOF &&
252 -* sm1 $head6...0000000:
252 + * sm1 $head6...0000000:
253
254 -* sm2 0000000...$head7 (2):
255 - > Add foo9
254 + * sm2 0000000...$head7 (2):
255 + > Add foo9
256
257 -EOF
257 + EOF
258 test_cmp expected actual
259 "
260
261 test_expect_success 'path filter' "
262 git submodule summary sm2 >actual &&
263 cat >expected <<-EOF &&
264 -* sm2 0000000...$head7 (2):
265 - > Add foo9
264 + * sm2 0000000...$head7 (2):
265 + > Add foo9
266
267 -EOF
267 + EOF
268 test_cmp expected actual
269 "
270
@@ -272,24 +272,24 @@ commit_file sm2
272 test_expect_success 'given commit' "
273 git submodule summary HEAD^ >actual &&
274 cat >expected <<-EOF &&
275 -* sm1 $head6...0000000:
275 + * sm1 $head6...0000000:
276
277 -* sm2 0000000...$head7 (2):
278 - > Add foo9
277 + * sm2 0000000...$head7 (2):
278 + > Add foo9
279
280 -EOF
280 + EOF
281 test_cmp expected actual
282 "
283
284 test_expect_success '--for-status' "
285 git submodule summary --for-status HEAD^ >actual &&
286 - test_i18ncmp - actual <<EOF
287 -* sm1 $head6...0000000:
286 + test_i18ncmp - actual <<-EOF
287 + * sm1 $head6...0000000:
288
289 -* sm2 0000000...$head7 (2):
290 - > Add foo9
289 + * sm2 0000000...$head7 (2):
290 + > Add foo9
291
292 -EOF
292 + EOF
293 "
294
295 test_expect_success 'fail when using --files together with --cached' "