Skip to content

Commit 728fc79

Browse files
devzero2000gitster
authored andcommitted
git-rebase.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 f257482 commit 728fc79

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

git-rebase.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -462,8 +462,8 @@ then
462462
else
463463
if test -z "$onto"
464464
then
465-
empty_tree=`git hash-object -t tree /dev/null`
466-
onto=`git commit-tree $empty_tree </dev/null`
465+
empty_tree=$(git hash-object -t tree /dev/null)
466+
onto=$(git commit-tree $empty_tree </dev/null)
467467
squash_onto="$onto"
468468
fi
469469
unset upstream_name
@@ -521,10 +521,10 @@ case "$#" in
521521
;;
522522
0)
523523
# Do not need to switch branches, we are already on it.
524-
if branch_name=`git symbolic-ref -q HEAD`
524+
if branch_name=$(git symbolic-ref -q HEAD)
525525
then
526526
head_name=$branch_name
527-
branch_name=`expr "z$branch_name" : 'zrefs/heads/\(.*\)'`
527+
branch_name=$(expr "z$branch_name" : 'zrefs/heads/\(.*\)')
528528
else
529529
head_name="detached HEAD"
530530
branch_name=HEAD ;# detached

0 commit comments

Comments
 (0)