summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLibravatar Johannes Sixt <j6t@kdbg.org>2011-12-20 09:24:21 +0100
committerLibravatar Junio C Hamano <gitster@pobox.com>2011-12-20 11:15:16 -0800
commit4cd675565647b2ccacdd6c93841b4ff06c32b16a (patch)
treef1806dbab91bed009a3c84675f108c053b5501c7
parentreset: update cache-tree data when appropriate (diff)
downloadtgif-4cd675565647b2ccacdd6c93841b4ff06c32b16a.tar.xz
t0090: be prepared that 'wc -l' writes leading blanks
Use 'printf %d $(whatever|wc -l)' so that the shell removes the blanks for us. Signed-off-by: Johannes Sixt <j6t@kdbg.org> Acked-by: Thomas Rast <trast@student.ethz.ch> Signed-off-by: Junio C Hamano <gitster@pobox.com>
-rwxr-xr-xt/t0090-cache-tree.sh6
1 files changed, 2 insertions, 4 deletions
diff --git a/t/t0090-cache-tree.sh b/t/t0090-cache-tree.sh
index f97256292e..6c33e28ee8 100755
--- a/t/t0090-cache-tree.sh
+++ b/t/t0090-cache-tree.sh
@@ -17,15 +17,13 @@ cmp_cache_tree () {
# test-dump-cache-tree already verifies that all existing data is
# correct.
test_shallow_cache_tree () {
- echo "SHA " \
- "($(git ls-files|wc -l) entries, 0 subtrees)" >expect &&
+ printf "SHA (%d entries, 0 subtrees)\n" $(git ls-files|wc -l) >expect &&
cmp_cache_tree expect
}
test_invalid_cache_tree () {
echo "invalid (0 subtrees)" >expect &&
- echo "SHA #(ref) " \
- "($(git ls-files|wc -l) entries, 0 subtrees)" >>expect &&
+ printf "SHA #(ref) (%d entries, 0 subtrees)\n" $(git ls-files|wc -l) >>expect &&
cmp_cache_tree expect
}