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

View File

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

View File

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

View File

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

View File

@ -138,8 +138,8 @@ cherry-pick)
}' }'
logmsg=$(git show -s --pretty=raw --encoding="$encoding" "$commit") logmsg=$(git show -s --pretty=raw --encoding="$encoding" "$commit")
set_author_env=`echo "$logmsg" | set_author_env=$(echo "$logmsg" |
LANG=C LC_ALL=C sed -ne "$pick_author_script"` LANG=C LC_ALL=C sed -ne "$pick_author_script")
eval "$set_author_env" eval "$set_author_env"
export GIT_AUTHOR_NAME export GIT_AUTHOR_NAME
export GIT_AUTHOR_EMAIL export GIT_AUTHOR_EMAIL
@ -160,9 +160,9 @@ cherry-pick)
esac >.msg esac >.msg
eval GITHEAD_$head=HEAD eval GITHEAD_$head=HEAD
eval GITHEAD_$next='`git show -s \ eval GITHEAD_$next='$(git show -s \
--pretty=oneline --encoding="$encoding" "$commit" | --pretty=oneline --encoding="$encoding" "$commit" |
sed -e "s/^[^ ]* //"`' sed -e "s/^[^ ]* //")'
export GITHEAD_$head GITHEAD_$next export GITHEAD_$head GITHEAD_$next
# This three way merge is an interesting one. We are at # 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}") CMT_MSG=$(sed -e '1,/^$/d' -e '/^---$/,$d' "${PATCH}")
DIFF=$(sed -e '1,/^---$/d' "${PATCH}") DIFF=$(sed -e '1,/^---$/d' "${PATCH}")
CCS=`echo -e "$CMT_MSG\n$HEADERS" | sed -n -e 's/^Cc: \(.*\)$/\1,/gp' \ CCS=$(echo -e "$CMT_MSG\n$HEADERS" | sed -n -e 's/^Cc: \(.*\)$/\1,/gp' \
-e 's/^Signed-off-by: \(.*\)/\1,/gp'` -e 's/^Signed-off-by: \(.*\)/\1,/gp')
echo "$SUBJECT" > $1 echo "$SUBJECT" > $1
echo "Cc: $CCS" >> $1 echo "Cc: $CCS" >> $1

View File

@ -11,7 +11,7 @@
if [ $# -eq 0 ] if [ $# -eq 0 ]
then then
cat <<! 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; exit 1;
fi fi
@ -33,7 +33,7 @@ cat <<!
msgid "" msgid ""
msgstr "" msgstr ""
"Project-Id-Version: PACKAGE VERSION\n" "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" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\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'" test_skip_or_die $GIT_TEST_HTTPD "no web server found at '$LIB_HTTPD_PATH'"
fi fi
HTTPD_VERSION=`$LIB_HTTPD_PATH -v | \ HTTPD_VERSION=$($LIB_HTTPD_PATH -v | \
sed -n 's/^Server version: Apache\/\([0-9]*\)\..*$/\1/p; q'` sed -n 's/^Server version: Apache\/\([0-9]*\)\..*$/\1/p; q')
if test -n "$HTTPD_VERSION" if test -n "$HTTPD_VERSION"
then then

View File

@ -35,11 +35,11 @@ test_expect_success \
GIT_COMMITTER_NAME="Committer Name" \ GIT_COMMITTER_NAME="Committer Name" \
GIT_COMMITTER_EMAIL="committer@email" \ GIT_COMMITTER_EMAIL="committer@email" \
GIT_COMMITTER_DATE="2005-05-26 23:30" \ 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 \ test_expect_success \
'read commit' \ 'read commit' \
'git cat-file commit `cat commitid` >commit' 'git cat-file commit $(cat commitid) >commit'
test_expect_success \ test_expect_success \
'compare commit' \ 'compare commit' \

View File

@ -29,7 +29,7 @@ reset_to_sane
test_expect_success 'symbolic-ref refuses bare sha1' ' test_expect_success 'symbolic-ref refuses bare sha1' '
echo content >file && git add file && git commit -m one && 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 reset_to_sane

View File

@ -62,18 +62,18 @@ test_expect_success setup '
git add . && git add . &&
test_tick && git commit -m rabbit && test_tick && git commit -m rabbit &&
H=`git rev-parse --verify HEAD` && H=$(git rev-parse --verify HEAD) &&
A=`git rev-parse --verify HEAD:A` && A=$(git rev-parse --verify HEAD:A) &&
B=`git rev-parse --verify HEAD:A/B` && B=$(git rev-parse --verify HEAD:A/B) &&
C=`git rev-parse --verify HEAD:C` && C=$(git rev-parse --verify HEAD:C) &&
D=`git rev-parse --verify HEAD:A/D` && D=$(git rev-parse --verify HEAD:A/D) &&
E=`git rev-parse --verify HEAD:A/B/E` && E=$(git rev-parse --verify HEAD:A/B/E) &&
check_fsck && check_fsck &&
test_chmod +x C && test_chmod +x C &&
git add C && git add C &&
test_tick && git commit -m dragon && test_tick && git commit -m dragon &&
L=`git rev-parse --verify HEAD` && L=$(git rev-parse --verify HEAD) &&
check_fsck && check_fsck &&
rm -f C A/B/E && rm -f C A/B/E &&
@ -81,15 +81,15 @@ test_expect_success setup '
echo horse >A/G && echo horse >A/G &&
git add F A/G && git add F A/G &&
test_tick && git commit -a -m sheep && test_tick && git commit -a -m sheep &&
F=`git rev-parse --verify HEAD:F` && F=$(git rev-parse --verify HEAD:F) &&
G=`git rev-parse --verify HEAD:A/G` && G=$(git rev-parse --verify HEAD:A/G) &&
I=`git rev-parse --verify HEAD:A` && I=$(git rev-parse --verify HEAD:A) &&
J=`git rev-parse --verify HEAD` && J=$(git rev-parse --verify HEAD) &&
check_fsck && check_fsck &&
rm -f A/G && rm -f A/G &&
test_tick && git commit -a -m monkey && test_tick && git commit -a -m monkey &&
K=`git rev-parse --verify HEAD` && K=$(git rev-parse --verify HEAD) &&
check_fsck && check_fsck &&
check_have A B C D E F G H I J K L && 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' ' test_expect_success 'setup' '
echo blob >a-blob && 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 && mkdir a-tree &&
echo moreblobs >a-tree/another-blob && echo moreblobs >a-tree/another-blob &&
git add . && git add . &&
TREE_SHA1=`git write-tree` && TREE_SHA1=$(git write-tree) &&
git tag -a -m tree tree-tag "$TREE_SHA1" && git tag -a -m tree tree-tag "$TREE_SHA1" &&
git commit -m Initial && git commit -m Initial &&
git tag -a -m commit commit-tag && 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' ' test_expect_success 'ambiguous 40-hex ref' '
TREE=$(git mktree </dev/null) && TREE=$(git mktree </dev/null) &&
REF=`git rev-parse HEAD` && REF=$(git rev-parse HEAD) &&
VAL=$(git commit-tree $TREE </dev/null) && VAL=$(git commit-tree $TREE </dev/null) &&
git update-ref refs/heads/$REF $VAL && 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 grep "refname.*${REF}.*ambiguous" err
' '
test_expect_success 'ambiguous short sha1 ref' ' test_expect_success 'ambiguous short sha1 ref' '
TREE=$(git mktree </dev/null) && TREE=$(git mktree </dev/null) &&
REF=`git rev-parse --short HEAD` && REF=$(git rev-parse --short HEAD) &&
VAL=$(git commit-tree $TREE </dev/null) && VAL=$(git commit-tree $TREE </dev/null) &&
git update-ref refs/heads/$REF $VAL && 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 grep "refname.*${REF}.*ambiguous" err
' '

View File

@ -55,7 +55,7 @@ test_expect_success 'disable split index' '
EOF EOF
test_cmp ls-files.expect ls-files.actual && 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 && test-dump-split-index .git/index | sed "/^own/d" >actual &&
cat >expect <<EOF && cat >expect <<EOF &&
not a split index 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_expect_success 'checkout with grafts' '
test_when_finished rm .git/info/grafts && test_when_finished rm .git/info/grafts &&
test_commit abc && test_commit abc &&
SHA1=`git rev-parse HEAD` && SHA1=$(git rev-parse HEAD) &&
test_commit def && test_commit def &&
test_commit xyz && test_commit xyz &&
echo "`git rev-parse HEAD` $SHA1" >.git/info/grafts && echo "$(git rev-parse HEAD) $SHA1" >.git/info/grafts &&
cat >expected <<-\EOF && cat >expected <<-\EOF &&
xyz xyz
abc abc

View File

@ -23,7 +23,7 @@ git update-index symlink'
test_expect_success \ test_expect_success \
'the index entry must still be a symbolic link' ' '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;; 120000" "*symlink) echo pass;;
*) echo fail; git ls-files --stage --cached symlink; (exit 1);; *) echo fail; git ls-files --stage --cached symlink; (exit 1);;
esac' esac'

View File

@ -263,7 +263,7 @@ test_expect_success 'setup 8' '
test_ln_s_add e a && test_ln_s_add e a &&
test_tick && test_tick &&
git commit -m "rename a->e, symlink a->e" && 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' ' test_expect_success 'setup 9' '

View File

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

View File

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

View File

@ -27,7 +27,7 @@ SHA1=
test_expect_success \ test_expect_success \
'see if git show-ref works as expected' \ 'see if git show-ref works as expected' \
'git branch a && 'git branch a &&
SHA1=`cat .git/refs/heads/a` && SHA1=$(cat .git/refs/heads/a) &&
echo "$SHA1 refs/heads/a" >expect && echo "$SHA1 refs/heads/a" >expect &&
git show-ref a >result && git show-ref a >result &&
test_cmp expect 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_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' ' 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' ' test_expect_success 'cherry-pick -x inserts blank line after one line subject' '
pristine_detach initial && 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 && git cherry-pick -x mesg-one-line &&
cat <<-EOF >expect && cat <<-EOF >expect &&
$mesg_one_line $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' ' test_expect_success 'cherry-pick -x inserts blank line when conforming footer not found' '
pristine_detach initial && 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 && git cherry-pick -x mesg-no-footer &&
cat <<-EOF >expect && cat <<-EOF >expect &&
$mesg_no_footer $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' ' test_expect_success 'cherry-pick -x -s inserts blank line when conforming footer not found' '
pristine_detach initial && 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 && git cherry-pick -x -s mesg-no-footer &&
cat <<-EOF >expect && cat <<-EOF >expect &&
$mesg_no_footer $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' ' test_expect_success 'cherry-pick -x -s adds sob when last sob doesnt match committer' '
pristine_detach initial && 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 && git cherry-pick -x -s mesg-with-footer &&
cat <<-EOF >expect && cat <<-EOF >expect &&
$mesg_with_footer $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' ' test_expect_success 'cherry-pick -x -s adds sob even when trailing sob exists for committer' '
pristine_detach initial && 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 && git cherry-pick -x -s mesg-with-footer-sob &&
cat <<-EOF >expect && cat <<-EOF >expect &&
$mesg_with_footer_sob $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' ' test_expect_success 'cherry-pick -x treats "(cherry picked from..." line as part of footer' '
pristine_detach initial && 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 && git cherry-pick -x mesg-with-cherry-footer &&
cat <<-EOF >expect && cat <<-EOF >expect &&
$mesg_with_cherry_footer $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' ' test_expect_success 'cherry-pick -x -s treats "(cherry picked from..." line as part of footer' '
pristine_detach initial && 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 && git cherry-pick -x -s mesg-with-cherry-footer &&
cat <<-EOF >expect && cat <<-EOF >expect &&
$mesg_with_cherry_footer $mesg_with_cherry_footer

View File

@ -115,7 +115,7 @@ test_expect_success '"rm" command printed' '
git add test-file && git add test-file &&
git commit -m "add file for rm test" && git commit -m "add file for rm test" &&
git rm test-file > rm-output && 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 && rm -f test-file rm-output &&
git commit -m "remove file from rm test" 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 add test-file &&
git commit -m "add file for rm --quiet test" && git commit -m "add file for rm --quiet test" &&
git rm --quiet test-file > rm-output && 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 && rm -f test-file rm-output &&
git commit -m "remove file from rm --quiet test" git commit -m "remove file from rm --quiet test"
' '

View File

@ -25,7 +25,7 @@ test_expect_success \
echo foo >xfoo1 && echo foo >xfoo1 &&
chmod 755 xfoo1 && chmod 755 xfoo1 &&
git add xfoo1 && git add xfoo1 &&
case "`git ls-files --stage xfoo1`" in case "$(git ls-files --stage xfoo1)" in
100644" "*xfoo1) echo pass;; 100644" "*xfoo1) echo pass;;
*) echo fail; git ls-files --stage xfoo1; (exit 1);; *) echo fail; git ls-files --stage xfoo1; (exit 1);;
esac' esac'
@ -33,7 +33,7 @@ test_expect_success \
test_expect_success 'git add: filemode=0 should not get confused by symlink' ' test_expect_success 'git add: filemode=0 should not get confused by symlink' '
rm -f xfoo1 && rm -f xfoo1 &&
test_ln_s_add foo 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;; 120000" "*xfoo1) echo pass;;
*) echo fail; git ls-files --stage xfoo1; (exit 1);; *) echo fail; git ls-files --stage xfoo1; (exit 1);;
esac esac
@ -45,7 +45,7 @@ test_expect_success \
echo foo >xfoo2 && echo foo >xfoo2 &&
chmod 755 xfoo2 && chmod 755 xfoo2 &&
git update-index --add xfoo2 && git update-index --add xfoo2 &&
case "`git ls-files --stage xfoo2`" in case "$(git ls-files --stage xfoo2)" in
100644" "*xfoo2) echo pass;; 100644" "*xfoo2) echo pass;;
*) echo fail; git ls-files --stage xfoo2; (exit 1);; *) echo fail; git ls-files --stage xfoo2; (exit 1);;
esac' esac'
@ -53,7 +53,7 @@ test_expect_success \
test_expect_success 'git add: filemode=0 should not get confused by symlink' ' test_expect_success 'git add: filemode=0 should not get confused by symlink' '
rm -f xfoo2 && rm -f xfoo2 &&
test_ln_s_add foo 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;; 120000" "*xfoo2) echo pass;;
*) echo fail; git ls-files --stage xfoo2; (exit 1);; *) echo fail; git ls-files --stage xfoo2; (exit 1);;
esac esac
@ -63,7 +63,7 @@ test_expect_success \
'git update-index --add: Test that executable bit is not used...' \ 'git update-index --add: Test that executable bit is not used...' \
'git config core.filemode 0 && 'git config core.filemode 0 &&
test_ln_s_add xfoo2 xfoo3 && # runs git update-index --add 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;; 120000" "*xfoo3) echo pass;;
*) echo fail; git ls-files --stage xfoo3; (exit 1);; *) echo fail; git ls-files --stage xfoo3; (exit 1);;
esac' 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' ' test_expect_success 'git add --refresh' '
>foo && git add foo && git commit -a -m "commit all" && >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 && git read-tree HEAD &&
case "`git diff-index HEAD -- foo`" in case "$(git diff-index HEAD -- foo)" in
:100644" "*"M foo") echo pass;; :100644" "*"M foo") echo pass;;
*) echo fail; (exit 1);; *) echo fail; (exit 1);;
esac && esac &&
git add --refresh -- foo && 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' ' 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' \ test_expect_success 'split sample box' \
'git mailsplit -o. "$TEST_DIRECTORY"/t5100/sample.mbox >last && 'git mailsplit -o. "$TEST_DIRECTORY"/t5100/sample.mbox >last &&
last=`cat last` && last=$(cat last) &&
echo total is $last && echo total is $last &&
test `cat last` = 17' test $(cat last) = 17'
check_mailinfo () { check_mailinfo () {
mail=$1 opt=$2 mail=$1 opt=$2
@ -23,7 +23,7 @@ check_mailinfo () {
} }
for mail in `echo 00*` for mail in 00*
do do
test_expect_success "mailinfo $mail" ' test_expect_success "mailinfo $mail" '
check_mailinfo $mail "" && check_mailinfo $mail "" &&
@ -47,11 +47,11 @@ test_expect_success 'split box with rfc2047 samples' \
'mkdir rfc2047 && 'mkdir rfc2047 &&
git mailsplit -orfc2047 "$TEST_DIRECTORY"/t5100/rfc2047-samples.mbox \ git mailsplit -orfc2047 "$TEST_DIRECTORY"/t5100/rfc2047-samples.mbox \
>rfc2047/last && >rfc2047/last &&
last=`cat rfc2047/last` && last=$(cat rfc2047/last) &&
echo total is $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 do
test_expect_success "mailinfo $mail" ' test_expect_success "mailinfo $mail" '
git mailinfo -u $mail-msg $mail-patch <$mail >$mail-info && git mailinfo -u $mail-msg $mail-patch <$mail >$mail-info &&

View File

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

View File

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

View File

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

View File

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

View File

@ -266,7 +266,7 @@ EOF
' '
test_expect_success 'prune .git/shallow' ' 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 && echo $SHA1 >.git/shallow &&
git prune --dry-run >out && git prune --dry-run >out &&
grep $SHA1 .git/shallow && grep $SHA1 .git/shallow &&

View File

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

View File

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

View File

@ -20,7 +20,7 @@ update_repos() {
} }
repo_fetched() { 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" echo >&2 "repo was fetched: $1"
return 0 return 0
fi fi

View File

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

View File

@ -128,8 +128,8 @@ do
case "$cmd" in case "$cmd" in
'' | '#'*) continue ;; '' | '#'*) continue ;;
esac esac
test=`echo "$cmd" | sed -e 's|[/ ][/ ]*|_|g'` test=$(echo "$cmd" | sed -e 's|[/ ][/ ]*|_|g')
pfx=`printf "%04d" $test_count` pfx=$(printf "%04d" $test_count)
expect_f="$TEST_DIRECTORY/t5515/fetch.$test" expect_f="$TEST_DIRECTORY/t5515/fetch.$test"
actual_f="$pfx-fetch.$test" actual_f="$pfx-fetch.$test"
expect_r="$TEST_DIRECTORY/t5515/refs.$test" expect_r="$TEST_DIRECTORY/t5515/refs.$test"

View File

@ -16,7 +16,7 @@ This test checks the following functionality:
. ./test-lib.sh . ./test-lib.sh
D=`pwd` D=$(pwd)
mk_empty () { mk_empty () {
repo_name="$1" 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' ' test_expect_success 'push sha1 with non-existent, incomplete dest' '
mk_test testrepo && 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 . ./test-lib.sh
D=`pwd` D=$(pwd)
invert () { invert () {
if "$@"; then 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 # git rev-parse --show-cdup printed a path relative to
# clone-repo/subdir/, not subdir-link/. Git rev-parse --show-cdup # clone-repo/subdir/, not subdir-link/. Git rev-parse --show-cdup
# used the correct .git, but when the git pull shell script did # 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 # directory. A POSIX shell's "cd" works a little differently
# than chdir() in C; "cd -P" is much closer to chdir(). # 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 . ./test-lib.sh
D=`pwd` D=$(pwd)
corrupt_repo () { corrupt_repo () {
object_sha1=$(git rev-parse "$1") && object_sha1=$(git rev-parse "$1") &&

View File

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

View File

@ -98,7 +98,7 @@ EOF
test_expect_success 'fetch something upstream has but hidden by clients shallow boundaries' ' test_expect_success 'fetch something upstream has but hidden by clients shallow boundaries' '
# the blob "1" is available in .git but hidden by the # the blob "1" is available in .git but hidden by the
# shallow2/.git/shallow and it should be resent # 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 && echo 1 >1.t &&
git add 1.t && git add 1.t &&
git commit -m add-1-back && git commit -m add-1-back &&
@ -114,7 +114,7 @@ add-1-back
EOF EOF
test_cmp expect actual 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' ' 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 && commit 1 &&
git push shallow2/.git +master:refs/remotes/top/master && git push shallow2/.git +master:refs/remotes/top/master &&
( (
@ -117,7 +117,7 @@ test_expect_success 'push from full to shallow' '
3 3
EOF EOF
test_cmp expect actual && 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 test_done

View File

@ -132,7 +132,7 @@ test_expect_success 'fetch packed objects' '
test_expect_success 'fetch notices corrupt pack' ' test_expect_success 'fetch notices corrupt pack' '
cp -R "$HTTPD_DOCUMENT_ROOT_PATH"/repo_pack.git "$HTTPD_DOCUMENT_ROOT_PATH"/repo_bad1.git && cp -R "$HTTPD_DOCUMENT_ROOT_PATH"/repo_pack.git "$HTTPD_DOCUMENT_ROOT_PATH"/repo_bad1.git &&
(cd "$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 && chmod u+w $p &&
printf %0256d 0 | dd of=$p bs=256 count=1 seek=1 conv=notrunc 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 && (cd repo_bad1.git &&
git --bare init && git --bare init &&
test_must_fail git --bare fetch $HTTPD_URL/dumb/repo_bad1.git && 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' ' test_expect_success 'fetch notices corrupt idx' '
cp -R "$HTTPD_DOCUMENT_ROOT_PATH"/repo_pack.git "$HTTPD_DOCUMENT_ROOT_PATH"/repo_bad2.git && cp -R "$HTTPD_DOCUMENT_ROOT_PATH"/repo_pack.git "$HTTPD_DOCUMENT_ROOT_PATH"/repo_bad2.git &&
(cd "$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 && chmod u+w $p &&
printf %0256d 0 | dd of=$p bs=256 count=1 seek=1 conv=notrunc 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 && (cd repo_bad2.git &&
git --bare init && git --bare init &&
test_must_fail git --bare fetch $HTTPD_URL/dumb/repo_bad2.git && 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' ' 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 && 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 && (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 && chmod u+w $p &&
printf %0256d 0 | dd of=$p bs=256 count=1 seek=1 conv=notrunc 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 && (cd repo_bad1.git &&
git --bare init && git --bare init &&
test_must_fail git --bare fetch "$GIT_DAEMON_URL/repo_bad1.git" && 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' ' 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 && 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 && (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 && chmod u+w $p &&
printf %0256d 0 | dd of=$p bs=256 count=1 seek=1 conv=notrunc 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 && (cd repo_bad2.git &&
git --bare init && git --bare init &&
test_must_fail git --bare fetch "$GIT_DAEMON_URL/repo_bad2.git" && 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' ' test_expect_success 'clone separate gitdir: output' '
echo "gitdir: `pwd`/realgitdir" >expected && echo "gitdir: $(pwd)/realgitdir" >expected &&
test_cmp expected dst/.git test_cmp expected dst/.git
' '

View File

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

View File

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

View File

@ -15,7 +15,7 @@ make_tree() {
make_bare() { make_bare() {
git init --bare "$1" && git init --bare "$1" &&
(cd "$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) && commit=$(echo "$1" | git commit-tree $tree) &&
git update-ref HEAD $commit git update-ref HEAD $commit
) )

View File

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

View File

@ -27,9 +27,9 @@ test_bisection_diff()
# Test if bisection size is close to half of list size within # Test if bisection size is close to half of list size within
# tolerance. # tolerance.
# #
_bisect_err=`expr $_list_size - $_bisection_size \* 2` _bisect_err=$(expr $_list_size - $_bisection_size \* 2)
test "$_bisect_err" -lt 0 && _bisect_err=`expr 0 - $_bisect_err` test "$_bisect_err" -lt 0 && _bisect_err=$(expr 0 - $_bisect_err)
_bisect_err=`expr $_bisect_err / 2` ; # floor _bisect_err=$(expr $_bisect_err / 2) ; # floor
test_expect_success \ test_expect_success \
"bisection diff $_bisect_option $_head $* <= $_max_diff" \ "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_expect_success 'set up --show-all --parents test' '
test_commit one foo.txt && test_commit one foo.txt &&
commit1=`git rev-list -1 HEAD` && commit1=$(git rev-list -1 HEAD) &&
test_commit two bar.txt && test_commit two bar.txt &&
commit2=`git rev-list -1 HEAD` && commit2=$(git rev-list -1 HEAD) &&
test_commit three foo.txt && 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' ' test_expect_success '--parents rewrites TREESAME parents correctly' '

View File

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

View File

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

View File

@ -156,11 +156,11 @@ test_expect_success "Michael Cassar's test case" '
echo b > partA/outline.txt && echo b > partA/outline.txt &&
echo c > papers/unsorted/_another && echo c > papers/unsorted/_another &&
git add papers partA && git add papers partA &&
T1=`git write-tree` && T1=$(git write-tree) &&
git mv papers/unsorted/Thesis.pdf papers/all-papers/moo-blah.pdf && 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 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 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' ' test_expect_success 'rewrite submodule with another content' '
git filter-branch --tree-filter "test -d submod && { git filter-branch --tree-filter "test -d submod && {
@ -396,7 +396,7 @@ test_expect_success 'rewrite submodule with another content' '
mkdir submod && mkdir submod &&
: > submod/file : > submod/file
} || :" HEAD && } || :" 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' ' 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 "if git ls-files --error-unmatch -- submod > /dev/null 2>&1
then git update-index --cacheinfo 160000 0123456789012345678901234567890123456789 submod then git update-index --cacheinfo 160000 0123456789012345678901234567890123456789 submod
fi" HEAD && 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' ' 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_expect_success 'listing all tags in an empty tree should output nothing' '
test `git tag -l | wc -l` -eq 0 && test $(git tag -l | wc -l) -eq 0 &&
test `git tag | wc -l` -eq 0 test $(git tag | wc -l) -eq 0
' '
test_expect_success 'looking for a tag in an empty tree should fail' \ 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_expect_success 'listing all tags if one exists should output that tag' '
test `git tag -l` = mytag && test $(git tag -l) = mytag &&
test `git tag` = mytag test $(git tag) = mytag
' '
# pattern matching: # pattern matching:
@ -83,7 +83,7 @@ test_expect_success 'listing a tag using a matching pattern should succeed' \
test_expect_success \ test_expect_success \
'listing a tag using a matching pattern should output that tag' \ '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 # todo: git tag -l now returns always zero, when fixed, change this test
test_expect_success \ test_expect_success \
@ -92,7 +92,7 @@ test_expect_success \
test_expect_success \ test_expect_success \
'listing tags using a non-matching pattern should output nothing' \ '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: # special cases for creating tags:
@ -102,13 +102,13 @@ test_expect_success \
test_expect_success \ test_expect_success \
'trying to create a tag with a non-valid name should fail' ' '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 "" &&
test_must_fail git tag .othertag && test_must_fail git tag .othertag &&
test_must_fail git tag "other tag" && test_must_fail git tag "other tag" &&
test_must_fail git tag "othertag^" && test_must_fail git tag "othertag^" &&
test_must_fail git tag "other~tag" && 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' ' 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 && echo "foo:initial" >expect &&
>actual && >actual &&
test_config pager.external "sed s/^/foo:/ >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 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' ' test_expect_success '"soft" reset is allowed in bare' '
git reset --soft HEAD^ && 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 test_done

View File

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

View File

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

View File

@ -179,7 +179,7 @@ EOF
chmod +x "$HOOK" chmod +x "$HOOK"
commit_msg_is () { 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' ' test_expect_success 'hook edits commit message' '

View File

@ -53,7 +53,7 @@ test_expect_success 'with hook (-m)' '
echo "more" >> file && echo "more" >> file &&
git add file && git add file &&
git commit -m "more" && 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 && echo "more" >> file &&
git add file && git add file &&
GIT_EDITOR="\"\$FAKE_EDITOR\"" git commit -e -m "more more" && 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 && echo "more" >> file &&
git add file && git add file &&
git commit -t "$(git rev-parse --git-dir)/template" && 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 && echo "more" >> file &&
git add file && git add file &&
(echo more | git commit -F -) && (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 && echo "more" >> file &&
git add file && git add file &&
(echo more more | GIT_EDITOR="\"\$FAKE_EDITOR\"" git commit -e -F -) && (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)' ' test_expect_success 'with hook (-C)' '
head=`git rev-parse HEAD` && head=$(git rev-parse HEAD) &&
echo "more" >> file && echo "more" >> file &&
git add file && git add file &&
git commit -C $head && 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 && echo "more more" >> file &&
git add file && git add file &&
GIT_EDITOR="\"\$FAKE_EDITOR\"" git commit && 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)' ' test_expect_success 'with hook (--amend)' '
head=`git rev-parse HEAD` && head=$(git rev-parse HEAD) &&
echo "more" >> file && echo "more" >> file &&
git add file && git add file &&
GIT_EDITOR="\"\$FAKE_EDITOR\"" git commit --amend && 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)' ' test_expect_success 'with hook (-c)' '
head=`git rev-parse HEAD` && head=$(git rev-parse HEAD) &&
echo "more" >> file && echo "more" >> file &&
git add file && git add file &&
GIT_EDITOR="\"\$FAKE_EDITOR\"" git commit -c $head && 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 commit -m other &&
git checkout - && git checkout - &&
git merge --no-ff other && 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)' ' 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 commit -m other &&
git checkout - && git checkout - &&
env GIT_EDITOR="\"\$FAKE_EDITOR\"" git merge --no-ff -e other && 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' cat > "$HOOK" <<'EOF'
@ -164,7 +164,7 @@ EOF
test_expect_success 'with failing hook' ' test_expect_success 'with failing hook' '
test_when_finished "git checkout -f master" && test_when_finished "git checkout -f master" &&
head=`git rev-parse HEAD` && head=$(git rev-parse HEAD) &&
echo "more" >> file && echo "more" >> file &&
git add file && git add file &&
test_must_fail env GIT_EDITOR="\"\$FAKE_EDITOR\"" git commit -c $head 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_expect_success 'with failing hook (--no-verify)' '
test_when_finished "git checkout -f master" && test_when_finished "git checkout -f master" &&
head=`git rev-parse HEAD` && head=$(git rev-parse HEAD) &&
echo "more" >> file && echo "more" >> file &&
git add file && git add file &&
test_must_fail env GIT_EDITOR="\"\$FAKE_EDITOR\"" git commit --no-verify -c $head 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 add c$i.c &&
git commit -m c$i && git commit -m c$i &&
git tag c$i && git tag c$i &&
i=`expr $i + 1` || return 1 i=$(expr $i + 1) || return 1
done done
' '
@ -30,7 +30,7 @@ test_expect_success 'merge c1 with c2, c3, c4, ... c29' '
while test $i -le 30 while test $i -le 30
do do
refs="$refs c$i" refs="$refs c$i"
i=`expr $i + 1` i=$(expr $i + 1)
done && done &&
git merge $refs && git merge $refs &&
test "$(git rev-parse c1)" != "$(git rev-parse HEAD)" && 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 while test $i -le 30
do do
test "$(git rev-parse c$i)" = "$(git rev-parse HEAD^$i)" && test "$(git rev-parse c$i)" = "$(git rev-parse HEAD^$i)" &&
i=`expr $i + 1` || return 1 i=$(expr $i + 1) || return 1
done && done &&
git diff --exit-code && git diff --exit-code &&
i=1 && i=1 &&
while test $i -le 30 while test $i -le 30
do do
test -f c$i.c && test -f c$i.c &&
i=`expr $i + 1` || return 1 i=$(expr $i + 1) || return 1
done 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' ' test_expect_success 'loose objects in alternate ODB are not repacked' '
mkdir alt_objects && mkdir alt_objects &&
echo `pwd`/alt_objects > .git/objects/info/alternates && echo $(pwd)/alt_objects > .git/objects/info/alternates &&
echo content3 > file3 && echo content3 > file3 &&
objsha1=$(GIT_OBJECT_DIRECTORY=alt_objects git hash-object -w file3) && objsha1=$(GIT_OBJECT_DIRECTORY=alt_objects git hash-object -w file3) &&
git add 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' ' 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 && echo "$csha1" | git pack-objects --non-empty --all --reflog pack &&
rm -f .git/objects/pack/* && rm -f .git/objects/pack/* &&
mv pack-* .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' ' test_expect_success 'blame to a commit with no author name' '
TREE=`git rev-parse HEAD:` && TREE=$(git rev-parse HEAD:) &&
cat >badcommit <<EOF && cat >badcommit <<EOF &&
tree $TREE tree $TREE
author <noname> 1234567890 +0000 author <noname> 1234567890 +0000
@ -161,7 +161,7 @@ committer David Reiss <dreiss@facebook.com> 1234567890 +0000
some message some message
EOF 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 git --no-pager blame $COMMIT -- uno >/dev/null
' '

View File

@ -36,7 +36,7 @@ clean_fake_sendmail () {
} }
test_expect_success $PREREQ 'Extract patches' ' 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 # 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' ' 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" && test_when_finished "rm $patch" &&
git send-email \ git send-email \
--dry-run \ --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' ' 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" && test_when_finished "rm $patch" &&
git send-email \ git send-email \
--dry-run \ --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' ' test_expect_success $PREREQ 'To headers from files reset each patch' '
patch1=`git format-patch -1 --to="bodies@example.com"` && patch1=$(git format-patch -1 --to="bodies@example.com") &&
patch2=`git format-patch -1 --to="other@example.com" HEAD~` && patch2=$(git format-patch -1 --to="other@example.com" HEAD~) &&
test_when_finished "rm $patch1 && rm $patch2" && test_when_finished "rm $patch1 && rm $patch2" &&
git send-email \ git send-email \
--dry-run \ --dry-run \
@ -1488,7 +1488,7 @@ test_cover_addresses () {
clean_fake_sendmail && clean_fake_sendmail &&
rm -fr outdir && rm -fr outdir &&
git format-patch --cover-letter -2 -o 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 && mv $cover cover-to-edit.patch &&
perl -pe "s/^From:/$header: extra\@address.com\nFrom:/" cover-to-edit.patch >"$cover" && perl -pe "s/^From:/$header: extra\@address.com\nFrom:/" cover-to-edit.patch >"$cover" &&
git send-email \ git send-email \

View File

@ -265,18 +265,18 @@ test_expect_success 'able to dcommit to a subdirectory' "
git update-index --add d && git update-index --add d &&
git commit -m '/bar/d should be in the log' && git commit -m '/bar/d should be in the log' &&
git svn dcommit -i bar && 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 && mkdir newdir &&
echo new > newdir/dir && echo new > newdir/dir &&
git update-index --add newdir/dir && git update-index --add newdir/dir &&
git commit -m 'add a new directory' && git commit -m 'add a new directory' &&
git svn dcommit -i bar && 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 && echo foo >> newdir/dir &&
git update-index newdir/dir && git update-index newdir/dir &&
git commit -m 'modify a file in new directory' && git commit -m 'modify a file in new directory' &&
git svn dcommit -i bar && 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' ' 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 update-index d &&
git commit -m 'update /bar/d' && git commit -m 'update /bar/d' &&
git svn set-tree -i bar HEAD && 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' ' test_expect_success 'git-svn works in a bare repository' '

View File

@ -26,27 +26,27 @@ cd import
EOF EOF
printf "Hello\r\nWorld\r\n" > crlf 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 printf "Hello\rWorld\r" > cr
a_cr=`git hash-object -w cr` a_cr=$(git hash-object -w cr)
printf "Hello\nWorld\n" > lf 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 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 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 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 touch empty
a_empty=`git hash-object -w empty` a_empty=$(git hash-object -w empty)
printf "\n" > empty_lf 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 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 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 svn_cmd import --no-auto-props -m 'import for git svn' . "$svnrepo" >/dev/null
cd .. cd ..
@ -80,7 +80,7 @@ test_expect_success "$name" \
git pull . ${remotes_git_svn}' git pull . ${remotes_git_svn}'
expect='/* $Id$ */' 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 'raw $Id$ found in kw.c' "test '$expect' = '$got'"
test_expect_success "propset CR on crlf files" ' test_expect_success "propset CR on crlf files" '
@ -107,8 +107,8 @@ done
cd test_wc cd test_wc
printf '$Id$\rHello\rWorld\r' > cr printf '$Id$\rHello\rWorld\r' > cr
printf '$Id$\rHello\rWorld' > ne_cr printf '$Id$\rHello\rWorld' > ne_cr
a_cr=`printf '$Id$\r\nHello\r\nWorld\r\n' | 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` a_ne_cr=$(printf '$Id$\r\nHello\r\nWorld' | git hash-object --stdin)
test_expect_success 'Set CRLF on cr files' \ test_expect_success 'Set CRLF on cr files' \
'svn_cmd propset svn:eol-style CRLF cr && 'svn_cmd propset svn:eol-style CRLF cr &&
svn_cmd propset svn:eol-style CRLF ne_cr && svn_cmd propset svn:eol-style CRLF ne_cr &&
@ -119,8 +119,8 @@ cd ..
test_expect_success 'fetch and pull latest from svn' \ test_expect_success 'fetch and pull latest from svn' \
'git svn fetch && git pull . ${remotes_git_svn}' 'git svn fetch && git pull . ${remotes_git_svn}'
b_cr="`git hash-object cr`" b_cr="$(git hash-object cr)"
b_ne_cr="`git hash-object ne_cr`" b_ne_cr="$(git hash-object ne_cr)"
test_expect_success 'CRLF + $Id$' "test '$a_cr' = '$b_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'" 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' ' test_expect_success 'init and fetch a moved directory' '
git svn init --minimize-url -i thunk "$svnrepo"/thunk && git svn init --minimize-url -i thunk "$svnrepo"/thunk &&
git svn fetch -i thunk && git svn fetch -i thunk &&
test "`git rev-parse --verify refs/remotes/thunk@2`" \ test "$(git rev-parse --verify refs/remotes/thunk@2)" \
= "`git rev-parse --verify refs/remotes/thunk~1`" && = "$(git rev-parse --verify refs/remotes/thunk~1)" &&
test "`git cat-file blob refs/remotes/thunk:readme |\ test "$(git cat-file blob refs/remotes/thunk:readme |\
sed -n -e "3p"`" = goodbye && sed -n -e "3p")" = goodbye &&
test -z "`git config --get svn-remote.svn.fetch \ test -z "$(git config --get svn-remote.svn.fetch \
"^trunk:refs/remotes/thunk@2$"`" "^trunk:refs/remotes/thunk@2$")"
' '
test_expect_success 'init and fetch from one svn-remote' ' 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 \ git config --add svn-remote.svn.fetch \
thunk:refs/remotes/svn/thunk && thunk:refs/remotes/svn/thunk &&
git svn fetch -i svn/thunk && git svn fetch -i svn/thunk &&
test "`git rev-parse --verify refs/remotes/svn/trunk`" \ test "$(git rev-parse --verify refs/remotes/svn/trunk)" \
= "`git rev-parse --verify refs/remotes/svn/thunk~1`" && = "$(git rev-parse --verify refs/remotes/svn/thunk~1)" &&
test "`git cat-file blob refs/remotes/svn/thunk:readme |\ test "$(git cat-file blob refs/remotes/svn/thunk:readme |\
sed -n -e "3p"`" = goodbye sed -n -e "3p")" = goodbye
' '
test_expect_success 'follow deleted parent' ' test_expect_success 'follow deleted parent' '
@ -61,9 +61,9 @@ test_expect_success 'follow deleted parent' '
junk:refs/remotes/svn/junk && junk:refs/remotes/svn/junk &&
git svn fetch -i svn/thunk && git svn fetch -i svn/thunk &&
git svn fetch -i svn/junk && git svn fetch -i svn/junk &&
test -z "`git diff svn/junk svn/trunk`" && test -z "$(git diff svn/junk svn/trunk)" &&
test "`git merge-base svn/junk svn/trunk`" \ test "$(git merge-base svn/junk svn/trunk)" \
= "`git rev-parse svn/trunk`" = "$(git rev-parse svn/trunk)"
' '
test_expect_success 'follow larger parent' ' 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 &&
git rev-parse --verify \ git rev-parse --verify \
refs/remotes/larger-parent && refs/remotes/larger-parent &&
test "`git merge-base \ test "$(git merge-base \
refs/remotes/larger-parent \ refs/remotes/larger-parent \
refs/remotes/larger`" = \ refs/remotes/larger)" = \
"`git rev-parse refs/remotes/larger`" "$(git rev-parse refs/remotes/larger)"
' '
test_expect_success 'follow higher-level parent' ' 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 && svn_cmd rm -m "remove glob" "$svnrepo"/glob &&
git svn init --minimize-url -i glob "$svnrepo"/glob && git svn init --minimize-url -i glob "$svnrepo"/glob &&
git svn fetch -i glob && git svn fetch -i glob &&
test "`git cat-file blob refs/remotes/glob:blob/bye`" = hi && test "$(git cat-file blob refs/remotes/glob:blob/bye)" = hi &&
test "`git ls-tree refs/remotes/glob | wc -l `" -eq 1 test "$(git ls-tree refs/remotes/glob | wc -l )" -eq 1
' '
# ref: r9270 of the Subversion repository: (http://svn.collab.net/repos/svn) # 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 \ git svn init --minimize-url -i r9270-t \
"$svnrepo"/r9270/trunk/subversion/bindings/swig/perl/native/t && "$svnrepo"/r9270/trunk/subversion/bindings/swig/perl/native/t &&
git svn fetch -i r9270-t && git svn fetch -i r9270-t &&
test `git rev-list r9270-t | wc -l` -eq 2 && test $(git rev-list r9270-t | wc -l) -eq 2 &&
test "`git ls-tree --name-only r9270-t~1`" = \ test "$(git ls-tree --name-only r9270-t~1)" = \
"`git ls-tree --name-only r9270-t`" "$(git ls-tree --name-only r9270-t)"
' '
test_expect_success "track initial change if it was only made to parent" ' 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 \ git svn init --minimize-url -i r9270-d \
"$svnrepo"/r9270/drunk/subversion/bindings/swig/perl/native/t && "$svnrepo"/r9270/drunk/subversion/bindings/swig/perl/native/t &&
git svn fetch -i r9270-d && git svn fetch -i r9270-d &&
test `git rev-list r9270-d | wc -l` -eq 3 && test $(git rev-list r9270-d | wc -l) -eq 3 &&
test "`git ls-tree --name-only r9270-t`" = \ test "$(git ls-tree --name-only r9270-t)" = \
"`git ls-tree --name-only r9270-d`" && "$(git ls-tree --name-only r9270-d)" &&
test "`git rev-parse r9270-t`" = \ test "$(git rev-parse r9270-t)" = \
"`git rev-parse r9270-d~1`" "$(git rev-parse r9270-d~1)"
' '
test_expect_success "follow-parent is atomic" ' 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 fetch -i stunk &&
git svn init --minimize-url -i flunked "$svnrepo"/flunked && git svn init --minimize-url -i flunked "$svnrepo"/flunked &&
git svn fetch -i flunked && git svn fetch -i flunked &&
test "`git rev-parse --verify refs/remotes/flunk@18`" \ test "$(git rev-parse --verify refs/remotes/flunk@18)" \
= "`git rev-parse --verify refs/remotes/stunk`" && = "$(git rev-parse --verify refs/remotes/stunk)" &&
test "`git rev-parse --verify refs/remotes/flunk~1`" \ test "$(git rev-parse --verify refs/remotes/flunk~1)" \
= "`git rev-parse --verify refs/remotes/stunk`" && = "$(git rev-parse --verify refs/remotes/stunk)" &&
test "`git rev-parse --verify refs/remotes/flunked~1`" \ test "$(git rev-parse --verify refs/remotes/flunked~1)" \
= "`git rev-parse --verify refs/remotes/stunk~1`" = "$(git rev-parse --verify refs/remotes/stunk~1)"
' '
test_expect_success "track multi-parent paths" ' test_expect_success "track multi-parent paths" '
svn_cmd cp -m "resurrect /glob" "$svnrepo"/r9270 "$svnrepo"/glob && svn_cmd cp -m "resurrect /glob" "$svnrepo"/r9270 "$svnrepo"/glob &&
git svn multi-fetch && git svn multi-fetch &&
test `git cat-file commit refs/remotes/glob | \ test $(git cat-file commit refs/remotes/glob | \
grep "^parent " | wc -l` -eq 2 grep "^parent " | wc -l) -eq 2
' '
test_expect_success "multi-fetch continues to work" " test_expect_success "multi-fetch continues to work" "

View File

@ -18,8 +18,8 @@ test_expect_success 'initialize repo' '
git commit -a -m "another" git commit -a -m "another"
' '
head=`git rev-parse --verify HEAD^0` head=$(git rev-parse --verify HEAD^0)
prev=`git rev-parse --verify HEAD^1` prev=$(git rev-parse --verify HEAD^1)
# the internals of the commit-diff command are the same as the regular # 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 # 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} 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'" 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' ' test_expect_success 'initialize old-style (v0) git svn layout' '
mkdir -p "$GIT_DIR"/git-svn/info "$GIT_DIR"/svn/info && 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_git_svn}^0 &&
git rev-parse --verify refs/remotes/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.url)" = "$svnrepo_escaped" &&
test `git config --get svn-remote.svn.fetch` = \ test $(git config --get svn-remote.svn.fetch) = \
":refs/${remotes_git_svn}" ":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 svn init "$svnrepo" -T trunk -t tags -b branches &&
git config --get-all svn-remote.svn.fetch > fetch.out && git config --get-all svn-remote.svn.fetch > fetch.out &&
grep "^trunk:refs/remotes/origin/trunk$" fetch.out && grep "^trunk:refs/remotes/origin/trunk$" fetch.out &&
test -n "`git config --get svn-remote.svn.branches \ test -n "$(git config --get svn-remote.svn.branches \
"^branches/\*:refs/remotes/origin/\*$"`" && "^branches/\*:refs/remotes/origin/\*$")" &&
test -n "`git config --get svn-remote.svn.tags \ test -n "$(git config --get svn-remote.svn.tags \
"^tags/\*:refs/remotes/origin/tags/\*$"`" && "^tags/\*:refs/remotes/origin/tags/\*$")" &&
git config --unset svn-remote.svn.branches \ git config --unset svn-remote.svn.branches \
"^branches/\*:refs/remotes/origin/\*$" && "^branches/\*:refs/remotes/origin/\*$" &&
git config --unset svn-remote.svn.tags \ 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 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; git rev-parse --verify refs/remotes/origin/\$i^0 >> refs.out || exit 1;
done && 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 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 for j in trunk a b tags/0.1 tags/0.2 tags/0.3; do
if test \$j != \$i; then continue; fi if test \$j != \$i; then continue; fi
test -z \"\`git diff refs/remotes/origin/\$i \ test -z \"\$(git diff refs/remotes/origin/\$i \
refs/remotes/origin/\$j\`\" ||exit 1; done; done refs/remotes/origin/\$j)\" ||exit 1; done; done
" "
test_expect_success 'migrate --minimize on old inited layout' ' test_expect_success 'migrate --minimize on old inited layout' '
git config --unset-all svn-remote.svn.fetch && git config --unset-all svn-remote.svn.fetch &&
git config --unset-all svn-remote.svn.url && git config --unset-all svn-remote.svn.url &&
rm -rf "$GIT_DIR"/svn && rm -rf "$GIT_DIR"/svn &&
for i in `cat fetch.out`; do for i in $(cat fetch.out); do
path=`expr $i : "\([^:]*\):.*$"` path=$(expr $i : "\([^:]*\):.*$")
ref=`expr $i : "[^:]*:\(refs/remotes/.*\)$"` ref=$(expr $i : "[^:]*:\(refs/remotes/.*\)$")
if test -z "$ref"; then continue; fi if test -z "$ref"; then continue; fi
if test -n "$path"; then path="/$path"; fi if test -n "$path"; then path="/$path"; fi
( mkdir -p "$GIT_DIR"/svn/$ref/info/ && ( mkdir -p "$GIT_DIR"/svn/$ref/info/ &&
echo "$svnrepo"$path > "$GIT_DIR"/svn/$ref/info/url ) || exit 1; echo "$svnrepo"$path > "$GIT_DIR"/svn/$ref/info/url ) || exit 1;
done && done &&
git svn migrate --minimize && 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 && git config --get-all svn-remote.svn.fetch > fetch.out &&
grep "^trunk:refs/remotes/origin/trunk$" fetch.out && grep "^trunk:refs/remotes/origin/trunk$" fetch.out &&
grep "^branches/a:refs/remotes/origin/a$" 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 | \ git log --pretty=oneline refs/remotes/tags/end | \
sed -e "s/^.\{41\}//" > output.end && sed -e "s/^.\{41\}//" > output.end &&
test_cmp expect.end output.end && test_cmp expect.end output.end &&
test "`git rev-parse refs/remotes/tags/end~1`" = \ test "$(git rev-parse refs/remotes/tags/end~1)" = \
"`git rev-parse refs/remotes/branches/start`" && "$(git rev-parse refs/remotes/branches/start)" &&
test "`git rev-parse refs/remotes/branches/start~2`" = \ test "$(git rev-parse refs/remotes/branches/start~2)" = \
"`git rev-parse refs/remotes/trunk`" && "$(git rev-parse refs/remotes/trunk)" &&
test_must_fail git rev-parse refs/remotes/tags/end@3 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" svn_cmd commit -m "try to try"
) && ) &&
git svn fetch two && git svn fetch two &&
test `git rev-list refs/remotes/two/tags/end | wc -l` -eq 6 && 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-list refs/remotes/two/branches/start | wc -l) -eq 3 &&
test `git rev-parse refs/remotes/two/branches/start~2` = \ test $(git rev-parse refs/remotes/two/branches/start~2) = \
`git rev-parse refs/remotes/two/trunk` && $(git rev-parse refs/remotes/two/trunk) &&
test `git rev-parse refs/remotes/two/tags/end~3` = \ test $(git rev-parse refs/remotes/two/tags/end~3) = \
`git rev-parse refs/remotes/two/branches/start` && $(git rev-parse refs/remotes/two/branches/start) &&
git log --pretty=oneline refs/remotes/two/tags/end | \ git log --pretty=oneline refs/remotes/two/tags/end | \
sed -e "s/^.\{41\}//" > output.two && sed -e "s/^.\{41\}//" > output.two &&
test_cmp expect.two 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 | \ git log --pretty=oneline refs/remotes/tags/end | \
sed -e "s/^.\{41\}//" > output.end && sed -e "s/^.\{41\}//" > output.end &&
test_cmp expect.end output.end && test_cmp expect.end output.end &&
test "`git rev-parse refs/remotes/tags/end~1`" = \ test "$(git rev-parse refs/remotes/tags/end~1)" = \
"`git rev-parse refs/remotes/branches/v1/start`" && "$(git rev-parse refs/remotes/branches/v1/start)" &&
test "`git rev-parse refs/remotes/branches/v1/start~2`" = \ test "$(git rev-parse refs/remotes/branches/v1/start~2)" = \
"`git rev-parse refs/remotes/trunk`" && "$(git rev-parse refs/remotes/trunk)" &&
test_must_fail git rev-parse refs/remotes/tags/end@3 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" svn_cmd commit -m "try to try"
) && ) &&
git svn fetch two && git svn fetch two &&
test `git rev-list refs/remotes/two/tags/end | wc -l` -eq 6 && 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-list refs/remotes/two/branches/v1/start | wc -l) -eq 3 &&
test `git rev-parse refs/remotes/two/branches/v1/start~2` = \ test $(git rev-parse refs/remotes/two/branches/v1/start~2) = \
`git rev-parse refs/remotes/two/trunk` && $(git rev-parse refs/remotes/two/trunk) &&
test `git rev-parse refs/remotes/two/tags/end~3` = \ test $(git rev-parse refs/remotes/two/tags/end~3) = \
`git rev-parse refs/remotes/two/branches/v1/start` && $(git rev-parse refs/remotes/two/branches/v1/start) &&
git log --pretty=oneline refs/remotes/two/tags/end | \ git log --pretty=oneline refs/remotes/two/tags/end | \
sed -e "s/^.\{41\}//" > output.two && sed -e "s/^.\{41\}//" > output.two &&
test_cmp expect.two 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 \ git config --add svn-remote.four.tags \
"tags/*:refs/remotes/four/tags/*" && "tags/*:refs/remotes/four/tags/*" &&
git svn fetch four && git svn fetch four &&
test `git rev-list refs/remotes/four/tags/next | wc -l` -eq 5 && 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-list refs/remotes/four/branches/v2/start | wc -l) -eq 3 &&
test `git rev-parse refs/remotes/four/branches/v2/start~2` = \ test $(git rev-parse refs/remotes/four/branches/v2/start~2) = \
`git rev-parse refs/remotes/four/trunk` && $(git rev-parse refs/remotes/four/trunk) &&
test `git rev-parse refs/remotes/four/tags/next~2` = \ test $(git rev-parse refs/remotes/four/tags/next~2) = \
`git rev-parse refs/remotes/four/branches/v2/start` && $(git rev-parse refs/remotes/four/branches/v2/start) &&
git log --pretty=oneline refs/remotes/four/tags/next | \ git log --pretty=oneline refs/remotes/four/tags/next | \
sed -e "s/^.\{41\}//" > output.four && sed -e "s/^.\{41\}//" > output.four &&
test_cmp expect.four 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' " test_expect_success 'find commit based on SVN revision number' "
git svn find-rev r12 | git svn find-rev r12 |
grep `git rev-parse HEAD` grep $(git rev-parse HEAD)
" "
test_expect_success 'empty rebase' " 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_debug 'gitk --all & sleep 1'
test_expect_success 'verify pre-merge ancestry' " test_expect_success 'verify pre-merge ancestry' "
test x\`git rev-parse --verify refs/heads/svn^2\` = \ test x\$(git rev-parse --verify refs/heads/svn^2) = \
x\`git rev-parse --verify refs/heads/merge\` && x\$(git rev-parse --verify refs/heads/merge) &&
git cat-file commit refs/heads/svn^ | grep '^friend$' 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_debug 'gitk --all & sleep 1'
test_expect_success 'verify post-merge ancestry' " test_expect_success 'verify post-merge ancestry' "
test x\`git rev-parse --verify refs/heads/svn\` = \ test x\$(git rev-parse --verify refs/heads/svn) = \
x\`git rev-parse --verify refs/remotes/origin/trunk \` && x\$(git rev-parse --verify refs/remotes/origin/trunk) &&
test x\`git rev-parse --verify refs/heads/svn^2\` = \ test x\$(git rev-parse --verify refs/heads/svn^2) = \
x\`git rev-parse --verify refs/heads/merge\` && x\$(git rev-parse --verify refs/heads/merge) &&
git cat-file commit refs/heads/svn^ | grep '^friend$' 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". # 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. # Look at what SVN wound up naming the branch and use that.
# Be sure to escape the @ if it shows up. # 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' ' test_expect_success 'test clone with funky branch names' '
git svn clone -s "$svnrepo/pr ject" project && 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.4.4 (r25188)
# Tested with: svn, version 1.6.[12345689] # 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 case $v in
1.[456].*) 1.[456].*)
;; ;;

View File

@ -7,7 +7,7 @@ test_description='git svn honors i18n.commitEncoding in config'
. ./lib-git-svn.sh . ./lib-git-svn.sh
compare_git_head_with () { compare_git_head_with () {
nr=`wc -l < "$1"` nr=$(wc -l < "$1")
a=7 a=7
b=$(($a + $nr - 1)) b=$(($a + $nr - 1))
git cat-file commit HEAD | sed -ne "$a,${b}p" >current && git cat-file commit HEAD | sed -ne "$a,${b}p" >current &&
@ -29,7 +29,7 @@ fi
compare_svn_head_with () { compare_svn_head_with () {
# extract just the log message and strip out committer info. # extract just the log message and strip out committer info.
# don't use --limit here since svn 1.1.x doesn't have it, # 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; use bytes;
$/ = ("-"x72) . "\n"; $/ = ("-"x72) . "\n";
my @x = <STDIN>; 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' ' test_expect_success 'imported 2 revisions successfully' '
( (
cd x 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 | \ git rev-list -1 --pretty=raw refs/remotes/git-svn | \
grep "^author BBBBBBB BBBBBBB <bb@example\.com> " && grep "^author BBBBBBB BBBBBBB <bb@example\.com> " &&
git rev-list -1 --pretty=raw refs/remotes/git-svn~1 | \ 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 cd x
git svn fetch --authors-file=../svn-authors && 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 | \ git rev-list -1 --pretty=raw refs/remotes/git-svn | \
grep "^author DDDDDDD DDDDDDD <dd@example\.com> " && grep "^author DDDDDDD DDDDDDD <dd@example\.com> " &&
git rev-list -1 --pretty=raw refs/remotes/git-svn~1 | \ 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' ' test_expect_success 'failure happened without negative side effects' '
( (
cd aa-work && cd aa-work &&
test 6 -eq "`tmp_config_get svn-remote.svn.branches-maxRev`" && 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.tags-maxRev)"
) )
' '
@ -86,8 +86,8 @@ test_expect_success 'fetch continues after authors-file is fixed' '
( (
cd aa-work && cd aa-work &&
git svn fetch --authors-file=../svn-authors && 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.branches-maxRev)" &&
test 8 -eq "`tmp_config_get svn-remote.svn.tags-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_expect_success SYMLINKS '"bar" is a symlink that points to "asdf"' '
test -L x/bar && 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' ' 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_expect_success SYMLINKS '"bar" remains a proper symlink' '
test -L x/bar && 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 test_done

View File

@ -16,15 +16,15 @@ test_expect_success 'initialize repo' '
' '
test_expect_success '(supposedly) non-conflicting change from SVN' ' test_expect_success '(supposedly) non-conflicting change from SVN' '
test x"`sed -n -e 58p < file`" = x58 && test x"$(sed -n -e 58p < file)" = x58 &&
test x"`sed -n -e 61p < file`" = x61 && test x"$(sed -n -e 61p < file)" = x61 &&
svn_cmd co "$svnrepo" tmp && svn_cmd co "$svnrepo" tmp &&
(cd tmp && (cd tmp &&
perl -i.bak -p -e "s/^58$/5588/" file && perl -i.bak -p -e "s/^58$/5588/" file &&
perl -i.bak -p -e "s/^61$/6611/" file && perl -i.bak -p -e "s/^61$/6611/" file &&
poke file && poke file &&
test x"`sed -n -e 58p < file`" = x5588 && test x"$(sed -n -e 58p < file)" = x5588 &&
test x"`sed -n -e 61p < file`" = x6611 && test x"$(sed -n -e 61p < file)" = x6611 &&
svn_cmd commit -m "58 => 5588, 61 => 6611" 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_expect_success 'change file but in unrelated area' "
test x\"\`sed -n -e 4p < file\`\" = x4 && test x\"\$(sed -n -e 4p < file)\" = x4 &&
test x\"\`sed -n -e 7p < file\`\" = x7 && test x\"\$(sed -n -e 7p < file)\" = x7 &&
perl -i.bak -p -e 's/^4\$/4444/' file && perl -i.bak -p -e 's/^4\$/4444/' file &&
perl -i.bak -p -e 's/^7\$/7777/' file && perl -i.bak -p -e 's/^7\$/7777/' file &&
test x\"\`sed -n -e 4p < file\`\" = x4444 && test x\"\$(sed -n -e 4p < file)\" = x4444 &&
test x\"\`sed -n -e 7p < file\`\" = x7777 && test x\"\$(sed -n -e 7p < file)\" = x7777 &&
git commit -m '4 => 4444, 7 => 7777' file && git commit -m '4 => 4444, 7 => 7777' file &&
git svn dcommit && git svn dcommit &&
svn_cmd up tmp && svn_cmd up tmp &&
cd tmp && cd tmp &&
test x\"\`sed -n -e 4p < file\`\" = x4444 && test x\"\$(sed -n -e 4p < file)\" = x4444 &&
test x\"\`sed -n -e 7p < file\`\" = x7777 && test x\"\$(sed -n -e 7p < file)\" = x7777 &&
test x\"\`sed -n -e 58p < file\`\" = x5588 && test x\"\$(sed -n -e 58p < file)\" = x5588 &&
test x\"\`sed -n -e 61p < file\`\" = x6611 test x\"\$(sed -n -e 61p < file)\" = x6611
" "
test_expect_success 'attempt to dcommit with a dirty index' ' 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' ' test_expect_success 'imported 6 revisions successfully' '
( (
cd x 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 && git svn clone -s "$svnrepo" g &&
( (
cd g && cd g &&
test x`git rev-parse --verify refs/remotes/origin/trunk^0` = \ test x$(git rev-parse --verify refs/remotes/origin/trunk^0) = \
x`git rev-parse --verify refs/heads/master^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 uuid=b48289b2-9c08-4d72-af37-0358a40b9c15
test_expect_success 'svk merges were represented coming in' " 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 test_done

View File

@ -171,10 +171,10 @@ test_expect_success 'A: verify tag/series-A-blob' '
test_expect_success 'A: verify marks output' ' test_expect_success 'A: verify marks output' '
cat >expect <<-EOF && cat >expect <<-EOF &&
:2 `git rev-parse --verify master:file2` :2 $(git rev-parse --verify master:file2)
:3 `git rev-parse --verify master:file3` :3 $(git rev-parse --verify master:file3)
:4 `git rev-parse --verify master:file4` :4 $(git rev-parse --verify master:file4)
:5 `git rev-parse --verify master^0` :5 $(git rev-parse --verify master^0)
EOF EOF
test_cmp expect marks.out test_cmp expect marks.out
' '
@ -264,8 +264,8 @@ test_expect_success 'A: verify diff' '
EOF EOF
git diff-tree -M -r master verify--import-marks >actual && git diff-tree -M -r master verify--import-marks >actual &&
compare_diff_raw expect actual && compare_diff_raw expect actual &&
test `git rev-parse --verify master:file2` \ test $(git rev-parse --verify master:file2) \
= `git rev-parse --verify verify--import-marks:copy-of-file2` = $(git rev-parse --verify verify--import-marks:copy-of-file2)
' '
test_expect_success 'A: export marks with large values' ' 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 prune" &&
git fast-import <input && git fast-import <input &&
test -f .git/TEMP_TAG && 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' ' 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' ' test_expect_success 'C: incremental import create pack from stdin' '
newf=`echo hi newf | git hash-object -w --stdin` && newf=$(echo hi newf | git hash-object -w --stdin) &&
oldf=`git rev-parse --verify master:file2` && oldf=$(git rev-parse --verify master:file2) &&
test_tick && test_tick &&
cat >input <<-INPUT_END && cat >input <<-INPUT_END &&
commit refs/heads/branch commit refs/heads/branch
@ -499,13 +499,13 @@ test_expect_success 'C: verify pack' '
' '
test_expect_success 'C: validate reuse existing blob' ' test_expect_success 'C: validate reuse existing blob' '
test $newf = `git rev-parse --verify branch:file2/newf` && test $newf = $(git rev-parse --verify branch:file2/newf) &&
test $oldf = `git rev-parse --verify branch:file2/oldf` test $oldf = $(git rev-parse --verify branch:file2/oldf)
' '
test_expect_success 'C: verify commit' ' test_expect_success 'C: verify commit' '
cat >expect <<-EOF && 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 author $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
committer $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' ' 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 && test_tick &&
cat >input <<-INPUT_END && cat >input <<-INPUT_END &&
commit refs/heads/branch commit refs/heads/branch
@ -642,7 +642,7 @@ test_expect_success 'F: non-fast-forward update skips' '
test_must_fail git fast-import <input && test_must_fail git fast-import <input &&
# branch must remain unaffected # 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' ' test_expect_success 'F: verify pack' '
@ -651,8 +651,8 @@ test_expect_success 'F: verify pack' '
test_expect_success 'F: verify other commit' ' test_expect_success 'F: verify other commit' '
cat >expect <<-EOF && cat >expect <<-EOF &&
tree `git rev-parse branch~1^{tree}` tree $(git rev-parse branch~1^{tree})
parent `git rev-parse branch~1` parent $(git rev-parse branch~1)
author $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE author $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
committer $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' ' 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 && test_tick &&
cat >input <<-INPUT_END && cat >input <<-INPUT_END &&
commit refs/heads/branch commit refs/heads/branch
@ -687,8 +687,8 @@ test_expect_success 'G: verify pack' '
' '
test_expect_success 'G: branch changed, but logged' ' 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^0) &&
test $old_branch = `git rev-parse --verify branch@{1}` 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' ' test_expect_success 'I: verify edge list' '
cat >expect <<-EOF && 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 EOF
sed -e s/pack-.*pack/pack-.pack/ edges.list >actual && sed -e s/pack-.*pack/pack-.pack/ edges.list >actual &&
test_cmp expect actual test_cmp expect actual
@ -795,8 +795,8 @@ test_expect_success 'J: reset existing branch creates empty commit' '
git fast-import <input git fast-import <input
' '
test_expect_success 'J: branch has 1 commit, empty tree' ' test_expect_success 'J: branch has 1 commit, empty tree' '
test 1 = `git rev-list J | wc -l` && test 1 = $(git rev-list J | wc -l) &&
test 0 = `git ls-tree J | wc -l` test 0 = $(git ls-tree J | wc -l)
' '
test_expect_success 'J: tag must fail on empty branch' ' 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 git fast-import <input
' '
test_expect_success 'K: verify K^1 = branch^1' ' test_expect_success 'K: verify K^1 = branch^1' '
test `git rev-parse --verify branch^1` \ test $(git rev-parse --verify branch^1) \
= `git rev-parse --verify K^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 && git ls-tree L2 g/b/ >tmp &&
cat tmp | cut -f 2 >actual && cat tmp | cut -f 2 >actual &&
test_cmp expect 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 INPUT_END
git fast-import <input && 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' ' test_expect_success 'N: copy directory by id' '
@ -1503,7 +1503,7 @@ test_expect_success 'O: comments are all skipped' '
INPUT_END INPUT_END
git fast-import <input && 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' ' 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 INPUT_END
git fast-import <input && 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' ' 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 INPUT_END
git fast-import <input && git fast-import <input &&
test 8 = `find .git/objects/pack -type f | wc -l` && test 8 = $(find .git/objects/pack -type f | wc -l) &&
test `git rev-parse refs/tags/O3-2nd` = `git rev-parse O3^` && test $(git rev-parse refs/tags/O3-2nd) = $(git rev-parse O3^) &&
git log --reverse --pretty=oneline O3 | sed s/^.*z// >actual && git log --reverse --pretty=oneline O3 | sed s/^.*z// >actual &&
test_cmp expect actual test_cmp expect actual
' '
@ -1631,7 +1631,7 @@ test_expect_success 'P: superproject & submodule mix' '
data <<DATAEND data <<DATAEND
[submodule "sub"] [submodule "sub"]
path = sub path = sub
url = "`pwd`/sub" url = "$(pwd)/sub"
DATAEND DATAEND
commit refs/heads/subuse1 commit refs/heads/subuse1
@ -1691,7 +1691,7 @@ test_expect_success 'P: verbatim SHA gitlinks' '
data <<DATAEND data <<DATAEND
[submodule "sub"] [submodule "sub"]
path = sub path = sub
url = "`pwd`/sub" url = "$(pwd)/sub"
DATAEND DATAEND
commit refs/heads/subuse2 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' ' test_expect_success 'Q: verify second notes commit' '
cat >expect <<-EOF && 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 author $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
committer $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' ' test_expect_success 'Q: verify fourth notes commit' '
cat >expect <<-EOF && 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 author $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
committer $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 add file &&
git commit -m sub_initial git commit -m sub_initial
) && ) &&
git submodule add "`pwd`/sub" sub && git submodule add "$(pwd)/sub" sub &&
git commit -m initial && git commit -m initial &&
test_tick && 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' ' test_expect_success 'set-up a few more tags for tag export tests' '
git checkout -f master && 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 tree_tag -m "tagging a tree" $HEAD_TREE &&
git tag -a tree_tag-obj -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 && 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' ' test_expect_success 'fast-export quotes pathnames' '
git init crazy-paths && git init crazy-paths &&
(cd 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 \ git update-index --add \
--cacheinfo 100644 $blob "$(printf "path with\\nnewline")" \ --cacheinfo 100644 $blob "$(printf "path with\\nnewline")" \
--cacheinfo 100644 $blob "path with \"quote\"" \ --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 && echo object > tag-object &&
git add tag-object && git add tag-object &&
test_tick && git commit -m "Object to be tagged" && 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" && gitweb_run "p=.git;a=snapshot;h=tagged-object;sf=tgz" &&
grep "400 - Object is not a tree-ish" gitweb.output grep "400 - Object is not a tree-ish" gitweb.output
' '
test_debug 'cat gitweb.output' test_debug 'cat gitweb.output'
test_expect_success 'snapshots: good object id' ' 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" && gitweb_run "p=.git;a=snapshot;h=$ID;sf=tgz" &&
grep "Status: 200 OK" gitweb.output 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_debug 'cat gitweb.headers'
test_expect_success DATE_PARSER 'modification: tree snapshot' ' 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" && HTTP_IF_MODIFIED_SINCE="Wed, 6 Apr 2005 22:14:13 +0000" &&
export HTTP_IF_MODIFIED_SINCE && export HTTP_IF_MODIFIED_SINCE &&
test_when_finished "unset HTTP_IF_MODIFIED_SINCE" && test_when_finished "unset HTTP_IF_MODIFIED_SINCE" &&

View File

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

View File

@ -1,4 +1,4 @@
#!/bin/sh #!/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 exit 128