t9400-git-cvsserver-server: modernize test format

Some tests still use the old format with four spaces indentation. Standardize the tests to the new format with tab indentation. Signed-off-by: John Cai <johncai86@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

John Cai committed May 20, 2023 at 16:13 UTC 447a3b733134813be2582dc85f62287300c75a14
1 file changed +278 -252
t/t9400-git-cvsserver-server.sh
+278 -252
@@ -66,10 +66,11 @@ test_expect_success 'setup' '
66
67 # note that cvs doesn't accept absolute pathnames
68 # as argument to co -d
69 -test_expect_success 'basic checkout' \
70 - 'GIT_CONFIG="$git_config" cvs -Q co -d cvswork main &&
71 - test "$(echo $(grep -v ^D cvswork/CVS/Entries|cut -d/ -f2,3,5 | head -n 1))" = "empty/1.1/" &&
72 - test "$(echo $(grep -v ^D cvswork/CVS/Entries|cut -d/ -f2,3,5 | sed -ne \$p))" = "secondrootfile/1.1/"'
69 +test_expect_success 'basic checkout' '
70 + GIT_CONFIG="$git_config" cvs -Q co -d cvswork main &&
71 + test "$(echo $(grep -v ^D cvswork/CVS/Entries|cut -d/ -f2,3,5 | head -n 1))" = "empty/1.1/" &&
72 + test "$(echo $(grep -v ^D cvswork/CVS/Entries|cut -d/ -f2,3,5 | sed -ne \$p))" = "secondrootfile/1.1/"
73 +'
74
75 #------------------------
76 # PSERVER AUTHENTICATION
@@ -115,35 +116,40 @@ Ah<Z:yZZ30 e
116 END VERIFICATION REQUEST
117 EOF
118
118 -test_expect_success 'pserver authentication' \
119 - 'cat request-anonymous | git-cvsserver pserver >log 2>&1 &&
120 - sed -ne \$p log | grep "^I LOVE YOU\$"'
119 +test_expect_success 'pserver authentication' '
120 + cat request-anonymous | git-cvsserver pserver >log 2>&1 &&
121 + sed -ne \$p log | grep "^I LOVE YOU\$"
122 +'
123
122 -test_expect_success 'pserver authentication failure (non-anonymous user)' \
123 - 'if cat request-git | git-cvsserver pserver >log 2>&1
124 - then
125 - false
126 - else
127 - true
128 - fi &&
129 - sed -ne \$p log | grep "^I HATE YOU\$"'
124 +test_expect_success 'pserver authentication failure (non-anonymous user)' '
125 + if cat request-git | git-cvsserver pserver >log 2>&1
126 + then
127 + false
128 + else
129 + true
130 + fi &&
131 + sed -ne \$p log | grep "^I HATE YOU\$"
132 +'
133
131 -test_expect_success 'pserver authentication success (non-anonymous user with password)' \
132 - 'cat login-git-ok | git-cvsserver pserver >log 2>&1 &&
133 - sed -ne \$p log | grep "^I LOVE YOU\$"'
134 +test_expect_success 'pserver authentication success (non-anonymous user with password)' '
135 + cat login-git-ok | git-cvsserver pserver >log 2>&1 &&
136 + sed -ne \$p log | grep "^I LOVE YOU\$"
137 +'
138
135 -test_expect_success 'pserver authentication (login)' \
136 - 'cat login-anonymous | git-cvsserver pserver >log 2>&1 &&
137 - sed -ne \$p log | grep "^I LOVE YOU\$"'
139 +test_expect_success 'pserver authentication (login)' '
140 + cat login-anonymous | git-cvsserver pserver >log 2>&1 &&
141 + sed -ne \$p log | grep "^I LOVE YOU\$"
142 +'
143
139 -test_expect_success 'pserver authentication failure (login/non-anonymous user)' \
140 - 'if cat login-git | git-cvsserver pserver >log 2>&1
141 - then
142 - false
143 - else
144 - true
145 - fi &&
146 - sed -ne \$p log | grep "^I HATE YOU\$"'
144 +test_expect_success 'pserver authentication failure (login/non-anonymous user)' '
145 + if cat login-git | git-cvsserver pserver >log 2>&1
146 + then
147 + false
148 + else
149 + true
150 + fi &&
151 + sed -ne \$p log | grep "^I HATE YOU\$"
152 +'
153
154
155 # misuse pserver authentication for testing of req_Root
@@ -165,36 +171,40 @@ END AUTH REQUEST
171 Root $WORKDIR
172 EOF
173
168 -test_expect_success 'req_Root failure (relative pathname)' \
169 - 'if cat request-relative | git-cvsserver pserver >log 2>&1
170 - then
171 - echo unexpected success
172 - false
173 - else
174 - true
175 - fi &&
176 - tail log | grep "^error 1 Root must be an absolute pathname$"'
174 +test_expect_success 'req_Root failure (relative pathname)' '
175 + if cat request-relative | git-cvsserver pserver >log 2>&1
176 + then
177 + echo unexpected success
178 + false
179 + else
180 + true
181 + fi &&
182 + tail log | grep "^error 1 Root must be an absolute pathname$"
183 +'
184
178 -test_expect_success 'req_Root failure (conflicting roots)' \
179 - 'cat request-conflict | git-cvsserver pserver >log 2>&1 &&
180 - tail log | grep "^error 1 Conflicting roots specified$"'
185 +test_expect_success 'req_Root failure (conflicting roots)' '
186 + cat request-conflict | git-cvsserver pserver >log 2>&1 &&
187 + tail log | grep "^error 1 Conflicting roots specified$"
188 +'
189
182 -test_expect_success 'req_Root (strict paths)' \
183 - 'cat request-anonymous | git-cvsserver --strict-paths pserver "$SERVERDIR" >log 2>&1 &&
184 - sed -ne \$p log | grep "^I LOVE YOU\$"'
190 +test_expect_success 'req_Root (strict paths)' '
191 + cat request-anonymous | git-cvsserver --strict-paths pserver "$SERVERDIR" >log 2>&1 &&
192 + sed -ne \$p log | grep "^I LOVE YOU\$"
193 +'
194
195 test_expect_success 'req_Root failure (strict-paths)' '
187 - ! cat request-anonymous |
188 - git-cvsserver --strict-paths pserver "$WORKDIR" >log 2>&1
196 + ! cat request-anonymous |
197 + git-cvsserver --strict-paths pserver "$WORKDIR" >log 2>&1
198 '
199
191 -test_expect_success 'req_Root (w/o strict-paths)' \
192 - 'cat request-anonymous | git-cvsserver pserver "$WORKDIR/" >log 2>&1 &&
193 - sed -ne \$p log | grep "^I LOVE YOU\$"'
200 +test_expect_success 'req_Root (w/o strict-paths)' '
201 + cat request-anonymous | git-cvsserver pserver "$WORKDIR/" >log 2>&1 &&
202 + sed -ne \$p log | grep "^I LOVE YOU\$"
203 +'
204
205 test_expect_success 'req_Root failure (w/o strict-paths)' '
196 - ! cat request-anonymous |
197 - git-cvsserver pserver "$WORKDIR/gitcvs" >log 2>&1
206 + ! cat request-anonymous |
207 + git-cvsserver pserver "$WORKDIR/gitcvs" >log 2>&1
208 '
209
210 cat >request-base <<EOF
@@ -206,27 +216,30 @@ END AUTH REQUEST
216 Root /gitcvs.git
217 EOF
218
209 -test_expect_success 'req_Root (base-path)' \
210 - 'cat request-base | git-cvsserver --strict-paths --base-path "$WORKDIR/" pserver "$SERVERDIR" >log 2>&1 &&
211 - sed -ne \$p log | grep "^I LOVE YOU\$"'
219 +test_expect_success 'req_Root (base-path)' '
220 + cat request-base | git-cvsserver --strict-paths --base-path "$WORKDIR/" pserver "$SERVERDIR" >log 2>&1 &&
221 + sed -ne \$p log | grep "^I LOVE YOU\$"
222 +'
223
224 test_expect_success 'req_Root failure (base-path)' '
214 - ! cat request-anonymous |
215 - git-cvsserver --strict-paths --base-path "$WORKDIR" pserver "$SERVERDIR" >log 2>&1
225 + ! cat request-anonymous |
226 + git-cvsserver --strict-paths --base-path "$WORKDIR" pserver "$SERVERDIR" >log 2>&1
227 '
228
229 GIT_DIR="$SERVERDIR" git config --bool gitcvs.enabled false || exit 1
230
220 -test_expect_success 'req_Root (export-all)' \
221 - 'cat request-anonymous | git-cvsserver --export-all pserver "$WORKDIR" >log 2>&1 &&
222 - sed -ne \$p log | grep "^I LOVE YOU\$"'
231 +test_expect_success 'req_Root (export-all)' '
232 + cat request-anonymous | git-cvsserver --export-all pserver "$WORKDIR" >log 2>&1 &&
233 + sed -ne \$p log | grep "^I LOVE YOU\$"
234 +'
235
224 -test_expect_success 'req_Root failure (export-all w/o directory list)' \
225 - '! (cat request-anonymous | git-cvsserver --export-all pserver >log 2>&1 || false)'
236 +test_expect_success 'req_Root failure (export-all w/o directory list)' '
237 + ! (cat request-anonymous | git-cvsserver --export-all pserver >log 2>&1 || false)'
238
227 -test_expect_success 'req_Root (everything together)' \
228 - 'cat request-base | git-cvsserver --export-all --strict-paths --base-path "$WORKDIR/" pserver "$SERVERDIR" >log 2>&1 &&
229 - sed -ne \$p log | grep "^I LOVE YOU\$"'
239 +test_expect_success 'req_Root (everything together)' '
240 + cat request-base | git-cvsserver --export-all --strict-paths --base-path "$WORKDIR/" pserver "$SERVERDIR" >log 2>&1 &&
241 + sed -ne \$p log | grep "^I LOVE YOU\$"
242 +'
243
244 GIT_DIR="$SERVERDIR" git config --bool gitcvs.enabled true || exit 1
245
@@ -247,45 +260,49 @@ test_expect_success 'gitcvs.enabled = false' \
260 test ! -d cvswork2'
261
262 rm -fr cvswork2
250 -test_expect_success 'gitcvs.ext.enabled = true' \
251 - 'GIT_DIR="$SERVERDIR" git config --bool gitcvs.ext.enabled true &&
252 - GIT_DIR="$SERVERDIR" git config --bool gitcvs.enabled false &&
253 - GIT_CONFIG="$git_config" cvs -Q co -d cvswork2 main >cvs.log 2>&1 &&
254 - test_cmp cvswork cvswork2'
263 +test_expect_success 'gitcvs.ext.enabled = true' '
264 + GIT_DIR="$SERVERDIR" git config --bool gitcvs.ext.enabled true &&
265 + GIT_DIR="$SERVERDIR" git config --bool gitcvs.enabled false &&
266 + GIT_CONFIG="$git_config" cvs -Q co -d cvswork2 main >cvs.log 2>&1 &&
267 + test_cmp cvswork cvswork2
268 +'
269
270 rm -fr cvswork2
257 -test_expect_success 'gitcvs.ext.enabled = false' \
258 - 'GIT_DIR="$SERVERDIR" git config --bool gitcvs.ext.enabled false &&
259 - GIT_DIR="$SERVERDIR" git config --bool gitcvs.enabled true &&
260 - if GIT_CONFIG="$git_config" cvs -Q co -d cvswork2 main >cvs.log 2>&1
261 - then
262 - echo unexpected cvs success
263 - false
264 - else
265 - true
266 - fi &&
267 - grep "GITCVS emulation disabled" cvs.log &&
268 - test ! -d cvswork2'
271 +test_expect_success 'gitcvs.ext.enabled = false' '
272 + GIT_DIR="$SERVERDIR" git config --bool gitcvs.ext.enabled false &&
273 + GIT_DIR="$SERVERDIR" git config --bool gitcvs.enabled true &&
274 + if GIT_CONFIG="$git_config" cvs -Q co -d cvswork2 main >cvs.log 2>&1
275 + then
276 + echo unexpected cvs success
277 + false
278 + else
279 + true
280 + fi &&
281 + grep "GITCVS emulation disabled" cvs.log &&
282 + test ! -d cvswork2
283 +'
284
285 rm -fr cvswork2
271 -test_expect_success 'gitcvs.dbname' \
272 - 'GIT_DIR="$SERVERDIR" git config --bool gitcvs.ext.enabled true &&
273 - GIT_DIR="$SERVERDIR" git config gitcvs.dbname %Ggitcvs.%a.%m.sqlite &&
274 - GIT_CONFIG="$git_config" cvs -Q co -d cvswork2 main >cvs.log 2>&1 &&
275 - test_cmp cvswork cvswork2 &&
276 - test -f "$SERVERDIR/gitcvs.ext.main.sqlite" &&
277 - cmp "$SERVERDIR/gitcvs.main.sqlite" "$SERVERDIR/gitcvs.ext.main.sqlite"'
286 +test_expect_success 'gitcvs.dbname' '
287 + GIT_DIR="$SERVERDIR" git config --bool gitcvs.ext.enabled true &&
288 + GIT_DIR="$SERVERDIR" git config gitcvs.dbname %Ggitcvs.%a.%m.sqlite &&
289 + GIT_CONFIG="$git_config" cvs -Q co -d cvswork2 main >cvs.log 2>&1 &&
290 + test_cmp cvswork cvswork2 &&
291 + test -f "$SERVERDIR/gitcvs.ext.main.sqlite" &&
292 + cmp "$SERVERDIR/gitcvs.main.sqlite" "$SERVERDIR/gitcvs.ext.main.sqlite"
293 +'
294
295 rm -fr cvswork2
280 -test_expect_success 'gitcvs.ext.dbname' \
281 - 'GIT_DIR="$SERVERDIR" git config --bool gitcvs.ext.enabled true &&
282 - GIT_DIR="$SERVERDIR" git config gitcvs.ext.dbname %Ggitcvs1.%a.%m.sqlite &&
283 - GIT_DIR="$SERVERDIR" git config gitcvs.dbname %Ggitcvs2.%a.%m.sqlite &&
284 - GIT_CONFIG="$git_config" cvs -Q co -d cvswork2 main >cvs.log 2>&1 &&
285 - test_cmp cvswork cvswork2 &&
286 - test -f "$SERVERDIR/gitcvs1.ext.main.sqlite" &&
287 - test ! -f "$SERVERDIR/gitcvs2.ext.main.sqlite" &&
288 - cmp "$SERVERDIR/gitcvs.main.sqlite" "$SERVERDIR/gitcvs1.ext.main.sqlite"'
296 +test_expect_success 'gitcvs.ext.dbname' '
297 + GIT_DIR="$SERVERDIR" git config --bool gitcvs.ext.enabled true &&
298 + GIT_DIR="$SERVERDIR" git config gitcvs.ext.dbname %Ggitcvs1.%a.%m.sqlite &&
299 + GIT_DIR="$SERVERDIR" git config gitcvs.dbname %Ggitcvs2.%a.%m.sqlite &&
300 + GIT_CONFIG="$git_config" cvs -Q co -d cvswork2 main >cvs.log 2>&1 &&
301 + test_cmp cvswork cvswork2 &&
302 + test -f "$SERVERDIR/gitcvs1.ext.main.sqlite" &&
303 + test ! -f "$SERVERDIR/gitcvs2.ext.main.sqlite" &&
304 + cmp "$SERVERDIR/gitcvs.main.sqlite" "$SERVERDIR/gitcvs1.ext.main.sqlite"
305 +'
306
307
308 #------------
@@ -299,109 +316,115 @@ GIT_DIR="$SERVERDIR" git config --bool gitcvs.enabled true &&
316 GIT_DIR="$SERVERDIR" git config gitcvs.logfile "$SERVERDIR/gitcvs.log" ||
317 exit 1
318
302 -test_expect_success 'cvs update (create new file)' \
303 - 'echo testfile1 >testfile1 &&
304 - git add testfile1 &&
305 - git commit -q -m "Add testfile1" &&
306 - git push gitcvs.git >/dev/null &&
307 - cd cvswork &&
308 - GIT_CONFIG="$git_config" cvs -Q update &&
309 - test "$(echo $(grep testfile1 CVS/Entries|cut -d/ -f2,3,5))" = "testfile1/1.1/" &&
310 - test_cmp testfile1 ../testfile1'
319 +test_expect_success 'cvs update (create new file)' '
320 + echo testfile1 >testfile1 &&
321 + git add testfile1 &&
322 + git commit -q -m "Add testfile1" &&
323 + git push gitcvs.git >/dev/null &&
324 + cd cvswork &&
325 + GIT_CONFIG="$git_config" cvs -Q update &&
326 + test "$(echo $(grep testfile1 CVS/Entries|cut -d/ -f2,3,5))" = "testfile1/1.1/" &&
327 + test_cmp testfile1 ../testfile1
328 +'
329
330 cd "$WORKDIR"
313 -test_expect_success 'cvs update (update existing file)' \
314 - 'echo line 2 >>testfile1 &&
315 - git add testfile1 &&
316 - git commit -q -m "Append to testfile1" &&
317 - git push gitcvs.git >/dev/null &&
318 - cd cvswork &&
319 - GIT_CONFIG="$git_config" cvs -Q update &&
320 - test "$(echo $(grep testfile1 CVS/Entries|cut -d/ -f2,3,5))" = "testfile1/1.2/" &&
321 - test_cmp testfile1 ../testfile1'
331 +test_expect_success 'cvs update (update existing file)' '
332 + echo line 2 >>testfile1 &&
333 + git add testfile1 &&
334 + git commit -q -m "Append to testfile1" &&
335 + git push gitcvs.git >/dev/null &&
336 + cd cvswork &&
337 + GIT_CONFIG="$git_config" cvs -Q update &&
338 + test "$(echo $(grep testfile1 CVS/Entries|cut -d/ -f2,3,5))" = "testfile1/1.2/" &&
339 + test_cmp testfile1 ../testfile1
340 +'
341
342 cd "$WORKDIR"
343 #TODO: cvsserver doesn't support update w/o -d
344 test_expect_failure "cvs update w/o -d doesn't create subdir (TODO)" '
326 - mkdir test &&
327 - echo >test/empty &&
328 - git add test &&
329 - git commit -q -m "Single Subdirectory" &&
330 - git push gitcvs.git >/dev/null &&
331 - cd cvswork &&
332 - GIT_CONFIG="$git_config" cvs -Q update &&
333 - test ! -d test
345 + mkdir test &&
346 + echo >test/empty &&
347 + git add test &&
348 + git commit -q -m "Single Subdirectory" &&
349 + git push gitcvs.git >/dev/null &&
350 + cd cvswork &&
351 + GIT_CONFIG="$git_config" cvs -Q update &&
352 + test ! -d test
353 '
354
355 cd "$WORKDIR"
337 -test_expect_success 'cvs update (subdirectories)' \
338 - '(for dir in A A/B A/B/C A/D E; do
339 - mkdir $dir &&
340 - echo "test file in $dir" >"$dir/file_in_$(echo $dir|sed -e "s#/# #g")" &&
341 - git add $dir || exit 1
342 - done) &&
343 - git commit -q -m "deep sub directory structure" &&
344 - git push gitcvs.git >/dev/null &&
345 - cd cvswork &&
346 - GIT_CONFIG="$git_config" cvs -Q update -d &&
347 - (for dir in A A/B A/B/C A/D E; do
348 - filename="file_in_$(echo $dir|sed -e "s#/# #g")" &&
349 - if test "$(echo $(grep -v ^D $dir/CVS/Entries|cut -d/ -f2,3,5))" = "$filename/1.1/" &&
350 - test_cmp "$dir/$filename" "../$dir/$filename"; then
351 - :
352 - else
353 - exit 1
354 - fi
355 - done)'
356 +test_expect_success 'cvs update (subdirectories)' '
357 + (for dir in A A/B A/B/C A/D E; do
358 + mkdir $dir &&
359 + echo "test file in $dir" >"$dir/file_in_$(echo $dir|sed -e "s#/# #g")" &&
360 + git add $dir || exit 1
361 + done) &&
362 + git commit -q -m "deep sub directory structure" &&
363 + git push gitcvs.git >/dev/null &&
364 + cd cvswork &&
365 + GIT_CONFIG="$git_config" cvs -Q update -d &&
366 + (for dir in A A/B A/B/C A/D E; do
367 + filename="file_in_$(echo $dir|sed -e "s#/# #g")" &&
368 + if test "$(echo $(grep -v ^D $dir/CVS/Entries|cut -d/ -f2,3,5))" = "$filename/1.1/" &&
369 + test_cmp "$dir/$filename" "../$dir/$filename"; then
370 + :
371 + else
372 + exit 1
373 + fi
374 + done)
375 +'
376
377 cd "$WORKDIR"
358 -test_expect_success 'cvs update (delete file)' \
359 - 'git rm testfile1 &&
360 - git commit -q -m "Remove testfile1" &&
361 - git push gitcvs.git >/dev/null &&
362 - cd cvswork &&
363 - GIT_CONFIG="$git_config" cvs -Q update &&
364 - test -z "$(grep testfile1 CVS/Entries)" &&
365 - test ! -f testfile1'
378 +test_expect_success 'cvs update (delete file)' '
379 + git rm testfile1 &&
380 + git commit -q -m "Remove testfile1" &&
381 + git push gitcvs.git >/dev/null &&
382 + cd cvswork &&
383 + GIT_CONFIG="$git_config" cvs -Q update &&
384 + test -z "$(grep testfile1 CVS/Entries)" &&
385 + test ! -f testfile1
386 +'
387
388 cd "$WORKDIR"
368 -test_expect_success 'cvs update (re-add deleted file)' \
369 - 'echo readded testfile >testfile1 &&
370 - git add testfile1 &&
371 - git commit -q -m "Re-Add testfile1" &&
372 - git push gitcvs.git >/dev/null &&
373 - cd cvswork &&
374 - GIT_CONFIG="$git_config" cvs -Q update &&
375 - test "$(echo $(grep testfile1 CVS/Entries|cut -d/ -f2,3,5))" = "testfile1/1.4/" &&
376 - test_cmp testfile1 ../testfile1'
389 +test_expect_success 'cvs update (re-add deleted file)' '
390 + echo readded testfile >testfile1 &&
391 + git add testfile1 &&
392 + git commit -q -m "Re-Add testfile1" &&
393 + git push gitcvs.git >/dev/null &&
394 + cd cvswork &&
395 + GIT_CONFIG="$git_config" cvs -Q update &&
396 + test "$(echo $(grep testfile1 CVS/Entries|cut -d/ -f2,3,5))" = "testfile1/1.4/" &&
397 + test_cmp testfile1 ../testfile1
398 +'
399
400 cd "$WORKDIR"
379 -test_expect_success 'cvs update (merge)' \
380 - 'echo Line 0 >expected &&
381 - for i in 1 2 3 4 5 6 7
382 - do
383 - echo Line $i >>merge &&
384 - echo Line $i >>expected || return 1
385 - done &&
386 - echo Line 8 >>expected &&
387 - git add merge &&
388 - git commit -q -m "Merge test (pre-merge)" &&
389 - git push gitcvs.git >/dev/null &&
390 - cd cvswork &&
391 - GIT_CONFIG="$git_config" cvs -Q update &&
392 - test "$(echo $(grep merge CVS/Entries|cut -d/ -f2,3,5))" = "merge/1.1/" &&
393 - test_cmp merge ../merge &&
394 - ( echo Line 0 && cat merge ) >merge.tmp &&
395 - mv merge.tmp merge &&
396 - cd "$WORKDIR" &&
397 - echo Line 8 >>merge &&
398 - git add merge &&
399 - git commit -q -m "Merge test (merge)" &&
400 - git push gitcvs.git >/dev/null &&
401 - cd cvswork &&
402 - sleep 1 && touch merge &&
403 - GIT_CONFIG="$git_config" cvs -Q update &&
404 - test_cmp merge ../expected'
401 +test_expect_success 'cvs update (merge)' '
402 + echo Line 0 >expected &&
403 + for i in 1 2 3 4 5 6 7
404 + do
405 + echo Line $i >>merge &&
406 + echo Line $i >>expected || return 1
407 + done &&
408 + echo Line 8 >>expected &&
409 + git add merge &&
410 + git commit -q -m "Merge test (pre-merge)" &&
411 + git push gitcvs.git >/dev/null &&
412 + cd cvswork &&
413 + GIT_CONFIG="$git_config" cvs -Q update &&
414 + test "$(echo $(grep merge CVS/Entries|cut -d/ -f2,3,5))" = "merge/1.1/" &&
415 + test_cmp merge ../merge &&
416 + ( echo Line 0 && cat merge ) >merge.tmp &&
417 + mv merge.tmp merge &&
418 + cd "$WORKDIR" &&
419 + echo Line 8 >>merge &&
420 + git add merge &&
421 + git commit -q -m "Merge test (merge)" &&
422 + git push gitcvs.git >/dev/null &&
423 + cd cvswork &&
424 + sleep 1 && touch merge &&
425 + GIT_CONFIG="$git_config" cvs -Q update &&
426 + test_cmp merge ../expected
427 +'
428
429 cd "$WORKDIR"
430
@@ -418,55 +441,58 @@ do
441 echo Line $i >>expected.C
442 done
443
421 -test_expect_success 'cvs update (conflict merge)' \
422 - '( echo LINE 0 && cat merge ) >merge.tmp &&
423 - mv merge.tmp merge &&
424 - git add merge &&
425 - git commit -q -m "Merge test (conflict)" &&
426 - git push gitcvs.git >/dev/null &&
427 - cd cvswork &&
428 - GIT_CONFIG="$git_config" cvs -Q update &&
429 - test_cmp merge ../expected.C'
444 +test_expect_success 'cvs update (conflict merge)' '
445 + ( echo LINE 0 && cat merge ) >merge.tmp &&
446 + mv merge.tmp merge &&
447 + git add merge &&
448 + git commit -q -m "Merge test (conflict)" &&
449 + git push gitcvs.git >/dev/null &&
450 + cd cvswork &&
451 + GIT_CONFIG="$git_config" cvs -Q update &&
452 + test_cmp merge ../expected.C
453 +'
454
455 cd "$WORKDIR"
432 -test_expect_success 'cvs update (-C)' \
433 - 'cd cvswork &&
434 - GIT_CONFIG="$git_config" cvs -Q update -C &&
435 - test_cmp merge ../merge'
456 +test_expect_success 'cvs update (-C)' '
457 + cd cvswork &&
458 + GIT_CONFIG="$git_config" cvs -Q update -C &&
459 + test_cmp merge ../merge
460 +'
461
462 cd "$WORKDIR"
438 -test_expect_success 'cvs update (merge no-op)' \
439 - 'echo Line 9 >>merge &&
440 - cp merge cvswork/merge &&
441 - git add merge &&
442 - git commit -q -m "Merge test (no-op)" &&
443 - git push gitcvs.git >/dev/null &&
444 - cd cvswork &&
445 - sleep 1 && touch merge &&
446 - GIT_CONFIG="$git_config" cvs -Q update &&
447 - test_cmp merge ../merge'
463 +test_expect_success 'cvs update (merge no-op)' '
464 + echo Line 9 >>merge &&
465 + cp merge cvswork/merge &&
466 + git add merge &&
467 + git commit -q -m "Merge test (no-op)" &&
468 + git push gitcvs.git >/dev/null &&
469 + cd cvswork &&
470 + sleep 1 && touch merge &&
471 + GIT_CONFIG="$git_config" cvs -Q update &&
472 + test_cmp merge ../merge
473 +'
474
475 cd "$WORKDIR"
476 test_expect_success 'cvs update (-p)' '
451 - touch really-empty &&
452 - echo Line 1 > no-lf &&
453 - printf "Line 2" >> no-lf &&
454 - git add really-empty no-lf &&
455 - git commit -q -m "Update -p test" &&
456 - git push gitcvs.git >/dev/null &&
457 - cd cvswork &&
458 - GIT_CONFIG="$git_config" cvs update &&
459 - for i in merge no-lf empty really-empty; do
460 - GIT_CONFIG="$git_config" cvs update -p "$i" >$i.out &&
461 - test_cmp $i.out ../$i || return 1
462 - done
477 + touch really-empty &&
478 + echo Line 1 > no-lf &&
479 + printf "Line 2" >> no-lf &&
480 + git add really-empty no-lf &&
481 + git commit -q -m "Update -p test" &&
482 + git push gitcvs.git >/dev/null &&
483 + cd cvswork &&
484 + GIT_CONFIG="$git_config" cvs update &&
485 + for i in merge no-lf empty really-empty; do
486 + GIT_CONFIG="$git_config" cvs update -p "$i" >$i.out &&
487 + test_cmp $i.out ../$i || return 1
488 + done
489 '
490
491 cd "$WORKDIR"
492 test_expect_success 'cvs update (module list supports packed refs)' '
467 - GIT_DIR="$SERVERDIR" git pack-refs --all &&
468 - GIT_CONFIG="$git_config" cvs -n up -d 2> out &&
469 - grep "cvs update: New directory \`main'\''" < out
493 + GIT_DIR="$SERVERDIR" git pack-refs --all &&
494 + GIT_CONFIG="$git_config" cvs -n up -d 2> out &&
495 + grep "cvs update: New directory \`main'\''" < out
496 '
497
498 #------------
@@ -475,30 +501,30 @@ test_expect_success 'cvs update (module list supports packed refs)' '
501
502 cd "$WORKDIR"
503 test_expect_success 'cvs status' '
478 - mkdir status.dir &&
479 - echo Line > status.dir/status.file &&
480 - echo Line > status.file &&
481 - git add status.dir status.file &&
482 - git commit -q -m "Status test" &&
483 - git push gitcvs.git >/dev/null &&
484 - cd cvswork &&
485 - GIT_CONFIG="$git_config" cvs update &&
486 - GIT_CONFIG="$git_config" cvs status | grep "^File: status.file" >../out &&
487 - test_line_count = 2 ../out
504 + mkdir status.dir &&
505 + echo Line > status.dir/status.file &&
506 + echo Line > status.file &&
507 + git add status.dir status.file &&
508 + git commit -q -m "Status test" &&
509 + git push gitcvs.git >/dev/null &&
510 + cd cvswork &&
511 + GIT_CONFIG="$git_config" cvs update &&
512 + GIT_CONFIG="$git_config" cvs status | grep "^File: status.file" >../out &&
513 + test_line_count = 2 ../out
514 '
515
516 cd "$WORKDIR"
517 test_expect_success 'cvs status (nonrecursive)' '
492 - cd cvswork &&
493 - GIT_CONFIG="$git_config" cvs status -l | grep "^File: status.file" >../out &&
494 - test_line_count = 1 ../out
518 + cd cvswork &&
519 + GIT_CONFIG="$git_config" cvs status -l | grep "^File: status.file" >../out &&
520 + test_line_count = 1 ../out
521 '
522
523 cd "$WORKDIR"
524 test_expect_success 'cvs status (no subdirs in header)' '
499 - cd cvswork &&
500 - GIT_CONFIG="$git_config" cvs status | grep ^File: >../out &&
501 - ! grep / <../out
525 + cd cvswork &&
526 + GIT_CONFIG="$git_config" cvs status | grep ^File: >../out &&
527 + ! grep / <../out
528 '
529
530 #------------
@@ -507,9 +533,9 @@ test_expect_success 'cvs status (no subdirs in header)' '
533
534 cd "$WORKDIR"
535 test_expect_success 'cvs co -c (shows module database)' '
510 - GIT_CONFIG="$git_config" cvs co -c > out &&
511 - grep "^main[ ][ ]*main$" <out &&
512 - ! grep -v "^main[ ][ ]*main$" <out
536 + GIT_CONFIG="$git_config" cvs co -c > out &&
537 + grep "^main[ ][ ]*main$" <out &&
538 + ! grep -v "^main[ ][ ]*main$" <out
539 '
540
541 #------------
@@ -575,11 +601,11 @@ expectStat="$?"
601
602 cd "$WORKDIR"
603 test_expect_success 'cvs log' '
578 - cd cvswork &&
579 - test x"$expectStat" = x"0" &&
580 - GIT_CONFIG="$git_config" cvs log merge >../out &&
581 - sed -e "s%2[0-9][0-9][0-9]/[01][0-9]/[0-3][0-9] [0-2][0-9]:[0-5][0-9]:[0-5][0-9]%__DATE__%" ../out > ../actual &&
582 - test_cmp ../expect ../actual
604 + cd cvswork &&
605 + test x"$expectStat" = x"0" &&
606 + GIT_CONFIG="$git_config" cvs log merge >../out &&
607 +sed -e "s%2[0-9][0-9][0-9]/[01][0-9]/[0-3][0-9] [0-2][0-9]:[0-5][0-9]:[0-5][0-9]%__DATE__%" ../out > ../actual &&
608 + test_cmp ../expect ../actual
609 '
610
611 #------------
@@ -588,11 +614,11 @@ test_expect_success 'cvs log' '
614
615 cd "$WORKDIR"
616 test_expect_success 'cvs annotate' '
591 - cd cvswork &&
592 - GIT_CONFIG="$git_config" cvs annotate merge >../out &&
593 - sed -e "s/ .*//" ../out >../actual &&
594 - printf "1.%d\n" 3 1 1 1 1 1 1 1 2 4 >../expect &&
595 - test_cmp ../expect ../actual
617 + cd cvswork &&
618 + GIT_CONFIG="$git_config" cvs annotate merge >../out &&
619 + sed -e "s/ .*//" ../out >../actual &&
620 + printf "1.%d\n" 3 1 1 1 1 1 1 1 2 4 >../expect &&
621 + test_cmp ../expect ../actual
622 '
623
624 #------------