1
0
mirror of https://github.com/git/git.git synced 2024-10-22 12:28:32 +02:00

Merge branch 'ls/filter-process'

Test portability improvements and optimization for an
already-graduated topic.

* ls/filter-process:
  t0021: compute file size with a single process instead of a pipeline
  t0021: expect more variations in the output of uniq -c
This commit is contained in:
Junio C Hamano 2016-11-10 13:17:30 -08:00
commit 81cf0b6c7e

@ -22,7 +22,7 @@ generate_random_characters () {
}
file_size () {
cat "$1" | wc -c | sed "s/^[ ]*//"
perl -e 'print -s $ARGV[0]' "$1"
}
filter_git () {
@ -40,10 +40,9 @@ test_cmp_count () {
actual=$2
for FILE in "$expect" "$actual"
do
sort "$FILE" | uniq -c | sed "s/^[ ]*//" |
sed "s/^\([0-9]\) IN: clean/x IN: clean/" |
sed "s/^\([0-9]\) IN: smudge/x IN: smudge/" >"$FILE.tmp" &&
mv "$FILE.tmp" "$FILE"
sort "$FILE" | uniq -c |
sed -e "s/^ *[0-9][0-9]*[ ]*IN: /x IN: /" >"$FILE.tmp" &&
mv "$FILE.tmp" "$FILE" || return
done &&
test_cmp "$expect" "$actual"
}