Skip to content
This repository was archived by the owner on Nov 9, 2017. It is now read-only.

Commit 5d21adc

Browse files
committed
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent ff86796 commit 5d21adc

File tree

1 file changed

+20
-20
lines changed

1 file changed

+20
-20
lines changed

contrib/remote-helpers/test-hg-hg-git.sh

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -144,10 +144,10 @@ test_expect_success 'executable bit' '
144144
hg_log . &&
145145
hg manifest -r 1 -v &&
146146
hg manifest -v
147-
) >output-$x &&
147+
) >"output-$x" &&
148148
149149
git_clone_$x hgrepo-$x gitrepo2-$x &&
150-
git_log gitrepo2-$x >log-$x
150+
git_log gitrepo2-$x >"log-$x"
151151
done &&
152152
153153
test_cmp output-hg output-git &&
@@ -175,10 +175,10 @@ test_expect_success 'symlink' '
175175
cd hgrepo-$x &&
176176
hg_log . &&
177177
hg manifest -v
178-
) >output-$x &&
178+
) >"output-$x" &&
179179
180180
git_clone_$x hgrepo-$x gitrepo2-$x &&
181-
git_log gitrepo2-$x >log-$x
181+
git_log gitrepo2-$x >"log-$x"
182182
done &&
183183
184184
test_cmp output-hg output-git &&
@@ -212,8 +212,8 @@ test_expect_success 'merge conflict 1' '
212212
do
213213
git_clone_$x hgrepo1 gitrepo-$x &&
214214
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"
217217
done &&
218218
219219
test_cmp hg-log-hg hg-log-git &&
@@ -247,8 +247,8 @@ test_expect_success 'merge conflict 2' '
247247
do
248248
git_clone_$x hgrepo1 gitrepo-$x &&
249249
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"
252252
done &&
253253
254254
test_cmp hg-log-hg hg-log-git &&
@@ -283,8 +283,8 @@ test_expect_success 'converged merge' '
283283
do
284284
git_clone_$x hgrepo1 gitrepo-$x &&
285285
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"
288288
done &&
289289
290290
test_cmp hg-log-hg hg-log-git &&
@@ -323,8 +323,8 @@ test_expect_success 'encoding' '
323323
hg_clone_$x gitrepo hgrepo-$x &&
324324
git_clone_$x hgrepo-$x gitrepo2-$x &&
325325
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"
328328
done &&
329329
330330
test_cmp hg-log-hg hg-log-git &&
@@ -361,10 +361,10 @@ test_expect_success 'file removal' '
361361
hg_log . &&
362362
hg manifest -r 3 &&
363363
hg manifest
364-
) >output-$x &&
364+
) >"output-$x" &&
365365
366366
git_clone_$x hgrepo-$x gitrepo2-$x &&
367-
git_log gitrepo2-$x >log-$x
367+
git_log gitrepo2-$x >"log-$x"
368368
done &&
369369
370370
test_cmp output-hg output-git &&
@@ -392,7 +392,7 @@ test_expect_success 'git tags' '
392392
for x in hg git
393393
do
394394
hg_clone_$x gitrepo hgrepo-$x &&
395-
hg_log hgrepo-$x >log-$x
395+
hg_log hgrepo-$x >"log-$x"
396396
done &&
397397
398398
test_cmp log-hg log-git
@@ -457,8 +457,8 @@ test_expect_success 'hg author' '
457457
hg_push_$x hgrepo-$x gitrepo-$x &&
458458
hg_clone_$x gitrepo-$x hgrepo2-$x &&
459459
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"
462462
done &&
463463
464464
test_cmp hg-log-hg hg-log-git &&
@@ -494,8 +494,8 @@ test_expect_success 'hg branch' '
494494
hg_push_$x hgrepo-$x gitrepo-$x &&
495495
hg_clone_$x gitrepo-$x hgrepo2-$x &&
496496
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"
499499
done &&
500500
501501
test_cmp hg-log-hg hg-log-git &&
@@ -532,7 +532,7 @@ test_expect_success 'hg tags' '
532532
git --git-dir=gitrepo-$x/.git tag -l &&
533533
hg_log hgrepo2-$x &&
534534
cat hgrepo2-$x/.hgtags
535-
) >output-$x
535+
) >"output-$x"
536536
done &&
537537
538538
test_cmp output-hg output-git

0 commit comments

Comments
 (0)