Merge branch 'ep/shell-command-substitution'
authorJunio C Hamano <gitster@pobox.com>
Tue, 3 Jun 2014 19:06:45 +0000 (12:06 -0700)
committerJunio C Hamano <gitster@pobox.com>
Tue, 3 Jun 2014 19:06:45 +0000 (12:06 -0700)
Adjust shell scripts to use $(cmd) instead of `cmd`.

* ep/shell-command-substitution: (41 commits)
t5000-tar-tree.sh: use the $( ... ) construct for command substitution
t4204-patch-id.sh: use the $( ... ) construct for command substitution
t4119-apply-config.sh: use the $( ... ) construct for command substitution
t4116-apply-reverse.sh: use the $( ... ) construct for command substitution
t4057-diff-combined-paths.sh: use the $( ... ) construct for command substitution
t4038-diff-combined.sh: use the $( ... ) construct for command substitution
t4036-format-patch-signer-mime.sh: use the $( ... ) construct for command substitution
t4014-format-patch.sh: use the $( ... ) construct for command substitution
t4013-diff-various.sh: use the $( ... ) construct for command substitution
t4012-diff-binary.sh: use the $( ... ) construct for command substitution
t4010-diff-pathspec.sh: use the $( ... ) construct for command substitution
t4006-diff-mode.sh: use the $( ... ) construct for command substitution
t3910-mac-os-precompose.sh: use the $( ... ) construct for command substitution
t3905-stash-include-untracked.sh: use the $( ... ) construct for command substitution
t1050-large.sh: use the $( ... ) construct for command substitution
t1020-subdirectory.sh: use the $( ... ) construct for command substitution
t1004-read-tree-m-u-wf.sh: use the $( ... ) construct for command substitution
t1003-read-tree-prefix.sh: use the $( ... ) construct for command substitution
t1002-read-tree-m-u-2way.sh: use the $( ... ) construct for command substitution
t1001-read-tree-m-2way.sh: use the $( ... ) construct for command substitution
...

41 files changed:
contrib/mw-to-git/t/t9365-continuing-queries.sh
contrib/mw-to-git/t/test-gitmw-lib.sh
contrib/subtree/t/t7900-subtree.sh
contrib/thunderbird-patch-inline/appp.sh
git-pull.sh
git-rebase--merge.sh
git-rebase.sh
git-stash.sh
git-web--browse.sh
t/lib-credential.sh
t/lib-cvs.sh
t/lib-gpg.sh
t/perf/p5302-pack-index.sh
t/t0001-init.sh
t/t0010-racy-git.sh
t/t0020-crlf.sh
t/t0025-crlf-auto.sh
t/t0026-eol-config.sh
t/t0030-stripspace.sh
t/t0300-credentials.sh
t/t1000-read-tree-m-3way.sh
t/t1001-read-tree-m-2way.sh
t/t1002-read-tree-m-u-2way.sh
t/t1003-read-tree-prefix.sh
t/t1004-read-tree-m-u-wf.sh
t/t1020-subdirectory.sh
t/t1050-large.sh
t/t3905-stash-include-untracked.sh
t/t3910-mac-os-precompose.sh
t/t4006-diff-mode.sh
t/t4010-diff-pathspec.sh
t/t4012-diff-binary.sh
t/t4013-diff-various.sh
t/t4014-format-patch.sh
t/t4036-format-patch-signer-mime.sh
t/t4038-diff-combined.sh
t/t4057-diff-combined-paths.sh
t/t4116-apply-reverse.sh
t/t4119-apply-config.sh
t/t4204-patch-id.sh
t/t5000-tar-tree.sh
index 27e267f532974914d1b214920bcfb8e2d4e3de6c..016454749f8dfa8539c7af1ca7fe4338414ab661 100755 (executable)
@@ -9,7 +9,7 @@ test_check_precond
 
 test_expect_success 'creating page w/ >500 revisions' '
        wiki_reset &&
-       for i in `test_seq 501`
+       for i in $(test_seq 501)
        do
                echo "creating revision $i" &&
                wiki_editpage foo "revision $i<br/>" true
index d9a114995a0f75434fc105ce7be508293da49227..6546294f159e940eb8f7adc3e695f16d9395eebc 100755 (executable)
@@ -90,7 +90,7 @@ test_diff_directories () {
 #
 # Check that <dir> contains exactly <N> files
 test_contains_N_files () {
-       if test `ls -- "$1" | wc -l` -ne "$2"; then
+       if test $(ls -- "$1" | wc -l) -ne "$2"; then
                echo "directory $1 should contain $2 files"
                echo "it contains these files:"
                ls "$1"
@@ -340,10 +340,10 @@ wiki_install () {
                        "http://download.wikimedia.org/mediawiki/$MW_VERSION_MAJOR/"\
                        "$MW_FILENAME. "\
                        "Please fix your connection and launch the script again."
-               echo "$MW_FILENAME downloaded in `pwd`. "\
+               echo "$MW_FILENAME downloaded in $(pwd). "\
                        "You can delete it later if you want."
        else
-               echo "Reusing existing $MW_FILENAME downloaded in `pwd`."
+               echo "Reusing existing $MW_FILENAME downloaded in $(pwd)."
        fi
        archive_abs_path=$(pwd)/$MW_FILENAME
        cd "$WIKI_DIR_INST/$WIKI_DIR_NAME/" ||
index 66ce4b07c2dc2d2d56dc260883f86d8672d2ac69..b22b710c262ed6c55e97859aac8a2fd1c5adb219 100755 (executable)
@@ -76,7 +76,7 @@ test_expect_success 'add sub1' '
 
 # Save this hash for testing later.
 
-subdir_hash=`git rev-parse HEAD`
+subdir_hash=$(git rev-parse HEAD)
 
 test_expect_success 'add sub2' '
         create sub2 &&
index 5eb4a5164397e3a34be10690025a9cd472261db9..8dc73ece15a075bb60971da577d2da272c8f7c14 100755 (executable)
@@ -10,7 +10,7 @@ CONFFILE=~/.appprc
 
 SEP="-=-=-=-=-=-=-=-=-=# Don't remove this line #=-=-=-=-=-=-=-=-=-"
 if [ -e "$CONFFILE" ] ; then
-       LAST_DIR=`grep -m 1 "^LAST_DIR=" "${CONFFILE}"|sed -e 's/^LAST_DIR=//'`
+       LAST_DIR=$(grep -m 1 "^LAST_DIR=" "${CONFFILE}"|sed -e 's/^LAST_DIR=//')
        cd "${LAST_DIR}"
 else
        cd > /dev/null
@@ -25,11 +25,11 @@ fi
 
 cd - > /dev/null
 
-SUBJECT=`sed -n -e '/^Subject: /p' "${PATCH}"`
-HEADERS=`sed -e '/^'"${SEP}"'$/,$d' $1`
-BODY=`sed -e "1,/${SEP}/d" $1`
-CMT_MSG=`sed -e '1,/^$/d' -e '/^---$/,$d' "${PATCH}"`
-DIFF=`sed -e '1,/^---$/d' "${PATCH}"`
+SUBJECT=$(sed -n -e '/^Subject: /p' "${PATCH}")
+HEADERS=$(sed -e '/^'"${SEP}"'$/,$d' $1)
+BODY=$(sed -e "1,/${SEP}/d" $1)
+CMT_MSG=$(sed -e '1,/^$/d' -e '/^---$/,$d' "${PATCH}")
+DIFF=$(sed -e '1,/^---$/d' "${PATCH}")
 
 CCS=`echo -e "$CMT_MSG\n$HEADERS" | sed -n -e 's/^Cc: \(.*\)$/\1,/gp' \
        -e 's/^Signed-off-by: \(.*\)/\1,/gp'`
@@ -48,7 +48,7 @@ if [ "x${BODY}x" != "xx" ] ; then
 fi
 echo "$DIFF" >> $1
 
-LAST_DIR=`dirname "${PATCH}"`
+LAST_DIR=$(dirname "${PATCH}")
 
 grep -v "^LAST_DIR=" "${CONFFILE}" > "${CONFFILE}_"
 echo "LAST_DIR=${LAST_DIR}" >> "${CONFFILE}_"
index 6cd8ebc534c174dfe613f62047424dc7491d75fa..cfc589dc15061c8ed1797c2d91ec420b1d6f33fe 100755 (executable)
@@ -108,7 +108,7 @@ do
        -s|--s|--st|--str|--stra|--strat|--strate|--strateg|--strategy)
                case "$#,$1" in
                *,*=*)
-                       strategy=`expr "z$1" : 'z-[^=]*=\(.*\)'` ;;
+                       strategy=$(expr "z$1" : 'z-[^=]*=\(.*\)') ;;
                1,*)
                        usage ;;
                *)
index 71429fd74373f3f804fc841b5dd60faca2baaec6..6d77b3ca9118e6fdd36615757a24c109cf0530ee 100644 (file)
@@ -24,7 +24,7 @@ continue_merge () {
                die "$resolvemsg"
        fi
 
-       cmt=`cat "$state_dir/current"`
+       cmt=$(cat "$state_dir/current")
        if ! git diff-index --quiet --ignore-submodules HEAD --
        then
                if ! git commit ${gpg_sign_opt:+"$gpg_sign_opt"} --no-verify -C "$cmt"
@@ -143,7 +143,7 @@ echo "$onto_name" > "$state_dir/onto_name"
 write_basic_state
 
 msgnum=0
-for cmt in `git rev-list --reverse --no-merges "$revisions"`
+for cmt in $(git rev-list --reverse --no-merges "$revisions")
 do
        msgnum=$(($msgnum + 1))
        echo "$cmt" > "$state_dir/cmt.$msgnum"
index 4543815ffd6b0d49466edc3059f6d085b79ebf8a..5c7a0a1a583552de49ee2e094e80f80ee18fd68c 100755 (executable)
@@ -457,8 +457,8 @@ then
 else
        if test -z "$onto"
        then
-               empty_tree=`git hash-object -t tree /dev/null`
-               onto=`git commit-tree $empty_tree </dev/null`
+               empty_tree=$(git hash-object -t tree /dev/null)
+               onto=$(git commit-tree $empty_tree </dev/null)
                squash_onto="$onto"
        fi
        unset upstream_name
@@ -516,10 +516,10 @@ case "$#" in
        ;;
 0)
        # Do not need to switch branches, we are already on it.
-       if branch_name=`git symbolic-ref -q HEAD`
+       if branch_name=$(git symbolic-ref -q HEAD)
        then
                head_name=$branch_name
-               branch_name=`expr "z$branch_name" : 'zrefs/heads/\(.*\)'`
+               branch_name=$(expr "z$branch_name" : 'zrefs/heads/\(.*\)')
        else
                head_name="detached HEAD"
                branch_name=HEAD ;# detached
index 4798bcf0e51b705005215e9a6339310defe16d03..af549c731779db02db29fef446014a58bc9a3996 100755 (executable)
@@ -13,7 +13,7 @@ USAGE="list [<options>]
 
 SUBDIRECTORY_OK=Yes
 OPTIONS_SPEC=
-START_DIR=`pwd`
+START_DIR=$(pwd)
 . git-sh-setup
 . git-sh-i18n
 require_work_tree
index ebdfba6c94db947f66add0c1b4840319c12252ea..ae152534f5026d50fa32b568d1bdd591629bc59d 100755 (executable)
@@ -59,7 +59,7 @@ do
        -b|--browser*|-t|--tool*)
                case "$#,$1" in
                *,*=*)
-                       browser=`expr "z$1" : 'z-[^=]*=\(.*\)'`
+                       browser=$(expr "z$1" : 'z-[^=]*=\(.*\)')
                        ;;
                1,*)
                        usage ;;
@@ -71,7 +71,7 @@ do
        -c|--config*)
                case "$#,$1" in
                *,*=*)
-                       conf=`expr "z$1" : 'z-[^=]*=\(.*\)'`
+                       conf=$(expr "z$1" : 'z-[^=]*=\(.*\)')
                        ;;
                1,*)
                        usage ;;
@@ -100,7 +100,7 @@ then
        for opt in "$conf" "web.browser"
        do
                test -z "$opt" && continue
-               browser="`git config $opt`"
+               browser="$(git config $opt)"
                test -z "$browser" || break
        done
        if test -n "$browser" && ! valid_tool "$browser"; then
index 957ae936e8b785f8b1afbffd9a5918a3260d213f..9e7d7962b0678dceefb93e3706b742cbfdc5b45e 100755 (executable)
@@ -281,7 +281,7 @@ helper_test_timeout() {
 cat >askpass <<\EOF
 #!/bin/sh
 echo >&2 askpass: $*
-what=`echo $1 | cut -d" " -f1 | tr A-Z a-z | tr -cd a-z`
+what=$(echo $1 | cut -d" " -f1 | tr A-Z a-z | tr -cd a-z)
 echo "askpass-$what"
 EOF
 chmod +x askpass
index 5076718916388d6abf483220cd35f9f61394abc4..9b2bcfb1b0e38ec75e4d6d772e530a69eaaad874 100644 (file)
@@ -13,7 +13,7 @@ fi
 CVS="cvs -f"
 export CVS
 
-cvsps_version=`cvsps -h 2>&1 | sed -ne 's/cvsps version //p'`
+cvsps_version=$(cvsps -h 2>&1 | sed -ne 's/cvsps version //p')
 case "$cvsps_version" in
 2.1 | 2.2*)
        ;;
index 05824fa8e4d18252f74c51531d6504039986c078..fd499e7c498449834992e67645f098d49c6290b8 100755 (executable)
@@ -1,6 +1,6 @@
 #!/bin/sh
 
-gpg_version=`gpg --version 2>&1`
+gpg_version=$(gpg --version 2>&1)
 if test $? = 127; then
        say "You do not seem to have gpg installed"
 else
index 6cb5b0d55b6d6ed4a91f6d0674c210d98b962b66..5ee9211f988dce1f334d796623feccda85641bbe 100755 (executable)
@@ -8,7 +8,7 @@ test_perf_large_repo
 
 test_expect_success 'repack' '
        git repack -ad &&
-       PACK=`ls .git/objects/pack/*.pack | head -n1` &&
+       PACK=$(ls .git/objects/pack/*.pack | head -n1) &&
        test -f "$PACK" &&
        export PACK
 '
index bbc9cb60ddea49f1ce3f0b0d124f704c30a61346..2f3020342a75f0d382af88e6ad35691ad0f183d5 100755 (executable)
@@ -185,14 +185,14 @@ test_expect_success 'init --bare/--shared overrides system/global config' '
        git init --bare --shared=0666 init-bare-shared-override &&
        check_config init-bare-shared-override true unset &&
        test x0666 = \
-       x`git config -f init-bare-shared-override/config core.sharedRepository`
+       x$(git config -f init-bare-shared-override/config core.sharedRepository)
 '
 
 test_expect_success 'init honors global core.sharedRepository' '
        test_config_global core.sharedRepository 0666 &&
        git init shared-honor-global &&
        test x0666 = \
-       x`git config -f shared-honor-global/.git/config core.sharedRepository`
+       x$(git config -f shared-honor-global/.git/config core.sharedRepository)
 '
 
 test_expect_success 'init rejects insanely long --template' '
@@ -285,7 +285,7 @@ test_expect_success 'init prefers command line to GIT_DIR' '
 test_expect_success 'init with separate gitdir' '
        rm -rf newdir &&
        git init --separate-git-dir realgitdir newdir &&
-       echo "gitdir: `pwd`/realgitdir" >expected &&
+       echo "gitdir: $(pwd)/realgitdir" >expected &&
        test_cmp expected newdir/.git &&
        test_path_is_dir realgitdir/refs
 '
@@ -299,7 +299,7 @@ test_expect_success 're-init to update git link' '
        cd newdir &&
        git init --separate-git-dir ../surrealgitdir
        ) &&
-       echo "gitdir: `pwd`/surrealgitdir" >expected &&
+       echo "gitdir: $(pwd)/surrealgitdir" >expected &&
        test_cmp expected newdir/.git &&
        test_path_is_dir surrealgitdir/refs &&
        test_path_is_missing realgitdir/refs
@@ -312,7 +312,7 @@ test_expect_success 're-init to move gitdir' '
        cd newdir &&
        git init --separate-git-dir ../realgitdir
        ) &&
-       echo "gitdir: `pwd`/realgitdir" >expected &&
+       echo "gitdir: $(pwd)/realgitdir" >expected &&
        test_cmp expected newdir/.git &&
        test_path_is_dir realgitdir/refs
 '
@@ -326,7 +326,7 @@ test_expect_success SYMLINKS 're-init to move gitdir symlink' '
        ln -s here .git &&
        git init --separate-git-dir ../realgitdir
        ) &&
-       echo "gitdir: `pwd`/realgitdir" >expected &&
+       echo "gitdir: $(pwd)/realgitdir" >expected &&
        test_cmp expected newdir/.git &&
        test_cmp expected newdir/here &&
        test_path_is_dir realgitdir/refs
index e45a9e40e432524454e94a041599b201a092879a..5657c5a87b6e253b8c8ca7d18dfa7535c295dc83 100755 (executable)
@@ -14,7 +14,7 @@ do
        git update-index --add infocom
        echo xyzzy >infocom
 
-       files=`git diff-files -p`
+       files=$(git diff-files -p)
        test_expect_success \
        "Racy GIT trial #$trial part A" \
        'test "" != "$files"'
@@ -23,7 +23,7 @@ do
        echo xyzzy >cornerstone
        git update-index --add cornerstone
 
-       files=`git diff-files -p`
+       files=$(git diff-files -p)
        test_expect_success \
        "Racy GIT trial #$trial part B" \
        'test "" != "$files"'
index e526184a0bfa3c8ad2171d0c41a7bee22cf9a04e..d2e51a81bc0897b19f8f087894187ed705ce29e3 100755 (executable)
@@ -20,14 +20,14 @@ test_expect_success setup '
 
        git commit -m initial &&
 
-       one=`git rev-parse HEAD:one` &&
-       dir=`git rev-parse HEAD:dir` &&
-       two=`git rev-parse HEAD:dir/two` &&
-       three=`git rev-parse HEAD:three` &&
+       one=$(git rev-parse HEAD:one) &&
+       dir=$(git rev-parse HEAD:dir) &&
+       two=$(git rev-parse HEAD:dir/two) &&
+       three=$(git rev-parse HEAD:three) &&
 
        for w in Some extra lines here; do echo $w; done >>one &&
        git diff >patch.file &&
-       patched=`git hash-object --stdin <one` &&
+       patched=$(git hash-object --stdin <one) &&
        git read-tree --reset -u HEAD &&
 
        echo happy.
@@ -111,7 +111,7 @@ test_expect_success 'update with autocrlf=input' '
                }
        done &&
 
-       differs=`git diff-index --cached HEAD` &&
+       differs=$(git diff-index --cached HEAD) &&
        test -z "$differs" || {
                echo Oops "$differs"
                false
@@ -135,7 +135,7 @@ test_expect_success 'update with autocrlf=true' '
                }
        done &&
 
-       differs=`git diff-index --cached HEAD` &&
+       differs=$(git diff-index --cached HEAD) &&
        test -z "$differs" || {
                echo Oops "$differs"
                false
@@ -158,9 +158,9 @@ test_expect_success 'checkout with autocrlf=true' '
                        break
                }
        done &&
-       test "$one" = `git hash-object --stdin <one` &&
-       test "$two" = `git hash-object --stdin <dir/two` &&
-       differs=`git diff-index --cached HEAD` &&
+       test "$one" = $(git hash-object --stdin <one) &&
+       test "$two" = $(git hash-object --stdin <dir/two) &&
+       differs=$(git diff-index --cached HEAD) &&
        test -z "$differs" || {
                echo Oops "$differs"
                false
@@ -184,9 +184,9 @@ test_expect_success 'checkout with autocrlf=input' '
                        git update-index -- $f
                fi
        done &&
-       test "$one" = `git hash-object --stdin <one` &&
-       test "$two" = `git hash-object --stdin <dir/two` &&
-       differs=`git diff-index --cached HEAD` &&
+       test "$one" = $(git hash-object --stdin <one) &&
+       test "$two" = $(git hash-object --stdin <dir/two) &&
+       differs=$(git diff-index --cached HEAD) &&
        test -z "$differs" || {
                echo Oops "$differs"
                false
@@ -200,7 +200,7 @@ test_expect_success 'apply patch (autocrlf=input)' '
        git read-tree --reset -u HEAD &&
 
        git apply patch.file &&
-       test "$patched" = "`git hash-object --stdin <one`" || {
+       test "$patched" = "$(git hash-object --stdin <one)" || {
                echo "Eh?  apply without index"
                false
        }
@@ -213,7 +213,7 @@ test_expect_success 'apply patch --cached (autocrlf=input)' '
        git read-tree --reset -u HEAD &&
 
        git apply --cached patch.file &&
-       test "$patched" = `git rev-parse :one` || {
+       test "$patched" = $(git rev-parse :one) || {
                echo "Eh?  apply with --cached"
                false
        }
@@ -226,8 +226,8 @@ test_expect_success 'apply patch --index (autocrlf=input)' '
        git read-tree --reset -u HEAD &&
 
        git apply --index patch.file &&
-       test "$patched" = `git rev-parse :one` &&
-       test "$patched" = `git hash-object --stdin <one` || {
+       test "$patched" = $(git rev-parse :one) &&
+       test "$patched" = $(git hash-object --stdin <one) || {
                echo "Eh?  apply with --index"
                false
        }
@@ -240,7 +240,7 @@ test_expect_success 'apply patch (autocrlf=true)' '
        git read-tree --reset -u HEAD &&
 
        git apply patch.file &&
-       test "$patched" = "`remove_cr <one | git hash-object --stdin`" || {
+       test "$patched" = "$(remove_cr <one | git hash-object --stdin)" || {
                echo "Eh?  apply without index"
                false
        }
@@ -253,7 +253,7 @@ test_expect_success 'apply patch --cached (autocrlf=true)' '
        git read-tree --reset -u HEAD &&
 
        git apply --cached patch.file &&
-       test "$patched" = `git rev-parse :one` || {
+       test "$patched" = $(git rev-parse :one) || {
                echo "Eh?  apply without index"
                false
        }
@@ -266,8 +266,8 @@ test_expect_success 'apply patch --index (autocrlf=true)' '
        git read-tree --reset -u HEAD &&
 
        git apply --index patch.file &&
-       test "$patched" = `git rev-parse :one` &&
-       test "$patched" = "`remove_cr <one | git hash-object --stdin`" || {
+       test "$patched" = $(git rev-parse :one) &&
+       test "$patched" = "$(remove_cr <one | git hash-object --stdin)" || {
                echo "Eh?  apply with --index"
                false
        }
index f5f67a6337320c11a285b78be299fa955663991d..b0e5694ebd07b59e80823cd87825cc9ec8187c21 100755 (executable)
@@ -19,9 +19,9 @@ test_expect_success setup '
 
        git commit -m initial &&
 
-       one=`git rev-parse HEAD:one` &&
-       two=`git rev-parse HEAD:two` &&
-       three=`git rev-parse HEAD:three` &&
+       one=$(git rev-parse HEAD:one) &&
+       two=$(git rev-parse HEAD:two) &&
+       three=$(git rev-parse HEAD:three) &&
 
        echo happy.
 '
@@ -33,9 +33,9 @@ test_expect_success 'default settings cause no changes' '
 
        ! has_cr one &&
        has_cr two &&
-       onediff=`git diff one` &&
-       twodiff=`git diff two` &&
-       threediff=`git diff three` &&
+       onediff=$(git diff one) &&
+       twodiff=$(git diff two) &&
+       threediff=$(git diff three) &&
        test -z "$onediff" -a -z "$twodiff" -a -z "$threediff"
 '
 
@@ -48,7 +48,7 @@ test_expect_success 'crlf=true causes a CRLF file to be normalized' '
 
        # Note, "normalized" means that git will normalize it if added
        has_cr two &&
-       twodiff=`git diff two` &&
+       twodiff=$(git diff two) &&
        test -n "$twodiff"
 '
 
@@ -60,7 +60,7 @@ test_expect_success 'text=true causes a CRLF file to be normalized' '
 
        # Note, "normalized" means that git will normalize it if added
        has_cr two &&
-       twodiff=`git diff two` &&
+       twodiff=$(git diff two) &&
        test -n "$twodiff"
 '
 
@@ -72,7 +72,7 @@ test_expect_success 'eol=crlf gives a normalized file CRLFs with autocrlf=false'
        git read-tree --reset -u HEAD &&
 
        has_cr one &&
-       onediff=`git diff one` &&
+       onediff=$(git diff one) &&
        test -z "$onediff"
 '
 
@@ -84,7 +84,7 @@ test_expect_success 'eol=crlf gives a normalized file CRLFs with autocrlf=input'
        git read-tree --reset -u HEAD &&
 
        has_cr one &&
-       onediff=`git diff one` &&
+       onediff=$(git diff one) &&
        test -z "$onediff"
 '
 
@@ -96,7 +96,7 @@ test_expect_success 'eol=lf gives a normalized file LFs with autocrlf=true' '
        git read-tree --reset -u HEAD &&
 
        ! has_cr one &&
-       onediff=`git diff one` &&
+       onediff=$(git diff one) &&
        test -z "$onediff"
 '
 
@@ -108,9 +108,9 @@ test_expect_success 'autocrlf=true does not normalize CRLF files' '
 
        has_cr one &&
        has_cr two &&
-       onediff=`git diff one` &&
-       twodiff=`git diff two` &&
-       threediff=`git diff three` &&
+       onediff=$(git diff one) &&
+       twodiff=$(git diff two) &&
+       threediff=$(git diff three) &&
        test -z "$onediff" -a -z "$twodiff" -a -z "$threediff"
 '
 
@@ -123,9 +123,9 @@ test_expect_success 'text=auto, autocrlf=true _does_ normalize CRLF files' '
 
        has_cr one &&
        has_cr two &&
-       onediff=`git diff one` &&
-       twodiff=`git diff two` &&
-       threediff=`git diff three` &&
+       onediff=$(git diff one) &&
+       twodiff=$(git diff two) &&
+       threediff=$(git diff three) &&
        test -z "$onediff" -a -n "$twodiff" -a -z "$threediff"
 '
 
@@ -137,7 +137,7 @@ test_expect_success 'text=auto, autocrlf=true does not normalize binary files' '
        git read-tree --reset -u HEAD &&
 
        ! has_cr three &&
-       threediff=`git diff three` &&
+       threediff=$(git diff three) &&
        test -z "$threediff"
 '
 
@@ -148,7 +148,7 @@ test_expect_success 'eol=crlf _does_ normalize binary files' '
        git read-tree --reset -u HEAD &&
 
        has_cr three &&
-       threediff=`git diff three` &&
+       threediff=$(git diff three) &&
        test -z "$threediff"
 '
 
index fe0164be62ad9ae7a2ea426c6e576cd1133f3d67..e1126aa7cc05ff61ddf087fe13880da7f48219a6 100755 (executable)
@@ -20,8 +20,8 @@ test_expect_success setup '
 
        git commit -m initial &&
 
-       one=`git rev-parse HEAD:one` &&
-       two=`git rev-parse HEAD:two` &&
+       one=$(git rev-parse HEAD:one) &&
+       two=$(git rev-parse HEAD:two) &&
 
        echo happy.
 '
@@ -34,8 +34,8 @@ test_expect_success 'eol=lf puts LFs in normalized file' '
 
        ! has_cr one &&
        ! has_cr two &&
-       onediff=`git diff one` &&
-       twodiff=`git diff two` &&
+       onediff=$(git diff one) &&
+       twodiff=$(git diff two) &&
        test -z "$onediff" -a -z "$twodiff"
 '
 
@@ -47,8 +47,8 @@ test_expect_success 'eol=crlf puts CRLFs in normalized file' '
 
        has_cr one &&
        ! has_cr two &&
-       onediff=`git diff one` &&
-       twodiff=`git diff two` &&
+       onediff=$(git diff one) &&
+       twodiff=$(git diff two) &&
        test -z "$onediff" -a -z "$twodiff"
 '
 
@@ -61,8 +61,8 @@ test_expect_success 'autocrlf=true overrides eol=lf' '
 
        has_cr one &&
        has_cr two &&
-       onediff=`git diff one` &&
-       twodiff=`git diff two` &&
+       onediff=$(git diff one) &&
+       twodiff=$(git diff two) &&
        test -z "$onediff" -a -z "$twodiff"
 '
 
@@ -75,8 +75,8 @@ test_expect_success 'autocrlf=true overrides unset eol' '
 
        has_cr one &&
        has_cr two &&
-       onediff=`git diff one` &&
-       twodiff=`git diff two` &&
+       onediff=$(git diff one) &&
+       twodiff=$(git diff two) &&
        test -z "$onediff" -a -z "$twodiff"
 '
 
index a8e84d854636178224b1bbd52272d47fc686ece9..0333dd9875af9fbbad04cf05eb9f0e9fe37ae182 100755 (executable)
@@ -225,22 +225,22 @@ test_expect_success \
 
 test_expect_success \
     'text without newline at end should end with newline' '
-    test `printf "$ttt" | git stripspace | wc -l` -gt 0 &&
-    test `printf "$ttt$ttt" | git stripspace | wc -l` -gt 0 &&
-    test `printf "$ttt$ttt$ttt" | git stripspace | wc -l` -gt 0 &&
-    test `printf "$ttt$ttt$ttt$ttt" | git stripspace | wc -l` -gt 0
+    test $(printf "$ttt" | git stripspace | wc -l) -gt 0 &&
+    test $(printf "$ttt$ttt" | git stripspace | wc -l) -gt 0 &&
+    test $(printf "$ttt$ttt$ttt" | git stripspace | wc -l) -gt 0 &&
+    test $(printf "$ttt$ttt$ttt$ttt" | git stripspace | wc -l) -gt 0
 '
 
 # text plus spaces at the end:
 
 test_expect_success \
     'text plus spaces without newline at end should end with newline' '
-    test `printf "$ttt$sss" | git stripspace | wc -l` -gt 0 &&
-    test `printf "$ttt$ttt$sss" | git stripspace | wc -l` -gt 0 &&
-    test `printf "$ttt$ttt$ttt$sss" | git stripspace | wc -l` -gt 0 &&
-    test `printf "$ttt$sss$sss" | git stripspace | wc -l` -gt 0 &&
-    test `printf "$ttt$ttt$sss$sss" | git stripspace | wc -l` -gt 0 &&
-    test `printf "$ttt$sss$sss$sss" | git stripspace | wc -l` -gt 0
+    test $(printf "$ttt$sss" | git stripspace | wc -l) -gt 0 &&
+    test $(printf "$ttt$ttt$sss" | git stripspace | wc -l) -gt 0 &&
+    test $(printf "$ttt$ttt$ttt$sss" | git stripspace | wc -l) -gt 0 &&
+    test $(printf "$ttt$sss$sss" | git stripspace | wc -l) -gt 0 &&
+    test $(printf "$ttt$ttt$sss$sss" | git stripspace | wc -l) -gt 0 &&
+    test $(printf "$ttt$sss$sss$sss" | git stripspace | wc -l) -gt 0
 '
 
 test_expect_success \
index 538ea5fb1c27bf5e4f9c4a0268f219f5d6d6e9c5..57ea5a10c5c716f52a8c8c7335ac7f68fe9dd92d 100755 (executable)
@@ -6,7 +6,7 @@ test_description='basic credential helper tests'
 
 test_expect_success 'setup helper scripts' '
        cat >dump <<-\EOF &&
-       whoami=`echo $0 | sed s/.*git-credential-//`
+       whoami=$(echo $0 | sed s/.*git-credential-//)
        echo >&2 "$whoami: $*"
        OIFS=$IFS
        IFS==
index babcdd23433348cd0e2397b2fb6968f7cfae4b0a..a0b79b4839fb21a96bf8aca769542d93b21bb90f 100755 (executable)
@@ -519,10 +519,10 @@ test_expect_success \
     'rm -f .git/index F16 &&
     echo F16 >F16 &&
     git update-index --add F16 &&
-    tree0=`git write-tree` &&
+    tree0=$(git write-tree) &&
     echo E16 >F16 &&
     git update-index F16 &&
-    tree1=`git write-tree` &&
+    tree1=$(git write-tree) &&
     read_tree_must_succeed -m $tree0 $tree1 $tree1 $tree0 &&
     git ls-files --stage'
 
index 3a24abf5496c76862e772907442dc24bdcb4d78a..db1b6f5cf4dd8c7932946a53bc2e1c30b09b762b 100755 (executable)
@@ -36,7 +36,7 @@ compare_change () {
 }
 
 check_cache_at () {
-       clean_if_empty=`git diff-files -- "$1"`
+       clean_if_empty=$(git diff-files -- "$1")
        case "$clean_if_empty" in
        '')  echo "$1: clean" ;;
        ?*)  echo "$1: dirty" ;;
@@ -68,14 +68,14 @@ test_expect_success \
      echo rezrov >rezrov &&
      echo yomin >yomin &&
      git update-index --add nitfol bozbar rezrov &&
-     treeH=`git write-tree` &&
+     treeH=$(git write-tree) &&
      echo treeH $treeH &&
      git ls-tree $treeH &&
 
      cat bozbar-new >bozbar &&
      git update-index --add frotz bozbar --force-remove rezrov &&
      git ls-files --stage >M.out &&
-     treeM=`git write-tree` &&
+     treeM=$(git write-tree) &&
      echo treeM $treeM &&
      git ls-tree $treeM &&
      git diff-tree $treeH $treeM'
@@ -315,7 +315,7 @@ test_expect_success \
     'rm -f .git/index &&
      echo DF >DF &&
      git update-index --add DF &&
-     treeDF=`git write-tree` &&
+     treeDF=$(git write-tree) &&
      echo treeDF $treeDF &&
      git ls-tree $treeDF &&
 
@@ -323,7 +323,7 @@ test_expect_success \
      mkdir DF &&
      echo DF/DF >DF/DF &&
      git update-index --add --remove DF DF/DF &&
-     treeDFDF=`git write-tree` &&
+     treeDFDF=$(git write-tree) &&
      echo treeDFDF $treeDFDF &&
      git ls-tree $treeDFDF &&
      git ls-files --stage >DFDF.out'
@@ -345,7 +345,7 @@ test_expect_success \
     'rm -f .git/index &&
      : >a &&
      git update-index --add a &&
-     treeM=`git write-tree` &&
+     treeM=$(git write-tree) &&
      echo treeM $treeM &&
      git ls-tree $treeM &&
      git ls-files --stage >treeM.out &&
@@ -354,7 +354,7 @@ test_expect_success \
      git update-index --remove a &&
      mkdir a &&
      : >a/b &&
-     treeH=`git write-tree` &&
+     treeH=$(git write-tree) &&
      echo treeH $treeH &&
      git ls-tree $treeH'
 
@@ -372,7 +372,7 @@ test_expect_success \
      mkdir c &&
      : >c/d &&
      git update-index --add a c/d &&
-     treeM=`git write-tree` &&
+     treeM=$(git write-tree) &&
      echo treeM $treeM &&
      git ls-tree $treeM &&
      git ls-files --stage >treeM.out &&
@@ -381,7 +381,7 @@ test_expect_success \
      mkdir a &&
      : >a/b &&
      git update-index --add --remove a a/b &&
-     treeH=`git write-tree` &&
+     treeH=$(git write-tree) &&
      echo treeH $treeH &&
      git ls-tree $treeH'
 
index a847709a1354a824c90a13d2c9e9ab6d6bc69b6c..fed877b20f428a1987357ad1f66dc678f5c7e2eb 100755 (executable)
@@ -21,7 +21,7 @@ compare_change () {
 }
 
 check_cache_at () {
-       clean_if_empty=`git diff-files -- "$1"`
+       clean_if_empty=$(git diff-files -- "$1")
        case "$clean_if_empty" in
        '')  echo "$1: clean" ;;
        ?*)  echo "$1: dirty" ;;
@@ -41,14 +41,14 @@ test_expect_success \
      echo bozbar >bozbar &&
      echo rezrov >rezrov &&
      git update-index --add nitfol bozbar rezrov &&
-     treeH=`git write-tree` &&
+     treeH=$(git write-tree) &&
      echo treeH $treeH &&
      git ls-tree $treeH &&
 
      echo gnusto >bozbar &&
      git update-index --add frotz bozbar --force-remove rezrov &&
      git ls-files --stage >M.out &&
-     treeM=`git write-tree` &&
+     treeM=$(git write-tree) &&
      echo treeM $treeM &&
      git ls-tree $treeM &&
      sum bozbar frotz nitfol >M.sum &&
@@ -318,7 +318,7 @@ test_expect_success \
     'rm -f .git/index &&
      echo DF >DF &&
      git update-index --add DF &&
-     treeDF=`git write-tree` &&
+     treeDF=$(git write-tree) &&
      echo treeDF $treeDF &&
      git ls-tree $treeDF &&
 
@@ -326,7 +326,7 @@ test_expect_success \
      mkdir DF &&
      echo DF/DF >DF/DF &&
      git update-index --add --remove DF DF/DF &&
-     treeDFDF=`git write-tree` &&
+     treeDFDF=$(git write-tree) &&
      echo treeDFDF $treeDFDF &&
      git ls-tree $treeDFDF &&
      git ls-files --stage >DFDF.out'
index 8c6d67edda1468ba0f1c7afc6d13ea3a7bbe0a90..b6111cd150fdd69973142808cf4a86a4fa6b7e76 100755 (executable)
@@ -11,7 +11,7 @@ test_description='git read-tree --prefix test.
 test_expect_success setup '
        echo hello >one &&
        git update-index --add one &&
-       tree=`git write-tree` &&
+       tree=$(git write-tree) &&
        echo tree is $tree
 '
 
index 3e72aff470f8d9e5e79689de459904d1f3271d0d..c70cf423008cfb6f3f3fd735c1f6ee2d1408de2c 100755 (executable)
@@ -30,7 +30,7 @@ test_expect_success 'two-way not clobbering' '
 
        echo >file2 master creates untracked file2 &&
        echo >subdir/file2 master creates untracked subdir/file2 &&
-       if err=`read_tree_u_must_succeed -m -u master side 2>&1`
+       if err=$(read_tree_u_must_succeed -m -u master side 2>&1)
        then
                echo should have complained
                false
@@ -43,7 +43,7 @@ echo file2 >.gitignore
 
 test_expect_success 'two-way with incorrect --exclude-per-directory (1)' '
 
-       if err=`read_tree_u_must_succeed -m --exclude-per-directory=.gitignore master side 2>&1`
+       if err=$(read_tree_u_must_succeed -m --exclude-per-directory=.gitignore master side 2>&1)
        then
                echo should have complained
                false
@@ -54,7 +54,7 @@ test_expect_success 'two-way with incorrect --exclude-per-directory (1)' '
 
 test_expect_success 'two-way with incorrect --exclude-per-directory (2)' '
 
-       if err=`read_tree_u_must_succeed -m -u --exclude-per-directory=foo --exclude-per-directory=.gitignore master side 2>&1`
+       if err=$(read_tree_u_must_succeed -m -u --exclude-per-directory=foo --exclude-per-directory=.gitignore master side 2>&1)
        then
                echo should have complained
                false
@@ -95,7 +95,7 @@ test_expect_success 'three-way not clobbering a working tree file' '
        git checkout master &&
        echo >file3 file three created in master, untracked &&
        echo >subdir/file3 file three created in master, untracked &&
-       if err=`read_tree_u_must_succeed -m -u branch-point master side 2>&1`
+       if err=$(read_tree_u_must_succeed -m -u branch-point master side 2>&1)
        then
                echo should have complained
                false
index 6902320e819651553beac7d80971b984b9168a8a..62c0d25af4ca1c8ef5d0d63b6e3ea329a6d75205 100755 (executable)
@@ -20,27 +20,27 @@ test_expect_success setup '
 
 test_expect_success 'update-index and ls-files' '
        git update-index --add one &&
-       case "`git ls-files`" in
+       case "$(git ls-files)" in
        one) echo pass one ;;
        *) echo bad one; exit 1 ;;
        esac &&
        (
                cd dir &&
                git update-index --add two &&
-               case "`git ls-files`" in
+               case "$(git ls-files)" in
                two) echo pass two ;;
                *) echo bad two; exit 1 ;;
                esac
        ) &&
-       case "`git ls-files`" in
+       case "$(git ls-files)" in
        dir/two"$LF"one) echo pass both ;;
        *) echo bad; exit 1 ;;
        esac
 '
 
 test_expect_success 'cat-file' '
-       two=`git ls-files -s dir/two` &&
-       two=`expr "$two" : "[0-7]* \\([0-9a-f]*\\)"` &&
+       two=$(git ls-files -s dir/two) &&
+       two=$(expr "$two" : "[0-7]* \\([0-9a-f]*\\)") &&
        echo "$two" &&
        git cat-file -p "$two" >actual &&
        cmp dir/two actual &&
@@ -55,18 +55,18 @@ rm -f actual dir/actual
 test_expect_success 'diff-files' '
        echo a >>one &&
        echo d >>dir/two &&
-       case "`git diff-files --name-only`" in
+       case "$(git diff-files --name-only)" in
        dir/two"$LF"one) echo pass top ;;
        *) echo bad top; exit 1 ;;
        esac &&
        # diff should not omit leading paths
        (
                cd dir &&
-               case "`git diff-files --name-only`" in
+               case "$(git diff-files --name-only)" in
                dir/two"$LF"one) echo pass subdir ;;
                *) echo bad subdir; exit 1 ;;
                esac &&
-               case "`git diff-files --name-only .`" in
+               case "$(git diff-files --name-only .)" in
                dir/two) echo pass subdir limited ;;
                *) echo bad subdir limited; exit 1 ;;
                esac
@@ -74,11 +74,11 @@ test_expect_success 'diff-files' '
 '
 
 test_expect_success 'write-tree' '
-       top=`git write-tree` &&
+       top=$(git write-tree) &&
        echo $top &&
        (
                cd dir &&
-               sub=`git write-tree` &&
+               sub=$(git write-tree) &&
                echo $sub &&
                test "z$top" = "z$sub"
        )
@@ -96,7 +96,7 @@ test_expect_success 'checkout-index' '
 
 test_expect_success 'read-tree' '
        rm -f one dir/two &&
-       tree=`git write-tree` &&
+       tree=$(git write-tree) &&
        read_tree_u_must_succeed --reset -u "$tree" &&
        cmp one original.one &&
        cmp dir/two original.two &&
index fd105280092b7f655f5c48f09b2e8f5e0ee6d351..aea493646e4400e733749768e48f2a3d1a470299 100755 (executable)
@@ -131,7 +131,7 @@ test_expect_success 'git-show a large file' '
 '
 
 test_expect_success 'index-pack' '
-       git clone file://"`pwd`"/.git foo &&
+       git clone file://"$(pwd)"/.git foo &&
        GIT_DIR=non-existent git index-pack --strict --verify foo/.git/objects/pack/*.pack
 '
 
@@ -140,7 +140,7 @@ test_expect_success 'repack' '
 '
 
 test_expect_success 'pack-objects with large loose object' '
-       SHA1=`git hash-object huge` &&
+       SHA1=$(git hash-object huge) &&
        test_create_repo loose &&
        echo $SHA1 | git pack-objects --stdout |
                GIT_ALLOC_LIMIT=0 GIT_DIR=loose/.git git unpack-objects &&
index a5e7e6b2ba3138d06c400e965decf1389da3274a..f372fc8ca8e3b311b03313a46db1aa8f35de2ea9 100755 (executable)
@@ -96,8 +96,8 @@ test_expect_success 'stash pop after save --include-untracked leaves files untra
        git stash pop &&
        git status --porcelain >actual &&
        test_cmp expect actual &&
-       test "1" = "`cat file2`" &&
-       test untracked = "`cat untracked/untracked`"
+       test "1" = "$(cat file2)" &&
+       test untracked = "$(cat untracked/untracked)"
 '
 
 git clean --force --quiet -d
index e4ba6013e41927bc0ec3ff3876648a71a71ce6e1..96941e94cc3b50d0f65a441316e577dee2adc7e2 100755 (executable)
@@ -14,13 +14,13 @@ then
 fi
 
 # create utf-8 variables
-Adiarnfc=`printf '\303\204'`
-Adiarnfd=`printf 'A\314\210'`
+Adiarnfc=$(printf '\303\204')
+Adiarnfd=$(printf 'A\314\210')
 
-Odiarnfc=`printf '\303\226'`
-Odiarnfd=`printf 'O\314\210'`
-AEligatu=`printf '\303\206'`
-Invalidu=`printf '\303\377'`
+Odiarnfc=$(printf '\303\226')
+Odiarnfd=$(printf 'O\314\210')
+AEligatu=$(printf '\303\206')
+Invalidu=$(printf '\303\377')
 
 
 #Create a string with 255 bytes (decomposed)
@@ -35,7 +35,7 @@ Alongc=$Alongc$Alongc$Alongc$Alongc$Alongc           #250 Byte
 Alongc=$Alongc$AEligatu$AEligatu                     #254 Byte
 
 test_expect_success "detect if nfd needed" '
-       precomposeunicode=`git config core.precomposeunicode` &&
+       precomposeunicode=$(git config core.precomposeunicode) &&
        test "$precomposeunicode" = true &&
        git config core.precomposeunicode true
 '
@@ -146,7 +146,7 @@ test_expect_success "respect git config --global core.precomposeunicode" '
        git config --global core.precomposeunicode true &&
        rm -rf .git &&
        git init &&
-       precomposeunicode=`git config core.precomposeunicode` &&
+       precomposeunicode=$(git config core.precomposeunicode) &&
        test "$precomposeunicode" = "true"
 '
 
index 05911492ca6df386bfe344ffcfb9562beeaceabf..76f643b2c2a2c7e307135de6942cf46743b6cbef 100755 (executable)
@@ -13,7 +13,7 @@ sed_script='s/\(:100644 100755\) \('"$_x40"'\) \2 /\1 X X /'
 test_expect_success 'setup' '
        echo frotz >rezrov &&
        git update-index --add rezrov &&
-       tree=`git write-tree` &&
+       tree=$(git write-tree) &&
        echo $tree
 '
 
index 2bb973655bf043cc43292764ffd68becda25aa2e..bf078418662c4bab4e512be8fc22a5aa76466119 100755 (executable)
@@ -18,7 +18,7 @@ test_expect_success \
      mkdir path1 &&
      echo rezrov >path1/file1 &&
      git update-index --add file0 path1/file1 &&
-     tree=`git write-tree` &&
+     tree=$(git write-tree) &&
      echo "$tree" &&
      echo nitfol >file0 &&
      echo yomin >path1/file1 &&
@@ -131,7 +131,7 @@ test_expect_success 'diff multiple wildcard pathspecs' '
        mkdir path2 &&
        echo rezrov >path2/file1 &&
        git update-index --add path2/file1 &&
-       tree3=`git write-tree` &&
+       tree3=$(git write-tree) &&
        git diff --name-only $tree $tree3 -- "path2*1" "path1*1" >actual &&
        cat <<-\EOF >expect &&
        path1/file1
index 1215ae544b6915fe2cc6df4d193c8f3a805beba1..643d729157d23ce501258710640e4090c34922fc 100755 (executable)
@@ -67,18 +67,18 @@ test_expect_success C_LOCALE_OUTPUT 'apply detecting corrupt patch correctly' '
        git diff >output &&
        sed -e "s/-CIT/xCIT/" <output >broken &&
        test_must_fail git apply --stat --summary broken 2>detected &&
-       detected=`cat detected` &&
-       detected=`expr "$detected" : "fatal.*at line \\([0-9]*\\)\$"` &&
-       detected=`sed -ne "${detected}p" broken` &&
+       detected=$(cat detected) &&
+       detected=$(expr "$detected" : "fatal.*at line \\([0-9]*\\)\$") &&
+       detected=$(sed -ne "${detected}p" broken) &&
        test "$detected" = xCIT
 '
 
 test_expect_success C_LOCALE_OUTPUT 'apply detecting corrupt patch correctly' '
        git diff --binary | sed -e "s/-CIT/xCIT/" >broken &&
        test_must_fail git apply --stat --summary broken 2>detected &&
-       detected=`cat detected` &&
-       detected=`expr "$detected" : "fatal.*at line \\([0-9]*\\)\$"` &&
-       detected=`sed -ne "${detected}p" broken` &&
+       detected=$(cat detected) &&
+       detected=$(expr "$detected" : "fatal.*at line \\([0-9]*\\)\$") &&
+       detected=$(sed -ne "${detected}p" broken) &&
        test "$detected" = xCIT
 '
 
@@ -88,7 +88,7 @@ test_expect_success 'initial commit' 'git commit -a -m initial'
 test_expect_success 'diff-index with --binary' '
        echo AIT >a && mv b e && echo CIT >c && cat e >d &&
        git update-index --add --remove a b c d e &&
-       tree0=`git write-tree` &&
+       tree0=$(git write-tree) &&
        git diff --cached --binary >current &&
        git apply --stat --summary current
 '
@@ -96,7 +96,7 @@ test_expect_success 'diff-index with --binary' '
 test_expect_success 'apply binary patch' '
        git reset --hard &&
        git apply --binary --index <current &&
-       tree1=`git write-tree` &&
+       tree1=$(git write-tree) &&
        test "$tree1" = "$tree0"
 '
 
index e77c09c37eede2f039610199ba8e3c45e94213d4..805b055c899e7c9f5653eb740572f67417c9dcb6 100755 (executable)
@@ -107,14 +107,14 @@ test_expect_success setup '
 +*++ [initial] Initial
 EOF
 
-V=`git version | sed -e 's/^git version //' -e 's/\./\\./g'`
+V=$(git version | sed -e 's/^git version //' -e 's/\./\\./g')
 while read cmd
 do
        case "$cmd" in
        '' | '#'*) continue ;;
        esac
-       test=`echo "$cmd" | sed -e 's|[/ ][/ ]*|_|g'`
-       pfx=`printf "%04d" $test_count`
+       test=$(echo "$cmd" | sed -e 's|[/ ][/ ]*|_|g')
+       pfx=$(printf "%04d" $test_count)
        expect="$TEST_DIRECTORY/t4013/diff.$test"
        actual="$pfx-diff.$test"
 
index 9c8063314688ec0c03d3fb2099379cbbf4ff2e19..282bee4a54c924b8168b6a28dfdbeb7ab300d7b7 100755 (executable)
@@ -43,7 +43,7 @@ test_expect_success setup '
 test_expect_success "format-patch --ignore-if-in-upstream" '
 
        git format-patch --stdout master..side >patch0 &&
-       cnt=`grep "^From " patch0 | wc -l` &&
+       cnt=$(grep "^From " patch0 | wc -l) &&
        test $cnt = 3
 
 '
@@ -52,7 +52,7 @@ test_expect_success "format-patch --ignore-if-in-upstream" '
 
        git format-patch --stdout \
                --ignore-if-in-upstream master..side >patch1 &&
-       cnt=`grep "^From " patch1 | wc -l` &&
+       cnt=$(grep "^From " patch1 | wc -l) &&
        test $cnt = 2
 
 '
@@ -69,7 +69,7 @@ test_expect_success "format-patch doesn't consider merge commits" '
        git checkout -b merger master &&
        test_tick &&
        git merge --no-ff slave &&
-       cnt=`git format-patch -3 --stdout | grep "^From " | wc -l` &&
+       cnt=$(git format-patch -3 --stdout | grep "^From " | wc -l) &&
        test $cnt = 3
 '
 
@@ -77,7 +77,7 @@ test_expect_success "format-patch result applies" '
 
        git checkout -b rebuild-0 master &&
        git am -3 patch0 &&
-       cnt=`git rev-list master.. | wc -l` &&
+       cnt=$(git rev-list master.. | wc -l) &&
        test $cnt = 2
 '
 
@@ -85,7 +85,7 @@ test_expect_success "format-patch --ignore-if-in-upstream result applies" '
 
        git checkout -b rebuild-1 master &&
        git am -3 patch1 &&
-       cnt=`git rev-list master.. | wc -l` &&
+       cnt=$(git rev-list master.. | wc -l) &&
        test $cnt = 2
 '
 
index ba43f185494630c50fc2a168df8dcd45c0b2421b..98d9713d8b2454eb1dfc4f137133a7cb0174bd0d 100755 (executable)
@@ -42,7 +42,7 @@ test_expect_success 'attach and signoff do not duplicate mime headers' '
 
        GIT_COMMITTER_NAME="はまの ふにおう" \
        git format-patch -s --stdout -1 --attach >output &&
-       test `grep -ci ^MIME-Version: output` = 1
+       test $(grep -ci ^MIME-Version: output) = 1
 
 '
 
index 1019d7b35fcb350761a44cf4ccd5ae156ce8d577..41913c3aa30de6d55b016fa9331e0877579b2d6b 100755 (executable)
@@ -94,7 +94,7 @@ test_expect_success 'setup for --cc --raw' '
        blob=$(echo file | git hash-object --stdin -w) &&
        base_tree=$(echo "100644 blob $blob     file" | git mktree) &&
        trees= &&
-       for i in `test_seq 1 40`
+       for i in $(test_seq 1 40)
        do
                blob=$(echo file$i | git hash-object --stdin -w) &&
                trees="$trees$(echo "100644 blob $blob  file" | git mktree)$LF"
index 097e63215e1ffc349ae9e3803f953aa70882b6a4..dff36b77ec8856573da26685376d156d49f8e021 100755 (executable)
@@ -5,7 +5,7 @@ test_description='combined diff show only paths that are different to all parent
 . ./test-lib.sh
 
 # verify that diffc.expect matches output of
-# `git diff -c --name-only HEAD HEAD^ HEAD^2`
+# $(git diff -c --name-only HEAD HEAD^ HEAD^2)
 diffc_verify () {
        git diff -c --name-only HEAD HEAD^ HEAD^2 >diffc.actual &&
        test_cmp diffc.expect diffc.actual
index 1e4d4380bf01c081aeb1df44cef40319063f2faa..ce8567f496438c18501f30632269ecbe7de15fd3 100755 (executable)
@@ -30,10 +30,10 @@ test_expect_success setup '
 
 test_expect_success 'apply in forward' '
 
-       T0=`git rev-parse "second^{tree}"` &&
+       T0=$(git rev-parse "second^{tree}") &&
        git reset --hard initial &&
        git apply --index --binary patch &&
-       T1=`git write-tree` &&
+       T1=$(git write-tree) &&
        test "$T0" = "$T1"
 '
 
@@ -62,22 +62,22 @@ test_expect_success 'setup separate repository lacking postimage' '
 
 test_expect_success 'apply in forward without postimage' '
 
-       T0=`git rev-parse "second^{tree}"` &&
+       T0=$(git rev-parse "second^{tree}") &&
        (
                cd initial &&
                git apply --index --binary ../patch &&
-               T1=`git write-tree` &&
+               T1=$(git write-tree) &&
                test "$T0" = "$T1"
        )
 '
 
 test_expect_success 'apply in reverse without postimage' '
 
-       T0=`git rev-parse "initial^{tree}"` &&
+       T0=$(git rev-parse "initial^{tree}") &&
        (
                cd second &&
                git apply --index --binary --reverse ../patch &&
-               T1=`git write-tree` &&
+               T1=$(git write-tree) &&
                test "$T0" = "$T1"
        )
 '
index 3d0384daa8a7b7369826b05bcb793cb445c3f9ee..c393be691be42a0b0a982c07ffeee489d4075bce 100755 (executable)
@@ -68,7 +68,7 @@ test_expect_success 'apply --whitespace=strip from config' '
        check_result sub/file1
 '
 
-D=`pwd`
+D=$(pwd)
 
 test_expect_success 'apply --whitespace=strip in subdir' '
 
index d2c930de87f721a0e876351e511295ae0b094108..7940f6f0b952b5accd3f1263f08e131a018de140 100755 (executable)
@@ -45,8 +45,8 @@ test_expect_success 'patch-id supports git-format-patch output' '
        git checkout same &&
        git format-patch -1 --stdout | calc_patch_id same &&
        test_cmp patch-id_master patch-id_same &&
-       set `git format-patch -1 --stdout | git patch-id` &&
-       test "$2" = `git rev-parse HEAD`
+       set $(git format-patch -1 --stdout | git patch-id) &&
+       test "$2" = $(git rev-parse HEAD)
 '
 
 test_expect_success 'whitespace is irrelevant in footer' '
index 1cf0a4e10301fe1bbfb3acced0c010da7b8df7f8..74fc5a88ecdaf66e34449df1a3429f8ee22cb1da 100755 (executable)
@@ -123,7 +123,7 @@ test_expect_success \
     'add files to repository' \
     'find a -type f | xargs git update-index --add &&
      find a -type l | xargs git update-index --add &&
-     treeid=`git write-tree` &&
+     treeid=$(git write-tree) &&
      echo $treeid >treeid &&
      git update-ref HEAD $(TZ=GMT GIT_COMMITTER_DATE="2005-05-27 22:00:00" \
      git commit-tree $treeid </dev/null)'
@@ -207,7 +207,7 @@ test_expect_success \
 
 test_expect_success 'clients cannot access unreachable commits' '
        test_commit unreachable &&
-       sha1=`git rev-parse HEAD` &&
+       sha1=$(git rev-parse HEAD) &&
        git reset --hard HEAD^ &&
        git archive $sha1 >remote.tar &&
        test_must_fail git archive --remote=. $sha1 >remote.tar
@@ -215,7 +215,7 @@ test_expect_success 'clients cannot access unreachable commits' '
 
 test_expect_success 'upload-archive can allow unreachable commits' '
        test_commit unreachable1 &&
-       sha1=`git rev-parse HEAD` &&
+       sha1=$(git rev-parse HEAD) &&
        git reset --hard HEAD^ &&
        git archive $sha1 >remote.tar &&
        test_config uploadarchive.allowUnreachable true &&