Skip to content

Commit ec2e8b3

Browse files
j6tpeff
authored andcommitted
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 <[email protected]> Signed-off-by: Jeff King <[email protected]>
1 parent 038212c commit ec2e8b3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

t/t0021-conversion.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ generate_random_characters () {
2222
}
2323

2424
file_size () {
25-
cat "$1" | wc -c | sed "s/^[ ]*//"
25+
perl -e 'print -s $ARGV[0]' "$1"
2626
}
2727

2828
filter_git () {

0 commit comments

Comments
 (0)