mergetool: use $( ... ) instead of `backticks`
This makes mergetool consistent with Documentation/CodingGuidelines. Signed-off-by: David Aguilar <davvid@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
David Aguilar committed
Apr 6, 2009 at 01:31 UTC
9a62d72dfa833f98dd0730b3d5136f56d637a5c3
1 file changed
+8
-8
git-mergetool.sh
+8
-8
@@ -137,7 +137,7 @@ checkout_staged_file () {
137
merge_file () {
138
MERGED="$1"
139
140
- f=`git ls-files -u -- "$MERGED"`
140
+ f=$(git ls-files -u -- "$MERGED")
141
if test -z "$f" ; then
142
if test ! -f "$MERGED" ; then
143
echo "$MERGED: file not found"
@@ -156,9 +156,9 @@ merge_file () {
156
mv -- "$MERGED" "$BACKUP"
157
cp -- "$BACKUP" "$MERGED"
158
159
- base_mode=`git ls-files -u -- "$MERGED" | awk '{if ($3==1) print $1;}'`
160
- local_mode=`git ls-files -u -- "$MERGED" | awk '{if ($3==2) print $1;}'`
161
- remote_mode=`git ls-files -u -- "$MERGED" | awk '{if ($3==3) print $1;}'`
159
+ base_mode=$(git ls-files -u -- "$MERGED" | awk '{if ($3==1) print $1;}')
160
+ local_mode=$(git ls-files -u -- "$MERGED" | awk '{if ($3==2) print $1;}')
161
+ remote_mode=$(git ls-files -u -- "$MERGED" | awk '{if ($3==3) print $1;}')
162
163
base_present && checkout_staged_file 1 "$MERGED" "$BASE"
164
local_present && checkout_staged_file 2 "$MERGED" "$LOCAL"
@@ -318,7 +318,7 @@ do
318
-t|--tool*)
319
case "$#,$1" in
320
*,*=*)
321
- merge_tool=`expr "z$1" : 'z-[^=]*=\(.*\)'`
321
+ merge_tool=$(expr "z$1" : 'z-[^=]*=\(.*\)')
322
;;
323
1,*)
324
usage ;;
@@ -366,7 +366,7 @@ valid_tool() {
366
}
367
368
init_merge_tool_path() {
369
- merge_tool_path=`git config mergetool.$1.path`
369
+ merge_tool_path=$(git config mergetool.$1.path)
370
if test -z "$merge_tool_path" ; then
371
case "$1" in
372
vimdiff)
@@ -403,7 +403,7 @@ prompt_after_failed_merge() {
403
}
404
405
if test -z "$merge_tool"; then
406
- merge_tool=`git config merge.tool`
406
+ merge_tool=$(git config merge.tool)
407
if test -n "$merge_tool" && ! valid_tool "$merge_tool"; then
408
echo >&2 "git config option merge.tool set to unknown tool: $merge_tool"
409
echo >&2 "Resetting to default..."
@@ -463,7 +463,7 @@ last_status=0
463
rollup_status=0
464
465
if test $# -eq 0 ; then
466
- files=`git ls-files -u | sed -e 's/^[^ ]* //' | sort -u`
466
+ files=$(git ls-files -u | sed -e 's/^[^ ]* //' | sort -u)
467
if test -z "$files" ; then
468
echo "No files need merging"
469
exit 0