Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
tests: modernise style: more uses of test_line_count
author
Stefano Lattarini
<stefano.lattarini@gmail.com>
Wed, 11 Apr 2012 11:24:01 +0000
(13:24 +0200)
committer
Junio C Hamano
<gitster@pobox.com>
Wed, 11 Apr 2012 16:32:20 +0000
(09:32 -0700)
Prefer:
test_line_count <OP> COUNT FILE
over:
test $(wc -l <FILE) <OP> COUNT
(or similar usages) in several tests.
Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
19 files changed:
t/t1410-reflog.sh
patch
|
blob
|
history
t/t2004-checkout-cache-temp.sh
patch
|
blob
|
history
t/t2030-unresolve-info.sh
patch
|
blob
|
history
t/t3415-rebase-autosquash.sh
patch
|
blob
|
history
t/t3900-i18n-commit.sh
patch
|
blob
|
history
t/t4035-diff-quiet.sh
patch
|
blob
|
history
t/t5100-mailinfo.sh
patch
|
blob
|
history
t/t5700-clone-reference.sh
patch
|
blob
|
history
t/t5710-info-alternate.sh
patch
|
blob
|
history
t/t6006-rev-list-format.sh
patch
|
blob
|
history
t/t6030-bisect-porcelain.sh
patch
|
blob
|
history
t/t6032-merge-large-rename.sh
patch
|
blob
|
history
t/t6042-merge-rename-corner-cases.sh
patch
|
blob
|
history
t/t7201-co.sh
patch
|
blob
|
history
t/t7400-submodule-basic.sh
patch
|
blob
|
history
t/t7408-submodule-reference.sh
patch
|
blob
|
history
t/t7502-commit.sh
patch
|
blob
|
history
t/t9350-fast-export.sh
patch
|
blob
|
history
t/t9400-git-cvsserver-server.sh
patch
|
blob
|
history
raw
|
patch
|
inline
| side by side (parent:
e8dde3e
)
diff --git
a/t/t1410-reflog.sh
b/t/t1410-reflog.sh
index 252fc828374583cfb4c2346853bb87560efdf01d..236b13a3ab27f54808fa88574738747e3c3936b1 100755
(executable)
--- a/
t/t1410-reflog.sh
+++ b/
t/t1410-reflog.sh
@@
-100,8
+100,7
@@
test_expect_success setup '
check_fsck &&
check_fsck &&
- loglen=$(wc -l <.git/logs/refs/heads/master) &&
- test $loglen = 4
+ test_line_count = 4 .git/logs/refs/heads/master
'
test_expect_success rewind '
'
test_expect_success rewind '
@@
-117,8
+116,7
@@
test_expect_success rewind '
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 &&
- loglen=$(wc -l <.git/logs/refs/heads/master) &&
- test $loglen = 5
+ test_line_count = 5 .git/logs/refs/heads/master
'
test_expect_success 'corrupt and check' '
'
test_expect_success 'corrupt and check' '
@@
-136,8
+134,7
@@
test_expect_success 'reflog expire --dry-run should not touch reflog' '
--stale-fix \
--all &&
--stale-fix \
--all &&
- loglen=$(wc -l <.git/logs/refs/heads/master) &&
- test $loglen = 5 &&
+ test_line_count = 5 .git/logs/refs/heads/master &&
check_fsck "missing blob $F"
'
check_fsck "missing blob $F"
'
@@
-150,8
+147,7
@@
test_expect_success 'reflog expire' '
--stale-fix \
--all &&
--stale-fix \
--all &&
- loglen=$(wc -l <.git/logs/refs/heads/master) &&
- test $loglen = 2 &&
+ test_line_count = 2 .git/logs/refs/heads/master &&
check_fsck "dangling commit $K"
'
check_fsck "dangling commit $K"
'
@@
-217,9
+213,7
@@
test_expect_success 'delete' '
test_expect_success 'rewind2' '
test_tick && git reset --hard HEAD~2 &&
test_expect_success 'rewind2' '
test_tick && git reset --hard HEAD~2 &&
- loglen=$(wc -l <.git/logs/refs/heads/master) &&
- test $loglen = 4
-
+ test_line_count = 4 .git/logs/refs/heads/master
'
test_expect_success '--expire=never' '
'
test_expect_success '--expire=never' '
@@
-228,9
+222,7
@@
test_expect_success '--expire=never' '
--expire=never \
--expire-unreachable=never \
--all &&
--expire=never \
--expire-unreachable=never \
--all &&
- loglen=$(wc -l <.git/logs/refs/heads/master) &&
- test $loglen = 4
-
+ test_line_count = 4 .git/logs/refs/heads/master
'
test_expect_success 'gc.reflogexpire=never' '
'
test_expect_success 'gc.reflogexpire=never' '
@@
-238,8
+230,7
@@
test_expect_success 'gc.reflogexpire=never' '
git config gc.reflogexpire never &&
git config gc.reflogexpireunreachable never &&
git reflog expire --verbose --all &&
git config gc.reflogexpire never &&
git config gc.reflogexpireunreachable never &&
git reflog expire --verbose --all &&
- loglen=$(wc -l <.git/logs/refs/heads/master) &&
- test $loglen = 4
+ test_line_count = 4 .git/logs/refs/heads/master
'
test_expect_success 'gc.reflogexpire=false' '
'
test_expect_success 'gc.reflogexpire=false' '
@@
-247,8
+238,7
@@
test_expect_success 'gc.reflogexpire=false' '
git config gc.reflogexpire false &&
git config gc.reflogexpireunreachable false &&
git reflog expire --verbose --all &&
git config gc.reflogexpire false &&
git config gc.reflogexpireunreachable false &&
git reflog expire --verbose --all &&
- loglen=$(wc -l <.git/logs/refs/heads/master) &&
- test $loglen = 4 &&
+ test_line_count = 4 .git/logs/refs/heads/master &&
git config --unset gc.reflogexpire &&
git config --unset gc.reflogexpireunreachable
git config --unset gc.reflogexpire &&
git config --unset gc.reflogexpireunreachable
diff --git
a/t/t2004-checkout-cache-temp.sh
b/t/t2004-checkout-cache-temp.sh
index 36cca14d957f85733174d6ce514e22acfff3b1c9..0f4b2896af8b73edcd5bd60631405a430803a40f 100755
(executable)
--- a/
t/t2004-checkout-cache-temp.sh
+++ b/
t/t2004-checkout-cache-temp.sh
@@
-40,7
+40,7
@@
test_expect_success \
rm -f path* .merge_* out .git/index &&
git read-tree $t1 &&
git checkout-index --temp -- path1 >out &&
rm -f path* .merge_* out .git/index &&
git read-tree $t1 &&
git checkout-index --temp -- path1 >out &&
-test
$(wc -l <out) = 1
&&
+test
_line_count = 1 out
&&
test $(cut "-d " -f2 out) = path1 &&
p=$(cut "-d " -f1 out) &&
test -f $p &&
test $(cut "-d " -f2 out) = path1 &&
p=$(cut "-d " -f1 out) &&
test -f $p &&
@@
-51,7
+51,7
@@
test_expect_success \
rm -f path* .merge_* out .git/index &&
git read-tree $t1 &&
git checkout-index -a --temp >out &&
rm -f path* .merge_* out .git/index &&
git read-tree $t1 &&
git checkout-index -a --temp >out &&
-test
$(wc -l <out) = 5
&&
+test
_line_count = 5 out
&&
for f in path0 path1 path3 path4 asubdir/path5
do
test $(grep $f out | cut "-d " -f2) = $f &&
for f in path0 path1 path3 path4 asubdir/path5
do
test $(grep $f out | cut "-d " -f2) = $f &&
@@
-69,7
+69,7
@@
test_expect_success \
'checkout one stage 2 to temporary file' '
rm -f path* .merge_* out &&
git checkout-index --stage=2 --temp -- path1 >out &&
'checkout one stage 2 to temporary file' '
rm -f path* .merge_* out &&
git checkout-index --stage=2 --temp -- path1 >out &&
-test
$(wc -l <out) = 1
&&
+test
_line_count = 1 out
&&
test $(cut "-d " -f2 out) = path1 &&
p=$(cut "-d " -f1 out) &&
test -f $p &&
test $(cut "-d " -f2 out) = path1 &&
p=$(cut "-d " -f1 out) &&
test -f $p &&
@@
-79,7
+79,7
@@
test_expect_success \
'checkout all stage 2 to temporary files' '
rm -f path* .merge_* out &&
git checkout-index --all --stage=2 --temp >out &&
'checkout all stage 2 to temporary files' '
rm -f path* .merge_* out &&
git checkout-index --all --stage=2 --temp >out &&
-test
$(wc -l <out) = 3
&&
+test
_line_count = 3 out
&&
for f in path1 path2 path4
do
test $(grep $f out | cut "-d " -f2) = $f &&
for f in path1 path2 path4
do
test $(grep $f out | cut "-d " -f2) = $f &&
@@
-92,13
+92,13
@@
test_expect_success \
'checkout all stages/one file to nothing' '
rm -f path* .merge_* out &&
git checkout-index --stage=all --temp -- path0 >out &&
'checkout all stages/one file to nothing' '
rm -f path* .merge_* out &&
git checkout-index --stage=all --temp -- path0 >out &&
-test
$(wc -l <out) = 0
'
+test
_line_count = 0 out
'
test_expect_success \
'checkout all stages/one file to temporary files' '
rm -f path* .merge_* out &&
git checkout-index --stage=all --temp -- path1 >out &&
test_expect_success \
'checkout all stages/one file to temporary files' '
rm -f path* .merge_* out &&
git checkout-index --stage=all --temp -- path1 >out &&
-test
$(wc -l <out) = 1
&&
+test
_line_count = 1 out
&&
test $(cut "-d " -f2 out) = path1 &&
cut "-d " -f1 out | (read s1 s2 s3 &&
test -f $s1 &&
test $(cut "-d " -f2 out) = path1 &&
cut "-d " -f1 out | (read s1 s2 s3 &&
test -f $s1 &&
@@
-112,7
+112,7
@@
test_expect_success \
'checkout some stages/one file to temporary files' '
rm -f path* .merge_* out &&
git checkout-index --stage=all --temp -- path2 >out &&
'checkout some stages/one file to temporary files' '
rm -f path* .merge_* out &&
git checkout-index --stage=all --temp -- path2 >out &&
-test
$(wc -l <out) = 1
&&
+test
_line_count = 1 out
&&
test $(cut "-d " -f2 out) = path2 &&
cut "-d " -f1 out | (read s1 s2 s3 &&
test $s1 = . &&
test $(cut "-d " -f2 out) = path2 &&
cut "-d " -f1 out | (read s1 s2 s3 &&
test $s1 = . &&
@@
-125,7
+125,7
@@
test_expect_success \
'checkout all stages/all files to temporary files' '
rm -f path* .merge_* out &&
git checkout-index -a --stage=all --temp >out &&
'checkout all stages/all files to temporary files' '
rm -f path* .merge_* out &&
git checkout-index -a --stage=all --temp >out &&
-test
$(wc -l <out) = 5
'
+test
_line_count = 5 out
'
test_expect_success \
'-- path0: no entry' '
test_expect_success \
'-- path0: no entry' '
@@
-185,7
+185,7
@@
test_expect_success \
'checkout --temp within subdir' '
(cd asubdir &&
git checkout-index -a --stage=all >out &&
'checkout --temp within subdir' '
(cd asubdir &&
git checkout-index -a --stage=all >out &&
- test
$(wc -l <out) = 1
&&
+ test
_line_count = 1 out
&&
test $(grep path5 out | cut "-d " -f2) = path5 &&
grep path5 out | cut "-d " -f1 | (read s1 s2 s3 &&
test -f ../$s1 &&
test $(grep path5 out | cut "-d " -f2) = path5 &&
grep path5 out | cut "-d " -f1 | (read s1 s2 s3 &&
test -f ../$s1 &&
@@
-203,7
+203,7
@@
t4=$(git write-tree) &&
rm -f .git/index &&
git read-tree $t4 &&
git checkout-index --temp -a >out &&
rm -f .git/index &&
git read-tree $t4 &&
git checkout-index --temp -a >out &&
-test
$(wc -l <out) = 1
&&
+test
_line_count = 1 out
&&
test $(cut "-d " -f2 out) = a &&
p=$(cut "-d " -f1 out) &&
test -f $p &&
test $(cut "-d " -f2 out) = a &&
p=$(cut "-d " -f1 out) &&
test -f $p &&
diff --git
a/t/t2030-unresolve-info.sh
b/t/t2030-unresolve-info.sh
index cb7effe0a3e38eeba92b43682de9be68e677099e..f2620650ce1d25252210c07db20e54f99bd515c6 100755
(executable)
--- a/
t/t2030-unresolve-info.sh
+++ b/
t/t2030-unresolve-info.sh
@@
-113,7
+113,7
@@
test_expect_success 'unmerge with plumbing' '
prime_resolve_undo &&
git update-index --unresolve fi/le &&
git ls-files -u >actual &&
prime_resolve_undo &&
git update-index --unresolve fi/le &&
git ls-files -u >actual &&
- test
$(wc -l <actual) = 3
+ test
_line_count = 3 actual
'
test_expect_success 'rerere and rerere forget' '
'
test_expect_success 'rerere and rerere forget' '
diff --git
a/t/t3415-rebase-autosquash.sh
b/t/t3415-rebase-autosquash.sh
index b38be8e93723991d717b6b7fb690560efb58c36d..a1e86c4097ba096245b11a991c39e79886ca2b91 100755
(executable)
--- a/
t/t3415-rebase-autosquash.sh
+++ b/
t/t3415-rebase-autosquash.sh
@@
-33,7
+33,7
@@
test_auto_fixup () {
test_tick &&
git rebase $2 -i HEAD^^^ &&
git log --oneline >actual &&
test_tick &&
git rebase $2 -i HEAD^^^ &&
git log --oneline >actual &&
- test
3 = $(wc -l <actual)
&&
+ test
_line_count = 3 actual
&&
git diff --exit-code $1 &&
test 1 = "$(git cat-file blob HEAD^:file1)" &&
test 1 = $(git cat-file commit HEAD^ | grep first | wc -l)
git diff --exit-code $1 &&
test 1 = "$(git cat-file blob HEAD^:file1)" &&
test 1 = $(git cat-file commit HEAD^ | grep first | wc -l)
@@
-62,7
+62,7
@@
test_auto_squash () {
test_tick &&
git rebase $2 -i HEAD^^^ &&
git log --oneline >actual &&
test_tick &&
git rebase $2 -i HEAD^^^ &&
git log --oneline >actual &&
- test
3 = $(wc -l <actual)
&&
+ test
_line_count = 3 actual
&&
git diff --exit-code $1 &&
test 1 = "$(git cat-file blob HEAD^:file1)" &&
test 2 = $(git cat-file commit HEAD^ | grep first | wc -l)
git diff --exit-code $1 &&
test 1 = "$(git cat-file blob HEAD^:file1)" &&
test 2 = $(git cat-file commit HEAD^ | grep first | wc -l)
@@
-90,7
+90,7
@@
test_expect_success 'misspelled auto squash' '
test_tick &&
git rebase --autosquash -i HEAD^^^ &&
git log --oneline >actual &&
test_tick &&
git rebase --autosquash -i HEAD^^^ &&
git log --oneline >actual &&
- test
4 = $(wc -l <actual)
&&
+ test
_line_count = 4 actual
&&
git diff --exit-code final-missquash &&
test 0 = $(git rev-list final-missquash...HEAD | wc -l)
'
git diff --exit-code final-missquash &&
test 0 = $(git rev-list final-missquash...HEAD | wc -l)
'
@@
-109,7
+109,7
@@
test_expect_success 'auto squash that matches 2 commits' '
test_tick &&
git rebase --autosquash -i HEAD~4 &&
git log --oneline >actual &&
test_tick &&
git rebase --autosquash -i HEAD~4 &&
git log --oneline >actual &&
- test
4 = $(wc -l <actual)
&&
+ test
_line_count = 4 actual
&&
git diff --exit-code final-multisquash &&
test 1 = "$(git cat-file blob HEAD^^:file1)" &&
test 2 = $(git cat-file commit HEAD^^ | grep first | wc -l) &&
git diff --exit-code final-multisquash &&
test 1 = "$(git cat-file blob HEAD^^:file1)" &&
test 2 = $(git cat-file commit HEAD^^ | grep first | wc -l) &&
@@
-130,7
+130,7
@@
test_expect_success 'auto squash that matches a commit after the squash' '
test_tick &&
git rebase --autosquash -i HEAD~4 &&
git log --oneline >actual &&
test_tick &&
git rebase --autosquash -i HEAD~4 &&
git log --oneline >actual &&
- test
5 = $(wc -l <actual)
&&
+ test
_line_count = 5 actual
&&
git diff --exit-code final-presquash &&
test 0 = "$(git cat-file blob HEAD^^:file1)" &&
test 1 = "$(git cat-file blob HEAD^:file1)" &&
git diff --exit-code final-presquash &&
test 0 = "$(git cat-file blob HEAD^^:file1)" &&
test 1 = "$(git cat-file blob HEAD^:file1)" &&
@@
-147,7
+147,7
@@
test_expect_success 'auto squash that matches a sha1' '
test_tick &&
git rebase --autosquash -i HEAD^^^ &&
git log --oneline >actual &&
test_tick &&
git rebase --autosquash -i HEAD^^^ &&
git log --oneline >actual &&
- test
3 = $(wc -l <actual)
&&
+ test
_line_count = 3 actual
&&
git diff --exit-code final-shasquash &&
test 1 = "$(git cat-file blob HEAD^:file1)" &&
test 1 = $(git cat-file commit HEAD^ | grep squash | wc -l)
git diff --exit-code final-shasquash &&
test 1 = "$(git cat-file blob HEAD^:file1)" &&
test 1 = $(git cat-file commit HEAD^ | grep squash | wc -l)
@@
-163,7
+163,7
@@
test_expect_success 'auto squash that matches longer sha1' '
test_tick &&
git rebase --autosquash -i HEAD^^^ &&
git log --oneline >actual &&
test_tick &&
git rebase --autosquash -i HEAD^^^ &&
git log --oneline >actual &&
- test
3 = $(wc -l <actual)
&&
+ test
_line_count = 3 actual
&&
git diff --exit-code final-longshasquash &&
test 1 = "$(git cat-file blob HEAD^:file1)" &&
test 1 = $(git cat-file commit HEAD^ | grep squash | wc -l)
git diff --exit-code final-longshasquash &&
test 1 = "$(git cat-file blob HEAD^:file1)" &&
test 1 = $(git cat-file commit HEAD^ | grep squash | wc -l)
@@
-179,7
+179,7
@@
test_auto_commit_flags () {
test_tick &&
git rebase --autosquash -i HEAD^^^ &&
git log --oneline >actual &&
test_tick &&
git rebase --autosquash -i HEAD^^^ &&
git log --oneline >actual &&
- test
3 = $(wc -l <actual)
&&
+ test
_line_count = 3 actual
&&
git diff --exit-code final-commit-$1 &&
test 1 = "$(git cat-file blob HEAD^:file1)" &&
test $2 = $(git cat-file commit HEAD^ | grep first | wc -l)
git diff --exit-code final-commit-$1 &&
test 1 = "$(git cat-file blob HEAD^:file1)" &&
test $2 = $(git cat-file commit HEAD^ | grep first | wc -l)
diff --git
a/t/t3900-i18n-commit.sh
b/t/t3900-i18n-commit.sh
index d48a7c002d622ffac5087be9a7998f781a242731..37ddabba2d60956a4d8da63585bec5a622e12a5d 100755
(executable)
--- a/
t/t3900-i18n-commit.sh
+++ b/
t/t3900-i18n-commit.sh
@@
-160,7
+160,7
@@
test_commit_autosquash_flags () {
git config --unset-all i18n.commitencoding &&
git rebase --autosquash -i HEAD^^^ &&
git log --oneline >actual &&
git config --unset-all i18n.commitencoding &&
git rebase --autosquash -i HEAD^^^ &&
git log --oneline >actual &&
- test
3 = $(wc -l <actual)
+ test
_line_count = 3 actual
'
}
'
}
diff --git
a/t/t4035-diff-quiet.sh
b/t/t4035-diff-quiet.sh
index e747e842272df5935f863f78ccfc3b311f64228b..cdb9202f57ea75983cf8a25f892bbf868724250d 100755
(executable)
--- a/
t/t4035-diff-quiet.sh
+++ b/
t/t4035-diff-quiet.sh
@@
-15,65
+15,65
@@
test_expect_success 'setup' '
test_expect_success 'git diff-tree HEAD^ HEAD' '
git diff-tree --quiet HEAD^ HEAD >cnt
test_expect_success 'git diff-tree HEAD^ HEAD' '
git diff-tree --quiet HEAD^ HEAD >cnt
- test $? = 1 && test
$(wc -l <cnt) = 0
+ test $? = 1 && test
_line_count = 0 cnt
'
test_expect_success 'git diff-tree HEAD^ HEAD -- a' '
git diff-tree --quiet HEAD^ HEAD -- a >cnt
'
test_expect_success 'git diff-tree HEAD^ HEAD -- a' '
git diff-tree --quiet HEAD^ HEAD -- a >cnt
- test $? = 0 && test
$(wc -l <cnt) = 0
+ test $? = 0 && test
_line_count = 0 cnt
'
test_expect_success 'git diff-tree HEAD^ HEAD -- b' '
git diff-tree --quiet HEAD^ HEAD -- b >cnt
'
test_expect_success 'git diff-tree HEAD^ HEAD -- b' '
git diff-tree --quiet HEAD^ HEAD -- b >cnt
- test $? = 1 && test
$(wc -l <cnt) = 0
+ test $? = 1 && test
_line_count = 0 cnt
'
# this diff outputs one line: sha1 of the given head
test_expect_success 'echo HEAD | git diff-tree --stdin' '
echo $(git rev-parse HEAD) | git diff-tree --quiet --stdin >cnt
'
# this diff outputs one line: sha1 of the given head
test_expect_success 'echo HEAD | git diff-tree --stdin' '
echo $(git rev-parse HEAD) | git diff-tree --quiet --stdin >cnt
- test $? = 1 && test
$(wc -l <cnt) = 1
+ test $? = 1 && test
_line_count = 1 cnt
'
test_expect_success 'git diff-tree HEAD HEAD' '
git diff-tree --quiet HEAD HEAD >cnt
'
test_expect_success 'git diff-tree HEAD HEAD' '
git diff-tree --quiet HEAD HEAD >cnt
- test $? = 0 && test
$(wc -l <cnt) = 0
+ test $? = 0 && test
_line_count = 0 cnt
'
test_expect_success 'git diff-files' '
git diff-files --quiet >cnt
'
test_expect_success 'git diff-files' '
git diff-files --quiet >cnt
- test $? = 0 && test
$(wc -l <cnt) = 0
+ test $? = 0 && test
_line_count = 0 cnt
'
test_expect_success 'git diff-index --cached HEAD' '
git diff-index --quiet --cached HEAD >cnt
'
test_expect_success 'git diff-index --cached HEAD' '
git diff-index --quiet --cached HEAD >cnt
- test $? = 0 && test
$(wc -l <cnt) = 0
+ test $? = 0 && test
_line_count = 0 cnt
'
test_expect_success 'git diff-index --cached HEAD^' '
git diff-index --quiet --cached HEAD^ >cnt
'
test_expect_success 'git diff-index --cached HEAD^' '
git diff-index --quiet --cached HEAD^ >cnt
- test $? = 1 && test
$(wc -l <cnt) = 0
+ test $? = 1 && test
_line_count = 0 cnt
'
test_expect_success 'git diff-index --cached HEAD^' '
echo text >>b &&
echo 3 >c &&
git add . && {
git diff-index --quiet --cached HEAD^ >cnt
'
test_expect_success 'git diff-index --cached HEAD^' '
echo text >>b &&
echo 3 >c &&
git add . && {
git diff-index --quiet --cached HEAD^ >cnt
- test $? = 1 && test
$(wc -l <cnt) = 0
+ test $? = 1 && test
_line_count = 0 cnt
}
'
test_expect_success 'git diff-tree -Stext HEAD^ HEAD -- b' '
git commit -m "text in b" && {
git diff-tree --quiet -Stext HEAD^ HEAD -- b >cnt
}
'
test_expect_success 'git diff-tree -Stext HEAD^ HEAD -- b' '
git commit -m "text in b" && {
git diff-tree --quiet -Stext HEAD^ HEAD -- b >cnt
- test $? = 1 && test
$(wc -l <cnt) = 0
+ test $? = 1 && test
_line_count = 0 cnt
}
'
test_expect_success 'git diff-tree -Snot-found HEAD^ HEAD -- b' '
git diff-tree --quiet -Snot-found HEAD^ HEAD -- b >cnt
}
'
test_expect_success 'git diff-tree -Snot-found HEAD^ HEAD -- b' '
git diff-tree --quiet -Snot-found HEAD^ HEAD -- b >cnt
- test $? = 0 && test
$(wc -l <cnt) = 0
+ test $? = 0 && test
_line_count = 0 cnt
'
test_expect_success 'git diff-files' '
echo 3 >>c && {
git diff-files --quiet >cnt
'
test_expect_success 'git diff-files' '
echo 3 >>c && {
git diff-files --quiet >cnt
- test $? = 1 && test
$(wc -l <cnt) = 0
+ test $? = 1 && test
_line_count = 0 cnt
}
'
test_expect_success 'git diff-index --cached HEAD' '
git update-index c && {
git diff-index --quiet --cached HEAD >cnt
}
'
test_expect_success 'git diff-index --cached HEAD' '
git update-index c && {
git diff-index --quiet --cached HEAD >cnt
- test $? = 1 && test
$(wc -l <cnt) = 0
+ test $? = 1 && test
_line_count = 0 cnt
}
'
}
'
diff --git
a/t/t5100-mailinfo.sh
b/t/t5100-mailinfo.sh
index ebc36c1758372f484055b62080d3ce81ae7c69b4..81904d9ec8d341399b534c5d576262439d0e1ad6 100755
(executable)
--- a/
t/t5100-mailinfo.sh
+++ b/
t/t5100-mailinfo.sh
@@
-65,7
+65,7
@@
test_expect_success 'respect NULs' '
git mailsplit -d3 -o. "$TEST_DIRECTORY"/t5100/nul-plain &&
test_cmp "$TEST_DIRECTORY"/t5100/nul-plain 001 &&
(cat 001 | git mailinfo msg patch) &&
git mailsplit -d3 -o. "$TEST_DIRECTORY"/t5100/nul-plain &&
test_cmp "$TEST_DIRECTORY"/t5100/nul-plain 001 &&
(cat 001 | git mailinfo msg patch) &&
- test
4 = $(wc -l < patch)
+ test
_line_count = 4 patch
'
'
diff --git
a/t/t5700-clone-reference.sh
b/t/t5700-clone-reference.sh
index bbc4691bd7ef1e3633d4a66440211179fae42a84..c47d450cc3731cb471aa8485178f517bb0d6cbf5 100755
(executable)
--- a/
t/t5700-clone-reference.sh
+++ b/
t/t5700-clone-reference.sh
@@
-34,7
+34,7
@@
test_expect_success 'cloning with reference (-l -s)' \
cd "$base_dir"
test_expect_success 'existence of info/alternates' \
cd "$base_dir"
test_expect_success 'existence of info/alternates' \
-'test
`wc -l <C/.git/objects/info/alternates` = 2
'
+'test
_line_count = 2 C/.git/objects/info/alternates
'
cd "$base_dir"
cd "$base_dir"
@@
-63,7
+63,7
@@
test_expect_success 'fetched no objects' \
cd "$base_dir"
test_expect_success 'existence of info/alternates' \
cd "$base_dir"
test_expect_success 'existence of info/alternates' \
-'test
`wc -l <D/.git/objects/info/alternates` = 1
'
+'test
_line_count = 1 D/.git/objects/info/alternates
'
cd "$base_dir"
cd "$base_dir"
diff --git
a/t/t5710-info-alternate.sh
b/t/t5710-info-alternate.sh
index ef7127c1b3943a494692ac8027ec321608a31b9c..aa045295dec5af9dedc25495668d4afd6022d2cd 100755
(executable)
--- a/
t/t5710-info-alternate.sh
+++ b/
t/t5710-info-alternate.sh
@@
-18,7
+18,7
@@
reachable_via() {
test_valid_repo() {
git fsck --full > fsck.log &&
test_valid_repo() {
git fsck --full > fsck.log &&
- test
`wc -l < fsck.log` = 0
+ test
_line_count = 0 fsck.log
}
base_dir=`pwd`
}
base_dir=`pwd`
diff --git
a/t/t6006-rev-list-format.sh
b/t/t6006-rev-list-format.sh
index 444279077e803ca96e48281ae956ea6536317608..a01d2445022ecb82fe0e31739527339fa02e44a5 100755
(executable)
--- a/
t/t6006-rev-list-format.sh
+++ b/
t/t6006-rev-list-format.sh
@@
-188,23
+188,23
@@
test_expect_success 'empty email' '
test_expect_success 'del LF before empty (1)' '
git show -s --pretty=format:"%s%n%-b%nThanks%n" HEAD^^ >actual &&
test_expect_success 'del LF before empty (1)' '
git show -s --pretty=format:"%s%n%-b%nThanks%n" HEAD^^ >actual &&
- test
$(wc -l <actual) = 2
+ test
_line_count = 2 actual
'
test_expect_success 'del LF before empty (2)' '
git show -s --pretty=format:"%s%n%-b%nThanks%n" HEAD >actual &&
'
test_expect_success 'del LF before empty (2)' '
git show -s --pretty=format:"%s%n%-b%nThanks%n" HEAD >actual &&
- test
$(wc -l <actual) = 6
&&
+ test
_line_count = 6 actual
&&
grep "^$" actual
'
test_expect_success 'add LF before non-empty (1)' '
git show -s --pretty=format:"%s%+b%nThanks%n" HEAD^^ >actual &&
grep "^$" actual
'
test_expect_success 'add LF before non-empty (1)' '
git show -s --pretty=format:"%s%+b%nThanks%n" HEAD^^ >actual &&
- test
$(wc -l <actual) = 2
+ test
_line_count = 2 actual
'
test_expect_success 'add LF before non-empty (2)' '
git show -s --pretty=format:"%s%+b%nThanks%n" HEAD >actual &&
'
test_expect_success 'add LF before non-empty (2)' '
git show -s --pretty=format:"%s%+b%nThanks%n" HEAD >actual &&
- test
$(wc -l <actual) = 6
&&
+ test
_line_count = 6 actual
&&
grep "^$" actual
'
grep "^$" actual
'
@@
-278,8
+278,9
@@
test_expect_success 'oneline with empty message' '
git commit -m "dummy" --allow-empty &&
git filter-branch --msg-filter "sed -e s/dummy//" HEAD^^.. &&
git rev-list --oneline HEAD >test.txt &&
git commit -m "dummy" --allow-empty &&
git filter-branch --msg-filter "sed -e s/dummy//" HEAD^^.. &&
git rev-list --oneline HEAD >test.txt &&
- test $(git rev-list --oneline HEAD | wc -l) -eq 5 &&
- test $(git rev-list --oneline --graph HEAD | wc -l) -eq 5
+ test_line_count = 5 test.txt &&
+ git rev-list --oneline --graph HEAD >testg.txt &&
+ test_line_count = 5 testg.txt
'
test_done
'
test_done
diff --git
a/t/t6030-bisect-porcelain.sh
b/t/t6030-bisect-porcelain.sh
index 691e4a4481eba2994ec40e498d4cd25fcff67f26..72e28ee5350926f3c4f27e2c99f8323a3eb8e57c 100755
(executable)
--- a/
t/t6030-bisect-porcelain.sh
+++ b/
t/t6030-bisect-porcelain.sh
@@
-480,7
+480,7
@@
test_expect_success 'many merge bases creation' '
git merge -m "merge HASH7 and SIDE_HASH7" "$HASH7" &&
B_HASH=$(git rev-parse --verify HEAD) &&
git merge-base --all "$A_HASH" "$B_HASH" > merge_bases.txt &&
git merge -m "merge HASH7 and SIDE_HASH7" "$HASH7" &&
B_HASH=$(git rev-parse --verify HEAD) &&
git merge-base --all "$A_HASH" "$B_HASH" > merge_bases.txt &&
- test
$(wc -l < merge_bases.txt) = "2"
&&
+ test
_line_count = 2 merge_bases.txt
&&
grep "$HASH5" merge_bases.txt &&
grep "$SIDE_HASH5" merge_bases.txt
'
grep "$HASH5" merge_bases.txt &&
grep "$SIDE_HASH5" merge_bases.txt
'
diff --git
a/t/t6032-merge-large-rename.sh
b/t/t6032-merge-large-rename.sh
index 94f010be8a17b8aaa8099d1a54ad2bd4317b67dc..15beecc3c6391fea89ffd5f0b6a091f19f9fce19 100755
(executable)
--- a/
t/t6032-merge-large-rename.sh
+++ b/
t/t6032-merge-large-rename.sh
@@
-97,7
+97,7
@@
test_expect_success 'setup large simple rename' '
test_expect_success 'massive simple rename does not spam added files' '
sane_unset GIT_MERGE_VERBOSITY &&
git merge --no-stat simple-rename | grep -v Removing >output &&
test_expect_success 'massive simple rename does not spam added files' '
sane_unset GIT_MERGE_VERBOSITY &&
git merge --no-stat simple-rename | grep -v Removing >output &&
- test
5 -gt "$(wc -l < output)"
+ test
_line_count -lt 5 output
'
test_done
'
test_done
diff --git
a/t/t6042-merge-rename-corner-cases.sh
b/t/t6042-merge-rename-corner-cases.sh
index 32591f94135755847b406389aba5779e73cff5e0..466fa3804bc8a840d994e9d2e9092f599cc87eab 100755
(executable)
--- a/
t/t6042-merge-rename-corner-cases.sh
+++ b/
t/t6042-merge-rename-corner-cases.sh
@@
-104,7
+104,7
@@
test_expect_failure 'conflict caused if rename not detected' '
test 0 -eq $(git ls-files -u | wc -l) &&
test 0 -eq $(git ls-files -o | wc -l) &&
test 0 -eq $(git ls-files -u | wc -l) &&
test 0 -eq $(git ls-files -o | wc -l) &&
- test
6 -eq $(wc -l < c)
&&
+ test
_line_count = 6 c
&&
test $(git rev-parse HEAD:a) = $(git rev-parse B:a) &&
test $(git rev-parse HEAD:b) = $(git rev-parse A:b)
'
test $(git rev-parse HEAD:a) = $(git rev-parse B:a) &&
test $(git rev-parse HEAD:b) = $(git rev-parse A:b)
'
diff --git
a/t/t7201-co.sh
b/t/t7201-co.sh
index 07fb53adcbc06e260b078de546bd07f11093071d..be9672e5a0222f0a796f400b2c22c615fff195a4 100755
(executable)
--- a/
t/t7201-co.sh
+++ b/
t/t7201-co.sh
@@
-229,7
+229,7
@@
test_expect_success 'checkout to detach HEAD (with advice declined)' '
git checkout -f renamer && git clean -f &&
git checkout renamer^ 2>messages &&
test_i18ngrep "HEAD is now at 7329388" messages &&
git checkout -f renamer && git clean -f &&
git checkout renamer^ 2>messages &&
test_i18ngrep "HEAD is now at 7329388" messages &&
- test
1 -eq $(wc -l <messages)
&&
+ test
_line_count = 1 messages
&&
H=$(git rev-parse --verify HEAD) &&
M=$(git show-ref -s --verify refs/heads/master) &&
test "z$H" = "z$M" &&
H=$(git rev-parse --verify HEAD) &&
M=$(git show-ref -s --verify refs/heads/master) &&
test "z$H" = "z$M" &&
@@
-247,7
+247,7
@@
test_expect_success 'checkout to detach HEAD' '
git checkout -f renamer && git clean -f &&
git checkout renamer^ 2>messages &&
test_i18ngrep "HEAD is now at 7329388" messages &&
git checkout -f renamer && git clean -f &&
git checkout renamer^ 2>messages &&
test_i18ngrep "HEAD is now at 7329388" messages &&
- test
1 -lt $(wc -l <messages)
&&
+ test
_line_count -gt 1 messages
&&
H=$(git rev-parse --verify HEAD) &&
M=$(git show-ref -s --verify refs/heads/master) &&
test "z$H" = "z$M" &&
H=$(git rev-parse --verify HEAD) &&
M=$(git show-ref -s --verify refs/heads/master) &&
test "z$H" = "z$M" &&
diff --git
a/t/t7400-submodule-basic.sh
b/t/t7400-submodule-basic.sh
index b377a7af28c9dde11bd4cf6adcf0d7eae31a0754..81827e696f21f598357313d6dad94400d8562718 100755
(executable)
--- a/
t/t7400-submodule-basic.sh
+++ b/
t/t7400-submodule-basic.sh
@@
-234,7
+234,7
@@
EOF
test_expect_success 'status should only print one line' '
git submodule status >lines &&
test_expect_success 'status should only print one line' '
git submodule status >lines &&
- test
$(wc -l <lines) = 1
+ test
_line_count = 1 lines
'
test_expect_success 'setup - fetch commit name from submodule' '
'
test_expect_success 'setup - fetch commit name from submodule' '
diff --git
a/t/t7408-submodule-reference.sh
b/t/t7408-submodule-reference.sh
index ab37c368d071236d0a2851417e85d2a216c7f4fc..a45fadc58e047aa0e6637b9ef5dce86a28ddc4f1 100755
(executable)
--- a/
t/t7408-submodule-reference.sh
+++ b/
t/t7408-submodule-reference.sh
@@
-43,7
+43,7
@@
git commit -m B-super-added'
cd "$base_dir"
test_expect_success 'after add: existence of info/alternates' \
cd "$base_dir"
test_expect_success 'after add: existence of info/alternates' \
-'test
`wc -l <super/.git/modules/sub/objects/info/alternates` = 1
'
+'test
_line_count = 1 super/.git/modules/sub/objects/info/alternates
'
cd "$base_dir"
cd "$base_dir"
@@
-66,7
+66,7
@@
test_expect_success 'update with reference' \
cd "$base_dir"
test_expect_success 'after update: existence of info/alternates' \
cd "$base_dir"
test_expect_success 'after update: existence of info/alternates' \
-'test
`wc -l <super-clone/.git/modules/sub/objects/info/alternates` = 1
'
+'test
_line_count = 1 super-clone/.git/modules/sub/objects/info/alternates
'
cd "$base_dir"
cd "$base_dir"
diff --git
a/t/t7502-commit.sh
b/t/t7502-commit.sh
index 3f3adc31b98773d26715089c25d8d923dd342717..181456aa9a80893e93477302516a7f00594eba85 100755
(executable)
--- a/
t/t7502-commit.sh
+++ b/
t/t7502-commit.sh
@@
-335,7
+335,7
@@
test_expect_success 'A single-liner subject with a token plus colon is not a foo
git reset --hard &&
git commit -s -m "hello: kitty" --allow-empty &&
git cat-file commit HEAD | sed -e "1,/^$/d" >actual &&
git reset --hard &&
git commit -s -m "hello: kitty" --allow-empty &&
git cat-file commit HEAD | sed -e "1,/^$/d" >actual &&
- test
$(wc -l <actual) = 3
+ test
_line_count = 3 actual
'
'
diff --git
a/t/t9350-fast-export.sh
b/t/t9350-fast-export.sh
index 950d0ff498fda58c2d3d68dfb2cf50512f8f81ba..b00196bd238f538f78ce421979e725ce501e84e1 100755
(executable)
--- a/
t/t9350-fast-export.sh
+++ b/
t/t9350-fast-export.sh
@@
-86,7
+86,7
@@
test_expect_success 'import/export-marks' '
git checkout -b marks master &&
git fast-export --export-marks=tmp-marks HEAD &&
test -s tmp-marks &&
git checkout -b marks master &&
git fast-export --export-marks=tmp-marks HEAD &&
test -s tmp-marks &&
- test
$(wc -l < tmp-marks) -eq 3
&&
+ test
_line_count = 3 tmp-marks
&&
test $(
git fast-export --import-marks=tmp-marks\
--export-marks=tmp-marks HEAD |
test $(
git fast-export --import-marks=tmp-marks\
--export-marks=tmp-marks HEAD |
@@
-101,7
+101,7
@@
test_expect_success 'import/export-marks' '
grep ^commit\ |
wc -l) \
-eq 1 &&
grep ^commit\ |
wc -l) \
-eq 1 &&
- test
$(wc -l < tmp-marks) -eq 4
+ test
_line_count = 4 tmp-marks
'
'
diff --git
a/t/t9400-git-cvsserver-server.sh
b/t/t9400-git-cvsserver-server.sh
index 9199550ef4ffa39e4ce8bdb36badfd723e95e55f..d3e88f8dd6d0bf79cef3856a187006777881f1c7 100755
(executable)
--- a/
t/t9400-git-cvsserver-server.sh
+++ b/
t/t9400-git-cvsserver-server.sh
@@
-476,14
+476,14
@@
test_expect_success 'cvs status' '
cd cvswork &&
GIT_CONFIG="$git_config" cvs update &&
GIT_CONFIG="$git_config" cvs status | grep "^File: status.file" >../out &&
cd cvswork &&
GIT_CONFIG="$git_config" cvs update &&
GIT_CONFIG="$git_config" cvs status | grep "^File: status.file" >../out &&
- test
$(wc -l <../out) = 2
+ test
_line_count = 2 ../out
'
cd "$WORKDIR"
test_expect_success 'cvs status (nonrecursive)' '
cd cvswork &&
GIT_CONFIG="$git_config" cvs status -l | grep "^File: status.file" >../out &&
'
cd "$WORKDIR"
test_expect_success 'cvs status (nonrecursive)' '
cd cvswork &&
GIT_CONFIG="$git_config" cvs status -l | grep "^File: status.file" >../out &&
- test
$(wc -l <../out) = 1
+ test
_line_count = 1 ../out
'
cd "$WORKDIR"
'
cd "$WORKDIR"