Junio C Hamano wrote:
Jonathan Nieder [off-list ref] writes:
quoted
+ if test "$3" = -
+ then
+ line_count_tmp=test_line_count.output
+ cat >"$line_count_tmp"
+ set -- "$1" "$2" "$line_count_tmp"
+ fi
+ if ! test $(wc -l <"$3") "$1" "$2"
then
echo "test_line_count: line count for $3 !$1 $2"
cat "$3"
return 1
You forgot to clean the temporary file here.
The idea was to leave it around to help in diagnosis. But you are
right, it is more useful to not break later tests:
rm -f "$line_count_tmp"
return 1
Also if the file is huge, do we really want to cat the whole thing?
I think so. (Maybe not if it is binary, though.)