Skip to content

Commit 4cd6755

Browse files
j6tgitster
authored andcommitted
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 <[email protected]> Acked-by: Thomas Rast <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 6c52ec8 commit 4cd6755

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

t/t0090-cache-tree.sh

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,13 @@ cmp_cache_tree () {
1717
# test-dump-cache-tree already verifies that all existing data is
1818
# correct.
1919
test_shallow_cache_tree () {
20-
echo "SHA " \
21-
"($(git ls-files|wc -l) entries, 0 subtrees)" >expect &&
20+
printf "SHA (%d entries, 0 subtrees)\n" $(git ls-files|wc -l) >expect &&
2221
cmp_cache_tree expect
2322
}
2423

2524
test_invalid_cache_tree () {
2625
echo "invalid (0 subtrees)" >expect &&
27-
echo "SHA #(ref) " \
28-
"($(git ls-files|wc -l) entries, 0 subtrees)" >>expect &&
26+
printf "SHA #(ref) (%d entries, 0 subtrees)\n" $(git ls-files|wc -l) >>expect &&
2927
cmp_cache_tree expect
3028
}
3129

0 commit comments

Comments
 (0)