diff options
author | Johannes Sixt <j6t@kdbg.org> | 2011-12-20 09:24:21 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2011-12-20 11:15:16 -0800 |
commit | 4cd675565647b2ccacdd6c93841b4ff06c32b16a (patch) | |
tree | f1806dbab91bed009a3c84675f108c053b5501c7 /t/t0090-cache-tree.sh | |
parent | 6c52ec8a9ab48b50fc8bf9559467d5a4cf7eee3b (diff) | |
download | git-4cd675565647b2ccacdd6c93841b4ff06c32b16a.tar.gz |
t0090: be prepared that 'wc -l' writes leading blankstr/cache-tree
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>
Diffstat (limited to 't/t0090-cache-tree.sh')
-rwxr-xr-x | t/t0090-cache-tree.sh | 6 |
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 } |