t6423-merge-rename-directories.sh: use the $(...) construct
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 shellcheck -i SC2006 -f diff ${_f} | ifne git apply -p2 done and then carefully proof-read. Signed-off-by: Elia Pinto <gitter.spiros@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Elia Pinto committed
Mar 13, 2022 at 17:28 UTC
c614beb933f7ef45b4921b1ea344d4a03a701679
1 file changed
+5
-5
t/t6423-merge-rename-directories.sh
+5
-5
@@ -4421,14 +4421,14 @@ test_setup_12c1 () {
4421
4422
git checkout A &&
4423
git mv node2/ node1/ &&
4424
- for i in `git ls-files`; do echo side A >>$i; done &&
4424
+ for i in $(git ls-files); do echo side A >>$i; done &&
4425
git add -u &&
4426
test_tick &&
4427
git commit -m "A" &&
4428
4429
git checkout B &&
4430
git mv node1/ node2/ &&
4431
- for i in `git ls-files`; do echo side B >>$i; done &&
4431
+ for i in $(git ls-files); do echo side B >>$i; done &&
4432
git add -u &&
4433
test_tick &&
4434
git commit -m "B"
@@ -4511,7 +4511,7 @@ test_setup_12c2 () {
4511
4512
git checkout A &&
4513
git mv node2/ node1/ &&
4514
- for i in `git ls-files`; do echo side A >>$i; done &&
4514
+ for i in $(git ls-files); do echo side A >>$i; done &&
4515
git add -u &&
4516
echo leaf5 >node1/leaf5 &&
4517
git add node1/leaf5 &&
@@ -4520,7 +4520,7 @@ test_setup_12c2 () {
4520
4521
git checkout B &&
4522
git mv node1/ node2/ &&
4523
- for i in `git ls-files`; do echo side B >>$i; done &&
4523
+ for i in $(git ls-files); do echo side B >>$i; done &&
4524
git add -u &&
4525
echo leaf6 >node2/leaf6 &&
4526
git add node2/leaf6 &&
@@ -4759,7 +4759,7 @@ test_setup_12f () {
4759
echo g >dir/subdir/tweaked/g &&
4760
echo h >dir/subdir/tweaked/h &&
4761
test_seq 20 30 >dir/subdir/tweaked/Makefile &&
4762
- for i in `test_seq 1 88`; do
4762
+ for i in $(test_seq 1 88); do
4763
echo content $i >dir/unchanged/file_$i
4764
done &&
4765
git add . &&