Skip to content

Commit f5efd51

Browse files
devzero2000gitster
authored andcommitted
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 <[email protected]> Reviewed-by: Matthieu Moy <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent ce21ccf commit f5efd51

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

t/t5000-tar-tree.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ test_expect_success \
123123
'add files to repository' \
124124
'find a -type f | xargs git update-index --add &&
125125
find a -type l | xargs git update-index --add &&
126-
treeid=`git write-tree` &&
126+
treeid=$(git write-tree) &&
127127
echo $treeid >treeid &&
128128
git update-ref HEAD $(TZ=GMT GIT_COMMITTER_DATE="2005-05-27 22:00:00" \
129129
git commit-tree $treeid </dev/null)'
@@ -207,15 +207,15 @@ test_expect_success \
207207

208208
test_expect_success 'clients cannot access unreachable commits' '
209209
test_commit unreachable &&
210-
sha1=`git rev-parse HEAD` &&
210+
sha1=$(git rev-parse HEAD) &&
211211
git reset --hard HEAD^ &&
212212
git archive $sha1 >remote.tar &&
213213
test_must_fail git archive --remote=. $sha1 >remote.tar
214214
'
215215

216216
test_expect_success 'upload-archive can allow unreachable commits' '
217217
test_commit unreachable1 &&
218-
sha1=`git rev-parse HEAD` &&
218+
sha1=$(git rev-parse HEAD) &&
219219
git reset --hard HEAD^ &&
220220
git archive $sha1 >remote.tar &&
221221
test_config uploadarchive.allowUnreachable true &&

0 commit comments

Comments
 (0)