t0021: compute file size with a single process instead of a pipeline
Avoid unwanted coding patterns (prodigal use of pipelines), and in particular a useless use of cat. Signed-off-by: Johannes Sixt <j6t@kdbg.org> Signed-off-by: Jeff King <peff@peff.net>
Johannes Sixt committed
Nov 6, 2016 at 20:31 UTC
ec2e8b3da21c884325c9764abc62251fcfbe6208
1 file changed
+1
-1
t/t0021-conversion.sh
+1
-1
@@ -22,7 +22,7 @@ generate_random_characters () {
22
}
23
24
file_size () {
25
- cat "$1" | wc -c | sed "s/^[ ]*//"
25
+ perl -e 'print -s $ARGV[0]' "$1"
26
}
27
28
filter_git () {