t5520: use test_line_count where possible

Instead of rolling our own functionality to test the number of lines a
command outputs, use test_line_count() which provides better debugging
information in the case of a failure.

Signed-off-by: Denton Liu <liu.denton@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Denton Liu 2019-11-12 15:08:00 -08:00 committed by Junio C Hamano
parent 93a9bf876b
commit 3037d3db90

View file

@ -699,7 +699,8 @@ test_expect_success 'git pull --rebase does not reapply old patches' '
(
cd dst &&
test_must_fail git pull --rebase &&
test 1 = $(find .git/rebase-apply -name "000*" | wc -l)
find .git/rebase-apply -name "000*" >patches &&
test_line_count = 1 patches
)
'