Skip to content

Commit 2b06c1e

Browse files
committed
Merge branch 'ep/shell-command-substitution'
* ep/shell-command-substitution: git-am.sh: use the $(...) construct for command substitution check-builtins.sh: use the $(...) construct for command substitution
2 parents 125d8ec + 75ee3d7 commit 2b06c1e

File tree

2 files changed

+17
-17
lines changed

2 files changed

+17
-17
lines changed

check-builtins.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ sort |
1414
bad=0
1515
while read builtin
1616
do
17-
base=`expr "$builtin" : 'git-\(.*\)'`
18-
x=`sed -ne 's/.*{ "'$base'", \(cmd_[^, ]*\).*/'$base' \1/p' git.c`
17+
base=$(expr "$builtin" : 'git-\(.*\)')
18+
x=$(sed -ne 's/.*{ "'$base'", \(cmd_[^, ]*\).*/'$base' \1/p' git.c)
1919
if test -z "$x"
2020
then
2121
echo "$base is builtin but not listed in git.c command list"

git-am.sh

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ cannot_fallback () {
125125
}
126126

127127
fall_back_3way () {
128-
O_OBJECT=`cd "$GIT_OBJECT_DIRECTORY" && pwd`
128+
O_OBJECT=$(cd "$GIT_OBJECT_DIRECTORY" && pwd)
129129

130130
rm -fr "$dotest"/patch-merge-*
131131
mkdir "$dotest/patch-merge-tmp-dir"
@@ -275,7 +275,7 @@ split_patches () {
275275
then
276276
clean_abort "$(gettext "Only one StGIT patch series can be applied at once")"
277277
fi
278-
series_dir=`dirname "$1"`
278+
series_dir=$(dirname "$1")
279279
series_file="$1"
280280
shift
281281
{
@@ -298,8 +298,8 @@ split_patches () {
298298
this=0
299299
for stgit in "$@"
300300
do
301-
this=`expr "$this" + 1`
302-
msgnum=`printf "%0${prec}d" $this`
301+
this=$(expr "$this" + 1)
302+
msgnum=$(printf "%0${prec}d" $this)
303303
# Perl version of StGIT parse_patch. The first nonemptyline
304304
# not starting with Author, From or Date is the
305305
# subject, and the body starts with the next nonempty
@@ -644,26 +644,26 @@ fi
644644
git_apply_opt=$(cat "$dotest/apply-opt")
645645
if test "$(cat "$dotest/sign")" = t
646646
then
647-
SIGNOFF=`git var GIT_COMMITTER_IDENT | sed -e '
647+
SIGNOFF=$(git var GIT_COMMITTER_IDENT | sed -e '
648648
s/>.*/>/
649649
s/^/Signed-off-by: /'
650-
`
650+
)
651651
else
652652
SIGNOFF=
653653
fi
654654

655-
last=`cat "$dotest/last"`
656-
this=`cat "$dotest/next"`
655+
last=$(cat "$dotest/last")
656+
this=$(cat "$dotest/next")
657657
if test "$skip" = t
658658
then
659-
this=`expr "$this" + 1`
659+
this=$(expr "$this" + 1)
660660
resume=
661661
fi
662662

663663
while test "$this" -le "$last"
664664
do
665-
msgnum=`printf "%0${prec}d" $this`
666-
next=`expr "$this" + 1`
665+
msgnum=$(printf "%0${prec}d" $this)
666+
next=$(expr "$this" + 1)
667667
test -f "$dotest/$msgnum" || {
668668
resume=
669669
go_next
@@ -739,16 +739,16 @@ To restore the original branch and stop patching run \"\$cmdline --abort\"."
739739
'')
740740
if test '' != "$SIGNOFF"
741741
then
742-
LAST_SIGNED_OFF_BY=`
742+
LAST_SIGNED_OFF_BY=$(
743743
sed -ne '/^Signed-off-by: /p' \
744744
"$dotest/msg-clean" |
745745
sed -ne '$p'
746-
`
747-
ADD_SIGNOFF=`
746+
)
747+
ADD_SIGNOFF=$(
748748
test "$LAST_SIGNED_OFF_BY" = "$SIGNOFF" || {
749749
test '' = "$LAST_SIGNED_OFF_BY" && echo
750750
echo "$SIGNOFF"
751-
}`
751+
})
752752
else
753753
ADD_SIGNOFF=
754754
fi

0 commit comments

Comments
 (0)