t0001-init.sh: use the $( ... ) construct for command substitution

The Git CodingGuidelines prefer the $(...) construct for command substitution instead of using the backquotes `...`. The backquoted form is the traditional method for command substitution, and is supported by POSIX. However, all but the simplest uses become complicated quickly. In particular, embedded command substitutions and/or the use of double quotes require careful escaping with the backslash character. The patch was generated by: for _f in $(find . -name "*.sh") do sed -i 's@`\(.*\)`@$(\1)@g' ${_f} done and then carefully proof-read. Signed-off-by: Elia Pinto <gitter.spiros@gmail.com> Reviewed-by: Matthieu Moy <Matthieu.Moy@imag.fr> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Elia Pinto committed Apr 28, 2014 at 05:57 UTC 88619b3ee4bd21254d3306b12f47be3f0d9ad04b
1 file changed +6 -6
t/t0001-init.sh
+6 -6
@@ -250,7 +250,7 @@ test_expect_success 'init --bare/--shared overrides system/global config' '
250 ) &&
251 check_config init-bare-shared-override true unset &&
252 test x0666 = \
253 - x`git config -f init-bare-shared-override/config core.sharedRepository`
253 + x$(git config -f init-bare-shared-override/config core.sharedRepository)
254 '
255
256 test_expect_success 'init honors global core.sharedRepository' '
@@ -262,7 +262,7 @@ test_expect_success 'init honors global core.sharedRepository' '
262 git init
263 ) &&
264 test x0666 = \
265 - x`git config -f shared-honor-global/.git/config core.sharedRepository`
265 + x$(git config -f shared-honor-global/.git/config core.sharedRepository)
266 '
267
268 test_expect_success 'init rejects insanely long --template' '
@@ -374,7 +374,7 @@ test_expect_success 'init prefers command line to GIT_DIR' '
374 test_expect_success 'init with separate gitdir' '
375 rm -rf newdir &&
376 git init --separate-git-dir realgitdir newdir &&
377 - echo "gitdir: `pwd`/realgitdir" >expected &&
377 + echo "gitdir: $(pwd)/realgitdir" >expected &&
378 test_cmp expected newdir/.git &&
379 test -d realgitdir/refs
380 '
@@ -388,7 +388,7 @@ test_expect_success 're-init to update git link' '
388 cd newdir &&
389 git init --separate-git-dir ../surrealgitdir
390 ) &&
391 - echo "gitdir: `pwd`/surrealgitdir" >expected &&
391 + echo "gitdir: $(pwd)/surrealgitdir" >expected &&
392 test_cmp expected newdir/.git &&
393 test -d surrealgitdir/refs &&
394 ! test -d realgitdir/refs
@@ -401,7 +401,7 @@ test_expect_success 're-init to move gitdir' '
401 cd newdir &&
402 git init --separate-git-dir ../realgitdir
403 ) &&
404 - echo "gitdir: `pwd`/realgitdir" >expected &&
404 + echo "gitdir: $(pwd)/realgitdir" >expected &&
405 test_cmp expected newdir/.git &&
406 test -d realgitdir/refs
407 '
@@ -415,7 +415,7 @@ test_expect_success SYMLINKS 're-init to move gitdir symlink' '
415 ln -s here .git &&
416 git init --separate-git-dir ../realgitdir
417 ) &&
418 - echo "gitdir: `pwd`/realgitdir" >expected &&
418 + echo "gitdir: $(pwd)/realgitdir" >expected &&
419 test_cmp expected newdir/.git &&
420 test -d realgitdir/refs &&
421 ! test -d newdir/here