contrib/remote-helpers: quote variable references in redirection targets

Even though it is not required by POSIX to double-quote the redirection target in a variable, our code does so because some versions of bash issue a warning without the quotes. Reviewed-by: Michael Haggerty <mhagger@alum.mit.edu> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Junio C Hamano committed Aug 29, 2013 at 14:20 UTC 5d21adcbfe5540b89831fef2a2581d54dee4d478
1 file changed +20 -20
contrib/remote-helpers/test-hg-hg-git.sh
+20 -20
@@ -144,10 +144,10 @@ test_expect_success 'executable bit' '
144 hg_log . &&
145 hg manifest -r 1 -v &&
146 hg manifest -v
147 - ) >output-$x &&
147 + ) >"output-$x" &&
148
149 git_clone_$x hgrepo-$x gitrepo2-$x &&
150 - git_log gitrepo2-$x >log-$x
150 + git_log gitrepo2-$x >"log-$x"
151 done &&
152
153 test_cmp output-hg output-git &&
@@ -175,10 +175,10 @@ test_expect_success 'symlink' '
175 cd hgrepo-$x &&
176 hg_log . &&
177 hg manifest -v
178 - ) >output-$x &&
178 + ) >"output-$x" &&
179
180 git_clone_$x hgrepo-$x gitrepo2-$x &&
181 - git_log gitrepo2-$x >log-$x
181 + git_log gitrepo2-$x >"log-$x"
182 done &&
183
184 test_cmp output-hg output-git &&
@@ -212,8 +212,8 @@ test_expect_success 'merge conflict 1' '
212 do
213 git_clone_$x hgrepo1 gitrepo-$x &&
214 hg_clone_$x gitrepo-$x hgrepo2-$x &&
215 - hg_log hgrepo2-$x >hg-log-$x &&
216 - git_log gitrepo-$x >git-log-$x
215 + hg_log hgrepo2-$x >"hg-log-$x" &&
216 + git_log gitrepo-$x >"git-log-$x"
217 done &&
218
219 test_cmp hg-log-hg hg-log-git &&
@@ -247,8 +247,8 @@ test_expect_success 'merge conflict 2' '
247 do
248 git_clone_$x hgrepo1 gitrepo-$x &&
249 hg_clone_$x gitrepo-$x hgrepo2-$x &&
250 - hg_log hgrepo2-$x >hg-log-$x &&
251 - git_log gitrepo-$x >git-log-$x
250 + hg_log hgrepo2-$x >"hg-log-$x" &&
251 + git_log gitrepo-$x >"git-log-$x"
252 done &&
253
254 test_cmp hg-log-hg hg-log-git &&
@@ -283,8 +283,8 @@ test_expect_success 'converged merge' '
283 do
284 git_clone_$x hgrepo1 gitrepo-$x &&
285 hg_clone_$x gitrepo-$x hgrepo2-$x &&
286 - hg_log hgrepo2-$x >hg-log-$x &&
287 - git_log gitrepo-$x >git-log-$x
286 + hg_log hgrepo2-$x >"hg-log-$x" &&
287 + git_log gitrepo-$x >"git-log-$x"
288 done &&
289
290 test_cmp hg-log-hg hg-log-git &&
@@ -323,8 +323,8 @@ test_expect_success 'encoding' '
323 hg_clone_$x gitrepo hgrepo-$x &&
324 git_clone_$x hgrepo-$x gitrepo2-$x &&
325
326 - HGENCODING=utf-8 hg_log hgrepo-$x >hg-log-$x &&
327 - git_log gitrepo2-$x >git-log-$x
326 + HGENCODING=utf-8 hg_log hgrepo-$x >"hg-log-$x" &&
327 + git_log gitrepo2-$x >"git-log-$x"
328 done &&
329
330 test_cmp hg-log-hg hg-log-git &&
@@ -361,10 +361,10 @@ test_expect_success 'file removal' '
361 hg_log . &&
362 hg manifest -r 3 &&
363 hg manifest
364 - ) >output-$x &&
364 + ) >"output-$x" &&
365
366 git_clone_$x hgrepo-$x gitrepo2-$x &&
367 - git_log gitrepo2-$x >log-$x
367 + git_log gitrepo2-$x >"log-$x"
368 done &&
369
370 test_cmp output-hg output-git &&
@@ -392,7 +392,7 @@ test_expect_success 'git tags' '
392 for x in hg git
393 do
394 hg_clone_$x gitrepo hgrepo-$x &&
395 - hg_log hgrepo-$x >log-$x
395 + hg_log hgrepo-$x >"log-$x"
396 done &&
397
398 test_cmp log-hg log-git
@@ -457,8 +457,8 @@ test_expect_success 'hg author' '
457 hg_push_$x hgrepo-$x gitrepo-$x &&
458 hg_clone_$x gitrepo-$x hgrepo2-$x &&
459
460 - hg_log hgrepo2-$x >hg-log-$x &&
461 - git_log gitrepo-$x >git-log-$x
460 + hg_log hgrepo2-$x >"hg-log-$x" &&
461 + git_log gitrepo-$x >"git-log-$x"
462 done &&
463
464 test_cmp hg-log-hg hg-log-git &&
@@ -494,8 +494,8 @@ test_expect_success 'hg branch' '
494 hg_push_$x hgrepo-$x gitrepo-$x &&
495 hg_clone_$x gitrepo-$x hgrepo2-$x &&
496
497 - hg_log hgrepo2-$x >hg-log-$x &&
498 - git_log gitrepo-$x >git-log-$x
497 + hg_log hgrepo2-$x >"hg-log-$x" &&
498 + git_log gitrepo-$x >"git-log-$x"
499 done &&
500
501 test_cmp hg-log-hg hg-log-git &&
@@ -532,7 +532,7 @@ test_expect_success 'hg tags' '
532 git --git-dir=gitrepo-$x/.git tag -l &&
533 hg_log hgrepo2-$x &&
534 cat hgrepo2-$x/.hgtags
535 - ) >output-$x
535 + ) >"output-$x"
536 done &&
537
538 test_cmp output-hg output-git