t5000-tar-tree.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 30, 2014 at 09:23 UTC
f5efd5196cf2d7931785f663b219b40fd204e1b1
1 file changed
+3
-3
t/t5000-tar-tree.sh
+3
-3
@@ -123,7 +123,7 @@ test_expect_success \
123
'add files to repository' \
124
'find a -type f | xargs git update-index --add &&
125
find a -type l | xargs git update-index --add &&
126
- treeid=`git write-tree` &&
126
+ treeid=$(git write-tree) &&
127
echo $treeid >treeid &&
128
git update-ref HEAD $(TZ=GMT GIT_COMMITTER_DATE="2005-05-27 22:00:00" \
129
git commit-tree $treeid </dev/null)'
@@ -207,7 +207,7 @@ test_expect_success \
207
208
test_expect_success 'clients cannot access unreachable commits' '
209
test_commit unreachable &&
210
- sha1=`git rev-parse HEAD` &&
210
+ sha1=$(git rev-parse HEAD) &&
211
git reset --hard HEAD^ &&
212
git archive $sha1 >remote.tar &&
213
test_must_fail git archive --remote=. $sha1 >remote.tar
@@ -215,7 +215,7 @@ test_expect_success 'clients cannot access unreachable commits' '
215
216
test_expect_success 'upload-archive can allow unreachable commits' '
217
test_commit unreachable1 &&
218
- sha1=`git rev-parse HEAD` &&
218
+ sha1=$(git rev-parse HEAD) &&
219
git reset --hard HEAD^ &&
220
git archive $sha1 >remote.tar &&
221
test_config uploadarchive.allowUnreachable true &&