Merge branch 'ep/shell-command-substitution-style'

A shell script style update to change `command substitution` into
$(command substitution).  Coverts contrib/ and much of the t/
directory contents.

* ep/shell-command-substitution-style: (92 commits)
  t9901-git-web--browse.sh: use the $( ... ) construct for command substitution
  t9501-gitweb-standalone-http-status.sh: use the $( ... ) construct for command substitution
  t9350-fast-export.sh: use the $( ... ) construct for command substitution
  t9300-fast-import.sh: use the $( ... ) construct for command substitution
  t9150-svk-mergetickets.sh: use the $( ... ) construct for command substitution
  t9145-git-svn-master-branch.sh: use the $( ... ) construct for command substitution
  t9138-git-svn-authors-prog.sh: use the $( ... ) construct for command substitution
  t9137-git-svn-dcommit-clobber-series.sh: use the $( ... ) construct for command substitution
  t9132-git-svn-broken-symlink.sh: use the $( ... ) construct for command substitution
  t9130-git-svn-authors-file.sh: use the $( ... ) construct for command substitution
  t9129-git-svn-i18n-commitencoding.sh: use the $( ... ) construct for command substitution
  t9119-git-svn-info.sh: use the $( ... ) construct for command substitution
  t9118-git-svn-funky-branch-names.sh: use the $( ... ) construct for command substitution
  t9114-git-svn-dcommit-merge.sh: use the $( ... ) construct for command substitution
  t9110-git-svn-use-svm-props.sh: use the $( ... ) construct for command substitution
  t9109-git-svn-multi-glob.sh: use the $( ... ) construct for command substitution
  t9108-git-svn-glob.sh: use the $( ... ) construct for command substitution
  t9107-git-svn-migrate.sh: use the $( ... ) construct for command substitution
  t9105-git-svn-commit-diff.sh: use the $( ... ) construct for command substitution
  t9104-git-svn-follow-parent.sh: use the $( ... ) construct for command substitution
  ...
This commit is contained in:
Junio C Hamano 2016-01-22 13:08:46 -08:00
commit e572fef9d4
91 changed files with 400 additions and 400 deletions

View file

@ -574,10 +574,10 @@ then
if test "$templatefile" != ""
then
# Test whether this is just the unaltered template.
if cnt=`sed -e '/^#/d' < "$templatefile" |
if cnt=$(sed -e '/^#/d' < "$templatefile" |
git stripspace |
diff "$GIT_DIR"/COMMIT_BAREMSG - |
wc -l` &&
wc -l) &&
test 0 -lt $cnt
then
have_commitmsg=t
@ -630,8 +630,8 @@ then
fi
if test -z "$quiet"
then
commit=`git diff-tree --always --shortstat --pretty="format:%h: %s"\
--abbrev --summary --root HEAD --`
commit=$(git diff-tree --always --shortstat --pretty="format:%h: %s"\
--abbrev --summary --root HEAD --)
echo "Created${initial_commit:+ initial} commit $commit"
fi
fi

View file

@ -146,13 +146,13 @@ esac
reflist=$(get_remote_refs_for_fetch "$@")
if test "$tags"
then
taglist=`IFS=' ' &&
taglist=$(IFS=' ' &&
echo "$ls_remote_result" |
git show-ref --exclude-existing=refs/tags/ |
while read sha1 name
do
echo ".${name}:${name}"
done` || exit
done) || exit
if test "$#" -gt 1
then
# remote URL plus explicit refspecs; we need to merge them.

View file

@ -523,10 +523,10 @@ do
if test "$exit" -eq 1
then
cnt=`{
cnt=$({
git diff-files --name-only
git ls-files --unmerged
} | wc -l`
} | wc -l)
if test $best_cnt -le 0 || test $cnt -le $best_cnt
then
best_strategy=$strategy

View file

@ -67,8 +67,8 @@ case ",$all_into_one," in
,t,)
args= existing=
if [ -d "$PACKDIR" ]; then
for e in `cd "$PACKDIR" && find . -type f -name '*.pack' \
| sed -e 's/^\.\///' -e 's/\.pack$//'`
for e in $(cd "$PACKDIR" && find . -type f -name '*.pack' \
| sed -e 's/^\.\///' -e 's/\.pack$//')
do
if [ -e "$PACKDIR/$e.keep" ]; then
: keep

View file

@ -138,8 +138,8 @@ cherry-pick)
}'
logmsg=$(git show -s --pretty=raw --encoding="$encoding" "$commit")
set_author_env=`echo "$logmsg" |
LANG=C LC_ALL=C sed -ne "$pick_author_script"`
set_author_env=$(echo "$logmsg" |
LANG=C LC_ALL=C sed -ne "$pick_author_script")
eval "$set_author_env"
export GIT_AUTHOR_NAME
export GIT_AUTHOR_EMAIL
@ -160,9 +160,9 @@ cherry-pick)
esac >.msg
eval GITHEAD_$head=HEAD
eval GITHEAD_$next='`git show -s \
eval GITHEAD_$next='$(git show -s \
--pretty=oneline --encoding="$encoding" "$commit" |
sed -e "s/^[^ ]* //"`'
sed -e "s/^[^ ]* //")'
export GITHEAD_$head GITHEAD_$next
# This three way merge is an interesting one. We are at

View file

@ -31,8 +31,8 @@ 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'`
CCS=$(echo -e "$CMT_MSG\n$HEADERS" | sed -n -e 's/^Cc: \(.*\)$/\1,/gp' \
-e 's/^Signed-off-by: \(.*\)/\1,/gp')
echo "$SUBJECT" > $1
echo "Cc: $CCS" >> $1

View file

@ -11,7 +11,7 @@
if [ $# -eq 0 ]
then
cat <<!
Usage: `basename $0` git-gui-glossary.txt > git-gui-glossary.pot
Usage: $(basename $0) git-gui-glossary.txt > git-gui-glossary.pot
!
exit 1;
fi
@ -33,7 +33,7 @@ cat <<!
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"POT-Creation-Date: `date +'%Y-%m-%d %H:%M%z'`\n"
"POT-Creation-Date: $(date +'%Y-%m-%d %H:%M%z')\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"

View file

@ -98,8 +98,8 @@ then
test_skip_or_die $GIT_TEST_HTTPD "no web server found at '$LIB_HTTPD_PATH'"
fi
HTTPD_VERSION=`$LIB_HTTPD_PATH -v | \
sed -n 's/^Server version: Apache\/\([0-9]*\)\..*$/\1/p; q'`
HTTPD_VERSION=$($LIB_HTTPD_PATH -v | \
sed -n 's/^Server version: Apache\/\([0-9]*\)\..*$/\1/p; q')
if test -n "$HTTPD_VERSION"
then

View file

@ -35,11 +35,11 @@ test_expect_success \
GIT_COMMITTER_NAME="Committer Name" \
GIT_COMMITTER_EMAIL="committer@email" \
GIT_COMMITTER_DATE="2005-05-26 23:30" \
TZ=GMT git commit-tree `cat treeid` >commitid 2>/dev/null'
TZ=GMT git commit-tree $(cat treeid) >commitid 2>/dev/null'
test_expect_success \
'read commit' \
'git cat-file commit `cat commitid` >commit'
'git cat-file commit $(cat commitid) >commit'
test_expect_success \
'compare commit' \

View file

@ -29,7 +29,7 @@ reset_to_sane
test_expect_success 'symbolic-ref refuses bare sha1' '
echo content >file && git add file && git commit -m one &&
test_must_fail git symbolic-ref HEAD `git rev-parse HEAD`
test_must_fail git symbolic-ref HEAD $(git rev-parse HEAD)
'
reset_to_sane

View file

@ -62,18 +62,18 @@ test_expect_success setup '
git add . &&
test_tick && git commit -m rabbit &&
H=`git rev-parse --verify HEAD` &&
A=`git rev-parse --verify HEAD:A` &&
B=`git rev-parse --verify HEAD:A/B` &&
C=`git rev-parse --verify HEAD:C` &&
D=`git rev-parse --verify HEAD:A/D` &&
E=`git rev-parse --verify HEAD:A/B/E` &&
H=$(git rev-parse --verify HEAD) &&
A=$(git rev-parse --verify HEAD:A) &&
B=$(git rev-parse --verify HEAD:A/B) &&
C=$(git rev-parse --verify HEAD:C) &&
D=$(git rev-parse --verify HEAD:A/D) &&
E=$(git rev-parse --verify HEAD:A/B/E) &&
check_fsck &&
test_chmod +x C &&
git add C &&
test_tick && git commit -m dragon &&
L=`git rev-parse --verify HEAD` &&
L=$(git rev-parse --verify HEAD) &&
check_fsck &&
rm -f C A/B/E &&
@ -81,15 +81,15 @@ test_expect_success setup '
echo horse >A/G &&
git add F A/G &&
test_tick && git commit -a -m sheep &&
F=`git rev-parse --verify HEAD:F` &&
G=`git rev-parse --verify HEAD:A/G` &&
I=`git rev-parse --verify HEAD:A` &&
J=`git rev-parse --verify HEAD` &&
F=$(git rev-parse --verify HEAD:F) &&
G=$(git rev-parse --verify HEAD:A/G) &&
I=$(git rev-parse --verify HEAD:A) &&
J=$(git rev-parse --verify HEAD) &&
check_fsck &&
rm -f A/G &&
test_tick && git commit -a -m monkey &&
K=`git rev-parse --verify HEAD` &&
K=$(git rev-parse --verify HEAD) &&
check_fsck &&
check_have A B C D E F G H I J K L &&

View file

@ -6,11 +6,11 @@ test_description='tests for ref^{stuff}'
test_expect_success 'setup' '
echo blob >a-blob &&
git tag -a -m blob blob-tag `git hash-object -w a-blob` &&
git tag -a -m blob blob-tag $(git hash-object -w a-blob) &&
mkdir a-tree &&
echo moreblobs >a-tree/another-blob &&
git add . &&
TREE_SHA1=`git write-tree` &&
TREE_SHA1=$(git write-tree) &&
git tag -a -m tree tree-tag "$TREE_SHA1" &&
git commit -m Initial &&
git tag -a -m commit commit-tag &&

View file

@ -275,19 +275,19 @@ test_expect_success 'rev-parse --disambiguate' '
test_expect_success 'ambiguous 40-hex ref' '
TREE=$(git mktree </dev/null) &&
REF=`git rev-parse HEAD` &&
REF=$(git rev-parse HEAD) &&
VAL=$(git commit-tree $TREE </dev/null) &&
git update-ref refs/heads/$REF $VAL &&
test `git rev-parse $REF 2>err` = $REF &&
test $(git rev-parse $REF 2>err) = $REF &&
grep "refname.*${REF}.*ambiguous" err
'
test_expect_success 'ambiguous short sha1 ref' '
TREE=$(git mktree </dev/null) &&
REF=`git rev-parse --short HEAD` &&
REF=$(git rev-parse --short HEAD) &&
VAL=$(git commit-tree $TREE </dev/null) &&
git update-ref refs/heads/$REF $VAL &&
test `git rev-parse $REF 2>err` = $VAL &&
test $(git rev-parse $REF 2>err) = $VAL &&
grep "refname.*${REF}.*ambiguous" err
'

View file

@ -55,7 +55,7 @@ test_expect_success 'disable split index' '
EOF
test_cmp ls-files.expect ls-files.actual &&
BASE=`test-dump-split-index .git/index | grep "^own" | sed "s/own/base/"` &&
BASE=$(test-dump-split-index .git/index | grep "^own" | sed "s/own/base/") &&
test-dump-split-index .git/index | sed "/^own/d" >actual &&
cat >expect <<EOF &&
not a split index

View file

@ -123,10 +123,10 @@ test_expect_success 'checkout from a bare repo without "add"' '
test_expect_success 'checkout with grafts' '
test_when_finished rm .git/info/grafts &&
test_commit abc &&
SHA1=`git rev-parse HEAD` &&
SHA1=$(git rev-parse HEAD) &&
test_commit def &&
test_commit xyz &&
echo "`git rev-parse HEAD` $SHA1" >.git/info/grafts &&
echo "$(git rev-parse HEAD) $SHA1" >.git/info/grafts &&
cat >expected <<-\EOF &&
xyz
abc

View file

@ -23,7 +23,7 @@ git update-index symlink'
test_expect_success \
'the index entry must still be a symbolic link' '
case "`git ls-files --stage --cached symlink`" in
case "$(git ls-files --stage --cached symlink)" in
120000" "*symlink) echo pass;;
*) echo fail; git ls-files --stage --cached symlink; (exit 1);;
esac'

View file

@ -263,7 +263,7 @@ test_expect_success 'setup 8' '
test_ln_s_add e a &&
test_tick &&
git commit -m "rename a->e, symlink a->e" &&
oln=`printf e | git hash-object --stdin`
oln=$(printf e | git hash-object --stdin)
'
test_expect_success 'setup 9' '

View file

@ -28,7 +28,7 @@ test_expect_success \
echo Mi >path2/baz/b &&
find path? \( -type f -o -type l \) -print |
xargs git update-index --add &&
tree=`git write-tree` &&
tree=$(git write-tree) &&
echo $tree'
test_output () {

View file

@ -35,7 +35,7 @@ test_expect_success 'setup' '
echo 222 >path3/2.txt &&
find *.txt path* \( -type f -o -type l \) -print |
xargs git update-index --add &&
tree=`git write-tree` &&
tree=$(git write-tree) &&
echo $tree
'

View file

@ -27,7 +27,7 @@ SHA1=
test_expect_success \
'see if git show-ref works as expected' \
'git branch a &&
SHA1=`cat .git/refs/heads/a` &&
SHA1=$(cat .git/refs/heads/a) &&
echo "$SHA1 refs/heads/a" >expect &&
git show-ref a >result &&
test_cmp expect result'

View file

@ -67,7 +67,7 @@ test_expect_success 'rebase --skip with --merge' '
'
test_expect_success 'merge and reference trees equal' '
test -z "`git diff-tree skip-merge skip-reference`"
test -z "$(git diff-tree skip-merge skip-reference)"
'
test_expect_success 'moved back to branch correctly' '

View file

@ -77,7 +77,7 @@ test_expect_success setup '
test_expect_success 'cherry-pick -x inserts blank line after one line subject' '
pristine_detach initial &&
sha1=`git rev-parse mesg-one-line^0` &&
sha1=$(git rev-parse mesg-one-line^0) &&
git cherry-pick -x mesg-one-line &&
cat <<-EOF >expect &&
$mesg_one_line
@ -114,7 +114,7 @@ test_expect_success 'cherry-pick -s inserts blank line after non-conforming foot
test_expect_success 'cherry-pick -x inserts blank line when conforming footer not found' '
pristine_detach initial &&
sha1=`git rev-parse mesg-no-footer^0` &&
sha1=$(git rev-parse mesg-no-footer^0) &&
git cherry-pick -x mesg-no-footer &&
cat <<-EOF >expect &&
$mesg_no_footer
@ -139,7 +139,7 @@ test_expect_success 'cherry-pick -s inserts blank line when conforming footer no
test_expect_success 'cherry-pick -x -s inserts blank line when conforming footer not found' '
pristine_detach initial &&
sha1=`git rev-parse mesg-no-footer^0` &&
sha1=$(git rev-parse mesg-no-footer^0) &&
git cherry-pick -x -s mesg-no-footer &&
cat <<-EOF >expect &&
$mesg_no_footer
@ -164,7 +164,7 @@ test_expect_success 'cherry-pick -s adds sob when last sob doesnt match committe
test_expect_success 'cherry-pick -x -s adds sob when last sob doesnt match committer' '
pristine_detach initial &&
sha1=`git rev-parse mesg-with-footer^0` &&
sha1=$(git rev-parse mesg-with-footer^0) &&
git cherry-pick -x -s mesg-with-footer &&
cat <<-EOF >expect &&
$mesg_with_footer
@ -187,7 +187,7 @@ test_expect_success 'cherry-pick -s refrains from adding duplicate trailing sob'
test_expect_success 'cherry-pick -x -s adds sob even when trailing sob exists for committer' '
pristine_detach initial &&
sha1=`git rev-parse mesg-with-footer-sob^0` &&
sha1=$(git rev-parse mesg-with-footer-sob^0) &&
git cherry-pick -x -s mesg-with-footer-sob &&
cat <<-EOF >expect &&
$mesg_with_footer_sob
@ -200,7 +200,7 @@ test_expect_success 'cherry-pick -x -s adds sob even when trailing sob exists fo
test_expect_success 'cherry-pick -x treats "(cherry picked from..." line as part of footer' '
pristine_detach initial &&
sha1=`git rev-parse mesg-with-cherry-footer^0` &&
sha1=$(git rev-parse mesg-with-cherry-footer^0) &&
git cherry-pick -x mesg-with-cherry-footer &&
cat <<-EOF >expect &&
$mesg_with_cherry_footer
@ -223,7 +223,7 @@ test_expect_success 'cherry-pick -s treats "(cherry picked from..." line as part
test_expect_success 'cherry-pick -x -s treats "(cherry picked from..." line as part of footer' '
pristine_detach initial &&
sha1=`git rev-parse mesg-with-cherry-footer^0` &&
sha1=$(git rev-parse mesg-with-cherry-footer^0) &&
git cherry-pick -x -s mesg-with-cherry-footer &&
cat <<-EOF >expect &&
$mesg_with_cherry_footer

View file

@ -115,7 +115,7 @@ test_expect_success '"rm" command printed' '
git add test-file &&
git commit -m "add file for rm test" &&
git rm test-file > rm-output &&
test `grep "^rm " rm-output | wc -l` = 1 &&
test $(grep "^rm " rm-output | wc -l) = 1 &&
rm -f test-file rm-output &&
git commit -m "remove file from rm test"
'
@ -125,7 +125,7 @@ test_expect_success '"rm" command suppressed with --quiet' '
git add test-file &&
git commit -m "add file for rm --quiet test" &&
git rm --quiet test-file > rm-output &&
test `wc -l < rm-output` = 0 &&
test $(wc -l < rm-output) = 0 &&
rm -f test-file rm-output &&
git commit -m "remove file from rm --quiet test"
'

View file

@ -25,7 +25,7 @@ test_expect_success \
echo foo >xfoo1 &&
chmod 755 xfoo1 &&
git add xfoo1 &&
case "`git ls-files --stage xfoo1`" in
case "$(git ls-files --stage xfoo1)" in
100644" "*xfoo1) echo pass;;
*) echo fail; git ls-files --stage xfoo1; (exit 1);;
esac'
@ -33,7 +33,7 @@ test_expect_success \
test_expect_success 'git add: filemode=0 should not get confused by symlink' '
rm -f xfoo1 &&
test_ln_s_add foo xfoo1 &&
case "`git ls-files --stage xfoo1`" in
case "$(git ls-files --stage xfoo1)" in
120000" "*xfoo1) echo pass;;
*) echo fail; git ls-files --stage xfoo1; (exit 1);;
esac
@ -45,7 +45,7 @@ test_expect_success \
echo foo >xfoo2 &&
chmod 755 xfoo2 &&
git update-index --add xfoo2 &&
case "`git ls-files --stage xfoo2`" in
case "$(git ls-files --stage xfoo2)" in
100644" "*xfoo2) echo pass;;
*) echo fail; git ls-files --stage xfoo2; (exit 1);;
esac'
@ -53,7 +53,7 @@ test_expect_success \
test_expect_success 'git add: filemode=0 should not get confused by symlink' '
rm -f xfoo2 &&
test_ln_s_add foo xfoo2 &&
case "`git ls-files --stage xfoo2`" in
case "$(git ls-files --stage xfoo2)" in
120000" "*xfoo2) echo pass;;
*) echo fail; git ls-files --stage xfoo2; (exit 1);;
esac
@ -63,7 +63,7 @@ test_expect_success \
'git update-index --add: Test that executable bit is not used...' \
'git config core.filemode 0 &&
test_ln_s_add xfoo2 xfoo3 && # runs git update-index --add
case "`git ls-files --stage xfoo3`" in
case "$(git ls-files --stage xfoo3)" in
120000" "*xfoo3) echo pass;;
*) echo fail; git ls-files --stage xfoo3; (exit 1);;
esac'
@ -173,14 +173,14 @@ test_expect_success 'git add with filemode=0, symlinks=0 prefers stage 2 over st
test_expect_success 'git add --refresh' '
>foo && git add foo && git commit -a -m "commit all" &&
test -z "`git diff-index HEAD -- foo`" &&
test -z "$(git diff-index HEAD -- foo)" &&
git read-tree HEAD &&
case "`git diff-index HEAD -- foo`" in
case "$(git diff-index HEAD -- foo)" in
:100644" "*"M foo") echo pass;;
*) echo fail; (exit 1);;
esac &&
git add --refresh -- foo &&
test -z "`git diff-index HEAD -- foo`"
test -z "$(git diff-index HEAD -- foo)"
'
test_expect_success 'git add --refresh with pathspec' '

View file

@ -9,9 +9,9 @@ test_description='git mailinfo and git mailsplit test'
test_expect_success 'split sample box' \
'git mailsplit -o. "$TEST_DIRECTORY"/t5100/sample.mbox >last &&
last=`cat last` &&
last=$(cat last) &&
echo total is $last &&
test `cat last` = 17'
test $(cat last) = 17'
check_mailinfo () {
mail=$1 opt=$2
@ -23,7 +23,7 @@ check_mailinfo () {
}
for mail in `echo 00*`
for mail in 00*
do
test_expect_success "mailinfo $mail" '
check_mailinfo $mail "" &&
@ -47,11 +47,11 @@ test_expect_success 'split box with rfc2047 samples' \
'mkdir rfc2047 &&
git mailsplit -orfc2047 "$TEST_DIRECTORY"/t5100/rfc2047-samples.mbox \
>rfc2047/last &&
last=`cat rfc2047/last` &&
last=$(cat rfc2047/last) &&
echo total is $last &&
test `cat rfc2047/last` = 11'
test $(cat rfc2047/last) = 11'
for mail in `echo rfc2047/00*`
for mail in rfc2047/00*
do
test_expect_success "mailinfo $mail" '
git mailinfo -u $mail-msg $mail-patch <$mail >$mail-info &&

View file

@ -8,7 +8,7 @@ test_description='git pack-object
'
. ./test-lib.sh
TRASH=`pwd`
TRASH=$(pwd)
test_expect_success \
'setup' \
@ -20,8 +20,8 @@ test_expect_success \
test-genrandom "seed b" 2097152 > b_big &&
git update-index --add a a_big b b_big c &&
cat c >d && echo foo >>d && git update-index --add d &&
tree=`git write-tree` &&
commit=`git commit-tree $tree </dev/null` && {
tree=$(git write-tree) &&
commit=$(git commit-tree $tree </dev/null) && {
echo $tree &&
echo $commit &&
git ls-tree $tree | sed -e "s/.* \\([0-9a-f]*\\) .*/\\1/"
@ -29,7 +29,7 @@ test_expect_success \
git diff-tree --root -p $commit &&
while read object
do
t=`git cat-file -t $object` &&
t=$(git cat-file -t $object) &&
git cat-file $t $object || return 1
done <obj-list
} >expect'
@ -147,7 +147,7 @@ test_expect_success \
git diff-tree --root -p $commit &&
while read object
do
t=`git cat-file -t $object` &&
t=$(git cat-file -t $object) &&
git cat-file $t $object || return 1
done <obj-list
} >current &&
@ -162,7 +162,7 @@ test_expect_success \
git diff-tree --root -p $commit &&
while read object
do
t=`git cat-file -t $object` &&
t=$(git cat-file -t $object) &&
git cat-file $t $object || return 1
done <obj-list
} >current &&
@ -177,7 +177,7 @@ test_expect_success \
git diff-tree --root -p $commit &&
while read object
do
t=`git cat-file -t $object` &&
t=$(git cat-file -t $object) &&
git cat-file $t $object || return 1
done <obj-list
} >current &&
@ -252,8 +252,8 @@ test_expect_success \
test_expect_success \
'verify-pack catches a corrupted sum of the index file itself' \
'l=`wc -c <test-3.idx` &&
l=`expr $l - 20` &&
'l=$(wc -c <test-3.idx) &&
l=$(expr $l - 20) &&
cat test-1-${packname_1}.pack >test-3.pack &&
printf "%20s" "" | dd of=test-3.idx count=20 bs=1 conv=notrunc seek=$l &&
if git verify-pack test-3.pack

View file

@ -16,12 +16,12 @@ test_expect_success \
git update-index --add $i || return 1
done &&
echo d >d && cat c >>d && git update-index --add d &&
tree=`git write-tree` &&
commit1=`git commit-tree $tree </dev/null` &&
tree=$(git write-tree) &&
commit1=$(git commit-tree $tree </dev/null) &&
git update-ref HEAD $commit1 &&
git repack -a -d &&
test "`git count-objects`" = "0 objects, 0 kilobytes" &&
pack1=`ls .git/objects/pack/*.pack` &&
test "$(git count-objects)" = "0 objects, 0 kilobytes" &&
pack1=$(ls .git/objects/pack/*.pack) &&
test -f "$pack1"'
test_expect_success \
@ -43,11 +43,11 @@ test_expect_success \
'repack -a -d, packedGit{WindowSize,Limit} == 1 page' \
'git config core.packedGitWindowSize 512 &&
git config core.packedGitLimit 512 &&
commit2=`git commit-tree $tree -p $commit1 </dev/null` &&
commit2=$(git commit-tree $tree -p $commit1 </dev/null) &&
git update-ref HEAD $commit2 &&
git repack -a -d &&
test "`git count-objects`" = "0 objects, 0 kilobytes" &&
pack2=`ls .git/objects/pack/*.pack` &&
test "$(git count-objects)" = "0 objects, 0 kilobytes" &&
pack2=$(ls .git/objects/pack/*.pack) &&
test -f "$pack2" &&
test "$pack1" \!= "$pack2"'

View file

@ -14,21 +14,21 @@ test_expect_success \
i=1 &&
while test $i -le 100
do
iii=`printf '%03i' $i`
iii=$(printf '%03i' $i)
test-genrandom "bar" 200 > wide_delta_$iii &&
test-genrandom "baz $iii" 50 >> wide_delta_$iii &&
test-genrandom "foo"$i 100 > deep_delta_$iii &&
test-genrandom "foo"`expr $i + 1` 100 >> deep_delta_$iii &&
test-genrandom "foo"`expr $i + 2` 100 >> deep_delta_$iii &&
test-genrandom "foo"$(expr $i + 1) 100 >> deep_delta_$iii &&
test-genrandom "foo"$(expr $i + 2) 100 >> deep_delta_$iii &&
echo $iii >file_$iii &&
test-genrandom "$iii" 8192 >>file_$iii &&
git update-index --add file_$iii deep_delta_$iii wide_delta_$iii &&
i=`expr $i + 1` || return 1
i=$(expr $i + 1) || return 1
done &&
{ echo 101 && test-genrandom 100 8192; } >file_101 &&
git update-index --add file_101 &&
tree=`git write-tree` &&
commit=`git commit-tree $tree </dev/null` && {
tree=$(git write-tree) &&
commit=$(git commit-tree $tree </dev/null) && {
echo $tree &&
git ls-tree $tree | sed -e "s/.* \\([0-9a-f]*\\) .*/\\1/"
} >obj-list &&
@ -152,10 +152,10 @@ test_expect_success \
'[index v1] 2) create a stealth corruption in a delta base reference' \
'# This test assumes file_101 is a delta smaller than 16 bytes.
# It should be against file_100 but we substitute its base for file_099
sha1_101=`git hash-object file_101` &&
sha1_099=`git hash-object file_099` &&
offs_101=`index_obj_offset 1.idx $sha1_101` &&
nr_099=`index_obj_nr 1.idx $sha1_099` &&
sha1_101=$(git hash-object file_101) &&
sha1_099=$(git hash-object file_099) &&
offs_101=$(index_obj_offset 1.idx $sha1_101) &&
nr_099=$(index_obj_nr 1.idx $sha1_099) &&
chmod +w ".git/objects/pack/pack-${pack1}.pack" &&
dd of=".git/objects/pack/pack-${pack1}.pack" seek=$(($offs_101 + 1)) \
if=".git/objects/pack/pack-${pack1}.idx" \
@ -193,10 +193,10 @@ test_expect_success \
'[index v2] 2) create a stealth corruption in a delta base reference' \
'# This test assumes file_101 is a delta smaller than 16 bytes.
# It should be against file_100 but we substitute its base for file_099
sha1_101=`git hash-object file_101` &&
sha1_099=`git hash-object file_099` &&
offs_101=`index_obj_offset 1.idx $sha1_101` &&
nr_099=`index_obj_nr 1.idx $sha1_099` &&
sha1_101=$(git hash-object file_101) &&
sha1_099=$(git hash-object file_099) &&
offs_101=$(index_obj_offset 1.idx $sha1_101) &&
nr_099=$(index_obj_nr 1.idx $sha1_099) &&
chmod +w ".git/objects/pack/pack-${pack1}.pack" &&
dd of=".git/objects/pack/pack-${pack1}.pack" seek=$(($offs_101 + 1)) \
if=".git/objects/pack/pack-${pack1}.idx" \
@ -222,11 +222,11 @@ test_expect_success \
'rm -f .git/objects/pack/* &&
git index-pack --index-version=2 --stdin < "test-1-${pack1}.pack" &&
git verify-pack ".git/objects/pack/pack-${pack1}.pack" &&
obj=`git hash-object file_001` &&
nr=`index_obj_nr ".git/objects/pack/pack-${pack1}.idx" $obj` &&
obj=$(git hash-object file_001) &&
nr=$(index_obj_nr ".git/objects/pack/pack-${pack1}.idx" $obj) &&
chmod +w ".git/objects/pack/pack-${pack1}.idx" &&
printf xxxx | dd of=".git/objects/pack/pack-${pack1}.idx" conv=notrunc \
bs=1 count=4 seek=$((8 + 256 * 4 + `wc -l <obj-list` * 20 + $nr * 4)) &&
bs=1 count=4 seek=$((8 + 256 * 4 + $(wc -l <obj-list) * 20 + $nr * 4)) &&
( while read obj
do git cat-file -p $obj >/dev/null || exit 1
done <obj-list ) &&

View file

@ -32,23 +32,23 @@ create_test_files() {
create_new_pack() {
rm -rf .git &&
git init &&
blob_1=`git hash-object -t blob -w file_1` &&
blob_2=`git hash-object -t blob -w file_2` &&
blob_3=`git hash-object -t blob -w file_3` &&
pack=`printf "$blob_1\n$blob_2\n$blob_3\n" |
git pack-objects $@ .git/objects/pack/pack` &&
blob_1=$(git hash-object -t blob -w file_1) &&
blob_2=$(git hash-object -t blob -w file_2) &&
blob_3=$(git hash-object -t blob -w file_3) &&
pack=$(printf "$blob_1\n$blob_2\n$blob_3\n" |
git pack-objects $@ .git/objects/pack/pack) &&
pack=".git/objects/pack/pack-${pack}" &&
git verify-pack -v ${pack}.pack
}
do_repack() {
pack=`printf "$blob_1\n$blob_2\n$blob_3\n" |
git pack-objects $@ .git/objects/pack/pack` &&
pack=$(printf "$blob_1\n$blob_2\n$blob_3\n" |
git pack-objects $@ .git/objects/pack/pack) &&
pack=".git/objects/pack/pack-${pack}"
}
do_corrupt_object() {
ofs=`git show-index < ${pack}.idx | grep $1 | cut -f1 -d" "` &&
ofs=$(git show-index < ${pack}.idx | grep $1 | cut -f1 -d" ") &&
ofs=$(($ofs + $2)) &&
chmod +w ${pack}.pack &&
dd of=${pack}.pack bs=1 conv=notrunc seek=$ofs &&

View file

@ -266,7 +266,7 @@ EOF
'
test_expect_success 'prune .git/shallow' '
SHA1=`echo hi|git commit-tree HEAD^{tree}` &&
SHA1=$(echo hi|git commit-tree HEAD^{tree}) &&
echo $SHA1 >.git/shallow &&
git prune --dry-run >out &&
grep $SHA1 .git/shallow &&

View file

@ -3,20 +3,20 @@
test_description='git pack-object --include-tag'
. ./test-lib.sh
TRASH=`pwd`
TRASH=$(pwd)
test_expect_success setup '
echo c >d &&
git update-index --add d &&
tree=`git write-tree` &&
commit=`git commit-tree $tree </dev/null` &&
tree=$(git write-tree) &&
commit=$(git commit-tree $tree </dev/null) &&
echo "object $commit" >sig &&
echo "type commit" >>sig &&
echo "tag mytag" >>sig &&
echo "tagger $(git var GIT_COMMITTER_IDENT)" >>sig &&
echo >>sig &&
echo "our test tag" >>sig &&
tag=`git mktag <sig` &&
tag=$(git mktag <sig) &&
rm d sig &&
git update-ref refs/tags/mytag $tag && {
echo $tree &&

View file

@ -14,7 +14,7 @@ test_description='Testing multi_ack pack fetching'
add () {
name=$1 &&
text="$@" &&
branch=`echo $name | sed -e 's/^\(.\).*$/\1/'` &&
branch=$(echo $name | sed -e 's/^\(.\).*$/\1/') &&
parents="" &&
shift &&
@ -50,18 +50,18 @@ pull_to_client () {
case "$heads" in *B*)
echo $BTIP > .git/refs/heads/B;;
esac &&
git symbolic-ref HEAD refs/heads/`echo $heads \
| sed -e "s/^\(.\).*$/\1/"` &&
git symbolic-ref HEAD refs/heads/$(echo $heads \
| sed -e "s/^\(.\).*$/\1/") &&
git fsck --full &&
mv .git/objects/pack/pack-* . &&
p=`ls -1 pack-*.pack` &&
p=$(ls -1 pack-*.pack) &&
git unpack-objects <$p &&
git fsck --full &&
idx=`echo pack-*.idx` &&
pack_count=`git show-index <$idx | wc -l` &&
idx=$(echo pack-*.idx) &&
pack_count=$(git show-index <$idx | wc -l) &&
test $pack_count = $count &&
rm -f pack-*
)
@ -132,13 +132,13 @@ test_expect_success 'single given branch clone' '
test_expect_success 'clone shallow depth 1' '
git clone --no-single-branch --depth 1 "file://$(pwd)/." shallow0 &&
test "`git --git-dir=shallow0/.git rev-list --count HEAD`" = 1
test "$(git --git-dir=shallow0/.git rev-list --count HEAD)" = 1
'
test_expect_success 'clone shallow depth 1 with fsck' '
git config --global fetch.fsckobjects true &&
git clone --no-single-branch --depth 1 "file://$(pwd)/." shallow0fsck &&
test "`git --git-dir=shallow0fsck/.git rev-list --count HEAD`" = 1 &&
test "$(git --git-dir=shallow0fsck/.git rev-list --count HEAD)" = 1 &&
git config --global --unset fetch.fsckobjects
'
@ -147,7 +147,7 @@ test_expect_success 'clone shallow' '
'
test_expect_success 'clone shallow depth count' '
test "`git --git-dir=shallow/.git rev-list --count HEAD`" = 2
test "$(git --git-dir=shallow/.git rev-list --count HEAD)" = 2
'
test_expect_success 'clone shallow object count' '
@ -273,7 +273,7 @@ test_expect_success 'additional simple shallow deepenings' '
'
test_expect_success 'clone shallow depth count' '
test "`git --git-dir=shallow/.git rev-list --count HEAD`" = 11
test "$(git --git-dir=shallow/.git rev-list --count HEAD)" = 11
'
test_expect_success 'clone shallow object count' '

View file

@ -85,7 +85,7 @@ test_expect_success C_LOCALE_OUTPUT 'check remote-tracking' '
test_expect_success 'remote forces tracking branches' '
(
cd test &&
case `git config remote.second.fetch` in
case $(git config remote.second.fetch) in
+*) true ;;
*) false ;;
esac

View file

@ -20,7 +20,7 @@ update_repos() {
}
repo_fetched() {
if test "`git log -1 --pretty=format:%s $1 --`" = "`cat mark`"; then
if test "$(git log -1 --pretty=format:%s $1 --)" = "$(cat mark)"; then
echo >&2 "repo was fetched: $1"
return 0
fi

View file

@ -7,7 +7,7 @@ test_description='Per branch config variables affects "git fetch".
. ./test-lib.sh
D=`pwd`
D=$(pwd)
test_bundle_object_count () {
git verify-pack -v "$1" >verify.out &&
@ -64,8 +64,8 @@ test_expect_success "fetch test" '
cd two &&
git fetch &&
test -f .git/refs/heads/one &&
mine=`git rev-parse refs/heads/one` &&
his=`cd ../one && git rev-parse refs/heads/master` &&
mine=$(git rev-parse refs/heads/one) &&
his=$(cd ../one && git rev-parse refs/heads/master) &&
test "z$mine" = "z$his"
'
@ -75,8 +75,8 @@ test_expect_success "fetch test for-merge" '
git fetch &&
test -f .git/refs/heads/two &&
test -f .git/refs/heads/one &&
master_in_two=`cd ../two && git rev-parse master` &&
one_in_two=`cd ../two && git rev-parse one` &&
master_in_two=$(cd ../two && git rev-parse master) &&
one_in_two=$(cd ../two && git rev-parse one) &&
{
echo "$one_in_two "
echo "$master_in_two not-for-merge"

View file

@ -128,8 +128,8 @@ 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_f="$TEST_DIRECTORY/t5515/fetch.$test"
actual_f="$pfx-fetch.$test"
expect_r="$TEST_DIRECTORY/t5515/refs.$test"

View file

@ -16,7 +16,7 @@ This test checks the following functionality:
. ./test-lib.sh
D=`pwd`
D=$(pwd)
mk_empty () {
repo_name="$1"
@ -422,7 +422,7 @@ test_expect_success 'push tag with non-existent, incomplete dest' '
test_expect_success 'push sha1 with non-existent, incomplete dest' '
mk_test testrepo &&
test_must_fail git push testrepo `git rev-parse master`:foo
test_must_fail git push testrepo $(git rev-parse master):foo
'

View file

@ -4,7 +4,7 @@ test_description='pushing to a mirror repository'
. ./test-lib.sh
D=`pwd`
D=$(pwd)
invert () {
if "$@"; then

View file

@ -54,7 +54,7 @@ test_expect_success SYMLINKS 'pulling from real subdir' '
# git rev-parse --show-cdup printed a path relative to
# clone-repo/subdir/, not subdir-link/. Git rev-parse --show-cdup
# used the correct .git, but when the git pull shell script did
# "cd `git rev-parse --show-cdup`", it ended up in the wrong
# "cd $(git rev-parse --show-cdup)", it ended up in the wrong
# directory. A POSIX shell's "cd" works a little differently
# than chdir() in C; "cd -P" is much closer to chdir().
#

View file

@ -4,7 +4,7 @@ test_description='errors in upload-pack'
. ./test-lib.sh
D=`pwd`
D=$(pwd)
corrupt_repo () {
object_sha1=$(git rev-parse "$1") &&

View file

@ -15,7 +15,7 @@ test_expect_success 'setup remote repo' '
cat >proxy <<'EOF'
#!/bin/sh
echo >&2 "proxying for $*"
cmd=`"$PERL_PATH" -e '
cmd=$("$PERL_PATH" -e '
read(STDIN, $buf, 4);
my $n = hex($buf) - 4;
read(STDIN, $buf, $n);
@ -23,7 +23,7 @@ cmd=`"$PERL_PATH" -e '
# drop absolute-path on repo name
$cmd =~ s{ /}{ };
print $cmd;
'`
')
echo >&2 "Running '$cmd'"
exec $cmd
EOF

View file

@ -98,7 +98,7 @@ EOF
test_expect_success 'fetch something upstream has but hidden by clients shallow boundaries' '
# the blob "1" is available in .git but hidden by the
# shallow2/.git/shallow and it should be resent
! git --git-dir=shallow2/.git cat-file blob `echo 1|git hash-object --stdin` >/dev/null &&
! git --git-dir=shallow2/.git cat-file blob $(echo 1|git hash-object --stdin) >/dev/null &&
echo 1 >1.t &&
git add 1.t &&
git commit -m add-1-back &&
@ -114,7 +114,7 @@ add-1-back
EOF
test_cmp expect actual
) &&
git --git-dir=shallow2/.git cat-file blob `echo 1|git hash-object --stdin` >/dev/null
git --git-dir=shallow2/.git cat-file blob $(echo 1|git hash-object --stdin) >/dev/null
'

View file

@ -104,7 +104,7 @@ EOF
'
test_expect_success 'push from full to shallow' '
! git --git-dir=shallow2/.git cat-file blob `echo 1|git hash-object --stdin` &&
! git --git-dir=shallow2/.git cat-file blob $(echo 1|git hash-object --stdin) &&
commit 1 &&
git push shallow2/.git +master:refs/remotes/top/master &&
(
@ -117,7 +117,7 @@ test_expect_success 'push from full to shallow' '
3
EOF
test_cmp expect actual &&
git cat-file blob `echo 1|git hash-object --stdin` >/dev/null
git cat-file blob $(echo 1|git hash-object --stdin) >/dev/null
)
'
test_done

View file

@ -132,7 +132,7 @@ test_expect_success 'fetch packed objects' '
test_expect_success 'fetch notices corrupt pack' '
cp -R "$HTTPD_DOCUMENT_ROOT_PATH"/repo_pack.git "$HTTPD_DOCUMENT_ROOT_PATH"/repo_bad1.git &&
(cd "$HTTPD_DOCUMENT_ROOT_PATH"/repo_bad1.git &&
p=`ls objects/pack/pack-*.pack` &&
p=$(ls objects/pack/pack-*.pack) &&
chmod u+w $p &&
printf %0256d 0 | dd of=$p bs=256 count=1 seek=1 conv=notrunc
) &&
@ -140,14 +140,14 @@ test_expect_success 'fetch notices corrupt pack' '
(cd repo_bad1.git &&
git --bare init &&
test_must_fail git --bare fetch $HTTPD_URL/dumb/repo_bad1.git &&
test 0 = `ls objects/pack/pack-*.pack | wc -l`
test 0 = $(ls objects/pack/pack-*.pack | wc -l)
)
'
test_expect_success 'fetch notices corrupt idx' '
cp -R "$HTTPD_DOCUMENT_ROOT_PATH"/repo_pack.git "$HTTPD_DOCUMENT_ROOT_PATH"/repo_bad2.git &&
(cd "$HTTPD_DOCUMENT_ROOT_PATH"/repo_bad2.git &&
p=`ls objects/pack/pack-*.idx` &&
p=$(ls objects/pack/pack-*.idx) &&
chmod u+w $p &&
printf %0256d 0 | dd of=$p bs=256 count=1 seek=1 conv=notrunc
) &&
@ -155,7 +155,7 @@ test_expect_success 'fetch notices corrupt idx' '
(cd repo_bad2.git &&
git --bare init &&
test_must_fail git --bare fetch $HTTPD_URL/dumb/repo_bad2.git &&
test 0 = `ls objects/pack | wc -l`
test 0 = $(ls objects/pack | wc -l)
)
'

View file

@ -57,7 +57,7 @@ test_expect_success 'prepare pack objects' '
test_expect_success 'fetch notices corrupt pack' '
cp -R "$GIT_DAEMON_DOCUMENT_ROOT_PATH"/repo_pack.git "$GIT_DAEMON_DOCUMENT_ROOT_PATH"/repo_bad1.git &&
(cd "$GIT_DAEMON_DOCUMENT_ROOT_PATH"/repo_bad1.git &&
p=`ls objects/pack/pack-*.pack` &&
p=$(ls objects/pack/pack-*.pack) &&
chmod u+w $p &&
printf %0256d 0 | dd of=$p bs=256 count=1 seek=1 conv=notrunc
) &&
@ -65,14 +65,14 @@ test_expect_success 'fetch notices corrupt pack' '
(cd repo_bad1.git &&
git --bare init &&
test_must_fail git --bare fetch "$GIT_DAEMON_URL/repo_bad1.git" &&
test 0 = `ls objects/pack/pack-*.pack | wc -l`
test 0 = $(ls objects/pack/pack-*.pack | wc -l)
)
'
test_expect_success 'fetch notices corrupt idx' '
cp -R "$GIT_DAEMON_DOCUMENT_ROOT_PATH"/repo_pack.git "$GIT_DAEMON_DOCUMENT_ROOT_PATH"/repo_bad2.git &&
(cd "$GIT_DAEMON_DOCUMENT_ROOT_PATH"/repo_bad2.git &&
p=`ls objects/pack/pack-*.idx` &&
p=$(ls objects/pack/pack-*.idx) &&
chmod u+w $p &&
printf %0256d 0 | dd of=$p bs=256 count=1 seek=1 conv=notrunc
) &&
@ -80,7 +80,7 @@ test_expect_success 'fetch notices corrupt idx' '
(cd repo_bad2.git &&
git --bare init &&
test_must_fail git --bare fetch "$GIT_DAEMON_URL/repo_bad2.git" &&
test 0 = `ls objects/pack | wc -l`
test 0 = $(ls objects/pack | wc -l)
)
'

View file

@ -244,7 +244,7 @@ test_expect_success 'clone separate gitdir' '
'
test_expect_success 'clone separate gitdir: output' '
echo "gitdir: `pwd`/realgitdir" >expected &&
echo "gitdir: $(pwd)/realgitdir" >expected &&
test_cmp expected dst/.git
'

View file

@ -6,7 +6,7 @@
test_description='test clone --reference'
. ./test-lib.sh
base_dir=`pwd`
base_dir=$(pwd)
U=$base_dir/UPLOAD_LOG

View file

@ -21,7 +21,7 @@ test_valid_repo() {
test_line_count = 0 fsck.log
}
base_dir=`pwd`
base_dir=$(pwd)
test_expect_success 'preparing first repository' \
'test_create_repo A && cd A &&

View file

@ -15,7 +15,7 @@ make_tree() {
make_bare() {
git init --bare "$1" &&
(cd "$1" &&
tree=`git hash-object -w -t tree /dev/null` &&
tree=$(git hash-object -w -t tree /dev/null) &&
commit=$(echo "$1" | git commit-tree $tree) &&
git update-ref HEAD $commit
)

View file

@ -10,15 +10,15 @@ test_expect_success setup '
echo >subdir/fileB fileB &&
git add fileA subdir/fileB &&
git commit -a -m "Initial in one history." &&
A0=`git rev-parse --verify HEAD` &&
A0=$(git rev-parse --verify HEAD) &&
echo >fileA fileA modified &&
git commit -a -m "Second in one history." &&
A1=`git rev-parse --verify HEAD` &&
A1=$(git rev-parse --verify HEAD) &&
echo >subdir/fileB fileB modified &&
git commit -a -m "Third in one history." &&
A2=`git rev-parse --verify HEAD` &&
A2=$(git rev-parse --verify HEAD) &&
rm -f .git/refs/heads/master .git/index &&
@ -26,15 +26,15 @@ test_expect_success setup '
echo >subdir/fileB fileB again &&
git add fileA subdir/fileB &&
git commit -a -m "Initial in alternate history." &&
B0=`git rev-parse --verify HEAD` &&
B0=$(git rev-parse --verify HEAD) &&
echo >fileA fileA modified in alternate history &&
git commit -a -m "Second in alternate history." &&
B1=`git rev-parse --verify HEAD` &&
B1=$(git rev-parse --verify HEAD) &&
echo >subdir/fileB fileB modified in alternate history &&
git commit -a -m "Third in alternate history." &&
B2=`git rev-parse --verify HEAD` &&
B2=$(git rev-parse --verify HEAD) &&
: done
'

View file

@ -27,9 +27,9 @@ test_bisection_diff()
# Test if bisection size is close to half of list size within
# tolerance.
#
_bisect_err=`expr $_list_size - $_bisection_size \* 2`
test "$_bisect_err" -lt 0 && _bisect_err=`expr 0 - $_bisect_err`
_bisect_err=`expr $_bisect_err / 2` ; # floor
_bisect_err=$(expr $_list_size - $_bisection_size \* 2)
test "$_bisect_err" -lt 0 && _bisect_err=$(expr 0 - $_bisect_err)
_bisect_err=$(expr $_bisect_err / 2) ; # floor
test_expect_success \
"bisection diff $_bisect_option $_head $* <= $_max_diff" \

View file

@ -6,11 +6,11 @@ test_description='--show-all --parents does not rewrite TREESAME commits'
test_expect_success 'set up --show-all --parents test' '
test_commit one foo.txt &&
commit1=`git rev-list -1 HEAD` &&
commit1=$(git rev-list -1 HEAD) &&
test_commit two bar.txt &&
commit2=`git rev-list -1 HEAD` &&
commit2=$(git rev-list -1 HEAD) &&
test_commit three foo.txt &&
commit3=`git rev-list -1 HEAD`
commit3=$(git rev-list -1 HEAD)
'
test_expect_success '--parents rewrites TREESAME parents correctly' '

View file

@ -20,7 +20,7 @@ test_expect_success 'setup (initial)' '
make_text() {
echo $1: $2
for i in `count 20`; do
for i in $(count 20); do
echo $1: $i
done
echo $1: $3

View file

@ -7,7 +7,7 @@ test_description='test case exclude pathspec'
test_expect_success 'setup' '
for p in file sub/file sub/sub/file sub/file2 sub/sub/sub/file sub2/file; do
if echo $p | grep /; then
mkdir -p `dirname $p`
mkdir -p $(dirname $p)
fi &&
: >$p &&
git add $p &&

View file

@ -156,11 +156,11 @@ test_expect_success "Michael Cassar's test case" '
echo b > partA/outline.txt &&
echo c > papers/unsorted/_another &&
git add papers partA &&
T1=`git write-tree` &&
T1=$(git write-tree) &&
git mv papers/unsorted/Thesis.pdf papers/all-papers/moo-blah.pdf &&
T=`git write-tree` &&
T=$(git write-tree) &&
git ls-tree -r $T | verbose grep partA/outline.txt
'

View file

@ -387,7 +387,7 @@ test_expect_success 'setup submodule' '
git branch original HEAD
'
orig_head=`git show-ref --hash --head HEAD`
orig_head=$(git show-ref --hash --head HEAD)
test_expect_success 'rewrite submodule with another content' '
git filter-branch --tree-filter "test -d submod && {
@ -396,7 +396,7 @@ test_expect_success 'rewrite submodule with another content' '
mkdir submod &&
: > submod/file
} || :" HEAD &&
test $orig_head != `git show-ref --hash --head HEAD`
test $orig_head != $(git show-ref --hash --head HEAD)
'
test_expect_success 'replace submodule revision' '
@ -405,7 +405,7 @@ test_expect_success 'replace submodule revision' '
"if git ls-files --error-unmatch -- submod > /dev/null 2>&1
then git update-index --cacheinfo 160000 0123456789012345678901234567890123456789 submod
fi" HEAD &&
test $orig_head != `git show-ref --hash --head HEAD`
test $orig_head != $(git show-ref --hash --head HEAD)
'
test_expect_success 'filter commit message without trailing newline' '

View file

@ -23,8 +23,8 @@ test_expect_success 'listing all tags in an empty tree should succeed' '
'
test_expect_success 'listing all tags in an empty tree should output nothing' '
test `git tag -l | wc -l` -eq 0 &&
test `git tag | wc -l` -eq 0
test $(git tag -l | wc -l) -eq 0 &&
test $(git tag | wc -l) -eq 0
'
test_expect_success 'looking for a tag in an empty tree should fail' \
@ -72,8 +72,8 @@ test_expect_success 'listing all tags if one exists should succeed' '
'
test_expect_success 'listing all tags if one exists should output that tag' '
test `git tag -l` = mytag &&
test `git tag` = mytag
test $(git tag -l) = mytag &&
test $(git tag) = mytag
'
# pattern matching:
@ -83,7 +83,7 @@ test_expect_success 'listing a tag using a matching pattern should succeed' \
test_expect_success \
'listing a tag using a matching pattern should output that tag' \
'test `git tag -l mytag` = mytag'
'test $(git tag -l mytag) = mytag'
# todo: git tag -l now returns always zero, when fixed, change this test
test_expect_success \
@ -92,7 +92,7 @@ test_expect_success \
test_expect_success \
'listing tags using a non-matching pattern should output nothing' \
'test `git tag -l xxx | wc -l` -eq 0'
'test $(git tag -l xxx | wc -l) -eq 0'
# special cases for creating tags:
@ -102,13 +102,13 @@ test_expect_success \
test_expect_success \
'trying to create a tag with a non-valid name should fail' '
test `git tag -l | wc -l` -eq 1 &&
test $(git tag -l | wc -l) -eq 1 &&
test_must_fail git tag "" &&
test_must_fail git tag .othertag &&
test_must_fail git tag "other tag" &&
test_must_fail git tag "othertag^" &&
test_must_fail git tag "other~tag" &&
test `git tag -l | wc -l` -eq 1
test $(git tag -l | wc -l) -eq 1
'
test_expect_success 'creating a tag using HEAD directly should succeed' '

View file

@ -424,7 +424,7 @@ test_expect_success TTY 'command-specific pager works for external commands' '
echo "foo:initial" >expect &&
>actual &&
test_config pager.external "sed s/^/foo:/ >actual" &&
test_terminal git --exec-path="`pwd`" external log --format=%s -1 &&
test_terminal git --exec-path="$(pwd)" external log --format=%s -1 &&
test_cmp expect actual
'

View file

@ -63,7 +63,7 @@ test_expect_success '"mixed" reset is not allowed in bare' '
test_expect_success '"soft" reset is allowed in bare' '
git reset --soft HEAD^ &&
test "`git show --pretty=format:%s | head -n 1`" = "one"
test "$(git show --pretty=format:%s | head -n 1)" = "one"
'
test_done

View file

@ -14,8 +14,8 @@ submodule and "git submodule update --rebase/--merge" does not detach the HEAD.
compare_head()
{
sha_master=`git rev-list --max-count=1 master`
sha_head=`git rev-list --max-count=1 HEAD`
sha_master=$(git rev-list --max-count=1 master)
sha_head=$(git rev-list --max-count=1 HEAD)
test "$sha_master" = "$sha_head"
}

View file

@ -6,7 +6,7 @@
test_description='test clone --reference'
. ./test-lib.sh
base_dir=`pwd`
base_dir=$(pwd)
U=$base_dir/UPLOAD_LOG

View file

@ -179,7 +179,7 @@ EOF
chmod +x "$HOOK"
commit_msg_is () {
test "`git log --pretty=format:%s%b -1`" = "$1"
test "$(git log --pretty=format:%s%b -1)" = "$1"
}
test_expect_success 'hook edits commit message' '

View file

@ -53,7 +53,7 @@ test_expect_success 'with hook (-m)' '
echo "more" >> file &&
git add file &&
git commit -m "more" &&
test "`git log -1 --pretty=format:%s`" = "message (no editor)"
test "$(git log -1 --pretty=format:%s)" = "message (no editor)"
'
@ -62,7 +62,7 @@ test_expect_success 'with hook (-m editor)' '
echo "more" >> file &&
git add file &&
GIT_EDITOR="\"\$FAKE_EDITOR\"" git commit -e -m "more more" &&
test "`git log -1 --pretty=format:%s`" = message
test "$(git log -1 --pretty=format:%s)" = message
'
@ -71,7 +71,7 @@ test_expect_success 'with hook (-t)' '
echo "more" >> file &&
git add file &&
git commit -t "$(git rev-parse --git-dir)/template" &&
test "`git log -1 --pretty=format:%s`" = template
test "$(git log -1 --pretty=format:%s)" = template
'
@ -80,7 +80,7 @@ test_expect_success 'with hook (-F)' '
echo "more" >> file &&
git add file &&
(echo more | git commit -F -) &&
test "`git log -1 --pretty=format:%s`" = "message (no editor)"
test "$(git log -1 --pretty=format:%s)" = "message (no editor)"
'
@ -89,17 +89,17 @@ test_expect_success 'with hook (-F editor)' '
echo "more" >> file &&
git add file &&
(echo more more | GIT_EDITOR="\"\$FAKE_EDITOR\"" git commit -e -F -) &&
test "`git log -1 --pretty=format:%s`" = message
test "$(git log -1 --pretty=format:%s)" = message
'
test_expect_success 'with hook (-C)' '
head=`git rev-parse HEAD` &&
head=$(git rev-parse HEAD) &&
echo "more" >> file &&
git add file &&
git commit -C $head &&
test "`git log -1 --pretty=format:%s`" = "$head (no editor)"
test "$(git log -1 --pretty=format:%s)" = "$head (no editor)"
'
@ -108,27 +108,27 @@ test_expect_success 'with hook (editor)' '
echo "more more" >> file &&
git add file &&
GIT_EDITOR="\"\$FAKE_EDITOR\"" git commit &&
test "`git log -1 --pretty=format:%s`" = default
test "$(git log -1 --pretty=format:%s)" = default
'
test_expect_success 'with hook (--amend)' '
head=`git rev-parse HEAD` &&
head=$(git rev-parse HEAD) &&
echo "more" >> file &&
git add file &&
GIT_EDITOR="\"\$FAKE_EDITOR\"" git commit --amend &&
test "`git log -1 --pretty=format:%s`" = "$head"
test "$(git log -1 --pretty=format:%s)" = "$head"
'
test_expect_success 'with hook (-c)' '
head=`git rev-parse HEAD` &&
head=$(git rev-parse HEAD) &&
echo "more" >> file &&
git add file &&
GIT_EDITOR="\"\$FAKE_EDITOR\"" git commit -c $head &&
test "`git log -1 --pretty=format:%s`" = "$head"
test "$(git log -1 --pretty=format:%s)" = "$head"
'
@ -141,7 +141,7 @@ test_expect_success 'with hook (merge)' '
git commit -m other &&
git checkout - &&
git merge --no-ff other &&
test "`git log -1 --pretty=format:%s`" = "merge (no editor)"
test "$(git log -1 --pretty=format:%s)" = "merge (no editor)"
'
test_expect_success 'with hook and editor (merge)' '
@ -153,7 +153,7 @@ test_expect_success 'with hook and editor (merge)' '
git commit -m other &&
git checkout - &&
env GIT_EDITOR="\"\$FAKE_EDITOR\"" git merge --no-ff -e other &&
test "`git log -1 --pretty=format:%s`" = "merge"
test "$(git log -1 --pretty=format:%s)" = "merge"
'
cat > "$HOOK" <<'EOF'
@ -164,7 +164,7 @@ EOF
test_expect_success 'with failing hook' '
test_when_finished "git checkout -f master" &&
head=`git rev-parse HEAD` &&
head=$(git rev-parse HEAD) &&
echo "more" >> file &&
git add file &&
test_must_fail env GIT_EDITOR="\"\$FAKE_EDITOR\"" git commit -c $head
@ -174,7 +174,7 @@ test_expect_success 'with failing hook' '
test_expect_success 'with failing hook (--no-verify)' '
test_when_finished "git checkout -f master" &&
head=`git rev-parse HEAD` &&
head=$(git rev-parse HEAD) &&
echo "more" >> file &&
git add file &&
test_must_fail env GIT_EDITOR="\"\$FAKE_EDITOR\"" git commit --no-verify -c $head

View file

@ -19,7 +19,7 @@ test_expect_success 'setup' '
git add c$i.c &&
git commit -m c$i &&
git tag c$i &&
i=`expr $i + 1` || return 1
i=$(expr $i + 1) || return 1
done
'
@ -30,7 +30,7 @@ test_expect_success 'merge c1 with c2, c3, c4, ... c29' '
while test $i -le 30
do
refs="$refs c$i"
i=`expr $i + 1`
i=$(expr $i + 1)
done &&
git merge $refs &&
test "$(git rev-parse c1)" != "$(git rev-parse HEAD)" &&
@ -38,14 +38,14 @@ test_expect_success 'merge c1 with c2, c3, c4, ... c29' '
while test $i -le 30
do
test "$(git rev-parse c$i)" = "$(git rev-parse HEAD^$i)" &&
i=`expr $i + 1` || return 1
i=$(expr $i + 1) || return 1
done &&
git diff --exit-code &&
i=1 &&
while test $i -le 30
do
test -f c$i.c &&
i=`expr $i + 1` || return 1
i=$(expr $i + 1) || return 1
done
'

View file

@ -69,7 +69,7 @@ test_expect_success 'writing bitmaps via config can duplicate .keep objects' '
test_expect_success 'loose objects in alternate ODB are not repacked' '
mkdir alt_objects &&
echo `pwd`/alt_objects > .git/objects/info/alternates &&
echo $(pwd)/alt_objects > .git/objects/info/alternates &&
echo content3 > file3 &&
objsha1=$(GIT_OBJECT_DIRECTORY=alt_objects git hash-object -w file3) &&
git add file3 &&
@ -168,7 +168,7 @@ test_expect_success 'packed unreachable obs in alternate ODB are not loosened' '
'
test_expect_success 'local packed unreachable obs that exist in alternate ODB are not loosened' '
echo `pwd`/alt_objects > .git/objects/info/alternates &&
echo $(pwd)/alt_objects > .git/objects/info/alternates &&
echo "$csha1" | git pack-objects --non-empty --all --reflog pack &&
rm -f .git/objects/pack/* &&
mv pack-* .git/objects/pack/ &&

View file

@ -153,7 +153,7 @@ test_expect_success 'blame path that used to be a directory' '
'
test_expect_success 'blame to a commit with no author name' '
TREE=`git rev-parse HEAD:` &&
TREE=$(git rev-parse HEAD:) &&
cat >badcommit <<EOF &&
tree $TREE
author <noname> 1234567890 +0000
@ -161,7 +161,7 @@ committer David Reiss <dreiss@facebook.com> 1234567890 +0000
some message
EOF
COMMIT=`git hash-object -t commit -w badcommit` &&
COMMIT=$(git hash-object -t commit -w badcommit) &&
git --no-pager blame $COMMIT -- uno >/dev/null
'

View file

@ -36,7 +36,7 @@ clean_fake_sendmail () {
}
test_expect_success $PREREQ 'Extract patches' '
patches=`git format-patch -s --cc="One <one@example.com>" --cc=two@example.com -n HEAD^1`
patches=$(git format-patch -s --cc="One <one@example.com>" --cc=two@example.com -n HEAD^1)
'
# Test no confirm early to ensure remaining tests will not hang
@ -1151,7 +1151,7 @@ test_expect_success $PREREQ '--no-bcc overrides sendemail.bcc' '
'
test_expect_success $PREREQ 'patches To headers are used by default' '
patch=`git format-patch -1 --to="bodies@example.com"` &&
patch=$(git format-patch -1 --to="bodies@example.com") &&
test_when_finished "rm $patch" &&
git send-email \
--dry-run \
@ -1162,7 +1162,7 @@ test_expect_success $PREREQ 'patches To headers are used by default' '
'
test_expect_success $PREREQ 'patches To headers are appended to' '
patch=`git format-patch -1 --to="bodies@example.com"` &&
patch=$(git format-patch -1 --to="bodies@example.com") &&
test_when_finished "rm $patch" &&
git send-email \
--dry-run \
@ -1175,8 +1175,8 @@ test_expect_success $PREREQ 'patches To headers are appended to' '
'
test_expect_success $PREREQ 'To headers from files reset each patch' '
patch1=`git format-patch -1 --to="bodies@example.com"` &&
patch2=`git format-patch -1 --to="other@example.com" HEAD~` &&
patch1=$(git format-patch -1 --to="bodies@example.com") &&
patch2=$(git format-patch -1 --to="other@example.com" HEAD~) &&
test_when_finished "rm $patch1 && rm $patch2" &&
git send-email \
--dry-run \
@ -1488,7 +1488,7 @@ test_cover_addresses () {
clean_fake_sendmail &&
rm -fr outdir &&
git format-patch --cover-letter -2 -o outdir &&
cover=`echo outdir/0000-*.patch` &&
cover=$(echo outdir/0000-*.patch) &&
mv $cover cover-to-edit.patch &&
perl -pe "s/^From:/$header: extra\@address.com\nFrom:/" cover-to-edit.patch >"$cover" &&
git send-email \

View file

@ -265,18 +265,18 @@ test_expect_success 'able to dcommit to a subdirectory' "
git update-index --add d &&
git commit -m '/bar/d should be in the log' &&
git svn dcommit -i bar &&
test -z \"\`git diff refs/heads/my-bar refs/remotes/bar\`\" &&
test -z \"\$(git diff refs/heads/my-bar refs/remotes/bar)\" &&
mkdir newdir &&
echo new > newdir/dir &&
git update-index --add newdir/dir &&
git commit -m 'add a new directory' &&
git svn dcommit -i bar &&
test -z \"\`git diff refs/heads/my-bar refs/remotes/bar\`\" &&
test -z \"\$(git diff refs/heads/my-bar refs/remotes/bar)\" &&
echo foo >> newdir/dir &&
git update-index newdir/dir &&
git commit -m 'modify a file in new directory' &&
git svn dcommit -i bar &&
test -z \"\`git diff refs/heads/my-bar refs/remotes/bar\`\"
test -z \"\$(git diff refs/heads/my-bar refs/remotes/bar)\"
"
test_expect_success 'dcommit should not fail with a touched file' '
@ -295,7 +295,7 @@ test_expect_success 'able to set-tree to a subdirectory' "
git update-index d &&
git commit -m 'update /bar/d' &&
git svn set-tree -i bar HEAD &&
test -z \"\`git diff refs/heads/my-bar refs/remotes/bar\`\"
test -z \"\$(git diff refs/heads/my-bar refs/remotes/bar)\"
"
test_expect_success 'git-svn works in a bare repository' '

View file

@ -26,27 +26,27 @@ cd import
EOF
printf "Hello\r\nWorld\r\n" > crlf
a_crlf=`git hash-object -w crlf`
a_crlf=$(git hash-object -w crlf)
printf "Hello\rWorld\r" > cr
a_cr=`git hash-object -w cr`
a_cr=$(git hash-object -w cr)
printf "Hello\nWorld\n" > lf
a_lf=`git hash-object -w lf`
a_lf=$(git hash-object -w lf)
printf "Hello\r\nWorld" > ne_crlf
a_ne_crlf=`git hash-object -w ne_crlf`
a_ne_crlf=$(git hash-object -w ne_crlf)
printf "Hello\nWorld" > ne_lf
a_ne_lf=`git hash-object -w ne_lf`
a_ne_lf=$(git hash-object -w ne_lf)
printf "Hello\rWorld" > ne_cr
a_ne_cr=`git hash-object -w ne_cr`
a_ne_cr=$(git hash-object -w ne_cr)
touch empty
a_empty=`git hash-object -w empty`
a_empty=$(git hash-object -w empty)
printf "\n" > empty_lf
a_empty_lf=`git hash-object -w empty_lf`
a_empty_lf=$(git hash-object -w empty_lf)
printf "\r" > empty_cr
a_empty_cr=`git hash-object -w empty_cr`
a_empty_cr=$(git hash-object -w empty_cr)
printf "\r\n" > empty_crlf
a_empty_crlf=`git hash-object -w empty_crlf`
a_empty_crlf=$(git hash-object -w empty_crlf)
svn_cmd import --no-auto-props -m 'import for git svn' . "$svnrepo" >/dev/null
cd ..
@ -80,7 +80,7 @@ test_expect_success "$name" \
git pull . ${remotes_git_svn}'
expect='/* $Id$ */'
got="`sed -ne 2p kw.c`"
got="$(sed -ne 2p kw.c)"
test_expect_success 'raw $Id$ found in kw.c' "test '$expect' = '$got'"
test_expect_success "propset CR on crlf files" '
@ -107,8 +107,8 @@ done
cd test_wc
printf '$Id$\rHello\rWorld\r' > cr
printf '$Id$\rHello\rWorld' > ne_cr
a_cr=`printf '$Id$\r\nHello\r\nWorld\r\n' | git hash-object --stdin`
a_ne_cr=`printf '$Id$\r\nHello\r\nWorld' | git hash-object --stdin`
a_cr=$(printf '$Id$\r\nHello\r\nWorld\r\n' | git hash-object --stdin)
a_ne_cr=$(printf '$Id$\r\nHello\r\nWorld' | git hash-object --stdin)
test_expect_success 'Set CRLF on cr files' \
'svn_cmd propset svn:eol-style CRLF cr &&
svn_cmd propset svn:eol-style CRLF ne_cr &&
@ -119,8 +119,8 @@ cd ..
test_expect_success 'fetch and pull latest from svn' \
'git svn fetch && git pull . ${remotes_git_svn}'
b_cr="`git hash-object cr`"
b_ne_cr="`git hash-object ne_cr`"
b_cr="$(git hash-object cr)"
b_ne_cr="$(git hash-object ne_cr)"
test_expect_success 'CRLF + $Id$' "test '$a_cr' = '$b_cr'"
test_expect_success 'CRLF + $Id$ (no newline)' "test '$a_ne_cr' = '$b_ne_cr'"

View file

@ -31,12 +31,12 @@ test_expect_success 'initialize repo' '
test_expect_success 'init and fetch a moved directory' '
git svn init --minimize-url -i thunk "$svnrepo"/thunk &&
git svn fetch -i thunk &&
test "`git rev-parse --verify refs/remotes/thunk@2`" \
= "`git rev-parse --verify refs/remotes/thunk~1`" &&
test "`git cat-file blob refs/remotes/thunk:readme |\
sed -n -e "3p"`" = goodbye &&
test -z "`git config --get svn-remote.svn.fetch \
"^trunk:refs/remotes/thunk@2$"`"
test "$(git rev-parse --verify refs/remotes/thunk@2)" \
= "$(git rev-parse --verify refs/remotes/thunk~1)" &&
test "$(git cat-file blob refs/remotes/thunk:readme |\
sed -n -e "3p")" = goodbye &&
test -z "$(git config --get svn-remote.svn.fetch \
"^trunk:refs/remotes/thunk@2$")"
'
test_expect_success 'init and fetch from one svn-remote' '
@ -46,10 +46,10 @@ test_expect_success 'init and fetch from one svn-remote' '
git config --add svn-remote.svn.fetch \
thunk:refs/remotes/svn/thunk &&
git svn fetch -i svn/thunk &&
test "`git rev-parse --verify refs/remotes/svn/trunk`" \
= "`git rev-parse --verify refs/remotes/svn/thunk~1`" &&
test "`git cat-file blob refs/remotes/svn/thunk:readme |\
sed -n -e "3p"`" = goodbye
test "$(git rev-parse --verify refs/remotes/svn/trunk)" \
= "$(git rev-parse --verify refs/remotes/svn/thunk~1)" &&
test "$(git cat-file blob refs/remotes/svn/thunk:readme |\
sed -n -e "3p")" = goodbye
'
test_expect_success 'follow deleted parent' '
@ -61,9 +61,9 @@ test_expect_success 'follow deleted parent' '
junk:refs/remotes/svn/junk &&
git svn fetch -i svn/thunk &&
git svn fetch -i svn/junk &&
test -z "`git diff svn/junk svn/trunk`" &&
test "`git merge-base svn/junk svn/trunk`" \
= "`git rev-parse svn/trunk`"
test -z "$(git diff svn/junk svn/trunk)" &&
test "$(git merge-base svn/junk svn/trunk)" \
= "$(git rev-parse svn/trunk)"
'
test_expect_success 'follow larger parent' '
@ -80,10 +80,10 @@ test_expect_success 'follow larger parent' '
git rev-parse --verify refs/remotes/larger &&
git rev-parse --verify \
refs/remotes/larger-parent &&
test "`git merge-base \
test "$(git merge-base \
refs/remotes/larger-parent \
refs/remotes/larger`" = \
"`git rev-parse refs/remotes/larger`"
refs/remotes/larger)" = \
"$(git rev-parse refs/remotes/larger)"
'
test_expect_success 'follow higher-level parent' '
@ -106,8 +106,8 @@ test_expect_success 'follow deleted directory' '
svn_cmd rm -m "remove glob" "$svnrepo"/glob &&
git svn init --minimize-url -i glob "$svnrepo"/glob &&
git svn fetch -i glob &&
test "`git cat-file blob refs/remotes/glob:blob/bye`" = hi &&
test "`git ls-tree refs/remotes/glob | wc -l `" -eq 1
test "$(git cat-file blob refs/remotes/glob:blob/bye)" = hi &&
test "$(git ls-tree refs/remotes/glob | wc -l )" -eq 1
'
# ref: r9270 of the Subversion repository: (http://svn.collab.net/repos/svn)
@ -142,9 +142,9 @@ test_expect_success 'follow-parent avoids deleting relevant info' '
git svn init --minimize-url -i r9270-t \
"$svnrepo"/r9270/trunk/subversion/bindings/swig/perl/native/t &&
git svn fetch -i r9270-t &&
test `git rev-list r9270-t | wc -l` -eq 2 &&
test "`git ls-tree --name-only r9270-t~1`" = \
"`git ls-tree --name-only r9270-t`"
test $(git rev-list r9270-t | wc -l) -eq 2 &&
test "$(git ls-tree --name-only r9270-t~1)" = \
"$(git ls-tree --name-only r9270-t)"
'
test_expect_success "track initial change if it was only made to parent" '
@ -152,11 +152,11 @@ test_expect_success "track initial change if it was only made to parent" '
git svn init --minimize-url -i r9270-d \
"$svnrepo"/r9270/drunk/subversion/bindings/swig/perl/native/t &&
git svn fetch -i r9270-d &&
test `git rev-list r9270-d | wc -l` -eq 3 &&
test "`git ls-tree --name-only r9270-t`" = \
"`git ls-tree --name-only r9270-d`" &&
test "`git rev-parse r9270-t`" = \
"`git rev-parse r9270-d~1`"
test $(git rev-list r9270-d | wc -l) -eq 3 &&
test "$(git ls-tree --name-only r9270-t)" = \
"$(git ls-tree --name-only r9270-d)" &&
test "$(git rev-parse r9270-t)" = \
"$(git rev-parse r9270-d~1)"
'
test_expect_success "follow-parent is atomic" '
@ -193,19 +193,19 @@ test_expect_success "follow-parent is atomic" '
git svn fetch -i stunk &&
git svn init --minimize-url -i flunked "$svnrepo"/flunked &&
git svn fetch -i flunked &&
test "`git rev-parse --verify refs/remotes/flunk@18`" \
= "`git rev-parse --verify refs/remotes/stunk`" &&
test "`git rev-parse --verify refs/remotes/flunk~1`" \
= "`git rev-parse --verify refs/remotes/stunk`" &&
test "`git rev-parse --verify refs/remotes/flunked~1`" \
= "`git rev-parse --verify refs/remotes/stunk~1`"
test "$(git rev-parse --verify refs/remotes/flunk@18)" \
= "$(git rev-parse --verify refs/remotes/stunk)" &&
test "$(git rev-parse --verify refs/remotes/flunk~1)" \
= "$(git rev-parse --verify refs/remotes/stunk)" &&
test "$(git rev-parse --verify refs/remotes/flunked~1)" \
= "$(git rev-parse --verify refs/remotes/stunk~1)"
'
test_expect_success "track multi-parent paths" '
svn_cmd cp -m "resurrect /glob" "$svnrepo"/r9270 "$svnrepo"/glob &&
git svn multi-fetch &&
test `git cat-file commit refs/remotes/glob | \
grep "^parent " | wc -l` -eq 2
test $(git cat-file commit refs/remotes/glob | \
grep "^parent " | wc -l) -eq 2
'
test_expect_success "multi-fetch continues to work" "

View file

@ -18,8 +18,8 @@ test_expect_success 'initialize repo' '
git commit -a -m "another"
'
head=`git rev-parse --verify HEAD^0`
prev=`git rev-parse --verify HEAD^1`
head=$(git rev-parse --verify HEAD^0)
prev=$(git rev-parse --verify HEAD^1)
# the internals of the commit-diff command are the same as the regular
# commit, so only a basic test of functionality is needed since we've

View file

@ -24,10 +24,10 @@ test_expect_success 'setup old-looking metadata' '
git update-ref -d refs/${remotes_git_svn} refs/${remotes_git_svn}
'
head=`git rev-parse --verify refs/heads/git-svn-HEAD^0`
head=$(git rev-parse --verify refs/heads/git-svn-HEAD^0)
test_expect_success 'git-svn-HEAD is a real HEAD' "test -n '$head'"
svnrepo_escaped=`echo $svnrepo | sed 's/ /%20/'`
svnrepo_escaped=$(echo $svnrepo | sed 's/ /%20/')
test_expect_success 'initialize old-style (v0) git svn layout' '
mkdir -p "$GIT_DIR"/git-svn/info "$GIT_DIR"/svn/info &&
@ -38,7 +38,7 @@ test_expect_success 'initialize old-style (v0) git svn layout' '
git rev-parse --verify refs/${remotes_git_svn}^0 &&
git rev-parse --verify refs/remotes/svn^0 &&
test "$(git config --get svn-remote.svn.url)" = "$svnrepo_escaped" &&
test `git config --get svn-remote.svn.fetch` = \
test $(git config --get svn-remote.svn.fetch) = \
":refs/${remotes_git_svn}"
'
@ -46,10 +46,10 @@ test_expect_success 'initialize a multi-repository repo' '
git svn init "$svnrepo" -T trunk -t tags -b branches &&
git config --get-all svn-remote.svn.fetch > fetch.out &&
grep "^trunk:refs/remotes/origin/trunk$" fetch.out &&
test -n "`git config --get svn-remote.svn.branches \
"^branches/\*:refs/remotes/origin/\*$"`" &&
test -n "`git config --get svn-remote.svn.tags \
"^tags/\*:refs/remotes/origin/tags/\*$"`" &&
test -n "$(git config --get svn-remote.svn.branches \
"^branches/\*:refs/remotes/origin/\*$")" &&
test -n "$(git config --get svn-remote.svn.tags \
"^tags/\*:refs/remotes/origin/tags/\*$")" &&
git config --unset svn-remote.svn.branches \
"^branches/\*:refs/remotes/origin/\*$" &&
git config --unset svn-remote.svn.tags \
@ -75,28 +75,28 @@ test_expect_success 'multi-fetch works on partial urls + paths' "
for i in trunk a b tags/0.1 tags/0.2 tags/0.3; do
git rev-parse --verify refs/remotes/origin/\$i^0 >> refs.out || exit 1;
done &&
test -z \"\`sort < refs.out | uniq -d\`\" &&
test -z \"\$(sort < refs.out | uniq -d)\" &&
for i in trunk a b tags/0.1 tags/0.2 tags/0.3; do
for j in trunk a b tags/0.1 tags/0.2 tags/0.3; do
if test \$j != \$i; then continue; fi
test -z \"\`git diff refs/remotes/origin/\$i \
refs/remotes/origin/\$j\`\" ||exit 1; done; done
test -z \"\$(git diff refs/remotes/origin/\$i \
refs/remotes/origin/\$j)\" ||exit 1; done; done
"
test_expect_success 'migrate --minimize on old inited layout' '
git config --unset-all svn-remote.svn.fetch &&
git config --unset-all svn-remote.svn.url &&
rm -rf "$GIT_DIR"/svn &&
for i in `cat fetch.out`; do
path=`expr $i : "\([^:]*\):.*$"`
ref=`expr $i : "[^:]*:\(refs/remotes/.*\)$"`
for i in $(cat fetch.out); do
path=$(expr $i : "\([^:]*\):.*$")
ref=$(expr $i : "[^:]*:\(refs/remotes/.*\)$")
if test -z "$ref"; then continue; fi
if test -n "$path"; then path="/$path"; fi
( mkdir -p "$GIT_DIR"/svn/$ref/info/ &&
echo "$svnrepo"$path > "$GIT_DIR"/svn/$ref/info/url ) || exit 1;
done &&
git svn migrate --minimize &&
test -z "`git config -l | grep "^svn-remote\.git-svn\."`" &&
test -z "$(git config -l | grep "^svn-remote\.git-svn\.")" &&
git config --get-all svn-remote.svn.fetch > fetch.out &&
grep "^trunk:refs/remotes/origin/trunk$" fetch.out &&
grep "^branches/a:refs/remotes/origin/a$" fetch.out &&

View file

@ -50,10 +50,10 @@ test_expect_success 'test refspec globbing' '
git log --pretty=oneline refs/remotes/tags/end | \
sed -e "s/^.\{41\}//" > output.end &&
test_cmp expect.end output.end &&
test "`git rev-parse refs/remotes/tags/end~1`" = \
"`git rev-parse refs/remotes/branches/start`" &&
test "`git rev-parse refs/remotes/branches/start~2`" = \
"`git rev-parse refs/remotes/trunk`" &&
test "$(git rev-parse refs/remotes/tags/end~1)" = \
"$(git rev-parse refs/remotes/branches/start)" &&
test "$(git rev-parse refs/remotes/branches/start~2)" = \
"$(git rev-parse refs/remotes/trunk)" &&
test_must_fail git rev-parse refs/remotes/tags/end@3
'
@ -75,12 +75,12 @@ test_expect_success 'test left-hand-side only globbing' '
svn_cmd commit -m "try to try"
) &&
git svn fetch two &&
test `git rev-list refs/remotes/two/tags/end | wc -l` -eq 6 &&
test `git rev-list refs/remotes/two/branches/start | wc -l` -eq 3 &&
test `git rev-parse refs/remotes/two/branches/start~2` = \
`git rev-parse refs/remotes/two/trunk` &&
test `git rev-parse refs/remotes/two/tags/end~3` = \
`git rev-parse refs/remotes/two/branches/start` &&
test $(git rev-list refs/remotes/two/tags/end | wc -l) -eq 6 &&
test $(git rev-list refs/remotes/two/branches/start | wc -l) -eq 3 &&
test $(git rev-parse refs/remotes/two/branches/start~2) = \
$(git rev-parse refs/remotes/two/trunk) &&
test $(git rev-parse refs/remotes/two/tags/end~3) = \
$(git rev-parse refs/remotes/two/branches/start) &&
git log --pretty=oneline refs/remotes/two/tags/end | \
sed -e "s/^.\{41\}//" > output.two &&
test_cmp expect.two output.two

View file

@ -50,10 +50,10 @@ test_expect_success 'test refspec globbing' '
git log --pretty=oneline refs/remotes/tags/end | \
sed -e "s/^.\{41\}//" > output.end &&
test_cmp expect.end output.end &&
test "`git rev-parse refs/remotes/tags/end~1`" = \
"`git rev-parse refs/remotes/branches/v1/start`" &&
test "`git rev-parse refs/remotes/branches/v1/start~2`" = \
"`git rev-parse refs/remotes/trunk`" &&
test "$(git rev-parse refs/remotes/tags/end~1)" = \
"$(git rev-parse refs/remotes/branches/v1/start)" &&
test "$(git rev-parse refs/remotes/branches/v1/start~2)" = \
"$(git rev-parse refs/remotes/trunk)" &&
test_must_fail git rev-parse refs/remotes/tags/end@3
'
@ -75,12 +75,12 @@ test_expect_success 'test left-hand-side only globbing' '
svn_cmd commit -m "try to try"
) &&
git svn fetch two &&
test `git rev-list refs/remotes/two/tags/end | wc -l` -eq 6 &&
test `git rev-list refs/remotes/two/branches/v1/start | wc -l` -eq 3 &&
test `git rev-parse refs/remotes/two/branches/v1/start~2` = \
`git rev-parse refs/remotes/two/trunk` &&
test `git rev-parse refs/remotes/two/tags/end~3` = \
`git rev-parse refs/remotes/two/branches/v1/start` &&
test $(git rev-list refs/remotes/two/tags/end | wc -l) -eq 6 &&
test $(git rev-list refs/remotes/two/branches/v1/start | wc -l) -eq 3 &&
test $(git rev-parse refs/remotes/two/branches/v1/start~2) = \
$(git rev-parse refs/remotes/two/trunk) &&
test $(git rev-parse refs/remotes/two/tags/end~3) = \
$(git rev-parse refs/remotes/two/branches/v1/start) &&
git log --pretty=oneline refs/remotes/two/tags/end | \
sed -e "s/^.\{41\}//" > output.two &&
test_cmp expect.two output.two
@ -124,12 +124,12 @@ test_expect_success 'test another branch' '
git config --add svn-remote.four.tags \
"tags/*:refs/remotes/four/tags/*" &&
git svn fetch four &&
test `git rev-list refs/remotes/four/tags/next | wc -l` -eq 5 &&
test `git rev-list refs/remotes/four/branches/v2/start | wc -l` -eq 3 &&
test `git rev-parse refs/remotes/four/branches/v2/start~2` = \
`git rev-parse refs/remotes/four/trunk` &&
test `git rev-parse refs/remotes/four/tags/next~2` = \
`git rev-parse refs/remotes/four/branches/v2/start` &&
test $(git rev-list refs/remotes/four/tags/next | wc -l) -eq 5 &&
test $(git rev-list refs/remotes/four/branches/v2/start | wc -l) -eq 3 &&
test $(git rev-parse refs/remotes/four/branches/v2/start~2) = \
$(git rev-parse refs/remotes/four/trunk) &&
test $(git rev-parse refs/remotes/four/tags/next~2) = \
$(git rev-parse refs/remotes/four/branches/v2/start) &&
git log --pretty=oneline refs/remotes/four/tags/next | \
sed -e "s/^.\{41\}//" > output.four &&
test_cmp expect.four output.four

View file

@ -51,7 +51,7 @@ test_expect_success 'verify metadata for /dir' "
test_expect_success 'find commit based on SVN revision number' "
git svn find-rev r12 |
grep `git rev-parse HEAD`
grep $(git rev-parse HEAD)
"
test_expect_success 'empty rebase' "

View file

@ -68,8 +68,8 @@ test_expect_success 'setup git mirror and merge' '
test_debug 'gitk --all & sleep 1'
test_expect_success 'verify pre-merge ancestry' "
test x\`git rev-parse --verify refs/heads/svn^2\` = \
x\`git rev-parse --verify refs/heads/merge\` &&
test x\$(git rev-parse --verify refs/heads/svn^2) = \
x\$(git rev-parse --verify refs/heads/merge) &&
git cat-file commit refs/heads/svn^ | grep '^friend$'
"
@ -80,10 +80,10 @@ test_expect_success 'git svn dcommit merges' "
test_debug 'gitk --all & sleep 1'
test_expect_success 'verify post-merge ancestry' "
test x\`git rev-parse --verify refs/heads/svn\` = \
x\`git rev-parse --verify refs/remotes/origin/trunk \` &&
test x\`git rev-parse --verify refs/heads/svn^2\` = \
x\`git rev-parse --verify refs/heads/merge\` &&
test x\$(git rev-parse --verify refs/heads/svn) = \
x\$(git rev-parse --verify refs/remotes/origin/trunk) &&
test x\$(git rev-parse --verify refs/heads/svn^2) = \
x\$(git rev-parse --verify refs/heads/merge) &&
git cat-file commit refs/heads/svn^ | grep '^friend$'
"

View file

@ -35,7 +35,7 @@ test_expect_success 'setup svnrepo' '
# SVN 1.7 will truncate "not-a%40{0]" to just "not-a".
# Look at what SVN wound up naming the branch and use that.
# Be sure to escape the @ if it shows up.
non_reflog=`svn_cmd ls "$svnrepo/pr ject/branches" | grep not-a | sed 's/\///' | sed 's/@/%40/'`
non_reflog=$(svn_cmd ls "$svnrepo/pr ject/branches" | grep not-a | sed 's/\///' | sed 's/@/%40/')
test_expect_success 'test clone with funky branch names' '
git svn clone -s "$svnrepo/pr ject" project &&

View file

@ -8,7 +8,7 @@ test_description='git svn info'
# Tested with: svn, version 1.4.4 (r25188)
# Tested with: svn, version 1.6.[12345689]
v=`svn_cmd --version | sed -n -e 's/^svn, version \(1\.[0-9]*\.[0-9]*\).*$/\1/p'`
v=$(svn_cmd --version | sed -n -e 's/^svn, version \(1\.[0-9]*\.[0-9]*\).*$/\1/p')
case $v in
1.[456].*)
;;

View file

@ -7,7 +7,7 @@ test_description='git svn honors i18n.commitEncoding in config'
. ./lib-git-svn.sh
compare_git_head_with () {
nr=`wc -l < "$1"`
nr=$(wc -l < "$1")
a=7
b=$(($a + $nr - 1))
git cat-file commit HEAD | sed -ne "$a,${b}p" >current &&
@ -29,7 +29,7 @@ fi
compare_svn_head_with () {
# extract just the log message and strip out committer info.
# don't use --limit here since svn 1.1.x doesn't have it,
LC_ALL="$a_utf8_locale" svn log `git svn info --url` | perl -w -e '
LC_ALL="$a_utf8_locale" svn log $(git svn info --url) | perl -w -e '
use bytes;
$/ = ("-"x72) . "\n";
my @x = <STDIN>;

View file

@ -26,7 +26,7 @@ test_expect_success 'start import with incomplete authors file' '
test_expect_success 'imported 2 revisions successfully' '
(
cd x
test "`git rev-list refs/remotes/git-svn | wc -l`" -eq 2 &&
test "$(git rev-list refs/remotes/git-svn | wc -l)" -eq 2 &&
git rev-list -1 --pretty=raw refs/remotes/git-svn | \
grep "^author BBBBBBB BBBBBBB <bb@example\.com> " &&
git rev-list -1 --pretty=raw refs/remotes/git-svn~1 | \
@ -43,7 +43,7 @@ test_expect_success 'continues to import once authors have been added' '
(
cd x
git svn fetch --authors-file=../svn-authors &&
test "`git rev-list refs/remotes/git-svn | wc -l`" -eq 4 &&
test "$(git rev-list refs/remotes/git-svn | wc -l)" -eq 4 &&
git rev-list -1 --pretty=raw refs/remotes/git-svn | \
grep "^author DDDDDDD DDDDDDD <dd@example\.com> " &&
git rev-list -1 --pretty=raw refs/remotes/git-svn~1 | \
@ -73,8 +73,8 @@ tmp_config_get () {
test_expect_success 'failure happened without negative side effects' '
(
cd aa-work &&
test 6 -eq "`tmp_config_get svn-remote.svn.branches-maxRev`" &&
test 6 -eq "`tmp_config_get svn-remote.svn.tags-maxRev`"
test 6 -eq "$(tmp_config_get svn-remote.svn.branches-maxRev)" &&
test 6 -eq "$(tmp_config_get svn-remote.svn.tags-maxRev)"
)
'
@ -86,8 +86,8 @@ test_expect_success 'fetch continues after authors-file is fixed' '
(
cd aa-work &&
git svn fetch --authors-file=../svn-authors &&
test 8 -eq "`tmp_config_get svn-remote.svn.branches-maxRev`" &&
test 8 -eq "`tmp_config_get svn-remote.svn.tags-maxRev`"
test 8 -eq "$(tmp_config_get svn-remote.svn.branches-maxRev)" &&
test 8 -eq "$(tmp_config_get svn-remote.svn.tags-maxRev)"
)
'

View file

@ -87,7 +87,7 @@ test_expect_success 'clone using git svn' 'git svn clone -r1 "$svnrepo" x'
test_expect_success SYMLINKS '"bar" is a symlink that points to "asdf"' '
test -L x/bar &&
(cd x && test xasdf = x"`git cat-file blob HEAD:bar`")
(cd x && test xasdf = x"$(git cat-file blob HEAD:bar)")
'
test_expect_success 'get "bar" => symlink fix from svn' '
@ -96,7 +96,7 @@ test_expect_success 'get "bar" => symlink fix from svn' '
test_expect_success SYMLINKS '"bar" remains a proper symlink' '
test -L x/bar &&
(cd x && test xdoink = x"`git cat-file blob HEAD:bar`")
(cd x && test xdoink = x"$(git cat-file blob HEAD:bar)")
'
test_done

View file

@ -16,15 +16,15 @@ test_expect_success 'initialize repo' '
'
test_expect_success '(supposedly) non-conflicting change from SVN' '
test x"`sed -n -e 58p < file`" = x58 &&
test x"`sed -n -e 61p < file`" = x61 &&
test x"$(sed -n -e 58p < file)" = x58 &&
test x"$(sed -n -e 61p < file)" = x61 &&
svn_cmd co "$svnrepo" tmp &&
(cd tmp &&
perl -i.bak -p -e "s/^58$/5588/" file &&
perl -i.bak -p -e "s/^61$/6611/" file &&
poke file &&
test x"`sed -n -e 58p < file`" = x5588 &&
test x"`sed -n -e 61p < file`" = x6611 &&
test x"$(sed -n -e 58p < file)" = x5588 &&
test x"$(sed -n -e 61p < file)" = x6611 &&
svn_cmd commit -m "58 => 5588, 61 => 6611"
)
'
@ -38,20 +38,20 @@ test_expect_success 'some unrelated changes to git' "
"
test_expect_success 'change file but in unrelated area' "
test x\"\`sed -n -e 4p < file\`\" = x4 &&
test x\"\`sed -n -e 7p < file\`\" = x7 &&
test x\"\$(sed -n -e 4p < file)\" = x4 &&
test x\"\$(sed -n -e 7p < file)\" = x7 &&
perl -i.bak -p -e 's/^4\$/4444/' file &&
perl -i.bak -p -e 's/^7\$/7777/' file &&
test x\"\`sed -n -e 4p < file\`\" = x4444 &&
test x\"\`sed -n -e 7p < file\`\" = x7777 &&
test x\"\$(sed -n -e 4p < file)\" = x4444 &&
test x\"\$(sed -n -e 7p < file)\" = x7777 &&
git commit -m '4 => 4444, 7 => 7777' file &&
git svn dcommit &&
svn_cmd up tmp &&
cd tmp &&
test x\"\`sed -n -e 4p < file\`\" = x4444 &&
test x\"\`sed -n -e 7p < file\`\" = x7777 &&
test x\"\`sed -n -e 58p < file\`\" = x5588 &&
test x\"\`sed -n -e 61p < file\`\" = x6611
test x\"\$(sed -n -e 4p < file)\" = x4444 &&
test x\"\$(sed -n -e 7p < file)\" = x7777 &&
test x\"\$(sed -n -e 58p < file)\" = x5588 &&
test x\"\$(sed -n -e 61p < file)\" = x6611
"
test_expect_success 'attempt to dcommit with a dirty index' '

View file

@ -37,7 +37,7 @@ test_expect_success 'import authors with prog and file' '
test_expect_success 'imported 6 revisions successfully' '
(
cd x
test "`git rev-list refs/remotes/git-svn | wc -l`" -eq 6
test "$(git rev-list refs/remotes/git-svn | wc -l)" -eq 6
)
'

View file

@ -17,8 +17,8 @@ test_expect_success 'git svn clone --stdlayout sets up trunk as master' '
git svn clone -s "$svnrepo" g &&
(
cd g &&
test x`git rev-parse --verify refs/remotes/origin/trunk^0` = \
x`git rev-parse --verify refs/heads/master^0`
test x$(git rev-parse --verify refs/remotes/origin/trunk^0) = \
x$(git rev-parse --verify refs/heads/master^0)
)
'

View file

@ -19,7 +19,7 @@ test_expect_success 'load svk depot' "
uuid=b48289b2-9c08-4d72-af37-0358a40b9c15
test_expect_success 'svk merges were represented coming in' "
[ `git cat-file commit HEAD | grep parent | wc -l` -eq 2 ]
[ $(git cat-file commit HEAD | grep parent | wc -l) -eq 2 ]
"
test_done

View file

@ -171,10 +171,10 @@ test_expect_success 'A: verify tag/series-A-blob' '
test_expect_success 'A: verify marks output' '
cat >expect <<-EOF &&
:2 `git rev-parse --verify master:file2`
:3 `git rev-parse --verify master:file3`
:4 `git rev-parse --verify master:file4`
:5 `git rev-parse --verify master^0`
:2 $(git rev-parse --verify master:file2)
:3 $(git rev-parse --verify master:file3)
:4 $(git rev-parse --verify master:file4)
:5 $(git rev-parse --verify master^0)
EOF
test_cmp expect marks.out
'
@ -264,8 +264,8 @@ test_expect_success 'A: verify diff' '
EOF
git diff-tree -M -r master verify--import-marks >actual &&
compare_diff_raw expect actual &&
test `git rev-parse --verify master:file2` \
= `git rev-parse --verify verify--import-marks:copy-of-file2`
test $(git rev-parse --verify master:file2) \
= $(git rev-parse --verify verify--import-marks:copy-of-file2)
'
test_expect_success 'A: export marks with large values' '
@ -364,7 +364,7 @@ test_expect_success 'B: accept branch name "TEMP_TAG"' '
git prune" &&
git fast-import <input &&
test -f .git/TEMP_TAG &&
test `git rev-parse master` = `git rev-parse TEMP_TAG^`
test $(git rev-parse master) = $(git rev-parse TEMP_TAG^)
'
test_expect_success 'B: accept empty committer' '
@ -473,8 +473,8 @@ test_expect_success 'B: fail on invalid committer (5)' '
###
test_expect_success 'C: incremental import create pack from stdin' '
newf=`echo hi newf | git hash-object -w --stdin` &&
oldf=`git rev-parse --verify master:file2` &&
newf=$(echo hi newf | git hash-object -w --stdin) &&
oldf=$(git rev-parse --verify master:file2) &&
test_tick &&
cat >input <<-INPUT_END &&
commit refs/heads/branch
@ -499,13 +499,13 @@ test_expect_success 'C: verify pack' '
'
test_expect_success 'C: validate reuse existing blob' '
test $newf = `git rev-parse --verify branch:file2/newf` &&
test $oldf = `git rev-parse --verify branch:file2/oldf`
test $newf = $(git rev-parse --verify branch:file2/newf) &&
test $oldf = $(git rev-parse --verify branch:file2/oldf)
'
test_expect_success 'C: verify commit' '
cat >expect <<-EOF &&
parent `git rev-parse --verify master^0`
parent $(git rev-parse --verify master^0)
author $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
@ -624,7 +624,7 @@ test_expect_success 'E: verify commit' '
###
test_expect_success 'F: non-fast-forward update skips' '
old_branch=`git rev-parse --verify branch^0` &&
old_branch=$(git rev-parse --verify branch^0) &&
test_tick &&
cat >input <<-INPUT_END &&
commit refs/heads/branch
@ -642,7 +642,7 @@ test_expect_success 'F: non-fast-forward update skips' '
test_must_fail git fast-import <input &&
# branch must remain unaffected
test $old_branch = `git rev-parse --verify branch^0`
test $old_branch = $(git rev-parse --verify branch^0)
'
test_expect_success 'F: verify pack' '
@ -651,8 +651,8 @@ test_expect_success 'F: verify pack' '
test_expect_success 'F: verify other commit' '
cat >expect <<-EOF &&
tree `git rev-parse branch~1^{tree}`
parent `git rev-parse branch~1`
tree $(git rev-parse branch~1^{tree})
parent $(git rev-parse branch~1)
author $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
@ -667,7 +667,7 @@ test_expect_success 'F: verify other commit' '
###
test_expect_success 'G: non-fast-forward update forced' '
old_branch=`git rev-parse --verify branch^0` &&
old_branch=$(git rev-parse --verify branch^0) &&
test_tick &&
cat >input <<-INPUT_END &&
commit refs/heads/branch
@ -687,8 +687,8 @@ test_expect_success 'G: verify pack' '
'
test_expect_success 'G: branch changed, but logged' '
test $old_branch != `git rev-parse --verify branch^0` &&
test $old_branch = `git rev-parse --verify branch@{1}`
test $old_branch != $(git rev-parse --verify branch^0) &&
test $old_branch = $(git rev-parse --verify branch@{1})
'
###
@ -763,7 +763,7 @@ test_expect_success 'I: export-pack-edges' '
test_expect_success 'I: verify edge list' '
cat >expect <<-EOF &&
.git/objects/pack/pack-.pack: `git rev-parse --verify export-boundary`
.git/objects/pack/pack-.pack: $(git rev-parse --verify export-boundary)
EOF
sed -e s/pack-.*pack/pack-.pack/ edges.list >actual &&
test_cmp expect actual
@ -795,8 +795,8 @@ test_expect_success 'J: reset existing branch creates empty commit' '
git fast-import <input
'
test_expect_success 'J: branch has 1 commit, empty tree' '
test 1 = `git rev-list J | wc -l` &&
test 0 = `git ls-tree J | wc -l`
test 1 = $(git rev-list J | wc -l) &&
test 0 = $(git ls-tree J | wc -l)
'
test_expect_success 'J: tag must fail on empty branch' '
@ -838,8 +838,8 @@ test_expect_success 'K: reinit branch with from' '
git fast-import <input
'
test_expect_success 'K: verify K^1 = branch^1' '
test `git rev-parse --verify branch^1` \
= `git rev-parse --verify K^1`
test $(git rev-parse --verify branch^1) \
= $(git rev-parse --verify K^1)
'
###
@ -929,7 +929,7 @@ test_expect_success 'L: nested tree copy does not corrupt deltas' '
git ls-tree L2 g/b/ >tmp &&
cat tmp | cut -f 2 >actual &&
test_cmp expect actual &&
git fsck `git rev-parse L2`
git fsck $(git rev-parse L2)
'
###
@ -1106,7 +1106,7 @@ test_expect_success 'N: copy dirty subdirectory' '
INPUT_END
git fast-import <input &&
test `git rev-parse N2^{tree}` = `git rev-parse N3^{tree}`
test $(git rev-parse N2^{tree}) = $(git rev-parse N3^{tree})
'
test_expect_success 'N: copy directory by id' '
@ -1503,7 +1503,7 @@ test_expect_success 'O: comments are all skipped' '
INPUT_END
git fast-import <input &&
test `git rev-parse N3` = `git rev-parse O1`
test $(git rev-parse N3) = $(git rev-parse O1)
'
test_expect_success 'O: blank lines not necessary after data commands' '
@ -1524,7 +1524,7 @@ test_expect_success 'O: blank lines not necessary after data commands' '
INPUT_END
git fast-import <input &&
test `git rev-parse N3` = `git rev-parse O2`
test $(git rev-parse N3) = $(git rev-parse O2)
'
test_expect_success 'O: repack before next test' '
@ -1570,8 +1570,8 @@ test_expect_success 'O: blank lines not necessary after other commands' '
INPUT_END
git fast-import <input &&
test 8 = `find .git/objects/pack -type f | wc -l` &&
test `git rev-parse refs/tags/O3-2nd` = `git rev-parse O3^` &&
test 8 = $(find .git/objects/pack -type f | wc -l) &&
test $(git rev-parse refs/tags/O3-2nd) = $(git rev-parse O3^) &&
git log --reverse --pretty=oneline O3 | sed s/^.*z// >actual &&
test_cmp expect actual
'
@ -1631,7 +1631,7 @@ test_expect_success 'P: superproject & submodule mix' '
data <<DATAEND
[submodule "sub"]
path = sub
url = "`pwd`/sub"
url = "$(pwd)/sub"
DATAEND
commit refs/heads/subuse1
@ -1691,7 +1691,7 @@ test_expect_success 'P: verbatim SHA gitlinks' '
data <<DATAEND
[submodule "sub"]
path = sub
url = "`pwd`/sub"
url = "$(pwd)/sub"
DATAEND
commit refs/heads/subuse2
@ -1978,7 +1978,7 @@ test_expect_success 'Q: verify first note for third commit' '
test_expect_success 'Q: verify second notes commit' '
cat >expect <<-EOF &&
parent `git rev-parse --verify refs/notes/foobar~2`
parent $(git rev-parse --verify refs/notes/foobar~2)
author $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
@ -2045,7 +2045,7 @@ test_expect_success 'Q: verify third note for first commit' '
test_expect_success 'Q: verify fourth notes commit' '
cat >expect <<-EOF &&
parent `git rev-parse --verify refs/notes/foobar^`
parent $(git rev-parse --verify refs/notes/foobar^)
author $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE

View file

@ -163,7 +163,7 @@ test_expect_success 'setup submodule' '
git add file &&
git commit -m sub_initial
) &&
git submodule add "`pwd`/sub" sub &&
git submodule add "$(pwd)/sub" sub &&
git commit -m initial &&
test_tick &&
(
@ -377,7 +377,7 @@ test_expect_success 'full-tree re-shows unmodified files' '
test_expect_success 'set-up a few more tags for tag export tests' '
git checkout -f master &&
HEAD_TREE=`git show -s --pretty=raw HEAD | grep tree | sed "s/tree //"` &&
HEAD_TREE=$(git show -s --pretty=raw HEAD | grep tree | sed "s/tree //") &&
git tag tree_tag -m "tagging a tree" $HEAD_TREE &&
git tag -a tree_tag-obj -m "tagging a tree" $HEAD_TREE &&
git tag tag-obj_tag -m "tagging a tag" tree_tag-obj &&
@ -422,7 +422,7 @@ test_expect_success 'directory becomes symlink' '
test_expect_success 'fast-export quotes pathnames' '
git init crazy-paths &&
(cd crazy-paths &&
blob=`echo foo | git hash-object -w --stdin` &&
blob=$(echo foo | git hash-object -w --stdin) &&
git update-index --add \
--cacheinfo 100644 $blob "$(printf "path with\\nnewline")" \
--cacheinfo 100644 $blob "path with \"quote\"" \

View file

@ -100,14 +100,14 @@ test_expect_success 'snapshots: bad tree-ish id (tagged object)' '
echo object > tag-object &&
git add tag-object &&
test_tick && git commit -m "Object to be tagged" &&
git tag tagged-object `git hash-object tag-object` &&
git tag tagged-object $(git hash-object tag-object) &&
gitweb_run "p=.git;a=snapshot;h=tagged-object;sf=tgz" &&
grep "400 - Object is not a tree-ish" gitweb.output
'
test_debug 'cat gitweb.output'
test_expect_success 'snapshots: good object id' '
ID=`git rev-parse --verify HEAD` &&
ID=$(git rev-parse --verify HEAD) &&
gitweb_run "p=.git;a=snapshot;h=$ID;sf=tgz" &&
grep "Status: 200 OK" gitweb.output
'
@ -173,7 +173,7 @@ test_expect_success DATE_PARSER 'modification: snapshot if-modified-since (unmod
test_debug 'cat gitweb.headers'
test_expect_success DATE_PARSER 'modification: tree snapshot' '
ID=`git rev-parse --verify HEAD^{tree}` &&
ID=$(git rev-parse --verify HEAD^{tree}) &&
HTTP_IF_MODIFIED_SINCE="Wed, 6 Apr 2005 22:14:13 +0000" &&
export HTTP_IF_MODIFIED_SINCE &&
test_when_finished "unset HTTP_IF_MODIFIED_SINCE" &&

View file

@ -43,7 +43,7 @@ test_expect_success \
echo fake: "$@"
EOF
chmod +x "fake browser" &&
git config browser.w3m.path "`pwd`/fake browser" &&
git config browser.w3m.path "$(pwd)/fake browser" &&
test_web_browse w3m http://example.com/foo
'

View file

@ -6,13 +6,13 @@ dd if=/dev/zero bs=1048576 count=100 2>/dev/null |
while read expect cnt pfx
do
case "$expect" in '#'*) continue ;; esac
actual=`
actual=$(
{
test -z "$pfx" || echo "$pfx"
dd if=/dev/zero bs=1048576 count=$cnt 2>/dev/null |
perl -pe 'y/\000/g/'
} | ./test-sha1 $cnt
`
)
if test "$expect" = "$actual"
then
echo "OK: $expect $cnt $pfx"
@ -51,14 +51,14 @@ exit
while read cnt pfx
do
actual=`
actual=$(
{
test -z "$pfx" || echo "$pfx"
dd if=/dev/zero bs=1048576 count=$cnt 2>/dev/null |
perl -pe 'y/\000/g/'
} | sha1sum |
sed -e 's/ .*//'
`
)
echo "$actual $cnt $pfx"
done <<EOF
0

View file

@ -1,4 +1,4 @@
#!/bin/sh
echo >&2 "fatal: git was built without support for `basename $0` (@@REASON@@)."
echo >&2 "fatal: git was built without support for $(basename $0) (@@REASON@@)."
exit 128